Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save openroomxyz/d5da48f3c7422fb79dae7baab83b66ab to your computer and use it in GitHub Desktop.
Save openroomxyz/d5da48f3c7422fb79dae7baab83b66ab to your computer and use it in GitHub Desktop.
Blender Python : How to set location, rotation, scale of object with name?
import bpy
def set_location(name, xyz):
bpy.data.objects[name].location = xyz
def set_euler_rotation(name, xyz):
bpy.data.objects[name].rotation_euler = xyz
def set_scale(name, xyz):
bpy.data.objects[name].scale = xyz
set_location("PEPE", (0, 0, 5))
set_euler_rotation("PEPE", (3.1415 * 0.5, 3.1415 * 0.5 * 3, 3.1415 * 0.5 * 0.5))
set_scale("PEPE", (1,2,3))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment