what is the most accurate way to get the full path for a value so I can use it in a single property drivers.
1 Answer
I prefer to use the outliner to find the data paths of variables. If you set the outliner type to 'Datablocks' you can see the whole RNA structure of the current Blender file. If you hover with your mouse over a property Blender will show you how you can access it using the python API:
-
$\begingroup$ If I want to get the path for the x location for an object,I go to the data block and then objects and then my object and then location and then the x location but I couldn't get it right he give me "location only with out the x axis.how can I get that. $\endgroup$ Feb 21, 2015 at 17:58
-
1$\begingroup$ The location you get is a Python object of type Vector. You can access its x-value by adding
.x
to the data path. For the default cube this would bebpy.data.objects["Cube"].location.x
. Alternatively you can access the vector components by index....location[0]
also gives you the x value. The index of the y value is 1 and the index of the z value is 2 respectively. $\endgroup$– maddin45Feb 21, 2015 at 18:13