In this picture I have a cube selected and in the transform panel you can see the cube's data, such as location and rotation. Is there a way to use the data of this selected object, like the x-location, and turn it into a variable?
1 Answer
$\begingroup$
$\endgroup$
I figured it out. If you change the x-location in the transform panel, the code will appear in the info section:
bpy.context.object.location[0] = 1
So to get the data from the active object and turn it into variables, I did this:
xl = bpy.context.object.location[0]
yl = bpy.context.object.location[1]
zl = bpy.context.object.location[2]
bpy.types.Object
. Additionally I suggest you enable the developer extras in the preferences and the python tooltips which will open a tooltip with the property path when you hover over a field $\endgroup$