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
User avatar
lf3thn4d
Orc
Posts: 478
Joined: Mon Apr 10, 2006 9:12 pm
x 12

Post by lf3thn4d »

Cool :) I'll check in my changes now then. :) I'll fix them later if any bug arises. :P

Hmm.. so it's for IK. I noticed it's also designed for keeping animation more splined oriented. I guess it works kinda. But that makes animation files really huge though. Maybe we can have some sort of post process optimization. Like skip certain key frames if their changes does not exceed a certain threshold. Maybe using some sort of delta graph filtering.
akem321
Bronze Sponsor
Bronze Sponsor
Posts: 153
Joined: Mon Jul 31, 2006 8:29 pm
Location: France
x 7
Contact:

Post by akem321 »

Nice, thanks!
The blender exporter available in the tool download section is broken
for blender >= 2.45(the poses part at least), but the patched version doesn t work with < 2.45 here
Would be nice to add this version to the dwnld list i think, as the actual blender version is 2.45

again, great job, thx :)
User avatar
lf3thn4d
Orc
Posts: 478
Joined: Mon Apr 10, 2006 9:12 pm
x 12

Post by lf3thn4d »

New update:
- Added some options for OgreXMLConverter to make it easier so one won't have to use the command line arguments.
- Beautified the UI a little to make them look better in Rounded theme.

http://lefthand.xullum.net/downloads/te ... atched.zip
drr00t
Gnoblar
Posts: 6
Joined: Thu Apr 24, 2008 6:06 pm

plans to material export...

Post by drr00t »

Hi,

There is any plan to export material script, with normal, alpha_blend, etc...?

Thanks for good job.
User avatar
lf3thn4d
Orc
Posts: 478
Joined: Mon Apr 10, 2006 9:12 pm
x 12

Post by lf3thn4d »

As of now, I don't plan to do anything with material exporting. Reason being for one, I'm not using it. And second, materials are usually application specific. Things like integrated shadow, normal map and environment map usually requires custom shaders. Hence it's something I don't plan to add right now.

IMHO, Unless ogre comes with some sort of real defaults, I practically find the material generation useless and deceiving.
User avatar
SaiCo
Halfling
Posts: 43
Joined: Sat Jun 09, 2007 2:19 pm
Location: Malbork, Poland

Found a bug

Post by SaiCo »

Hey!
Just found a bug, or something looking like it
I've tried to exporting mesh with shapekeys, and got python error all over

Image

using latest exporter and blender 2.46
all project's dead .. maybe time for something on me own :/
User avatar
lf3thn4d
Orc
Posts: 478
Joined: Mon Apr 10, 2006 9:12 pm
x 12

Post by lf3thn4d »

That's odd. Could you email me the blend file so I can reproduce this?
lefthand(at)xullum(dot)net

[edit]
Never mind. Found it. Updated. Just redownload link. ;-)
[/edit]
k0h4n
Gnoblar
Posts: 3
Joined: Tue Jun 17, 2008 1:47 am

Post by k0h4n »

First of all thank you for maintaining the blender ogre exporter

after i used the exporter for animation,
it seems like the exporter incorrectly translate the armature to the ogre mesh

this is the normal position of the armature
http://www.imageox.com/image/282413-001.jpeg

this is the 1st frame of idle action that i create
http://www.imageox.com/image/282414-002.jpeg

and this is the result after i put it into ogre
http://www.imageox.com/image/282415-003.jpeg

i'm using blender2.46 with ogre 1.4.8
is there any solution for the above problem
or should i downgrade the blender and ogre in order to run properly?

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

Post by lf3thn4d »

I believe your problem lies in that your arm bones are not connected to your spine bones. So they ended up as root bones that are offset to the origin. If I understand how Ogre works, you must have all your bones connected to the parent bone.
k0h4n
Gnoblar
Posts: 3
Joined: Tue Jun 17, 2008 1:47 am

Post by k0h4n »

i still got the same problem
i already connected the whole armature
i also change the direction of the root in order to connect it to the armature
here is the .blend file:
http://www.mediafire.com/?imyqlcmmb3i

please take a look

thank you
k0h4n
Gnoblar
Posts: 3
Joined: Tue Jun 17, 2008 1:47 am

Post by k0h4n »

Kyaaaa....
Thx god i found the culprit

The exporter change the scale of my model into 1
in blender my scale for the mesh is 0.4 and for the armature is 1.0
the exporter change my mesh scale into 1
so when the armature try to animate, the mesh got stretched

i try a hundred times from creating new bone, export to another format and hit my head on the wall
none of it are worked to me :shock:
i spent the whole day without eating and i realize my inexperience is the culprit :oops:

thank you for your support lf3thn4d
keep maintaining blender Ogre Exporter
and good luck 8)

-EDIT-
ogre can animate my armature (no connected bone require) by parent it using keep offset function
User avatar
lf3thn4d
Orc
Posts: 478
Joined: Mon Apr 10, 2006 9:12 pm
x 12

Post by lf3thn4d »

Cool! :) Glad that you solved it. So I was wrong with my assumptions. Sorry about that :P
User avatar
nikki
Old One
Posts: 2730
Joined: Sat Sep 17, 2005 10:08 am
Location: San Francisco
x 13
Contact:

Post by nikki »

Hey lefthand! Nice work on the improvements!

I just have one little problem: I used to use the old exporter till now, where I used the rotation options in the old exporter to rotate the model -90 degrees around X (to make Y up) and 180 degrees around Z.

Flipping to Y for up axis in this new exporter is fine, but an additional 180 degree rotation around the Blender Z axis is required for proper Blender to Ogre coordination conversion.

I went though the code but I was lost. :) Can you tell me how I can implement this change? Thanks.
User avatar
lf3thn4d
Orc
Posts: 478
Joined: Mon Apr 10, 2006 9:12 pm
x 12

Post by lf3thn4d »

Hey, thanks :) But are you sure about that rotate 180 around Z thing? Sounds like your mesh was originally facing the wrong direction.

What should be done is when modelling, treat Y as the facing direction. When exported, it will be facing -Z. In opengl matrix, facing direction is always -Z. Camera, Light follow this. If you want to use +Z, just make sure your mesh face the -Y direction before exporting. ;)
User avatar
nikki
Old One
Posts: 2730
Joined: Sat Sep 17, 2005 10:08 am
Location: San Francisco
x 13
Contact:

Post by nikki »

lf3thn4d wrote:Hey, thanks :) But are you sure about that rotate 180 around Z thing? Sounds like your mesh was originally facing the wrong direction.

What should be done is when modelling, treat Y as the facing direction. When exported, it will be facing -Z. In opengl matrix, facing direction is always -Z. Camera, Light follow this. If you want to use +Z, just make sure your mesh face the -Y direction before exporting. ;)
Hmm... You're probably right. This is how I export positions in my level exporter I wrote for Blender (its a human-readable format):-

Code: Select all

out.write("\t\tposition %f %f %f\n" % (-(objPos[0]), objPos[2], objPos[1]))
So, it should be this?:-

Code: Select all

out.write("\t\tposition %f %f %f\n" % (-(objPos[0]), objPos[2], -objPos[1]))
And then what about orientation? I have this:-

Code: Select all

out.write("\t\trotation %f %f %f %f\n" % (objRot[0], objRot[1], objRot[3], objRot[2]))
Should it be this?:-

Code: Select all

out.write("\t\trotation %f %f %f %f\n" % (objRot[0], objRot[1], objRot[3], -objRot[2]))
User avatar
lf3thn4d
Orc
Posts: 478
Joined: Mon Apr 10, 2006 9:12 pm
x 12

Post by lf3thn4d »

Ah ok. You're pretty close. However, I think you shouldn't be negating X. Also the rotation needs to be fixed too. Check out the dot scene exporter that came prepackaged with my release. It does what you want. ;)
User avatar
nikki
Old One
Posts: 2730
Joined: Sat Sep 17, 2005 10:08 am
Location: San Francisco
x 13
Contact:

Post by nikki »

lf3thn4d wrote:Ah ok. You're pretty close. However, I think you shouldn't be negating X. Also the rotation needs to be fixed too. Check out the dot scene exporter that came prepackaged with my release. It does what you want. ;)
I've done that, but I think I'll have to stick with my current way of doing things because I'm in the middle of a project, and I wanted to switch to the new exporter. The thing is, that I edit meshes, and the scene together in the same .blend file, giving a WYSIWYG image of the final level.

It would be best if you can tell me how I can rotate around Z by 180 degrees while exporting? That would fix it. I'm sorry for taking your time.

There's no need to include this change in the official version, I'd just change mine. Or, you could add an addition option to specify the rotations like the old exporter.

I had always taken -Y as Blender forward.

Thanks a lot! :)
User avatar
nikki
Old One
Posts: 2730
Joined: Sat Sep 17, 2005 10:08 am
Location: San Francisco
x 13
Contact:

Post by nikki »

Update:
Ok, I've converted everything to accept 'Y forward' coordinate system, its working well.

I just have another little request (I'm bothering you too much, am I not?): Making the material name default to the Blender scene name.

I understand that this feature is very application/user-specific, so I understand if you do not add it to the exporter, but I'd like it if you could tell me how to add it myself (the code is too big, I can't find anything :) ).
User avatar
lf3thn4d
Orc
Posts: 478
Joined: Mon Apr 10, 2006 9:12 pm
x 12

Post by lf3thn4d »

Actually that's a rather acceptable request. I'll try to find time to add that option in as a toggle button.
User avatar
nikki
Old One
Posts: 2730
Joined: Sat Sep 17, 2005 10:08 am
Location: San Francisco
x 13
Contact:

Post by nikki »

lf3thn4d wrote:Actually that's a rather acceptable request. I'll try to find time to add that option in as a toggle button.
Thanks a lot!

ps. I love how the 'Help' button takes you to the Ogre Forums' search page. :)
Quiberion
Gnoblar
Posts: 1
Joined: Tue Jul 01, 2008 11:22 am

Python error

Post by Quiberion »

Hello !

I use blender 2.46 and the last patched exporter (the one you posted the last 4th June).

I am trying to export an animated uvmapped parallelepiped with an armature of 4 bones. But I get the following python error.

Image

What is wrong ? :(

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

Post by lf3thn4d »

Ah.. material export problem. I've not tested material export for some time. Looks like there's some old obsolete code there. I'll fix that and post up a new update soon. Thanks for reporting. :)

For the moment, you can just disable material exporting. ;)
lile
Gnoblar
Posts: 4
Joined: Sun Jul 06, 2008 11:13 pm

Post by lile »

Hello !

I am in a project where I need to create a character for ogre (1.4.9) , using blender.

There are a few questions for which I couldn't find answers :

does the exporter support b-bones ?
does it support bone driven shape keys ?
My rig is relatively complex, should I try to export only the deform bones, or will it be happy with all the handles and little intermediate bones, that use blender specific constraints ?
Does the armature have to have the same center as the mesh ?


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

Post by lf3thn4d »

lile wrote:Hello !

I am in a project where I need to create a character for ogre (1.4.9) , using blender.

There are a few questions for which I couldn't find answers :

does the exporter support b-bones ?
does it support bone driven shape keys ?
My rig is relatively complex, should I try to export only the deform bones, or will it be happy with all the handles and little intermediate bones, that use blender specific constraints ?
Does the armature have to have the same center as the mesh ?


ty !!
1. Umm.. isn't b-bone just a method of drawing the bone in blender?
2. From my understanding, shape key is not the same as bone deforming in blender. Unless you bake the bone deform into the mesh's shape key. Then yes, that's possible.
3. You should only export nessesary bones that actually manipulate the mesh. Constraint bones has nothing to do with Ogre. When exporting, the exporter bakes the bone animation anyways. That's why IK works too.
4. No, AFAIK, this should never be a problem at all.
lile
Gnoblar
Posts: 4
Joined: Sun Jul 06, 2008 11:13 pm

Post by lile »

ty for answering !

b-bones are not only a display option, if you set 'segments' to a value higher than 1 , the bone becomes a b-bone (bezier-bone) , and then can be twisted and even bent -- see http://www.blender.org/development/rele ... raw-modes/ bottom of the page
Guess I'll segment the bones into sevral smaller ones to achieve the twist effect.


bone driven shape keys, are a way to ..well 'drive' the amount of blending a shape key given a bone rotation for example. This is handy to make a muscle deform when an arm is bent, for instance. Its also very useful to correct wrong joints deformations. http://kokcito.tk/rvk/ipo.html - From your answer I guess I would have to bake the result of the bone drive into timeline keys for the shape - that sounds tricky :)

About which bones are exported, I noticied that only 'deform' bones go eported, and that is cool !

Thnak you for your answers !
Post Reply