diff options
author | Aras Pranckevicius <aras@nesnausk.org> | 2022-10-10 14:06:36 +0300 |
---|---|---|
committer | Aras Pranckevicius <aras@nesnausk.org> | 2022-10-10 14:06:54 +0300 |
commit | 499af28a35c48244c1ac58bf7a817f0eeb24c7f5 (patch) | |
tree | d0d648fa045289dad46747e44a10c56bd99386f0 /source/blender/io/usd | |
parent | b099cf73ae3644175c0668c1c2253420daf059a3 (diff) |
IO: remove BKE_layer_collection_resync_forbid & allow
Part of T101073: after the view layer sync was made lazy (D15885), the
BKE_layer_collection_resync_forbid and BKE_layer_collection_resync_allow
in Alembic/USD/OBJ importers is no longer needed, as long as they do
view layer dependent operations (selecting new objects) in a separate
loop after creating all the objects.
Verified that this does not regress import times for 26k objects OBJ
scene (Blender 3.0 splash) and 250k objects USD scene (Moana).
Diffstat (limited to 'source/blender/io/usd')
-rw-r--r-- | source/blender/io/usd/intern/usd_capi_import.cc | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/source/blender/io/usd/intern/usd_capi_import.cc b/source/blender/io/usd/intern/usd_capi_import.cc index 5808c6bc77a..b8cc43beeb9 100644 --- a/source/blender/io/usd/intern/usd_capi_import.cc +++ b/source/blender/io/usd/intern/usd_capi_import.cc @@ -317,8 +317,7 @@ static void import_endjob(void *customdata) lc = BKE_layer_collection_get_active(view_layer); - /* Add all objects to the collection (don't do sync for each object). */ - BKE_layer_collection_resync_forbid(); + /* Add all objects to the collection. */ for (USDPrimReader *reader : data->archive->readers()) { if (!reader) { continue; @@ -330,9 +329,7 @@ static void import_endjob(void *customdata) BKE_collection_object_add(data->bmain, lc->collection, ob); } - /* Sync the collection, and do view layer operations. */ - BKE_layer_collection_resync_allow(); - BKE_main_collection_sync(data->bmain); + /* Sync and do the view layer operations. */ BKE_view_layer_synced_ensure(scene, view_layer); for (USDPrimReader *reader : data->archive->readers()) { if (!reader) { |