2009-11-01 15:21:20 +00:00
|
|
|
# ##### BEGIN GPL LICENSE BLOCK #####
|
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or
|
|
|
|
# modify it under the terms of the GNU General Public License
|
|
|
|
# as published by the Free Software Foundation; either version 2
|
|
|
|
# of the License, or (at your option) any later version.
|
2009-11-03 07:23:02 +00:00
|
|
|
#
|
2009-11-01 15:21:20 +00:00
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
2009-11-03 07:23:02 +00:00
|
|
|
#
|
2009-11-01 15:21:20 +00:00
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program; if not, write to the Free Software Foundation,
|
2010-02-12 13:34:04 +00:00
|
|
|
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2009-11-01 15:21:20 +00:00
|
|
|
#
|
|
|
|
# ##### END GPL LICENSE BLOCK #####
|
2009-10-31 20:16:59 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
# <pep8 compliant>
|
2011-03-21 12:35:49 +00:00
|
|
|
|
2009-05-19 15:38:36 +00:00
|
|
|
import bpy
|
2011-08-12 06:57:00 +00:00
|
|
|
from bpy.types import Panel
|
2010-01-08 08:54:41 +00:00
|
|
|
from rna_prop_ui import PropertyPanel
|
2009-11-14 13:35:44 +00:00
|
|
|
|
2011-09-20 18:29:19 +00:00
|
|
|
|
2010-08-02 02:55:12 +00:00
|
|
|
class BoneButtonsPanel():
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_space_type = 'PROPERTIES'
|
|
|
|
bl_region_type = 'WINDOW'
|
|
|
|
bl_context = "bone"
|
|
|
|
|
2010-08-09 01:37:09 +00:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
2009-10-31 19:31:45 +00:00
|
|
|
return (context.bone or context.edit_bone)
|
2009-05-20 02:17:53 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class BONE_PT_context_bone(BoneButtonsPanel, Panel):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_label = ""
|
2010-08-26 01:05:37 +00:00
|
|
|
bl_options = {'HIDE_HEADER'}
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
bone = context.bone
|
|
|
|
if not bone:
|
|
|
|
bone = context.edit_bone
|
|
|
|
|
|
|
|
row = layout.row()
|
2009-12-10 10:23:53 +00:00
|
|
|
row.label(text="", icon='BONE_DATA')
|
2009-11-23 00:27:30 +00:00
|
|
|
row.prop(bone, "name", text="")
|
2009-07-09 09:07:25 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class BONE_PT_transform(BoneButtonsPanel, Panel):
|
2011-09-15 13:20:18 +00:00
|
|
|
bl_label = "Transform"
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2010-12-17 17:51:43 +00:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
if context.edit_bone:
|
|
|
|
return True
|
2011-01-01 07:20:34 +00:00
|
|
|
|
2010-12-17 17:51:43 +00:00
|
|
|
ob = context.object
|
|
|
|
return ob and ob.mode == 'POSE' and context.bone
|
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
ob = context.object
|
|
|
|
bone = context.bone
|
2009-11-14 13:35:44 +00:00
|
|
|
|
2010-12-17 17:51:43 +00:00
|
|
|
if bone and ob:
|
2010-12-04 06:21:08 +00:00
|
|
|
pchan = ob.pose.bones[bone.name]
|
2009-11-14 13:35:44 +00:00
|
|
|
|
2010-08-06 15:17:44 +00:00
|
|
|
row = layout.row()
|
|
|
|
col = row.column()
|
|
|
|
col.prop(pchan, "location")
|
2010-08-18 07:45:32 +00:00
|
|
|
col.active = not (bone.parent and bone.use_connect)
|
2010-08-06 15:17:44 +00:00
|
|
|
|
|
|
|
col = row.column()
|
|
|
|
if pchan.rotation_mode == 'QUATERNION':
|
2011-09-21 15:18:38 +00:00
|
|
|
col.prop(pchan, "rotation_quaternion", text="Rotation")
|
2010-08-06 15:17:44 +00:00
|
|
|
elif pchan.rotation_mode == 'AXIS_ANGLE':
|
2011-09-21 15:18:38 +00:00
|
|
|
#col.label(text="Rotation")
|
|
|
|
#col.prop(pchan, "rotation_angle", text="Angle")
|
|
|
|
#col.prop(pchan, "rotation_axis", text="Axis")
|
|
|
|
col.prop(pchan, "rotation_axis_angle", text="Rotation")
|
2009-10-31 19:31:45 +00:00
|
|
|
else:
|
2011-09-21 15:18:38 +00:00
|
|
|
col.prop(pchan, "rotation_euler", text="Rotation")
|
2010-08-06 15:17:44 +00:00
|
|
|
|
|
|
|
row.column().prop(pchan, "scale")
|
|
|
|
|
|
|
|
layout.prop(pchan, "rotation_mode")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2010-12-17 17:51:43 +00:00
|
|
|
elif context.edit_bone:
|
2010-12-04 06:21:08 +00:00
|
|
|
bone = context.edit_bone
|
|
|
|
row = layout.row()
|
|
|
|
row.column().prop(bone, "head")
|
|
|
|
row.column().prop(bone, "tail")
|
|
|
|
|
|
|
|
col = row.column()
|
|
|
|
sub = col.column(align=True)
|
2011-09-21 15:18:38 +00:00
|
|
|
sub.label(text="Roll:")
|
2010-12-04 06:21:08 +00:00
|
|
|
sub.prop(bone, "roll", text="")
|
|
|
|
sub.label()
|
|
|
|
sub.prop(bone, "lock")
|
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class BONE_PT_transform_locks(BoneButtonsPanel, Panel):
|
2011-09-15 13:20:18 +00:00
|
|
|
bl_label = "Transform Locks"
|
2010-08-26 01:05:37 +00:00
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2010-08-09 01:37:09 +00:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
2010-12-17 17:51:43 +00:00
|
|
|
ob = context.object
|
|
|
|
return ob and ob.mode == 'POSE' and context.bone
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
ob = context.object
|
|
|
|
bone = context.bone
|
2010-12-04 06:21:08 +00:00
|
|
|
pchan = ob.pose.bones[bone.name]
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2012-06-06 18:11:12 +00:00
|
|
|
split = layout.split(percentage=0.1)
|
2012-06-19 22:17:19 +00:00
|
|
|
|
2012-06-06 18:11:12 +00:00
|
|
|
col = split.column(align=True)
|
|
|
|
col.label(text="")
|
|
|
|
col.label(text="X:")
|
|
|
|
col.label(text="Y:")
|
|
|
|
col.label(text="Z:")
|
2012-06-19 22:17:19 +00:00
|
|
|
|
2013-08-23 20:41:21 +00:00
|
|
|
col = split.column()
|
|
|
|
col.active = not (bone.parent and bone.use_connect)
|
|
|
|
col.prop(pchan, "lock_location", text="Location")
|
|
|
|
|
|
|
|
col = split.column()
|
|
|
|
col.prop(pchan, "lock_rotation", text="Rotation")
|
|
|
|
|
|
|
|
col = split.column()
|
|
|
|
col.prop(pchan, "lock_scale", text="Scale")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2011-03-07 13:23:45 +00:00
|
|
|
if pchan.rotation_mode in {'QUATERNION', 'AXIS_ANGLE'}:
|
2012-06-06 18:11:12 +00:00
|
|
|
row = layout.row()
|
|
|
|
row.prop(pchan, "lock_rotations_4d", text="Lock Rotation")
|
2012-06-19 22:17:19 +00:00
|
|
|
|
2012-06-06 18:11:12 +00:00
|
|
|
sub = row.row()
|
|
|
|
sub.active = pchan.lock_rotations_4d
|
|
|
|
sub.prop(pchan, "lock_rotation_w", text="W")
|
2009-07-14 12:32:19 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class BONE_PT_relations(BoneButtonsPanel, Panel):
|
2011-09-15 13:20:18 +00:00
|
|
|
bl_label = "Relations"
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
ob = context.object
|
|
|
|
bone = context.bone
|
|
|
|
arm = context.armature
|
2010-12-17 17:51:43 +00:00
|
|
|
pchan = None
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2010-12-17 10:33:28 +00:00
|
|
|
if ob and bone:
|
2010-12-04 06:21:08 +00:00
|
|
|
pchan = ob.pose.bones[bone.name]
|
2010-12-17 17:51:43 +00:00
|
|
|
elif bone is None:
|
2009-10-31 19:31:45 +00:00
|
|
|
bone = context.edit_bone
|
|
|
|
|
|
|
|
split = layout.split()
|
|
|
|
|
|
|
|
col = split.column()
|
2011-09-21 15:18:38 +00:00
|
|
|
col.label(text="Layers:")
|
2010-08-18 07:45:32 +00:00
|
|
|
col.prop(bone, "layers", text="")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
col.separator()
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
if ob and pchan:
|
2011-09-21 15:18:38 +00:00
|
|
|
col.label(text="Bone Group:")
|
2010-08-23 05:47:45 +00:00
|
|
|
col.prop_search(pchan, "bone_group", ob.pose, "bone_groups", text="")
|
2012-12-21 12:07:28 +00:00
|
|
|
col.label(text="Object Children:")
|
2012-12-21 12:17:30 +00:00
|
|
|
col.prop(bone, "use_relative_parent")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2010-08-06 15:17:44 +00:00
|
|
|
col = split.column()
|
2011-09-21 15:18:38 +00:00
|
|
|
col.label(text="Parent:")
|
2009-10-31 19:31:45 +00:00
|
|
|
if context.bone:
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(bone, "parent", text="")
|
2009-10-31 19:31:45 +00:00
|
|
|
else:
|
2010-08-23 05:47:45 +00:00
|
|
|
col.prop_search(bone, "parent", arm, "edit_bones", text="")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
sub = col.column()
|
2009-11-22 17:41:35 +00:00
|
|
|
sub.active = (bone.parent is not None)
|
2010-08-18 07:45:32 +00:00
|
|
|
sub.prop(bone, "use_connect")
|
2012-12-21 12:07:28 +00:00
|
|
|
sub.prop(bone, "use_inherit_rotation")
|
|
|
|
sub.prop(bone, "use_inherit_scale")
|
2009-11-25 18:48:29 +00:00
|
|
|
sub = col.column()
|
2010-08-18 07:45:32 +00:00
|
|
|
sub.active = (not bone.parent or not bone.use_connect)
|
2012-12-21 12:07:28 +00:00
|
|
|
sub.prop(bone, "use_local_location")
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2009-11-28 23:37:56 +00:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class BONE_PT_display(BoneButtonsPanel, Panel):
|
2011-09-15 13:20:18 +00:00
|
|
|
bl_label = "Display"
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2010-08-09 01:37:09 +00:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
2009-10-31 19:31:45 +00:00
|
|
|
return context.bone
|
|
|
|
|
|
|
|
def draw(self, context):
|
2011-10-17 06:58:07 +00:00
|
|
|
# note. this works ok in edit-mode but isn't
|
2010-12-04 06:21:08 +00:00
|
|
|
# all that useful so disabling for now.
|
2009-10-31 19:31:45 +00:00
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
ob = context.object
|
|
|
|
bone = context.bone
|
2010-12-17 17:51:43 +00:00
|
|
|
pchan = None
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2010-12-17 10:33:28 +00:00
|
|
|
if ob and bone:
|
2010-12-04 06:21:08 +00:00
|
|
|
pchan = ob.pose.bones[bone.name]
|
2010-12-17 17:51:43 +00:00
|
|
|
elif bone is None:
|
2009-10-31 19:31:45 +00:00
|
|
|
bone = context.edit_bone
|
|
|
|
|
2010-12-04 06:21:08 +00:00
|
|
|
if bone:
|
2009-10-31 19:31:45 +00:00
|
|
|
split = layout.split()
|
|
|
|
|
|
|
|
col = split.column()
|
2011-09-21 15:18:38 +00:00
|
|
|
col.prop(bone, "hide", text="Hide")
|
2012-03-20 20:06:10 +00:00
|
|
|
sub = col.column()
|
|
|
|
sub.active = bool(pchan.custom_shape)
|
|
|
|
sub.prop(bone, "show_wire", text="Wireframe")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2010-12-04 06:21:08 +00:00
|
|
|
if pchan:
|
|
|
|
col = split.column()
|
2010-01-05 11:47:43 +00:00
|
|
|
|
2011-09-21 15:18:38 +00:00
|
|
|
col.label(text="Custom Shape:")
|
2010-12-04 06:21:08 +00:00
|
|
|
col.prop(pchan, "custom_shape", text="")
|
|
|
|
if pchan.custom_shape:
|
2011-09-21 15:18:38 +00:00
|
|
|
col.prop_search(pchan, "custom_shape_transform", ob.pose, "bones", text="At")
|
2009-07-09 09:07:25 +00:00
|
|
|
|
2009-12-14 20:56:19 +00:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class BONE_PT_inverse_kinematics(BoneButtonsPanel, Panel):
|
2011-09-15 13:20:18 +00:00
|
|
|
bl_label = "Inverse Kinematics"
|
2010-08-26 01:05:37 +00:00
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2009-12-14 03:01:42 +00:00
|
|
|
|
2010-08-09 01:37:09 +00:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
2010-12-17 17:51:43 +00:00
|
|
|
ob = context.object
|
|
|
|
return ob and ob.mode == 'POSE' and context.bone
|
2009-12-14 03:01:42 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
2010-12-17 17:51:43 +00:00
|
|
|
ob = context.object
|
|
|
|
bone = context.bone
|
|
|
|
pchan = ob.pose.bones[bone.name]
|
2009-12-14 03:01:42 +00:00
|
|
|
|
2010-03-07 09:53:59 +00:00
|
|
|
row = layout.row()
|
|
|
|
|
2012-10-24 22:36:06 +00:00
|
|
|
active = pchan.is_in_ik_chain
|
|
|
|
|
2009-12-14 03:01:42 +00:00
|
|
|
split = layout.split(percentage=0.25)
|
2014-07-18 09:14:52 +00:00
|
|
|
split.prop(pchan, "lock_ik_x", text="X")
|
2012-10-24 22:36:06 +00:00
|
|
|
split.active = active
|
2009-12-14 03:01:42 +00:00
|
|
|
row = split.row()
|
2011-09-21 15:18:38 +00:00
|
|
|
row.prop(pchan, "ik_stiffness_x", text="Stiffness", slider=True)
|
2012-10-24 22:36:06 +00:00
|
|
|
row.active = pchan.lock_ik_x is False and active
|
2009-12-14 03:01:42 +00:00
|
|
|
|
2010-08-06 15:17:44 +00:00
|
|
|
split = layout.split(percentage=0.25)
|
|
|
|
sub = split.row()
|
|
|
|
|
2011-09-21 15:18:38 +00:00
|
|
|
sub.prop(pchan, "use_ik_limit_x", text="Limit")
|
2012-10-24 22:36:06 +00:00
|
|
|
sub.active = pchan.lock_ik_x is False and active
|
2010-08-06 15:17:44 +00:00
|
|
|
sub = split.row(align=True)
|
2009-12-14 03:01:42 +00:00
|
|
|
sub.prop(pchan, "ik_min_x", text="")
|
|
|
|
sub.prop(pchan, "ik_max_x", text="")
|
2012-10-24 22:36:06 +00:00
|
|
|
sub.active = pchan.lock_ik_x is False and pchan.use_ik_limit_x and active
|
2009-12-14 03:01:42 +00:00
|
|
|
|
|
|
|
split = layout.split(percentage=0.25)
|
2014-07-18 09:14:52 +00:00
|
|
|
split.prop(pchan, "lock_ik_y", text="Y")
|
2012-10-24 22:36:06 +00:00
|
|
|
split.active = active
|
2009-12-14 03:01:42 +00:00
|
|
|
row = split.row()
|
2011-09-21 15:18:38 +00:00
|
|
|
row.prop(pchan, "ik_stiffness_y", text="Stiffness", slider=True)
|
2012-10-24 22:36:06 +00:00
|
|
|
row.active = pchan.lock_ik_y is False and active
|
2009-12-14 03:01:42 +00:00
|
|
|
|
2010-08-06 15:17:44 +00:00
|
|
|
split = layout.split(percentage=0.25)
|
|
|
|
sub = split.row()
|
|
|
|
|
2011-09-21 15:18:38 +00:00
|
|
|
sub.prop(pchan, "use_ik_limit_y", text="Limit")
|
2012-10-24 22:36:06 +00:00
|
|
|
sub.active = pchan.lock_ik_y is False and active
|
2010-08-06 15:17:44 +00:00
|
|
|
|
|
|
|
sub = split.row(align=True)
|
2009-12-14 03:01:42 +00:00
|
|
|
sub.prop(pchan, "ik_min_y", text="")
|
|
|
|
sub.prop(pchan, "ik_max_y", text="")
|
2012-10-24 22:36:06 +00:00
|
|
|
sub.active = pchan.lock_ik_y is False and pchan.use_ik_limit_y and active
|
2009-12-14 03:01:42 +00:00
|
|
|
|
|
|
|
split = layout.split(percentage=0.25)
|
2014-07-18 09:14:52 +00:00
|
|
|
split.prop(pchan, "lock_ik_z", text="Z")
|
2012-10-24 22:36:06 +00:00
|
|
|
split.active = active
|
2009-12-14 03:01:42 +00:00
|
|
|
sub = split.row()
|
2011-09-21 15:18:38 +00:00
|
|
|
sub.prop(pchan, "ik_stiffness_z", text="Stiffness", slider=True)
|
2012-10-24 22:36:06 +00:00
|
|
|
sub.active = pchan.lock_ik_z is False and active
|
2009-12-14 03:01:42 +00:00
|
|
|
|
2010-08-06 15:17:44 +00:00
|
|
|
split = layout.split(percentage=0.25)
|
|
|
|
sub = split.row()
|
|
|
|
|
2011-09-21 15:18:38 +00:00
|
|
|
sub.prop(pchan, "use_ik_limit_z", text="Limit")
|
2012-10-24 22:36:06 +00:00
|
|
|
sub.active = pchan.lock_ik_z is False and active
|
2010-08-06 15:17:44 +00:00
|
|
|
sub = split.row(align=True)
|
2009-12-14 03:01:42 +00:00
|
|
|
sub.prop(pchan, "ik_min_z", text="")
|
|
|
|
sub.prop(pchan, "ik_max_z", text="")
|
2012-10-24 22:36:06 +00:00
|
|
|
sub.active = pchan.lock_ik_z is False and pchan.use_ik_limit_z and active
|
2010-09-07 15:17:42 +00:00
|
|
|
|
2010-08-27 00:05:00 +00:00
|
|
|
split = layout.split(percentage=0.25)
|
2011-09-21 15:18:38 +00:00
|
|
|
split.label(text="Stretch:")
|
2010-08-27 00:05:00 +00:00
|
|
|
sub = split.row()
|
|
|
|
sub.prop(pchan, "ik_stretch", text="", slider=True)
|
2012-10-24 22:36:06 +00:00
|
|
|
sub.active = active
|
2009-12-14 03:01:42 +00:00
|
|
|
|
|
|
|
if ob.pose.ik_solver == 'ITASC':
|
|
|
|
split = layout.split()
|
|
|
|
col = split.column()
|
2011-09-21 15:18:38 +00:00
|
|
|
col.prop(pchan, "use_ik_rotation_control", text="Control Rotation")
|
2012-10-24 22:36:06 +00:00
|
|
|
col.active = active
|
2010-08-06 15:17:44 +00:00
|
|
|
col = split.column()
|
2011-09-21 15:18:38 +00:00
|
|
|
col.prop(pchan, "ik_rotation_weight", text="Weight", slider=True)
|
2012-10-24 22:36:06 +00:00
|
|
|
col.active = active
|
2009-12-14 03:01:42 +00:00
|
|
|
# not supported yet
|
|
|
|
#row = layout.row()
|
2011-09-21 15:18:38 +00:00
|
|
|
#row.prop(pchan, "use_ik_linear_control", text="Joint Size")
|
|
|
|
#row.prop(pchan, "ik_linear_weight", text="Weight", slider=True)
|
2009-12-14 03:01:42 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class BONE_PT_deform(BoneButtonsPanel, Panel):
|
2011-09-15 13:20:18 +00:00
|
|
|
bl_label = "Deform"
|
2010-08-26 01:05:37 +00:00
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
def draw_header(self, context):
|
|
|
|
bone = context.bone
|
|
|
|
|
|
|
|
if not bone:
|
|
|
|
bone = context.edit_bone
|
|
|
|
|
2010-08-18 07:45:32 +00:00
|
|
|
self.layout.prop(bone, "use_deform", text="")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
bone = context.bone
|
|
|
|
|
|
|
|
if not bone:
|
|
|
|
bone = context.edit_bone
|
|
|
|
|
2010-08-18 07:45:32 +00:00
|
|
|
layout.active = bone.use_deform
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
split = layout.split()
|
|
|
|
|
|
|
|
col = split.column()
|
2011-09-21 15:18:38 +00:00
|
|
|
col.label(text="Envelope:")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
sub = col.column(align=True)
|
2011-09-21 15:18:38 +00:00
|
|
|
sub.prop(bone, "envelope_distance", text="Distance")
|
|
|
|
sub.prop(bone, "envelope_weight", text="Weight")
|
|
|
|
col.prop(bone, "use_envelope_multiply", text="Multiply")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
sub = col.column(align=True)
|
2011-09-21 15:18:38 +00:00
|
|
|
sub.label(text="Radius:")
|
|
|
|
sub.prop(bone, "head_radius", text="Head")
|
|
|
|
sub.prop(bone, "tail_radius", text="Tail")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2010-08-06 15:17:44 +00:00
|
|
|
col = split.column()
|
2011-09-21 15:18:38 +00:00
|
|
|
col.label(text="Curved Bones:")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
sub = col.column(align=True)
|
2011-09-21 15:18:38 +00:00
|
|
|
sub.prop(bone, "bbone_segments", text="Segments")
|
|
|
|
sub.prop(bone, "bbone_in", text="Ease In")
|
|
|
|
sub.prop(bone, "bbone_out", text="Ease Out")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2010-02-22 23:32:58 +00:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class BONE_PT_custom_props(BoneButtonsPanel, PropertyPanel, Panel):
|
2010-08-12 19:36:10 +00:00
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
|
2010-12-17 10:33:28 +00:00
|
|
|
_property_type = bpy.types.Bone, bpy.types.EditBone, bpy.types.PoseBone
|
2010-08-12 19:36:10 +00:00
|
|
|
|
|
|
|
@property
|
|
|
|
def _context_path(self):
|
|
|
|
obj = bpy.context.object
|
|
|
|
if obj and obj.mode == 'POSE':
|
|
|
|
return "active_pose_bone"
|
|
|
|
else:
|
|
|
|
return "active_bone"
|
2011-04-04 10:13:04 +00:00
|
|
|
|
|
|
|
if __name__ == "__main__": # only for live edit.
|
|
|
|
bpy.utils.register_module(__name__)
|