[Bf-extensions-cvs] [96b9c3c] master: Added a new setting for controlling the hierarchy levels of the dart throwing algorithm (although the default of 4 seems to be sufficient).
Lukas Tönne
noreply at git.blender.org
Wed Nov 26 14:55:05 CET 2014
Commit: 96b9c3c238c6f1010a5dd960c6039938e95b544a
Author: Lukas Tönne
Date: Wed Nov 26 12:47:00 2014 +0100
Branches: master
https://developer.blender.org/rBAC96b9c3c238c6f1010a5dd960c6039938e95b544a
Added a new setting for controlling the hierarchy levels of the dart
throwing algorithm (although the default of 4 seems to be sufficient).
===================================================================
M object_physics_meadow/meadow.py
M object_physics_meadow/settings.py
M object_physics_meadow/ui.py
===================================================================
diff --git a/object_physics_meadow/meadow.py b/object_physics_meadow/meadow.py
index 5fe562a..063be99 100644
--- a/object_physics_meadow/meadow.py
+++ b/object_physics_meadow/meadow.py
@@ -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)
diff --git a/object_physics_meadow/settings.py b/object_physics_meadow/settings.py
index ac52fcb..21db217 100644
--- a/object_physics_meadow/settings.py
+++ b/object_physics_meadow/settings.py
@@ -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",
diff --git a/object_physics_meadow/ui.py b/object_physics_meadow/ui.py
index 47b61fe..fefbef6 100644
--- a/object_physics_meadow/ui.py
+++ b/object_physics_meadow/ui.py
@@ -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")
More information about the Bf-extensions-cvs
mailing list