Bug: Script per frame wrong started (_BongoBonusToolsForEachFrame)


Today I found that the script is started at the wrong time. The current order is first the script is started and than Bongo jumps to the next frame. I havn’t seen this bug because a light difference between the script and frame count was not visible yet. But at my current project I got trouble. The bug cause:

  • if the slider position isn’t at the first frame than the first frame is rendered without the script is started at the right place of the time line because the script is started at the current time line position
  • if the animation is stopped and started again (don’t overwrite exist files enabled) than for example the script is applied at the animation start position and if Bongo start to render in the middle of the animation than script is not applied

I want to align a billboard surface to the camera per script. First Bongo start the script at the current slider position, than Bongo jumps to the first frame and starts the rendering. After the frame is rendered the next loop starts: the script is started and than Bongo jumps to the next frame. So, Bongo is rendering the script from the previous slider position. For my billboard example it means that the billboard isn’t 100% aligned to the camera.

I hope I found the right words to explain the bug. We need: first Bongo moves to the tick and than the script is started and than the rendering is started. Please fix it asap.

Please add the script option at the Bongo animation options (if _BongoRenderAnimation is started) so that it is saved with the Rhino file. I could be great to get it for Bongo 2.

Recalculate a part of an animation is to slow (Bug)
(Brian James) #2

@andy can you or @Luc offer any help here?

(Luc Adriaenssen) #3

Scripting isn’t ‘my thing’. Sorry.


@Luc: No scripting is needed. At the Bongo Bonus tools is a command that allow to run a script before a frame is started. It’s a Bongo bonus tool bug. A fix is needed and it could be great if the user added script or command is saved at the Rhino file.

(Luc Adriaenssen) #5

OK Micha,

A plunge into the forum history learned me that the _BongoBonusToolsForEachFrame was developed at your wish in Dec ’13 - I must have been inattentive at the time. I assume you call the command-list it offers “the script” – hence my confusion.

Some experimenting learned you are right:

  • the scene is firstly rendered,
  • then the command-list is executed,
  • then Bongo moves to the next frame. Maybe a _BongoBonusTools Before EachFrame is needed in addition to this _BongoBonusTools After EachFrame?

The only thing I can do for you is bring the subject to Andy’s attention. Further it’s up to him.


PS. I can understand that you miss Marika. I miss her to.


The need behind the request for this tool was that for example billboard objects (flat rectangle surface with textures of people or plants/trees) are turned to the camera before a new frame is started. Also very useful if a geometric solver like RhinoWorks is used for an animation. I hope it’s not hard to change and a quick fix is possible.

Thank you for looking on it.


@Luc @BrianJ @Andy I don’t get contact to Andy, but I need the fix for a project here. Could someone look at the code please? It looks like a very little bug, the functionality is there, but only at the wrong time started.

(Lars Rivinius) #8

Sorry for the late reply.

The script should be executed after the model is updated to the current tick but before the rendering starts. Is that correct?

Should the script execute at existing frames when an animation is restarted?


Yes and yes, in both cases needed. The script function is needed to prepare the frame rendering.

PS: And if possible, the script could be saved to the rhino file and also it would be great if the script functionality could enabled for the time line preview. But this are second priority wishes only. :wink:


Has there been any progress on fixing the before & after problem? I think it’s very valuable for Rhino 5 users, even if I expect this to be implemented in Bongo3… :slight_smile:


For @Luc and @marika_almgren to lobby for:

May I suggest that Bongo 3 implements RunScriptBefore and RunScriptAfter of individual keyframes in the Bongo Keyframe Editor?

Wow would this become powerful. And a link to a (list of) Grasshopper definition(s) as well. :slight_smile:

Optionally scripts should be applied for all keyframes in an AnimationSet (like expressions, from start & onward), or for intervals of keyframes (blank out at end keyframe? or by specifying interval at the start frame?), or by explicit call from an individual keyframe (Onward turned “OFF”). All this managed from the Keyframe Editor.

I was surprised to learn that some basic “run command at keyframe” wasn’t already there, but this can be fixed. :slight_smile:

// Rolf

(Luc Adriaenssen) #11

Do you mean a specific type of keyframe (next to Object, View, Layer etc…)

noting a script offering options like ‘on’ ‘off’ and ‘run once’, ‘run every frame’ etc…??
Should the result be taken in account during Preview or only during rendering?

I don’t get what you mean by “a link to a (list of) Grasshopper definition(s)”.

Could you please illustrate your wish with an example in which either (script, grasshopper) would come in handy?


I was thinking of just adding another section after “Expressions”, but perhaps a separare type of Keyframe also would be an option (I think that Expressions and Scripts resides in the same “logical domain”, whereas different UI elements, like Views & Documents etc is obviously different.

For example one could add to the existing Objects Keyframe Editor:

  • One (multi line) field for RunScripttBefore
  • One (multi line) field for RunScriptAfter
  • Checkboxes for Activating the scripts.
  • Radiobuttons: This KeyframOnly | Run Script from Here, or
    Textbox for entering a Keyframe interval.
  • Radiobuttons: VBScript | Phyton :slight_smile:

Something along those lines.

Making changes to a curve (History on) with a Pipe or Lofted surface, could be modified with Script or Grasshopper, for example a curve with hanging cables on a Robot would update according to - not manually set object positions at a keyframe - but according to the Object’s changing position and/or directions (like hanging cables being stretched or relaxed depending on IK-chain movements of the parts it is attached to, hence the manual positioning of cables at specific keyframes is hopeless, especially if the animation needs changes…)

This was just a quick and dirty suggestion, but I’ll think more about this later.

// Rolf

Addendum: I tried to put some life into a downloaded ABB-robot, and realized that I had to drop the cable (flexible) tubing since the tubing bent in unpredictable ways due to the IK-chain controlling the motion :slight_smile: :

(Luc Adriaenssen) #13

OK Rolf, I’ll put it on hold.:expressionless:


The current implementation doesn’t save the script to the Rhino file. Could be great if this could be fixed.