Igor is right, you can use 'in' for this:

[in MyReadNode {metadata input/filename}]

-Nathan

On 6/23/2016 9:16 AM, Igor Majdandzic wrote:

I am not soooo well versed in TCL (still on my list), but there is the in-function. from the docs:

in      (       object  /command/       
        

Execute commands with a given node/knob/field as the "context".

  * object: node, knob, or field in knob
  * command: commands to execute, use curly braces for multiple

The /command/ is executed with the /object/ as the "context". This means that all names are evaluated relative to this object, and commands that modify "this" node will modify the given one.

If no arguments are given, this returns the name of the current context. Warning: this name may not give the exact same context if your nodes do not all have unique names.


Sounds like what you are after.

Greets,

    Igor


Am 23.06.2016 um 18:03 schrieb Vincent Langer:
Hi there,
I am working on a PRECOMP setup for royal render.

So I am creating precomps and inside them I would like to use the incoming metadata input/filename value to fill empty placeholder ReadNodes. These readnodes have the exact same naming as my input metaData filename exept for one folder name which I like to replace.

But I realized that the way nuke (version8.0v6) handles metaData is different in evaluation.
here is a small example
______________________
set cut_paste_input [stack 0]
version 8.0 v6
Read {
 inputs 0
 cacheLocal always
 format "2048 1152 0 0 2048 1152 1 RR2_2K"
 first 1000
 last 1024
 origfirst 1000
 origlast 1024
 origset true
 name Read1
 selected true
 xpos 440
 ypos -96
}
Dot {
 name Dot1
 selected true
 xpos 386
 ypos -27
}
NoOp {
 name NoOp_TCL_metaData
 label "\[metadata input/filename]"
 selected true
 xpos 352
 ypos 68
}
NoOp {
 name NoOp_PY_metadata
 label "\[python nuke.thisNode().metadata(\"input/filename\")]"
 selected true
 xpos 352
 ypos 119
}
Text {
 message "TCL expression:\n\[metadata input/filename]"
 font C:/Windows/Fonts/arial.ttf
 size 28.5
 xjustify center
 yjustify center
 box {2044 483 -4 773}
 name Text_TCL_metaData
 selected true
 xpos 352
 ypos 202
}
Text {
message "Python Expression:\n\[python nuke.thisNode().metadata(\"input/filename\")]"
 font C:/Windows/Fonts/arial.ttf
 size 28.5
 xjustify center
 yjustify center
 box {2048 315 0 605}
 name Text_PY_metaData
 selected true
 xpos 352
 ypos 247
}
Text {
message "Python Expression looking to a specific node:\n\[python nuke.toNode(\"Read1\").metadata(\"input/filename\")]"
 font C:/Windows/Fonts/arial.ttf
 size 28.5
 xjustify center
 yjustify center
 box {2048 155 0 445}
 name Text_PY_metaData1
 selected true
 xpos 352
 ypos 298
}

__________________

the TCL expression:
[metadata input/filename]
gives me for every frame the exact filename in a nodes label and in for example a TextNodes message knob.

Python metaData:
[python nuke.thisNode().metadata("input/filename")]
the Python version does not update in the NodeGraph like in a label for example.
But it updates in a textNode

Python metaData from a specific Node:
[python nuke.toNode("Read1").metadata("input/filename")]
does not update in the NodeGraph and seems to be one frame behind when you skip some frames.

So the TCL expression would be great but I can not specify another node to read the metadata from. or can I?

Or is there a way to force the python expressions to update?
And I am in a precomp so no beforeEachFrameRender scripts are possible.

Any ideas?

cheers,
Vincent






--
Vincent Langer
Uhlandstr. 29
71634 Ludwigsburg
+49 176 965 177 61
www.vincentlanger.com <http://www.vincentlanger.com>


_______________________________________________
Nuke-python mailing list
Nuke-python@support.thefoundry.co.uk,http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python

--

CHIMNEY

*Igor Majdandzic*
Compositing Supervisor

CHIMNEY Deutschland GmbH & Co. KG
Hanauer Landstraße 196
60314 Frankfurt am Main
Direct: +49 69 989 56 431 -*NEW PHONE NUMBER*-
Fax: +49 69 904 36 68 29
Mobile: +49 176 321 375 72
Berlin, Frankfurt/Main, Stockholm, Malmö, Warsaw, Copenhagen, Sydney, Singapore

www.chimneygroup.com <http://www.chimneygroup.com/>


AG Charlottenburg HRA 44507 B; Pers. haft. Gesellschafter: Chimney Deutschland GmbH AG Charlottenburg HRB 130013 B; Geschäftsführer: Ralf Drechsler, Michal Kalinowski,Carl Henric Larsson



_______________________________________________
Nuke-python mailing list
Nuke-python@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python

_______________________________________________
Nuke-python mailing list
Nuke-python@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python

Reply via email to