Page MenuHome

Fix T43120: Cycles mapping node rotation order is different from viewport
ClosedPublic

Authored by Sergey Sharybin (sergey) on Jan 6 2015, 11:05 PM.

Details

Summary

Root of the issue goes to the fact that since the very beginning Cycles was
using ZYX euler rotation for mapping shader node but blender was always
using XYZ euler rotation.

This commit switches Cycles to use XYZ euler order and adds versioning code
to preserve backward compatibility.

There was no really nice solution here because either we're ending up with
versioning code or we'll need to deal with all sort of exceptions from blender
side in order to support ZYX order for the mapping node. The latest one is
also creepy from the other render engines points of view -- that might break
compatibility with existing bindings or introduce some extra headache for them
in the future.

This could also become a PITA for us with need of supporting all sort of weird
and wonderful exceptions in the refactored viewport project.

NOTE: This commit breaks forward compatibility, meaning opening new files in older blender might not give proper result if Mapping node was used.

Diff Detail

Repository
rB Blender

Event Timeline

Sergey Sharybin (sergey) retitled this revision from to Fix T43120: Cycles mapping node rotation order is different from viewport.
Sergey Sharybin (sergey) updated this object.

Just for the record: this patch can't be applied yet because cycles versioning code does not run for linked scenes. This i'll fix anyway, regardless if we'll decide this patch is indeed a way to go.

Campbell Barton (campbellbarton) edited edge metadata.

LGTM, minor change suggested

intern/cycles/blender/addon/version_update.py
27

Would use obj since object is a python class.

This revision is now accepted and ready to land.Jan 14 2015, 4:09 PM
Sergey Sharybin (sergey) edited edge metadata.

Update do versions so it works for linked datablocks just nicely as well

Go back to py-side versioning after discussion in IRC

Optimize material traversal code

LGTM

(small picky change suggested)

intern/cycles/blender/addon/version_update.py
28

Should be if 'NEW_SHADING' in node.shading_compatibility:

This revision was automatically updated to reflect the committed changes.