This is the code I wrote for rotating the .fbx model I imported from Rhino.
bl_info = {
"name": "Reture Z axls",
"category": "Object",
}
import bpy
class ObjectRotateX(bpy.types.Operator):
"""My Object Rotate Script"""
bl_idname = "object.rotate_x"
bl_label = "Rotate X by 90"
bl_options = {'REGISTER', 'UNDO'}
def execute(self, context):
scene = context.scene
for obj in scene.objects:
obj.rotation_euler = (0,0,0)
return {'FINISHED'}
def register():
bpy.utils.register_class(ObjectRotateX)
def unregister():
bpy.utils.unregister_class(ObjectRotateX)
if __name__ == "__main__":
register()
The problem is that it will rotate everything in the scene including the camera. I wonder if there is better way to do this? Also is there anyway I can rotate each object seperately?
Thank you!