2009-05-24 12:37:55 +00:00
|
|
|
|
2009-05-19 15:38:36 +00:00
|
|
|
import bpy
|
|
|
|
|
|
|
|
class DataButtonsPanel(bpy.types.Panel):
|
2009-08-22 08:48:01 +00:00
|
|
|
__space_type__ = 'PROPERTIES'
|
|
|
|
__region_type__ = 'WINDOW'
|
2009-05-20 02:17:53 +00:00
|
|
|
__context__ = "data"
|
|
|
|
|
|
|
|
def poll(self, context):
|
2009-07-27 20:39:10 +00:00
|
|
|
return (context.armature)
|
2009-05-20 02:17:53 +00:00
|
|
|
|
2009-07-09 09:42:34 +00:00
|
|
|
class DATA_PT_context_arm(DataButtonsPanel):
|
2009-07-26 03:54:17 +00:00
|
|
|
__show_header__ = False
|
2009-06-13 21:22:21 +00:00
|
|
|
|
2009-05-20 02:17:53 +00:00
|
|
|
def draw(self, context):
|
2009-06-13 21:22:21 +00:00
|
|
|
layout = self.layout
|
|
|
|
|
2009-06-07 13:36:12 +00:00
|
|
|
ob = context.object
|
2009-06-03 00:17:35 +00:00
|
|
|
arm = context.armature
|
2009-06-07 13:36:12 +00:00
|
|
|
space = context.space_data
|
2009-05-20 02:17:53 +00:00
|
|
|
|
2009-06-07 13:36:12 +00:00
|
|
|
split = layout.split(percentage=0.65)
|
|
|
|
|
|
|
|
if ob:
|
2009-06-23 00:19:10 +00:00
|
|
|
split.template_ID(ob, "data")
|
2009-06-07 13:36:12 +00:00
|
|
|
split.itemS()
|
|
|
|
elif arm:
|
2009-06-23 00:19:10 +00:00
|
|
|
split.template_ID(space, "pin_id")
|
2009-06-07 13:36:12 +00:00
|
|
|
split.itemS()
|
|
|
|
|
2009-07-09 09:07:25 +00:00
|
|
|
class DATA_PT_skeleton(DataButtonsPanel):
|
|
|
|
__label__ = "Skeleton"
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
ob = context.object
|
|
|
|
arm = context.armature
|
|
|
|
space = context.space_data
|
2009-09-19 21:40:37 +00:00
|
|
|
|
|
|
|
layout.itemR(arm, "pose_position", expand=True)
|
|
|
|
|
2009-07-27 20:39:10 +00:00
|
|
|
split = layout.split()
|
2009-07-09 09:07:25 +00:00
|
|
|
|
2009-08-29 07:44:21 +00:00
|
|
|
col = split.column()
|
|
|
|
col.itemL(text="Layers:")
|
2009-09-09 17:39:19 +00:00
|
|
|
col.itemR(arm, "layer", text="")
|
2009-08-29 07:44:21 +00:00
|
|
|
col.itemL(text="Protected Layers:")
|
2009-09-09 17:39:19 +00:00
|
|
|
col.itemR(arm, "layer_protection", text="")
|
2009-09-02 12:16:00 +00:00
|
|
|
col.itemL(text="Edit Options:")
|
|
|
|
col.itemR(arm, "x_axis_mirror")
|
|
|
|
col.itemR(arm, "auto_ik")
|
2009-08-29 07:44:21 +00:00
|
|
|
|
2009-07-27 20:39:10 +00:00
|
|
|
col = split.column()
|
|
|
|
col.itemL(text="Deform:")
|
2009-08-16 12:52:57 +00:00
|
|
|
col.itemR(arm, "deform_vertexgroups", text="Vertex Groups")
|
2009-07-27 20:39:10 +00:00
|
|
|
col.itemR(arm, "deform_envelope", text="Envelopes")
|
|
|
|
col.itemR(arm, "deform_quaternion", text="Quaternion")
|
|
|
|
col.itemR(arm, "deform_bbone_rest", text="B-Bones Rest")
|
2009-08-29 07:44:21 +00:00
|
|
|
|
2009-05-19 15:38:36 +00:00
|
|
|
class DATA_PT_display(DataButtonsPanel):
|
2009-05-20 02:17:53 +00:00
|
|
|
__label__ = "Display"
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2009-07-27 20:39:10 +00:00
|
|
|
|
2009-06-13 21:22:21 +00:00
|
|
|
arm = context.armature
|
2009-05-20 02:17:53 +00:00
|
|
|
|
2009-07-14 17:59:26 +00:00
|
|
|
layout.row().itemR(arm, "drawtype", expand=True)
|
2009-05-19 15:38:36 +00:00
|
|
|
|
2009-07-27 20:39:10 +00:00
|
|
|
flow = layout.column_flow()
|
|
|
|
flow.itemR(arm, "draw_names", text="Names")
|
|
|
|
flow.itemR(arm, "draw_axes", text="Axes")
|
|
|
|
flow.itemR(arm, "draw_custom_bone_shapes", text="Shapes")
|
|
|
|
flow.itemR(arm, "draw_group_colors", text="Colors")
|
|
|
|
flow.itemR(arm, "delay_deform", text="Delay Refresh")
|
2009-05-19 15:38:36 +00:00
|
|
|
|
2009-07-21 10:18:08 +00:00
|
|
|
class DATA_PT_bone_groups(DataButtonsPanel):
|
|
|
|
__label__ = "Bone Groups"
|
|
|
|
|
|
|
|
def poll(self, context):
|
|
|
|
return (context.object and context.object.type=='ARMATURE' and context.object.pose)
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2009-07-27 20:39:10 +00:00
|
|
|
|
2009-07-21 10:18:08 +00:00
|
|
|
ob = context.object
|
2009-09-01 00:33:39 +00:00
|
|
|
pose = ob.pose
|
2009-07-21 10:18:08 +00:00
|
|
|
|
|
|
|
row = layout.row()
|
|
|
|
row.template_list(pose, "bone_groups", pose, "active_bone_group_index")
|
|
|
|
|
|
|
|
col = row.column(align=True)
|
2009-07-26 11:57:27 +00:00
|
|
|
col.active = (ob.proxy == None)
|
2009-08-22 08:48:01 +00:00
|
|
|
col.itemO("pose.group_add", icon='ICON_ZOOMIN', text="")
|
|
|
|
col.itemO("pose.group_remove", icon='ICON_ZOOMOUT', text="")
|
2009-07-21 10:18:08 +00:00
|
|
|
|
|
|
|
group = pose.active_bone_group
|
|
|
|
if group:
|
2009-07-21 12:38:01 +00:00
|
|
|
col = layout.column()
|
2009-07-26 11:57:27 +00:00
|
|
|
col.active= (ob.proxy == None)
|
2009-07-21 12:38:01 +00:00
|
|
|
col.itemR(group, "name")
|
|
|
|
|
|
|
|
split = layout.split(0.5)
|
2009-07-26 11:57:27 +00:00
|
|
|
split.active= (ob.proxy == None)
|
2009-07-21 12:38:01 +00:00
|
|
|
split.itemR(group, "color_set")
|
|
|
|
if group.color_set:
|
|
|
|
split.template_triColorSet(group, "colors")
|
2009-07-21 10:18:08 +00:00
|
|
|
|
|
|
|
row = layout.row(align=True)
|
2009-07-27 20:39:10 +00:00
|
|
|
row.active = (ob.proxy == None)
|
2009-07-21 10:18:08 +00:00
|
|
|
|
|
|
|
row.itemO("pose.group_assign", text="Assign")
|
|
|
|
row.itemO("pose.group_remove", text="Remove") #row.itemO("pose.bone_group_remove_from", text="Remove")
|
|
|
|
#row.itemO("object.bone_group_select", text="Select")
|
|
|
|
#row.itemO("object.bone_group_deselect", text="Deselect")
|
|
|
|
|
2009-05-19 15:38:36 +00:00
|
|
|
class DATA_PT_paths(DataButtonsPanel):
|
2009-05-20 02:17:53 +00:00
|
|
|
__label__ = "Paths"
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2009-07-27 20:39:10 +00:00
|
|
|
|
2009-06-13 21:22:21 +00:00
|
|
|
arm = context.armature
|
2009-09-19 13:50:24 +00:00
|
|
|
|
|
|
|
layout.itemR(arm, "paths_type", expand=True)
|
|
|
|
|
2009-05-20 02:17:53 +00:00
|
|
|
split = layout.split()
|
2009-05-19 15:38:36 +00:00
|
|
|
|
2009-07-27 20:39:10 +00:00
|
|
|
col = split.column()
|
|
|
|
|
|
|
|
sub = col.column(align=True)
|
2009-09-19 13:50:24 +00:00
|
|
|
if (arm.paths_type == 'CURRENT_FRAME'):
|
2009-07-27 20:39:10 +00:00
|
|
|
sub.itemR(arm, "path_before_current", text="Before")
|
|
|
|
sub.itemR(arm, "path_after_current", text="After")
|
2009-09-19 13:50:24 +00:00
|
|
|
elif (arm.paths_type == 'RANGE'):
|
2009-07-27 20:39:10 +00:00
|
|
|
sub.itemR(arm, "path_start_frame", text="Start")
|
|
|
|
sub.itemR(arm, "path_end_frame", text="End")
|
2009-05-19 15:38:36 +00:00
|
|
|
|
2009-09-19 13:50:24 +00:00
|
|
|
sub.itemR(arm, "path_size", text="Step")
|
|
|
|
col.row().itemR(arm, "paths_location", expand=True)
|
2009-05-19 15:38:36 +00:00
|
|
|
|
2009-07-27 20:39:10 +00:00
|
|
|
col = split.column()
|
2009-09-19 21:40:37 +00:00
|
|
|
col.itemL(text="Display:")
|
2009-07-27 20:39:10 +00:00
|
|
|
col.itemR(arm, "paths_show_frame_numbers", text="Frame Numbers")
|
|
|
|
col.itemR(arm, "paths_highlight_keyframes", text="Keyframes")
|
|
|
|
col.itemR(arm, "paths_show_keyframe_numbers", text="Keyframe Numbers")
|
2009-09-19 13:50:24 +00:00
|
|
|
|
2009-09-19 21:40:37 +00:00
|
|
|
layout.itemS()
|
|
|
|
|
|
|
|
row = layout.row()
|
|
|
|
row.itemO("pose.paths_calculate", text="Calculate Paths")
|
|
|
|
row.itemO("pose.paths_clear", text="Clear Paths")
|
2009-05-19 15:38:36 +00:00
|
|
|
|
|
|
|
class DATA_PT_ghost(DataButtonsPanel):
|
2009-05-20 02:17:53 +00:00
|
|
|
__label__ = "Ghost"
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2009-07-27 20:39:10 +00:00
|
|
|
|
2009-06-13 21:22:21 +00:00
|
|
|
arm = context.armature
|
2009-09-19 13:50:24 +00:00
|
|
|
|
|
|
|
layout.itemR(arm, "ghost_type", expand=True)
|
|
|
|
|
2009-05-20 02:17:53 +00:00
|
|
|
split = layout.split()
|
|
|
|
|
2009-07-27 20:39:10 +00:00
|
|
|
col = split.column()
|
2009-07-14 17:59:26 +00:00
|
|
|
|
2009-07-27 20:39:10 +00:00
|
|
|
sub = col.column(align=True)
|
2009-05-19 15:38:36 +00:00
|
|
|
if arm.ghost_type == 'RANGE':
|
2009-07-27 20:39:10 +00:00
|
|
|
sub.itemR(arm, "ghost_start_frame", text="Start")
|
|
|
|
sub.itemR(arm, "ghost_end_frame", text="End")
|
|
|
|
sub.itemR(arm, "ghost_size", text="Step")
|
2009-05-19 15:38:36 +00:00
|
|
|
elif arm.ghost_type == 'CURRENT_FRAME':
|
2009-07-27 20:39:10 +00:00
|
|
|
sub.itemR(arm, "ghost_step", text="Range")
|
|
|
|
sub.itemR(arm, "ghost_size", text="Step")
|
2009-05-19 15:38:36 +00:00
|
|
|
|
2009-07-27 20:39:10 +00:00
|
|
|
col = split.column()
|
2009-09-19 21:40:37 +00:00
|
|
|
col.itemL(text="Display:")
|
2009-07-27 20:39:10 +00:00
|
|
|
col.itemR(arm, "ghost_only_selected", text="Selected Only")
|
2009-05-19 15:38:36 +00:00
|
|
|
|
2009-07-09 09:42:34 +00:00
|
|
|
bpy.types.register(DATA_PT_context_arm)
|
2009-05-19 15:38:36 +00:00
|
|
|
bpy.types.register(DATA_PT_skeleton)
|
|
|
|
bpy.types.register(DATA_PT_display)
|
2009-07-21 10:18:08 +00:00
|
|
|
bpy.types.register(DATA_PT_bone_groups)
|
2009-05-19 15:38:36 +00:00
|
|
|
bpy.types.register(DATA_PT_paths)
|
2009-06-18 14:20:25 +00:00
|
|
|
bpy.types.register(DATA_PT_ghost)
|