diff options
-rw-r--r-- | source/blender/blenkernel/intern/scene.c | 110 | ||||
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 109 |
2 files changed, 109 insertions, 110 deletions
diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index 36bfec8f9ec..bed10df5ace 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -1549,6 +1549,114 @@ static void scene_blend_read_lib(BlendLibReader *reader, ID *id) #endif } +static void scene_blend_read_expand(BlendExpander *expander, ID *id) +{ + Scene *sce = (Scene *)id; + + LISTBASE_FOREACH (Base *, base_legacy, &sce->base) { + BLO_expand(expander, base_legacy->object); + } + BLO_expand(expander, sce->camera); + BLO_expand(expander, sce->world); + + BKE_keyingsets_blend_read_expand(expander, &sce->keyingsets); + + if (sce->set) { + BLO_expand(expander, sce->set); + } + + LISTBASE_FOREACH (SceneRenderLayer *, srl, &sce->r.layers) { + BLO_expand(expander, srl->mat_override); + LISTBASE_FOREACH (FreestyleModuleConfig *, module, &srl->freestyleConfig.modules) { + if (module->script) { + BLO_expand(expander, module->script); + } + } + LISTBASE_FOREACH (FreestyleLineSet *, lineset, &srl->freestyleConfig.linesets) { + if (lineset->group) { + BLO_expand(expander, lineset->group); + } + BLO_expand(expander, lineset->linestyle); + } + } + + LISTBASE_FOREACH (ViewLayer *, view_layer, &sce->view_layers) { + IDP_BlendReadExpand(expander, view_layer->id_properties); + + LISTBASE_FOREACH (FreestyleModuleConfig *, module, &view_layer->freestyle_config.modules) { + if (module->script) { + BLO_expand(expander, module->script); + } + } + + LISTBASE_FOREACH (FreestyleLineSet *, lineset, &view_layer->freestyle_config.linesets) { + if (lineset->group) { + BLO_expand(expander, lineset->group); + } + BLO_expand(expander, lineset->linestyle); + } + } + + if (sce->gpd) { + BLO_expand(expander, sce->gpd); + } + + if (sce->ed) { + Sequence *seq; + + SEQ_ALL_BEGIN (sce->ed, seq) { + IDP_BlendReadExpand(expander, seq->prop); + + if (seq->scene) { + BLO_expand(expander, seq->scene); + } + if (seq->scene_camera) { + BLO_expand(expander, seq->scene_camera); + } + if (seq->clip) { + BLO_expand(expander, seq->clip); + } + if (seq->mask) { + BLO_expand(expander, seq->mask); + } + if (seq->sound) { + BLO_expand(expander, seq->sound); + } + + if (seq->type == SEQ_TYPE_TEXT && seq->effectdata) { + TextVars *data = seq->effectdata; + BLO_expand(expander, data->text_font); + } + } + SEQ_ALL_END; + } + + if (sce->rigidbody_world) { + BLO_expand(expander, sce->rigidbody_world->group); + BLO_expand(expander, sce->rigidbody_world->constraints); + } + + LISTBASE_FOREACH (TimeMarker *, marker, &sce->markers) { + IDP_BlendReadExpand(expander, marker->prop); + + if (marker->camera) { + BLO_expand(expander, marker->camera); + } + } + + BLO_expand(expander, sce->clip); + +#ifdef USE_COLLECTION_COMPAT_28 + if (sce->collection) { + BKE_collection_compat_blend_read_expand(expander, sce->collection); + } +#endif + + if (sce->r.bake.cage_object) { + BLO_expand(expander, sce->r.bake.cage_object); + } +} + static void scene_undo_preserve(BlendLibReader *reader, ID *id_new, ID *id_old) { Scene *scene_new = (Scene *)id_new; @@ -1587,7 +1695,7 @@ IDTypeInfo IDType_ID_SCE = { .blend_write = scene_blend_write, .blend_read_data = scene_blend_read_data, .blend_read_lib = scene_blend_read_lib, - .blend_read_expand = NULL, + .blend_read_expand = scene_blend_read_expand, .blend_read_undo_preserve = scene_undo_preserve, }; diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index c321424ea7c..29956b85db5 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -5994,112 +5994,6 @@ static void expand_object(BlendExpander *expander, Object *ob) } } -static void expand_scene(BlendExpander *expander, Scene *sce) -{ - LISTBASE_FOREACH (Base *, base_legacy, &sce->base) { - BLO_expand(expander, base_legacy->object); - } - BLO_expand(expander, sce->camera); - BLO_expand(expander, sce->world); - - BKE_keyingsets_blend_read_expand(expander, &sce->keyingsets); - - if (sce->set) { - BLO_expand(expander, sce->set); - } - - LISTBASE_FOREACH (SceneRenderLayer *, srl, &sce->r.layers) { - BLO_expand(expander, srl->mat_override); - LISTBASE_FOREACH (FreestyleModuleConfig *, module, &srl->freestyleConfig.modules) { - if (module->script) { - BLO_expand(expander, module->script); - } - } - LISTBASE_FOREACH (FreestyleLineSet *, lineset, &srl->freestyleConfig.linesets) { - if (lineset->group) { - BLO_expand(expander, lineset->group); - } - BLO_expand(expander, lineset->linestyle); - } - } - - LISTBASE_FOREACH (ViewLayer *, view_layer, &sce->view_layers) { - IDP_BlendReadExpand(expander, view_layer->id_properties); - - LISTBASE_FOREACH (FreestyleModuleConfig *, module, &view_layer->freestyle_config.modules) { - if (module->script) { - BLO_expand(expander, module->script); - } - } - - LISTBASE_FOREACH (FreestyleLineSet *, lineset, &view_layer->freestyle_config.linesets) { - if (lineset->group) { - BLO_expand(expander, lineset->group); - } - BLO_expand(expander, lineset->linestyle); - } - } - - if (sce->gpd) { - BLO_expand(expander, sce->gpd); - } - - if (sce->ed) { - Sequence *seq; - - SEQ_ALL_BEGIN (sce->ed, seq) { - IDP_BlendReadExpand(expander, seq->prop); - - if (seq->scene) { - BLO_expand(expander, seq->scene); - } - if (seq->scene_camera) { - BLO_expand(expander, seq->scene_camera); - } - if (seq->clip) { - BLO_expand(expander, seq->clip); - } - if (seq->mask) { - BLO_expand(expander, seq->mask); - } - if (seq->sound) { - BLO_expand(expander, seq->sound); - } - - if (seq->type == SEQ_TYPE_TEXT && seq->effectdata) { - TextVars *data = seq->effectdata; - BLO_expand(expander, data->text_font); - } - } - SEQ_ALL_END; - } - - if (sce->rigidbody_world) { - BLO_expand(expander, sce->rigidbody_world->group); - BLO_expand(expander, sce->rigidbody_world->constraints); - } - - LISTBASE_FOREACH (TimeMarker *, marker, &sce->markers) { - IDP_BlendReadExpand(expander, marker->prop); - - if (marker->camera) { - BLO_expand(expander, marker->camera); - } - } - - BLO_expand(expander, sce->clip); - -#ifdef USE_COLLECTION_COMPAT_28 - if (sce->collection) { - BKE_collection_compat_blend_read_expand(expander, sce->collection); - } -#endif - - if (sce->r.bake.cage_object) { - BLO_expand(expander, sce->r.bake.cage_object); - } -} - /** * Set the callback func used over all ID data found by \a BLO_expand_main func. * @@ -6146,9 +6040,6 @@ void BLO_expand_main(void *fdhandle, Main *mainvar) case ID_OB: expand_object(&expander, (Object *)id); break; - case ID_SCE: - expand_scene(&expander, (Scene *)id); - break; case ID_IP: expand_ipo(&expander, (Ipo *)id); /* XXX deprecated - old animation system */ break; |