Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/startup/bl_ui/properties_data_bone.py
| Show First 20 Lines • Show All 67 Lines • ▼ Show 20 Lines | def draw(self, context): | ||||
| bone = context.bone | bone = context.bone | ||||
| col = layout.column() | col = layout.column() | ||||
| if bone and ob: | if bone and ob: | ||||
| pchan = ob.pose.bones[bone.name] | pchan = ob.pose.bones[bone.name] | ||||
| col.active = not (bone.parent and bone.use_connect) | col.active = not (bone.parent and bone.use_connect) | ||||
| sub = col.row(align=True) | row = col.row(align=True) | ||||
| sub.prop(pchan, "location") | row.prop(pchan, "location") | ||||
| sub.prop(pchan, "lock_location", text="") | row.use_property_decorate = False | ||||
| row.prop(pchan, "lock_location", text="", emboss=False, icon='DECORATE_UNLOCKED') | |||||
| col = layout.column() | |||||
| rotation_mode = pchan.rotation_mode | rotation_mode = pchan.rotation_mode | ||||
| if rotation_mode == 'QUATERNION': | if rotation_mode == 'QUATERNION': | ||||
| sub = col.row(align=True) | col = layout.column() | ||||
| sub.prop(pchan, "rotation_quaternion", text="Rotation") | row = col.row(align=True) | ||||
| subsub = sub.column(align=True) | row.prop(pchan, "rotation_quaternion", text="Rotation") | ||||
| subsub.prop(pchan, "lock_rotation_w", text="") | sub = row.column(align=True) | ||||
| subsub.prop(pchan, "lock_rotation", text="") | sub.use_property_decorate = False | ||||
| sub.prop(pchan, "lock_rotation_w", text="", emboss=False, icon='DECORATE_UNLOCKED') | |||||
| sub.prop(pchan, "lock_rotation", text="", emboss=False, icon='DECORATE_UNLOCKED') | |||||
| elif rotation_mode == 'AXIS_ANGLE': | elif rotation_mode == 'AXIS_ANGLE': | ||||
| sub = col.row(align=True) | col = layout.column() | ||||
| sub.prop(pchan, "rotation_axis_angle", text="Rotation") | row = col.row(align=True) | ||||
| subsub = sub.column(align=True) | row.prop(pchan, "rotation_axis_angle", text="Rotation") | ||||
| subsub.prop(pchan, "lock_rotation_w", text="") | |||||
| subsub.prop(pchan, "lock_rotation", text="") | |||||
| else: | |||||
| sub = col.row(align=True) | |||||
| sub.prop(pchan, "rotation_euler", text="Rotation") | |||||
| sub.prop(pchan, "lock_rotation", text="") | |||||
| sub = row.column(align=True) | |||||
| sub.use_property_decorate = False | |||||
| sub.prop(pchan, "lock_rotation_w", text="", emboss=False, icon='DECORATE_UNLOCKED') | |||||
| sub.prop(pchan, "lock_rotation", text="", emboss=False, icon='DECORATE_UNLOCKED') | |||||
| else: | |||||
| col = layout.column() | col = layout.column() | ||||
| sub = col.row(align=True) | row = col.row(align=True) | ||||
| sub.prop(pchan, "scale") | row.prop(pchan, "rotation_euler", text="Rotation") | ||||
| sub.prop(pchan, "lock_scale", text="") | row.use_property_decorate = False | ||||
| row.prop(pchan, "lock_rotation", text="", emboss=False, icon='DECORATE_UNLOCKED') | |||||
| row = layout.row(align=True) | |||||
| row.prop(pchan, "rotation_mode") | |||||
| row.label(text="", icon='BLANK1') | |||||
| col = layout.column() | col = layout.column() | ||||
| col.prop(pchan, "rotation_mode") | row = col.row(align=True) | ||||
| row.prop(pchan, "scale") | |||||
| row.use_property_decorate = False | |||||
| row.prop(pchan, "lock_scale", text="", emboss=False, icon='DECORATE_UNLOCKED') | |||||
| elif context.edit_bone: | elif context.edit_bone: | ||||
| bone = context.edit_bone | bone = context.edit_bone | ||||
| col = layout.column() | col = layout.column() | ||||
| col.prop(bone, "head") | col.prop(bone, "head") | ||||
| col.prop(bone, "tail") | col.prop(bone, "tail") | ||||
| col = layout.column() | col = layout.column() | ||||
| col.prop(bone, "roll") | col.prop(bone, "roll") | ||||
| col.prop(bone, "lock") | col.prop(bone, "lock") | ||||
| col = layout.column() | |||||
| col.prop(bone, "tail_radius") | |||||
| col.prop(bone, "envelope_distance") | |||||
| class BONE_PT_curved(BoneButtonsPanel, Panel): | class BONE_PT_curved(BoneButtonsPanel, Panel): | ||||
| bl_label = "Bendy Bones" | bl_label = "Bendy Bones" | ||||
| bl_options = {'DEFAULT_CLOSED'} | bl_options = {'DEFAULT_CLOSED'} | ||||
| def draw(self, context): | def draw(self, context): | ||||
| ob = context.object | ob = context.object | ||||
| bone = context.bone | bone = context.bone | ||||
| arm = context.armature | arm = context.armature | ||||
| Show All 10 Lines | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| layout.use_property_split = True | layout.use_property_split = True | ||||
| layout.prop(bone, "bbone_segments", text="Segments") | layout.prop(bone, "bbone_segments", text="Segments") | ||||
| topcol = layout.column() | topcol = layout.column() | ||||
| topcol.active = bone.bbone_segments > 1 | topcol.active = bone.bbone_segments > 1 | ||||
| col = topcol.column(align=True) | col = topcol.column(align=True) | ||||
| col.prop(bone, "bbone_x", text="Display Size X") | |||||
| col.prop(bone, "bbone_z", text="Z") | |||||
| col = topcol.column(align=True) | |||||
| col.prop(bbone, "bbone_curveinx", text="Curve In X") | col.prop(bbone, "bbone_curveinx", text="Curve In X") | ||||
| col.prop(bbone, "bbone_curveiny", text="In Y") | col.prop(bbone, "bbone_curveiny", text="In Y") | ||||
| col = topcol.column(align=True) | col = topcol.column(align=True) | ||||
| col.prop(bbone, "bbone_curveoutx", text="Curve Out X") | col.prop(bbone, "bbone_curveoutx", text="Curve Out X") | ||||
| col.prop(bbone, "bbone_curveouty", text="Out Y") | col.prop(bbone, "bbone_curveouty", text="Out Y") | ||||
| col = topcol.column(align=True) | col = topcol.column(align=True) | ||||
| ▲ Show 20 Lines • Show All 273 Lines • Show Last 20 Lines | |||||