Anyways I use this bit of tcl in my nuke text nodes to get the name of an image sequence:
[split [lindex [split [lindex [split [knob [topnode].file] "/"] 10] "."] 0] "_"]
It first splits the whole path (which in this case has 10 tokens) using a "/"
The last token is returned and split again based on "."
And finally it splits out the last token if there's any underscores
so a path like this:
/job/thingny/dev/sandbox/sandbox_iguerrer/work/iguerrer/maya/images/skinTestSmooth_backLeft.####.iff
ends up being displayed as this:
skinTestSmooth backLeft
This assumes you have a read node as the top most node in the tree with the text node in the flow.
I'd like to figure (using tcl --- python is a bit easier for me when it comes to text manipulation) how to get the total number of tokens in the first directory split where I'm using "/", and then feed the number to the rest of the expression.
Further explorations!
addenum -- check out this web site for lots of nuke tcl tips: http://thoughtvfx.blogspot.com/2012/12/nuke-tcl-tips.html |