[SOLVED] Editing multiple renderpaths (batch render)


#1

I’m sorry if this has been asked many time but im looking for some help/advice regarding the following, we had a server crash and had to replace it. This means the output for our render files have to be changed and every file has a batch render with plusminus 200 images of which ONLY the paths need to be changed, is there a script out there that already does this? I tried something silly:

(
outPath = "\\serverlocation"
makedir outPath all:true
)

Of course it didnt work. So what should I look into? Or is there a script that already does this/ Any help is much appreciated


#2

you should use dotnet api to do it
(dotnetclass "System.IO.Directory").CreateDirectory "yourpath"


#3

Sorry, not really familiar with dotnet api. Especially on how to make that work in this case. Is it gonna be impossible with plain maxscript ?


#4

I think you want to work with server path , the truth is to repath
that’s something complex
for most bitmaps , proxy files and output file path , you can use atsops method
for something from other plugin , the path may not show in asset tracking , you must get all nodes and use the plugin’s api to change
when you have the functions to get all paths you need , you can use callbackswith #filePostOpen or #preRender or others you need to change the path automatic


#5

I tried but nothing happens. In fact if I evaluate the line you gave me with my path it will give the following message:

-- Runtime error: dotNet runtime exception: Illegal characters in path.

I’ve tried both a server path and local path. “\111.111.111.111\test\” and “C:\test”.

Could it be because im using a Japanese OS? so the backslash \ will become ¥¥ characters.??


#6

I reposted the post previous
and for this one , when we use a string for path , we need a @ before the string or all \ should be \\ or / , if we not , windows will set them as escape character


#7

Yikes, this goes way above my head. Ill look into atsops and I also found something called substitute string. Do you think that might work?


#8

I didn’t know what you mean this
if you need to plus the new path and the old filename , you can use newpath + "\\" + filenameFromPath oldpath

for atsops , if all your bitmaps in same path , use ATSOps.SetPath newpath , if not ,should use atsops.retargetselection newpath one by one


#9

Ohh now I understand. Theres some miscommunication. I didn’t mean bitmap-path but render-paths for the batch render, see screenshot


#10

if no need to change the assets , re-set the path use batchRenderMgr in a for loop
for i = 1 to batchRenderMgr.numViews do ( (batchRenderMgr.GetView i).outputFilename = newpath + "\\" + filenameFromPath (batchRenderMgr.GetView i).outputFilename )


#11

Oh wow, this worked! this solved everything. Thank you thank you.

trying to press reply but this forum keeps giving me ‘403 errors.’


#12

there are lot’s of errors since last update