[Bf-extensions-cvs] [4aa74ca] master: Another template object option to hide copies in the viewport.

Lukas Tönne noreply at git.blender.org
Tue Dec 16 18:37:25 CET 2014


Commit: 4aa74cadd42f37491df2802d3f3c76e7dfaae729
Author: Lukas Tönne
Date:   Tue Dec 16 18:36:00 2014 +0100
Branches: master
https://developer.blender.org/rBAC4aa74cadd42f37491df2802d3f3c76e7dfaae729

Another template object option to hide copies in the viewport.

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.

===================================================================

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

===================================================================

diff --git a/object_physics_meadow/patch.py b/object_physics_meadow/patch.py
index d584283..80f5652 100644
--- a/object_physics_meadow/patch.py
+++ b/object_physics_meadow/patch.py
@@ -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
diff --git a/object_physics_meadow/settings.py b/object_physics_meadow/settings.py
index a4de886..9b87faa 100644
--- a/object_physics_meadow/settings.py
+++ b/object_physics_meadow/settings.py
@@ -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",
diff --git a/object_physics_meadow/ui.py b/object_physics_meadow/ui.py
index 66f5501..6ee0767 100644
--- a/object_physics_meadow/ui.py
+++ b/object_physics_meadow/ui.py
@@ -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):



More information about the Bf-extensions-cvs mailing list