- Sun Oct 20, 2013 5:18 pm
#372257
Hi Jeremy
I got another weird thing.
The following code is a combination of some scripts you wrote. The first part exports a timelapse animation of 2 hours (120 minutes) in 120 frames. The next parts is a bongo time line animation with a camera movement.
I now rendered out the first part and it is not smooth. When checking frame by frame, sometimes the sun jumps further, sometimes there is no change inbetween the frames. I double checked the MXS files in studio, to rule out that the network render did mess up the resulting images. And inbetween some mxs is a difference of several minutes, sometimes no difference at all and sometimes it even jumps back in time.... Do you have an idea how that is even possible?
For example, the following frames show these times in studio when I open the mxs files:
68 - 17:02
69 - 17:03
70 - 17:06
71 - 17:07
72 - 17:03
73 - 17:04
It looks something like this:
https://vimeo.com/77335512
I got another weird thing.
The following code is a combination of some scripts you wrote. The first part exports a timelapse animation of 2 hours (120 minutes) in 120 frames. The next parts is a bongo time line animation with a camera movement.
I now rendered out the first part and it is not smooth. When checking frame by frame, sometimes the sun jumps further, sometimes there is no change inbetween the frames. I double checked the MXS files in studio, to rule out that the network render did mess up the resulting images. And inbetween some mxs is a difference of several minutes, sometimes no difference at all and sometimes it even jumps back in time.... Do you have an idea how that is even possible?
For example, the following frames show these times in studio when I open the mxs files:
68 - 17:02
69 - 17:03
70 - 17:06
71 - 17:07
72 - 17:03
73 - 17:04
It looks something like this:
https://vimeo.com/77335512
Code: Select all
Option Explicit
Dim mw, startTime, endTime, startFrame, frameCount, startMove, finalMove, timeSpan, increment, currentTime,endFrame, currentFrame, frameDuration, cmdPrefix
Dim promptForValues, setTimelineRange, RangeCmd
Sub Maxwell_Bongo2SunStudy()
Set mw = CreateObject("Maxwell.Script.ScriptObject")
' scene options
mw.Environment.SunEnabled = True
mw.Environment.EnvironmentType = "PhysicalSky"
mw.PluginOptions.CacheMXSMeshes = True
' animation options
startTime = 16.0 ' start
endTime = 18.0 ' end
startFrame = 0 ' start @ frame 0 for the sun-Animation
frameCount = 120 ' 1 minute per frame
startMove = 0
finalMove = 250
' optionally, get options using the command prompt
promptForValues = False
If promptForValues Then
startTime = Rhino.GetReal("Enter Start Time", 9.5, 0.0)
If IsNull(startTime) Then Exit Sub ' cancelled
endTime = Rhino.GetReal("Enter End Time", 12.5, startTime)
If IsNull(endTime) Then Exit Sub ' cancelled
startFrame = Rhino.GetInteger("Enter Start Frame", 0, 0)
If Isnull(startFrame) Then Exit Sub ' cancelled
frameCount = Rhino.GetInteger("Enter Frame Count", 180, startFrame)
If IsNull(frameCount) Then Exit Sub ' cancelled
End If
' internal variables
timeSpan = endTime - startTime
increment = timeSpan / frameCount
currentTime = startTime
endFrame = startFrame + frameCount - 1
currentFrame = startFrame
frameDuration = increment * 60.0
cmdPrefix = "_ClearUndo _BongoSetCurrentTick "
' abort if frame length is less than 1 minute
If frameDuration < 1.0 Then
Rhino.Print("Too many frames: minimum time per frame is 1 minute.")
Exit Sub
End If
' export the animation
Rhino.Print("Maxwell_Bongo2SunStudy info:")
Rhino.Print(" - time span: " & startTime & "-" & endTime)
Rhino.Print(" - frame range: " & startFrame & "-" & endFrame)
Rhino.Print(" - frame time: " & frameDuration & " min.")
Rhino.Print("Exporting animation...")
mw.Rendering.BeginAnimation()
While currentTime <= endTime
Rhino.Command "_ClearUndo"
mw.DateAndTime.TimeOfDay = currentTime
Rhino.Print("Exporting Time: " & currentTime)
mw.Rendering.RenderToMxs()
currentFrame = currentFrame + 1
currentTime = currentTime + increment
Wend
While startMove <= finalMove
Rhino.Command cmdPrefix & startMove, False
Rhino.Print("Exporting Bongo Frame: " & startMove)
mw.Rendering.RenderToMxs()
startMove = startMove + 1
Wend
' mw.Rendering.EndAnimation()
Rhino.Print("Animation export done.")
End Sub
Call Maxwell_Bongo2SunStudy()
nightnurse images, Zürich
http://www.nightnurse.ch
http://www.nightnurse.ch