cycloneslider
domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init
action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home2/wacggq0abkde/public_html/wp-includes/functions.php on line 6114cartel
domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init
action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home2/wacggq0abkde/public_html/wp-includes/functions.php on line 6114tl;dr: <\/strong>Leveraging the power of the EXR metadata to create an animated Camera Node in Nuke.<\/p>\n<\/div><\/div>\n important<\/strong>: for making this work, import the script and call the\u00a0create_cam()<\/span> function.<\/p>\n<\/div>\n snippet<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[47,48,49],"tags":[],"class_list":["post-2016","post","type-post","status-publish","format-standard","hentry","category-nuke","category-python","category-scripting"],"_links":{"self":[{"href":"https:\/\/boris-mc.com\/index.php?rest_route=\/wp\/v2\/posts\/2016","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/boris-mc.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/boris-mc.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/boris-mc.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/boris-mc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2016"}],"version-history":[{"count":16,"href":"https:\/\/boris-mc.com\/index.php?rest_route=\/wp\/v2\/posts\/2016\/revisions"}],"predecessor-version":[{"id":2548,"href":"https:\/\/boris-mc.com\/index.php?rest_route=\/wp\/v2\/posts\/2016\/revisions\/2548"}],"wp:attachment":[{"href":"https:\/\/boris-mc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2016"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/boris-mc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2016"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/boris-mc.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2016"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}snippet<\/strong><\/h6>\n<\/div>\n
# local application\/library specific imports\r\nimport nukescripts\r\nimport nuke\r\n\r\n\r\ndef bake_arnold_exr_cam(name, eye):\r\n\r\n try:\r\n node = nuke.selectedNode()\r\n except ValueError:\r\n nuke.message("select a node")\r\n return\r\n\r\n if node.Class() != "Read":\r\n nuke.message("you should select an EXR file containing metadata")\r\n return\r\n else:\r\n cam = nuke.createNode('Camera2')\r\n cam['useMatrix'].setValue(False)\r\n cam['rot_order'].setValue('XYZ')\r\n # cam.setName("EXR_right_camera_" + node.name())\r\n cam.setName("EXR_" + name + "_camera_" + node.name())\r\n\r\n for k in ('focal', 'haperture', 'vaperture', 'translate', 'rotate'):\r\n cam[k].setAnimated()\r\n\r\n for frame in range(node.firstFrame(), (node.lastFrame()) + 1):\r\n haperture = node.metadata('exr\/g' + eye + '_cameraApertureMmH', frame)\r\n vaperture = node.metadata('exr\/g' + eye + '_cameraApertureMmV', frame)\r\n focal = node.metadata('exr\/g' + eye + '_focalLength', frame)\r\n\r\n transX = node.metadata('exr\/g' + eye + '_cameraTranslationX', frame)\r\n transY = node.metadata('exr\/g' + eye + '_cameraTranslationY', frame)\r\n transZ = node.metadata('exr\/g' + eye + '_cameraTranslationZ', frame)\r\n\r\n rotX = node.metadata('exr\/g' + eye + '_cameraRotationX', frame)\r\n rotY = node.metadata('exr\/g' + eye + '_cameraRotationY', frame)\r\n rotZ = node.metadata('exr\/g' + eye + '_cameraRotationZ', frame)\r\n\r\n cam['focal'].setValueAt(float(focal), frame)\r\n cam['haperture'].setValueAt(float(haperture), frame)\r\n cam['vaperture'].setValueAt(float(vaperture), frame)\r\n\r\n cam['translate'].setValueAt(float(transX), frame, 0)\r\n cam['translate'].setValueAt(float(transY), frame, 1)\r\n cam['translate'].setValueAt(float(transZ), frame, 2)\r\n cam['rotate'].setValueAt(float(rotX), frame, 0)\r\n cam['rotate'].setValueAt(float(rotY), frame, 1)\r\n cam['rotate'].setValueAt(float(rotZ), frame, 2)\r\n\r\n return nuke.message( name + " " + "camera" + " " + "created")\r\n\r\n\r\n\r\nclass ModalPanel(nukescripts.PythonPanel):\r\n def __init__(self):\r\n nukescripts.PythonPanel.__init__(self, title="BAKE YOUR CAM")\r\n self.menu = nuke.Enumeration_Knob('eye', 'eye:', ['left', 'right'])\r\n self.addKnob(self.menu)\r\n\r\n def getValue(self):\r\n return self.menu.getValue()\r\n\r\n def getName(self, n):\r\n return self.menu.value()\r\n\r\n\r\ndef create_cam():\r\n panel_instance = ModalPanel()\r\n if panel_instance.showModalDialog():\r\n\r\n value = int(panel_instance.getValue())\r\n cam_created = panel_instance.getName(value)\r\n\r\n if value == 0:\r\n bake_arnold_exr_cam("left", "_L")\r\n # ok_panel = nuke.message(cam_created + " " + 'camera' + " " + "created")\r\n elif value == 1:\r\n bake_arnold_exr_cam("right", "_R")\r\n # ok_panel = nuke.message(cam_created + " " + 'camera' + " " + "created") #ok_panel.show()\r\n else:\r\n pass\r\n print("next time")\r\n\r\n\r\n\t\t\r\nif __name__ == '__main__':\r\n create_cam()\r\n\r\n\r\n<\/pre><\/div>\n","protected":false},"excerpt":{"rendered":"