Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2015-07-21 13:02:11 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2015-07-21 13:02:11 +0300
commitff3d535bc2a63092357533acbe7289556af956a0 (patch)
treed7d95cb579774490e48568464a5d568fdc5ddf60 /source/blender/makesdna/DNA_customdata_types.h
parentb91d64a3d1209b3e7a96d4fc79b39c58010d890a (diff)
Fix T45471: Blend file: Bad old_addr handling in mesh's customdata writing.
Issue is rather well explained in T45471: our current customdata writing code easily generates several different blocks in blend file with same 'old' address. This is bad, because those addresses are used as 'uid' during reading process (it kind of work in Blender's own reading process, by mere luck mostly, but breaks the file specs). Solution (suggested by Campbell, thanks) implemented by this patch is to avoid duplicating everything, and instead just overwrite what we needs to skip some cdlayers on write: * the CustomData's `totlayer` number; * the CustomData's `layers` array of CustomDataLayer (keeping its original address using the `writestruct_at_address` helper). New design allows us to get completely rid of the no_free flag stuff in `write_customdata()`. Note that this implies written data is **not** directly valid from Blend PoV, since its written typemap does not match written layers (this is not an issue because typemap is rebuilt on read anyway - and it's easy to fix this if really needed). Also, the backward compatibility saving of mface data remains an issue here, see comment in code. Reviewers: sergey, campbellbarton Projects: #bf_blender Maniphest Tasks: T45471 Differential Revision: https://developer.blender.org/D1425
Diffstat (limited to 'source/blender/makesdna/DNA_customdata_types.h')
-rw-r--r--source/blender/makesdna/DNA_customdata_types.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/source/blender/makesdna/DNA_customdata_types.h b/source/blender/makesdna/DNA_customdata_types.h
index 79be28bb1aa..3807bb296fd 100644
--- a/source/blender/makesdna/DNA_customdata_types.h
+++ b/source/blender/makesdna/DNA_customdata_types.h
@@ -193,6 +193,8 @@ enum {
#define DYNTOPO_NODE_NONE -1
+#define CD_TEMP_CHUNK_SIZE 128
+
#ifdef __cplusplus
}
#endif