| 
									
										
										
										
											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-08-12 06:57:00 +00:00
										 |  |  | from bpy.types import Panel | 
					
						
							| 
									
										
										
										
											2009-11-28 23:37:56 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-09-20 18:29:19 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  | class ObjectConstraintPanel(Panel): | 
					
						
							|  |  |  |     bl_context = "constraint" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     @classmethod | 
					
						
							|  |  |  |     def poll(cls, context): | 
					
						
							|  |  |  |         return (context.object) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class BoneConstraintPanel(Panel): | 
					
						
							|  |  |  |     bl_context = "bone_constraint" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     @classmethod | 
					
						
							|  |  |  |     def poll(cls, context): | 
					
						
							|  |  |  |         return (context.pose_bone) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class OBJECT_PT_constraints(ObjectConstraintPanel): | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  |     bl_space_type = 'PROPERTIES' | 
					
						
							|  |  |  |     bl_region_type = 'WINDOW' | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |     bl_label = "Object Constraints" | 
					
						
							|  |  |  |     bl_options = {'HIDE_HEADER'} | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |     def draw(self, context): | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  |         layout = self.layout | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         layout.operator_menu_enum("object.constraint_add", "type", text="Add Object Constraint") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         layout.template_constraints(use_bone_constraints=False) | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-05-08 10:57:17 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  | class BONE_PT_constraints(BoneConstraintPanel): | 
					
						
							|  |  |  |     bl_space_type = 'PROPERTIES' | 
					
						
							|  |  |  |     bl_region_type = 'WINDOW' | 
					
						
							|  |  |  |     bl_label = "Bone Constraints" | 
					
						
							|  |  |  |     bl_options = {'HIDE_HEADER'} | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         layout = self.layout | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         layout.operator_menu_enum("pose.constraint_add", "type", text="Add Bone Constraint") | 
					
						
							| 
									
										
										
										
											2009-11-21 00:05:43 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         layout.template_constraints(use_bone_constraints=True) | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-11-21 00:05:43 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  | # Parent class for constraint panels, with templates and drawing methods | 
					
						
							|  |  |  | # shared between the bone and object constraint panels | 
					
						
							|  |  |  | class ConstraintButtonsPanel(Panel): | 
					
						
							|  |  |  |     bl_space_type = 'PROPERTIES' | 
					
						
							|  |  |  |     bl_region_type = 'WINDOW' | 
					
						
							|  |  |  |     bl_label = "" | 
					
						
							|  |  |  |     bl_options = {'INSTANCED', 'HEADER_LAYOUT_EXPAND', 'DRAW_BOX'} | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |     @staticmethod | 
					
						
							|  |  |  |     def draw_influence(layout, con): | 
					
						
							|  |  |  |         layout.separator() | 
					
						
							|  |  |  |         if con.type in {'IK', 'SPLINE_IK'}: | 
					
						
							|  |  |  |             # constraint.disable_keep_transform doesn't work well | 
					
						
							|  |  |  |             # for these constraints. | 
					
						
							|  |  |  |             layout.prop(con, "influence") | 
					
						
							|  |  |  |         else: | 
					
						
							|  |  |  |             row = layout.row(align=True) | 
					
						
							|  |  |  |             row.prop(con, "influence") | 
					
						
							|  |  |  |             row.operator("constraint.disable_keep_transform", text="", icon='CANCEL') | 
					
						
							| 
									
										
										
										
											2010-08-06 15:17:44 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |     @staticmethod | 
					
						
							|  |  |  |     def space_template(layout, con, target=True, owner=True): | 
					
						
							|  |  |  |         if target or owner: | 
					
						
							|  |  |  |             layout.separator() | 
					
						
							|  |  |  |             if target: | 
					
						
							|  |  |  |                 layout.prop(con, "target_space", text="Target") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  |             if owner: | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |                 layout.prop(con, "owner_space", text="Owner") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-06-07 17:40:39 +10:00
										 |  |  |     @staticmethod | 
					
						
							|  |  |  |     def target_template(layout, con, subtargets=True): | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         col = layout.column() | 
					
						
							|  |  |  |         col.prop(con, "target")  # XXX limiting settings for only 'curves' or some type of object | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |         if con.target and subtargets: | 
					
						
							|  |  |  |             if con.target.type == 'ARMATURE': | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |                 col.prop_search(con, "subtarget", con.target.data, "bones", text="Bone") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-01-02 04:16:19 +00:00
										 |  |  |                 if hasattr(con, "head_tail"): | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |                     row = col.row(align=True, heading="Head/Tail") | 
					
						
							|  |  |  |                     row.use_property_decorate = False | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |                     row.prop(con, "head_tail", text="") | 
					
						
							| 
									
										
										
										
											2019-01-30 09:03:37 +11:00
										 |  |  |                     # XXX icon, and only when bone has segments? | 
					
						
							|  |  |  |                     row.prop(con, "use_bbone_shape", text="", icon='IPO_BEZIER') | 
					
						
							| 
									
										
										
										
											2011-03-07 13:23:45 +00:00
										 |  |  |             elif con.target.type in {'MESH', 'LATTICE'}: | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |                 col.prop_search(con, "subtarget", con.target, "vertex_groups", text="Vertex Group") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |     def get_constraint(self, context): | 
					
						
							|  |  |  |         con = None | 
					
						
							|  |  |  |         if context.pose_bone: | 
					
						
							|  |  |  |             con = context.pose_bone.constraints[self.list_panel_index] | 
					
						
							|  |  |  |         else: | 
					
						
							|  |  |  |             con = context.object.constraints[self.list_panel_index] | 
					
						
							|  |  |  |         self.layout.context_pointer_set("constraint", con) | 
					
						
							|  |  |  |         return con | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |     def draw_header(self, context): | 
					
						
							|  |  |  |         layout = self.layout | 
					
						
							|  |  |  |         con = self.get_constraint(context) | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         layout.template_constraint_header(con) | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |     # Drawing methods for specific constraints. (Shared by object and bone constraint panels) | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |     def draw_childof(self, context): | 
					
						
							|  |  |  |         layout = self.layout | 
					
						
							|  |  |  |         con = self.get_constraint(context) | 
					
						
							|  |  |  |         layout.use_property_split = True | 
					
						
							|  |  |  |         layout.use_property_decorate = True | 
					
						
							| 
									
										
										
										
											2009-11-07 22:07:46 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-08-06 15:17:44 +00:00
										 |  |  |         self.target_template(layout, con) | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         row = layout.row(heading="Location") | 
					
						
							|  |  |  |         row.use_property_decorate = False | 
					
						
							|  |  |  |         row.prop(con, "use_location_x", text="X", toggle=True) | 
					
						
							|  |  |  |         row.prop(con, "use_location_y", text="Y", toggle=True) | 
					
						
							|  |  |  |         row.prop(con, "use_location_z", text="Z", toggle=True) | 
					
						
							|  |  |  |         row.label(icon='BLANK1') | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         row = layout.row(heading="Rotation") | 
					
						
							|  |  |  |         row.use_property_decorate = False | 
					
						
							|  |  |  |         row.prop(con, "use_rotation_x", text="X", toggle=True) | 
					
						
							|  |  |  |         row.prop(con, "use_rotation_y", text="Y", toggle=True) | 
					
						
							|  |  |  |         row.prop(con, "use_rotation_z", text="Z", toggle=True) | 
					
						
							|  |  |  |         row.label(icon='BLANK1') | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         row = layout.row(heading="Scale") | 
					
						
							|  |  |  |         row.use_property_decorate = False | 
					
						
							|  |  |  |         row.prop(con, "use_scale_x", text="X", toggle=True) | 
					
						
							|  |  |  |         row.prop(con, "use_scale_y", text="Y", toggle=True) | 
					
						
							|  |  |  |         row.prop(con, "use_scale_z", text="Z", toggle=True) | 
					
						
							|  |  |  |         row.label(icon='BLANK1') | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-02-26 16:04:14 +00:00
										 |  |  |         row = layout.row() | 
					
						
							|  |  |  |         row.operator("constraint.childof_set_inverse") | 
					
						
							|  |  |  |         row.operator("constraint.childof_clear_inverse") | 
					
						
							| 
									
										
										
										
											2009-11-17 15:59:54 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         self.draw_influence(layout, con) | 
					
						
							| 
									
										
										
										
											2012-11-24 00:18:34 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |     def draw_trackto(self, context): | 
					
						
							|  |  |  |         layout = self.layout | 
					
						
							|  |  |  |         con = self.get_constraint(context) | 
					
						
							|  |  |  |         layout.use_property_split = True | 
					
						
							|  |  |  |         layout.use_property_decorate = True | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-08-06 15:17:44 +00:00
										 |  |  |         self.target_template(layout, con) | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         layout.prop(con, "track_axis", expand=True) | 
					
						
							|  |  |  |         layout.prop(con, "up_axis", text="Up", expand=True) | 
					
						
							|  |  |  |         layout.prop(con, "use_target_z") | 
					
						
							| 
									
										
										
										
											2011-02-26 16:04:14 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         self.space_template(layout, con) | 
					
						
							| 
									
										
										
										
											2009-11-07 22:07:46 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         self.draw_influence(layout, con) | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |     def draw_follow_path(self, context): | 
					
						
							|  |  |  |         layout = self.layout | 
					
						
							|  |  |  |         con = self.get_constraint(context) | 
					
						
							|  |  |  |         layout.use_property_split = True | 
					
						
							|  |  |  |         layout.use_property_decorate = True | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         self.target_template(layout, con) | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-08-20 06:09:58 +00:00
										 |  |  |         if con.use_fixed_location: | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |             layout.prop(con, "offset_factor", text="Offset Factor") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  |         else: | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |             layout.prop(con, "offset") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         layout.prop(con, "forward_axis", expand=True) | 
					
						
							|  |  |  |         layout.prop(con, "up_axis", expand=True) | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         col = layout.column() | 
					
						
							|  |  |  |         col.prop(con, "use_fixed_location") | 
					
						
							|  |  |  |         col.prop(con, "use_curve_radius") | 
					
						
							|  |  |  |         col.prop(con, "use_curve_follow") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         layout.operator("constraint.followpath_path_animate", text="Animate Path", icon='ANIM_DATA') | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         self.draw_influence(layout, con) | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |     def draw_rot_limit(self, context): | 
					
						
							|  |  |  |         layout = self.layout | 
					
						
							|  |  |  |         con = self.get_constraint(context) | 
					
						
							|  |  |  |         layout.use_property_split = True | 
					
						
							|  |  |  |         layout.use_property_decorate = True | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         # Decorators and property split are really buggy with these properties | 
					
						
							|  |  |  |         row = layout.row(heading="Limit X", align=True) | 
					
						
							|  |  |  |         row.use_property_decorate = False | 
					
						
							|  |  |  |         row.prop(con, "use_limit_x", text="") | 
					
						
							|  |  |  |         sub = row.column(align=True) | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  |         sub.active = con.use_limit_x | 
					
						
							| 
									
										
										
										
											2011-09-21 15:18:38 +00:00
										 |  |  |         sub.prop(con, "min_x", text="Min") | 
					
						
							|  |  |  |         sub.prop(con, "max_x", text="Max") | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         row.label(icon="BLANK1") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         row = layout.row(heading="Y", align=True) | 
					
						
							|  |  |  |         row.use_property_decorate = False | 
					
						
							|  |  |  |         row.prop(con, "use_limit_y", text="") | 
					
						
							|  |  |  |         sub = row.column(align=True) | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  |         sub.active = con.use_limit_y | 
					
						
							| 
									
										
										
										
											2011-09-21 15:18:38 +00:00
										 |  |  |         sub.prop(con, "min_y", text="Min") | 
					
						
							|  |  |  |         sub.prop(con, "max_y", text="Max") | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         row.label(icon="BLANK1") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         row = layout.row(heading="Z", align=True) | 
					
						
							|  |  |  |         row.use_property_decorate = False | 
					
						
							|  |  |  |         row.prop(con, "use_limit_z", text="") | 
					
						
							|  |  |  |         sub = row.column(align=True) | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  |         sub.active = con.use_limit_z | 
					
						
							| 
									
										
										
										
											2011-09-21 15:18:38 +00:00
										 |  |  |         sub.prop(con, "min_z", text="Min") | 
					
						
							|  |  |  |         sub.prop(con, "max_z", text="Max") | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         row.label(icon="BLANK1") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-08-30 10:44:02 +00:00
										 |  |  |         layout.prop(con, "use_transform_limit") | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         layout.prop(con, "owner_space") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         self.draw_influence(layout, con) | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |     def draw_loc_limit(self, context): | 
					
						
							|  |  |  |         layout = self.layout | 
					
						
							|  |  |  |         con = self.get_constraint(context) | 
					
						
							|  |  |  |         layout.use_property_split = True | 
					
						
							|  |  |  |         layout.use_property_decorate = True | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         col = layout.column() | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         row = col.row(heading="Minimum X", align=True) | 
					
						
							|  |  |  |         row.use_property_decorate = False | 
					
						
							|  |  |  |         sub = row.row(align=True) | 
					
						
							|  |  |  |         sub.prop(con, "use_min_x", text="") | 
					
						
							|  |  |  |         subsub = sub.row(align=True) | 
					
						
							|  |  |  |         subsub.active = con.use_min_x | 
					
						
							|  |  |  |         subsub.prop(con, "min_x", text="") | 
					
						
							|  |  |  |         row.prop_decorator(con, "min_x") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         row = col.row(heading="Y", align=True) | 
					
						
							|  |  |  |         row.use_property_decorate = False | 
					
						
							|  |  |  |         sub = row.row(align=True) | 
					
						
							|  |  |  |         sub.prop(con, "use_min_y", text="") | 
					
						
							|  |  |  |         subsub = sub.row(align=True) | 
					
						
							|  |  |  |         subsub.active = con.use_min_y | 
					
						
							|  |  |  |         subsub.prop(con, "min_y", text="") | 
					
						
							|  |  |  |         row.prop_decorator(con, "min_y") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         row = col.row(heading="Z", align=True) | 
					
						
							|  |  |  |         row.use_property_decorate = False | 
					
						
							|  |  |  |         sub = row.row(align=True) | 
					
						
							|  |  |  |         sub.prop(con, "use_min_z", text="") | 
					
						
							|  |  |  |         subsub = sub.row(align=True) | 
					
						
							|  |  |  |         subsub.active = con.use_min_z | 
					
						
							|  |  |  |         subsub.prop(con, "min_z", text="") | 
					
						
							|  |  |  |         row.prop_decorator(con, "min_z") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         col.separator() | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         row = col.row(heading="Maximum X", align=True) | 
					
						
							|  |  |  |         row.use_property_decorate = False | 
					
						
							|  |  |  |         sub = row.row(align=True) | 
					
						
							|  |  |  |         sub.prop(con, "use_max_x", text="") | 
					
						
							|  |  |  |         subsub = sub.row(align=True) | 
					
						
							|  |  |  |         subsub.active = con.use_max_x | 
					
						
							|  |  |  |         subsub.prop(con, "max_x", text="") | 
					
						
							|  |  |  |         row.prop_decorator(con, "max_x") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         row = col.row(heading="Y", align=True) | 
					
						
							|  |  |  |         row.use_property_decorate = False | 
					
						
							|  |  |  |         sub = row.row(align=True) | 
					
						
							|  |  |  |         sub.prop(con, "use_max_y", text="") | 
					
						
							|  |  |  |         subsub = sub.row(align=True) | 
					
						
							|  |  |  |         subsub.active = con.use_max_y | 
					
						
							|  |  |  |         subsub.prop(con, "max_y", text="") | 
					
						
							|  |  |  |         row.prop_decorator(con, "max_y") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         row = col.row(heading="Z", align=True) | 
					
						
							|  |  |  |         row.use_property_decorate = False | 
					
						
							|  |  |  |         sub = row.row(align=True) | 
					
						
							|  |  |  |         sub.prop(con, "use_max_z", text="") | 
					
						
							|  |  |  |         subsub = sub.row(align=True) | 
					
						
							|  |  |  |         subsub.active = con.use_max_z | 
					
						
							|  |  |  |         subsub.prop(con, "max_z", text="") | 
					
						
							|  |  |  |         row.prop_decorator(con, "max_z") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         layout.prop(con, "use_transform_limit") | 
					
						
							|  |  |  |         layout.prop(con, "owner_space") | 
					
						
							| 
									
										
										
										
											2009-11-07 22:07:46 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         self.draw_influence(layout, con) | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |     def draw_size_limit(self, context): | 
					
						
							|  |  |  |         layout = self.layout | 
					
						
							|  |  |  |         con = self.get_constraint(context) | 
					
						
							|  |  |  |         layout.use_property_split = True | 
					
						
							|  |  |  |         layout.use_property_decorate = True | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         col = layout.column() | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         row = col.row(heading="Minimum X", align=True) | 
					
						
							|  |  |  |         row.use_property_decorate = False | 
					
						
							|  |  |  |         sub = row.row(align=True) | 
					
						
							|  |  |  |         sub.prop(con, "use_min_x", text="") | 
					
						
							|  |  |  |         subsub = sub.row(align=True) | 
					
						
							|  |  |  |         subsub.active = con.use_min_x | 
					
						
							|  |  |  |         subsub.prop(con, "min_x", text="") | 
					
						
							|  |  |  |         row.prop_decorator(con, "min_x") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         row = col.row(heading="Y", align=True) | 
					
						
							|  |  |  |         row.use_property_decorate = False | 
					
						
							|  |  |  |         sub = row.row(align=True) | 
					
						
							|  |  |  |         sub.prop(con, "use_min_y", text="") | 
					
						
							|  |  |  |         subsub = sub.row(align=True) | 
					
						
							|  |  |  |         subsub.active = con.use_min_y | 
					
						
							|  |  |  |         subsub.prop(con, "min_y", text="") | 
					
						
							|  |  |  |         row.prop_decorator(con, "min_y") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         row = col.row(heading="Z", align=True) | 
					
						
							|  |  |  |         row.use_property_decorate = False | 
					
						
							|  |  |  |         sub = row.row(align=True) | 
					
						
							|  |  |  |         sub.prop(con, "use_min_z", text="") | 
					
						
							|  |  |  |         subsub = sub.row(align=True) | 
					
						
							|  |  |  |         subsub.active = con.use_min_z | 
					
						
							|  |  |  |         subsub.prop(con, "min_z", text="") | 
					
						
							|  |  |  |         row.prop_decorator(con, "min_z") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         col.separator() | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         row = col.row(heading="Maximum X", align=True) | 
					
						
							|  |  |  |         row.use_property_decorate = False | 
					
						
							|  |  |  |         sub = row.row(align=True) | 
					
						
							|  |  |  |         sub.prop(con, "use_max_x", text="") | 
					
						
							|  |  |  |         subsub = sub.row(align=True) | 
					
						
							|  |  |  |         subsub.active = con.use_max_x | 
					
						
							|  |  |  |         subsub.prop(con, "max_x", text="") | 
					
						
							|  |  |  |         row.prop_decorator(con, "max_x") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         row = col.row(heading="Y", align=True) | 
					
						
							|  |  |  |         row.use_property_decorate = False | 
					
						
							|  |  |  |         sub = row.row(align=True) | 
					
						
							|  |  |  |         sub.prop(con, "use_max_y", text="") | 
					
						
							|  |  |  |         subsub = sub.row(align=True) | 
					
						
							|  |  |  |         subsub.active = con.use_max_y | 
					
						
							|  |  |  |         subsub.prop(con, "max_y", text="") | 
					
						
							|  |  |  |         row.prop_decorator(con, "max_y") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         row = col.row(heading="Z", align=True) | 
					
						
							|  |  |  |         row.use_property_decorate = False | 
					
						
							|  |  |  |         sub = row.row(align=True) | 
					
						
							|  |  |  |         sub.prop(con, "use_max_z", text="") | 
					
						
							|  |  |  |         subsub = sub.row(align=True) | 
					
						
							|  |  |  |         subsub.active = con.use_max_z | 
					
						
							|  |  |  |         subsub.prop(con, "max_z", text="") | 
					
						
							|  |  |  |         row.prop_decorator(con, "max_z") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         layout.prop(con, "use_transform_limit") | 
					
						
							|  |  |  |         layout.prop(con, "owner_space") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         self.draw_influence(layout, con) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def draw_rotate_like(self, context): | 
					
						
							|  |  |  |         layout = self.layout | 
					
						
							|  |  |  |         con = self.get_constraint(context) | 
					
						
							|  |  |  |         layout.use_property_split = True | 
					
						
							|  |  |  |         layout.use_property_decorate = True | 
					
						
							| 
									
										
										
										
											2019-09-01 13:19:11 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         self.target_template(layout, con) | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         layout.prop(con, "euler_order", text="Order") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         row = layout.row(heading="Axis") | 
					
						
							|  |  |  |         row.use_property_decorate = False | 
					
						
							|  |  |  |         row.prop(con, "use_x", text="X", toggle=True) | 
					
						
							|  |  |  |         row.prop(con, "use_y", text="Y", toggle=True) | 
					
						
							|  |  |  |         row.prop(con, "use_z", text="Z", toggle=True) | 
					
						
							|  |  |  |         row.label(icon='BLANK1') | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         row = layout.row(heading="Invert") | 
					
						
							|  |  |  |         row.use_property_decorate = False | 
					
						
							|  |  |  |         row.prop(con, "invert_x", text="X", toggle=True) | 
					
						
							|  |  |  |         row.prop(con, "invert_y", text="Y", toggle=True) | 
					
						
							|  |  |  |         row.prop(con, "invert_z", text="Z", toggle=True) | 
					
						
							|  |  |  |         row.label(icon='BLANK1') | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-09-04 12:06:59 +03:00
										 |  |  |         layout.prop(con, "mix_mode", text="Mix") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-08-06 15:17:44 +00:00
										 |  |  |         self.space_template(layout, con) | 
					
						
							| 
									
										
										
										
											2009-11-07 22:07:46 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         self.draw_influence(layout, con) | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |     def draw_locate_like(self, context): | 
					
						
							|  |  |  |         layout = self.layout | 
					
						
							|  |  |  |         con = self.get_constraint(context) | 
					
						
							|  |  |  |         layout.use_property_split = True | 
					
						
							|  |  |  |         layout.use_property_decorate = True | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         self.target_template(layout, con) | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         row = layout.row(heading="Axis") | 
					
						
							|  |  |  |         row.use_property_decorate = False | 
					
						
							|  |  |  |         row.prop(con, "use_x", text="X", toggle=True) | 
					
						
							|  |  |  |         row.prop(con, "use_y", text="Y", toggle=True) | 
					
						
							|  |  |  |         row.prop(con, "use_z", text="Z", toggle=True) | 
					
						
							|  |  |  |         row.label(icon='BLANK1') | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         row = layout.row(heading="Invert") | 
					
						
							|  |  |  |         row.use_property_decorate = False | 
					
						
							|  |  |  |         row.prop(con, "invert_x", text="X", toggle=True) | 
					
						
							|  |  |  |         row.prop(con, "invert_y", text="Y", toggle=True) | 
					
						
							|  |  |  |         row.prop(con, "invert_z", text="Z", toggle=True) | 
					
						
							|  |  |  |         row.label(icon='BLANK1') | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-11-25 15:00:29 +00:00
										 |  |  |         layout.prop(con, "use_offset") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-08-06 15:17:44 +00:00
										 |  |  |         self.space_template(layout, con) | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         self.draw_influence(layout, con) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def draw_size_like(self, context): | 
					
						
							|  |  |  |         layout = self.layout | 
					
						
							|  |  |  |         con = self.get_constraint(context) | 
					
						
							|  |  |  |         layout.use_property_split = True | 
					
						
							|  |  |  |         layout.use_property_decorate = True | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-08-06 15:17:44 +00:00
										 |  |  |         self.target_template(layout, con) | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         row = layout.row(heading="Axis") | 
					
						
							|  |  |  |         row.prop(con, "use_x", text="X", toggle=True) | 
					
						
							|  |  |  |         row.prop(con, "use_y", text="Y", toggle=True) | 
					
						
							|  |  |  |         row.prop(con, "use_z", text="Z", toggle=True) | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         col = layout.column() | 
					
						
							|  |  |  |         col.prop(con, "power") | 
					
						
							|  |  |  |         col.prop(con, "use_make_uniform") | 
					
						
							| 
									
										
										
										
											2019-05-08 12:08:54 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         col.prop(con, "use_offset") | 
					
						
							|  |  |  |         row = col.row() | 
					
						
							| 
									
										
										
										
											2018-07-24 18:53:22 +03:00
										 |  |  |         row.active = con.use_offset | 
					
						
							|  |  |  |         row.prop(con, "use_add") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-08-06 15:17:44 +00:00
										 |  |  |         self.space_template(layout, con) | 
					
						
							| 
									
										
										
										
											2010-01-31 14:46:28 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         self.draw_influence(layout, con) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def draw_same_volume(self, context): | 
					
						
							|  |  |  |         layout = self.layout | 
					
						
							|  |  |  |         con = self.get_constraint(context) | 
					
						
							|  |  |  |         layout.use_property_split = True | 
					
						
							|  |  |  |         layout.use_property_decorate = True | 
					
						
							| 
									
										
										
										
											2010-03-16 12:55:56 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
											  
											
												Maintain Volume: introduce an option switching between modes.
After a lot of thinking about this, I decided that all operation modes
that I've tried over the past couple of years, including the original
2.79 one, have their uses after all. Thus the only reasonable solution
is to add yet another option.
The modes are:
- Strict: The current 2.80 mode, which overrides the original scaling
  of the non-free axes to strictly preserve the volume. This is the most
  obvious way one would expect a 'Maintain Volume' constraint to work.
- Uniform: The original 2.79 mode, which assumes that all axes have been
  scaled the same as the free one when computing the volume. This seems
  strange, but the net effect is that when simply scaling the object
  uniformly with S, the volume is preserved; however, scaling the non-
  free axes individually allows deviating from the locked volume.
  This was obviously intended as a more or less convenient UI tool.
- Single Axis: My own variant of the intent of the Uniform scale, which
  does volume-preserving if the object is scaled just on the Free axis,
  while passing the non-free axis scaling through. I.e. instead of
  uniform S scaling, the user has to scale the object just on its
  primary axis to achieve constant volume. This can allow reducing the
  number of animation curves when only constant volume scaling is needed,
  or be an easier to control tool inside a complex rig.
											
										 
											2019-05-06 21:47:51 +03:00
										 |  |  |         layout.prop(con, "mode") | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         row = layout.row(heading="Free Axis") | 
					
						
							| 
									
										
										
										
											2010-08-21 04:51:00 +00:00
										 |  |  |         row.prop(con, "free_axis", expand=True) | 
					
						
							| 
									
										
										
										
											2010-03-16 12:55:56 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |         layout.prop(con, "volume") | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         layout.prop(con, "owner_space") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         self.draw_influence(layout, con) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def draw_trans_like(self, context): | 
					
						
							|  |  |  |         layout = self.layout | 
					
						
							|  |  |  |         con = self.get_constraint(context) | 
					
						
							|  |  |  |         layout.use_property_split = True | 
					
						
							|  |  |  |         layout.use_property_decorate = True | 
					
						
							| 
									
										
										
										
											2010-03-16 12:55:56 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-08-06 15:17:44 +00:00
										 |  |  |         self.target_template(layout, con) | 
					
						
							| 
									
										
										
										
											2010-01-02 04:14:17 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-09-04 14:59:18 +03:00
										 |  |  |         layout.prop(con, "mix_mode", text="Mix") | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-08-06 15:17:44 +00:00
										 |  |  |         self.space_template(layout, con) | 
					
						
							| 
									
										
										
										
											2010-01-31 14:46:28 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         self.draw_influence(layout, con) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def draw_action(self, context): | 
					
						
							|  |  |  |         layout = self.layout | 
					
						
							|  |  |  |         con = self.get_constraint(context) | 
					
						
							|  |  |  |         layout.use_property_split = True | 
					
						
							|  |  |  |         layout.use_property_decorate = True | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-08-06 15:17:44 +00:00
										 |  |  |         self.target_template(layout, con) | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         layout.prop(con, "mix_mode", text="Mix") | 
					
						
							| 
									
										
										
										
											2012-02-04 11:10:41 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         self.draw_influence(layout, con) | 
					
						
							| 
									
										
										
										
											2012-02-04 11:10:41 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |     def draw_lock_track(self, context): | 
					
						
							|  |  |  |         layout = self.layout | 
					
						
							|  |  |  |         con = self.get_constraint(context) | 
					
						
							|  |  |  |         layout.use_property_split = True | 
					
						
							|  |  |  |         layout.use_property_decorate = True | 
					
						
							| 
									
										
										
										
											2012-02-04 11:10:41 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         self.target_template(layout, con) | 
					
						
							| 
									
										
										
										
											2012-02-04 11:10:41 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         layout.prop(con, "track_axis", expand=True) | 
					
						
							|  |  |  |         layout.prop(con, "lock_axis", expand=True) | 
					
						
							| 
									
										
										
										
											2012-02-04 11:10:41 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         self.draw_influence(layout, con) | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |     def draw_dist_limit(self, context): | 
					
						
							|  |  |  |         layout = self.layout | 
					
						
							|  |  |  |         con = self.get_constraint(context) | 
					
						
							|  |  |  |         layout.use_property_split = True | 
					
						
							|  |  |  |         layout.use_property_decorate = True | 
					
						
							| 
									
										
											  
											
												Action Constraint: introduce a mix mode setting.
Currently the action channels are applied after the existing
transformation, as if the action controlled a child of the
bone. This is not very natural, but more importantly, the
transform tools are not designed to work conveniently with an
additional 'pseudo-child' transformation, resulting in effects
like an unexpected pivot location.
Implementing a Before mode that integrates the action channels
as if applied to a parent allows using the special transform
tool code intended for dealing with such constraints.
Note that in either mode, Action constraints should be added
in reverse order, putting a new constraint before the existing
ones that the Action was keyframed to work together.
In order to implement the option, extract a utility from
the Copy Transform constraint code for combining transforms
with special anti-shear scale handling that matches the
Aligned Inherit Scale mode.
The Before mode also requires switching the constraint to
the Local owner space, while the After mode can still use the
World space for efficiency as before. Since the constraint
doesn't have an Owner space option in the UI, this has to be
handled in an RNA setter.
For full backward compatibility, the original simple matrix
multiplication mode is preserved as the third option, but it
is not recommended due to creating shear.
Differential Revision: https://developer.blender.org/D6297
											
										 
											2019-11-23 13:11:39 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-08-06 15:17:44 +00:00
										 |  |  |         self.target_template(layout, con) | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |         row = layout.row() | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         row.prop(con, "distance") | 
					
						
							|  |  |  |         row.operator("constraint.limitdistance_reset", text="", icon="X") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         layout.prop(con, "limit_mode", text="Clamp Region") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         layout.prop(con, "use_transform_limit") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         self.space_template(layout, con) | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         self.draw_influence(layout, con) | 
					
						
							| 
									
										
										
										
											2011-05-24 12:12:12 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |     def draw_stretch_to(self, context): | 
					
						
							|  |  |  |         layout = self.layout | 
					
						
							|  |  |  |         con = self.get_constraint(context) | 
					
						
							|  |  |  |         layout.use_property_split = True | 
					
						
							|  |  |  |         layout.use_property_decorate = True | 
					
						
							| 
									
										
										
										
											2012-10-11 08:26:49 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-08-06 15:17:44 +00:00
										 |  |  |         self.target_template(layout, con) | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-02-26 16:04:14 +00:00
										 |  |  |         row = layout.row() | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         row.prop(con, "rest_length") | 
					
						
							|  |  |  |         row.operator("constraint.stretchto_reset", text="", icon="X") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         layout.separator() | 
					
						
							| 
									
										
										
										
											2010-08-06 15:17:44 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         col = layout.column() | 
					
						
							|  |  |  |         col.prop(con, "bulge", text="Volume Variation") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         row = col.row(heading="Volume Min", align=True) | 
					
						
							|  |  |  |         row.use_property_decorate = False | 
					
						
							|  |  |  |         sub = row.row(align=True) | 
					
						
							|  |  |  |         sub.prop(con, "use_bulge_min", text="") | 
					
						
							|  |  |  |         subsub = sub.row(align=True) | 
					
						
							|  |  |  |         subsub.active = con.use_bulge_min | 
					
						
							|  |  |  |         subsub.prop(con, "bulge_min", text="") | 
					
						
							|  |  |  |         row.prop_decorator(con, "bulge_min") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         row = col.row(heading="Max", align=True) | 
					
						
							|  |  |  |         row.use_property_decorate = False | 
					
						
							|  |  |  |         sub = row.row(align=True) | 
					
						
							|  |  |  |         sub.prop(con, "use_bulge_max", text="") | 
					
						
							|  |  |  |         subsub = sub.row(align=True) | 
					
						
							|  |  |  |         subsub.active = con.use_bulge_max | 
					
						
							|  |  |  |         subsub.prop(con, "bulge_max", text="") | 
					
						
							|  |  |  |         row.prop_decorator(con, "bulge_max") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         row = col.row() | 
					
						
							|  |  |  |         row.active = con.use_bulge_min or con.use_bulge_max | 
					
						
							|  |  |  |         row.prop(con, "bulge_smooth", text="Smooth") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         layout.prop(con, "volume", expand=True) | 
					
						
							|  |  |  |         layout.prop(con, "keep_axis", text="Rotation", expand=True) | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         self.draw_influence(layout, con) | 
					
						
							| 
									
										
										
										
											2010-01-31 14:46:28 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |     def draw_min_max(self, context): | 
					
						
							|  |  |  |         layout = self.layout | 
					
						
							|  |  |  |         con = self.get_constraint(context) | 
					
						
							|  |  |  |         layout.use_property_split = True | 
					
						
							|  |  |  |         layout.use_property_decorate = True | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         self.target_template(layout, con) | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         layout.prop(con, "offset") | 
					
						
							|  |  |  |         layout.prop(con, "floor_location", expand=True, text="Min/Max") | 
					
						
							|  |  |  |         layout.prop(con, "use_rotation") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         self.space_template(layout, con) | 
					
						
							| 
									
										
										
										
											2011-02-27 09:21:13 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         self.draw_influence(layout, con) | 
					
						
							| 
									
										
										
										
											2011-02-27 09:21:13 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |     def draw_clamp_to(self, context): | 
					
						
							|  |  |  |         layout = self.layout | 
					
						
							|  |  |  |         con = self.get_constraint(context) | 
					
						
							|  |  |  |         layout.use_property_split = True | 
					
						
							|  |  |  |         layout.use_property_decorate = True | 
					
						
							| 
									
										
										
										
											2011-01-01 07:20:34 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-08-06 15:17:44 +00:00
										 |  |  |         self.target_template(layout, con) | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         layout.prop(con, "main_axis", expand=True) | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-02-27 10:47:32 +00:00
										 |  |  |         layout.prop(con, "use_cyclic") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         self.draw_influence(layout, con) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def draw_transform(self, context): | 
					
						
							|  |  |  |         layout = self.layout | 
					
						
							|  |  |  |         con = self.get_constraint(context) | 
					
						
							|  |  |  |         layout.use_property_split = True | 
					
						
							|  |  |  |         layout.use_property_decorate = True | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-08-06 15:17:44 +00:00
										 |  |  |         self.target_template(layout, con) | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-09-21 15:18:38 +00:00
										 |  |  |         layout.prop(con, "use_motion_extrapolate", text="Extrapolate") | 
					
						
							| 
									
										
										
										
											2009-11-21 00:05:43 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         self.space_template(layout, con) | 
					
						
							| 
									
										
										
										
											2009-11-21 00:05:43 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         self.draw_influence(layout, con) | 
					
						
							| 
									
										
										
										
											2019-09-01 13:19:11 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |     def draw_shrinkwrap(self, context): | 
					
						
							|  |  |  |         layout = self.layout | 
					
						
							|  |  |  |         con = self.get_constraint(context) | 
					
						
							|  |  |  |         layout.use_property_split = True | 
					
						
							|  |  |  |         layout.use_property_decorate = True | 
					
						
							| 
									
										
										
										
											2009-11-21 00:05:43 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         self.target_template(layout, con, False) | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         layout.prop(con, "distance") | 
					
						
							|  |  |  |         layout.prop(con, "shrinkwrap_type", text="Mode") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         layout.separator() | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         if con.shrinkwrap_type == 'PROJECT': | 
					
						
							|  |  |  |             layout.prop(con, "project_axis", expand=True, text="Project Axis") | 
					
						
							|  |  |  |             layout.prop(con, "project_axis_space", text="Space") | 
					
						
							|  |  |  |             layout.prop(con, "project_limit", text="Distance") | 
					
						
							|  |  |  |             layout.prop(con, "use_project_opposite") | 
					
						
							| 
									
										
										
										
											2011-05-20 18:26:44 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |             layout.separator() | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |             col = layout.column() | 
					
						
							|  |  |  |             row = col.row() | 
					
						
							|  |  |  |             row.prop(con, "cull_face", expand=True) | 
					
						
							|  |  |  |             row = col.row() | 
					
						
							|  |  |  |             row.active = con.use_project_opposite and con.cull_face != 'OFF' | 
					
						
							|  |  |  |             row.prop(con, "use_invert_cull") | 
					
						
							| 
									
										
										
										
											2011-05-20 18:26:44 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |             layout.separator() | 
					
						
							| 
									
										
										
										
											2011-05-26 09:33:51 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         if con.shrinkwrap_type in {'PROJECT', 'NEAREST_SURFACE', 'TARGET_PROJECT'}: | 
					
						
							|  |  |  |             layout.prop(con, "wrap_mode", text="Snap Mode") | 
					
						
							|  |  |  |             row = layout.row(heading="Align to Normal", align=True) | 
					
						
							|  |  |  |             row.use_property_decorate = False | 
					
						
							|  |  |  |             sub = row.row(align=True) | 
					
						
							|  |  |  |             sub.prop(con, "use_track_normal", text="") | 
					
						
							|  |  |  |             subsub = sub.row(align=True) | 
					
						
							|  |  |  |             subsub.active = con.use_track_normal | 
					
						
							|  |  |  |             subsub.prop(con, "track_axis", text="") | 
					
						
							|  |  |  |             row.prop_decorator(con, "track_axis") | 
					
						
							| 
									
										
										
										
											2011-05-26 09:33:51 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         self.draw_influence(layout, con) | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |     def draw_damp_track(self, context): | 
					
						
							|  |  |  |         layout = self.layout | 
					
						
							|  |  |  |         con = self.get_constraint(context) | 
					
						
							|  |  |  |         layout.use_property_split = True | 
					
						
							|  |  |  |         layout.use_property_decorate = True | 
					
						
							| 
									
										
										
										
											2019-09-01 13:19:11 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         self.target_template(layout, con) | 
					
						
							| 
									
										
										
										
											2009-11-21 00:05:43 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         layout.prop(con, "track_axis", expand=True) | 
					
						
							| 
									
										
										
										
											2009-11-21 00:05:43 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         self.draw_influence(layout, con) | 
					
						
							| 
									
										
										
										
											2009-11-21 00:05:43 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |     def draw_spline_ik(self, context): | 
					
						
							|  |  |  |         layout = self.layout | 
					
						
							|  |  |  |         con = self.get_constraint(context) | 
					
						
							|  |  |  |         layout.use_property_split = True | 
					
						
							|  |  |  |         layout.use_property_decorate = True | 
					
						
							| 
									
										
										
										
											2009-11-21 00:05:43 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         self.target_template(layout, con) | 
					
						
							| 
									
										
										
										
											2009-11-21 00:05:43 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         self.draw_influence(layout, con) | 
					
						
							| 
									
										
										
										
											2009-11-21 00:05:43 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |     def draw_pivot(self, context): | 
					
						
							|  |  |  |         layout = self.layout | 
					
						
							|  |  |  |         con = self.get_constraint(context) | 
					
						
							|  |  |  |         layout.use_property_split = True | 
					
						
							|  |  |  |         layout.use_property_decorate = True | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         self.target_template(layout, con) | 
					
						
							| 
									
										
										
										
											2019-09-06 11:54:34 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         if con.target: | 
					
						
							|  |  |  |             layout.prop(con, "offset", text="Pivot Offset") | 
					
						
							|  |  |  |         else: | 
					
						
							|  |  |  |             layout.prop(con, "use_relative_location") | 
					
						
							|  |  |  |             if con.use_relative_location: | 
					
						
							|  |  |  |                 layout.prop(con, "offset", text="Pivot Point") | 
					
						
							|  |  |  |             else: | 
					
						
							|  |  |  |                 layout.prop(con, "offset", text="Pivot Point") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         col = layout.column() | 
					
						
							|  |  |  |         col.prop(con, "rotation_range", text="Rotation Range") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         self.draw_influence(layout, con) | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |     def draw_follow_track(self, context): | 
					
						
							|  |  |  |         layout = self.layout | 
					
						
							|  |  |  |         con = self.get_constraint(context) | 
					
						
							|  |  |  |         layout.use_property_split = True | 
					
						
							|  |  |  |         layout.use_property_decorate = True | 
					
						
							| 
									
										
										
										
											2018-07-07 18:39:45 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         clip = None | 
					
						
							|  |  |  |         if con.use_active_clip: | 
					
						
							|  |  |  |             clip = context.scene.active_clip | 
					
						
							|  |  |  |         else: | 
					
						
							|  |  |  |             clip = con.clip | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         layout.prop(con, "use_active_clip") | 
					
						
							|  |  |  |         layout.prop(con, "use_3d_position") | 
					
						
							| 
									
										
										
										
											2018-10-03 19:09:43 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         row = layout.row() | 
					
						
							|  |  |  |         row.active = not con.use_3d_position | 
					
						
							|  |  |  |         row.prop(con, "use_undistorted_position") | 
					
						
							| 
									
										
										
										
											2018-10-03 19:09:43 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         if not con.use_active_clip: | 
					
						
							|  |  |  |             layout.prop(con, "clip") | 
					
						
							| 
									
										
										
										
											2009-11-01 18:07:35 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         layout.prop(con, "frame_method") | 
					
						
							| 
									
										
										
										
											2009-11-03 07:23:02 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         if clip: | 
					
						
							|  |  |  |             tracking = clip.tracking | 
					
						
							| 
									
										
										
										
											2009-11-03 07:23:02 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |             layout.prop_search(con, "object", tracking, "objects", icon='OBJECT_DATA') | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |             tracking_object = tracking.objects.get(con.object, tracking.objects[0]) | 
					
						
							| 
									
										
										
										
											2015-01-13 18:06:53 +13:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |             layout.prop_search(con, "track", tracking_object, "tracks", icon='ANIM_DATA') | 
					
						
							| 
									
										
										
										
											2019-05-07 19:52:10 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         layout.prop(con, "camera") | 
					
						
							| 
									
										
										
										
											2011-12-15 16:10:49 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-11-14 06:41:42 +00:00
										 |  |  |         row = layout.row() | 
					
						
							| 
									
										
										
										
											2012-01-04 17:20:08 +00:00
										 |  |  |         row.active = not con.use_3d_position | 
					
						
							|  |  |  |         row.prop(con, "depth_object") | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-11-07 12:55:18 +00:00
										 |  |  |         layout.operator("clip.constraint_to_fcurve") | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         self.draw_influence(layout, con) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def draw_camera_solver(self, context): | 
					
						
							|  |  |  |         layout = self.layout | 
					
						
							|  |  |  |         con = self.get_constraint(context) | 
					
						
							|  |  |  |         layout.use_property_split = True | 
					
						
							|  |  |  |         layout.use_property_decorate = True | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-11-07 12:55:18 +00:00
										 |  |  |         layout.prop(con, "use_active_clip") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         if not con.use_active_clip: | 
					
						
							|  |  |  |             layout.prop(con, "clip") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         layout.operator("clip.constraint_to_fcurve") | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         self.draw_influence(layout, con) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def draw_object_solver(self, context): | 
					
						
							|  |  |  |         layout = self.layout | 
					
						
							|  |  |  |         con = self.get_constraint(context) | 
					
						
							|  |  |  |         layout.use_property_split = True | 
					
						
							|  |  |  |         layout.use_property_decorate = True | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         clip = None | 
					
						
							|  |  |  |         if con.use_active_clip: | 
					
						
							|  |  |  |             clip = context.scene.active_clip | 
					
						
							|  |  |  |         else: | 
					
						
							|  |  |  |             clip = con.clip | 
					
						
							| 
									
										
										
										
											2011-12-15 16:10:49 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-12-05 18:57:17 +00:00
										 |  |  |         layout.prop(con, "use_active_clip") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         if not con.use_active_clip: | 
					
						
							|  |  |  |             layout.prop(con, "clip") | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-12-15 16:10:49 +00:00
										 |  |  |         if clip: | 
					
						
							|  |  |  |             layout.prop_search(con, "object", clip.tracking, "objects", icon='OBJECT_DATA') | 
					
						
							| 
									
										
										
										
											2011-12-05 18:57:17 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-12-15 20:38:23 +00:00
										 |  |  |         layout.prop(con, "camera") | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-12-15 16:09:57 +00:00
										 |  |  |         row = layout.row() | 
					
						
							|  |  |  |         row.operator("constraint.objectsolver_set_inverse") | 
					
						
							|  |  |  |         row.operator("constraint.objectsolver_clear_inverse") | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-12-05 18:57:17 +00:00
										 |  |  |         layout.operator("clip.constraint_to_fcurve") | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         self.draw_influence(layout, con) | 
					
						
							| 
									
										
										
											
												Basic Alembic support
All in all, this patch adds an Alembic importer, an Alembic exporter,
and a new CacheFile data block which, for now, wraps around an Alembic
archive. This data block is made available through a new modifier ("Mesh
Sequence Cache") as well as a new constraint ("Transform Cache") to
somewhat properly support respectively geometric and transformation data
streaming from alembic caches.
A more in-depth documentation is to be found on the wiki, as well as a
 guide to compile alembic: https://wiki.blender.org/index.php/
User:Kevindietrich/AlembicBasicIo.
Many thanks to everyone involved in this little project, and huge shout
out to "cgstrive" for the thorough testings with Maya, 3ds Max, Houdini
and Realflow as well as @fjuhec, @jensverwiebe and @jasperge for the
custom builds and compile fixes.
Reviewers: sergey, campbellbarton, mont29
Reviewed By: sergey, campbellbarton, mont29
Differential Revision: https://developer.blender.org/D2060
											
										 
											2016-08-06 06:20:37 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |     def draw_transform_cache(self, context): | 
					
						
							|  |  |  |         layout = self.layout | 
					
						
							|  |  |  |         con = self.get_constraint(context) | 
					
						
							|  |  |  |         layout.use_property_split = True | 
					
						
							|  |  |  |         layout.use_property_decorate = True | 
					
						
							| 
									
										
										
										
											2017-07-25 01:27:43 +10:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         layout.template_cache_file(con, "cache_file") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         cache_file = con.cache_file | 
					
						
							| 
									
										
										
										
											2017-07-25 01:27:43 +10:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
											
												Basic Alembic support
All in all, this patch adds an Alembic importer, an Alembic exporter,
and a new CacheFile data block which, for now, wraps around an Alembic
archive. This data block is made available through a new modifier ("Mesh
Sequence Cache") as well as a new constraint ("Transform Cache") to
somewhat properly support respectively geometric and transformation data
streaming from alembic caches.
A more in-depth documentation is to be found on the wiki, as well as a
 guide to compile alembic: https://wiki.blender.org/index.php/
User:Kevindietrich/AlembicBasicIo.
Many thanks to everyone involved in this little project, and huge shout
out to "cgstrive" for the thorough testings with Maya, 3ds Max, Houdini
and Realflow as well as @fjuhec, @jensverwiebe and @jasperge for the
custom builds and compile fixes.
Reviewers: sergey, campbellbarton, mont29
Reviewed By: sergey, campbellbarton, mont29
Differential Revision: https://developer.blender.org/D2060
											
										 
											2016-08-06 06:20:37 +02:00
										 |  |  |         if cache_file is not None: | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |             layout.prop_search(con, "object_path", cache_file, "object_paths") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         self.draw_influence(layout, con) | 
					
						
							| 
									
										
										
											
												Basic Alembic support
All in all, this patch adds an Alembic importer, an Alembic exporter,
and a new CacheFile data block which, for now, wraps around an Alembic
archive. This data block is made available through a new modifier ("Mesh
Sequence Cache") as well as a new constraint ("Transform Cache") to
somewhat properly support respectively geometric and transformation data
streaming from alembic caches.
A more in-depth documentation is to be found on the wiki, as well as a
 guide to compile alembic: https://wiki.blender.org/index.php/
User:Kevindietrich/AlembicBasicIo.
Many thanks to everyone involved in this little project, and huge shout
out to "cgstrive" for the thorough testings with Maya, 3ds Max, Houdini
and Realflow as well as @fjuhec, @jensverwiebe and @jasperge for the
custom builds and compile fixes.
Reviewers: sergey, campbellbarton, mont29
Reviewed By: sergey, campbellbarton, mont29
Differential Revision: https://developer.blender.org/D2060
											
										 
											2016-08-06 06:20:37 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |     def draw_python_constraint(self, context): | 
					
						
							|  |  |  |         layout = self.layout | 
					
						
							| 
									
										
										
										
											2018-08-28 12:34:51 +10:00
										 |  |  |         layout.label(text="Blender 2.6 doesn't support python constraints yet") | 
					
						
							| 
									
										
										
										
											2010-08-21 07:15:11 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |     def draw_armature(self, context): | 
					
						
							|  |  |  |         layout = self.layout | 
					
						
							|  |  |  |         con = self.get_constraint(context) | 
					
						
							|  |  |  |         layout.use_property_split = True | 
					
						
							|  |  |  |         layout.use_property_decorate = True | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         col = layout.column() | 
					
						
							|  |  |  |         col.prop(con, "use_deform_preserve_volume") | 
					
						
							|  |  |  |         col.prop(con, "use_bone_envelopes") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         if context.pose_bone: | 
					
						
							|  |  |  |             col.prop(con, "use_current_location") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         layout.operator("constraint.add_target", text="Add Target Bone") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         layout.operator("constraint.normalize_target_weights") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         self.draw_influence(layout, con) | 
					
						
							| 
									
										
										
										
											2018-07-15 20:39:02 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  |         if not con.targets: | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |             layout.label(text="No target bones added", icon='ERROR') | 
					
						
							| 
									
										
										
										
											2018-07-15 20:39:02 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |     def draw_kinematic(self, context): | 
					
						
							|  |  |  |         layout = self.layout | 
					
						
							|  |  |  |         con = self.get_constraint(context) | 
					
						
							|  |  |  |         layout.use_property_split = True | 
					
						
							|  |  |  |         layout.use_property_decorate = True | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         self.target_template(layout, con) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         if context.object.pose.ik_solver == 'ITASC': | 
					
						
							|  |  |  |             layout.prop(con, "ik_type") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |             layout.prop(con, "pole_target") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |             if con.pole_target and con.pole_target.type == 'ARMATURE': | 
					
						
							|  |  |  |                 layout.prop_search(con, "pole_subtarget", con.pole_target.data, "bones", text="Bone") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |             if con.pole_target: | 
					
						
							|  |  |  |                 row = layout.row() | 
					
						
							|  |  |  |                 row.label() | 
					
						
							|  |  |  |                 row.prop(con, "pole_angle") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |             col = layout.column() | 
					
						
							|  |  |  |             col.prop(con, "use_tail") | 
					
						
							|  |  |  |             col.prop(con, "use_stretch") | 
					
						
							|  |  |  |             col.prop(con, "chain_count") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |             if con.ik_type == 'COPY_POSE': | 
					
						
							|  |  |  |                 layout.prop(con, "reference_axis", expand=True) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |                 col = layout.column() | 
					
						
							|  |  |  |                 col.prop(con, "use_location") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |                 sub = col.column() | 
					
						
							|  |  |  |                 sub.active = con.use_location | 
					
						
							|  |  |  |                 sub.prop(con, "weight", text="Weight", slider=True) | 
					
						
							|  |  |  |                 row = sub.row(heading="Lock") | 
					
						
							|  |  |  |                 row.use_property_decorate = False | 
					
						
							|  |  |  |                 row.prop(con, "lock_location_x", text="X", toggle=True) | 
					
						
							|  |  |  |                 row.prop(con, "lock_location_y", text="Y", toggle=True) | 
					
						
							|  |  |  |                 row.prop(con, "lock_location_z", text="Z", toggle=True) | 
					
						
							|  |  |  |                 row.label(icon='BLANK1') | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |                 col = layout.column() | 
					
						
							|  |  |  |                 col.prop(con, "use_rotation") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |                 sub = col.column() | 
					
						
							|  |  |  |                 sub.active = con.use_rotation | 
					
						
							|  |  |  |                 sub.prop(con, "orient_weight", text="Weight", slider=True) | 
					
						
							|  |  |  |                 row = sub.row(heading="Lock") | 
					
						
							|  |  |  |                 row.use_property_decorate = False | 
					
						
							|  |  |  |                 row.prop(con, "lock_rotation_x", text="X", toggle=True) | 
					
						
							|  |  |  |                 row.prop(con, "lock_rotation_y", text="Y", toggle=True) | 
					
						
							|  |  |  |                 row.prop(con, "lock_rotation_z", text="Z", toggle=True) | 
					
						
							|  |  |  |                 row.label(icon='BLANK1') | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |             elif con.ik_type == 'DISTANCE': | 
					
						
							|  |  |  |                 layout.prop(con, "limit_mode") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |                 col = layout.column() | 
					
						
							|  |  |  |                 col.prop(con, "weight", text="Weight", slider=True) | 
					
						
							|  |  |  |                 col.prop(con, "distance", text="Distance", slider=True) | 
					
						
							|  |  |  |         else: | 
					
						
							|  |  |  |             # Standard IK constraint | 
					
						
							|  |  |  |             layout.prop(con, "pole_target") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |             if con.pole_target and con.pole_target.type == 'ARMATURE': | 
					
						
							|  |  |  |                 layout.prop_search(con, "pole_subtarget", con.pole_target.data, "bones", text="Bone") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |             if con.pole_target: | 
					
						
							|  |  |  |                 row = layout.row() | 
					
						
							|  |  |  |                 row.prop(con, "pole_angle") | 
					
						
							|  |  |  |                 row.label() | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |             col = layout.column() | 
					
						
							|  |  |  |             col.prop(con, "iterations") | 
					
						
							|  |  |  |             col.prop(con, "chain_count") | 
					
						
							|  |  |  |             col.prop(con, "use_tail") | 
					
						
							|  |  |  |             col.prop(con, "use_stretch") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |             col = layout.column() | 
					
						
							|  |  |  |             row = col.row(align=True, heading="Weight Position") | 
					
						
							|  |  |  |             row.prop(con, "use_location", text="") | 
					
						
							|  |  |  |             sub = row.row(align=True) | 
					
						
							|  |  |  |             sub.active = con.use_location | 
					
						
							|  |  |  |             sub.prop(con, "weight", text="", slider=True) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |             row = col.row(align=True, heading="Rotation") | 
					
						
							|  |  |  |             row.prop(con, "use_rotation", text="") | 
					
						
							|  |  |  |             sub = row.row(align=True) | 
					
						
							|  |  |  |             sub.active = con.use_rotation | 
					
						
							|  |  |  |             sub.prop(con, "orient_weight", text="", slider=True) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         self.draw_influence(layout, con) | 
					
						
							| 
									
										
										
										
											2018-07-15 20:39:02 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | # Parent class for constraint subpanels | 
					
						
							|  |  |  | class ConstraintButtonsSubPanel(Panel): | 
					
						
							|  |  |  |     bl_space_type = 'PROPERTIES' | 
					
						
							|  |  |  |     bl_region_type = 'WINDOW' | 
					
						
							|  |  |  |     bl_label = "" | 
					
						
							|  |  |  |     bl_options = {'DRAW_BOX'} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def get_constraint(self, context): | 
					
						
							|  |  |  |         con = None | 
					
						
							|  |  |  |         if context.pose_bone: | 
					
						
							|  |  |  |             con = context.pose_bone.constraints[self.list_panel_index] | 
					
						
							|  |  |  |         else: | 
					
						
							| 
									
										
										
										
											2020-06-19 16:07:20 -04:00
										 |  |  |             con = context.object.constraints[self.list_panel_index] | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         self.layout.context_pointer_set("constraint", con) | 
					
						
							|  |  |  |         return con | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def draw_transform_source(self, context): | 
					
						
							|  |  |  |         layout = self.layout | 
					
						
							|  |  |  |         con = self.get_constraint(context) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         layout.prop(con, "map_from", expand=True) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         layout.use_property_split = True | 
					
						
							|  |  |  |         layout.use_property_decorate = True | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         if con.map_from == 'ROTATION': | 
					
						
							|  |  |  |             layout.prop(con, "from_rotation_mode", text="Mode") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         ext = "" if con.map_from == 'LOCATION' else "_rot" if con.map_from == 'ROTATION' else "_scale" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         col = layout.column(align=True) | 
					
						
							|  |  |  |         col.prop(con, "from_min_x" + ext, text="X Min") | 
					
						
							|  |  |  |         col.prop(con, "from_max_x" + ext, text="Max") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         col = layout.column(align=True) | 
					
						
							|  |  |  |         col.prop(con, "from_min_y" + ext, text="Y Min") | 
					
						
							|  |  |  |         col.prop(con, "from_max_y" + ext, text="Max") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         col = layout.column(align=True) | 
					
						
							|  |  |  |         col.prop(con, "from_min_z" + ext, text="Z Min") | 
					
						
							|  |  |  |         col.prop(con, "from_max_z" + ext, text="Max") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def draw_transform_mapping(self, context): | 
					
						
							|  |  |  |         layout = self.layout | 
					
						
							|  |  |  |         con = self.get_constraint(context) | 
					
						
							|  |  |  |         layout.use_property_split = True | 
					
						
							|  |  |  |         layout.use_property_decorate = True | 
					
						
							|  |  |  |          | 
					
						
							|  |  |  |         layout.prop(con, "map_to_x_from", expand=False, text="Source Axis X") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         layout.prop(con, "map_to_y_from", expand=False, text="Y") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         layout.prop(con, "map_to_z_from", expand=False, text="Z") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def draw_transform_destination(self, context): | 
					
						
							|  |  |  |         layout = self.layout | 
					
						
							|  |  |  |         con = self.get_constraint(context) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         layout.prop(con, "map_to", expand=True) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         layout.use_property_split = True | 
					
						
							|  |  |  |         layout.use_property_decorate = True | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         if con.map_to == 'ROTATION': | 
					
						
							|  |  |  |             layout.prop(con, "to_euler_order", text="Order") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         ext = "" if con.map_to == 'LOCATION' else "_rot" if con.map_to == 'ROTATION' else "_scale" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         col = layout.column(align=True) | 
					
						
							|  |  |  |         col.prop(con, "to_min_x" + ext, text="X Min") | 
					
						
							|  |  |  |         col.prop(con, "to_max_x" + ext, text="Max") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         col = layout.column(align=True) | 
					
						
							|  |  |  |         col.prop(con, "to_min_y" + ext, text="Y Min") | 
					
						
							|  |  |  |         col.prop(con, "to_max_y" + ext, text="Max") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         col = layout.column(align=True) | 
					
						
							|  |  |  |         col.prop(con, "to_min_z" + ext, text="Z Min") | 
					
						
							|  |  |  |         col.prop(con, "to_max_z" + ext, text="Max")       | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         layout.prop(con, "mix_mode" + ext, text="Mix") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def draw_armature_bones(self, context): | 
					
						
							|  |  |  |         layout = self.layout | 
					
						
							|  |  |  |         con = self.get_constraint(context) | 
					
						
							|  |  |  |         layout.use_property_split = True | 
					
						
							|  |  |  |         layout.use_property_decorate = True | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         for i, tgt in enumerate(con.targets): | 
					
						
							| 
									
										
										
										
											2018-07-15 20:39:02 +03:00
										 |  |  |             has_target = tgt.target is not None | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |             box = layout.box() | 
					
						
							| 
									
										
										
										
											2018-07-15 20:39:02 +03:00
										 |  |  |             header = box.row() | 
					
						
							|  |  |  |             header.use_property_split = False | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |             split = header.split(factor=0.45, align=True) | 
					
						
							|  |  |  |             split.prop(tgt, "target", text="") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |             row = split.row(align=True) | 
					
						
							|  |  |  |             row.active = has_target | 
					
						
							|  |  |  |             if has_target: | 
					
						
							|  |  |  |                 row.prop_search(tgt, "subtarget", tgt.target.data, "bones", text="") | 
					
						
							|  |  |  |             else: | 
					
						
							| 
									
										
										
										
											2018-11-23 13:55:33 +11:00
										 |  |  |                 row.prop(tgt, "subtarget", text="", icon='BONE_DATA') | 
					
						
							| 
									
										
										
										
											2018-07-15 20:39:02 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |             header.operator("constraint.remove_target", text="", icon='X').index = i | 
					
						
							| 
									
										
										
										
											2018-07-15 20:39:02 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |             row = box.row() | 
					
						
							|  |  |  |             row.active = has_target and tgt.subtarget != "" | 
					
						
							|  |  |  |             row.prop(tgt, "weight", slider=True, text="Weight") | 
					
						
							| 
									
										
										
										
											2018-07-15 20:39:02 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |     def draw_spline_ik_fitting(self, context): | 
					
						
							|  |  |  |         layout = self.layout | 
					
						
							|  |  |  |         con = self.get_constraint(context) | 
					
						
							|  |  |  |         layout.use_property_split = True | 
					
						
							|  |  |  |         layout.use_property_decorate = True | 
					
						
							| 
									
										
										
										
											2018-07-15 20:39:02 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         col = layout.column() | 
					
						
							|  |  |  |         col.prop(con, "chain_count") | 
					
						
							|  |  |  |         col.prop(con, "use_even_divisions") | 
					
						
							|  |  |  |         col.prop(con, "use_chain_offset") | 
					
						
							| 
									
										
										
										
											2018-07-15 20:39:02 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |     def draw_spline_ik_chain_scaling(self, context): | 
					
						
							|  |  |  |         layout = self.layout | 
					
						
							|  |  |  |         con = self.get_constraint(context) | 
					
						
							|  |  |  |         layout.use_property_split = True | 
					
						
							|  |  |  |         layout.use_property_decorate = True | 
					
						
							| 
									
										
										
										
											2010-08-21 07:15:11 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         layout.prop(con, "use_curve_radius") | 
					
						
							| 
									
										
										
										
											2009-05-28 23:45:50 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         layout.prop(con, "y_scale_mode") | 
					
						
							|  |  |  |         layout.prop(con, "xz_scale_mode") | 
					
						
							| 
									
										
										
										
											2009-05-28 23:45:50 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         if con.xz_scale_mode in {'INVERSE_PRESERVE', 'VOLUME_PRESERVE'}: | 
					
						
							|  |  |  |             layout.prop(con, "use_original_scale") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         if con.xz_scale_mode == 'VOLUME_PRESERVE': | 
					
						
							|  |  |  |             col = layout.column() | 
					
						
							|  |  |  |             col.prop(con, "bulge", text="Volume Variation") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |             row = col.row(heading="Volume Min") | 
					
						
							|  |  |  |             row.prop(con, "use_bulge_min", text="") | 
					
						
							|  |  |  |             sub = row.row() | 
					
						
							|  |  |  |             sub.active = con.use_bulge_min | 
					
						
							|  |  |  |             sub.prop(con, "bulge_min", text="") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |             row = col.row(heading="Max") | 
					
						
							|  |  |  |             row.prop(con, "use_bulge_max", text="") | 
					
						
							|  |  |  |             sub = row.row() | 
					
						
							|  |  |  |             sub.active = con.use_bulge_max | 
					
						
							|  |  |  |             sub.prop(con, "bulge_max", text="") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |             row = layout.row() | 
					
						
							|  |  |  |             row.active = con.use_bulge_min or con.use_bulge_max | 
					
						
							|  |  |  |             row.prop(con, "bulge_smooth", text="Smooth") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def draw_action_target(self, context): | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  |         layout = self.layout | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         con = self.get_constraint(context) | 
					
						
							|  |  |  |         layout.use_property_split = True | 
					
						
							|  |  |  |         layout.use_property_decorate = True | 
					
						
							| 
									
										
										
										
											2010-01-30 08:45:31 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         layout.prop(con, "transform_channel", text="Channel") | 
					
						
							|  |  |  |         layout.prop(con, "target_space") | 
					
						
							| 
									
										
										
										
											2011-01-03 16:22:30 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         col = layout.column(align=True) | 
					
						
							|  |  |  |         col.prop(con, "min", text="Range Min") | 
					
						
							|  |  |  |         col.prop(con, "max", text="Max") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-05-28 23:45:50 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |     def draw_action_action(self, context): | 
					
						
							|  |  |  |         layout = self.layout | 
					
						
							|  |  |  |         con = self.get_constraint(context) | 
					
						
							|  |  |  |         layout.use_property_split = True | 
					
						
							|  |  |  |         layout.use_property_decorate = True | 
					
						
							| 
									
										
										
										
											2009-12-14 20:56:19 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         layout.prop(con, "action") | 
					
						
							|  |  |  |         layout.prop(con, "use_bone_object_action") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         col = layout.column(align=True) | 
					
						
							|  |  |  |         col.prop(con, "frame_start", text="Frame Start") | 
					
						
							|  |  |  |         col.prop(con, "frame_end", text="End") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  | # Child Of Constraint | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class OBJECT_PT_bChildOfConstraint(ObjectConstraintPanel, ConstraintButtonsPanel): | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  |     def draw(self, context): | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |         self.draw_childof(context) | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  | class BONE_PT_bChildOfConstraint(BoneConstraintPanel, ConstraintButtonsPanel): | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         self.draw_childof(context) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # Track To Constraint | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class OBJECT_PT_bTrackToConstraint(ObjectConstraintPanel, ConstraintButtonsPanel): | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         self.draw_trackto(context) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class BONE_PT_bTrackToConstraint(BoneConstraintPanel, ConstraintButtonsPanel): | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         self.draw_trackto(context) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # Follow Path Constraint | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class OBJECT_PT_bFollowPathConstraint(ObjectConstraintPanel, ConstraintButtonsPanel): | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         self.draw_follow_path(context) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class BONE_PT_bFollowPathConstraint(BoneConstraintPanel, ConstraintButtonsPanel): | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         self.draw_follow_path(context) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # Roation Limit Constraint | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class OBJECT_PT_bRotLimitConstraint(ObjectConstraintPanel, ConstraintButtonsPanel): | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         self.draw_rot_limit(context) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class BONE_PT_bRotLimitConstraint(BoneConstraintPanel, ConstraintButtonsPanel): | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         self.draw_rot_limit(context) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # Location Limit Constraint | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class OBJECT_PT_bLocLimitConstraint(ObjectConstraintPanel, ConstraintButtonsPanel): | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         self.draw_loc_limit(context) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class BONE_PT_bLocLimitConstraint(BoneConstraintPanel, ConstraintButtonsPanel): | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         self.draw_loc_limit(context) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # Size Limit Constraint | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class OBJECT_PT_bSizeLimitConstraint(ObjectConstraintPanel, ConstraintButtonsPanel): | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         self.draw_size_limit(context) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class BONE_PT_bSizeLimitConstraint(BoneConstraintPanel, ConstraintButtonsPanel): | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         self.draw_size_limit(context) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # Rotate Like Constraint | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class OBJECT_PT_bRotateLikeConstraint(ObjectConstraintPanel, ConstraintButtonsPanel): | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         self.draw_rotate_like(context) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class BONE_PT_bRotateLikeConstraint(BoneConstraintPanel, ConstraintButtonsPanel): | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         self.draw_rotate_like(context) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # Locate Like Constraint | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class OBJECT_PT_bLocateLikeConstraint(ObjectConstraintPanel, ConstraintButtonsPanel): | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         self.draw_locate_like(context) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class BONE_PT_bLocateLikeConstraint(BoneConstraintPanel, ConstraintButtonsPanel): | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         self.draw_locate_like(context) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # Size Like Constraint | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class OBJECT_PT_bSizeLikeConstraint(ObjectConstraintPanel, ConstraintButtonsPanel): | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         self.draw_size_like(context) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class BONE_PT_bSizeLikeConstraint(BoneConstraintPanel, ConstraintButtonsPanel): | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         self.draw_size_like(context) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # Same Volume Constraint | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class OBJECT_PT_bSameVolumeConstraint(ObjectConstraintPanel, ConstraintButtonsPanel): | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         self.draw_same_volume(context) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class BONE_PT_bSameVolumeConstraint(BoneConstraintPanel, ConstraintButtonsPanel): | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         self.draw_same_volume(context) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # Trans Like Constraint | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class OBJECT_PT_bTransLikeConstraint(ObjectConstraintPanel, ConstraintButtonsPanel): | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         self.draw_trans_like(context) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class BONE_PT_bTransLikeConstraint(BoneConstraintPanel, ConstraintButtonsPanel): | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         self.draw_trans_like(context) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # Action Constraint | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class OBJECT_PT_bActionConstraint(ObjectConstraintPanel, ConstraintButtonsPanel): | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         self.draw_action(context) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class BONE_PT_bActionConstraint(BoneConstraintPanel, ConstraintButtonsPanel): | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         self.draw_action(context) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class OBJECT_PT_bActionConstraint_target(ObjectConstraintPanel, ConstraintButtonsSubPanel): | 
					
						
							|  |  |  |     bl_parent_id = "OBJECT_PT_bActionConstraint" | 
					
						
							|  |  |  |     bl_label = "Target" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         self.draw_action_target(context) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class BONE_PT_bActionConstraint_target(BoneConstraintPanel, ConstraintButtonsSubPanel): | 
					
						
							|  |  |  |     bl_parent_id = "BONE_PT_bActionConstraint" | 
					
						
							|  |  |  |     bl_label = "Target" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         self.draw_action_target(context) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class OBJECT_PT_bActionConstraint_action(ObjectConstraintPanel, ConstraintButtonsSubPanel): | 
					
						
							|  |  |  |     bl_parent_id = "OBJECT_PT_bActionConstraint" | 
					
						
							|  |  |  |     bl_label = "Action" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         self.draw_action_action(context) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class BONE_PT_bActionConstraint_action(BoneConstraintPanel, ConstraintButtonsSubPanel): | 
					
						
							|  |  |  |     bl_parent_id = "BONE_PT_bActionConstraint" | 
					
						
							|  |  |  |     bl_label = "Action" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         self.draw_action_action(context) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # Lock Track Constraint | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class OBJECT_PT_bLockTrackConstraint(ObjectConstraintPanel, ConstraintButtonsPanel): | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         self.draw_lock_track(context) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class BONE_PT_bLockTrackConstraint(BoneConstraintPanel, ConstraintButtonsPanel): | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         self.draw_lock_track(context) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # Disance Limit Constraint | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class OBJECT_PT_bDistLimitConstraint(ObjectConstraintPanel, ConstraintButtonsPanel): | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         self.draw_dist_limit(context) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class BONE_PT_bDistLimitConstraint(BoneConstraintPanel, ConstraintButtonsPanel): | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         self.draw_dist_limit(context) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # Stretch To Constraint | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class OBJECT_PT_bStretchToConstraint(ObjectConstraintPanel, ConstraintButtonsPanel): | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         self.draw_stretch_to(context) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class BONE_PT_bStretchToConstraint(BoneConstraintPanel, ConstraintButtonsPanel): | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         self.draw_stretch_to(context) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # Min Max Constraint | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class OBJECT_PT_bMinMaxConstraint(ObjectConstraintPanel, ConstraintButtonsPanel): | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         self.draw_min_max(context) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class BONE_PT_bMinMaxConstraint(BoneConstraintPanel, ConstraintButtonsPanel): | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         self.draw_min_max(context) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # Clamp To Constraint | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class OBJECT_PT_bClampToConstraint(ObjectConstraintPanel, ConstraintButtonsPanel): | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         self.draw_clamp_to(context) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class BONE_PT_bClampToConstraint(BoneConstraintPanel, ConstraintButtonsPanel): | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         self.draw_clamp_to(context) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # Transform Constraint | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class OBJECT_PT_bTransformConstraint(ObjectConstraintPanel, ConstraintButtonsPanel): | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         self.draw_transform(context) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class BONE_PT_bTransformConstraint(BoneConstraintPanel, ConstraintButtonsPanel): | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         self.draw_transform(context) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class OBJECT_PT_bTransformConstraint_source(ObjectConstraintPanel, ConstraintButtonsSubPanel): | 
					
						
							|  |  |  |     bl_parent_id = "OBJECT_PT_bTransformConstraint" | 
					
						
							|  |  |  |     bl_label = "Source" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         self.draw_transform_source(context) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class BONE_PT_bTransformConstraint_source(BoneConstraintPanel, ConstraintButtonsSubPanel): | 
					
						
							|  |  |  |     bl_parent_id = "BONE_PT_bTransformConstraint" | 
					
						
							|  |  |  |     bl_label = "Source" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         self.draw_transform_source(context) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class OBJECT_PT_bTransformConstraint_mapping(ObjectConstraintPanel, ConstraintButtonsSubPanel): | 
					
						
							|  |  |  |     bl_parent_id = "OBJECT_PT_bTransformConstraint" | 
					
						
							|  |  |  |     bl_label = "Mapping" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         self.draw_transform_mapping(context) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class BONE_PT_bTransformConstraint_mapping(BoneConstraintPanel, ConstraintButtonsSubPanel): | 
					
						
							|  |  |  |     bl_parent_id = "BONE_PT_bTransformConstraint" | 
					
						
							|  |  |  |     bl_label = "Mapping" | 
					
						
							|  |  |  |      | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         self.draw_transform_mapping(context) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |    | 
					
						
							|  |  |  | class OBJECT_PT_bTransformConstraint_destination(ObjectConstraintPanel, ConstraintButtonsSubPanel): | 
					
						
							|  |  |  |     bl_parent_id = "OBJECT_PT_bTransformConstraint" | 
					
						
							|  |  |  |     bl_label = "Destination" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         self.draw_transform_destination(context) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class BONE_PT_bTransformConstraint_destination(BoneConstraintPanel, ConstraintButtonsSubPanel): | 
					
						
							|  |  |  |     bl_parent_id = "BONE_PT_bTransformConstraint" | 
					
						
							|  |  |  |     bl_label = "Destination" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         self.draw_transform_destination(context) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # Shrinkwrap Constraint | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class OBJECT_PT_bShrinkwrapConstraint(ObjectConstraintPanel, ConstraintButtonsPanel): | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         self.draw_shrinkwrap(context) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class BONE_PT_bShrinkwrapConstraint(BoneConstraintPanel, ConstraintButtonsPanel): | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         self.draw_shrinkwrap(context) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # Damp Track Constraint | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class OBJECT_PT_bDampTrackConstraint(ObjectConstraintPanel, ConstraintButtonsPanel): | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         self.draw_damp_track(context) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class BONE_PT_bDampTrackConstraint(BoneConstraintPanel, ConstraintButtonsPanel): | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         self.draw_damp_track(context) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # Spline IK Constraint | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class BONE_PT_bSplineIKConstraint(BoneConstraintPanel, ConstraintButtonsPanel): | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         self.draw_spline_ik(context) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class BONE_PT_bSplineIKConstraint_fitting(BoneConstraintPanel, ConstraintButtonsSubPanel): | 
					
						
							|  |  |  |     bl_parent_id = "BONE_PT_bSplineIKConstraint" | 
					
						
							|  |  |  |     bl_label = "Fitting" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         self.draw_spline_ik_fitting(context) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class BONE_PT_bSplineIKConstraint_chain_scaling(BoneConstraintPanel, ConstraintButtonsSubPanel): | 
					
						
							|  |  |  |     bl_parent_id = "BONE_PT_bSplineIKConstraint" | 
					
						
							|  |  |  |     bl_label = "Chain Scaling" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         self.draw_spline_ik_chain_scaling(context) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # Pivot Constraint | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class OBJECT_PT_bPivotConstraint(ObjectConstraintPanel, ConstraintButtonsPanel): | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         self.draw_pivot(context) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class BONE_PT_bPivotConstraint(BoneConstraintPanel, ConstraintButtonsPanel): | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         self.draw_pivot(context) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # Follow Track Constraint | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class OBJECT_PT_bFollowTrackConstraint(ObjectConstraintPanel, ConstraintButtonsPanel): | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         self.draw_follow_track(context) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class BONE_PT_bFollowTrackConstraint(BoneConstraintPanel, ConstraintButtonsPanel): | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         self.draw_follow_track(context) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # Camera Solver Constraint | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class OBJECT_PT_bCameraSolverConstraint(ObjectConstraintPanel, ConstraintButtonsPanel): | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         self.draw_camera_solver(context) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class BONE_PT_bCameraSolverConstraint(BoneConstraintPanel, ConstraintButtonsPanel): | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         self.draw_camera_solver(context) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # Object Solver Constraint | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class OBJECT_PT_bObjectSolverConstraint(ObjectConstraintPanel, ConstraintButtonsPanel): | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         self.draw_object_solver(context) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class BONE_PT_bObjectSolverConstraint(BoneConstraintPanel, ConstraintButtonsPanel): | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         self.draw_object_solver(context) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # Transform Cache Constraint | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class OBJECT_PT_bTransformCacheConstraint(ObjectConstraintPanel, ConstraintButtonsPanel): | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         self.draw_transform_cache(context) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class BONE_PT_bTransformCacheConstraint(BoneConstraintPanel, ConstraintButtonsPanel): | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         self.draw_transform_cache(context) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # Python Constraint | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class OBJECT_PT_bPythonConstraint(ObjectConstraintPanel, ConstraintButtonsPanel): | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         self.draw_python_constraint(context) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class BONE_PT_bPythonConstraint(BoneConstraintPanel, ConstraintButtonsPanel): | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         self.draw_python_constraint(context) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # Armature Constraint | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class OBJECT_PT_bArmatureConstraint(ObjectConstraintPanel, ConstraintButtonsPanel): | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         self.draw_armature(context) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class BONE_PT_bArmatureConstraint(BoneConstraintPanel, ConstraintButtonsPanel): | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         self.draw_armature(context) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class OBJECT_PT_bArmatureConstraint_bones(ObjectConstraintPanel, ConstraintButtonsSubPanel): | 
					
						
							|  |  |  |     bl_parent_id = "OBJECT_PT_bArmatureConstraint" | 
					
						
							|  |  |  |     bl_label = "Bones" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         self.draw_armature_bones(context) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class BONE_PT_bArmatureConstraint_bones(BoneConstraintPanel, ConstraintButtonsSubPanel): | 
					
						
							|  |  |  |     bl_parent_id = "BONE_PT_bArmatureConstraint" | 
					
						
							|  |  |  |     bl_label = "Bones" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         self.draw_armature_bones(context) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # Inverse Kinematic Constraint | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class OBJECT_PT_bKinematicConstraint(ObjectConstraintPanel, ConstraintButtonsPanel): | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         self.draw_kinematic(context) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class BONE_PT_bKinematicConstraint(BoneConstraintPanel, ConstraintButtonsPanel): | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         self.draw_kinematic(context) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-04-04 10:13:04 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-06-05 16:32:11 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-03-18 20:03:24 +11:00
										 |  |  | classes = ( | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |     # Object Panels | 
					
						
							| 
									
										
										
										
											2017-03-18 20:03:24 +11:00
										 |  |  |     OBJECT_PT_constraints, | 
					
						
							| 
									
										
										
										
											2017-03-20 02:34:32 +11:00
										 |  |  |     BONE_PT_constraints, | 
					
						
							| 
									
										
										
										
											2020-06-19 12:40:48 -04:00
										 |  |  |     OBJECT_PT_bChildOfConstraint, | 
					
						
							|  |  |  |     OBJECT_PT_bTrackToConstraint, | 
					
						
							|  |  |  |     OBJECT_PT_bKinematicConstraint, | 
					
						
							|  |  |  |     OBJECT_PT_bFollowPathConstraint, | 
					
						
							|  |  |  |     OBJECT_PT_bRotLimitConstraint, | 
					
						
							|  |  |  |     OBJECT_PT_bLocLimitConstraint, | 
					
						
							|  |  |  |     OBJECT_PT_bSizeLimitConstraint, | 
					
						
							|  |  |  |     OBJECT_PT_bRotateLikeConstraint, | 
					
						
							|  |  |  |     OBJECT_PT_bLocateLikeConstraint, | 
					
						
							|  |  |  |     OBJECT_PT_bSizeLikeConstraint, | 
					
						
							|  |  |  |     OBJECT_PT_bSameVolumeConstraint, | 
					
						
							|  |  |  |     OBJECT_PT_bTransLikeConstraint, | 
					
						
							|  |  |  |     OBJECT_PT_bActionConstraint, | 
					
						
							|  |  |  |     OBJECT_PT_bActionConstraint_target, | 
					
						
							|  |  |  |     OBJECT_PT_bActionConstraint_action, | 
					
						
							|  |  |  |     OBJECT_PT_bLockTrackConstraint, | 
					
						
							|  |  |  |     OBJECT_PT_bDistLimitConstraint, | 
					
						
							|  |  |  |     OBJECT_PT_bStretchToConstraint, | 
					
						
							|  |  |  |     OBJECT_PT_bMinMaxConstraint, | 
					
						
							|  |  |  |     OBJECT_PT_bClampToConstraint, | 
					
						
							|  |  |  |     OBJECT_PT_bTransformConstraint, | 
					
						
							|  |  |  |     OBJECT_PT_bTransformConstraint_source, | 
					
						
							|  |  |  |     OBJECT_PT_bTransformConstraint_mapping, | 
					
						
							|  |  |  |     OBJECT_PT_bTransformConstraint_destination, | 
					
						
							|  |  |  |     OBJECT_PT_bShrinkwrapConstraint, | 
					
						
							|  |  |  |     OBJECT_PT_bDampTrackConstraint, | 
					
						
							|  |  |  |     OBJECT_PT_bPivotConstraint, | 
					
						
							|  |  |  |     OBJECT_PT_bFollowTrackConstraint, | 
					
						
							|  |  |  |     OBJECT_PT_bCameraSolverConstraint, | 
					
						
							|  |  |  |     OBJECT_PT_bObjectSolverConstraint, | 
					
						
							|  |  |  |     OBJECT_PT_bTransformCacheConstraint, | 
					
						
							|  |  |  |     OBJECT_PT_bPythonConstraint, | 
					
						
							|  |  |  |     OBJECT_PT_bArmatureConstraint, | 
					
						
							|  |  |  |     OBJECT_PT_bArmatureConstraint_bones, | 
					
						
							|  |  |  |     # Bone panels | 
					
						
							|  |  |  |     BONE_PT_bChildOfConstraint, | 
					
						
							|  |  |  |     BONE_PT_bTrackToConstraint, | 
					
						
							|  |  |  |     BONE_PT_bKinematicConstraint, | 
					
						
							|  |  |  |     BONE_PT_bFollowPathConstraint, | 
					
						
							|  |  |  |     BONE_PT_bRotLimitConstraint, | 
					
						
							|  |  |  |     BONE_PT_bLocLimitConstraint, | 
					
						
							|  |  |  |     BONE_PT_bSizeLimitConstraint, | 
					
						
							|  |  |  |     BONE_PT_bRotateLikeConstraint, | 
					
						
							|  |  |  |     BONE_PT_bLocateLikeConstraint, | 
					
						
							|  |  |  |     BONE_PT_bSizeLikeConstraint, | 
					
						
							|  |  |  |     BONE_PT_bSameVolumeConstraint, | 
					
						
							|  |  |  |     BONE_PT_bTransLikeConstraint, | 
					
						
							|  |  |  |     BONE_PT_bActionConstraint, | 
					
						
							|  |  |  |     BONE_PT_bActionConstraint_target, | 
					
						
							|  |  |  |     BONE_PT_bActionConstraint_action, | 
					
						
							|  |  |  |     BONE_PT_bLockTrackConstraint, | 
					
						
							|  |  |  |     BONE_PT_bDistLimitConstraint, | 
					
						
							|  |  |  |     BONE_PT_bStretchToConstraint, | 
					
						
							|  |  |  |     BONE_PT_bMinMaxConstraint, | 
					
						
							|  |  |  |     BONE_PT_bClampToConstraint, | 
					
						
							|  |  |  |     BONE_PT_bTransformConstraint, | 
					
						
							|  |  |  |     BONE_PT_bTransformConstraint_source, | 
					
						
							|  |  |  |     BONE_PT_bTransformConstraint_mapping, | 
					
						
							|  |  |  |     BONE_PT_bTransformConstraint_destination, | 
					
						
							|  |  |  |     BONE_PT_bShrinkwrapConstraint, | 
					
						
							|  |  |  |     BONE_PT_bDampTrackConstraint, | 
					
						
							|  |  |  |     BONE_PT_bSplineIKConstraint, | 
					
						
							|  |  |  |     BONE_PT_bSplineIKConstraint_fitting, | 
					
						
							|  |  |  |     BONE_PT_bSplineIKConstraint_chain_scaling, | 
					
						
							|  |  |  |     BONE_PT_bPivotConstraint, | 
					
						
							|  |  |  |     BONE_PT_bFollowTrackConstraint, | 
					
						
							|  |  |  |     BONE_PT_bCameraSolverConstraint, | 
					
						
							|  |  |  |     BONE_PT_bObjectSolverConstraint, | 
					
						
							|  |  |  |     BONE_PT_bTransformCacheConstraint, | 
					
						
							|  |  |  |     BONE_PT_bPythonConstraint, | 
					
						
							|  |  |  |     BONE_PT_bArmatureConstraint, | 
					
						
							|  |  |  |     BONE_PT_bArmatureConstraint_bones, | 
					
						
							| 
									
										
										
										
											2017-03-18 20:03:24 +11:00
										 |  |  | ) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-04-04 10:13:04 +00:00
										 |  |  | if __name__ == "__main__":  # only for live edit. | 
					
						
							| 
									
										
										
										
											2017-03-18 20:03:24 +11:00
										 |  |  |     from bpy.utils import register_class | 
					
						
							|  |  |  |     for cls in classes: | 
					
						
							|  |  |  |         register_class(cls) |