Skip to content

Commit b4378e2

Browse files
committed
Suppress id changes for materials that reference a library
1 parent 74210c4 commit b4378e2

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

mmd_tools/core/morph.py

+9
Original file line numberDiff line numberDiff line change
@@ -684,9 +684,18 @@ def update_mmd_morph():
684684
@staticmethod
685685
def ensure_material_id_not_conflict():
686686
mat_ids_set = set()
687+
688+
# The reference library properties cannot be modified and bypassed in advance.
689+
need_update_mat = []
687690
for mat in bpy.data.materials:
688691
if mat.mmd_material.material_id < 0:
689692
continue
693+
if mat.library is not None:
694+
mat_ids_set.add(mat.mmd_material.material_id)
695+
else:
696+
need_update_mat.append(mat)
697+
698+
for mat in need_update_mat:
690699
if mat.mmd_material.material_id in mat_ids_set:
691700
mat.mmd_material.material_id = max(mat_ids_set) + 1
692701
mat_ids_set.add(mat.mmd_material.material_id)

0 commit comments

Comments
 (0)