Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the 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 6114

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the cartel 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 6114

Warning: Cannot modify header information - headers already sent by (output started at /home2/wacggq0abkde/public_html/wp-includes/functions.php:6114) in /home2/wacggq0abkde/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1893

Warning: Cannot modify header information - headers already sent by (output started at /home2/wacggq0abkde/public_html/wp-includes/functions.php:6114) in /home2/wacggq0abkde/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1893

Warning: Cannot modify header information - headers already sent by (output started at /home2/wacggq0abkde/public_html/wp-includes/functions.php:6114) in /home2/wacggq0abkde/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1893

Warning: Cannot modify header information - headers already sent by (output started at /home2/wacggq0abkde/public_html/wp-includes/functions.php:6114) in /home2/wacggq0abkde/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1893

Warning: Cannot modify header information - headers already sent by (output started at /home2/wacggq0abkde/public_html/wp-includes/functions.php:6114) in /home2/wacggq0abkde/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1893

Warning: Cannot modify header information - headers already sent by (output started at /home2/wacggq0abkde/public_html/wp-includes/functions.php:6114) in /home2/wacggq0abkde/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1893

Warning: Cannot modify header information - headers already sent by (output started at /home2/wacggq0abkde/public_html/wp-includes/functions.php:6114) in /home2/wacggq0abkde/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1893

Warning: Cannot modify header information - headers already sent by (output started at /home2/wacggq0abkde/public_html/wp-includes/functions.php:6114) in /home2/wacggq0abkde/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1893
{"id":2027,"date":"2016-11-20T13:38:41","date_gmt":"2016-11-20T12:38:41","guid":{"rendered":"http:\/\/boris-mc.com\/?p=2027"},"modified":"2019-04-25T17:23:18","modified_gmt":"2019-04-25T16:23:18","slug":"smartpos-knob","status":"publish","type":"post","link":"https:\/\/boris-mc.com\/?p=2027","title":{"rendered":"“SMARTPOS” KNOB"},"content":{"rendered":"
\n
\n

tl;dr: <\/strong>A useful custom knob that enables the user to\u00a0to place objects in 3D while working in screen space.<\/p>\n<\/div><\/div>\n

\n
I called “SmartPost”<\/strong> to a custom knob that enables the user to color-pick positional values from a World Point Position Pass (WPP) and then use those values to drive the XYZ coordinates of a XYZ_Knob existing it tools such as the Axis, the TransformGeo, the Sphere, the Card or the Cube node. By doing so, basically one is able to position geometry, cards, axis and such in worldspace based on color values.<\/div>\n
<\/div><\/div>\n
\n
This knob can therefore come in handy when working in animation projects (where the WPP is typically rendered by default), allowing\u00a0us to place objects in 3D while working in screen space, ultimately saving a great deal of time and guessing work.<\/div>\n
<\/div>\n
<\/div><\/div>\n<\/div>\n
\n

important<\/strong>:\u00a0 make sure to copy this code somewhere in your meny.py file to make it work.<\/p>\n<\/div>\n

<\/div><\/div><\/div>\n
\n<\/div>\n
<\/div>\n
<\/div>\n
snippet<\/strong><\/h6>\n
.__author__ Boris Martinez\r\n\r\n# assign nuke.createNode() function to a variable for later use.\r\nnuke_create_node = nuke.createNode\r\n\r\ndef create_my_nodes(node, knobs = "", inpanel = True):\r\n    """\r\n    this function calls nuke_create_node and add a tab and a color picker knob based on the class\r\n    of the node created.\r\n    @param node: Node class.\r\n    @param knobs: Optional string containing a TCL list of name value pairs (like "size 50 quality 19")\r\n    @param inpanel:  Optional boolean to open the control bin (default is True; only applies when the GUI is running).\r\n    @return: result\r\n    """\r\n    result = nuke_create_node(node, knobs, inpanel) # call to nuke_create_node\r\n\r\n    if node == "Sphere" or node == "TransformGeo" or node == "Cube" or node == "Card2" or node == "Cylinder" or node \\\r\n            == "Axis2":\r\n        tab = nuke.Tab_Knob('SmartPos', 'SmartPos')\r\n        col = nuke.Color_Knob('PickPos')\r\n        result.addKnob(tab)\r\n        result.addKnob(col)\r\n\r\n    return result\r\n\r\n# overwrite nuke.createNode\r\nnuke.createNode = create_my_nodes\r\n\r\n# KnobChanged callable function\r\n\r\ndef smart_post_expression():\r\n    """\r\n    This is the function to be called as the first argument for the AddKnobChanged callback later on.\r\n    Sets its context to nuke.thisNode() and picks up the changing knob by the nuke.thisKnob() command.\r\n    @return: None\r\n    """\r\n    n = nuke.thisNode()\r\n    k = nuke.thisKnob()\r\n    if k.name() == "PickPos":\r\n        n['translate'].setExpression('PickPos.r', 0)\r\n        n['translate'].setExpression('PickPos.g', 1)\r\n        n['translate'].setExpression('PickPos.b', 2)\r\n    return None\r\n\r\n# adding callbacks to certain node classes.\r\n\r\nnuke.addKnobChanged(smart_post_expression, nodeClass="TransformGeo")\r\nnuke.addKnobChanged(smart_post_expression, nodeClass="Sphere")\r\nnuke.addKnobChanged(smart_post_expression, nodeClass="Cube")\r\nnuke.addKnobChanged(smart_post_expression, nodeClass="Card2")\r\nnuke.addKnobChanged(smart_post_expression, nodeClass="Cylinder")\r\nnuke.addKnobChanged(smart_post_expression, nodeClass="Axis2")\r\n\r\n\r\n<\/pre><\/div>\n

 <\/p>\n

<\/div>\n
As a side note, I\u00b4d like to note that I don\u00b4t think it\u00b4s ideal the fact that the new “SmartPos” tab created appears first in the properties bin whenever we create a node that\u00b4s intended to have it. I\u00b4d like to see the main tab first, but so far I didn\u00b4t find the way. Any suggestion would be much appreciated. Thanks for reading!<\/div>\n
\u00a0<\/strong><\/h6>\n<\/div>\n","protected":false},"excerpt":{"rendered":"

snippet   As a side note, I\u00b4d like to note that I don\u00b4t think it\u00b4s ideal the fact that the new “SmartPos” tab created appears first in the properties bin whenever we create a node that\u00b4s intended to have it. I\u00b4d like to see the main tab first, but so far I didn\u00b4t find the […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[50,47,48,49],"tags":[],"class_list":["post-2027","post","type-post","status-publish","format-standard","hentry","category-begginer","category-nuke","category-python","category-scripting"],"_links":{"self":[{"href":"https:\/\/boris-mc.com\/index.php?rest_route=\/wp\/v2\/posts\/2027","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=2027"}],"version-history":[{"count":9,"href":"https:\/\/boris-mc.com\/index.php?rest_route=\/wp\/v2\/posts\/2027\/revisions"}],"predecessor-version":[{"id":2553,"href":"https:\/\/boris-mc.com\/index.php?rest_route=\/wp\/v2\/posts\/2027\/revisions\/2553"}],"wp:attachment":[{"href":"https:\/\/boris-mc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2027"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/boris-mc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2027"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/boris-mc.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2027"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}