6
$\begingroup$

I sometimes feel difficult to call type of properties which user (or add on) added. and choice of them.(set driver etc)

I know there are clear difference and how to add new properties, but I still not clear understand which is ID property, RNA property, or custom propeties when blender user call them (In forum or here)

PropertyA: we can add new property of obj, armature, or any IDdata,

obj['prop_a'] = 3.0 #(I add prop_a for current active obj)

https://docs.blender.org/api/blender_python_api_current/info_quickstart.html#custom-properties

in this document, it is called as "Custom proeprty"

then we can access this property, by use dictonary key. but can not access, by "obj.prop_a"

Then

PropertyB: use bpy.props then add it for object

bpy.types.Object.prop_b = bpy.props.FloatProperty(name="Test Prob")
bpy.data.objects["Cube"].prop_b = 0.5

https://docs.blender.org/api/blender_python_api_current/bpy.props.html#module-bpy.props

In this documents the property is called as "custom property" too.

it have no RNA_UI then we can not edit min max etc. it is labelled as "API defined"

so what is formal (or official) name, when we distinguish these property for usage? and hope to find clear document which guide about these distinguish and detail more. (to make script)

And I often see user call custom property, ID property, or RNA property which is one? really apreciate if someone answer them.(or tell me a link which guide these things)

$\endgroup$
1
  • $\begingroup$ Re custom properties AFAIK would call any non API defined property custom... eg ob["foo"] or ob.foo. Not ob.location as that is already a member of bpy.types.Object For want of a better name could call ob["foo"] an instance property, since it is (most likely) only defined on one object. Whereas setting up ob.foo makes the property available to all objects of that type. $\endgroup$ – batFINGER May 28 '19 at 7:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.