condition in a read node

hey,

what is easy in a field that expect digits (e.g..: (frame>10?5:0)) drives me nuts in the text field of a read node.

i want to be able to change a filename according to the error state of another node.
like:
([python nuke.toNode("TestNode").error()] > 0)? "filename1" : "filename2"
of course the above does not work like that.
does anyone have a working syntax for something like this?

cheers & thanks

alex

DiskCachePath from Preferences

Hi there,
does anybody know how to get the path which is in Preferences under DiskCachePath knob via Python?
Cheers,
Nanuk

time manipulation problem in nuke

preveiosly i use fusion for my freelance project after hearing from lots of user i want to shift to nuke. i find it more simple and powerful then fusion but for one thing i have problem i cant solve time manipulation problem e.g. take particular time segment from whole footage

so, i would be grateful if you please solve my problem

_rotopaint.whatever not working

Hello,
I code plugin in C++ and python(script_command("pythonscript")), when I use
nuke.rotopaint.etc like its recommend here http://www.nukepedia.com/reference/Python/

nuke said :module object has no atribute rotopaint

and when I use _rotopaint.whatever
it said : name error, so how should I call that?

thanks.

Nuke2AE Optical Flares Gizmo

This gizmo corvert a 3d data to 2d position, create AE keyframe data. to work with Optical Flares.

source code to copy paste on nuke node graph:

Code:

set cut_paste_input [stack 0]
version 6.2 v3
push $cut_paste_input
Group {
 name NukeToOpticalFlares
 help "1-Retime your sequence after this gizmo\nex. 100-360 ------- 0-260\n\n2-Put the width format of your project\nex. 1080, 1556, etc\n\n3-Clink on Create Keyframes this allowed to convert 3d information to 2d\n(if dont work go to node tab click on copy to group open reconcile3D1 and press create keyframes)\n\n4-Click on Bake your animation this bake your keyframe data frame by frame\n(if dont work click on animation menu then right click--->Edit---->Generate-->ok)\n\n5-Open the script editor and press TrackData\n(make sure that you have selected tracker1)\n\n6-Copy track data\n\n7-go to AE create a adjusment layer open optical flares pulldown the options \neffects--->optical flares and select Position XY and pasted (make sure that you pasted on the first frame)\n\n@b;\[you can help using it and making it better]\n\n@b;BY:JOHAN ROMERO"
 selected true
 xpos -383
 ypos -135
 addUserKnob {20 User l NukeToOpticalFlares}
 addUserKnob {26 Format l "@b;Format"}
 addUserKnob {3 format l "width Format" t "HD=1080\n2K=1556\n..etc"}
 format 1080
 addUserKnob {26 "" l "@b;Output:"}
 addUserKnob {41 track1 T Tracker1.track1}
 addUserKnob {22 createkeyframes2 l "create keyframes" t "Convert 3d position of the axis to 2d position useful to optical flares" -STARTLINE T "\[Reconcile3D1.createKeyframes]"}
 addUserKnob {22 bake l "Bake Animation" t "Bake Keyframes Animation to be exported" T "# Bake Expressions\n# By Nathan Rusch\n# Updated August 23, 2010\n\nimport nuke\nimport re\n\ndef bakeExpressions(startFrame = nuke.root().firstFrame(), endFrame = nuke.root().lastFrame()):\n\t'''\n\tBakes all expression-driven knobs/knob components to keyframes over given input range\n\tTo Do:\n\t- Add support for multiple views\n\t'''\n\n\tif not nuke.selectedNodes():\n\t\treturn\n\tfor node in nuke.selectedNodes():\n\t\tfor knob in node.knobs().values():\n\t\t\tif knob.hasExpression():\n\t\t\t\tif knob.singleValue():\n\t\t\t\t\taSize = 1\n\t\t\t\telse:\n\t\t\t\t\taSize = knob.arraySize()\n\t\t\t\tfor index in range(aSize):\n\t\t\t\t\tif knob.hasExpression(index):\n\t\t\t\t\t\tanim = knob.animation(index)\n\t\t\t\t\t\tf = startFrame\n\t\t\t\t\t\twhile f <= endFrame:\n\t\t\t\t\t\t\tknob.setValueAt(anim.evaluate(f), f, index)\n\t\t\t\t\t\t\tf += 1\n\t\t\t\t\t\tknob.setExpression(\"curve\", index)\n\t\t\t\t\t\tif knob.animation(index).constant():\n\t\t\t\t\t\t\tknob.clearAnimated(index)\n\n\ndef expressBaker():\n\t'''\n\tGUI wrapper for bakeExpressions function\n\t'''\n\n\tinput = nuke.getFramesAndViews(\"Range to Bake\", \"%d-%d\" % (nuke.root().firstFrame(), nuke.root().lastFrame()))\n\trange = input\[0]\n\tif not re.match(\"^\\d+-\\d+\$\", range):\n\t\treturn\n\tfirst, last = range.split(\"-\")\n\tbakeExpressions(int(first), int(last))" +STARTLINE}
 addUserKnob {26 Export l "@b;Export Tracking Data"}
 addUserKnob {22 button l TrackData t "1-open the script editor then press export and copy pase to the position tab on the optical flares" T "sn = nuke.selectedNode()\n\nif sn.Class() != \"Tracker3\":\n  nuke.message(\"This script only runs on a Tracker node.\")\n\nfps = nuke.root().fps()\nff = nuke.root().firstFrame()\nlf = nuke.root().lastFrame()\n\nheaderstart = \"Adobe After Effects 6.5 Keyframe Data\"\nw = nuke.value(sn.name() + \".bbox.w\")\nh = nuke.value(sn.name() + \".bbox.h\")\n\nprint headerstart\nprint\nprint \"\\tUnits Per Second\\t\" + str(fps)\nprint \"\\tSource Width\\t\" + str(w)\nprint \"\\tSource Height\\t\" + str(h)\nprint \"\\tSource Pixel Aspect Ratio\\t1\"\nprint \"\\tComp Pixel Aspect Ratio\\t1\"\nprint\nprint \"Position\"\nprint \"\\tFrame\\tX pixels\\tY pixels\\tZ pixels\"\n\nfor fr in range(ff, lf):\n    print \"\\t\" + str(fr) + \"\\t\" + str(sn.knob(\"track1\").valueAt(fr,0)) + \"\\t\" + str(sn.knob(\"track1\").valueAt(fr,1)) + \"\\t0\"\n\nprint \"End of Keyframe Data\"" +STARTLINE}
 addUserKnob {26 ""}
 addUserKnob {26 "" l "@b;2D transform:"}
 addUserKnob {41 track T Reconcile3D1.track}
 addUserKnob {41 offset T Reconcile3D1.offset}
 addUserKnob {26 "" l " "}
 addUserKnob {41 stabilize T Reconcile3D1.stabilize}
 addUserKnob {41 filter T Reconcile3D1.filter}
 addUserKnob {41 clamp T Reconcile3D1.clamp}
 addUserKnob {41 black_outside l "black outside" T Reconcile3D1.black_outside}
 addUserKnob {41 motionblur T Reconcile3D1.motionblur}
 addUserKnob {41 shutter T Reconcile3D1.shutter}
 addUserKnob {41 shutteroffset l "shutter offset" T Reconcile3D1.shutteroffset}
 addUserKnob {41 shuttercustomoffset l "" -STARTLINE T Reconcile3D1.shuttercustomoffset}
 addUserKnob {26 ""}
 addUserKnob {26 jr l "Created By @b; Johan Romero" T "you can help using it and making it better"}
 addUserKnob {26 text2 l "" +STARTLINE T Johan149@hotmail.com}
}
 Input {
  inputs 0
  name axis
  xpos 180
  ypos -11
  number 2
 }
 Input {
  inputs 0
  name cam
  xpos -25
  ypos -11
 }
 Input {
  inputs 0
  name img
  xpos 78
  ypos -11
  number 1
 }
 Retime {
  name Retime1
  xpos 78
  ypos 13
 }
 Reconcile3D {
  inputs 3
  output {{curve} {"curve*(-1)+\[knob format]"}}
  name Reconcile3D1
  label "curve*(-1)+\[knob format]"
  xpos 78
  ypos 95
 }
set N8ba63a0 [stack 0]
 Output {
  name Output1
  xpos 78
  ypos 216
 }
push $N8ba63a0
 Tracker3 {
  track1 {{parent.Reconcile3D1.output} {parent.Reconcile3D1.output}}
  offset1 {0 0}
  pattern1 {-32 -32 32 32}
  search1 {-22 -22 22 22}
  track2 {1126 676}
  offset2 {0 0}
  pattern2 {-32 -32 32 32}
  search2 {-22 -22 22 22}
  track3 {1126 880}
  offset3 {0 0}
  pattern3 {-32 -32 32 32}
  search3 {-22 -22 22 22}
  track4 {922 880}
  offset4 {0 0}
  pattern4 {-32 -32 32 32}
  search4 {-22 -22 22 22}
  center {1024 778}
  name Tracker1
  selected true
  xpos -22
  ypos 108
 }
end_group


HELP:

1-Retime your sequence after this gizmo
ex. 100-360 ——- 0-260

2-Put the width format of your project
ex. 1080, 1556, etc

3-Clink on Create Keyframes this allowed to convert 3d information to 2d
(if dont work go to node tab click on copy to group open reconcile3D1 and press create keyframes)

4-Click on Bake your animation this bake your keyframe data frame by frame
(if dont work click on animation menu then right click—>Edit—->Generate–>ok)

5-Open the script editor and press TrackData
(make sure that you have selected tracker1)

6-Copy track data

7-go to AE create a adjusment layer open optical flares pulldown the options
effects—>optical flares and select Position XY and pasted (make sure that you pasted on the first frame)

[you can help using it and making it better]

CREATED BY:JOHAN ROMERO
Johan149@hotmail.com

manipulate rotopaint nodes

Hello everybody,
I’m new to Python in Nuke and I can’t figure out how to access the different shapes in rotopaint nodes.
I need to get the x, y values of a selected point overtime.
Anybody knows how to do that?
Even only an example of rotopaint syntax would be very useful.
Thank you very much

Copy / Paste not working after setting Drop Callback

Hey there,

i registered a DropDataCallback. When registered, nuke won’t copy or paste, neither using ctrl+c/v nor using the menu commands.

has anyone encountered this behaviour before?

thanks!

sean

Adding knobs to nodes

Hi!
This should be sooo simple but I can’t figure it out.

I’m overriding the creation of the Write node, and using that creation event to add an extra knob to the node. When I add this new knob to the interface, it creates a new tab and places the new control on it. It also brings the tab to the front in the property editor.

The net result is that when the user now creates a Write node, it shows them the new custom tab, rather than the main one which is what they would want to see 99% of the time.

Is there any way around this? Is there some way to tell Nuke to display a particular tab of a node in the editor?

Thanks for any help,
Andy

x,y from curve

Hi!
What should I do to return x,y from curve? I need numeric data for further operations. For example x,y coordinates from CornerPin.

show/hide viewer Overlay function

Hi, I’m looking for an alternative hotkey or the show/hide viewer Overlay option. It is shown in the viewer contextual menu and hitting "o" but I want to change that hotkey, The problem is that I cant find in the python reference any information about this overlay.

It wold be great if anyone can point to the right direction. Thanks.