[Bf-extensions-cvs] [c8c3b6d] master: Shift the "primary object" focus from the grid to the ground object.

Lukas Tönne noreply at git.blender.org
Wed Dec 10 15:41:03 CET 2014


Commit: c8c3b6d1c3938d5a64913b69737f1423b6164285
Author: Lukas Tönne
Date:   Wed Dec 10 15:39:22 2014 +0100
Branches: master
https://developer.blender.org/rBACc8c3b6d1c3938d5a64913b69737f1423b6164285

Shift the "primary object" focus from the grid to the ground object.

For artists it is probably more intuitive to select the ground object
to tweak settings.

Operators are now also displayed for every object type for convenience.

===================================================================

M	object_physics_meadow/meadow.py
M	object_physics_meadow/ui.py

===================================================================

diff --git a/object_physics_meadow/meadow.py b/object_physics_meadow/meadow.py
index 245de8f..17482fb 100644
--- a/object_physics_meadow/meadow.py
+++ b/object_physics_meadow/meadow.py
@@ -44,11 +44,11 @@ def make_samples(context, gridob, groundob):
     #debug = MeshDebug(drawsize=0.1)
     
     # get a sample generator implementation
-    #gen = best_candidate_gen(gridob.meadow.patch_radius, xmin, xmax, ymin, ymax)
-    gen = hierarchical_dart_throw_gen(gridob.meadow.patch_radius, gridob.meadow.sampling_levels, xmin, xmax, ymin, ymax, debug)
+    #gen = best_candidate_gen(groundob.meadow.patch_radius, xmin, xmax, ymin, ymax)
+    gen = hierarchical_dart_throw_gen(groundob.meadow.patch_radius, groundob.meadow.sampling_levels, xmin, xmax, ymin, ymax, debug)
     
     mat = groundob.matrix_world
-    loc2D = [(mat * Vector(p[0:3] + (1.0,)))[0:2] for p in gen(gridob.meadow.seed, gridob.meadow.max_patches)]
+    loc2D = [(mat * Vector(p[0:3] + (1.0,)))[0:2] for p in gen(groundob.meadow.seed, groundob.meadow.max_patches)]
     #debug.to_object(context)
     
     # project samples onto the ground object
@@ -66,11 +66,11 @@ def make_blobs(context, gridob, groundob):
     patch.patch_group_clear(context)
     
     samples = make_samples(context, gridob, groundob)
-    blob.make_blobs(context, gridob, groundob, samples, gridob.meadow.patch_radius)
+    blob.make_blobs(context, gridob, groundob, samples, groundob.meadow.patch_radius)
 
 ### Patch copies for simulation ###
 def make_patches(context, gridob, groundob):
     scene = context.scene
     template_objects = [ob for ob in scene.objects if ob.meadow.type == 'TEMPLATE']
     patch.make_patches(context, groundob, gridob, template_objects)
-    blob.setup_blob_duplis(context, groundob, 0.333 * gridob.meadow.patch_radius)
+    blob.setup_blob_duplis(context, groundob, 0.333 * groundob.meadow.patch_radius)
diff --git a/object_physics_meadow/ui.py b/object_physics_meadow/ui.py
index b032a7b..24c4761 100644
--- a/object_physics_meadow/ui.py
+++ b/object_physics_meadow/ui.py
@@ -65,10 +65,8 @@ class OBJECT_PT_Meadow(Panel):
             sub = row.row()
             sub.enabled = meadow.use_as_dupli
             sub.prop(meadow, "use_centered")
-            
-            layout.operator("meadow.make_patches", icon='PARTICLE_PATH')
         
-        elif meadow.type == 'BLOBGRID':
+        elif meadow.type == 'GROUND':
             layout.prop(meadow, "seed")
             
             col = layout.column(align=True)
@@ -76,17 +74,12 @@ class OBJECT_PT_Meadow(Panel):
             col.prop(meadow, "max_patches")
             
             layout.prop(meadow, "sampling_levels")
-            
-            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)
+        layout.operator("meadow.make_blobs", icon='STICKY_UVS_DISABLE')
+        layout.operator("meadow.make_patches", icon='PARTICLE_PATH')
+        layout.operator("meadow.rebake_meadow")
 
 
 class MeadowOperatorBase():



More information about the Bf-extensions-cvs mailing list