[Bf-blender-cvs] [af73006] openvdb: Disable UI is there is cache, similar to what the pointcache is doing.

Kévin Dietrich noreply at git.blender.org
Mon Aug 3 16:41:12 CEST 2015


Commit: af730061f28cc7f86d9911c927d1071ef2dea075
Author: Kévin Dietrich
Date:   Mon Aug 3 15:30:48 2015 +0200
Branches: openvdb
https://developer.blender.org/rBaf730061f28cc7f86d9911c927d1071ef2dea075

Disable UI is there is cache, similar to what the pointcache is doing.

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

M	release/scripts/startup/bl_ui/properties_physics_smoke.py
M	source/blender/makesrna/intern/rna_smoke.c

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

diff --git a/release/scripts/startup/bl_ui/properties_physics_smoke.py b/release/scripts/startup/bl_ui/properties_physics_smoke.py
index 8e0ffb1..eaf2532 100644
--- a/release/scripts/startup/bl_ui/properties_physics_smoke.py
+++ b/release/scripts/startup/bl_ui/properties_physics_smoke.py
@@ -25,6 +25,11 @@ from bl_ui.properties_physics_common import (
         effector_weights_ui,
         )
 
+def enable_panel(domain):
+    if domain.cache_type in {'POINTCACHE'}:
+        return not domain.point_cache.is_baked
+    else:
+        return not domain.active_openvdb_cache.is_baked
 
 class PhysicButtonsPanel:
     bl_space_type = 'PROPERTIES'
@@ -54,7 +59,7 @@ class PHYSICS_PT_smoke(PhysicButtonsPanel, Panel):
 
             split = layout.split()
 
-            split.enabled = not domain.point_cache.is_baked
+            split.enabled = enable_panel(domain)
 
             col = split.column()
             col.label(text="Resolution:")
@@ -176,7 +181,7 @@ class PHYSICS_PT_smoke_fire(PhysicButtonsPanel, Panel):
         domain = context.smoke.domain_settings
 
         split = layout.split()
-        split.enabled = not domain.point_cache.is_baked
+        split.enabled = enable_panel(domain)
 
         col = split.column(align=True)
         col.label(text="Reaction:")
@@ -212,7 +217,7 @@ class PHYSICS_PT_smoke_adaptive_domain(PhysicButtonsPanel, Panel):
         layout.active = domain.use_adaptive_domain
 
         split = layout.split()
-        split.enabled = (not domain.point_cache.is_baked)
+        split.enabled = enable_panel(domain)
 
         col = split.column(align=True)
         col.label(text="Resolution:")
@@ -247,7 +252,7 @@ class PHYSICS_PT_smoke_highres(PhysicButtonsPanel, Panel):
         layout.active = md.use_high_resolution
 
         split = layout.split()
-        split.enabled = not md.point_cache.is_baked
+        split.enabled = enable_panel(md)
 
         col = split.column()
         col.label(text="Resolution:")
diff --git a/source/blender/makesrna/intern/rna_smoke.c b/source/blender/makesrna/intern/rna_smoke.c
index aeb7042..bc98414 100644
--- a/source/blender/makesrna/intern/rna_smoke.c
+++ b/source/blender/makesrna/intern/rna_smoke.c
@@ -402,6 +402,10 @@ static void rna_def_openvdb_cache(BlenderRNA *brna)
 	RNA_def_property_ui_text(prop, "Name", "Cache name");
 	RNA_def_struct_name_property(srna, prop);
 
+	prop = RNA_def_property(srna, "is_baked", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_sdna(prop, NULL, "flags", VDB_CACHE_SMOKE_EXPORTED);
+	RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+
 	prop = RNA_def_property(srna, "compression", PROP_ENUM, PROP_NONE);
 	RNA_def_property_enum_sdna(prop, NULL, "compression");
 	RNA_def_property_enum_items(prop, prop_compression_items);




More information about the Bf-blender-cvs mailing list