diff options
Diffstat (limited to 'source/blender/blenloader/intern')
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 52 | ||||
-rw-r--r-- | source/blender/blenloader/intern/versioning_250.c | 14 |
2 files changed, 55 insertions, 11 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 0dac27b13cc..a45e517d6c3 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -6976,17 +6976,24 @@ static void do_versions_nodetree_multi_file_output_format_2_62_1(Scene *sce, bNo node->storage = nimf; - /* split off filename from the old path, to be used as socket sub-path */ - BLI_split_dirfile(old_data->name, basepath, filename, sizeof(basepath), sizeof(filename)); - - BLI_strncpy(nimf->base_path, basepath, sizeof(nimf->base_path)); - nimf->format = old_data->im_format; + /* looks like storage data can be messed up somehow, stupid check here */ + if (old_data) { + /* split off filename from the old path, to be used as socket sub-path */ + BLI_split_dirfile(old_data->name, basepath, filename, sizeof(basepath), sizeof(filename)); + + BLI_strncpy(nimf->base_path, basepath, sizeof(nimf->base_path)); + nimf->format = old_data->im_format; + } + else { + basepath[0] = '\0'; + BLI_strncpy(filename, old_image->name, sizeof(filename)); + } /* if z buffer is saved, change the image type to multilayer exr. * XXX this is slightly messy, Z buffer was ignored before for anything but EXR and IRIS ... * i'm just assuming here that IRIZ means IRIS with z buffer ... */ - if (ELEM(old_data->im_format.imtype, R_IMF_IMTYPE_IRIZ, R_IMF_IMTYPE_OPENEXR)) { + if (old_data && ELEM(old_data->im_format.imtype, R_IMF_IMTYPE_IRIZ, R_IMF_IMTYPE_OPENEXR)) { char sockpath[FILE_MAX]; nimf->format.imtype = R_IMF_IMTYPE_MULTILAYER; @@ -7021,7 +7028,8 @@ static void do_versions_nodetree_multi_file_output_format_2_62_1(Scene *sce, bNo nodeRemoveSocket(ntree, node, old_image); nodeRemoveSocket(ntree, node, old_z); - MEM_freeN(old_data); + if (old_data) + MEM_freeN(old_data); } else if (node->type==CMP_NODE_OUTPUT_MULTI_FILE__DEPRECATED) { NodeImageMultiFile *nimf = node->storage; @@ -7163,6 +7171,21 @@ static void do_version_ntree_image_user_264(void *UNUSED(data), ID *UNUSED(id), } } +static void do_version_ntree_dilateerode_264(void *UNUSED(data), ID *UNUSED(id), bNodeTree *ntree) +{ + bNode *node; + + for (node = ntree->nodes.first; node; node = node->next) { + if (node->type == CMP_NODE_DILATEERODE) { + if (node->storage == NULL) { + NodeDilateErode *data = MEM_callocN(sizeof(NodeDilateErode), __func__); + data->falloff = PROP_SMOOTH; + node->storage = data; + } + } + } +} + static void do_versions(FileData *fd, Library *lib, Main *main) { /* WATCH IT!!!: pointers from libdata have not been converted */ @@ -7962,6 +7985,21 @@ static void do_versions(FileData *fd, Library *lib, Main *main) } } + if (main->versionfile < 263 || (main->versionfile == 263 && main->subversionfile < 12)) { + Material *ma; + + for (ma = main->mat.first; ma; ma = ma->id.next) + if (ma->strand_widthfade == 2.0f) + ma->strand_widthfade = 0.0f; + } + + if (main->versionfile < 263 || (main->versionfile == 263 && main->subversionfile < 13)) { + bNodeTreeType *ntreetype = ntreeGetType(NTREE_COMPOSIT); + + if (ntreetype && ntreetype->foreach_nodetree) + ntreetype->foreach_nodetree(main, NULL, do_version_ntree_dilateerode_264); + } + /* default values in Freestyle settings */ { Scene *sce; diff --git a/source/blender/blenloader/intern/versioning_250.c b/source/blender/blenloader/intern/versioning_250.c index 5ed39ad5307..bfaa526b995 100644 --- a/source/blender/blenloader/intern/versioning_250.c +++ b/source/blender/blenloader/intern/versioning_250.c @@ -2558,11 +2558,11 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main) for (ob = main->object.first; ob; ob = ob->id.next) { for (act = ob->actuators.first; act; act = act->next) { if (act->type == ACT_IPO) { - // Create the new actuator + /* Create the new actuator */ ia = act->data; aa = MEM_callocN(sizeof(bActionActuator), "fcurve -> action actuator do_version"); - // Copy values + /* Copy values */ aa->type = ia->type; aa->flag = ia->flag; aa->sta = ia->sta; @@ -2572,12 +2572,18 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main) if (ob->adt) aa->act = ob->adt->action; - // Get rid of the old actuator + /* Get rid of the old actuator */ MEM_freeN(ia); - // Assign the new actuator + /* Assign the new actuator */ act->data = aa; act->type = act->otype = ACT_ACTION; + + /* Fix for converting 2.4x files: if we don't have an action, but we have an + object IPO, then leave the actuator as an IPO actuator for now and let the + IPO conversion code handle it */ + if (ob->ipo && !aa->act) + act->type = ACT_IPO; } else if (act->type == ACT_SHAPEACTION) { act->type = act->otype = ACT_ACTION; |