i’m trying to create a flythru animation with Bongo, and i already have seriese of camera position and target points in csv.
instead of making keyframe manually, i tried to do it by RhinoScript.
following script fails to function as i want to where i hoped that moving the camera position while Animate isEnabled will create a keyframe.
can anyone give me some advice??
Rhino.Command "BongoSetCurrentTick 0"
While Not objFile.AtEndOfStream
strLine = objFile.ReadLine
arrData = split(strLine, ",")
Rhino.Command "BongoAnimate e _Enter"
Rhino.ViewCameraTarget strTargetView, Array(arrData(0), arrData(1), arrData(2)), Array(arrData(3), arrData(4), arrData(5))
Rhino.ViewCameraUp strTargetView, Array(arrData(6), arrData(7), arrData(8))
Rhino.Command "BongoAnimate e _Enter"
Rhino.Command "BongoSetCurrentTick i _Enter"
Wend
Did you enable animation for the viewport? You do this by right clicking the view in the animation manager and clicking “Animation Enabled.” It should look like this when you’re done.
If animation for the view is not enabled the keyframes will not be created. You can also read more about animating views here.
So there’s some issues with Bongo that make your script not work. It has to do with how Bongo listens to viewport updates. A better way to pass this data to Bongo would be via the BongoAddKeyframe command. What I do is build one large command with all the keyframe data then run that command. It may take awhile to run but hopefully this accomplishes what you want.
@Joshua_Kennedy
thank you so much for your help.
it certainly accomplishes what me want!!
i wasn’t using BongAddKeyframe command just because i didn’t want to do Up vector to Rotation conversion.
this was just for my experimental project (below), but possibly in the future, i’d use the script in the real project. https://youtu.be/NZZGcjKKpxI