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:
Diffstat (limited to 'source/blender/blenloader/intern')
-rw-r--r--source/blender/blenloader/intern/readfile.c84
-rw-r--r--source/blender/blenloader/intern/versioning_250.c2
-rw-r--r--source/blender/blenloader/intern/writefile.c80
3 files changed, 87 insertions, 79 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 5f5070f1173..d6853bba9b5 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -207,7 +207,7 @@
* - join all Mains
* - link all LibBlocks and indirect pointers to libblocks
* - initialize FileGlobal and copy pointers to Global
-*/
+ */
/* also occurs in library.c */
/* GS reads the memory pointed at in a specific ordering. There are,
@@ -3667,7 +3667,14 @@ static void lib_link_mesh(FileData *fd, Main *main)
if (me->mr && me->mr->levels.first)
lib_link_customdata_mtface(fd, me, &me->mr->fdata,
((MultiresLevel*)me->mr->levels.first)->totface);
-
+ }
+ }
+
+ /* convert texface options to material */
+ convert_tface_mt(fd, main);
+
+ for (me = main->mesh.first; me; me = me->id.next) {
+ if (me->id.flag & LIB_NEED_LINK) {
/*check if we need to convert mfaces to mpolys*/
if (me->totface && !me->totpoly) {
/* temporarily switch main so that reading from
@@ -3679,14 +3686,7 @@ static void lib_link_mesh(FileData *fd, Main *main)
G.main = gmain;
}
- }
- }
-
- /* convert texface options to material */
- convert_tface_mt(fd, main);
- for (me = main->mesh.first; me; me = me->id.next) {
- if (me->id.flag & LIB_NEED_LINK) {
/*
* Re-tessellate, even if the polys were just created from tessfaces, this
* is important because it:
@@ -3843,35 +3843,6 @@ static void direct_link_mesh(FileData *fd, Mesh *mesh)
direct_link_customdata(fd, &mesh->ldata, mesh->totloop);
direct_link_customdata(fd, &mesh->pdata, mesh->totpoly);
-
-#ifdef USE_BMESH_FORWARD_COMPAT
- /* NEVER ENABLE THIS CODE INTO BMESH!
- * THIS IS FOR LOADING BMESH INTO OLDER FILES ONLY */
- mesh->mpoly = newdataadr(fd, mesh->mpoly);
- mesh->mloop = newdataadr(fd, mesh->mloop);
-
- direct_link_customdata(fd, &mesh->pdata, mesh->totpoly);
- direct_link_customdata(fd, &mesh->ldata, mesh->totloop);
-
- if (mesh->mpoly) {
- /* be clever and load polygons as mfaces */
- mesh->totface= BKE_mesh_mpoly_to_mface(&mesh->fdata, &mesh->ldata, &mesh->pdata,
- mesh->totface, mesh->totloop, mesh->totpoly);
-
- CustomData_free(&mesh->pdata, mesh->totpoly);
- memset(&mesh->pdata, 0, sizeof(CustomData));
- mesh->totpoly = 0;
-
- CustomData_free(&mesh->ldata, mesh->totloop);
- memset(&mesh->ldata, 0, sizeof(CustomData));
- mesh->totloop = 0;
-
- mesh_update_customdata_pointers(mesh);
- }
-
-#endif
-
-
mesh->bb = NULL;
mesh->edit_btmesh = NULL;
@@ -7068,6 +7039,15 @@ static void do_version_ntree_keying_despill_balance(void *UNUSED(data), ID *UNUS
}
}
+static void do_version_ntree_tex_coord_from_dupli_264(void *UNUSED(data), ID *UNUSED(id), bNodeTree *ntree)
+{
+ bNode *node;
+
+ for (node = ntree->nodes.first; node; node = node->next)
+ if (node->type == SH_NODE_TEX_COORD)
+ node->flag |= NODE_OPTIONS;
+}
+
static void do_versions(FileData *fd, Library *lib, Main *main)
{
/* WATCH IT!!!: pointers from libdata have not been converted */
@@ -8016,6 +7996,34 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
}
+ /* correction for files saved in blender version when BKE_pose_copy_data
+ * didn't copy animation visualization, which lead to deadlocks on motion
+ * path calculation for proxied armatures, see [#32742]
+ */
+ if (main->versionfile < 264) {
+ Object *ob;
+
+ for (ob = main->object.first; ob; ob = ob->id.next) {
+ if (ob->pose) {
+ if (ob->pose->avs.path_step == 0) {
+ animviz_settings_init(&ob->pose->avs);
+ }
+ }
+ }
+ }
+
+ if (main->versionfile < 264 || (main->versionfile == 264 && main->subversionfile < 1)) {
+ bNodeTreeType *ntreetype = ntreeGetType(NTREE_SHADER);
+ bNodeTree *ntree;
+
+ if (ntreetype && ntreetype->foreach_nodetree)
+ ntreetype->foreach_nodetree(main, NULL, do_version_ntree_tex_coord_from_dupli_264);
+
+ for (ntree=main->nodetree.first; ntree; ntree=ntree->id.next)
+ if (ntree->type==NTREE_SHADER)
+ do_version_ntree_tex_coord_from_dupli_264(NULL, NULL, ntree);
+ }
+
/* WATCH IT!!!: pointers from libdata have not been converted yet here! */
/* WATCH IT 2!: Userdef struct init has to be in editors/interface/resources.c! */
diff --git a/source/blender/blenloader/intern/versioning_250.c b/source/blender/blenloader/intern/versioning_250.c
index 0d39b9011b2..c1849e6ec91 100644
--- a/source/blender/blenloader/intern/versioning_250.c
+++ b/source/blender/blenloader/intern/versioning_250.c
@@ -652,7 +652,7 @@ static void do_versions_seq_unique_name_all_strips(Scene * sce, ListBase *seqbas
Sequence * seq = seqbasep->first;
while (seq) {
- BKE_seqence_base_unique_name_recursive(&sce->ed->seqbase, seq);
+ BKE_sequence_base_unique_name_recursive(&sce->ed->seqbase, seq);
if (seq->seqbase.first) {
do_versions_seq_unique_name_all_strips(sce, &seq->seqbase);
}
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c
index b3effa62664..51c78cd2432 100644
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@ -30,46 +30,46 @@
/*
-FILEFORMAT: IFF-style structure (but not IFF compatible!)
-
-start file:
- BLENDER_V100 12 bytes (versie 1.00)
- V = big endian, v = little endian
- _ = 4 byte pointer, - = 8 byte pointer
-
-datablocks: also see struct BHead
- <bh.code> 4 chars
- <bh.len> int, len data after BHead
- <bh.old> void, old pointer
- <bh.SDNAnr> int
- <bh.nr> int, in case of array: amount of structs
- data
- ...
- ...
-
-Almost all data in Blender are structures. Each struct saved
-gets a BHead header. With BHead the struct can be linked again
-and compared with StructDNA .
-
-WRITE
-
-Preferred writing order: (not really a must, but why would you do it random?)
-Any case: direct data is ALWAYS after the lib block
-
-(Local file data)
-- for each LibBlock
- - write LibBlock
- - write associated direct data
-(External file data)
-- per library
- - write library block
- - per LibBlock
- - write the ID of LibBlock
-- write TEST (128x128, blend file preview, optional)
-- write FileGlobal (some global vars)
-- write SDNA
-- write USER if filename is ~/X.XX/config/startup.blend
-*/
+ * FILEFORMAT: IFF-style structure (but not IFF compatible!)
+ *
+ * start file:
+ * BLENDER_V100 12 bytes (versie 1.00)
+ * V = big endian, v = little endian
+ * _ = 4 byte pointer, - = 8 byte pointer
+ *
+ * datablocks: also see struct BHead
+ * <bh.code> 4 chars
+ * <bh.len> int, len data after BHead
+ * <bh.old> void, old pointer
+ * <bh.SDNAnr> int
+ * <bh.nr> int, in case of array: amount of structs
+ * data
+ * ...
+ * ...
+ *
+ * Almost all data in Blender are structures. Each struct saved
+ * gets a BHead header. With BHead the struct can be linked again
+ * and compared with StructDNA .
+ *
+ * WRITE
+ *
+ * Preferred writing order: (not really a must, but why would you do it random?)
+ * Any case: direct data is ALWAYS after the lib block
+ *
+ * (Local file data)
+ * - for each LibBlock
+ * - write LibBlock
+ * - write associated direct data
+ * (External file data)
+ * - per library
+ * - write library block
+ * - per LibBlock
+ * - write the ID of LibBlock
+ * - write TEST (128x128, blend file preview, optional)
+ * - write FileGlobal (some global vars)
+ * - write SDNA
+ * - write USER if filename is ~/X.XX/config/startup.blend
+ */
#include <math.h>