Showing posts with label Blender. Show all posts
Showing posts with label Blender. Show all posts

Wednesday, 13 July 2011

Blender M3G export error

I'm attempting to build a game atop Kajak3D framework. For that I'm creating models in Blender and exporting them to M3G format.

Well, exporting my very first model failed with "Python script error: Check console". After figuring out that this doesn't mean any Blender-internal console, but plain old console output, I closed Blender and started it from a terminal window. So, I received this message:
translate mesh ...[Object "Body"]
1 material(s) found.
Traceback (most recent call last):
  File "/usr/share/blender/scripts/export_m3g.py", line 3068, in file_callback_m3g
    exporter.start()
  File "/usr/share/blender/scripts/export_m3g.py", line 2680, in start
    world = Translator.start()
  File "/usr/share/blender/scripts/export_m3g.py", line 2022, in start
    self.translateMesh(obj)
  File "/usr/share/blender/scripts/export_m3g.py", line 2296, in translateMesh
    if material.getMode() & Material.Modes.TEXFACE: createUvs = True;
AttributeError: 'NoneType' object has no attribute 'getMode'

My first thought of that was that the first "material" is likely typed with wrong capitalization and should have been "Material". But it is not so: both capitalized and non-capitalized version are actually valid in that script at that point...

Google search didn't find anything on fixing that error, just one unanswered forum post asking how to fix it. Anyhow, I found the solution and decided to post it here, in case anyone else bumps into same issue.

The solution
Link the object material to object mesh, not to whole object.
Note the circled area: your settings should look like this. You can click on "OB" to see if there are any materials linked to the object and to remove them.

Saturday, 31 May 2008

Big Buck Bunny

You may remember the Elephants Dream, the open short movie. It was developed as project Orange at the Happy Blender Institute. Now, a new team working on project Peach at the Blender Institute has published their work: an open short movie Big Buck Bunny.

At LGM, I had the pleasure of watching this great movie on a big movie theatre screen.

Elephants Dream was a technical masterpiece, showing the quality of graphics that can be accomplished with open source programs, it was somewhat lacking in the area of storytelling. While I'm guessing this dreamlike drifting to different directions was intentional at least to some degree, it just felt somehow odd to me. Maybe I just don't understand the fine art ;)

Things look quite different in Big Buck Bunny. It's still a technical masterpiece, actually they've bumped the graphics quality up a notch or two with fur, grass and all such natural phenomena. But the bigger difference is in storytelling. This movie tells a simple story in easy to follow manner, with loads of humour. Some might think that it underestimates the mental capacity of viewers, but I digress. It's nice entertainment.

Other interesting thing from Blender Institute is the project Apricot, which is creating an open source game using Blender, CrystalSpace and several other related tools. I've tried the released versions of these tools, and from what I saw at LGM, this project has made huge improvements to them. Already with the release versions, you can edit stuff like models, textures and actions between the player and scenery in Blender and export all that to the game engine. With the development version project Apricot has, it's possible to actually have the game engine running in a blender window while you can edit game data in other windows.