I had an experiment that involved taking a lot of photos with different aperture, focal etc. settings. I got tired of looking up camera settings in xnview, so I did a little trick. Jpeg exif information exists in nuke as metadata, and quite easy to get that. I just created a noop node, and pasted a little tcl/python expression in it's label, or directly in the read node's label.
For example to get the focal length:
Focal: [lindex [split [python {nuke.thisNode().metadata()['input/focal_length']}] / ] 0]
A little explanation:
[python {nuke.thisNode().metadata()['input/focal_length']}] - this gets the actual value for the input/focal length key. Metadata stored as key-value pairs, you want to pass the key ('input/focal_length'), and get the value (70/1, for example). The outer part of the expression, (split and lindex) just separates the 70/1 by splitting with "/" and taking the first part only, that is the needed value 70. I don't really know what is "/1", but it's not needed. If you want other parameters, best to view exact key string of the needed metadata with a "viewmetadata" node, and putting that into the expression on the noop/read or other node, and modify if needed. For example if you want to shutter speed value, no reason to cut the second part after "/", beacause it's stored like 1/50.
One last hint: if you have a noop with expression like this, and connect to other read node, it doesn't updates automatically! On other nodes I used to just press disable/enable, and label get's updated, but noops don't have disable. It's easier to put the whole thing directly to read node's label.
No comments:
Post a Comment