Page 1 of 1

Animation with Maxwell Sea

Posted: Wed Aug 12, 2015 10:44 am
by kami
Thanks Jeremy for implementing a feature to control the Maxwell Sea time via command line.
We've written a script to export an animation with bongo and Maxwell Sea, if somebody ever needs that ...
Code: Select all
Option Explicit 
Sub Maxwell_SeaStudy() 
	Dim Maxwell 
	Dim x
	Dim y
	Dim framerate
	Dim frames
	framerate = 25
	frames = 50
	' create the ScriptObject 
	Set Maxwell = CreateObject("Maxwell.Script.ScriptObject") 
	' successfully created? 
	If Maxwell Is Nothing Then
		Rhino.Print("Unable to create Maxwell.Script.ScriptObject.") 
		Exit Sub 
	End If 
	' successfully connected? 
	If Not Maxwell.IsConnected Then
		Rhino.Print("Unable to connect to the current Maxwell scene.") 
		Exit Sub 
	End If 
	x = 0
	' loop 
	While x < frames 
		' Bongo Tick
		Rhino.Command "_BongoSetCurrentTick " & x, False
		' Maxwell Sea Time
		y = x / framerate
		Rhino.Command "Maxwell_SetMaxwellSeaReferenceTime " & y, False
		Call Rhino.Sleep(0)
		' increment 
		x = x + 1		
		' write frame to disk 
	' done 
End Sub