cedricduriau / Cryptomatte

Cryptomatte Nuke plugin, sample images, and specification
BSD 3-Clause "New" or "Revised" License
6 stars 1 forks source link

Support EXR file path mapping #16

Closed cedricduriau closed 3 years ago

cedricduriau commented 3 years ago

EXR metadata field "Filename" can contain a value representing a non-absolute path, relative to a path mapping key.

Error:

ERROR: Cannot read image file "Comp:/Media/crypto_vray_balls_test.exr". No such file or directory.

Solution:

filename = self.Comp:MapPath(filename)
cedricduriau commented 3 years ago

Function MapPath is available on FusionUI object instanced and stored under global variable fusion. Use this instead of self.Comp to loose requirement of both script operator (self) and comp session (self.Comp).

cedricduriau commented 3 years ago

Valid feedback from Andrew:

Fusion supports both "global" program wide PathMaps, and comp specific PathMap overrides.

You can see the difference between these two options if you look in the Fusion Preference window at the "Global and Defaults PathMap" entry vs the preference for the current comp's PathMap entry inside the same Fusion preference window.

AFAIK if you use the Fusion / App-based program scope PathMap functionality, you are throwing away the comp-specific customized PathMap entries.