Set Render Elements

Set Render Elements

Anonymous
Not applicable
378 Views
1 Reply
Message 1 of 2

Set Render Elements

Anonymous
Not applicable
Hi,

I have downloaded a script from scriptspot, which is close to what I want, but not quite and was hoping you could help me make the necessary changes.

The script is Sort Render Elements by Tollef Roe Steen, which is a simple enough script that sets the path of the render elements to the same as the main pass. However, the script creates sub-directories for all the elements in this directory.

What I am after is for the script just to change the path of the elements to that of the main pass, without any sub-directories, so the main pass and the elements are all in the same directory.

I have listed a copy of the code below, for your information: -


function setUpRenderElements =
(
re = maxOps.GetCurRenderElementMgr()
numb = re.numrenderelements()

for i=0 to (numb-1) do
(
el = re.getrenderelement i
currentFileName = (fileNameFromPath (re.GetRenderElementFileName i))
currentRendOutputFilePath = getFileNamePath rendOutputFilename
newDirectory = currentRendOutputFilePath+"\\"+el.elementname
if re.GetElementsActive() then makeDir newDirectory
newFileName = newDirectory +"\\"+ currentFileName
re.SetRenderElementFileName i newFileName
)
)
setUpRenderElements()


I'm sure this is quite simple, but I haven't had any luck with this.

Thanks
0 Likes
379 Views
1 Reply
Reply (1)
Message 2 of 2

keithm
Enthusiast
Enthusiast
replace the loop... this takes the render output filename apart and reassembles it as the renderElement output, with "_<element name>" on the RE output filename.



for i=0 to &#40;numb-1&#41; do
&#40;
local el = re.getrenderelement i
local FNP = &#40; getFileNamePath rendOutputFilename &#41;
local FNN = &#40; getfilenameFile rendOutputFilename &#41;
local FNT = &#40; getFileNametype rendOutputFilename &#41;
re.SetRenderElementFileName i &#40; FNP + FNN + "_" + el.elementname + FNT &#41;
&#41;
0 Likes