How to check if a node in Maya is read only using Python

101 Views Asked by At

I was trying to find a Maya command or flag to use to check if a node is read only in Maya using Python. There does not seem to be a direct way to query this, but it must be needed fairly often?

2

There are 2 best solutions below

0
haggi krey On

Maybe the command lockNode() will help.

0
Andy Jazz On

The following command with readOnly (ro) flag lists all DAG nodes that are read-only.

cmds.ls(dag=True, ro=True)

If you want to check a specific node, use this command:

cmds.ls('character_USDZ', ro=True)