I was planning to add blender particle support for mitsuba exporter, and export them as instances, but it seems there is always some kind for problem.
Blender mitsuba exporter works based on collada format, and collada exporter in blender dosen’t support modifiers (including particles).
So I did something like 3 different python scripts to hack my way through exporting instanced particles (it would be good for all kind of stuff – hair, grass, instanced leafs or whole trees etc.)
- Changing exporter from dae to obj. Unfortunately mitsuba seems to convert all obj objects from ‘scene.obj’ file as one shape (mitsuba shape is same as blender object-mesh entity). So I could not even get materials to work, and assign them correctly through mitsu adjustment file.
- Exporting each blender mesh, as separate obj file. This time Blender was freaking bitching about modyfing scene while . I have no idea, how do I bypass this. Probbably need to detect UI drawing state, but I have no idea how ( I just learn Blender API and python while coding exporter :/).
- I tried to just iterate manually over each particle and export it through mitsuba adjustment mechanics, as type with transformation matrices, but then it seems, there is no way to attach this list of after shape they are referring too. It is important to attach instances of object after it’s declaration in xml scene file, so parser knows what those instances are reffering too.
Damm, coding is stresfull. Somebody help me…
Anyway here is updated mitsuba exporter with:
After coding it is good to relax by drawing some 🙂