diff options
-rw-r--r-- | source/blender/blenkernel/intern/lib_query.c | 7 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/world.c | 12 |
2 files changed, 13 insertions, 6 deletions
diff --git a/source/blender/blenkernel/intern/lib_query.c b/source/blender/blenkernel/intern/lib_query.c index 578f59fb027..8100c42f261 100644 --- a/source/blender/blenkernel/intern/lib_query.c +++ b/source/blender/blenkernel/intern/lib_query.c @@ -934,16 +934,11 @@ static void library_foreach_ID_link(Main *bmain, } case ID_KE: { - BLI_assert(0); break; } case ID_WO: { - World *world = (World *)id; - if (world->nodetree) { - /* nodetree **are owned by IDs**, treat them as mere sub-data and not real ID! */ - BKE_library_foreach_ID_embedded(&data, (ID **)&world->nodetree); - } + BLI_assert(0); break; } diff --git a/source/blender/blenkernel/intern/world.c b/source/blender/blenkernel/intern/world.c index 5be74f34338..e3b58e03d93 100644 --- a/source/blender/blenkernel/intern/world.c +++ b/source/blender/blenkernel/intern/world.c @@ -38,6 +38,7 @@ #include "BKE_icons.h" #include "BKE_idtype.h" #include "BKE_lib_id.h" +#include "BKE_lib_query.h" #include "BKE_main.h" #include "BKE_node.h" #include "BKE_world.h" @@ -111,6 +112,16 @@ static void world_copy_data(Main *bmain, ID *id_dst, const ID *id_src, const int } } +static void world_foreach_id(ID *id, LibraryForeachIDData *data) +{ + World *world = (World *)id; + + if (world->nodetree) { + /* nodetree **are owned by IDs**, treat them as mere sub-data and not real ID! */ + BKE_library_foreach_ID_embedded(data, (ID **)&world->nodetree); + } +} + IDTypeInfo IDType_ID_WO = { .id_code = ID_WO, .id_filter = FILTER_ID_WO, @@ -125,6 +136,7 @@ IDTypeInfo IDType_ID_WO = { .copy_data = world_copy_data, .free_data = world_free_data, .make_local = NULL, + .foreach_id = world_foreach_id, }; World *BKE_world_add(Main *bmain, const char *name) |