6
$\begingroup$

I sometimes find it difficult to recall what type of properties a Blender user or addon has, as well as what choices it brings. ("Set Driver", etc.)

I know there are clear differences between how to add new custom properties, but I'm still not clear on what the meaning is of things such as ID property, RNA property, or custom properties, when a Blender user referernces them (In forum or here).

Property A: We can add new property of obj, armature, or any IDdata,

obj['prop_a'] = 3.0 #(I added 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 a "Custom property".

We can access this property by using a dictonary key. But we cannot access it 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 document, the property is called a "custom property" also.

If it has no RNA_UI, then we cannot edit values such as min, max, etc. It is labelled as "API defined".

So what is the formal (or official) name, when we distinguish these properties for general use? And while hoping to find clear documentation which guides us about these distinctions and details to a greater extent (so that we can make a script)?

And I often see users make offhand reference to custom properties, ID properties, or RNA properties. But which is which? I'd really appreciate if someone could elaborate on this (or tell me a link which can guide me toward getting a better understanding of 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.