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:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2009-04-11 06:18:24 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2009-04-11 06:18:24 +0400
commitc7b587105fae174c47bd29291ac384037af06685 (patch)
treea2f8c88ea1bffb2864350ba3a494f2ceb9601117 /release
parent3ed5e2153796fb633f20d49ce7eac0db6bb82a74 (diff)
UI:
* Added very basic loading of .py files on startup to define panels. It now executes all .py files in .blender/ui on startup. Right now this contains the object buttons, the C code for it is commented out. These files should get embedded in the blender executable as well eventually, that's a bit more complicated so this works for now. * For scons and cmake it seems to copy & find the files OK, for make only "make release" works (same with scripts/ folder it seems). * Added BLI_gethome_folder function in BLI_util.h. This is adapted from bpy_gethome, and gives the path to a folder in .blender like scripts or ui. There's plenty of things to figure out here about paths, embedding, caching, user configs ...
Diffstat (limited to 'release')
-rw-r--r--release/Makefile3
-rw-r--r--release/ui/buttons_objects.py124
2 files changed, 127 insertions, 0 deletions
diff --git a/release/Makefile b/release/Makefile
index 43a369d8f77..79258f03767 100644
--- a/release/Makefile
+++ b/release/Makefile
@@ -163,6 +163,9 @@ endif
@echo "----> Copy python infrastructure"
@[ ! -d scripts ] || cp -r scripts $(CONFDIR)/scripts
+ @echo "----> Copy python UI files"
+ @[ ! -d ui ] || cp -r ui $(CONFDIR)/ui
+
ifeq ($(OS),darwin)
@echo "----> Move .blender to .app/Contents/MacOS/"
@rm -fr $(DISTDIR)/blender$(EXT0)/Contents/MacOS/.blender
diff --git a/release/ui/buttons_objects.py b/release/ui/buttons_objects.py
new file mode 100644
index 00000000000..48c113a84ff
--- /dev/null
+++ b/release/ui/buttons_objects.py
@@ -0,0 +1,124 @@
+
+class OBJECT_PT_transform(bpy.types.Panel):
+ __label__ = "Transform"
+ __context__ = "object"
+
+ def draw(self, context):
+ ob = context.active_object
+ layout = self.layout
+
+ if not ob:
+ return
+
+ layout.template_column_flow(3)
+ layout.itemR(ob, "location")
+ layout.itemR(ob, "rotation")
+ layout.itemR(ob, "scale")
+
+class OBJECT_PT_groups(bpy.types.Panel):
+ __label__ = "Groups"
+ __context__ = "object"
+
+ def draw(self, context):
+ ob = context.active_object
+ layout = self.layout
+
+ if not ob:
+ return
+
+ layout.template_column_flow(2)
+ layout.itemR(ob, "pass_index")
+ layout.itemR(ob, "parent")
+
+ # layout.template_left_right()
+ # layout.itemO("OBJECT_OT_add_group");
+
+ for group in bpy.data.groups:
+ if ob in group.objects:
+ sublayout = layout.template_stack()
+
+ sublayout.template_left_right()
+ sublayout.itemR(group, "name")
+ # sublayout.itemO("OBJECT_OT_remove_group")
+
+ sublayout.template_column_flow(2)
+ sublayout.itemR(group, "layer")
+ sublayout.itemR(group, "dupli_offset")
+
+class OBJECT_PT_display(bpy.types.Panel):
+ __label__ = "Display"
+ __context__ = "object"
+
+ def draw(self, context):
+ ob = context.active_object
+ layout = self.layout
+
+ if not ob:
+ return
+
+ layout.template_column_flow(2)
+ layout.itemR(ob, "max_draw_type", text="Type")
+ layout.itemR(ob, "draw_bounds_type", text="Bounds")
+
+ layout.template_column_flow(2)
+ layout.itemR(ob, "draw_name", text="Name")
+ layout.itemR(ob, "draw_axis", text="Axis")
+ layout.itemR(ob, "draw_wire", text="Wire")
+ layout.itemR(ob, "draw_texture_space", text="Texture Space")
+ layout.itemR(ob, "x_ray", text="X-Ray")
+ layout.itemR(ob, "draw_transparent", text="Transparency")
+
+class OBJECT_PT_duplication(bpy.types.Panel):
+ __label__ = "Duplication"
+ __context__ = "object"
+
+ def draw(self, context):
+ ob = context.active_object
+ layout = self.layout
+
+ if not ob:
+ return
+
+ layout.template_column()
+ layout.itemR(ob, "dupli_type", text="")
+
+ if ob.dupli_type == "FRAMES":
+ layout.template_column_flow(2)
+ layout.itemR(ob, "dupli_frames_start", text="Start:")
+ layout.itemR(ob, "dupli_frames_end", text="End:")
+ layout.itemR(ob, "dupli_frames_on", text="On:")
+ layout.itemR(ob, "dupli_frames_off", text="Off:")
+
+class OBJECT_PT_animation(bpy.types.Panel):
+ __label__ = "Animation"
+ __context__ = "object"
+
+ def draw(self, context):
+ ob = context.active_object
+ layout = self.layout
+
+ if not ob:
+ return
+
+ layout.template_column()
+
+ layout.template_slot("COLUMN_1")
+ layout.itemL(text="Time Offset:")
+ layout.itemR(ob, "time_offset_edit", text="Edit")
+ layout.itemR(ob, "time_offset_particle", text="Particle")
+ layout.itemR(ob, "time_offset_parent", text="Parent")
+ layout.itemR(ob, "slow_parent")
+ layout.itemR(ob, "time_offset", text="Offset:")
+
+ layout.template_slot("COLUMN_2")
+ layout.itemL(text="Tracking:")
+ layout.itemR(ob, "track_axis", text="Axis")
+ layout.itemR(ob, "up_axis", text="Up Axis")
+ layout.itemR(ob, "track_rotation", text="Rotation")
+
+bpy.ui.addPanel(OBJECT_PT_transform, "BUTTONS_WINDOW", "WINDOW")
+bpy.ui.addPanel(OBJECT_PT_groups, "BUTTONS_WINDOW", "WINDOW")
+bpy.ui.addPanel(OBJECT_PT_display, "BUTTONS_WINDOW", "WINDOW")
+bpy.ui.addPanel(OBJECT_PT_duplication, "BUTTONS_WINDOW", "WINDOW")
+bpy.ui.addPanel(OBJECT_PT_animation, "BUTTONS_WINDOW", "WINDOW")
+