[Bf-blender-cvs] [6caba7b] alembic: Use a dedicated panel for cache library UI instead of appending to the duplication UI.
Lukas Tönne
noreply at git.blender.org
Tue Apr 21 11:51:18 CEST 2015
Commit: 6caba7bba2e44a3020242ab3165274edf779b6dd
Author: Lukas Tönne
Date: Tue Apr 21 11:50:19 2015 +0200
Branches: alembic
https://developer.blender.org/rB6caba7bba2e44a3020242ab3165274edf779b6dd
Use a dedicated panel for cache library UI instead of appending to the
duplication UI.
===================================================================
M release/scripts/startup/bl_ui/properties_object.py
===================================================================
diff --git a/release/scripts/startup/bl_ui/properties_object.py b/release/scripts/startup/bl_ui/properties_object.py
index 5a3d0b9..7e61ded 100644
--- a/release/scripts/startup/bl_ui/properties_object.py
+++ b/release/scripts/startup/bl_ui/properties_object.py
@@ -312,6 +312,48 @@ def cachelib_object_items(cachelib, ob):
class OBJECT_PT_duplication(ObjectButtonsPanel, Panel):
bl_label = "Duplication"
+ def draw(self, context):
+ layout = self.layout
+
+ ob = context.object
+
+ layout.prop(ob, "dupli_type", expand=True)
+
+ if ob.dupli_type == 'FRAMES':
+ split = layout.split()
+
+ col = split.column(align=True)
+ col.prop(ob, "dupli_frames_start", text="Start")
+ col.prop(ob, "dupli_frames_end", text="End")
+
+ col = split.column(align=True)
+ col.prop(ob, "dupli_frames_on", text="On")
+ col.prop(ob, "dupli_frames_off", text="Off")
+
+ layout.prop(ob, "use_dupli_frames_speed", text="Speed")
+
+ elif ob.dupli_type == 'VERTS':
+ layout.prop(ob, "use_dupli_vertices_rotation", text="Rotation")
+
+ elif ob.dupli_type == 'FACES':
+ row = layout.row()
+ row.prop(ob, "use_dupli_faces_scale", text="Scale")
+ sub = row.row()
+ sub.active = ob.use_dupli_faces_scale
+ sub.prop(ob, "dupli_faces_scale", text="Inherit Scale")
+
+ elif ob.dupli_type == 'GROUP':
+ layout.prop(ob, "dupli_group", text="Group")
+
+
+class OBJECT_PT_cache_library(ObjectButtonsPanel, Panel):
+ bl_label = "Cache"
+
+ @classmethod
+ def poll(cls, context):
+ ob = context.object
+ return (ob and ob.dupli_type == 'GROUP' and ob.dupli_group)
+
def draw_cache_modifier(self, context, layout, cachelib, md):
layout.context_pointer_set("cache_modifier", md)
@@ -395,43 +437,15 @@ class OBJECT_PT_duplication(ObjectButtonsPanel, Panel):
self.draw_cache_modifier(context, box, cachelib, md)
def draw(self, context):
- layout = self.layout
-
ob = context.object
- layout.prop(ob, "dupli_type", expand=True)
-
- if ob.dupli_type == 'FRAMES':
- split = layout.split()
-
- col = split.column(align=True)
- col.prop(ob, "dupli_frames_start", text="Start")
- col.prop(ob, "dupli_frames_end", text="End")
-
- col = split.column(align=True)
- col.prop(ob, "dupli_frames_on", text="On")
- col.prop(ob, "dupli_frames_off", text="Off")
-
- layout.prop(ob, "use_dupli_frames_speed", text="Speed")
-
- elif ob.dupli_type == 'VERTS':
- layout.prop(ob, "use_dupli_vertices_rotation", text="Rotation")
-
- elif ob.dupli_type == 'FACES':
- row = layout.row()
- row.prop(ob, "use_dupli_faces_scale", text="Scale")
- sub = row.row()
- sub.active = ob.use_dupli_faces_scale
- sub.prop(ob, "dupli_faces_scale", text="Inherit Scale")
-
- elif ob.dupli_type == 'GROUP':
- layout.prop(ob, "dupli_group", text="Group")
- row = layout.row(align=True)
- row.template_ID(ob, "cache_library", new="cachelibrary.new")
+ layout = self.layout
+ row = layout.row(align=True)
+ row.template_ID(ob, "cache_library", new="cachelibrary.new")
- if ob.cache_library:
- cache_objects = cachelib_objects(ob.cache_library, ob.dupli_group)
- self.draw_cachelib(context, layout, ob, ob.cache_library, cache_objects)
+ if ob.cache_library:
+ cache_objects = cachelib_objects(ob.cache_library, ob.dupli_group)
+ self.draw_cachelib(context, layout, ob, ob.cache_library, cache_objects)
def HAIR_SIMULATION(self, context, layout, cachelib, md):
params = md.parameters
More information about the Bf-blender-cvs
mailing list