Another Softimage to Mitsuba exporter

Plugins linking to this thread: (hide)

Mitsuba ExporterAuthor: Shekn @si-community
v0.7.2 updated Apr 4th 2015. This plugin is called Mitsuba and Softimage synchronizer (shortly MaSs). I start to develop it for understanding how the Mitsuba renderer works. So, some tool for export scenes needed. Of course, there are some other exporters from Softimage to Mitsuba. One of them here. I try to understand how it works, but then decide to create my one exporter with Python and GUI.

The latest update includes the abilty to render volumes. For that purpose, the package includes ICE compounds that create 3D-grids which can be manipulated further in ICE, exported with the 'Store VOL' compound, then rendered using Mitsuba. Supports rendering of OpenVDB volumes through Oleg Bliznuk's OpenVDB ICE package. More in the si-community thread.

Slava Shumikhin made a fork of an older version of Shekn's plugin available here on github.

local backup: MaSs plugin 0.7.2 package.zip   Mitsuba 0.5.0 x64 Win.zip (compatible version of Mitsuba)

Angel 07
Posts: 30
Joined: 16 Jan 2011, 13:59

Another Softimage to Mitsuba exporter

Post by Angel 07 » 30 Mar 2014, 11:49

This plugin is called Mitsuba and Softimage synchronizer (shortly MaSs). I start to develop it for understanding how the Mitsuba renderer (https://www.mitsuba-renderer.org/) works. So, some tool for export scenes needed. Of course, there are some other exporters from Softimage to Mitsuba. One of them here: http://www.si-community.com/community/v ... =13&t=3163 I try to understand how it works, but then decide to create my one exporter with Python and GUI.

Link for download (old version): https://dl.dropboxusercontent.com/u/114 ... %200.2.zip
The latest version: https://dl.dropboxusercontent.com/u/114 ... ackage.zip
Post with description of the last version: http://www.si-community.com/community/v ... 517#p49517

After installation in the top menu will appear "MaSs menu" item. Let describe command from this menu:

1. In the Primitive group we can create primitives for Mitsuba. For example, mSphere is not a polygonal sphere but parametric.

2. In the Lights group we can create lights of different types for Mitsuba. In fact all of them are standard lights but with custom light shader

3. The command in Property group add property to the camera. In this property we can choose type of camera, different parameters of it and so on. If this property is not assign to exported camera it will be append automatically.

4. MaSs window open the main window with export settings.

Image

The plugin form a xml file with description of a scene. It can export polygon geometry, lights, camera and point clouds (but with some limitations). Let describe properties of the main export window.

1. Sources - we can choose export whole scene, only selected model with sub-objects or only selected objects.

2. Path - is the path to folder where exported xml file will be saved.

3. File name - the name of exported xml file.

4. If the checkbox "Should increment" is on, then new xml file will be created in each export. The order number will be attached to the file's name. If this chekbox is off, the file will be rewrite.

5. If the checkbox "Should export geometry" is on, all polygon geometry will be export to ply-files. If the mesh contains UV-maps, then only the first of it will be export. Notice that process of export is not fast (because it written on Python). So, you should export all necessary geometry once, and then turn off this checkbox. All properties of meshes will be export to xml-file, but files with geometry information would not recreate.

6. Checkbox "Should export strands" is similar to the previous one. Strands exports as hair primitives. For example, the export of 1000 strands with 10 segments on each spend nearly 7 hours. So strands should export only one time, and after that this chekbox should be off.

7. Image properties set a resolution of image.

8. In the list of Cameras we can choose exported camera.

9. In the section "Types" we can chose tipes of object for export. If we turn off pPolymeshes (for example) then no polymesh will be export. In particular no mesh will be export to ply-files.

10. Export process start by pressing "Export XML" button.

Image

Image

Some words about export of point clouds. If this point cloud contains strands, then this strands will be export as hairs. In the other case, if point cloud has particles, and the type of these particles are sphere, cube, rectangle, cylinder or disc, then for each particle correspondiong primitive will be export. No other types of point clouds is supported.

All supported shaders appear in the Mitsuba section. But medium, volume or phase shaders are empty and can not be used. At present time I don't understand how it should works. The meaning of shader properties can be founded in Mitsuba manual.

Image

Also some examples of scenes in Softimage and corresponding renders in Mitsuba:

Image

Image

Image

Image
Last edited by Angel 07 on 04 Apr 2015, 15:40, edited 5 times in total.

Bullit
Moderator
Posts: 2497
Joined: 24 May 2012, 09:44

Re: Another Softimage to Mitsuba exporter

Post by Bullit » 30 Mar 2014, 13:02

Hi Angel can you tell us your opinion about Mitsuba? Plus minus, what made you consider it, anything else you think relevant.

Angel 07
Posts: 30
Joined: 16 Jan 2011, 13:59

Re: Another Softimage to Mitsuba exporter

Post by Angel 07 » 30 Mar 2014, 14:59

Some advantages:

1. Very easy to render. Also very easy to add more computers for network rendering. So, it allow to render complex scene with hte help of some not pover computers.
2. Physically based shaders. No fake glossy or specular.
3. Many different types of integrator, i.e. algorithms for rendering. In some cases comfortably to use one method, in other case - other.
4. There is possibility to get an implementation of some modern features, which will never be implemented in other renders (like Arnold or, I am sorry, MentalRay). I mean something like feature for render of physically correct fabric structure.

Disadvantages:

1. The render under developing (may be this is the most critical disadvantage). So, there are many usual in other renders things that are not allowed. For example, there is no displace, SSS shader does not support any images as texture, there are no subdivided surfaces and so on.
2. It is hard to synchronize geometry from Softimage to Mitsuba. I mean that the export of geometry is spend a lot of time. Of course, if this export write in c++ it will be faster (more faster), but it should be tested.

In the other words, for some simple task this render can be used. May be for architect visualization, or objective visualization. For more complex tasks as character photo-real visualization it can't be used.

User avatar
Hirazi Blue
Administrator
Posts: 4965
Joined: 04 Jun 2009, 12:15

Re: Another Softimage to Mitsuba exporter

Post by Hirazi Blue » 30 Mar 2014, 18:12

Nice work!
Could you perhaps explain what the direct benefits of your plugin
over the "Collada workflow" (as they call it) are?
;)
...

Angel 07
Posts: 30
Joined: 16 Jan 2011, 13:59

Re: Another Softimage to Mitsuba exporter

Post by Angel 07 » 30 Mar 2014, 19:53

I am sorry if I don't understand what you precisely mean. But anyway, this plugin export scene from Softimage to xml file, which can be load to Mitsuba and rendered. This xml file is a scene for Mitsuba, and the format of this file specified by Mitsuba. So, you can not export your scene from Softimage to fbx or obj and load to Mitsuba for render. You need specific description of the scene. This description presented in generated xml file.

User avatar
Tekano
Posts: 488
Joined: 09 Jun 2009, 14:49
Location: London, UK

Re: Another Softimage to Mitsuba exporter

Post by Tekano » 01 Apr 2014, 22:37

Hi Angel. good work! I like this setup and seemed straight forward

I tried this in 2013 SP1 but get the following error when trying out the 'export XML' button. either with scene, model or object selected.

# ERROR : Traceback (most recent call last):
# File "<Script Block 2>", line 275, in MaSs_ExportXML_OnClicked
# import MaSsXML
# File "D:\xsi\workgroups\mitsuba_render\Application\Plugins\MaSsXML.py", line 3, in <module>
# from lxml import etree
# ImportError: Module use of python27.dll conflicts with this version of Python.
# - [line 274 in D:\xsi\workgroups\mitsuba_render\Application\Plugins\MaSsPlugin.py]
# ERROR : Property Page Script Logic Error (Python ActiveX Scripting Engine)
# ERROR : [272] incrementValue = incrementValue + 1
# ERROR : [273] else:
# ERROR : >[274] strCompleteFilePath = strCompleteFilePath + "\\" + strFileName + ".xml"
# ERROR : [275] import MaSsXML
# ERROR : [276] reload(MaSsXML)
# ERROR : [277]
# ERROR : Traceback (most recent call last):
# File "<Script Block 2>", line 275, in MaSs_ExportXML_OnClicked
# import MaSsXML
# File "D:\xsi\workgroups\mitsuba_render\Application\Plugins\MaSsXML.py", line 3, in <module>
# from lxml import etree
# ImportError: Module use of python27.dll conflicts with this version of Python.
#


is this 2014 only? or should I install python27.. or what do you recon? :D
Gossip is what no one claims to like, but everybody enjoys.

Angel 07
Posts: 30
Joined: 16 Jan 2011, 13:59

Re: Another Softimage to Mitsuba exporter

Post by Angel 07 » 02 Apr 2014, 03:24

Right, the library lxml is needed for export. As in Softimage 2013 installed Python 2.6, you should manually download this library for this version of Python and copy corresponding folders to Python folder of Softimage. It should works.

You can download package from here: https://pypi.python.org/pypi/lxml/2.3/

User avatar
Tekano
Posts: 488
Joined: 09 Jun 2009, 14:49
Location: London, UK

Re: Another Softimage to Mitsuba exporter

Post by Tekano » 03 Apr 2014, 01:16

Angel 07 wrote:Right, the library lxml is needed for export. As in Softimage 2013 installed Python 2.6, you should manually download this library for this version of Python and copy corresponding folders to Python folder of Softimage. It should works.

You can download package from here: https://pypi.python.org/pypi/lxml/2.3/
thank you Angel 07

I am sorry to say that I did this , deleted the previous lxml folders and copied the 2.6 python versions over. (had to install some .egg reader!) but i still get an error :( it is different though

I tried to download the windows installer binaries for 2.6 python version but they are stupid and could not find Python installed in the registry. I appear to have both 2.6 & 2.7 installed as well as the version inside Softimage..!

but I know (from past experience) python can be a pain in the ass with versions and Softimage b-(


# ERROR : Traceback (most recent call last):
# File "<Script Block 2>", line 275, in MaSs_ExportXML_OnClicked
# import MaSsXML
# File "D:\xsi\workgroups\mitsuba_render\Application\Plugins\MaSsXML.py", line 3, in <module>
# from lxml import etree
# ImportError: DLL load failed: %1 is not a valid Win32 application.
# - [line 274 in D:\xsi\workgroups\mitsuba_render\Application\Plugins\MaSsPlugin.py]
# ERROR : Property Page Script Logic Error (Python ActiveX Scripting Engine)
# ERROR : [272] incrementValue = incrementValue + 1
# ERROR : [273] else:
# ERROR : >[274] strCompleteFilePath = strCompleteFilePath + "\\" + strFileName + ".xml"
# ERROR : [275] import MaSsXML
# ERROR : [276] reload(MaSsXML)
# ERROR : [277]
# ERROR : Traceback (most recent call last):
# File "<Script Block 2>", line 275, in MaSs_ExportXML_OnClicked
# import MaSsXML
# File "D:\xsi\workgroups\mitsuba_render\Application\Plugins\MaSsXML.py", line 3, in <module>
# from lxml import etree
# ImportError: DLL load failed: %1 is not a valid Win32 application.
#
Gossip is what no one claims to like, but everybody enjoys.

Angel 07
Posts: 30
Joined: 16 Jan 2011, 13:59

Re: Another Softimage to Mitsuba exporter

Post by Angel 07 » 03 Apr 2014, 07:40

Ok, try to download this archive: https://mega.co.nz/#!UthDUa6L!_Vu5IT0ZS_mWpVOXF5IUwsLbOkuuK5w63WFels1lQXA

It contains lxml for Python 2.6 for 64-bit Windows. And then, as described in installation instruction, copy these two folders to C:\Program Files\Autodesk\"Your version of SI"\Application\python\Lib\site-packages

Of course, previous folders should be deleted.

User avatar
Hirazi Blue
Administrator
Posts: 4965
Joined: 04 Jun 2009, 12:15

Re: Another Softimage to Mitsuba exporter

Post by Hirazi Blue » 03 Apr 2014, 10:22

I think a slightly more general approach to the problem is described over at eX-SI:
Installing Python modules in the Softimage Python site-packages
You obviously have to adapt the value of the registry entry to the actual path
(not the older - 2011 SAP - one used as an example)...
...

Angel 07
Posts: 30
Joined: 16 Jan 2011, 13:59

Re: Another Softimage to Mitsuba exporter

Post by Angel 07 » 02 May 2014, 21:47

Some little small update:

https://dl.dropboxusercontent.com/u/114 ... 00.1.5.zip

What's new:

1. There are no any additional module for Python needed. So, for install sufficiently to move files to \Application\Plugins folder in any workgroup, and it will work.

2. Add parameter "Default integrator" for exporter. This parameter set the integrator (rendering algorithm) to corresponding value. By default in Mitsuba this integrator is equal to Direct Illumination. So, for obtain reflections in the test renders we had change the algorithm every time. Now it not necessary.
Image

3. Add new property for every object. If "Is subdivide" is on, then before export object to ply format it will be subdivided to the specified level (of course with preserving UV maps). If "Is solid" is on, the object will be export with ignoring UV maps and information of smooth groups (in fact each normal of vertex will be the average of incident polygons). Resulting ply-file has smaller weight and load to render faster.
Image

The main subject - test of the exporter and render in real scene. So, I take some scene from Evermotion (Archinteriors vol. 24) and try render it in Mitsuba. The result:
Image

What I can note:

1. Of course, this is not VRay, Mental or Arnold. But it works and very stable. Export of all geometry spend nearly 3 hours. Total weight is 600 Mb. Scene loaded to render nearly 1-2 minutes. This is not convenient for test renders.

2. All scene lighted by one HDR-map. So, many small bright dots appear. Increasing samples count theoretical solve this problem, but in this case render time tends to infinity. More or less this problem was solved with the help of "Photon mapper" algorithm. But anyway, the render time of presented image is nearly 1-2 hours.

3. I used one of the main advantage (as I think) of Mitsuba - it is very easy to increase calculating power. I have another computer in network (i7 with 8 threads), and by specifying the network address of this computer in properties of render, my computer render the picture together with this second computer. So, the total number of threads is 16. This is very convenient.

Newcomer (<20 posts) alert: please use the URL tags - HB

Bullit
Moderator
Posts: 2497
Joined: 24 May 2012, 09:44

Re: Another Softimage to Mitsuba exporter

Post by Bullit » 03 May 2014, 00:22

Yeah that image seems to miss some light.

Angel 07
Posts: 30
Joined: 16 Jan 2011, 13:59

Re: Another Softimage to Mitsuba exporter

Post by Angel 07 » 10 May 2014, 12:30

Next small update.

https://dl.dropboxusercontent.com/u/114 ... %200.2.zip

What's new:

1. Now it's possible to export not only ascii ply-format, but also binary ply-format and serialized mesh.

2. Hight field object

3. Irawan shader for cloth. There are no any generator of template files for this shader, but it is possible to use 6 example files.

4. Homogeneous shader. This allow to obtain more accurate sss effect and also translucent liquid.

Try to render some example:
Image

Newcomer (<20 posts) alert: please use the URL tags - HB

User avatar
Tekano
Posts: 488
Joined: 09 Jun 2009, 14:49
Location: London, UK

Re: Another Softimage to Mitsuba exporter

Post by Tekano » 12 May 2014, 19:26

I got it to work after putting the path into regedit pointing to 2013 SP! etc. yay!

not sure how to connnect the shaders up properly yet am sure here is homogonous shader set to skin
render_xsi_mitsuba_test.jpg
by the way .PLY export set to binary is orders of magnitude quicker than sequential. many thanks for adding this!
You do not have the required permissions to view the files attached to this post.
Gossip is what no one claims to like, but everybody enjoys.

Angel 07
Posts: 30
Joined: 16 Jan 2011, 13:59

Re: Another Softimage to Mitsuba exporter

Post by Angel 07 » 12 May 2014, 20:17

The shader setup is simple. Use mHomogeneous for presets or mHomogeneousSigmaAS or mHomogeneousSigmaTAlbedo for specifying parameters by hand. But this add only sss effect. For adding some specular add mDielectric shader (or mRoughDielectric) to bsdf port. You can also pass throw mBumpMap for adding bump effect. The phase node is not necessary (at default it has isotropic type).
You do not have the required permissions to view the files attached to this post.

Angel 07
Posts: 30
Joined: 16 Jan 2011, 13:59

Re: Another Softimage to Mitsuba exporter

Post by Angel 07 » 30 Sep 2014, 06:28

Ok, next version of the plugin is MaSs 0.5.0.

Download: https://dl.dropboxusercontent.com/u/114 ... ackage.zip
Compatible version of Mitsuba: https://dl.dropboxusercontent.com/u/114 ... %20Win.zip

What improved: now the plugin not only generate xml-file, but render it in separate Qt-window. Initially I would like to do something like integrated render (like Arnold, for example), but it was harder than expected. So, some compromise is to use Mitsuba Python API. It allows to render pictures by using Python commands. As plugin used Qt interface, PyQtForSoftimage is needed. All necessary files are in archive.

Also I rewrite some functions for export geometry in C++. Now the export process is more faster.

Some videos (from the channel http://www.youtube.com/channel/UC9gBf1mPED7yIOemBp-XUlQ):

1. Example of animation, rendered with the help of the plugin:



2. Installation process:



3. Description of details of rendering process:



4. Properties of rendering window:



5. General workflow:



6. Mitsuba primitives:



7. Mitsuba lights:



8. Shaders setup:



9. Setup of the Irawan shader for fabric:



10. Rendering point clouds (but not volumetrics):



11. Workflow for rendering animation:



Known bugs:

1. The button "Stop" on rendering window should stop the render process. It happens, but then XSI is crushed. I don't know why.
2. If the scene contains strands (for hairs, for example) then render in window does not start, but all works correctly throw command line.

Also for render should be used the version of Mitsuba from the top of the post. The old official build have some differences in Python API.
You do not have the required permissions to view the files attached to this post.