2009-05-27 00:03:49 +00:00
|
|
|
|
|
|
|
import bpy
|
|
|
|
|
2009-05-28 23:45:50 +00:00
|
|
|
class ConstraintButtonsPanel(bpy.types.Panel):
|
2009-08-22 08:48:01 +00:00
|
|
|
__space_type__ = 'PROPERTIES'
|
|
|
|
__region_type__ = 'WINDOW'
|
2009-06-06 22:14:45 +00:00
|
|
|
__context__ = "constraint"
|
2009-05-27 00:03:49 +00:00
|
|
|
|
2009-05-28 23:45:50 +00:00
|
|
|
def draw_constraint(self, con):
|
2009-05-27 00:03:49 +00:00
|
|
|
layout = self.layout
|
2009-07-30 10:11:19 +00:00
|
|
|
|
2009-05-28 23:45:50 +00:00
|
|
|
box = layout.template_constraint(con)
|
2009-05-27 00:03:49 +00:00
|
|
|
|
2009-05-28 23:45:50 +00:00
|
|
|
if box:
|
2009-08-06 18:31:25 +00:00
|
|
|
# match enum type to our functions, avoids a lookup table.
|
|
|
|
getattr(self, con.type)(box, con)
|
|
|
|
|
2009-05-28 23:45:50 +00:00
|
|
|
# show/key buttons here are most likely obsolete now, with
|
|
|
|
# keyframing functionality being part of every button
|
2009-08-07 01:05:33 +00:00
|
|
|
if con.type not in ('RIGID_BODY_JOINT', 'NULL'):
|
2009-05-28 23:45:50 +00:00
|
|
|
box.itemR(con, "influence")
|
|
|
|
|
|
|
|
def space_template(self, layout, con, target=True, owner=True):
|
|
|
|
if target or owner:
|
|
|
|
row = layout.row()
|
|
|
|
|
|
|
|
row.itemL(text="Convert:")
|
|
|
|
|
|
|
|
if target:
|
|
|
|
row.itemR(con, "target_space", text="")
|
2009-05-27 00:03:49 +00:00
|
|
|
|
2009-05-28 23:45:50 +00:00
|
|
|
if target and owner:
|
2009-08-07 01:05:33 +00:00
|
|
|
row.itemL(icon='ICON_ARROW_LEFTRIGHT')
|
2009-05-28 23:45:50 +00:00
|
|
|
|
|
|
|
if owner:
|
|
|
|
row.itemR(con, "owner_space", text="")
|
|
|
|
|
2009-05-27 07:28:51 +00:00
|
|
|
def target_template(self, layout, con, subtargets=True):
|
|
|
|
layout.itemR(con, "target") # XXX limiting settings for only 'curves' or some type of object
|
|
|
|
|
|
|
|
if con.target and subtargets:
|
2009-08-22 08:48:01 +00:00
|
|
|
if con.target.type == 'ARMATURE':
|
2009-06-27 01:15:31 +00:00
|
|
|
layout.item_pointerR(con, "subtarget", con.target.data, "bones", text="Bone")
|
2009-05-27 07:28:51 +00:00
|
|
|
|
2009-06-27 01:15:31 +00:00
|
|
|
if con.type == 'COPY_LOCATION':
|
|
|
|
row = layout.row()
|
|
|
|
row.itemL(text="Head/Tail:")
|
|
|
|
row.itemR(con, "head_tail", text="")
|
2009-08-07 01:05:33 +00:00
|
|
|
elif con.target.type in ('MESH', 'LATTICE'):
|
2009-06-27 01:15:31 +00:00
|
|
|
layout.item_pointerR(con, "subtarget", con.target, "vertex_groups", text="Vertex Group")
|
2009-05-27 07:28:51 +00:00
|
|
|
|
2009-08-06 18:31:25 +00:00
|
|
|
def CHILD_OF(self, layout, con):
|
2009-05-30 23:31:10 +00:00
|
|
|
self.target_template(layout, con)
|
2009-05-31 11:47:45 +00:00
|
|
|
|
|
|
|
split = layout.split()
|
2009-05-30 23:31:10 +00:00
|
|
|
|
2009-07-30 10:11:19 +00:00
|
|
|
col = split.column()
|
|
|
|
col.itemL(text="Location:")
|
|
|
|
col.itemR(con, "locationx", text="X")
|
|
|
|
col.itemR(con, "locationy", text="Y")
|
|
|
|
col.itemR(con, "locationz", text="Z")
|
2009-05-30 23:31:10 +00:00
|
|
|
|
2009-07-30 10:11:19 +00:00
|
|
|
col = split.column()
|
|
|
|
col.itemL(text="Rotation:")
|
|
|
|
col.itemR(con, "rotationx", text="X")
|
|
|
|
col.itemR(con, "rotationy", text="Y")
|
|
|
|
col.itemR(con, "rotationz", text="Z")
|
2009-05-30 23:31:10 +00:00
|
|
|
|
2009-07-30 10:11:19 +00:00
|
|
|
col = split.column()
|
|
|
|
col.itemL(text="Scale:")
|
|
|
|
col.itemR(con, "sizex", text="X")
|
|
|
|
col.itemR(con, "sizey", text="Y")
|
|
|
|
col.itemR(con, "sizez", text="Z")
|
2009-05-30 23:31:10 +00:00
|
|
|
|
|
|
|
row = layout.row()
|
2009-07-17 12:26:40 +00:00
|
|
|
row.itemO("constraint.childof_set_inverse")
|
|
|
|
row.itemO("constraint.childof_clear_inverse")
|
2009-05-30 23:31:10 +00:00
|
|
|
|
2009-08-06 18:31:25 +00:00
|
|
|
def TRACK_TO(self, layout, con):
|
2009-05-30 23:31:10 +00:00
|
|
|
self.target_template(layout, con)
|
|
|
|
|
|
|
|
row = layout.row()
|
|
|
|
row.itemL(text="To:")
|
|
|
|
row.itemR(con, "track", expand=True)
|
2009-05-31 11:47:45 +00:00
|
|
|
|
|
|
|
row = layout.row()
|
2009-07-11 12:54:17 +00:00
|
|
|
#row.itemR(con, "up", text="Up", expand=True) # XXX: up and expand don't play nice together
|
2009-05-31 11:47:45 +00:00
|
|
|
row.itemR(con, "up", text="Up")
|
|
|
|
row.itemR(con, "target_z")
|
2009-05-30 23:31:10 +00:00
|
|
|
|
|
|
|
self.space_template(layout, con)
|
|
|
|
|
2009-08-06 18:31:25 +00:00
|
|
|
def IK(self, layout, con):
|
2009-06-02 09:40:24 +00:00
|
|
|
self.target_template(layout, con)
|
|
|
|
|
|
|
|
layout.itemR(con, "pole_target")
|
2009-08-10 12:17:12 +00:00
|
|
|
|
2009-08-07 01:05:33 +00:00
|
|
|
if con.pole_target and con.pole_target.type == 'ARMATURE':
|
2009-07-14 22:11:25 +00:00
|
|
|
layout.item_pointerR(con, "pole_subtarget", con.pole_target.data, "bones", text="Bone")
|
2009-06-02 09:40:24 +00:00
|
|
|
|
2009-08-10 12:17:12 +00:00
|
|
|
split = layout.split()
|
|
|
|
|
|
|
|
col = split.column()
|
|
|
|
col.itemR(con, "iterations")
|
|
|
|
col.itemR(con, "chain_length")
|
|
|
|
sub = col.column()
|
|
|
|
sub.active = con.pole_target
|
|
|
|
sub.itemR(con, "pole_angle")
|
|
|
|
col.itemL(text="Weight:")
|
|
|
|
col.itemR(con, "weight", text="Position", slider=True)
|
|
|
|
sub = col.column()
|
|
|
|
sub.active = con.rotation
|
|
|
|
sub.itemR(con, "orient_weight", text="Rotation", slider=True)
|
|
|
|
|
|
|
|
col = split.column()
|
|
|
|
col.itemR(con, "tail")
|
|
|
|
col.itemR(con, "rotation")
|
|
|
|
col.itemR(con, "targetless")
|
|
|
|
col.itemR(con, "stretch")
|
2009-06-02 09:40:24 +00:00
|
|
|
|
2009-08-06 18:31:25 +00:00
|
|
|
def FOLLOW_PATH(self, layout, con):
|
2009-05-30 23:31:10 +00:00
|
|
|
self.target_template(layout, con)
|
|
|
|
|
|
|
|
row = layout.row()
|
2009-06-02 09:40:24 +00:00
|
|
|
row.itemR(con, "curve_follow")
|
2009-05-30 23:31:10 +00:00
|
|
|
row.itemR(con, "offset")
|
|
|
|
|
|
|
|
row = layout.row()
|
|
|
|
row.itemL(text="Forward:")
|
|
|
|
row.itemR(con, "forward", expand=True)
|
2009-05-31 11:47:45 +00:00
|
|
|
|
|
|
|
row = layout.row()
|
|
|
|
row.itemR(con, "up", text="Up")
|
|
|
|
row.itemL()
|
2009-05-30 23:31:10 +00:00
|
|
|
|
2009-08-06 18:31:25 +00:00
|
|
|
def LIMIT_ROTATION(self, layout, con):
|
2009-05-30 23:31:10 +00:00
|
|
|
|
2009-05-31 11:47:45 +00:00
|
|
|
split = layout.split()
|
2009-05-30 23:31:10 +00:00
|
|
|
|
2009-05-31 11:47:45 +00:00
|
|
|
col = split.column()
|
|
|
|
col.itemR(con, "use_limit_x")
|
2009-07-30 10:11:19 +00:00
|
|
|
sub = col.column()
|
|
|
|
sub.active = con.use_limit_x
|
|
|
|
sub.itemR(con, "minimum_x", text="Min")
|
|
|
|
sub.itemR(con, "maximum_x", text="Max")
|
2009-05-31 11:47:45 +00:00
|
|
|
|
|
|
|
col = split.column()
|
|
|
|
col.itemR(con, "use_limit_y")
|
2009-07-30 10:11:19 +00:00
|
|
|
sub = col.column()
|
|
|
|
sub.active = con.use_limit_y
|
|
|
|
sub.itemR(con, "minimum_y", text="Min")
|
|
|
|
sub.itemR(con, "maximum_y", text="Max")
|
2009-05-31 11:47:45 +00:00
|
|
|
|
|
|
|
col = split.column()
|
|
|
|
col.itemR(con, "use_limit_z")
|
2009-07-30 10:11:19 +00:00
|
|
|
sub = col.column()
|
|
|
|
sub.active = con.use_limit_z
|
|
|
|
sub.itemR(con, "minimum_z", text="Min")
|
|
|
|
sub.itemR(con, "maximum_z", text="Max")
|
2009-05-30 23:31:10 +00:00
|
|
|
|
|
|
|
row = layout.row()
|
2009-05-31 11:47:45 +00:00
|
|
|
row.itemR(con, "limit_transform")
|
2009-05-30 23:31:10 +00:00
|
|
|
row.itemL()
|
|
|
|
|
|
|
|
row = layout.row()
|
|
|
|
row.itemL(text="Convert:")
|
|
|
|
row.itemR(con, "owner_space", text="")
|
|
|
|
|
2009-08-06 18:31:25 +00:00
|
|
|
def LIMIT_LOCATION(self, layout, con):
|
2009-05-30 23:31:10 +00:00
|
|
|
split = layout.split()
|
|
|
|
|
|
|
|
col = split.column()
|
2009-05-31 11:47:45 +00:00
|
|
|
col.itemR(con, "use_minimum_x")
|
2009-07-30 10:11:19 +00:00
|
|
|
sub = col.column()
|
|
|
|
sub.active = con.use_minimum_x
|
|
|
|
sub.itemR(con, "minimum_x", text="")
|
2009-05-31 11:47:45 +00:00
|
|
|
col.itemR(con, "use_maximum_x")
|
2009-07-30 10:11:19 +00:00
|
|
|
sub = col.column()
|
|
|
|
sub.active = con.use_maximum_x
|
|
|
|
sub.itemR(con, "maximum_x", text="")
|
2009-05-30 23:31:10 +00:00
|
|
|
|
|
|
|
col = split.column()
|
2009-05-31 11:47:45 +00:00
|
|
|
col.itemR(con, "use_minimum_y")
|
2009-07-30 10:11:19 +00:00
|
|
|
sub = col.column()
|
|
|
|
sub.active = con.use_minimum_y
|
|
|
|
sub.itemR(con, "minimum_y", text="")
|
2009-05-31 11:47:45 +00:00
|
|
|
col.itemR(con, "use_maximum_y")
|
2009-07-30 10:11:19 +00:00
|
|
|
sub = col.column()
|
|
|
|
sub.active = con.use_maximum_y
|
|
|
|
sub.itemR(con, "maximum_y", text="")
|
2009-05-30 23:31:10 +00:00
|
|
|
|
2009-05-31 11:47:45 +00:00
|
|
|
col = split.column()
|
|
|
|
col.itemR(con, "use_minimum_z")
|
2009-07-30 10:11:19 +00:00
|
|
|
sub = col.column()
|
|
|
|
sub.active = con.use_minimum_z
|
|
|
|
sub.itemR(con, "minimum_z", text="")
|
2009-05-31 11:47:45 +00:00
|
|
|
col.itemR(con, "use_maximum_z")
|
2009-07-30 10:11:19 +00:00
|
|
|
sub = col.column()
|
|
|
|
sub.active = con.use_maximum_z
|
|
|
|
sub.itemR(con, "maximum_z", text="")
|
2009-05-31 11:47:45 +00:00
|
|
|
|
2009-05-30 23:31:10 +00:00
|
|
|
row = layout.row()
|
2009-05-31 11:47:45 +00:00
|
|
|
row.itemR(con, "limit_transform")
|
2009-05-30 23:31:10 +00:00
|
|
|
row.itemL()
|
|
|
|
|
|
|
|
row = layout.row()
|
|
|
|
row.itemL(text="Convert:")
|
|
|
|
row.itemR(con, "owner_space", text="")
|
|
|
|
|
2009-08-06 18:31:25 +00:00
|
|
|
def LIMIT_SCALE(self, layout, con):
|
2009-05-30 23:31:10 +00:00
|
|
|
split = layout.split()
|
2009-05-31 11:47:45 +00:00
|
|
|
|
|
|
|
col = split.column()
|
|
|
|
col.itemR(con, "use_minimum_x")
|
2009-07-30 10:11:19 +00:00
|
|
|
sub = col.column()
|
|
|
|
sub.active = con.use_minimum_x
|
|
|
|
sub.itemR(con, "minimum_x", text="")
|
2009-05-31 11:47:45 +00:00
|
|
|
col.itemR(con, "use_maximum_x")
|
2009-07-30 10:11:19 +00:00
|
|
|
sub = col.column()
|
|
|
|
sub.active = con.use_maximum_x
|
|
|
|
sub.itemR(con, "maximum_x", text="")
|
2009-05-30 23:31:10 +00:00
|
|
|
|
|
|
|
col = split.column()
|
2009-05-31 11:47:45 +00:00
|
|
|
col.itemR(con, "use_minimum_y")
|
2009-07-30 10:11:19 +00:00
|
|
|
sub = col.column()
|
|
|
|
sub.active = con.use_minimum_y
|
|
|
|
sub.itemR(con, "minimum_y", text="")
|
2009-05-31 11:47:45 +00:00
|
|
|
col.itemR(con, "use_maximum_y")
|
2009-07-30 10:11:19 +00:00
|
|
|
sub = col.column()
|
|
|
|
sub.active = con.use_maximum_y
|
|
|
|
sub.itemR(con, "maximum_y", text="")
|
2009-05-30 23:31:10 +00:00
|
|
|
|
|
|
|
col = split.column()
|
2009-05-31 11:47:45 +00:00
|
|
|
col.itemR(con, "use_minimum_z")
|
2009-07-30 10:11:19 +00:00
|
|
|
sub = col.column()
|
|
|
|
sub.active = con.use_minimum_z
|
|
|
|
sub.itemR(con, "minimum_z", text="")
|
2009-05-31 11:47:45 +00:00
|
|
|
col.itemR(con, "use_maximum_z")
|
2009-07-30 10:11:19 +00:00
|
|
|
sub = col.column()
|
|
|
|
sub.active = con.use_maximum_z
|
|
|
|
sub.itemR(con, "maximum_z", text="")
|
2009-05-30 23:31:10 +00:00
|
|
|
|
|
|
|
row = layout.row()
|
2009-05-31 11:47:45 +00:00
|
|
|
row.itemR(con, "limit_transform")
|
2009-05-30 23:31:10 +00:00
|
|
|
row.itemL()
|
|
|
|
|
|
|
|
row = layout.row()
|
|
|
|
row.itemL(text="Convert:")
|
|
|
|
row.itemR(con, "owner_space", text="")
|
|
|
|
|
2009-08-06 18:31:25 +00:00
|
|
|
def COPY_ROTATION(self, layout, con):
|
2009-05-30 23:31:10 +00:00
|
|
|
self.target_template(layout, con)
|
|
|
|
|
2009-05-31 11:47:45 +00:00
|
|
|
split = layout.split()
|
|
|
|
|
|
|
|
col = split.column()
|
|
|
|
col.itemR(con, "rotate_like_x", text="X")
|
2009-07-30 10:11:19 +00:00
|
|
|
sub = col.column()
|
|
|
|
sub.active = con.rotate_like_x
|
|
|
|
sub.itemR(con, "invert_x", text="Invert")
|
2009-05-31 11:47:45 +00:00
|
|
|
|
|
|
|
col = split.column()
|
|
|
|
col.itemR(con, "rotate_like_y", text="Y")
|
2009-07-30 10:11:19 +00:00
|
|
|
sub = col.column()
|
|
|
|
sub.active = con.rotate_like_y
|
|
|
|
sub.itemR(con, "invert_y", text="Invert")
|
2009-05-31 11:47:45 +00:00
|
|
|
|
|
|
|
col = split.column()
|
|
|
|
col.itemR(con, "rotate_like_z", text="Z")
|
2009-07-30 10:11:19 +00:00
|
|
|
sub = col.column()
|
|
|
|
sub.active = con.rotate_like_z
|
|
|
|
sub.itemR(con, "invert_z", text="Invert")
|
2009-05-30 23:31:10 +00:00
|
|
|
|
2009-05-31 11:47:45 +00:00
|
|
|
layout.itemR(con, "offset")
|
2009-05-30 23:31:10 +00:00
|
|
|
|
|
|
|
self.space_template(layout, con)
|
|
|
|
|
2009-08-06 18:31:25 +00:00
|
|
|
def COPY_LOCATION(self, layout, con):
|
2009-05-27 07:28:51 +00:00
|
|
|
self.target_template(layout, con)
|
|
|
|
|
2009-05-31 11:47:45 +00:00
|
|
|
split = layout.split()
|
2009-05-30 23:31:10 +00:00
|
|
|
|
2009-05-31 11:47:45 +00:00
|
|
|
col = split.column()
|
|
|
|
col.itemR(con, "locate_like_x", text="X")
|
2009-07-30 10:11:19 +00:00
|
|
|
sub = col.column()
|
|
|
|
sub.active = con.locate_like_x
|
|
|
|
sub.itemR(con, "invert_x", text="Invert")
|
2009-05-31 11:47:45 +00:00
|
|
|
|
|
|
|
col = split.column()
|
|
|
|
col.itemR(con, "locate_like_y", text="Y")
|
2009-07-30 10:11:19 +00:00
|
|
|
sub = col.column()
|
|
|
|
sub.active = con.locate_like_y
|
|
|
|
sub.itemR(con, "invert_y", text="Invert")
|
2009-05-31 11:47:45 +00:00
|
|
|
|
|
|
|
col = split.column()
|
|
|
|
col.itemR(con, "locate_like_z", text="Z")
|
2009-07-30 10:11:19 +00:00
|
|
|
sub = col.column()
|
|
|
|
sub.active = con.locate_like_z
|
|
|
|
sub.itemR(con, "invert_z", text="Invert")
|
2009-05-31 11:47:45 +00:00
|
|
|
|
|
|
|
layout.itemR(con, "offset")
|
|
|
|
|
2009-05-30 23:31:10 +00:00
|
|
|
self.space_template(layout, con)
|
|
|
|
|
2009-08-06 18:31:25 +00:00
|
|
|
def COPY_SCALE(self, layout, con):
|
2009-05-30 23:31:10 +00:00
|
|
|
self.target_template(layout, con)
|
|
|
|
|
|
|
|
row = layout.row(align=True)
|
2009-05-31 11:47:45 +00:00
|
|
|
row.itemR(con, "size_like_x", text="X")
|
|
|
|
row.itemR(con, "size_like_y", text="Y")
|
|
|
|
row.itemR(con, "size_like_z", text="Z")
|
2009-05-27 00:03:49 +00:00
|
|
|
|
2009-05-31 11:47:45 +00:00
|
|
|
layout.itemR(con, "offset")
|
2009-05-30 23:31:10 +00:00
|
|
|
|
2009-05-28 23:45:50 +00:00
|
|
|
self.space_template(layout, con)
|
2009-05-30 23:31:10 +00:00
|
|
|
|
2009-08-06 18:31:25 +00:00
|
|
|
#def SCRIPT(self, layout, con):
|
2009-05-31 11:47:45 +00:00
|
|
|
|
2009-08-06 18:31:25 +00:00
|
|
|
def ACTION(self, layout, con):
|
2009-05-31 11:47:45 +00:00
|
|
|
self.target_template(layout, con)
|
|
|
|
|
|
|
|
layout.itemR(con, "action")
|
|
|
|
layout.itemR(con, "transform_channel")
|
|
|
|
|
|
|
|
split = layout.split()
|
|
|
|
|
|
|
|
col = split.column(align=True)
|
|
|
|
col.itemR(con, "start_frame", text="Start")
|
|
|
|
col.itemR(con, "end_frame", text="End")
|
|
|
|
|
|
|
|
col = split.column(align=True)
|
|
|
|
col.itemR(con, "minimum", text="Min")
|
|
|
|
col.itemR(con, "maximum", text="Max")
|
|
|
|
|
|
|
|
row = layout.row()
|
|
|
|
row.itemL(text="Convert:")
|
|
|
|
row.itemR(con, "owner_space", text="")
|
2009-05-30 23:31:10 +00:00
|
|
|
|
2009-08-06 18:31:25 +00:00
|
|
|
def LOCKED_TRACK(self, layout, con):
|
2009-05-30 23:31:10 +00:00
|
|
|
self.target_template(layout, con)
|
|
|
|
|
|
|
|
row = layout.row()
|
|
|
|
row.itemL(text="To:")
|
|
|
|
row.itemR(con, "track", expand=True)
|
2009-05-31 11:47:45 +00:00
|
|
|
|
|
|
|
row = layout.row()
|
2009-05-30 23:31:10 +00:00
|
|
|
row.itemL(text="Lock:")
|
|
|
|
row.itemR(con, "locked", expand=True)
|
|
|
|
|
2009-08-06 18:31:25 +00:00
|
|
|
def LIMIT_DISTANCE(self, layout, con):
|
2009-05-30 23:31:10 +00:00
|
|
|
self.target_template(layout, con)
|
|
|
|
|
2009-07-26 11:57:27 +00:00
|
|
|
col = layout.column(align=True);
|
|
|
|
col.itemR(con, "distance")
|
|
|
|
col.itemO("constraint.limitdistance_reset")
|
2009-05-30 23:31:10 +00:00
|
|
|
|
|
|
|
row = layout.row()
|
|
|
|
row.itemL(text="Clamp Region:")
|
|
|
|
row.itemR(con, "limit_mode", text="")
|
|
|
|
|
2009-08-06 18:31:25 +00:00
|
|
|
def STRETCH_TO(self, layout, con):
|
2009-05-30 23:31:10 +00:00
|
|
|
self.target_template(layout, con)
|
|
|
|
|
2009-08-12 22:16:47 +00:00
|
|
|
row = layout.row()
|
|
|
|
row.itemR(con, "original_length", text="Rest Length")
|
|
|
|
row.itemO("constraint.stretchto_reset", text="Reset")
|
2009-07-26 11:57:27 +00:00
|
|
|
|
|
|
|
col = layout.column()
|
|
|
|
col.itemR(con, "bulge", text="Volume Variation")
|
2009-05-30 23:31:10 +00:00
|
|
|
|
|
|
|
row = layout.row()
|
|
|
|
row.itemL(text="Volume:")
|
|
|
|
row.itemR(con, "volume", expand=True)
|
|
|
|
row.itemL(text="Plane:")
|
|
|
|
row.itemR(con, "keep_axis", expand=True)
|
|
|
|
|
2009-08-06 18:31:25 +00:00
|
|
|
def FLOOR(self, layout, con):
|
2009-05-30 23:31:10 +00:00
|
|
|
self.target_template(layout, con)
|
|
|
|
|
|
|
|
row = layout.row()
|
2009-05-31 11:47:45 +00:00
|
|
|
row.itemR(con, "sticky")
|
|
|
|
row.itemR(con, "use_rotation")
|
2009-05-30 23:31:10 +00:00
|
|
|
|
|
|
|
layout.itemR(con, "offset")
|
|
|
|
|
|
|
|
row = layout.row()
|
|
|
|
row.itemL(text="Min/Max:")
|
|
|
|
row.itemR(con, "floor_location", expand=True)
|
|
|
|
|
2009-08-06 18:31:25 +00:00
|
|
|
def RIGID_BODY_JOINT(self, layout, con):
|
2009-06-02 09:40:24 +00:00
|
|
|
self.target_template(layout, con)
|
|
|
|
|
|
|
|
layout.itemR(con, "pivot_type")
|
|
|
|
layout.itemR(con, "child")
|
|
|
|
|
|
|
|
row = layout.row()
|
|
|
|
row.itemR(con, "disable_linked_collision", text="No Collision")
|
2009-08-12 22:16:47 +00:00
|
|
|
row.itemR(con, "draw_pivot", text="Display Pivot")
|
2009-06-02 09:40:24 +00:00
|
|
|
|
|
|
|
split = layout.split()
|
|
|
|
|
2009-08-12 22:16:47 +00:00
|
|
|
col = split.column(align=True)
|
|
|
|
col.itemL(text="Pivot:")
|
|
|
|
col.itemR(con, "pivot_x", text="X")
|
|
|
|
col.itemR(con, "pivot_y", text="Y")
|
|
|
|
col.itemR(con, "pivot_z", text="Z")
|
2009-06-02 09:40:24 +00:00
|
|
|
|
2009-08-12 22:16:47 +00:00
|
|
|
col = split.column(align=True)
|
|
|
|
col.itemL(text="Axis:")
|
|
|
|
col.itemR(con, "axis_x", text="X")
|
|
|
|
col.itemR(con, "axis_y", text="Y")
|
|
|
|
col.itemR(con, "axis_z", text="Z")
|
2009-06-02 09:40:24 +00:00
|
|
|
|
|
|
|
#Missing: Limit arrays (not wrapped in RNA yet)
|
2009-05-30 23:31:10 +00:00
|
|
|
|
2009-08-06 18:31:25 +00:00
|
|
|
def CLAMP_TO(self, layout, con):
|
2009-05-30 23:31:10 +00:00
|
|
|
self.target_template(layout, con)
|
|
|
|
|
|
|
|
row = layout.row()
|
|
|
|
row.itemL(text="Main Axis:")
|
|
|
|
row.itemR(con, "main_axis", expand=True)
|
|
|
|
|
|
|
|
row = layout.row()
|
2009-05-31 11:47:45 +00:00
|
|
|
row.itemR(con, "cyclic")
|
2009-05-30 23:31:10 +00:00
|
|
|
|
2009-08-06 18:31:25 +00:00
|
|
|
def TRANSFORM(self, layout, con):
|
2009-05-30 23:31:10 +00:00
|
|
|
self.target_template(layout, con)
|
|
|
|
|
2009-05-31 11:47:45 +00:00
|
|
|
layout.itemR(con, "extrapolate_motion", text="Extrapolate")
|
2009-05-30 23:31:10 +00:00
|
|
|
|
|
|
|
split = layout.split()
|
|
|
|
|
|
|
|
col = split.column()
|
|
|
|
col.itemL(text="Source:")
|
|
|
|
col.row().itemR(con, "map_from", expand=True)
|
|
|
|
|
|
|
|
sub = col.row(align=True)
|
|
|
|
sub.itemL(text="X:")
|
|
|
|
sub.itemR(con, "from_min_x", text="")
|
|
|
|
sub.itemR(con, "from_max_x", text="")
|
|
|
|
|
|
|
|
sub = col.row(align=True)
|
|
|
|
sub.itemL(text="Y:")
|
|
|
|
sub.itemR(con, "from_min_y", text="")
|
|
|
|
sub.itemR(con, "from_max_y", text="")
|
|
|
|
|
|
|
|
sub = col.row(align=True)
|
|
|
|
sub.itemL(text="Z:")
|
|
|
|
sub.itemR(con, "from_min_z", text="")
|
|
|
|
sub.itemR(con, "from_max_z", text="")
|
|
|
|
|
2009-05-31 11:47:45 +00:00
|
|
|
split = layout.split()
|
|
|
|
|
2009-05-30 23:31:10 +00:00
|
|
|
col = split.column()
|
|
|
|
col.itemL(text="Destination:")
|
|
|
|
col.row().itemR(con, "map_to", expand=True)
|
2009-05-28 23:45:50 +00:00
|
|
|
|
2009-05-30 23:31:10 +00:00
|
|
|
sub = col.row(align=True)
|
|
|
|
sub.itemR(con, "map_to_x_from", text="")
|
|
|
|
sub.itemR(con, "to_min_x", text="")
|
|
|
|
sub.itemR(con, "to_max_x", text="")
|
|
|
|
|
|
|
|
sub = col.row(align=True)
|
|
|
|
sub.itemR(con, "map_to_y_from", text="")
|
|
|
|
sub.itemR(con, "to_min_y", text="")
|
|
|
|
sub.itemR(con, "to_max_y", text="")
|
|
|
|
|
|
|
|
sub = col.row(align=True)
|
|
|
|
sub.itemR(con, "map_to_z_from", text="")
|
|
|
|
sub.itemR(con, "to_min_z", text="")
|
|
|
|
sub.itemR(con, "to_max_z", text="")
|
|
|
|
|
|
|
|
self.space_template(layout, con)
|
|
|
|
|
2009-08-06 18:31:25 +00:00
|
|
|
def SHRINKWRAP (self, layout, con):
|
2009-05-30 23:31:10 +00:00
|
|
|
self.target_template(layout, con)
|
|
|
|
|
|
|
|
layout.itemR(con, "distance")
|
|
|
|
layout.itemR(con, "shrinkwrap_type")
|
|
|
|
|
2009-08-22 08:48:01 +00:00
|
|
|
if con.shrinkwrap_type == 'PROJECT':
|
2009-05-30 23:31:10 +00:00
|
|
|
row = layout.row(align=True)
|
2009-05-31 11:47:45 +00:00
|
|
|
row.itemR(con, "axis_x")
|
|
|
|
row.itemR(con, "axis_y")
|
|
|
|
row.itemR(con, "axis_z")
|
2009-05-30 23:31:10 +00:00
|
|
|
|
2009-05-28 23:45:50 +00:00
|
|
|
class OBJECT_PT_constraints(ConstraintButtonsPanel):
|
|
|
|
__label__ = "Constraints"
|
2009-06-06 22:14:45 +00:00
|
|
|
__context__ = "constraint"
|
2009-05-28 23:45:50 +00:00
|
|
|
|
|
|
|
def poll(self, context):
|
2009-07-30 10:11:19 +00:00
|
|
|
return (context.object)
|
2009-05-28 23:45:50 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2009-07-30 10:11:19 +00:00
|
|
|
ob = context.object
|
2009-05-28 23:45:50 +00:00
|
|
|
|
|
|
|
row = layout.row()
|
2009-07-19 13:06:18 +00:00
|
|
|
row.item_menu_enumO("object.constraint_add", "type")
|
2009-05-28 23:45:50 +00:00
|
|
|
row.itemL();
|
|
|
|
|
|
|
|
for con in ob.constraints:
|
|
|
|
self.draw_constraint(con)
|
|
|
|
|
|
|
|
class BONE_PT_constraints(ConstraintButtonsPanel):
|
2009-07-14 20:27:28 +00:00
|
|
|
__label__ = "Constraints"
|
2009-06-27 14:07:17 +00:00
|
|
|
__context__ = "bone"
|
2009-05-28 23:45:50 +00:00
|
|
|
|
|
|
|
def poll(self, context):
|
2009-06-03 00:17:35 +00:00
|
|
|
ob = context.object
|
2009-08-07 01:05:33 +00:00
|
|
|
return (ob and ob.type == 'ARMATURE' and context.bone)
|
2009-05-28 23:45:50 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
2009-07-30 10:11:19 +00:00
|
|
|
layout = self.layout
|
|
|
|
|
2009-06-03 00:17:35 +00:00
|
|
|
ob = context.object
|
2009-06-27 14:07:17 +00:00
|
|
|
pchan = ob.pose.pose_channels[context.bone.name]
|
2009-05-28 23:45:50 +00:00
|
|
|
|
2009-06-27 14:07:17 +00:00
|
|
|
row = layout.row()
|
2009-07-17 12:26:40 +00:00
|
|
|
row.item_menu_enumO("pose.constraint_add", "type")
|
2009-06-27 14:07:17 +00:00
|
|
|
row.itemL();
|
2009-05-28 23:45:50 +00:00
|
|
|
|
|
|
|
for con in pchan.constraints:
|
|
|
|
self.draw_constraint(con)
|
|
|
|
|
|
|
|
bpy.types.register(OBJECT_PT_constraints)
|
2009-06-21 00:17:45 +00:00
|
|
|
bpy.types.register(BONE_PT_constraints)
|