7
$\begingroup$

First of all, I'm sorry. My question seems to be somewhat comprehensive.
While setting up the driver and writing related rudimentary scripts, I confirmed that both RNA Path and Property were mentioned in the Data Path pop-up. At first glance, it seems to have a similar meaning. Can you explain the difference between these terms and the concept of constructing the data path in the blender?

enter image description here

enter image description here


*Sorry, I attached an image for drawing annotation, but I will add text for the convenience of copying and pasting the code.

# Copy Data Path
'key_blocks["shapeKeyName"].value'

# Copy Full Data Path
bpy.data.shape_keys["Key.001"].key_blocks["shapeKeyName"].value
$\endgroup$
0

1 Answer 1

5
$\begingroup$

For shapekeys.

[Hunt down link re ID objects and paths]

Basically ID objects get stored in the data of the blend.

path_from_id(property="")
.. method:: path_from_id(property="")
Returns the data path from the ID to this object (string).
:arg property: Optional property name which can be used if the path is
   to a property of this object.
:type property: string
:return: The path from :class:`bpy.types.bpy_struct.id_data`
   to this struct and property (when given).
:rtype: str

For the key 1 shape value on the context objects mesh

>>> C.object.data.shape_keys.key_blocks['Key 1'].path_from_id('value')
'key_blocks["Key 1"].value'

Ok that's different, let's check the

>>> C.object.data.shape_keys.key_blocks['Key 1'].id_data
bpy.data.shape_keys['Key']

or via

>>> C.object.data.shape_keys
bpy.data.shape_keys['Key']

confirms that the shape keys property on the mesh points to the Keys type ID object in the blend data shape keys collection.

Just like the data property of a mesh type object points to a mesh

>>> C.object.data
bpy.data.meshes['Cylinder']  

If you are going to use shape keys as driver variables then set the ID type to Key and select the set named "Key" in this example.

The data path (RNA is blender jargon how it is stored internally) to this ID object value to put in datapath field (from above)

'key_blocks["Key 1"].value' 
$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .