Material Assignment Algorithm - matyalatte/Blender-Uasset-Addon GitHub Wiki
The inject function will reorder material ids by the following steps. If it failed to assign materials in proper order, check the steps to understand how it assigns.
Step1. Compare Slot Names
Mesh assets have slot names for each material slot.
If Blender materials have slot_name
as custom properties, the addon will use it to assign materials.
Step2. Compare Material Names
If there are unassigned materials, the addon will use material names to assign them.
Step3. Compare Material Names Removed Suffix
If there are still unassigned materials, the addon will remove suffix (.xxx
) from material names and try to assign materials.
Step4. Assign Remains
If there are still unassigned materials, the addon will assign them in the list order.