Animate an Assembly Explosion

This article explains the script that can be used to explode an assembly, put it back together and render the explosion or the reversal/assemble animation.

Using the script, it is possible explode or assemble an animation. It also allows to render the animation of the explosion or assembly.

Using the Script

With script transformation not being able to be undone with Ctrl-Z, please make sure to back up your scene before running scripts.

The script is currently using the Group names in order to identify and sort the assembly. 
It will look for Groups starting with three digits and order them from lowest to highest.
Please put the parts you want to explode in respectively named Groups, and of course, there needs to be at least two groups.


Running the script, you will receive a prompt to 
  • You can enter the translation off set,
  • And the rotation offset

Both are total values that the Group with the highest number will have, while other parts will have fractions of the transformations depending on the amount of parts.

  • The Number of Frames indicates how many steps are required for the explosion to finish.

You can use one frame to find the position you like and to create the camera animation. It's best to create keyframes for the camera on frame 1 and your desired end frame and then keyframe the starting and end position before running the script in the whole frame range.

  • Reverse transformations will transform the explosion in reverse.
    By default it will start with the entered transformations and go back to zero.
  • The Easing refers to the interpolation type, where you can chose between linear, ease in, ease out and ease in and out. Linear easing will have equal steps between frames.
    Easing in will start slow and gradually accelerate, ease out will start fast and decelerate and ease in out is a mix of the last two where it starts and ends slowly and is fast in the middle.
  • The Render option will render each frame and compose a video in the directory of the .bip file.
  • The Camera Name is for choosing which camera should be used for the rendering.
  • Using Group Transformation is for using the actual transformations of the Groups, but due to Euler complications, it might not always produce accurate results, especially with angles >90°
  • Absolute Rotation will keep the axis global, unchecking it will likely not properly assemble the Groups
  • RESET GROUPS will reset all groups of the assembly back to zero.

Comprehensiveness

With Euler angles being non-unique, the using the Group Transformations option might produce unexpected results.
I would be grateful if you would inform me of any missing suffix at nikita.krutov@keyshot.com

Installing the Script

First, please download and install the script below. 

Explode Script

Please note that Custom Scripts are not supported by KeyShot.
Additionally, any changes performed by scripts cannot be reversed with the undo function.
Please make sure to save your Scene before running a script so that you can restore your previous Scene in case of unwanted or unexpected changes.

In order to add the script to KeyShot, you can unzip the script and import the .py file through the scripting console or by copying it into the Scripts folder in your Resource Folder

The Resource Folder by default is installed in the following locations:
Windows:

  • Installed Just For Me:
    %UserProfile%\Documents/KeyShot or 
    C:\Users\<username>\Documents\KeyShot

  • Installed For Everybody:
    C:\Users\Public\Documents\KeyShot or 
    %Public%\Documents\KeyShot

macOS:

  • /Library/Application Support/KeyShot

Other Scripts