- Mon Apr 28, 2008 12:57 pm
#268006
-- for the solution scroll to the end of this thread --
Hi Everyone,
unfortunatelly I don't understand how to use the new Maxwell Animation Functions to export an mxs-series for my Bongo-Animation. Maybe, I'm doing something wrong...
So I tried to solve my problem with a Rhino Script. This ist my first script and I'm no programmer, so it is not nice and doesn't know how to react on wrong input and ESC, but ist works.
My Problem now is: With every Maxwell_RenderToMxs RenderScene Some amount of Ram is filled and I don't know how to free it. Maxwell_ClearCachedData doesn't help and Maxwell_CancelAnimation doesn't either.
If I try to render an animation of more than 80 frames my Ram is filled up and Rhino crashes.
Is anyone here who can help or has an idea what to try?
Here's my Rhino Script:
Hi Everyone,
unfortunatelly I don't understand how to use the new Maxwell Animation Functions to export an mxs-series for my Bongo-Animation. Maybe, I'm doing something wrong...
So I tried to solve my problem with a Rhino Script. This ist my first script and I'm no programmer, so it is not nice and doesn't know how to react on wrong input and ESC, but ist works.
My Problem now is: With every Maxwell_RenderToMxs RenderScene Some amount of Ram is filled and I don't know how to free it. Maxwell_ClearCachedData doesn't help and Maxwell_CancelAnimation doesn't either.
If I try to render an animation of more than 80 frames my Ram is filled up and Rhino crashes.

Is anyone here who can help or has an idea what to try?
Here's my Rhino Script:
Code: Select all
Option Explicit
'Script written by ADF
Public strAnimPath, strAnimName, strImageType, intNr, blnMXI
Sub MWRBA
Dim i, z, intStartFrame, intEndFrame, intByFrames
intNr = 0
'Rhino.Command "! _Maxwell_BeginAnimation"
intStartFrame = Rhino.GetInteger("First Frame", 0, 0)
intEndFrame = Rhino.GetInteger("Last Frame", intStartframe+10, intStartframe)
intByFrames = Rhino.GetInteger("Render every n-th Frame", 1, 0, intEndFrame)
strAnimName = Rhino.GetString("Sequence Name")
strAnimPath = Rhino.BrowseForFolder( Rhino.DocumentPath , "Please select the home folder for this render sequence.", "Select animation Folder")
If Not IsNull(strAnimPath) Then
Rhino.Print strAnimPath
End If
Dim arrFormats(5)
arrFormats(0) = "tif"
arrFormats(1) = "tga"
arrFormats(2) = "jpg"
arrFormats(3) = "png"
arrFormats(4) = "bmp"
arrFormats(5) = "hdr"
strImageType = Rhino.GetString("Image Format", "png", arrFormats)
'Write MXI YES/NO
Dim arrItems, arrDefaults, arrResults
arrItems = Array( "WriteMXI", "NO", "YES", _
"FrameNumbering", "BongoTimeline", "StartWith_1" )
arrDefaults = Array(False, True)
arrResults = Rhino.GetBoolean("Write MXI or not", arrItems, arrDefaults)
'Create Project Folder
Dim filesys, newfolder, newfolderpath
newfolderpath = strAnimPath & strAnimName
Set filesys=CreateObject("Scripting.FileSystemObject")
If Not filesys.FolderExists(newfolderpath) Then
Set newfolder = filesys.CreateFolder(newfolderpath)
End If
'Create MXS Folder
newfolderpath = strAnimPath & strAnimName & "\MXS"
If Not filesys.FolderExists(newfolderpath) Then
Set newfolder = filesys.CreateFolder(newfolderpath)
End If
'Create Output Folder
newfolderpath = strAnimPath & strAnimName & "\Output"
If Not filesys.FolderExists(newfolderpath) Then
Set newfolder = filesys.CreateFolder(newfolderpath)
End If
'Create MXI Folder
If arrResults(0) = True Then
newfolderpath = strAnimPath & strAnimName & "\MXI"
If Not filesys.FolderExists(newfolderpath) Then
Set newfolder = filesys.CreateFolder(newfolderpath)
End If
Rhino.Command "Maxwell_RenderSettings WriteMXI=Yes _Enter"
Else
Rhino.Command "Maxwell_RenderSettings WriteMXI=No _Enter"
End If
Rhino.Command "BongoSchieberpositionDefinieren " & intStartFrame
For i = intStartFrame To intEndFrame Step intByFrames
If arrResults(1) = True Then
z = z+1
Else
z = i
End If
intNr = Right("00000" & Left(Int(z), 4), 4)
blnMXI = arrResults(1)
RenderFrame
If i < intEndFrame Then
Rhino.Command "BongoSchieberpositionDefinieren "& i+intByFrames
End If
'Rhino.Command "Maxwell_ClearCachedData"
Next
Rhino.Command "Maxwell_ClearCachedData"
Rhino.Command "BongoSchieberpositionDefinieren " & intStartFrame & " _Enter"
'Rhino.Command "! _Maxwell_CancelAnimation"
End Sub
Sub RenderFrame
Rhino.Command "Maxwell_OutputSettings ScenePath " & strAnimPath & strAnimName & "\MXS\" & strAnimName &"_"& intNr & ".mxs ImagePath " & strAnimPath & strAnimName & "\Output\" & strAnimName &"_"& intNr & "." & strImageType & " _Enter"
If blnMXI = True Then
Rhino.Command "Maxwell_RenderSettings MXIPath " & strAnimPath & strAnimName & "\MXI\" & strAnimName &"_"& intNr & ".mxi _Enter"
Else
Rhino.Command "Maxwell_RenderSettings MXIPath " & strAnimPath & strAnimName & "\" & strAnimName & ".mxi _Enter"
End If
Rhino.Command "Maxwell_RenderToMxs RenderScene"
Rhino.Command "Maxwell_ClearCachedData"
End Sub
Last edited by polykat on Thu May 01, 2008 12:25 pm, edited 1 time in total.