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 |
wish i could read custom props as well
i tried on a BoolProp assigned to scen. But it cant find it
You can access object’s custom properties simply
But you can’t test them via RNA because they are not in it.
I think all of custom properties are not read-only.
You mean they are i think
I tried so many variations, also get/set or update, Keep getting read-only error or it even transformed the boolprop to an integerprop?! super weird.
For that single prop i now made a propertygroup and a pointerproperty
I guess i move everything inside just to make it all more clean