20 Dec 2016
Selective explode in the viewer
![Default blog image](/sites/default/files/default_images/Placeholder%20-%20Blog%20images_Lifestyle%2016x9%201920x1080.jpg)
Here is a question that was asked by a developer during our last accelerator: How to exclude some components from being exploded in a model?
Well, there is no API method directly exposed to achieve that, so I dig in the viewer source code and extracted the piece of code that handles the explosion transforms, then customized it a bit by adding an if condition that will prevent the passed fragment ids from being transformed.
Here is the method, I named that selectiveExplode:
You can cut and paste that code here to quickly test it, simply replace the load method by this one with predefined fragment Ids:
This will prevent the carburator ("Carb:1") from being exploded: