Exporting light bindings

Hello.

I am about to write an exporter to my own realtime graphic engine. This engine has very special requierements, so i don’t see a sane way to reuse Gameblender (or much of any existing engine out there) - and i’m afraid i can write one faster then understand all of Blender’s code.

There is one thing that i cannot figure out from the Python Interface docs. I recall that to make geometry recieve light in Blender’s realtime engine, you must bind the geometry to this light. However, i wasn’t able to figure out how to discover this binding from the Python script. It is not strictly necessary, but i would like to retain this information anyway.

Is it possible at all through Python exporter or should i dive into the SDNA system and write in my tools an importer for Blender files instead? Has anyone ever written any external tools which read Blender files directly?

Kindest regards,
Ilya

starting from:
http://www.blender.org/modules/documentation/237PythonDoc/

the NMFace type has a modes property, it works like a bunch of flags in c…

http://www.blender.org/modules/documentation/237PythonDoc/NMesh.NMFace-class.html#mode

it says see NMesh.FaceModes

http://www.blender.org/modules/documentation/237PythonDoc/NMesh-module.html#FaceModes

notice the LIGHT option there?

so essentially:


for face in mesh.faces:
   if face.mode & NMesh.FaceModes.LIGHT: # notice the bitwise and
      pass # face is light sensitive

Huh? I could have sworn that didn’t get into the printed PDF documentation i generated with epydoc from source! Though i’m far away from it now and unable to check.

Uh, wait. It tells me whether a face may recieve lights at all, but not which lights i actually bound to it!

-i.