Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenloader/intern/readfile.c
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
| Show First 20 Lines • Show All 5,311 Lines • ▼ Show 20 Lines | for (level = ob->lodlevels.first; level; level = level->next) { | ||||
| level->source = newlibadr(fd, ob->id.lib, level->source); | level->source = newlibadr(fd, ob->id.lib, level->source); | ||||
| if (!level->source && level == ob->lodlevels.first) { | if (!level->source && level == ob->lodlevels.first) { | ||||
| level->source = ob; | level->source = ob; | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| for (BakePass *bp = ob->bake_passes.first; bp; bp = bp->next) { | |||||
| bp->image = newlibadr(fd, ob->id.lib, bp->image); | |||||
| bp->material = newlibadr(fd, ob->id.lib, bp->material); | |||||
| bp->cage_object = newlibadr(fd, ob->id.lib, bp->cage_object); | |||||
| bp->bake_from_collection = newlibadr(fd, ob->id.lib, bp->bake_from_collection); | |||||
| } | |||||
| if (warn) { | if (warn) { | ||||
| BKE_report(fd->reports, RPT_WARNING, "Warning in console"); | BKE_report(fd->reports, RPT_WARNING, "Warning in console"); | ||||
| } | } | ||||
| } | } | ||||
| /* direct data for cache */ | /* direct data for cache */ | ||||
| static void direct_link_motionpath(FileData *fd, bMotionPath *mpath) | static void direct_link_motionpath(FileData *fd, bMotionPath *mpath) | ||||
| { | { | ||||
| ▲ Show 20 Lines • Show All 646 Lines • ▼ Show 20 Lines | if (NULL == BKE_shaderfxType_getInfo(fx->type)) { | ||||
| fx->type = eShaderFxType_None; | fx->type = eShaderFxType_None; | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| static void direct_link_object(FileData *fd, Object *ob) | static void direct_link_object(FileData *fd, Object *ob) | ||||
| { | { | ||||
| PartEff *paf; | PartEff *paf; | ||||
| BakePass *bp; | |||||
| /* XXX This should not be needed - but seems like it can happen in some cases, | /* XXX This should not be needed - but seems like it can happen in some cases, | ||||
| * so for now play safe. */ | * so for now play safe. */ | ||||
| ob->proxy_from = NULL; | ob->proxy_from = NULL; | ||||
| /* loading saved files with editmode enabled works, but for undo we like | /* loading saved files with editmode enabled works, but for undo we like | ||||
| * to stay in object mode during undo presses so keep editmode disabled. | * to stay in object mode during undo presses so keep editmode disabled. | ||||
| * | * | ||||
| ▲ Show 20 Lines • Show All 189 Lines • ▼ Show 20 Lines | if (fd->memfile && (ob->mode & OB_MODE_ALL_SCULPT)) { | ||||
| BKE_object_sculpt_data_create(ob); | BKE_object_sculpt_data_create(ob); | ||||
| } | } | ||||
| } | } | ||||
| link_list(fd, &ob->lodlevels); | link_list(fd, &ob->lodlevels); | ||||
| ob->currentlod = ob->lodlevels.first; | ob->currentlod = ob->lodlevels.first; | ||||
| ob->preview = direct_link_preview_image(fd, ob->preview); | ob->preview = direct_link_preview_image(fd, ob->preview); | ||||
| link_list(fd, &ob->bake_passes); | |||||
| for (bp = ob->bake_passes.first; bp; bp = bp->next) { | |||||
| bp->prop = newdataadr(fd, bp->prop); | |||||
| IDP_DirectLinkGroup_OrFree(&bp->prop, (fd->flags & FD_FLAGS_SWITCH_ENDIAN), fd); | |||||
| } | |||||
| } | } | ||||
| static void direct_link_view_settings(FileData *fd, ColorManagedViewSettings *view_settings) | static void direct_link_view_settings(FileData *fd, ColorManagedViewSettings *view_settings) | ||||
| { | { | ||||
| view_settings->curve_mapping = newdataadr(fd, view_settings->curve_mapping); | view_settings->curve_mapping = newdataadr(fd, view_settings->curve_mapping); | ||||
| if (view_settings->curve_mapping) { | if (view_settings->curve_mapping) { | ||||
| direct_link_curvemapping(fd, view_settings->curve_mapping); | direct_link_curvemapping(fd, view_settings->curve_mapping); | ||||
| ▲ Show 20 Lines • Show All 472 Lines • ▼ Show 20 Lines | if (sce->collection) { | ||||
| lib_link_scene_collection(fd, sce->id.lib, sce->collection); | lib_link_scene_collection(fd, sce->id.lib, sce->collection); | ||||
| } | } | ||||
| #endif | #endif | ||||
| for (ViewLayer *view_layer = sce->view_layers.first; view_layer; view_layer = view_layer->next) { | for (ViewLayer *view_layer = sce->view_layers.first; view_layer; view_layer = view_layer->next) { | ||||
| lib_link_view_layer(fd, sce->id.lib, view_layer); | lib_link_view_layer(fd, sce->id.lib, view_layer); | ||||
| } | } | ||||
| if (sce->r.bake.cage_object) { | |||||
| sce->r.bake.cage_object = newlibadr(fd, sce->id.lib, sce->r.bake.cage_object); | |||||
| } | |||||
| #ifdef USE_SETSCENE_CHECK | #ifdef USE_SETSCENE_CHECK | ||||
| if (sce->set != NULL) { | if (sce->set != NULL) { | ||||
| sce->flag |= SCE_READFILE_LIBLINK_NEED_SETSCENE_CHECK; | sce->flag |= SCE_READFILE_LIBLINK_NEED_SETSCENE_CHECK; | ||||
| } | } | ||||
| #endif | #endif | ||||
| } | } | ||||
| static void lib_link_scenes_check_set(Main *bmain) | static void lib_link_scenes_check_set(Main *bmain) | ||||
| ▲ Show 20 Lines • Show All 4,368 Lines • ▼ Show 20 Lines | static void expand_object_expandModifiers(void *userData, | ||||
| expand_doit(fd, mainvar, *idpoin); | expand_doit(fd, mainvar, *idpoin); | ||||
| } | } | ||||
| static void expand_object(FileData *fd, Main *mainvar, Object *ob) | static void expand_object(FileData *fd, Main *mainvar, Object *ob) | ||||
| { | { | ||||
| ParticleSystem *psys; | ParticleSystem *psys; | ||||
| bActionStrip *strip; | bActionStrip *strip; | ||||
| PartEff *paf; | PartEff *paf; | ||||
| BakePass *bp; | |||||
| int a; | int a; | ||||
| expand_doit(fd, mainvar, ob->data); | expand_doit(fd, mainvar, ob->data); | ||||
| /* expand_object_expandModifier() */ | /* expand_object_expandModifier() */ | ||||
| if (ob->modifiers.first) { | if (ob->modifiers.first) { | ||||
| struct { | struct { | ||||
| FileData *fd; | FileData *fd; | ||||
| ▲ Show 20 Lines • Show All 91 Lines • ▼ Show 20 Lines | static void expand_object(FileData *fd, Main *mainvar, Object *ob) | ||||
| } | } | ||||
| if (ob->currentlod) { | if (ob->currentlod) { | ||||
| LodLevel *level; | LodLevel *level; | ||||
| for (level = ob->lodlevels.first; level; level = level->next) { | for (level = ob->lodlevels.first; level; level = level->next) { | ||||
| expand_doit(fd, mainvar, level->source); | expand_doit(fd, mainvar, level->source); | ||||
| } | } | ||||
| } | } | ||||
| for (bp = ob->bake_passes.first; bp; bp = bp->next) { | |||||
| expand_doit(fd, mainvar, bp->image); | |||||
| expand_doit(fd, mainvar, bp->material); | |||||
| expand_doit(fd, mainvar, bp->cage_object); | |||||
| expand_doit(fd, mainvar, bp->bake_from_collection); | |||||
| } | |||||
| } | } | ||||
| #ifdef USE_COLLECTION_COMPAT_28 | #ifdef USE_COLLECTION_COMPAT_28 | ||||
| static void expand_scene_collection(FileData *fd, Main *mainvar, SceneCollection *sc) | static void expand_scene_collection(FileData *fd, Main *mainvar, SceneCollection *sc) | ||||
| { | { | ||||
| for (LinkData *link = sc->objects.first; link; link = link->next) { | for (LinkData *link = sc->objects.first; link; link = link->next) { | ||||
| expand_doit(fd, mainvar, link->data); | expand_doit(fd, mainvar, link->data); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 102 Lines • ▼ Show 20 Lines | static void expand_scene(FileData *fd, Main *mainvar, Scene *sce) | ||||
| expand_doit(fd, mainvar, sce->clip); | expand_doit(fd, mainvar, sce->clip); | ||||
| #ifdef USE_COLLECTION_COMPAT_28 | #ifdef USE_COLLECTION_COMPAT_28 | ||||
| if (sce->collection) { | if (sce->collection) { | ||||
| expand_scene_collection(fd, mainvar, sce->collection); | expand_scene_collection(fd, mainvar, sce->collection); | ||||
| } | } | ||||
| #endif | #endif | ||||
| if (sce->r.bake.cage_object) { | |||||
| expand_doit(fd, mainvar, sce->r.bake.cage_object); | |||||
| } | |||||
| } | } | ||||
| static void expand_camera(FileData *fd, Main *mainvar, Camera *ca) | static void expand_camera(FileData *fd, Main *mainvar, Camera *ca) | ||||
| { | { | ||||
| expand_doit(fd, mainvar, ca->ipo); // XXX deprecated - old animation system | expand_doit(fd, mainvar, ca->ipo); // XXX deprecated - old animation system | ||||
| for (CameraBGImage *bgpic = ca->bg_images.first; bgpic; bgpic = bgpic->next) { | for (CameraBGImage *bgpic = ca->bg_images.first; bgpic; bgpic = bgpic->next) { | ||||
| if (bgpic->source == CAM_BGIMG_SOURCE_IMAGE) { | if (bgpic->source == CAM_BGIMG_SOURCE_IMAGE) { | ||||
| ▲ Show 20 Lines • Show All 1,144 Lines • Show Last 20 Lines | |||||