bpy.ops.object.mode_set(mode='POSE', toggle=False) Is change the mode, but how to find the active mode? is there any function to find that?
This is my python code:
if bpy. == 'POSE': // Here I have to check the MODE
bpy.ops.pose.scale_clear()
bpy.ops.pose.scale_clear()
bpy.ops.pose.loc_clear()
else:
bpy.context.object.rotation_euler = [0,0,0]
bpy.context.object.scale = [1,1,1]
bpy.context.object.location = [0,0,0]
Bcz the bpy.ops.pose.scale_clear() raises Runtime error in OBJECT or EDIT mode, and bpy.context.object.rotation_euler = [0,0,0] this not works in POSE mode.
Thanks
Find Mode of blender
Moderators: jesterKing, stiv
-
- Posts: 0
- Joined: Sat Oct 05, 2013 11:44 am
- Location: INDIA