The cool thing about programs like Autodesk Softimage is they allow programmers to extend their functionality through plugins. In this blog, I’ll explain how Vaida Laganeckiene and I created WebGL exporter plugin written in C++ for SoftImage 2011.
To create SoftImage plugins, you first need to setup a environment variable. Add the environment variable XSISDK_ROOT with the value ‘C:\Program Files\Autodesk\Softimage 2011\XSISDK‘ (or where ever SoftImage XSISDK is installed).
We used Visual Studio 2010 for compiling the projects. To get started we took one of the example plugins located in C:\Program Files\Autodesk\Softimage 2011\XSISDK\examples\workgroup . This way we had a plugin-project up and running from the beginning, and we didn’t spend time on compiler and linker configuration (the example files includes project files for Visual Studio). Besides the well documented example files, SoftImage also includes great API documentation.
The SoftImage plugin
Currently there is no easy way to take your SoftImage scene and render it on a webpage using WebGL. Our plugin iterates the scene and export all polygon mesh to a JSON mesh files. Besides it also export the scene structure to another JSON file; this includes materials, parent/child information, transforms, light and camera information. Finally it copies all diffuse textures to the export folder, it creates a sample html file and it save other dependencies.
There is a some limitations on what is supported for the export. Read the plugin documentation for more details.
The WebGL renderer
- WebGL-Renderer: Renders a scene in WebGL
- WebGL-Loader: Loads the scene-file, mesh-files and textures
- WebGL-Input: Handle mouse and keyboard input that let the user fly around in the scene
WebGL is shader based, so we also implemented some shaders in GLSL. Most important is the phong shader.
Since loading of JSON files requires a webbrowser, we also created a tiny web-server that can be used for testing the scene easily.
Using the plugin
The following videos show how to install and use the plugin. Note the videos are also available in the plugin itself (in higher resolution).
Getting the plugin
The plugin is released as Open Source under the Creative Commons Attribution 3.0.
The plugin (source, binaries and documentation) can be downloaded from: