change coordinates

Hello to all.
I have an object in the scene, which is rotated but has global coordinates. I want to change to local coordinates in a script to rotate with local coordinates.
How can I do? :confused::confused::confused::confused::confused:
Thanks in advance.

Set position for object… ?

Open info window, set parameters (as needed)…


bpy.ops.transform.rotate(value=(0.766413,), axis=(-0, 1, -3.42285e-008), constraint_axis=(False, False, False), constraint_orientation='LOCAL', mirror=False, proportional='DISABLED', proportional_edit_falloff='SMOOTH', proportional_size=1, snap=False, snap_target='CLOSEST', snap_point=(0, 0, 0), snap_align=False, snap_normal=(0, 0, 0), release_confirm=False)

to clarify…
in one of my scripts, after having generated lists for mesh…


            # since base and cap use same logic to generate, rotate and reposition base for use with column...
            bpy.ops.transform.rotate(value=(3.14159,), axis=(1,0,0), constraint_axis=(True,False,False), constraint_orientation='GLOBAL',
                mirror=False, proportional='DISABLED', proportional_edit_falloff='SMOOTH', proportional_size=1, snap=False,
                snap_target='CLOSEST', snap_point=(0,0,0), snap_align=False, snap_normal=(0,0,0), release_confirm=False)

            bpy.ops.transform.translate(value=(0,0,baseH), constraint_axis=(False,False,True), constraint_orientation='GLOBAL',
                mirror=False, proportional='DISABLED', proportional_edit_falloff='SMOOTH', proportional_size=1, snap=False,
                snap_target='CLOSEST', snap_point=(0,0,0), snap_align=False, snap_normal=(0,0,0), texture_space=False, release_confirm=False)

This uses global if you need “LOCAL” try doing manually and see what is needed in script window.

Hello again.
Jambay, my friend, I didn’t understand what you mean or I’m not running well the procedure because the object is rotating with respect to global coordinates.
Excuse the trouble but you could be more explicit.
Thanks in advance. :smiley:

Sounds like you want to change focus/center… not necessarily local. Recommend looking at script window for details when you modify manually in Blender and then apply to logic/script/code to get desired result.

HTH