splitting and recombining paths in vex.

   3357   1   0
User Avatar
Member
119 posts
Joined: July 2005
Offline
hi all, i`m trying to use split in a wrangle to break up a file path, and then reassemble it with some changes.


ie.. if the original path referenced was

dir/folder/imageseq.$F.tif

i would end up with

dir/folder/imageseq.`expression to replace $F`.tif

as my prim attribute.

so far i have this but note string expression = blah is incorrect and doesnt work -

string expression = “`(round(rand($PR)*chs(”../cop2net1/fileSeq/length“)))`”;
string splitpath = split(chsraw(“../../seq”),“$”“F”);
s@newpath = splitpath+expression+splitpath;



the problem is getting this prim attribute

dir/folder/imageseq.$F.exr

to end up as this this :-

dir/folder/imageseq.`(round(rand($PR)*chs(“../cop2net1/fileSeq/length”)))`.exr
Edited by MWainwright - March 28, 2018 08:54:04
User Avatar
Member
166 posts
Joined: March 2013
Offline
Why do you want the expression in the attribute at all? Why not evaluate it in the wrangle, and make the attribute look like dir/folder/imageseq.4.exr.
  • Quick Links