Added a new setting for controlling the hierarchy levels of the dart
[blender-addons-contrib.git] / object_physics_meadow / settings.py
index 404d0f8a01687d692d12b6a796393beab94a73a3..21db217716b7931ffc6195f14c8fe6b7a5873749 100644 (file)
@@ -30,7 +30,7 @@ def copy_rna_enum_items(type, prop):
 dupli_draw_type_items = copy_rna_enum_items(bpy.types.Object, 'draw_type')
 
 def dupli_draw_type_update(self, context):
-    from meadow import blob # import here to avoid cyclic import
+    from object_physics_meadow import blob # import here to avoid cyclic import
     
     for ob in blob.blob_objects(context):
         blob.blob_apply_settings(ob, self)
@@ -38,15 +38,24 @@ def dupli_draw_type_update(self, context):
 class MeadowAddonPreferences(AddonPreferences):
     bl_idname = __package__
 
-    patch_groupname = StringProperty(name="Patch Group Name", description="Object group for storing patch copies of templates", default="Patches")
-    blob_groupname = StringProperty(name="Blob Group Name", description="Object group for storing blob duplicators", default="Blobs")
-
-    seed = IntProperty(name="Seed", description="General random number seed value", default=12345)
-
-    patch_radius = FloatProperty(name="Patch Radius", description="Free area around each patch where no other patch overlaps", default=1.0, min=0.01)
-    max_patches = IntProperty(name="Maximum Patch Number", description="Maximum number of patches", default=1000, max=1000000, soft_max=10000)
-
-    dupli_draw_type = EnumProperty(name="Dupli Draw Type", description="Maximum draw type in the viewport for duplis", items=dupli_draw_type_items, default='BOUNDS', update=dupli_draw_type_update)
+    patch_groupname = StringProperty(
+        name="Patch Group Name",
+        description="Object group for storing patch copies of templates",
+        default="Patches"
+        )
+    blob_groupname = StringProperty(
+        name="Blob Group Name",
+        description="Object group for storing blob duplicators",
+        default="Blobs"
+        )
+
+    dupli_draw_type = EnumProperty(
+        name="Dupli Draw Type",
+        description="Maximum draw type in the viewport for duplis",
+        items=dupli_draw_type_items,
+        default='BOUNDS',
+        update=dupli_draw_type_update
+        )
 
     def patch_group(self, context):
         return bpy.data.groups.get(self.patch_groupname)
@@ -59,11 +68,6 @@ class MeadowAddonPreferences(AddonPreferences):
         
         layout.separator()
         
-        layout.prop(self, "seed")
-        
-        layout.prop(self, "patch_radius")
-        layout.prop(self, "max_patches")
-        
         layout.prop(self, "dupli_draw_type")
 
 
@@ -92,11 +96,51 @@ def type_update(self, context):
                 ob.meadow.type = 'NONE'
 
 class MeadowObjectSettings(PropertyGroup):
-    type = EnumProperty(name="Type", description="Role of the object in the meadow simulation", items=type_items, update=type_update)
-    use_as_dupli = BoolProperty(name="Use as Dupli", description="Use the object for dupli instances", default=True)
+    type = EnumProperty(
+        name="Type",
+        description="Role of the object in the meadow simulation",
+        items=type_items,
+        update=type_update
+        )
+    
+    use_as_dupli = BoolProperty(
+        name="Use as Dupli",
+        description="Use the object for dupli instances",
+        default=True
+        )
+    
+    seed = IntProperty(
+        name="Seed",
+        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",
+        description="Free area around each patch where no other patch overlaps",
+        default=1.0,
+        min=0.01
+        )
+    max_patches = IntProperty(
+        name="Maximum Patch Number",
+        description="Maximum number of patches",
+        default=1000,
+        max=1000000,
+        soft_max=10000
+        )
     
     # internal
-    blob_index = IntProperty(name="Blob Index", description="Unique blob index of the object", default=-1, options={'HIDDEN'})
+    blob_index = IntProperty(
+        name="Blob Index",
+        description="Unique blob index of the object",
+        default=-1,
+        options={'HIDDEN'}
+        )
 
 #-----------------------------------------------------------------------