6

what is the most accurate way to get the full path for a value so I can use it in a single property drivers.

David
  • 49,291
  • 38
  • 159
  • 317
Omar Emara
  • 22,639
  • 5
  • 55
  • 103

1 Answers1

6

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:

enter image description here

maddin45
  • 4,804
  • 16
  • 21
  • 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. – Omar Emara Feb 21 '15 at 17:58
  • 1
    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 be bpy.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. – maddin45 Feb 21 '15 at 18:13