if you use tcl (stuff inside and including the square brackets) inside a file path in Nuke, it will be calculated on the fly. So you can use python to construct a file path which includes a valid tcl command, then assign the lot via python. Nuke will then carry on doing what it does anyway, which is evaluate the TCL on the fly.
For Python, it's just a string either way.

On 13/03/17 5:11 pm, Darren Coombes wrote:
Thanks Frank, this would be for a tcl script button i'm assuming?

what if the button was a python button?
Check out some of my work...
www.vimeo.com/darrencoombes

Mob:  +61 418 631 079
Skype:  darrencoombes
Twitter:  @durwood81

On Mar 13, 2017, at 03:02 PM, Frank Rueter|OHUfx <[email protected]> wrote:

Sure. Just use something like this to generate your Read node:
    path/to/file/*[value NoOp1.whichsheet]*/*[value NoOp1.chooseread]*



On 13/03/17 4:16 pm, Darren Coombes wrote:
Thanks Frank, that lind of works for what i'm trying to do..

here's what i'm trying to do, im simpler form (all made on no-op).

essentially, i've got a bunch of elements, then trying to select the parent directory of certain elements, then select the filename and then finally, read in said element..

set cut_paste_input [stack 0]
version 10.0 v3
push $cut_paste_input
NoOp {
name NoOp1
selected true
xpos -798
ypos -669
addUserKnob {20 User}
addUserKnob {4 whichsheet l "parent directory" M {glass elements "" ""}}
addUserKnob {4 chooseread l "read in" M {glass.png fuzz.png red.png}}
addUserKnob {22 readthis l read T "thisNode = nuke.thisNode()\n\n#check whether gizmo inside group\nroot = 'root'\nnodeRoot = thisNode.fullName()\nif nodeRoot.count('.') > 0:\n root = '.'.join(nodeRoot.split('.')\[:-1])\n\nwith nuke.toNode(root):\n #create read\n nuke.nodes.Read(file=\"path/to/file/glass.png\")" +STARTLINE}
}
Check out some of my work...
www.vimeo.com/darrencoombes

Mob:  +61 418 631 079
Skype:  darrencoombes
Twitter:  @durwood81

On Mar 13, 2017, at 12:35 PM, Frank Rueter|OHUfx <[email protected]> wrote:

Try something like
/home/darren/Pictures/[value myDropDownList]

On 13/03/17 1:20 pm, Darren Coombes wrote:
if i want to create a read node based on what is selected in a pulldown menu, how would i do that?

say my menu has the following two files listed..
aura_green.png
bluesky.png
redball.png

i can create a read by adding..

nuke.nodes.Read(file="/home/darren/Pictures/aura_green.png")


which only links directly to the file listed, but i'd like it to change the filename depending on whats selected in the pulldown menu.


Thanks.

Darren



Check out some of my work...
www.vimeo.com/darrencoombes

Mob:  +61 418 631 079
Skype:  darrencoombes
Twitter:  @durwood81


_______________________________________________
Nuke-users mailing list
[email protected],http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users

--
ohufxLogo 50x50 <http://www.ohufx.com>    

*vfx for storytellers <http://www.ohufx.com>*

*vfx compositing <http://ohufx.com/compositing.html> | *workflow customisation & consulting <http://ohufx.com/customising.html>**

*W E L L I N G T O N    |    N E W   Z E A L A N D *

_______________________________________________
Nuke-users mailing list
[email protected] <mailto:[email protected]>, http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users


_______________________________________________
Nuke-users mailing list
[email protected],http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users

--
ohufxLogo 50x50 <http://www.ohufx.com>    

*vfx for storytellers <http://www.ohufx.com>*

*vfx compositing <http://ohufx.com/compositing.html> | *workflow customisation & consulting <http://ohufx.com/customising.html>**

*W E L L I N G T O N    |    N E W   Z E A L A N D *

_______________________________________________
Nuke-users mailing list
[email protected] <mailto:[email protected]>, http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users


_______________________________________________
Nuke-users mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users

--
ohufxLogo 50x50 <http://www.ohufx.com>    

*vfx for storytellers <http://www.ohufx.com>*

*vfx compositing <http://ohufx.com/compositing.html> | *workflow customisation & consulting <http://ohufx.com/customising.html>**

*W E L L I N G T O N    |    N E W   Z E A L A N D *

_______________________________________________
Nuke-users mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users

Reply via email to