Created
April 21, 2020 12:42
-
-
Save openroomxyz/d5da48f3c7422fb79dae7baab83b66ab to your computer and use it in GitHub Desktop.
Blender Python : How to set location, rotation, scale of object with name?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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