How to check if Blender object property/attribute is read-only
To check is an attribute/property of any Blender object (mesh, node, modifier, etc.) read-only:
- With the is_property_readonly function, execute the following command:
<object> .is_property_readonly (‘<property name>’)
- Through the rna structure, execute the following command:
<object> .bl_rna.properties [‘<property name>’]. is_readonly
For example, for the “is_editmode” mesh property (is the mesh in edit mode or not):
1 2 3 4 5 6 7 8 |
bpy.context.active_object.data.is_property_readonly('is_editmode') # True bpy.context.active_object.data.bl_rna.properties['is_editmode'].is_readonly # True |