Hallo,
I am caught from the blenderartists forum (thread), why?
Interested in Blender and (was) as Java fan, jMonkey is very much intreaging …
So maybe this will be a revival of a dead thread?
The questions at blenderartists was:
Importer does not support:
1- Layers (only first layer works)
2- Empty objects (import empty objects as empty nodes to JMEPlatform)
3- Bones/Armature
4- Animation
5- Right coordinate system (XYZ coordinates)
The last problem 5 may eventually be solved at blender by a script exchanging y,z coordinates of ‘everything’ (I will start with just a mesh) …
By the way the p from pkhg comes from Peter, OK?
Peter
Hi Peter,
the blender importer has no active maintainer and is not complete as you said. The recommended import pipeline is OgreXML.
Hi, a beginning in Blender to change yz to zy (worked with plane and Suzanne)
[java]
#all objects exchange y,z
import bpy
objects = bpy.data.objects[:]
#supported (partiallly)
types =
typesSceneDict =[]
cameras = []
meshes = []
lamps = []
armatures = []
for el in objects:
if el.type == ‘CAMERA’:
cameras.append(el)
elif el.type == ‘MESH’:
meshes.append(el)
elif el.type == ‘LAMP’:
lamps.append(el)
elif el.type == ‘ARMATUE’:
armatures.append(el)
def changeyzMesh(obj):
for el in obj.data.vertices:
el.co.y,el.co.z = el.co.z,el.co.y
def exchangeYZLocation(obj):
obj.location[2],obj.location[1] = obj.location[1],obj.location[2]
for mesh in meshes:
changeyzMesh(mesh)
#not yes sufficient
for cam in cameras:
exchangeYZLocation(cam)
for lamp in lamps:
exchangeYZLocation(lamp)
[/java]
Tryed a sandtanker … indeed now it is nicely shown …
Hey, welcome to the forum Peter I added the Blenderartists thread so extra interested people can read the conversation that lead us up to this point.
So what’s the next step for you with Blender Loader?
As you can see, changing y z and z y in Blender 2.55 (for ‘normal’ objects) is very easy,
The tanker above was first wrong, than I used the script, and in the jMonkeyPlatform its orientation was then OK.
Eventually nothing is done with cameras, so one could leave them out as well as lamps?!
(newbie to jMonkey…, therefore I do not know yet … have much to learn and use jMonkey)
EDIT:
got an 2.55 OGREXML export from the Ogre forum, ONE change needed to use it in Blender 2.55
So exporting of a mesh to an XML and importing works! …
So jMonkey knowing people should tell me what they would like to have, if there are two (or more) scenes with mesh objects.
Can you link to the OgreXML exporter you’re using? Thing is, the OgreXML exporter is a whole different project from the em>Blender Loader. Unless something has changed, the OgreXML format has some shortcomings that only a straight Blender → jME3 pipeline can solve, hence the need to revive this project.
@erlend_sh
I just checked this ogre export mesh
One change is necessary in export_mesh.py
line 64 has to be " wm.fileselect_add(self)"
Verbs in the new API of Blender should be at the end of the context, therefore
It exports ONE mesh-object. Not the material.
Better evem look at: search for the addons form bottom
BUT do you mean, that “convert to j30 binary” on a *.blend file should be revived?
(Contrary what normen says: next alinea?!?!)
@normen (you said: The recommended import pipeline is OgreXML. )
Does this mean that my ‘help’ should be XML export of features from Blender?
And if so, could you tell me, where in the jMonkeyPlatform the XML conversion (Java-souce) can be found,
meaning: what xml can jMonkey already import … (material[this already?], bones, meshes[this for sure])
Uh, sorry, I think theres some confusion here. Theres two area we’d like to see contributions in. First is plain old models and second its somebody that extends the existing but unfinished .blend file importer. It is completely written in Java, no python exporter in blender but a complete .blend file reader: http://code.google.com/p/jmonkeyplatform-contributions/source/browse/#svn%2Ftrunk%2Fblender-support
Yes, what I saw, the .blend file reader is what I saw very very nice. If that is in my ability?
I have to learn how and where a ‘right click’ on a .blend (in models of jMonkeyPlatform) to see what is really going on. … I will try (at least a little bit to find out).
Problem 5 could (as is already more or less see code) be done in Blender itself (and that is Blender Api Python)…
A good change into 2011 wished to al readers here
Peter
my screen is full hd. I hope you will win this war with blender and JME.
HI PKHG!!! Thanks that you are here.
So what we have got about blender:
mporter supports:
- .blend files (2.49, 2.5) compressed or uncompressed.
- Object meshes with location, rotation, scale.
- Materials.
- Texture Color map, Normal map, Specular map, Alpha map.
Importer does not support:
- Layers (only first layer works)
- Empty objects (import empty objects as empty nodes to JMEPlatform)
- Bones/Armature
- Animation
- Right coordinate system (XYZ coordinates)
Firs of all i think we need for blender importer:
1 - correct xyz coordinates
2 - get armature/bones to jmonkey object. You can have a look at ogre importer as it loads bones from ogre model to jmp.
Peter, i’ve got 2 video messages for you 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).
Will look very soon …
Start experimenting (trying to see the ‘man’ running in jMonkey)
result:
I gave the running “man” a green color … and exchanged in Blender y-z coordinates:
Gave a ‘standing’ man as you can see in the picture.
Helaas, the exchange (y-z) of bones etc does NOT work at this moment … AND probably the use
of actionsscripts etc have to be ‘redone’ or …(do not know yet).
In any case you are already very good in making a walkcycle (than me ;-(, something I have to learn in
Blender … your videos may maybe help me ;)!
Comment to the videos … my screen is a little bit too small.
What are your screen measures? 1024x760 or …?
@mifth
I created a new project and copied the blender 2.49 files into the models directory,
both the .blend and mesh.xml were converted into j30 files (no complaints by the system)
But first: how to fix the screen-viewer again to the main window
But more important were is the AnimControl? Ha ,ha, solved! I was too quick, I had to wait an moment!
Now I can see base, the sidewalks the jump and the run_01
So it remains the question: how to fasten the screen-viewer again to the main window.
Next experiment, I will use Blender 2.49b to give the man a color, trying to use the Ogreexporter and
import it into jMonkeyPlatform …
Little steps forward
Why did nobody tell me about Alt Shift D ??? Thus THAT (mini annoying) problem is solved.