WARNING: This change breaks backwards compatibility
In the blend material, the component materials (material1 and material2) are defined as Enum properties. This causes that if somebody removes or adds a new material, the enum property does not point to the same material as before, causing unexpected changes in the Blend material components.
Unfortunately due to Blender API limitations, I don't know any way to set a consistent link between a material to another, so I've replaced the Enum properties by String properties. I've added code to convert old scenes "Enum" properties to the new "String" properties automatically.
The advantages of this solution are:
Creating and deleting materials will not affect the existing Blend materials components.
However, there are disadvantages too, but due to Blender API limitations I cannot think in a better way (for now):
No more dropdown menus for selecting the blend material components. You have to write down the material names.
If you rename one of the component materials, the blend material will no longer work.
I still believe this is better than the previous blend behavior. Renaming a material that's used for a blend material would be expected to cause problems.
To mitigate this, I've made the Logging more explicit. Now, if a blend material component is not found, it will tell you what's the problematic blend material and which component (material1 or material2) cannot be found, and what is the name of the component material that cannot be found.
Changes to be committed:
modified: init.py
modified: io/yaf_export.py
modified: io/yaf_material.py
modified: prop/yaf_material.py
modified: ui/properties_yaf_material.py
WARNING: This change breaks backwards compatibility
In the blend material, the component materials (material1 and material2) are defined as Enum properties. This causes that if somebody removes or adds a new material, the enum property does not point to the same material as before, causing unexpected changes in the Blend material components.
Unfortunately due to Blender API limitations, I don't know any way to set a consistent link between a material to another, so I've replaced the Enum properties by String properties. I've added code to convert old scenes "Enum" properties to the new "String" properties automatically.
The advantages of this solution are:
However, there are disadvantages too, but due to Blender API limitations I cannot think in a better way (for now):
I still believe this is better than the previous blend behavior. Renaming a material that's used for a blend material would be expected to cause problems.
To mitigate this, I've made the Logging more explicit. Now, if a blend material component is not found, it will tell you what's the problematic blend material and which component (material1 or material2) cannot be found, and what is the name of the component material that cannot be found.
Changes to be committed: modified: init.py modified: io/yaf_export.py modified: io/yaf_material.py modified: prop/yaf_material.py modified: ui/properties_yaf_material.py