BlenderToIndigo: Yet another Blender to Indigo exporter

Announcements, requests and support regarding the Blender Indigo export script
User avatar
soxofaan
Posts: 20
Joined: Sun Dec 31, 2006 2:32 am

BlenderToIndigo: Yet another Blender to Indigo exporter

Post by soxofaan » Sun May 27, 2007 1:38 pm

Hi blender/indigo folks

In other threads I already declared that I wanted to contribute to the blender to indigo exporter. What kept me back was the lack of version control or other kinds of cooperative tools. Another thing was that I didn't like the way the original exporter was written: a lot of global variables, hardcoded gui stuff, no object oriented design, hardcoded export code, kinky python/math expressions, etc.

When Wedge declared on thread http://www2.indigorenderer.com/joomla/f ... php?t=1817 that he is no longer able to invest time in the exporter, I saw my chance to jump in. I decided to do a complete rewrite of the exporter. After a week working on it I dare to present it on this forum. Most of the changes are under the hood (actually there is hardly anything left from the original code). I opted for an object oriented design, both in the exporter code and gui code. The benefits of this is to make it easier in the long term to support different Indigo version with the same script (e.g. subclassing old exporter classes and only overloading the things that changed). At this point only Indigo 0.8 stable is supported, however.

Another problem with the old version is the very complicated material exporting. How a Blender material is mapped to an Indigo material and its properties was done based with hackish rules (like "if alpha<1 then use a uniform spectrum and a rgb spectrum otherwise"). This is very difficult for the code mainainers and I think not very user friendly too. Moreover, when additional Indigo material types or medium options would be added, it would be increasingly difficult to add these in the exporter without breaking something. I choose a different approach that was already suggested in the code of the old exporter: the name of the material defines the type (diffuse, phong, specular). The settings of the material and medium can also be defined with strings: the names of the textures in the material. See further for the manual, which should make things more clear if this sounds mysterious.

Another feature of this new version is that you can export the material code to a Blender buffer and edit it in Blender. After editing it is possible to export your scene with this edited materials. This way you can store custom Indigo material settings within your Blender file and keep these for future exports.

I chose to create a page on the Blender wiki for hosting the script an a manual (under construction): http://wiki.blender.org/index.php/BlenderToIndigo

The current version of this script (2.43 at the time of this writing) is still beta and not thouroughly tested, but I invite you to test it.

Please reply in this thread if things don't work as expected, if things are unclear, if you have patches or other ideas. I'm happy to help.

(I should get some sleep now)
Last edited by soxofaan on Wed May 30, 2007 1:10 am, edited 1 time in total.

User avatar
Olis
Posts: 215
Joined: Tue Mar 20, 2007 6:46 am
Location: Stockholm, Sweden

Post by Olis » Sun May 27, 2007 7:47 pm

This looks promising. I looked at the wiki page, and it looks like the setting for where the focus should be is missing. Or is it something you set in blender?

zuegs
Posts: 380
Joined: Tue Jun 27, 2006 5:46 pm
Location: switzerland

Post by zuegs » Sun May 27, 2007 7:50 pm

hi soxofaan,
very nice coding... i see you are a real master of python :shock: :D
I've done years of OO coding but never used python before. The indigo exporter and blendigo are my first steps in python and i'am still learning all this nice tricky language features :roll: :wink: . Your code shows me what's possible with tha "snake"... very NICE :!:

User avatar
Kram1032
Posts: 6649
Joined: Tue Jan 23, 2007 3:55 am
Location: Austria near Vienna

Re: Yet another Blender to Indigo exporter

Post by Kram1032 » Sun May 27, 2007 10:03 pm

soxofaan wrote:The current version of this script (2.43 at the time of this writing) is still beta and not thouroughly tested, but I invite you to test it.
The "2.43" has nothing to do with the blenderversion, you use, I guess, but if so, you should try 2.44 ;)

This looks very promissing, indeed :D

User avatar
soxofaan
Posts: 20
Joined: Sun Dec 31, 2006 2:32 am

Post by soxofaan » Sun May 27, 2007 10:06 pm

Olis wrote:This looks promising. I looked at the wiki page, and it looks like the setting for where the focus should be is missing. Or is it something you set in blender?
you have 2 options:
  • you can use the autofocus feature of Indigo: enable the "autofocus" button
  • if the "autofocus" button is disabled, you can set the focus disance by hand, or with 2 extra buttons: getting the focusdistance from the camera settings in blender or getting the focusdistance to the blender cursor

User avatar
soxofaan
Posts: 20
Joined: Sun Dec 31, 2006 2:32 am

Re: Yet another Blender to Indigo exporter

Post by soxofaan » Sun May 27, 2007 10:13 pm

Kram1032 wrote:
soxofaan wrote:The current version of this script (2.43 at the time of this writing) is still beta and not thouroughly tested, but I invite you to test it.
The "2.43" has nothing to do with the blenderversion, you use, I guess, but if so, you should try 2.44 ;)

This looks very promissing, indeed :D
2.43 is the current version of the exporter, it has nothing to do with the blender version (I test it mainly in blender 2.43 however).
It's indeed a coincidence: the old exporter was at version 1.42 or something, I started versioning the rewrite of the exporter from 2.0 and now I'm at 2.43.

thanks

User avatar
Kram1032
Posts: 6649
Joined: Tue Jan 23, 2007 3:55 am
Location: Austria near Vienna

Post by Kram1032 » Sun May 27, 2007 10:15 pm

I see...
But with 2.43, it's not a simple to set up SSS as with 2.44, there is that additional Tab ;)

User avatar
soxofaan
Posts: 20
Joined: Sun Dec 31, 2006 2:32 am

Post by soxofaan » Sun May 27, 2007 10:38 pm

Kram1032 wrote:I see...
But with 2.43, it's not a simple to set up SSS as with 2.44, there is that additional Tab ;)
I doubt it's a good idea to use Blender's SSS settings for Indigo SSS settings. Blender's SSS is "fake" (but fast) and uses a totaly different technique than the "real" SSS of Indigo. Consequently the SSS settings can't be mapped 1 to 1.

That's the whole idea after my approach: it's to difficult (for both the exporter developers and the users) to do an understandable mapping from blender material settings to indigo material/medium settings. That's why I take a different route with the weird texturename stuff.

However, the exporter is designed that way that it could be possible to implement different blender-material-to-indigo-material-filters within the same script. So it could be an option how you translate your Blender scene to a Indigo scene.

User avatar
Kram1032
Posts: 6649
Joined: Tue Jan 23, 2007 3:55 am
Location: Austria near Vienna

Post by Kram1032 » Sun May 27, 2007 10:44 pm

hum... I think, it's very simple:

activate SSS

use only ONE setting: the amount of blur.

this can be used between 0.01 and 1000, which should be enough.

Blur settings define the colour and if all the sliders are simmilar, it's getting exported as uniform :D

Only all those extra options are kinda hard to find...
greystein and such...

User avatar
soxofaan
Posts: 20
Joined: Sun Dec 31, 2006 2:32 am

Post by soxofaan » Sun May 27, 2007 11:12 pm

Kram1032 wrote:Only all those extra options are kinda hard to find...
greystein and such...
That's what I mean. The simple things are obvious, but at one point it becomes evil :twisted:

User avatar
Kram1032
Posts: 6649
Joined: Tue Jan 23, 2007 3:55 am
Location: Austria near Vienna

Post by Kram1032 » Mon May 28, 2007 4:48 am

But it will be hard in ANY case :P

Wedge
Posts: 441
Joined: Sun Jan 14, 2007 11:33 am
Location: East Coast, USA

Post by Wedge » Mon May 28, 2007 4:02 pm

Good luck in your journey. :) Hopefully I will find time to try it in the future. (most of the time I only read forum and don't have time to use Blender/Indigo)
Content contained in my posts is for informational purposes only and is used at your own risk.

User avatar
joegiampaoli
Posts: 837
Joined: Thu Oct 05, 2006 7:12 am
Location: San Miguel de Allende-MEXICO
Contact:

Post by joegiampaoli » Mon May 28, 2007 6:53 pm

That wiki is really nice soxofaan, thx for your work!
Joe Giampaoli
Never tie a ship to a single anchor, nor life to a single hope
My Indigo Gallery

User avatar
soxofaan
Posts: 20
Joined: Sun Dec 31, 2006 2:32 am

new version

Post by soxofaan » Wed May 30, 2007 1:10 am

I posted a new version (version 2.52) of the BlenderToIndigo exporter script to http://wiki.blender.org/index.php/BlenderToIndigo . The documentation is not updated yet at the moment of this writing. I'll do it when I have some time.

Changes:
  • added support for mesh modifiers (like mirror and subsurf),
  • added support for DupliVerts, Duplifaces, DupliFrames, DupliGroups
  • added support for Curve objecs, Surf Objects, MBall objects
  • changed spectrum handling
The image in attachment is complete crap from an artistic point of view, but it shows the new capabilities of the new version:
  • The green balls are 'DupliVerted' sphere primitives
  • the orange drops are 'DupliVerted' meshes with subsurf subdivision
  • the gold 3-shaped objects are 'Dupliverted' curves with a bevOb profile
  • the blue things are 'DupliFramed' nurbs surfaces
  • the glass things are 'DupliFramed' meshes with subsurf subdivision
  • the lighting is done by 4 'DupliVerted' rectangular lights, (see the highlights in the green spheres
Attachments
im1180440231.png
im1180440231.png (214.56 KiB) Viewed 14540 times

User avatar
Kram1032
Posts: 6649
Joined: Tue Jan 23, 2007 3:55 am
Location: Austria near Vienna

Post by Kram1032 » Wed May 30, 2007 1:21 am

artistically crap?
nope!
It looks like cool modern art 8)

Post Reply
18 posts

Who is online

Users browsing this forum: No registered users and 3 guests