YafaRay / Blender-Exporter

ARCHIVED-READ ONLY now. Use YafaRay-Blender repository instead. YafaRay's Blender Exporter
http://www.yafaray.org
63 stars 19 forks source link

Changes in Blend material properties #25

Closed DavidBluecame closed 8 years ago

DavidBluecame commented 9 years ago

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

DavidBluecame commented 8 years ago

No need for this anymore, too many changes already since this pull request. We will integrate these changes via the new experimental branch.