Commit: 013baf14077722547a5af3b532376fef801830b8
Author: Kévin Dietrich
Date:   Thu Jun 9 15:06:33 2016 +0200
Branches: alembic_basic_io
https://developer.blender.org/rB013baf14077722547a5af3b532376fef801830b8

Move is_sequence property from cache modifier to CacheFile.

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

M       source/blender/alembic/intern/abc_object.cc
M       source/blender/alembic/intern/alembic_capi.cc
M       source/blender/makesdna/DNA_cachefile_types.h
M       source/blender/makesdna/DNA_modifier_types.h
M       source/blender/makesrna/intern/rna_cachefile.c
M       source/blender/makesrna/intern/rna_modifier.c
M       source/blender/modifiers/intern/MOD_meshsequencecache.c

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

diff --git a/source/blender/alembic/intern/abc_object.cc 
b/source/blender/alembic/intern/abc_object.cc
index 84da55a..1c2e0c5 100644
--- a/source/blender/alembic/intern/abc_object.cc
+++ b/source/blender/alembic/intern/abc_object.cc
@@ -416,7 +416,6 @@ void AbcObjectReader::addDefaultModifier(Main *bmain) const
 
        mcmd->cache_file = m_settings->cache_file;
        BLI_strncpy(mcmd->abc_object_path, m_iobject.getFullName().c_str(), 
1024);
-       mcmd->is_sequence = m_settings->is_sequence;
 
        DAG_id_tag_update(&m_object->id, OB_RECALC_DATA);
        DAG_relations_tag_update(bmain);
diff --git a/source/blender/alembic/intern/alembic_capi.cc 
b/source/blender/alembic/intern/alembic_capi.cc
index 019ca4c..83696ea 100644
--- a/source/blender/alembic/intern/alembic_capi.cc
+++ b/source/blender/alembic/intern/alembic_capi.cc
@@ -483,8 +483,12 @@ static void import_startjob(void *cjv, short *stop, short 
*do_update, float *pro
                return;
        }
 
-       data->settings.cache_file = static_cast<CacheFile 
*>(BKE_libblock_alloc(data->bmain, ID_CF, BLI_path_basename(data->filename)));
-       BLI_strncpy(data->settings.cache_file->filepath, data->filename, 1024);
+       CacheFile *cache_file = static_cast<CacheFile 
*>(BKE_libblock_alloc(data->bmain, ID_CF, BLI_path_basename(data->filename)));
+
+       cache_file->is_sequence = data->settings.is_sequence;
+       BLI_strncpy(cache_file->filepath, data->filename, 1024);
+
+       data->settings.cache_file = cache_file;
 
        *data->do_update = true;
        *data->progress = 0.05f;
diff --git a/source/blender/makesdna/DNA_cachefile_types.h 
b/source/blender/makesdna/DNA_cachefile_types.h
index 21a772b..95065db 100644
--- a/source/blender/makesdna/DNA_cachefile_types.h
+++ b/source/blender/makesdna/DNA_cachefile_types.h
@@ -40,6 +40,8 @@ typedef struct CacheFile {
        ID id;
 
        char filepath[1024];
+       char is_sequence;
+       char pad[7];
 } CacheFile;
 
 #ifdef __cplusplus
diff --git a/source/blender/makesdna/DNA_modifier_types.h 
b/source/blender/makesdna/DNA_modifier_types.h
index f5a4a6a..16861d0 100644
--- a/source/blender/makesdna/DNA_modifier_types.h
+++ b/source/blender/makesdna/DNA_modifier_types.h
@@ -1551,8 +1551,6 @@ typedef struct MeshSeqCacheModifierData {
 
        struct CacheFile *cache_file;
        char abc_object_path[1024];
-       char is_sequence;
-       char pad[7];
 } MeshSeqCacheModifierData;
 
 #endif  /* __DNA_MODIFIER_TYPES_H__ */
diff --git a/source/blender/makesrna/intern/rna_cachefile.c 
b/source/blender/makesrna/intern/rna_cachefile.c
index 41290d3..0d9fb12 100644
--- a/source/blender/makesrna/intern/rna_cachefile.c
+++ b/source/blender/makesrna/intern/rna_cachefile.c
@@ -43,6 +43,10 @@ static void rna_def_cachefile(BlenderRNA *brna)
        PropertyRNA *prop = RNA_def_property(srna, "filepath", PROP_STRING, 
PROP_FILEPATH);
        RNA_def_property_ui_text(prop, "File Path", "Path to external 
displacements file");
        RNA_def_property_update(prop, 0, NULL);
+
+       prop = RNA_def_property(srna, "is_sequence", PROP_BOOLEAN, PROP_NONE);
+       RNA_def_property_ui_text(prop, "Sequence", "Whether the cache is 
separated in a series of files");
+       RNA_def_property_update(prop, 0, NULL);
 }
 
 void RNA_def_cachefile(BlenderRNA *brna)
diff --git a/source/blender/makesrna/intern/rna_modifier.c 
b/source/blender/makesrna/intern/rna_modifier.c
index b9bedef..2b52259 100644
--- a/source/blender/makesrna/intern/rna_modifier.c
+++ b/source/blender/makesrna/intern/rna_modifier.c
@@ -4250,10 +4250,6 @@ static void rna_def_modifier_meshseqcache(BlenderRNA 
*brna)
        prop = RNA_def_property(srna, "abc_object_path", PROP_STRING, 
PROP_NONE);
        RNA_def_property_ui_text(prop, "Object", "Path to the object in the 
Alembic archive");
        RNA_def_property_update(prop, 0, "rna_Modifier_update");
-
-       prop = RNA_def_property(srna, "is_sequence", PROP_BOOLEAN, PROP_NONE);
-       RNA_def_property_ui_text(prop, "Sequence", "Whether the cache is 
separated in a series of files");
-       RNA_def_property_update(prop, 0, "rna_Modifier_update");
 }
 
 static void rna_def_modifier_laplaciandeform(BlenderRNA *brna)
diff --git a/source/blender/modifiers/intern/MOD_meshsequencecache.c 
b/source/blender/modifiers/intern/MOD_meshsequencecache.c
index f63f22d..3104a60 100644
--- a/source/blender/modifiers/intern/MOD_meshsequencecache.c
+++ b/source/blender/modifiers/intern/MOD_meshsequencecache.c
@@ -49,7 +49,6 @@ static void initData(ModifierData *md)
 
        mcmd->cache_file = NULL;
        mcmd->abc_object_path[0] = '\0';
-       mcmd->is_sequence = false;
 }
 
 static void copyData(ModifierData *md, ModifierData *target)
@@ -86,7 +85,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object 
*ob,
        int fframe;
        int frame_len;
 
-       if (mcmd->is_sequence && BLI_path_frame_get(filepath, &fframe, 
&frame_len)) {
+       if (mcmd->cache_file->is_sequence && BLI_path_frame_get(filepath, 
&fframe, &frame_len)) {
                char ext[32];
                BLI_path_frame_strip(filepath, true, ext);
                BLI_path_frame(filepath, frame, frame_len);
@@ -128,7 +127,7 @@ static void deformVerts(ModifierData *md, Object *ob,
        int fframe;
        int frame_len;
 
-       if (mcmd->is_sequence && BLI_path_frame_get(filepath, &fframe, 
&frame_len)) {
+       if (mcmd->cache_file->is_sequence && BLI_path_frame_get(filepath, 
&fframe, &frame_len)) {
                char ext[32];
                BLI_path_frame_strip(filepath, true, ext);
                BLI_path_frame(filepath, frame, frame_len);

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to