In keeping with the tcl time theme, here's a little date/time format i put into my Write nodes label
[expr { ([clock seconds] -[file mtime [value knob.file]]) /86400 }]d[clock format [expr { [clock seconds] -[file mtime [value knob.file]] }] -format {%Hh%Mm} -gmt true] ago Tells me how long ago the node was rendered. Michael On Fri, Apr 27, 2012 at 3:33 PM, Rich Bobo <richb...@mac.com> wrote: > Magno, > > Thanks for those! > > Here are a couple of other 'date' command flavors that may be of use to > somebody... > * > * > *Date Formatting:* > [date %D] 12/28/11 > [date %m%d%y] 122811 > > > Rich > > Rich Bobo > Senior VFX Compositor > > Mobile: (248) 840-2665 > Web: http://richbobo.com/ > > > On Apr 27, 2012, at 1:33 PM, Magno Borgo wrote: > > I usually place the tcl inside the label of a backdropnode to test the > results, in fact I have a toolset with several expressions saved on it: > > [join [lrange [split [file dirname [knob root.name]] "/"] 0 end-1] "/"] > [file dirname [value root.name]] > [lindex [split [value root.name] /] end] > [lindex [split [lindex [split [value root.name] /] end] .] 0] > [file tail [value root.name]] > [file rootname [file tail [value root.name]]] > [date %Hh%Mm%Ss] > > > I like to append the date one on the filename of the quicktime previews, > this way a new preview is always created, instead of overwriting and you > can compare versions. > > Magno. > > > > Magno, > > That's a nice, compact way to disassemble and reassemble pathname > components! I have used something similar with split before, but I didn't > use join, which makes it a lot shorter than what I was doing! ;^) > > One question I have is, how do you debug your evaluated expression to make > sure your pathname is what you want? What I've been doing is to attach a > Text node after the Write node and view the result of the text message > "[value Write1.file]" - or whatever the name of the Write node happens to > be... That gives me an overlay of the printed path. When I look at the > result of your expression, however, it is not evaluated. I get the same > code that is typed in the file section - essentially what "[knob > Write1.file]" would report. But when I use something like "[file dirname > [file dirname [value root.name]]]" - I get the actual pathname that it's > going to write to. Not sure why that would be. Any idea...? > > Thanks, > Rich > > > Rich Bobo > Senior VFX Compositor > > Mobile: (248) 840-2665 > Web: http://richbobo.com/ > > On Apr 26, 2012, at 11:14 AM, Magno Borgo wrote: > > Try this one. > [join [lrange [split [file dirname [knob root.name]] "/"] 0 end-1] "/"] > > Change "end-1" to end-2, end-3, and so on to go back on the directory > structure > > > > > > Howard, > > Hmm... That just seems to append /../ to the path and doesn't actually > perform the change directory command... Unless I'm missing something. > > Thanks, > Rich > > > On Apr 26, 2012, at 9:14 AM, Howard Jones wrote: > > [file dirname [value root.name]]/../ > to be more precise > > Howard > > ------------------------------ > *From:* Howard Jones <mrhowardjo...@yahoo.com> > *To:* Nuke user discussion <nuke-users@support.thefoundry.co.uk> > *Sent:* Thursday, 26 April 2012, 14:11 > *Subject:* Re: [Nuke-users] Write node - TCL directory navigation question > > [file dirname [value root.name]]/../ [file tail [value root.name]] > should do it I think > > Howard > > ------------------------------ > *From:* Rich Bobo <richb...@mac.com> > *To:* Nuke-Users Mailing List <nuke-users@support.thefoundry.co.uk> > *Sent:* Thursday, 26 April 2012, 13:57 > *Subject:* [Nuke-users] Write node - TCL directory navigation question > > Hi, > > Does anyone know how to indicate a relative directory change in TCL? In a > Write node, I'd like to designate the directory to write files to that is > parallel to the one the script is in. I'm using this typical form to get > the current script directory: > > [file dirname [file tail [value root.name]]] > > Then, I'd like to do the equivalent of 'cd ../different_dir'. So, I'd > like to have a (hopefully short) chunk of code that would a) grab the > script's current directory, b) navigate up one directory and c) indicate > the parallel directory to write the files to. Should be easy - I just don't > know if it's possible with TCL or if I have to combine some Python in > there... > > Thanks for any help! > > Rich > > > Rich Bobo > Senior VFX Compositor > > Mobile: (248) 840-2665 > Web: http://richbobo.com/ > > > _______________________________________________ > Nuke-users mailing list > Nuke-users@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/ > http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users > > > _______________________________________________ > Nuke-users mailing list > Nuke-users@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/ > http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users > > _______________________________________________ > Nuke-users mailing list > Nuke-users@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/ > http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users > > > > > > -- > ************************** > Magno Borgo > > www.borgo.tv > www.boundaryvfx.com > _______________________________________________ > Nuke-users mailing list > Nuke-users@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/ > http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users > > > > > > -- > ************************** > Magno Borgo > > www.borgo.tv > www.boundaryvfx.com > _______________________________________________ > Nuke-users mailing list > Nuke-users@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/ > http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users > > > > _______________________________________________ > Nuke-users mailing list > Nuke-users@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/ > http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users >
_______________________________________________ Nuke-users mailing list Nuke-users@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/ http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users