Fix #107633: USD import: duplicate shader nodes #107945

Merged
Michael Kowalski merged 4 commits from makowalski/blender:usd-import-duplicate-shaders into main 2023-05-16 17:46:32 +02:00

4 Commits

Author SHA1 Message Date
Michael Kowalski 6d8f7ce7fe USD import: call Map::lookup_ptr().
buildbot/vexp-code-patch-coordinator Build done. Details
Now calling Map::lookup_ptr() to avoid double
lookup.
2023-05-16 11:11:28 -04:00
Michael Kowalski e0c5c2b976 Merge branch 'main' into usd-import-duplicate-shaders 2023-05-16 10:34:06 -04:00
Michael Kowalski 9135003c96 USD material import: Use blender::Map.
Changed code to use blender::Map instead of
std::map, to conform with current coding guidelines.
2023-05-15 14:55:57 -04:00
Michael Kowalski 4e1f5cd701 USD import: Fix duplicate shader nodes
Added logic to avoid creating duplicate Blender shader nodes when
converting USD Preview Surface shaders that are connected to more
than one input.

This change adds a `NodePlacementContext::node_cache` map to record
Blender nodes converted for given USD shaders.  The node creation
logic has been updated to query this cache to check if a node was
previously created for a given USD shader, before creating a
new node.
2023-05-15 12:49:10 -04:00