Advertisement
Guest User

Untitled

a guest
Aug 18th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. import bpy
  2.  
  3. obj = bpy.context.object
  4.  
  5. rot = obj.rotation_euler
  6. print("store object rotation", rot)
  7. #evaluates correct
  8.  
  9. bpy.ops.object.transform_apply(location=False, rotation=True, scale=False)
  10. print("rot after rotation-apply", rot)
  11. #problem: rot has changed to (0, 0, 0)
  12.  
  13. #problem: rotation cant be set back.
  14. obj.rotation_euler = (rot)
  15. print("gameobject_final_rotation: ", obj.rotation_euler)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement