Isotropix Forums

EXR Metadata

Discuss about expressions in Clarisse

Re: EXR Metadata

Unread postby anemoff » Tue Jul 09, 2019 3:35 pm

Adding quotes will output the variables as strings:
Code: Select all
anti_aliasing_sample_count (type string): "9"
camera_f_stop (type string): "5.6"
camera_focus_distance (type string): "5.0"
camera_fov (type string): "25.0"

For info, the syntax of the Clarisse metadata attribute is based on the Clarisse parser (used for Clarisse project files, CID files, etc.).
The Clarisse attribute is parsed and passed to OpenEXR API to create the EXR metadata. We don't control the syntax of the metadata in the EXR file.
Anthony Nemoff
Isotropix
R&D Engineer
User avatar
anemoff
 
Posts: 500
Joined: Wed Jan 13, 2016 10:10 am

Re: EXR Metadata

Unread postby dane » Tue Jul 09, 2019 3:39 pm

Okay I've got it working for Nuke, was simpler than I thought, just added what you had to the rest of the values

Code: Select all
# Get attribute values
aa = get_double("project://scene/path_tracer.anti_aliasing_sample_count");
cam_fov = get_double("project://scene/camera.field_of_view");
cam_f_stop = get_double("project://scene/camera.f_stop");
cam_focus_dist = get_double("project://scene/camera.focus_distance");

# Can't retrieve the Camera module needed to compute the global matrix.
# But it's possible to get the Kinematics attributes: translate, rotate, etc.

# Build the metadata string with the values
# NOTE: the eval usage is a temporary workaround to allow escaping characters.
md = "anti_aliasing_sample_count " + eval("\"") + to_string(aa) + eval("\"");
md += eval("\n");
md += "camera_fov " + eval("\"") + to_string(cam_fov) + eval("\"");
md += eval("\n");
md += "camera_f_stop " + eval("\"") + to_string(cam_f_stop) + eval("\"");
md += eval("\n");
md += "camera_focus_distance " + eval("\"") + to_string(cam_focus_dist) + eval("\"");
md += eval("\n");
md += "custom_string " + eval("\"") + "hello world" + eval("\"");

# return the string
md


This now reads correctly in Nuke! Thanks again for your help, we will expand on this and share back our findings!
dane
 
Posts: 98
Joined: Wed Aug 29, 2018 11:50 am

Re: EXR Metadata

Unread postby anemoff » Tue Jul 09, 2019 3:42 pm

You're welcome! ;)
Anthony Nemoff
Isotropix
R&D Engineer
User avatar
anemoff
 
Posts: 500
Joined: Wed Jan 13, 2016 10:10 am

Previous

Return to Expressions