Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Leung <aligorith@gmail.com>2009-05-27 11:28:51 +0400
committerJoshua Leung <aligorith@gmail.com>2009-05-27 11:28:51 +0400
commite1681fcf3574c89ffa12a0e2e1a9953581a6f9a7 (patch)
tree51ae3b7aed7cf89c5787a762f93eac0cac7b1c9b /release
parentaf324690ee646973ade5ba6ce5b5b0574a7b8d67 (diff)
2.5 - Constraint Buttons Layout file
Separated out the code for defining the layout for the constraint targets since its practically the same (with a few minor variations) for all of the other constraints.
Diffstat (limited to 'release')
-rw-r--r--release/ui/buttons_object_constraint.py27
1 files changed, 16 insertions, 11 deletions
diff --git a/release/ui/buttons_object_constraint.py b/release/ui/buttons_object_constraint.py
index bf1f5cd208e..1ff1bec199d 100644
--- a/release/ui/buttons_object_constraint.py
+++ b/release/ui/buttons_object_constraint.py
@@ -28,18 +28,23 @@ class DATA_PT_constraints(DataButtonsPanel):
if box:
if con.type == 'COPY_LOCATION':
self.copy_location(box, con)
-
+
+ def target_template(self, layout, con, subtargets=True):
+ layout.itemR(con, "target") # XXX limiting settings for only 'curves' or some type of object
+
+ if con.target and subtargets:
+ if con.target.type == "ARMATURE":
+ layout.itemR(con, "subtarget", text="Bone") # XXX autocomplete
+
+ row = layout.row()
+ row.itemL(text="Head/Tail:")
+ row.itemR(con, "head_tail", text="")
+ elif con.target.type in ("MESH", "LATTICE"):
+ layout.itemR(con, "subtarget", text="Vertex Group") # XXX autocomplete
+
def copy_location(self, layout, con):
- layout.itemR(con, "target")
-
- if con.target and con.target.type == "ARMATURE":
- layout.itemR(con, "subtarget", text="Bone") # XXX autocomplete
- row = layout.row()
- row.itemL(text="Head/Tail:")
- row.itemR(con, "head_tail", text="")
- elif con.target and con.target.type == "MESH":
- layout.itemR(con, "subtarget", text="Vertex Group") # XXX autocomplete
-
+ self.target_template(layout, con)
+
row = layout.row(align=True)
row.itemR(con, "locate_like_x", text="X", toggle=True)
row.itemR(con, "invert_x", text="-", toggle=True)