Find Mode of blender

Compiling, libraries, modules, coding guidelines and porting

Moderators: jesterKing, stiv

Post Reply
rasamohamed
Posts: 8
Joined: Sat Oct 05, 2013 11:44 am
Location: INDIA

Find Mode of blender

Post by rasamohamed » Fri Nov 22, 2013 7:32 am

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
Regards
Rasa [India]
http://projectvismaya.com/

Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests