[Bf-blender-cvs] [2ebed32] openvdb: Prepare merge with master

Kévin Dietrich noreply at git.blender.org
Sat Jan 23 09:14:43 CET 2016


Commit: 2ebed329ae2d388ef4ad473d1c7465b9f66aecad
Author: Kévin Dietrich
Date:   Sat Jan 23 08:59:34 2016 +0100
Branches: openvdb
https://developer.blender.org/rB2ebed329ae2d388ef4ad473d1c7465b9f66aecad

Prepare merge with master

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

M	release/scripts/startup/bl_ui/properties_physics_smoke.py
M	source/blender/blenkernel/BKE_smoke.h
M	source/blender/blenkernel/intern/depsgraph.c
M	source/blender/blenkernel/intern/smoke.c
M	source/blender/editors/object/CMakeLists.txt
M	source/blender/editors/object/object_intern.h
M	source/blender/editors/object/object_modifier.c
M	source/blender/editors/object/object_ops.c
M	source/blender/editors/space_time/space_time.c
M	source/blender/editors/space_view3d/CMakeLists.txt
M	source/blender/editors/space_view3d/drawobject.c
M	source/blender/makesdna/DNA_smoke_types.h
M	source/blender/makesrna/RNA_access.h
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 2d7994f..32d5b28 100644
--- a/release/scripts/startup/bl_ui/properties_physics_smoke.py
+++ b/release/scripts/startup/bl_ui/properties_physics_smoke.py
@@ -18,7 +18,7 @@
 
 # <pep8 compliant>
 import bpy
-from bpy.types import Panel, UIList
+from bpy.types import Panel
 
 from bl_ui.properties_physics_common import (
         point_cache_ui,
@@ -26,14 +26,6 @@ from bl_ui.properties_physics_common import (
         )
 
 
-def enable_panel(domain):
-    if domain.cache_type in {'POINTCACHE'}:
-        return not domain.point_cache.is_baked
-    else:
-        cache = domain.active_openvdb_cache
-        return (not cache.is_baked if cache else True)
-
-
 class PhysicButtonsPanel:
     bl_space_type = 'PROPERTIES'
     bl_region_type = 'WINDOW'
@@ -62,7 +54,7 @@ class PHYSICS_PT_smoke(PhysicButtonsPanel, Panel):
 
             split = layout.split()
 
-            split.enabled = enable_panel(domain)
+            split.enabled = not domain.point_cache.is_baked
 
             col = split.column()
             col.label(text="Resolution:")
@@ -184,7 +176,7 @@ class PHYSICS_PT_smoke_fire(PhysicButtonsPanel, Panel):
         domain = context.smoke.domain_settings
 
         split = layout.split()
-        split.enabled = enable_panel(domain)
+        split.enabled = not domain.point_cache.is_baked
 
         col = split.column(align=True)
         col.label(text="Reaction:")
@@ -210,9 +202,8 @@ class PHYSICS_PT_smoke_adaptive_domain(PhysicButtonsPanel, Panel):
 
     def draw_header(self, context):
         md = context.smoke.domain_settings
-        layout = self.layout
-        layout.active = enable_panel(md)
-        layout.prop(md, "use_adaptive_domain", text="")
+
+        self.layout.prop(md, "use_adaptive_domain", text="")
 
     def draw(self, context):
         layout = self.layout
@@ -221,7 +212,7 @@ class PHYSICS_PT_smoke_adaptive_domain(PhysicButtonsPanel, Panel):
         layout.active = domain.use_adaptive_domain
 
         split = layout.split()
-        split.enabled = enable_panel(domain)
+        split.enabled = (not domain.point_cache.is_baked)
 
         col = split.column(align=True)
         col.label(text="Resolution:")
@@ -245,9 +236,8 @@ class PHYSICS_PT_smoke_highres(PhysicButtonsPanel, Panel):
 
     def draw_header(self, context):
         md = context.smoke.domain_settings
-        layout = self.layout
-        layout.active = enable_panel(md)
-        layout.prop(md, "use_high_resolution", text="")
+
+        self.layout.prop(md, "use_high_resolution", text="")
 
     def draw(self, context):
         layout = self.layout
@@ -257,7 +247,7 @@ class PHYSICS_PT_smoke_highres(PhysicButtonsPanel, Panel):
         layout.active = md.use_high_resolution
 
         split = layout.split()
-        split.enabled = enable_panel(md)
+        split.enabled = not md.point_cache.is_baked
 
         col = split.column()
         col.label(text="Resolution:")
@@ -301,15 +291,6 @@ class PHYSICS_PT_smoke_groups(PhysicButtonsPanel, Panel):
         col.prop(domain, "collision_group", text="")
 
 
-class DATA_UL_openvdb_caches(UIList):
-    def draw_items(self, context, layout, item, icon, active_data, active_propname, index):
-        if self.layout_type in {'DEFAULT', 'COMPACT'}:
-            layout.prop(item, "name", text="", emboss=False, icon_value=icon)
-        elif self.layout_type in {'GRID'}:
-            layout.alignement = 'CENTER'
-            layout.label(text="", icon_value=icon)
-
-
 class PHYSICS_PT_smoke_cache(PhysicButtonsPanel, Panel):
     bl_label = "Smoke Cache"
     bl_options = {'DEFAULT_CLOSED'}
@@ -324,48 +305,26 @@ class PHYSICS_PT_smoke_cache(PhysicButtonsPanel, Panel):
         layout = self.layout
 
         domain = context.smoke.domain_settings
-        cache_type = domain.cache_type
-
-        layout.prop(domain, "cache_type")
+        cache_file_format = domain.cache_file_format
 
-        if cache_type in {'POINTCACHE'}:
-            cache = domain.point_cache
+        layout.prop(domain, "cache_file_format")
 
+        if cache_file_format == 'POINTCACHE':
             layout.label(text="Compression:")
             layout.prop(domain, "point_cache_compress_type", expand=True)
-
-            point_cache_ui(self, context, cache, (cache.is_baked is False), 'SMOKE')
-        elif cache_type in {'OPENVDB'}:
+        elif cache_file_format == 'OPENVDB':
             if not bpy.app.build_options.openvdb:
                 layout.label("Build without OpenVDB support.")
                 return
 
+            layout.label(text="Compression:")
+            layout.prop(domain, "openvdb_cache_compress_type", expand=True)
             row = layout.row()
-            row.template_list("DATA_UL_openvdb_caches", "", domain, "cache", domain, "active_openvdb_cache_index", rows=3)
-
-            col = row.column()
-            sub = col.row()
-            subsub = sub.column(align=True)
-            subsub.operator("object.openvdb_cache_add", icon='ZOOMIN', text="")
-            subsub.operator("object.openvdb_cache_remove", icon='ZOOMOUT', text="")
-            sub = col.row()
-            subsub = sub.column(align=True)
-            subsub.operator("object.openvdb_cache_move", icon='MOVE_UP_VEC', text="").direction = 'UP'
-            subsub.operator("object.openvdb_cache_move", icon='MOVE_DOWN_VEC', text="").direction = 'DOWN'
-
-            cache = domain.active_openvdb_cache
-
-            if cache:
-                layout.prop(cache, "filepath")
-                layout.prop(cache, "compression")
-                row = layout.row(align=True)
-                row.prop(cache, "frame_start")
-                row.prop(cache, "frame_end")
-                row = layout.row()
-                row.prop(cache, "save_as_half")
-                row = layout.row()
-                row.operator("object.openvdb_cache_bake")
-                row.operator("object.openvdb_cache_free")
+            row.label("Data Depth:")
+            row.prop(domain, "data_depth", expand=True, text="Data Depth")
+
+        cache = domain.point_cache
+        point_cache_ui(self, context, cache, (cache.is_baked is False), 'SMOKE')
 
 
 class PHYSICS_PT_smoke_field_weights(PhysicButtonsPanel, Panel):
diff --git a/source/blender/blenkernel/BKE_smoke.h b/source/blender/blenkernel/BKE_smoke.h
index 5de8c27..20366f0 100644
--- a/source/blender/blenkernel/BKE_smoke.h
+++ b/source/blender/blenkernel/BKE_smoke.h
@@ -33,8 +33,6 @@
  *  \author Daniel Genrich
  */
 
-struct OpenVDBCache;
-
 typedef float (*bresenham_callback)(float *result, float *input, int res[3], int *pixel, float *tRay, float correct);
 
 struct DerivedMesh *smokeModifier_do(struct SmokeModifierData *smd, struct Scene *scene, struct Object *ob, struct DerivedMesh *dm);
@@ -50,20 +48,4 @@ void smokeModifier_copy(struct SmokeModifierData *smd, struct SmokeModifierData
 float smoke_get_velocity_at(struct Object *ob, float position[3], float velocity[3]);
 int smoke_get_data_flags(struct SmokeDomainSettings *sds);
 
-/* OpenVDB smoke export/import */
-
-typedef void (*update_cb)(void *, float progress, int *cancel);
-
-void smokeModifier_OpenVDB_export(struct SmokeModifierData *smd, struct Scene *scene,
-                                  struct Object *ob, struct DerivedMesh *dm,
-                                  update_cb update,
-                                  void *update_cb_data);
-
-bool smokeModifier_OpenVDB_import(struct SmokeModifierData *smd, struct Scene *scene, struct Object *ob, struct OpenVDBCache *cache);
-
-struct OpenVDBCache *BKE_openvdb_cache_current(struct SmokeDomainSettings *sds);
-void BKE_openvdb_cache_filename(char *r_filename, const char *path, const char *fname, const char *relbase, int frame);
-void BKE_openvdb_cache_remove_files(struct OpenVDBCache *cache, const char *relbase);
-bool BKE_openvdb_cache_reset(struct Object *ob);
-
 #endif /* __BKE_SMOKE_H__ */
diff --git a/source/blender/blenkernel/intern/depsgraph.c b/source/blender/blenkernel/intern/depsgraph.c
index 15fa3a6..e313ad7 100644
--- a/source/blender/blenkernel/intern/depsgraph.c
+++ b/source/blender/blenkernel/intern/depsgraph.c
@@ -80,7 +80,6 @@
 #include "BKE_pointcache.h"
 #include "BKE_scene.h"
 #include "BKE_screen.h"
-#include "BKE_smoke.h"
 #include "BKE_tracking.h"
 
 #include "GPU_buffers.h"
@@ -1888,40 +1887,6 @@ static void flush_pointcache_reset(Main *bmain, Scene *scene, DagNode *node,
 	}
 }
 
-/* node was checked to have lasttime != curtime, and is of type ID_OB */
-static void flush_openvdbcache_reset(Main *bmain, Scene *scene, DagNode *node,
-                                     int curtime, unsigned int lay, bool reset)
-{
-	DagAdjList *itA;
-	Object *ob;
-
-	node->lasttime = curtime;
-
-	for (itA = node->child; itA; itA = itA->next) {
-		if (itA->node->type != ID_OB) {
-			continue;
-		}
-
-		if (itA->node->lasttime != curtime) {
-			ob = (Object *)(itA->node->ob);
-
-			if (reset || (ob->recalc & OB_RECALC_ALL)) {
-				if (BKE_openvdb_cache_reset(ob)) {
-					/* Don't tag nodes which are on invisible layer. */
-					if (itA->node->lay & lay) {
-						ob->recalc |= OB_RECALC_DATA;
-						lib_id_recalc_data_tag(bmain, &ob->id);
-					}
-				}
-
-				flush_openvdbcache_reset(bmain, scene, itA->node, curtime, lay, true);
-			}
-			else
-				flush_openvdbcache_reset(bmain, scene, itA->node, curtime, lay, false);
-		}
-	}
-}
-
 /* flush layer flags to dependencies */
 static void dag_scene_flush_layers(Scene *sce, int lay)
 {
@@ -2037,24 +2002,12 @@ void DAG_scene_flush_update(Main *bmain, Scene *sce, unsigned int lay, const sho
 						lib_id_recalc_data_tag(bmain, &ob->id);
 					}
 
-					if (BKE_openvdb_cache_reset(ob)) {
-						ob->recalc |= OB_RECALC_DATA;
-						lib_id_recalc_data_tag(bmain, &ob->id);
-					}
-
 					flush_pointcache_reset(bmain, sce, itA->node, lasttime,
 					                       lay, true);
-
-					flush_openvdbcache_reset(bmain, sce, itA->node, lasttime,
-					                         lay, true);
 				}
-				else {
+				else
 					flush_pointcache_reset(bmain, sce, itA->node, lasttime,
 					                       lay, false);


@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list