Another template object option to hide copies in the viewport.
authorLukas Tönne <lukas.toenne@gmail.com>
Tue, 16 Dec 2014 17:36:00 +0000 (18:36 +0100)
committerLukas Tönne <lukas.toenne@gmail.com>
Tue, 16 Dec 2014 17:36:00 +0000 (18:36 +0100)
This is useful to hide non-renderable object which are only used for
simulation, without having to toggle their visibility every time before
updating patches.

object_physics_meadow/patch.py
object_physics_meadow/settings.py
object_physics_meadow/ui.py

index d584283..80f5652 100644 (file)
@@ -154,6 +154,10 @@ def make_patches(context, groundob, gridob, template_objects):
             duplimat = gridmat * vertmat
             ob.matrix_world = duplimat
             
+            # optional visibility override
+            if ob.meadow.hide:
+                ob.hide = True
+
             # XXX WARNING: having lots of objects in the scene slows down
             # the make-duplis-real operator to an absolute crawl!!
             # Therefore we unlink all copies here until the copying
index a4de886..9b87faa 100644 (file)
@@ -111,6 +111,12 @@ class MeadowObjectSettings(PropertyGroup):
         default=True
         )
 
+    hide = BoolProperty(
+        name="Hide",
+        description="Hide copies in the viewport",
+        default=False
+        )
+
     use_layers = BoolProperty(
         name="Use Layers",
         description="Put new objects into custom layers",
index 66f5501..6ee0767 100644 (file)
@@ -77,6 +77,8 @@ class OBJECT_PT_Meadow(Panel):
             sub = row.row()
             sub.enabled = meadow.use_as_dupli
             sub.prop(meadow, "use_centered")
+            row = layout.row()
+            row.prop(meadow, "hide")
         
         elif meadow.type == 'GROUND':
             box = layout.box()
@@ -98,6 +100,11 @@ class OBJECT_PT_Meadow(Panel):
         
         layout.separator()
         
+        sub = layout.column()
+        sub.enabled = has_samples
+        sub.operator("meadow.make_patches", icon='PARTICLE_PATH', text="Update Patches")
+        sub.operator("meadow.rebake_meadow", icon='MOD_PHYSICS', text="Update Physics Cache")
+
         row = layout.row()
         row.prop(groundob.meadow, "use_layers")
         sub = row.row()
@@ -107,11 +114,6 @@ class OBJECT_PT_Meadow(Panel):
             sub.enabled = False
             sub.template_layers(groundob, "layers", groundob.meadow, "used_layers", -1)
 
-        sub = layout.column()
-        sub.enabled = has_samples
-        sub.operator("meadow.make_patches", icon='PARTICLE_PATH', text="Update Patches")
-        sub.operator("meadow.rebake_meadow", icon='MOD_PHYSICS', text="Update Physics Cache")
-
 
 class MeadowOperatorBase():
     def verify_cache_dir(self):