0
$\begingroup$

I would like to know what variable Blender uses to determine location. Something like position_x = 0 or something? I dunno.

$\endgroup$
1

1 Answer 1

1
$\begingroup$

You can access an object by calling it in the collections (= all things stored in 'bpy.data') For example:

import bpy

cube = bpy.data.objects["Cube"] 

You can search in the console for things you can access from there, like the attributes of the object: i.g. type bpy.data.objects["Cube"]. in the console and press SPACE+. and it will show you all the attributes and methods of this object. One of these is location.

So to get an objects location:

cube_loc = bpy.data.objects["Cube"].location

or to set an objects location:

bpy.data.objects["Cube"].location = (1,1,1)
$\endgroup$

You must log in to answer this question.

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