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 » Wed Apr 04, 2007 10:55 am

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.
0 x

Skapie
Gremlin
Posts: 162
Joined: Fri Jan 27, 2006 2:59 pm

Post by Skapie » Thu Apr 12, 2007 4:24 pm

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!
0 x

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

Post by banal » Tue Jan 22, 2008 11:23 am

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!
0 x

ahkun
Gnoblar
Posts: 2
Joined: Wed Apr 04, 2007 5:54 am

Post by ahkun » Wed Feb 27, 2008 11:20 pm

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.
0 x

User avatar
nikki
Old One
Posts: 2730
Joined: Sat Sep 17, 2005 10:08 am
Location: Princeton, New Jersey, USA
Contact:

Post by nikki » Mon Mar 24, 2008 5:48 pm

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. :)
0 x

reimpell
OGRE Contributor
OGRE Contributor
Posts: 570
Joined: Mon Mar 01, 2004 10:35 am
Location: Hamburg, Germany

Post by reimpell » Wed Mar 26, 2008 12:05 am

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.
0 x

User avatar
nikki
Old One
Posts: 2730
Joined: Sat Sep 17, 2005 10:08 am
Location: Princeton, New Jersey, USA
Contact:

Post by nikki » Wed Mar 26, 2008 8:10 pm

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. :(
0 x

User avatar
lf3thn4d
Orc
Posts: 478
Joined: Mon Apr 10, 2006 9:12 pm

Post by lf3thn4d » Thu Mar 27, 2008 6:54 pm

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.
0 x

User avatar
SaiCo
Halfling
Posts: 43
Joined: Sat Jun 09, 2007 2:19 pm
Location: Malbork, Poland

Post by SaiCo » Fri Mar 28, 2008 8:04 am

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: )
0 x

User avatar
nikki
Old One
Posts: 2730
Joined: Sat Sep 17, 2005 10:08 am
Location: Princeton, New Jersey, USA
Contact:

Post by nikki » Fri Mar 28, 2008 11:26 am

Thanks a lot! :) I'll look at it tomorrow, pretty busy today.
0 x

User avatar
lf3thn4d
Orc
Posts: 478
Joined: Mon Apr 10, 2006 9:12 pm

Post by lf3thn4d » Fri Mar 28, 2008 8:28 pm

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.
0 x

Marnel
Gnoblar
Posts: 4
Joined: Thu Apr 10, 2008 8:00 pm

Post by Marnel » Thu Apr 10, 2008 8:07 pm

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 ?
0 x

User avatar
lf3thn4d
Orc
Posts: 478
Joined: Mon Apr 10, 2006 9:12 pm

Post by lf3thn4d » Fri Apr 11, 2008 1:03 am

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
0 x

Marnel
Gnoblar
Posts: 4
Joined: Thu Apr 10, 2008 8:00 pm

Post by Marnel » Sat Apr 12, 2008 1:56 pm

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
0 x

User avatar
lf3thn4d
Orc
Posts: 478
Joined: Mon Apr 10, 2006 9:12 pm

Post by lf3thn4d » Sun Apr 13, 2008 8:57 am

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.
0 x

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

Post by Praetorian » Sun Apr 13, 2008 8:57 pm

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.
0 x

User avatar
lf3thn4d
Orc
Posts: 478
Joined: Mon Apr 10, 2006 9:12 pm

Post by lf3thn4d » Mon Apr 14, 2008 1:19 am

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. :)
0 x

User avatar
SaiCo
Halfling
Posts: 43
Joined: Sat Jun 09, 2007 2:19 pm
Location: Malbork, Poland

Post by SaiCo » Mon Apr 14, 2008 7:06 am

Bit late, but just to let You know, here also works perfectly! thanks lf3thn4d!
0 x

Marnel
Gnoblar
Posts: 4
Joined: Thu Apr 10, 2008 8:00 pm

Post by Marnel » Tue Apr 15, 2008 3:44 pm

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
0 x

User avatar
lf3thn4d
Orc
Posts: 478
Joined: Mon Apr 10, 2006 9:12 pm

Post by lf3thn4d » Tue Apr 15, 2008 4:01 pm

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
0 x

Dekker3D
Gnoblar
Posts: 7
Joined: Wed Apr 16, 2008 4:39 pm

Post by Dekker3D » Wed Apr 16, 2008 4:42 pm

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!
0 x

User avatar
SaiCo
Halfling
Posts: 43
Joined: Sat Jun 09, 2007 2:19 pm
Location: Malbork, Poland

Post by SaiCo » Sun Apr 20, 2008 2:29 pm

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)
0 x

User avatar
lf3thn4d
Orc
Posts: 478
Joined: Mon Apr 10, 2006 9:12 pm

Post by lf3thn4d » Mon Apr 21, 2008 9:36 am

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]
0 x

User avatar
lf3thn4d
Orc
Posts: 478
Joined: Mon Apr 10, 2006 9:12 pm

Post by lf3thn4d » Thu Apr 24, 2008 8:22 pm

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.
0 x

User avatar
SaiCo
Halfling
Posts: 43
Joined: Sat Jun 09, 2007 2:19 pm
Location: Malbork, Poland

Post by SaiCo » Fri Apr 25, 2008 9:03 am

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 :)
0 x

Post Reply