write nodes filename from topmost read
if you need your output file named exactly like your input file then use a little TCL expression in the file knob of the write node
suggestion your filename convention is like: //path/to/file/filename.pattern.ext
then:
1 |
[lindex [split [lindex [split [knob [topnode].file] .] 0] /] end]
|
will give you back just the "filename" part of the original read node
if you want to write to same folder as the original file but with a new filename extension you could use:
1 |
[file dirname [knob [topnode].file]]/[lindex [split [lindex [split [knob [topnode].file] .] 0] /] end]_conv.%04d.exr
|
Comments
Root dir:
[file dirname [knob [topnode].file] ]
File name:
[file tail [knob [topnode].file] ]
File extension:
[file extension [knob [topnode].file] ]
hi
Digo-G
if i need only /filename_fileprecomp/
what should i do ??
ie : /usr /root/show_name /seq_name/shot_ number/filename _fileprecomp/fi lename_fileprec omp_v098.025.ex r
Nothing is named ''node##nn##### .file''.
Any suggenstions?
Thank you!
i noticed that issue and flip sources (shift+x)
but here i have an suggestion:
- could anyone correct this recipe to take filename not from previous Read node but from first one (Read1)
PS - how to make this script write with SAME filename but in new folder which was manually created in folder where is Read1 node file is
ex:
my tif seq is : "zebra_V01_C002 _b01_101.tiff"
"_101" is my frame numbers
i want it to be render as "zebra_V01_C002 _b01.mov"
_mask.tif is just a string to concatenate I needed to use.
rootname returns the full path up to the filnename, excluding the extension.
Handy..
Can you have it still look for the top most node in the stream (outside of the group)
[file rootname [knob [topnode this.parent.inp ut].file] ]_mask.tif
sorry for the late reply.
How would you go about this so it takes out
frame number and extension?
so keep path, keep name only add .mov in the end.
Thanks a bunch"
[lrange [split [file rootname [filename [topnode]]] "."] 0 end-1].mov
this drops the extension, splits the result into a list using dots as delimiters, then reassembles that list with dots again, dropping the last item (which presumably is your frame number).
When using dots as separators it's easier but I always get name_v01_####.e xt frames anyway to go around this?
This line will split "." OR "_"
Because I dropped the file rootname part, it returns the fullname of the file including extension, this is why lrange is set to (0, -2).
Finally joining everything using "_"
[join [lrange [split [knob [topnode].file] ".|_"] 0 end-2] "_"].mov
Glad it worked Kristijan, your welcome
Thank you! :)
[join [lrange [split [value root.name] ] end-5 end-1] _ ]
something like this, but the constants are .exr's
Constant {
inputs 0
channels rgb
color {1 0 0.063009 0}
color_panelDropped true
name kingAurther
selected true
xpos 3920
ypos -1329
}
Constant {
inputs 0
channels rgb
color {1 0.427098 0 0}
color_panelDropped true
name sirRobin
selected true
xpos 3810
ypos -1329
}
Constant {
inputs 0
channels rgb
color {0.052967 1 0 0}
color_panelDropped true
name greenKnight
selected true
xpos 3700
ypos -1329
}
Constant {
inputs 0
channels rgb
color {0.845645 0 1 0}
color_panelDropped true
name lancelot
selected true
xpos 3590
ypos -1329
}
Constant {
inputs 0
channels rgb
color {0 0 1 0}
color_panelDropped true
name sirBedivere
selected true
xpos 3480
ypos -1329
}
Switch {
inputs 5
which {{"\[frame]"}}
name Switch5
selected true
xpos 3711
ypos -923
}
Write {
file "C:/Users/KP-PC 01/Desktop/New folder/\[file tail \[knob \[topnode].file]].jpeg"
file_type jpeg
checkHashOnRead false
name Write3
selected true
xpos 3711
ypos -835
}
I had a target to take only version from the name of the source. For example, I have source "TEST_0010_v012 .####.exr" and I need to take a version numbers only - "12". I needed it for daylieses
So I've found two ways to do that.
1. If you work with .dpx, .exr, .tiff, .jpeg etc. use this
([join [lrange [split [file dirname [filename [topnode]]] ""] end end]]) + ([join [lrange [split [file dirname [filename [topnode]]] ""] end-1 end-1]])*10
2. If you work with .mov, .mp4 etc. use this
[join [lrange [split [file rootname [filename [topnode]]] ""] end end]] + [join [lrange [split [file rootname [filename [topnode]]] ""] end-1 end-1]]*10
this is my command in text node while doing gizmos
[file tail [value [? AutoName==0 filename [topnode].name ]]].
it had shown input1.
But i need the shot name (ex. Shot_001)
Please help me to solve this.
RSS feed for comments to this post