Skip to content

Commit

Permalink
Fix: Match override datablocks (ynput#114)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tilix4 committed Jun 1, 2023
1 parent 8b4e595 commit e22c439
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions openpype/hosts/blender/api/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -765,11 +765,14 @@ def _load_library_datablocks(
if isinstance(d, bpy.types.Collection):
override_datablocks.update(d.all_objects)

# Ensure user override NOTE: will be unecessary after BL3.4
for d in override_datablocks:
# Ensure user override NOTE: will be unecessary after BL3.4
if d and hasattr(d.override_library, "is_system_override"):
d.override_library.is_system_override = False

# Set source_name
d["source_name"] = d.override_library.reference.name

# Add override datablocks to datablocks
datablocks.update(override_datablocks)

Expand Down Expand Up @@ -1188,9 +1191,8 @@ def replace_container(
and old_datablock.get("source_name")
== d.get("source_name")
),
key=lambda d: d.name_full,
# Library datablocks names are before override ones
reverse=True,
# Put source datablocks at the end
key=lambda d: 1 if d.library else 0,
)
),
None,
Expand Down

0 comments on commit e22c439

Please sign in to comment.