Last active
August 29, 2015 14:19
-
-
Save TurBoss/a08962ed9a44ca78ee9f to your computer and use it in GitHub Desktop.
blender addon to change euler coordinate system to match springrts
This file contains 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
bl_info = { | |
"name": "Euler Changer", | |
"category": "Object", | |
} | |
import bpy | |
class ObjectEuler(bpy.types.Operator): | |
"""Changes the Euler coordinate mode""" # blender will use this as a tooltip for menu items and buttons. | |
bl_idname = "object.change_euler" # unique identifier for buttons and menu items to reference. | |
bl_label = "Change Euler to ZXY" # display name in the interface. | |
bl_options = {'REGISTER', 'UNDO'} # enable undo for the operator. | |
def execute(self, context): # execute() is called by blender when running the operator. | |
# The original script | |
scene = context.scene | |
for obj in scene.objects: | |
obj.rotation_mode="ZXY" # Set euler to all stored pieces | |
return {'FINISHED'} # this lets blender know the operator finished successfully. | |
def register(): | |
bpy.utils.register_class(ObjectEuler) | |
bpy.types.VIEW3D_MT_object.append(menu_func) | |
def unregister(): | |
bpy.utils.unregister_class(ObjectEuler) | |
bpy.types.VIEW3D_MT_object.remove(menu_func) | |
def menu_func(self, context): | |
self.layout.operator(ObjectEuler.bl_idname) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment