[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [55183] trunk/blender/release/scripts/ startup/bl_ui: Renaming "properties_object_constraint.py" to " properties_constraint.py"

Joshua Leung aligorith at gmail.com
Mon Mar 11 02:59:48 CET 2013


Revision: 55183
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=55183
Author:   aligorith
Date:     2013-03-11 01:59:48 +0000 (Mon, 11 Mar 2013)
Log Message:
-----------
Renaming "properties_object_constraint.py" to "properties_constraint.py"

The code in this file is NOT restricted to use in object context only. Renaming
it makes it easier to find this file (taking in account name truncations).

Modified Paths:
--------------
    trunk/blender/release/scripts/startup/bl_ui/__init__.py

Added Paths:
-----------
    trunk/blender/release/scripts/startup/bl_ui/properties_constraint.py

Removed Paths:
-------------
    trunk/blender/release/scripts/startup/bl_ui/properties_object_constraint.py

Modified: trunk/blender/release/scripts/startup/bl_ui/__init__.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_ui/__init__.py	2013-03-11 01:53:21 UTC (rev 55182)
+++ trunk/blender/release/scripts/startup/bl_ui/__init__.py	2013-03-11 01:59:48 UTC (rev 55183)
@@ -26,6 +26,7 @@
         _reload(val)
 _modules = (
     "properties_animviz",
+    "properties_constraint",
     "properties_data_armature",
     "properties_data_bone",
     "properties_data_camera",
@@ -40,7 +41,6 @@
     "properties_game",
     "properties_mask_common",
     "properties_material",
-    "properties_object_constraint",
     "properties_object",
     "properties_particle",
     "properties_physics_cloth",

Copied: trunk/blender/release/scripts/startup/bl_ui/properties_constraint.py (from rev 55182, trunk/blender/release/scripts/startup/bl_ui/properties_object_constraint.py)
===================================================================
--- trunk/blender/release/scripts/startup/bl_ui/properties_constraint.py	                        (rev 0)
+++ trunk/blender/release/scripts/startup/bl_ui/properties_constraint.py	2013-03-11 01:59:48 UTC (rev 55183)
@@ -0,0 +1,885 @@
+# ##### 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.
+#
+#  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.
+#
+#  You should have received a copy of the GNU General Public License
+#  along with this program; if not, write to the Free Software Foundation,
+#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# ##### END GPL LICENSE BLOCK #####
+
+# <pep8 compliant>
+import bpy
+from bpy.types import Panel
+
+
+class ConstraintButtonsPanel():
+    bl_space_type = 'PROPERTIES'
+    bl_region_type = 'WINDOW'
+    bl_context = "constraint"
+
+    def draw_constraint(self, context, con):
+        layout = self.layout
+
+        box = layout.template_constraint(con)
+
+        if box:
+            # match enum type to our functions, avoids a lookup table.
+            getattr(self, con.type)(context, box, con)
+
+            if con.type not in {'RIGID_BODY_JOINT', 'NULL'}:
+                box.prop(con, "influence")
+
+    def space_template(self, layout, con, target=True, owner=True):
+        if target or owner:
+
+            split = layout.split(percentage=0.2)
+
+            split.label(text="Space:")
+            row = split.row()
+
+            if target:
+                row.prop(con, "target_space", text="")
+
+            if target and owner:
+                row.label(icon='ARROW_LEFTRIGHT')
+
+            if owner:
+                row.prop(con, "owner_space", text="")
+
+    def target_template(self, layout, con, subtargets=True):
+        layout.prop(con, "target")  # XXX limiting settings for only 'curves' or some type of object
+
+        if con.target and subtargets:
+            if con.target.type == 'ARMATURE':
+                layout.prop_search(con, "subtarget", con.target.data, "bones", text="Bone")
+
+                if hasattr(con, "head_tail"):
+                    row = layout.row()
+                    row.label(text="Head/Tail:")
+                    row.prop(con, "head_tail", text="")
+            elif con.target.type in {'MESH', 'LATTICE'}:
+                layout.prop_search(con, "subtarget", con.target, "vertex_groups", text="Vertex Group")
+
+    def ik_template(self, layout, con):
+        # only used for iTaSC
+        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")
+
+        split = layout.split(percentage=0.33)
+        col = split.column()
+        col.prop(con, "use_tail")
+        col.prop(con, "use_stretch")
+
+        col = split.column()
+        col.prop(con, "chain_count")
+
+    def CHILD_OF(self, context, layout, con):
+        self.target_template(layout, con)
+
+        split = layout.split()
+
+        col = split.column()
+        col.label(text="Location:")
+        col.prop(con, "use_location_x", text="X")
+        col.prop(con, "use_location_y", text="Y")
+        col.prop(con, "use_location_z", text="Z")
+
+        col = split.column()
+        col.label(text="Rotation:")
+        col.prop(con, "use_rotation_x", text="X")
+        col.prop(con, "use_rotation_y", text="Y")
+        col.prop(con, "use_rotation_z", text="Z")
+
+        col = split.column()
+        col.label(text="Scale:")
+        col.prop(con, "use_scale_x", text="X")
+        col.prop(con, "use_scale_y", text="Y")
+        col.prop(con, "use_scale_z", text="Z")
+
+        row = layout.row()
+        row.operator("constraint.childof_set_inverse")
+        row.operator("constraint.childof_clear_inverse")
+
+    def TRACK_TO(self, context, layout, con):
+        self.target_template(layout, con)
+
+        row = layout.row()
+        row.label(text="To:")
+        row.prop(con, "track_axis", expand=True)
+
+        row = layout.row()
+        row.prop(con, "up_axis", text="Up")
+        row.prop(con, "use_target_z")
+
+        self.space_template(layout, con)
+
+    def IK(self, context, layout, con):
+        if context.object.pose.ik_solver == 'ITASC':
+            layout.prop(con, "ik_type")
+            getattr(self, 'IK_' + con.ik_type)(context, layout, con)
+        else:
+            # Standard IK constraint
+            self.target_template(layout, con)
+            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()
+
+            split = layout.split()
+            col = split.column()
+            col.prop(con, "iterations")
+            col.prop(con, "chain_count")
+
+            col = split.column()
+            col.prop(con, "use_tail")
+            col.prop(con, "use_stretch")
+
+            layout.label(text="Weight:")
+
+            split = layout.split()
+            col = split.column()
+            row = col.row(align=True)
+            row.prop(con, "use_location", text="")
+            sub = row.row()
+            sub.active = con.use_location
+            sub.prop(con, "weight", text="Position", slider=True)
+
+            col = split.column()
+            row = col.row(align=True)
+            row.prop(con, "use_rotation", text="")
+            sub = row.row()
+            sub.active = con.use_rotation
+            sub.prop(con, "orient_weight", text="Rotation", slider=True)
+
+    def IK_COPY_POSE(self, context, layout, con):
+        self.target_template(layout, con)
+        self.ik_template(layout, con)
+
+        row = layout.row()
+        row.label(text="Axis Ref:")
+        row.prop(con, "reference_axis", expand=True)
+        split = layout.split(percentage=0.33)
+        split.row().prop(con, "use_location")
+        row = split.row()
+        row.prop(con, "weight", text="Weight", slider=True)
+        row.active = con.use_location
+        split = layout.split(percentage=0.33)
+        row = split.row()
+        row.label(text="Lock:")
+        row = split.row()
+        row.prop(con, "lock_location_x", text="X")
+        row.prop(con, "lock_location_y", text="Y")
+        row.prop(con, "lock_location_z", text="Z")
+        split.active = con.use_location
+
+        split = layout.split(percentage=0.33)
+        split.row().prop(con, "use_rotation")
+        row = split.row()
+        row.prop(con, "orient_weight", text="Weight", slider=True)
+        row.active = con.use_rotation
+        split = layout.split(percentage=0.33)
+        row = split.row()
+        row.label(text="Lock:")
+        row = split.row()
+        row.prop(con, "lock_rotation_x", text="X")
+        row.prop(con, "lock_rotation_y", text="Y")
+        row.prop(con, "lock_rotation_z", text="Z")
+        split.active = con.use_rotation
+
+    def IK_DISTANCE(self, context, layout, con):
+        self.target_template(layout, con)
+        self.ik_template(layout, con)
+
+        layout.prop(con, "limit_mode")
+
+        row = layout.row()
+        row.prop(con, "weight", text="Weight", slider=True)
+        row.prop(con, "distance", text="Distance", slider=True)
+
+    def FOLLOW_PATH(self, context, layout, con):
+        self.target_template(layout, con)
+        layout.operator("constraint.followpath_path_animate", text="Animate Path", icon='ANIM_DATA')
+
+        split = layout.split()
+
+        col = split.column()
+        col.prop(con, "use_curve_follow")
+        col.prop(con, "use_curve_radius")
+
+        col = split.column()
+        col.prop(con, "use_fixed_location")
+        if con.use_fixed_location:
+            col.prop(con, "offset_factor", text="Offset")
+        else:
+            col.prop(con, "offset")
+
+        row = layout.row()
+        row.label(text="Forward:")
+        row.prop(con, "forward_axis", expand=True)
+
+        row = layout.row()
+        row.prop(con, "up_axis", text="Up")
+        row.label()
+
+    def LIMIT_ROTATION(self, context, layout, con):
+        split = layout.split()
+
+        col = split.column(align=True)
+        col.prop(con, "use_limit_x")
+        sub = col.column()
+        sub.active = con.use_limit_x
+        sub.prop(con, "min_x", text="Min")
+        sub.prop(con, "max_x", text="Max")
+
+        col = split.column(align=True)
+        col.prop(con, "use_limit_y")
+        sub = col.column()
+        sub.active = con.use_limit_y
+        sub.prop(con, "min_y", text="Min")
+        sub.prop(con, "max_y", text="Max")
+
+        col = split.column(align=True)
+        col.prop(con, "use_limit_z")
+        sub = col.column()
+        sub.active = con.use_limit_z
+        sub.prop(con, "min_z", text="Min")

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list