I have a cube.
The cube's Z rotation is 45 degrees.
If I press G X X, I can move the object along its local X axis.
How can I do this with a Python script?
Blender Stack Exchange is a question and answer site for people who use Blender to create 3D graphics, animations, or games. It only takes a minute to sign up.Sign up to join this community
I found the answer here.
import bpy from mathutils import Vector, Matrix ... trans_local = Vector((0.0, 32.0, 0.0)) trans_world = obj.matrix_world.to_3x3() * trans_local obj.matrix_world.translation += trans_world