[Bf-extensions-cvs] [00bcccf] master: Reorganization of the UI elements to stress importance of certain settings and clarify workflow.
Lukas Tönne
noreply at git.blender.org
Tue Dec 9 12:40:13 CET 2014
Commit: 00bcccf02e22041e5c951f14ab8673bd07e7aa1d
Author: Lukas Tönne
Date: Tue Dec 9 12:36:20 2014 +0100
Branches: master
https://developer.blender.org/rBAC00bcccf02e22041e5c951f14ab8673bd07e7aa1d
Reorganization of the UI elements to stress importance of certain
settings and clarify workflow.
===================================================================
M object_physics_meadow/ui.py
===================================================================
diff --git a/object_physics_meadow/ui.py b/object_physics_meadow/ui.py
index e0434f2..05a6e2c 100644
--- a/object_physics_meadow/ui.py
+++ b/object_physics_meadow/ui.py
@@ -32,33 +32,46 @@ class OBJECT_PT_Meadow(Panel):
bl_region_type = 'WINDOW'
bl_context = "object"
+ @classmethod
+ def poll(cls, context):
+ ob = context.object
+ if not ob:
+ return False
+ return True
+
def draw(self, context):
settings = _settings.get(context)
ob = context.object
+ meadow = ob.meadow
layout = self.layout
- # draw general settings here as well
- type(settings).draw_ex(settings, layout, context)
+ layout.prop(meadow, "type", expand=True)
+
+ layout.separator()
- layout.operator("meadow.make_blobs", icon='STICKY_UVS_DISABLE')
- layout.operator("meadow.make_patches", icon='PARTICLE_PATH')
- layout.operator("meadow.rebake_meadow")
+ if meadow.type == 'TEMPLATE':
+ layout.prop(meadow, "use_as_dupli")
+ layout.operator("meadow.make_patches", icon='PARTICLE_PATH')
- if ob:
- meadow = ob.meadow
+ elif meadow.type == 'BLOBGRID':
+ layout.prop(meadow, "seed")
- layout.separator()
+ col = layout.column(align=True)
+ col.prop(meadow, "patch_radius")
+ col.prop(meadow, "max_patches")
- layout.prop(meadow, "type", expand=True)
+ layout.prop(meadow, "sampling_levels")
- if meadow.type == 'TEMPLATE':
- layout.prop(meadow, "use_as_dupli")
- elif meadow.type == 'BLOBGRID':
- layout.prop(meadow, "seed")
- layout.prop(meadow, "sampling_levels")
-
- layout.prop(meadow, "patch_radius")
- layout.prop(meadow, "max_patches")
+ layout.operator("meadow.make_blobs", icon='STICKY_UVS_DISABLE')
+ layout.operator("meadow.rebake_meadow")
+
+ layout.separator()
+
+ # common stuff
+ if meadow.type != 'NONE':
+ layout.label("Settings:")
+ # draw general settings here as well
+ type(settings).draw_ex(settings, layout, context)
class MeadowOperatorBase():
More information about the Bf-extensions-cvs
mailing list