Commit: 664d6ad6c6fa8f3df2aed5d73c86c2b57fe241f4
Author: Sebastián Barschkis
Date:   Wed Jun 8 16:22:40 2016 +0200
Branches: fluid-mantaflow
https://developer.blender.org/rB664d6ad6c6fa8f3df2aed5d73c86c2b57fe241f4

first customizations for liquid caching - extending the smoke cache

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

M       release/scripts/startup/bl_ui/properties_physics_smoke.py
M       source/blender/blenkernel/BKE_pointcache.h
M       source/blender/makesdna/DNA_smoke_types.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 12c4075..ef36548 100644
--- a/release/scripts/startup/bl_ui/properties_physics_smoke.py
+++ b/release/scripts/startup/bl_ui/properties_physics_smoke.py
@@ -327,6 +327,9 @@ class PHYSICS_PT_smoke_cache(PhysicButtonsPanel, Panel):
             row = layout.row()
             row.label("Data Depth:")
             row.prop(domain, "data_depth", expand=True, text="Data Depth")
+        elif cache_file_format == 'OBJECT':
+            layout.label(text="Compression:")
+            layout.prop(domain, "liquid_cache_compress_type", expand=True)
 
         cache = domain.point_cache
         point_cache_ui(self, context, cache, (cache.is_baked is False), 
'SMOKE')
diff --git a/source/blender/blenkernel/BKE_pointcache.h 
b/source/blender/blenkernel/BKE_pointcache.h
index 8238ea6..d955072 100644
--- a/source/blender/blenkernel/BKE_pointcache.h
+++ b/source/blender/blenkernel/BKE_pointcache.h
@@ -125,6 +125,7 @@ typedef struct PTCacheFile {
 enum {
        PTCACHE_FILE_PTCACHE = 0,
        PTCACHE_FILE_OPENVDB = 1,
+       PTCACHE_FILE_LIQUID = 2,
 };
 
 typedef struct PTCacheID {
diff --git a/source/blender/makesdna/DNA_smoke_types.h 
b/source/blender/makesdna/DNA_smoke_types.h
index bf321e1..40917e4 100644
--- a/source/blender/makesdna/DNA_smoke_types.h
+++ b/source/blender/makesdna/DNA_smoke_types.h
@@ -153,6 +153,9 @@ typedef struct SmokeDomainSettings {
        char cache_file_format;
        char data_depth;
        char pad[2];
+       /* Liquid cache options */
+       int liquid_cache_comp;
+       char mock_pad[4]; /* unused */
 
        /* Smoke uses only one cache from now on (index [0]), but keeping the 
array for now for reading old files. */
        struct PointCache *point_cache[2];      /* definition is in 
DNA_object_force.h */
diff --git a/source/blender/makesrna/intern/rna_smoke.c 
b/source/blender/makesrna/intern/rna_smoke.c
index c25e8d3..82a3d51 100644
--- a/source/blender/makesrna/intern/rna_smoke.c
+++ b/source/blender/makesrna/intern/rna_smoke.c
@@ -436,6 +436,12 @@ static void rna_def_smoke_domain_settings(BlenderRNA *brna)
                {SM_CACHE_HEAVY, "CACHEHEAVY", 0, "Heavy", "Effective but slow 
compression"},
                {0, NULL, 0, NULL, NULL}
        };
+       
+       static EnumPropertyItem liquid_cache_comp_items[] = {
+               {SM_CACHE_LIGHT, "CACHELIGHT", 0, "Light", "Write .bobj.gz 
files, smaller in size than .obj"},
+               {SM_CACHE_HEAVY, "CACHEHEAVY", 0, "Heavy", "Write .obj files 
(not yet implemented)"},
+               {0, NULL, 0, NULL, NULL}
+       };
 
        static EnumPropertyItem smoke_highres_sampling_items[] = {
                {SM_HRES_FULLSAMPLE, "FULLSAMPLE", 0, "Full Sample", ""},
@@ -463,6 +469,9 @@ static void rna_def_smoke_domain_settings(BlenderRNA *brna)
 #ifdef WITH_OPENVDB
                {PTCACHE_FILE_OPENVDB, "OPENVDB", 0, "OpenVDB", "OpenVDB file 
format"},
 #endif
+#ifdef WITH_MANTA
+               {PTCACHE_FILE_LIQUID, "OBJECT", 0, "Object files ", "Obj file 
format"},
+#endif
                {0, NULL, 0, NULL, NULL}
        };
 
@@ -586,6 +595,11 @@ static void rna_def_smoke_domain_settings(BlenderRNA *brna)
        RNA_def_property_enum_sdna(prop, NULL, "openvdb_comp");
        RNA_def_property_enum_items(prop, prop_compression_items);
        RNA_def_property_ui_text(prop, "Compression", "Compression method to be 
used");
+       
+       prop = RNA_def_property(srna, "liquid_cache_compress_type", PROP_ENUM, 
PROP_NONE);
+       RNA_def_property_enum_sdna(prop, NULL, "liquid_cache_comp");
+       RNA_def_property_enum_items(prop, liquid_cache_comp_items);
+       RNA_def_property_ui_text(prop, "Cache Compression", "Compression method 
to be used");
 
        prop = RNA_def_property(srna, "data_depth", PROP_ENUM, PROP_NONE);
        RNA_def_property_enum_bitflag_sdna(prop, NULL, "data_depth");

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to