.blend import with two scenes, what does one want?


A question: I imported a .blend with two scenes.

In each an object, both got two colours.

In jMonkeyPlaform the import worked ‘half’: both objects were imported in one of the colours.

So if I try to make some progress, I need some info of … (?!).

What should be done with objects in several scenes? a choice which scene one wants to ‘import’?

What about the ‘error’, that only ONE colour shows up?

Where should I start to look at the today implementation of .blend files (I could search, but

I direct advice is more comfortable)



Here is the structure of the 2.53 blend version, maybe some things changed now, this was linked few month ago by pgi (the one who started the blender loader)

I don’t get it how a blend file can have 2 scenes? you mean layers?

I guess the layers should be merged.

For the “two colors” thing, this means the object has 2 materials. JME3 does not support that, there is only one material by geometry.

There is 2 ways :

  • keep the first one encountered (i guess it’s what is done right now since the objects has one color).
  • Split the object into 2 mesh and geometries, apply the different material to each part, then attach the 2 geoms to a parent node so that the object can be manipulated as one.

    However this a very particular case IMO, you should stick to the first solution for now.

No, in Blender you have the option of ‘Scenes’ … (to my knowledge different to layers)

OK. two colors in ONE object, the Blender- user has to split and maybe parent to an empty?

Will see.

Have to learn to use objects imported by a .blend (have to read more ‘tutorial’, today no time any more)

“Here is the structure of the 2.53 blend version, maybe some things changed now, this was linked few month ago by pgi (the one who started the blender loader)” ??? not clear to me.

Biggest wish: where to start to look at the Blender import … in jMonkey? to make stepwise executione

of the 'right click … convert to) possible.

@pkhg I try to develop/extend the blender loader, but i have not much progress.

Here are some infos for you.



This is the netbeans module source for the jmonkey platform integration.


This is the .blend loader source it self.

I do only work on the .blend loader sources for know.

The person called PGI has left jme development. PKHG is our hope for blender support.

About layers: only first layer is supported only in blender importer.

About scenes: I don’t know.

I think only one blender scene should be supported(loaded).

I would also say to just import the objects from the first scene.

A few days ago i looked at the blender importer and did some tests with bones, but unluckily i was not able to find out how the bone->vertex group->vertices connection works. Bone->vertex group connection is not the problem but vertex group->vertices.

So I suppose, that Blenderusers have to move objects from a second or third … scene to one and should best delete all not any more necessary ones (and save it NEW with a name jMonkey or so in it, not disturbing the development .blend)


In the Blender 2.5 to my knowledge there are ‘only vertexgroups’ (and some how distinguishable) and the info of a vertex taking part in which group is in the vertex to be found NOT in the vertexgroup …

Sorry old information …

Checked now

for el in cube.vertices:

print(el.index, “in group”,el.groups.values()[0].group)


0 in group 1

1 in group 1

2 in group 1

3 in group 1

4 in group 0

5 in group 0

6 in group 0

7 in group 0

And indeed I have two vertexgroups the upper face(4,5,6,7) and the lower face (0,1,2,3)

Peter, you are right, but there is no need to delete scenes. Blender importer can import active scene (when we open blender file we have got active scene (by default “Scene”)). IMHO. So, blenderheads can just switch scenes and import what they want.

Also, i’ve got 2 video messages to Peter and Madlion about bones and animation in blender.

http://www.youtube.com/watch?v=ohVgbTY25Ws - part one, about blender and ogre importers.

http://www.youtube.com/watch?v=SCYygRA2OKo - part two, about how blender importer could get animations from .blend files.

http://files.mail.ru/KFTZUU - BaseMesh model (blend and ogre).

Ha, my Russian is at a very low level (though i got BaseMesh.zip ) :wink: … will look soon …

@pkhq Well from the python api it’s as easy as you show, but i can’t get the right informations directly from the .blend file in java.

From there all vertices seems to be bound to the same vertexgroup.

Let me tell you what i have done so far.

I extended the MeshData class to read the “dvert” (array of MDeformVert struct).

I created a new class MDeformVertData to read it attributes, totweight, flag and dw (array of MDeformWeight).

Now a created a new class MDeformWeightDaa to read it attributes, def_nr and weight.

The interesting attributes is def_nr which is the index to the vertexgroups (defbase list of DeformGroup) from the onject.

But def_nr is for all vertices the same.


Nice, you are developing the .blend import to jMonkey.

I would like to help with it … but I have to start to understand how the jMonkeyPlatform

reads the .blend (where is the start?) and where I get the info of how it should

be represented internally for jMonkey.

You should know, that I am beginner in jMonkey and have not yet looked ever

into the binary representation of a .blend file

Have to learn that … the source of Blender 2.5 is available for me … so eventually I

can investigate there, where and how things are ‘saved’ to be read by jMonkey …

or ask the ‘blendercoders’ (http://en.irc2go.com/webchat/?net=freenode&room=blendercoders)

@pkhg One more think… if you have looked at the sources and have some overview i can provide you my changes for the vertexgroups i have done.

Hi, very fine, I just succeeded to use an SVN update …

If you be so kind to give me a ‘bootstrap’ to activate:

blender-support to use your files

And a main to open say a .blend (not compressed) with only the Cube (one material) to

give me a chance to ask questions and to go into problems to be solved …?

@Kaelthas will commit a working blend file importer soon. It has animation support and supports most game compatible material settings out of the box.

Wow, that sounds fantastic! ^^

Good to here that.

OK, sorry, did not know, that you are so busy … will try to update Netbeans… (not possible, downloaded)

And look at BlenderLoder.load() … Thanks!

After some got first (blue face ) running in NB 6.9.1 (*.dll problems solved and som imports of jars) :wink:

madlion said:
@pkhg One more think... if you have looked at the sources and have some overview i can provide you my changes for the vertexgroups i have done.

I have in Netbeans 6.1 the jme3blend project.
Would you be so kind and give me a Class with a main to open a .blend (eg. CubeOnly.blend) in
that project?

I want to inform myself how a I can look into a .blend using jMonkey (or jme3.blend) ...

Why does nobody help me to do the necessary (to my opinion) step to help jMonkey???

pkhg said:
Why does nobody help me to do the necessary (to my opinion) step to help jMonkey????

Be patient... i had no time to prepare a main and provide it.
But there is no magic... just look at BlenderLoader.load() method how to use it. There is the source. There is all you need.

If @Kaelthas will commit a working blend file importer soon there is no need for me to look into this any longer for now. For me it's waste of time.

You should use netbeans 6.8 at least. I think its the min. requirement for jmonkey platform.