Preview of the next Blender exporter

The place for artists, modellers, level designers et al to discuss their approaches for creating content for OGRE.
Post Reply
reimpell
OGRE Contributor
OGRE Contributor
Posts: 570
Joined: Mon Mar 01, 2004 10:35 am
Location: Hamburg, Germany

Post by reimpell »

ahkun wrote:But the new exporter outputs a set of skeleton file for each mesh, even though in this case they are all the same.
Unfortunately, the transformation between the armature object and the mesh object becomes part of the OGRE skeleton. So as long as the meshes that share the same armature do not have the same Blender object transformation, the resulting skeletons are different.
ahkun wrote:Also, why not bring back the option of "not" pose sampling animations
The problem is that this only works for a very special case, namely, that the Bezier splines of the Blender animation curves do not have any kinks (i.e., they are differentiable with a continuous derivate).
ahkun wrote:"vertex at index ### is not part of passed group...
This is a debug message of BPy that is not disabled for release builds for some unknown reason.
Skapie
Gremlin
Posts: 162
Joined: Fri Jan 27, 2006 2:59 pm

Post by Skapie »

Hi, I seem to have a problem with the new exporter. It might be something else, but I'll try to explain the problem and hopefully someone might be able to help.

I use code in ogre to access the hardware buffers and move vertices around. When a vertex is moved, so is the surrounding vertices connected to it.

I updated one of my meshes in Blender 2.43 and used the newest exporter to export it to ogre.

When I run my application though, the mesh doesn't behave like it used to. When I move a vertex, it looks like a copy of the vertex is moved around, but nothing next to it moves, almost like it's not connected anything else. It's difficult to explain, but it might have something to do with the fact that the current version of blender supports multiple UVs? Perhaps the hardware buffers change with the new blender meshes, so it might be my own code? Anyway, exporting the mesh with the old exporter works fine. I also noticed that the mesh file is more than half the size of the new exporter's mesh files.

I suppose I can just use the old exporter in the meantime, though I'm curious as to what is causing this behavior. If I have more info on the new exporter's mesh structure, perhaps I can figure out what goes wrong.

Thanks!
banal
Halfling
Posts: 59
Joined: Tue Jan 22, 2008 11:06 am

Post by banal »

Hi reimpell

First, let me say thanks for this great Exporter you developed. I just started to use it and it was very easy to use and produced the results i expected :)

I wondered if its possible to handle Blenders Multires Meshes as well? It would be quite awesome if it were possible to export a Multires Mesh directly into OGREs mesh format to manually create different LOD Meshes.

Here are the release notes for multires meshes: http://www.blender.org/development/rele ... /multires/

I don't know if the different meshes are already accessible using the Python API though. A quick look at the Blender 2.45 Python API unveiled that it's possible to check if a mesh has multires enabled. I don't see a way to "grab" verteces from a certain level.. although i'm not familiar with Python Scripting and the Blender API.

Don't know if this is doable or even useful?
Cheers -- banal

Edit: Umm. I should probably have posted this in the sticky thread since the last activity on this thread was quite some time ago. Sorry for that!
ahkun
Gnoblar
Posts: 2
Joined: Wed Apr 04, 2007 5:54 am

Post by ahkun »

Great work on the exporter, no more surprises for exporting from blender these days.

Just wondering whether you can bring back the RotX -90 as a toggle button, as it would make life a lot easier for people who want to export each object with orientation "as it looks like" in blender.

I reckon that function existed in the old blender exporter for a reason.
Thanks for the good work though.
User avatar
nikki
Old One
Posts: 2730
Joined: Sat Sep 17, 2005 10:08 am
Location: San Francisco
x 13
Contact:

Post by nikki »

In the old exporter, there was an option to rotate and scale the mesh while exporting. For my applications, I scale the meshes by a factor of 10 and rotate them -90 degress around X axis and 180 degrees on the Y axis. How would I go about doing something similar in the current exporter? Do I have to hard code it or is there some parameter somewhere?

Thanks for all the hard work you put into these things. They're very important. :)
reimpell
OGRE Contributor
OGRE Contributor
Posts: 570
Joined: Mon Mar 01, 2004 10:35 am
Location: Hamburg, Germany

Post by reimpell »

nikki wrote:How would I go about doing something similar in the current exporter?
If you do not have any animation key frame that relies on absolute coordinates,
  1. go into edit mode,
  2. select all vertices,
  3. scale and rotate with the local coordinate system in mind,
  4. leave edit mode,
  5. select the mesh object,
  6. scale and rotate the mesh object such that it looks right in Blender's global coordinate system.
The mesh object transformation of the last step only gets exported with the scene exporter. Therefore you can have both: A model that looks right with Blender's default "up"-vector and scaling conventions and that looks right with Ogre's default "up"-vector and scaling at the same time.

However, you can still hard code any transformation into the export code.
User avatar
nikki
Old One
Posts: 2730
Joined: Sat Sep 17, 2005 10:08 am
Location: San Francisco
x 13
Contact:

Post by nikki »

Thanks, I'll look into the steps, but, if I want to hard code it, where and how should I? The export script is pretty huge, and I had no luck understanding anything. :(
User avatar
lf3thn4d
Orc
Posts: 478
Joined: Mon Apr 10, 2006 9:12 pm
x 12

Post by lf3thn4d »

nikki: This might be your lucky day. :P (but no scaling though)

Here's a patch to anybody who cares. I feel that fix Y as up axis feature should be added back to the exporter. Namely being that that's what most of us want. And also the real problem is the scene exporter not exporting correctly. Which I have fixed.

Mesh Exporter patch:
https://sourceforge.net/tracker/index.p ... tid=302997
- enable/disable material export.
- fix meshes to Y axis. (We REALLY need this - the real fix is to fix scene exporter!)
- change the mesh listing to use mesh name instead of object name. Hence
instanced meshes will not be exported more than once.

Scene Exporter patch:
https://sourceforge.net/tracker/index.p ... tid=302997
- follow the new dot scene format
- added Fix Up Axis to Y button (This does the right thing compared to the
rotate by X option)
- when this is used, the rotation values will not be used.
User avatar
SaiCo
Halfling
Posts: 43
Joined: Sat Jun 09, 2007 2:19 pm
Location: Malbork, Poland

Post by SaiCo »

Hey! Wonderfull thing you've done ...
but could you post fixed scripts somwhere for ppl who do not want to wait for official approval ? Unofficial release ?
(frankly i have no idea what to do with that patch thingies, noob + windowz :oops: )
User avatar
nikki
Old One
Posts: 2730
Joined: Sat Sep 17, 2005 10:08 am
Location: San Francisco
x 13
Contact:

Post by nikki »

Thanks a lot! :) I'll look at it tomorrow, pretty busy today.
User avatar
lf3thn4d
Orc
Posts: 478
Joined: Mon Apr 10, 2006 9:12 pm
x 12

Post by lf3thn4d »

Alrights alrights, here ya go. :wink:
http://lefthand.xullum.net/downloads/te ... atched.zip

This contains both scene and mesh exporter. Just put them in blender's script dir.
Marnel
Gnoblar
Posts: 4
Joined: Thu Apr 10, 2008 8:00 pm

Post by Marnel »

This exporter is really wonderful, but we can't export two UV coordinates, so I can't use lightmap.
How can I get that fixed ?
User avatar
lf3thn4d
Orc
Posts: 478
Joined: Mon Apr 10, 2006 9:12 pm
x 12

Post by lf3thn4d »

Updated patch to export multiple UV:
https://sourceforge.net/tracker/index.p ... tid=302997
Note: This patch changed the script to use Mesh instead of NMesh. Since NMesh doesn't have multi UV feature and Mesh now has shape key info.

For those who want the full files, it's updated:
http://lefthand.xullum.net/downloads/te ... atched.zip
Marnel
Gnoblar
Posts: 4
Joined: Thu Apr 10, 2008 8:00 pm

Post by Marnel »

I had a look, and it don't seem to work

It is OK for the two uv coordinates, but it make an only submesh instead of one by texture as before (I have 4 textures for the first uv layer and my lightmap for the second), it copy only the lightmap and make the material file only for it
User avatar
lf3thn4d
Orc
Posts: 478
Joined: Mon Apr 10, 2006 9:12 pm
x 12

Post by lf3thn4d »

Heh. You mean that meshes got exported with multiple UV all right. But the material doesn't export correctly. That's obviously because I didn't even do anything to the material export script. Personally, IMHO, material script generation is rather limited. Most of the time we are writing our own material script instead of using generated ones which half the time can't do what we want. If anybody wants to fix up the material export, feel free to do so and submit another patch. As for me, i'm happy with whatever there is now. I don't really use the material export. Which is why I added a way to turn it on or off.
User avatar
Praetorian
Google Summer of Code Student
Google Summer of Code Student
Posts: 171
Joined: Fri Aug 10, 2007 10:37 pm
Location: WA - USA
x 5

Post by Praetorian »

Thank you lf3thn4d!!! :D :D

I have been trying various ways of getting multiple texcoords out of the exporter and though I had a method that worked, it required exporting several times and comparing and merging the files... this will save me a lot of time, thanks!

And I'm fine with the material stuff not working with it, I always ended up deleting the file anyways...

EDIT: I just played around with it a bit and wow, it works much faster (30 seconds on a 3000 vert model with a couple hundred frames of animation and 2 sets of uv's, as opposed to 5-10 minutes for the same model with the old exporter) and the "vertex at index ### is not part of a passed group" error is gone.
User avatar
lf3thn4d
Orc
Posts: 478
Joined: Mon Apr 10, 2006 9:12 pm
x 12

Post by lf3thn4d »

You're welcome :) Glad it worked out for you. Yeah, speed improvements is mainly because I switched the exporter to use the new blender mesh API that accesses the mesh data directly. Before that, it used to be doing lots of copies every time you try to access the mesh data.

Thanks for checking it out btw. :)
User avatar
SaiCo
Halfling
Posts: 43
Joined: Sat Jun 09, 2007 2:19 pm
Location: Malbork, Poland

Post by SaiCo »

Bit late, but just to let You know, here also works perfectly! thanks lf3thn4d!
Marnel
Gnoblar
Posts: 4
Joined: Thu Apr 10, 2008 8:00 pm

Post by Marnel »

Ok for the materials.
But there is still a thing I don't anderstand: how can I have multiple texures in one UV Layer (before it was in multiple submesh, and now there is one submesh) ?

Otherwise, thank you for this wonderfull tool! :D
User avatar
lf3thn4d
Orc
Posts: 478
Joined: Mon Apr 10, 2006 9:12 pm
x 12

Post by lf3thn4d »

SaiCo wrote:Bit late, but just to let You know, here also works perfectly! thanks lf3thn4d!
You're welcome :) Thanks for testing it out :)
Marnel wrote:Ok for the materials.
But there is still a thing I don't anderstand: how can I have multiple texures in one UV Layer (before it was in multiple submesh, and now there is one submesh) ?
Umm.. what do you mean by the submesh and one submesh thing? I don't quite get you there. If you are talking about multitexturing, that's pretty much a material thing. Just use multiple texture unit in the same pass. If you are talking about having multiple material in one mesh, it's should still be possible. Just make sure you know what are the material names assigned with the mesh and build your own materials with the right names. ;)
Marnel wrote:Otherwise, thank you for this wonderfull tool! :D
Thanks for trying this out too. :) Hopefully enough people can confirm this is stable and get the owner to patch it in. :P
Dekker3D
Gnoblar
Posts: 7
Joined: Wed Apr 16, 2008 4:39 pm

Post by Dekker3D »

wow, this is great!
i was just searching for a clue as to how i'd get rid of the passed group error messages (thinking they're slowing down the script somehow) and i stumbled upon this.. staring in disbelief until i had it installed and exporting a model in mere seconds.

had me going "o_O OMG!" for a second there. thank you, lf3thn4d!
User avatar
SaiCo
Halfling
Posts: 43
Joined: Sat Jun 09, 2007 2:19 pm
Location: Malbork, Poland

Post by SaiCo »

Hey!

I'm just moved from exporting simple meshes to exporting armatured ones, and i've noticed following problem :

- armature is exported in rotated position.
<bone id="36" name="Root">
<position x="0.000000" y="0.000000" z="0.000000"/>
<rotation angle="1.570796">
<axis x="1.000000" y="0.000000" z="0.000000"/>
</rotation>

Neither Root nor Armature itself has any rotation in Blender. The coords for root are (XYZ) 0,0,0 for head and 0,0,1 for tail.

Right now i 'm fixing this by manualy clearing rotation on root bone to "0" . When done, run through XML converter and it works, still a minor nuissance.
Mesh exports alright (as expected)
User avatar
lf3thn4d
Orc
Posts: 478
Joined: Mon Apr 10, 2006 9:12 pm
x 12

Post by lf3thn4d »

Hmmm ok. I'll look into it. Thanks for reporting. :)

[edit]
Ok. I know what's going on already. I cheated when doing the mesh exporting for vertexes by rotating the vertices by 90 along x-axis :P Guess I need to fix it to the real thing. If nobody beats me to it, i'll get a patch up by end of this week or so. ;)
[/edit]
User avatar
lf3thn4d
Orc
Posts: 478
Joined: Mon Apr 10, 2006 9:12 pm
x 12

Post by lf3thn4d »

Ok, As promised, I've got them fixed I think. Files are updated.
http://lefthand.xullum.net/downloads/te ... atched.zip

I've tested skeleton and pose animation. They seem to be working perfectly for me. Anyways, do check it out and give me feedbacks.

On the side note, I'm now the maintainer of this exporter and has gain write access to the blender exporter cvs tree. Which means new stuffs will get checked in faster now. :) So feedbacks are important to make sure my changes are stable.

P.S. The exporter's animation exporting might need a rewrite imho. It's sampling animation through the main key frame system which is a tad bit slow. And it's kinda doing a fixed time step sampling. Have to think about how to optimize that.
User avatar
SaiCo
Halfling
Posts: 43
Joined: Sat Jun 09, 2007 2:19 pm
Location: Malbork, Poland

Post by SaiCo »

Heh, many thanks again! just have run some preliminary tests, looks allright atm ...

As for frame sampling, afaik it was introduced for sampling ik bones. If it would be possible to limit that behavior ONLY for IK (or other constraint-driven) bone... Also, sometimes there's need to include bone in skeleton, but do not under any circumstances have any animation track on it ( for folk not migrated to shoggoth, which has skeletal blending masks). Just spining wild thoughts here :)
Post Reply