Removed the draw_type pseudo-property and propagation to blobs/duplis.
authorLukas Tönne <lukas.toenne@gmail.com>
Tue, 9 Dec 2014 11:12:55 +0000 (12:12 +0100)
committerLukas Tönne <lukas.toenne@gmail.com>
Tue, 9 Dec 2014 11:12:55 +0000 (12:12 +0100)
This feature is too clumsy because adding more properties can only be
done manually and adds lots of maintenance overhead.

Instead, the "make patches" step can simply be repeated when template
properties (such as the draw mode) are changed. This could also become
an (optionally) automatic update that runs via a scene update handler
when the user changes the template object.

object_physics_meadow/blob.py
object_physics_meadow/settings.py

index 5cc46be..61e6334 100644 (file)
@@ -74,11 +74,7 @@ def blob_group_remove(context, blobob):
     blob_group.objects.unlink(blobob)
 
 def blob_apply_settings(ob, settings):
-    ob.draw_type = settings.dupli_draw_type
-    
-    particle_draw_method = 'NONE' if settings.dupli_draw_type in {'BOUNDS'} else 'RENDER'
-    for psys in ob.particle_systems:
-        psys.settings.draw_method = particle_draw_method
+    pass # TODO
 
 #-----------------------------------------------------------------------
 
index 21db217..2833d55 100644 (file)
@@ -27,14 +27,6 @@ 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 object_physics_meadow import blob # import here to avoid cyclic import
-    
-    for ob in blob.blob_objects(context):
-        blob.blob_apply_settings(ob, self)
-
 class MeadowAddonPreferences(AddonPreferences):
     bl_idname = __package__
 
@@ -49,14 +41,6 @@ class MeadowAddonPreferences(AddonPreferences):
         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)
     def blob_group(self, context):
@@ -65,11 +49,6 @@ class MeadowAddonPreferences(AddonPreferences):
     def draw_ex(self, layout, context):
         layout.prop(self, "patch_groupname")
         layout.prop(self, "blob_groupname")
-        
-        layout.separator()
-        
-        layout.prop(self, "dupli_draw_type")
-
 
     def draw(self, context):
         self.draw_ex(self, self.layout, context)