December 20, 2016

Selective explode in the viewer

Default blog image

    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:

Screen Shot 2016-12-21 at 15.06.45

Related Posts

June 5, 2019

What icons are provided by the Viewer stylesheet

At the Forge Accelerator in Boston Tianmin asked if there was an easy way to see

Read More