Shift the "primary object" focus from the grid to the ground object.
authorLukas Tönne <lukas.toenne@gmail.com>
Wed, 10 Dec 2014 14:39:22 +0000 (15:39 +0100)
committerLukas Tönne <lukas.toenne@gmail.com>
Wed, 10 Dec 2014 14:39:22 +0000 (15:39 +0100)
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.

object_physics_meadow/meadow.py
object_physics_meadow/ui.py

index 245de8f..17482fb 100644 (file)
@@ -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)
index b032a7b..24c4761 100644 (file)
@@ -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():