Property definitions saved in blender rna.
When we define a prop with bpy.props
the methods are akin to python's property
method, extended to save the details in the blend files rna
. (From the geneticists mumbo jumbo)
All the things we define in the definition funcion, in this case FloatVectorProperty
are stored here. The value when set is stored as a custom property in the file.
Even tho we don't need to define Object.color
it's very, very similar to as if we defined
>>> from bpy.props import FloatVectorProperty
>>> bpy.types.Object.xcolor = FloatVectorProperty(
... size=4,
... default=(1, 1, 1, 1),
... )
>>> C.object.bl_rna.properties['xcolor']
<bpy_struct, FloatProperty("xcolor") at 0x7fa4ee68d288>
Which looks just like
>>> C.object.bl_rna.properties["color"]
<bpy_struct, FloatProperty("color") at 0xc110c20>
Instance value
>>> C.object.color
bpy.data.objects['Cube.004'].color
>>> C.object.color[:]
(1.0, 1.0, 1.0, 1.0)
Some defaults.
>>> C.object.bl_rna.properties["color"].default
0.0
>>> C.object.bl_rna.properties["color"].array_length
4
The array's default value
>>> C.object.bl_rna.properties['color'].default_array
<bpy_float[4], FloatProperty.default_array>
>>> C.object.bl_rna.properties['color'].default_array[:]
(1.0, 1.0, 1.0, 1.0)