Added a new setting for controlling the hierarchy levels of the dart
authorLukas Tönne <lukas.toenne@gmail.com>
Wed, 26 Nov 2014 11:47:00 +0000 (12:47 +0100)
committerLukas Tönne <lukas.toenne@gmail.com>
Wed, 26 Nov 2014 11:47:00 +0000 (12:47 +0100)
throwing algorithm (although the default of 4 seems to be sufficient).

object_physics_meadow/meadow.py
object_physics_meadow/settings.py
object_physics_meadow/ui.py

index 5fe562a926c5f182882275a1fc7343128655fb30..063be99ddc9583e634ab455382550f5a9f6174bc 100644 (file)
@@ -45,7 +45,7 @@ def make_samples(context, gridob, groundob):
     
     # 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, 4, xmin, xmax, ymin, ymax, debug)
+    gen = hierarchical_dart_throw_gen(gridob.meadow.patch_radius, gridob.meadow.sampling_levels, xmin, xmax, ymin, ymax, debug)
     
     loc2D = [(p[0], p[1]) for p in gen(gridob.meadow.seed, gridob.meadow.max_patches)]
     #debug.to_object(context)
index ac52fcb99237f1702af516e3d8807eb79756a8b5..21db217716b7931ffc6195f14c8fe6b7a5873749 100644 (file)
@@ -114,6 +114,11 @@ class MeadowObjectSettings(PropertyGroup):
         description="General random number seed value",
         default=12345
         )
+    sampling_levels = IntProperty(
+        name="Sampling Levels",
+        description="Maximum number of sampling subdivision levels",
+        default=4
+        )
     
     patch_radius = FloatProperty(
         name="Patch Radius",
index 47b61feaf91633de1b2ea318418f78af48091132..fefbef6b2e3c1f6e2754adfd7c5036e2c4f1619e 100644 (file)
@@ -54,6 +54,7 @@ class OBJECT_PT_Meadow(Panel):
                 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")