Announcement

Collapse
No announcement yet.

serially numbered renderelements

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    I am a total hack with mxs. I made this to update the paths of my elements to match the main output path. I don't have time right now but something similar could be made to number the output filenames.

    Code:
    global theRenderFile = rendOutputFilename --gets the render output path and file name and stores it in the variable "theRenderFile"
    global theRenderPath = getfileNamePath theRenderFile --strips out just the path part of "theRenderFile" from above and stores it in the variable "theRenderPath"
    
    makeDir (theRenderPath +@"elements\") -- makes a directory in "theRenderPath" called "elements"
    
    global re = maxOps.GetCurRenderElementMgr() -- creates a MixinInterface for the Render Element Manager. Basically creates a temporary maxscript interface into this tab in the Render Setup dialog.
    
    for i in 0 to (re.numrenderelements()-1) do --starts a loop that will repeat as many times as there are Render Elements. The zero and -1 are an offset. Some lists of things are zero based, as in, the first element in the list is 0, the second is 1, the third is 2...
    (
        theFile = re.GetRenderElementFilename i     --get the file name and path of the Render Element output path. Variable "i" will change each time the loop is run; from 0 to 1 to 2 to 3 to 4... 
        theFileName = fileNameFromPath theFile     --strip out just the filename part of the path in the last step
        theFile = (theRenderPath +@"elements\"+ theFileName ) -- create a new path and filename variable that  uses the Render Output path plus the "elements" folder plus the original name of the Render Element.
        re.SetRenderElementFilename i theFile --set the output path and filename of teh Render Element to our new path variable from the last step.
    )

    Comment

    Working...
    X