Blender26 Ogre Exporter

The place for artists, modellers, level designers et al to discuss their approaches for creating content for OGRE.
Post Reply
hartsantler
Greenskin
Posts: 107
Joined: Tue Nov 16, 2010 7:33 am
x 15

Re: Blender25 Ogre Exporter + extended .scene format

Post by hartsantler »

http://www.youtube.com/watch?v=8HudA0NSdNU


Ogre texture blending is far more limited than Blender's texture slots. While many of the blending options are the same or similar, only the blend mode "Mix" is allowed to have a variable setting. All other texture blend modes are either on or off, for example you can not use the "Add" blend mode and set the amount to anything other than fully on (1.0). The user also has to take into consideration the hardware multi-texturing limitations of their target platform - for example the GeForce3 can only do four texture blend operations in a single pass. Note that Ogre will fallback to multipass rendering when the hardware won't accelerate it.

==Supported Blending Modes:==
* Mix - blend_manual -
* Multiply - modulate -
* Screen - modulate_x2 -
* Lighten - modulate_x4 -
* Add - add -
* Subtract - subtract -
* Overlay - add_signed -
* Difference - dotproduct -

==Mapping Types:==
* UV
* Sphere environment mapping
* Flat environment mapping

==Animation:==
* scroll animation
* rotation animation
GenesisRage
Halfling
Posts: 73
Joined: Sun Dec 14, 2008 4:25 am
x 3

Re: Blender25 Ogre Exporter + extended .scene format

Post by GenesisRage »

@hartsantler: me again... i know your prolly hating me by now ;)
ran some models back and forth with different versions of OgreXmlConverter and comes out the when converting it rounds to the nearest 0.000001 (6th decimal) so thinking the other 6 decimals being exported now seem to be a waste?
IRC Nick: Jake-GR
supermael28
Gnoblar
Posts: 7
Joined: Wed Aug 18, 2010 9:59 am

Re: Blender25 Ogre Exporter + extended .scene format

Post by supermael28 »

Hello ! Thank you for your script !
But I've some problmes with it... My character exported from Blender 2.55 is deformed in my game.
The exportation works well without animation...

Do you know how to solve this problem ?

PS : I'm french, so I'm sorry for my very bad english... :roll:
hartsantler
Greenskin
Posts: 107
Joined: Tue Nov 16, 2010 7:33 am
x 15

Re: Blender25 Ogre Exporter + extended .scene format

Post by hartsantler »

supermael28, i have seen this problem creep up with some armatures, i want to fix the bug, but unfortunately i do not know what is causing it either. If somebody can figure out what triggers the problem then i can fix it.

GenesisRage, no problem, i will drop to 6 digit precision on next update.
supermael28
Gnoblar
Posts: 7
Joined: Wed Aug 18, 2010 9:59 am

Re: Blender25 Ogre Exporter + extended .scene format

Post by supermael28 »

I think I know where the problem comes from. The bones of my character's arms are not "connected" of the main bone. Just those two bones doesn't work fine.
hartsantler
Greenskin
Posts: 107
Joined: Tue Nov 16, 2010 7:33 am
x 15

Re: Blender25 Ogre Exporter + extended .scene format

Post by hartsantler »

GenesisRage, latest version on googlecode uses 6 decimal places precision.

supermael28, i will work on your problem, thanks for finding the cause of the issue.

Updated the UI to make control of collision much simpler. See blog posting:
http://pyppet.blogspot.com/2010/12/blen ... panel.html
werzar
Gnoblar
Posts: 3
Joined: Thu Dec 16, 2010 11:58 am

Re: Blender25 Ogre Exporter + extended .scene format

Post by werzar »

Hi all,

I have a problem with some models in blender, I'm using specifically version 0.2.2, terminal of blender show:

"WARNING: Vertex (number of vertex) is in more than 4 vertex groups <bone weights><this maybe ogre incompatible>".

When finish it and run the ogrexmlconverter, always crash it and not create the .mesh file, I don't know where is the problem, some helps???

Thanks all
User avatar
so0os
Bugbear
Posts: 833
Joined: Thu Apr 15, 2010 7:42 am
Location: Poznan, Poland
x 33

Re: Blender25 Ogre Exporter + extended .scene format

Post by so0os »

you cannot attack one vertex to more that 4 bones
Sos Sosowski :)
http://www.sos.gd
werzar
Gnoblar
Posts: 3
Joined: Thu Dec 16, 2010 11:58 am

Re: Blender25 Ogre Exporter + extended .scene format

Post by werzar »

why?? and sorry for asking, I'm very noob at the moment...
User avatar
so0os
Bugbear
Posts: 833
Joined: Thu Apr 15, 2010 7:42 am
Location: Poznan, Poland
x 33

Re: Blender25 Ogre Exporter + extended .scene format

Post by so0os »

hardware skinning confomance.
Sos Sosowski :)
http://www.sos.gd
werzar
Gnoblar
Posts: 3
Joined: Thu Dec 16, 2010 11:58 am

Re: Blender25 Ogre Exporter + extended .scene format

Post by werzar »

Ok thx for all so I comment you my problem ok??...

I have YoFrankie an open game of blender... I take the model of flyingsquirrel, this model have animation, materials, textures, etc... is more complet... In theory this model you could convert it in .mesh file but always crash cause the one vertex to more that 4 bones, this model is in a game but I cant export into mesh file... Where is here the hardware skinning conformance??

thx for all
GenesisRage
Halfling
Posts: 73
Joined: Sun Dec 14, 2008 4:25 am
x 3

Re: Blender25 Ogre Exporter + extended .scene format

Post by GenesisRage »

@werzar: ogre has the limitation of 4 weights per vertex, not sure if its hardware or a lib ogre uses, but its an ogre limitation right now
IRC Nick: Jake-GR
User avatar
so0os
Bugbear
Posts: 833
Joined: Thu Apr 15, 2010 7:42 am
Location: Poznan, Poland
x 33

Re: Blender25 Ogre Exporter + extended .scene format

Post by so0os »

you can see the log to get this vertex index
Sos Sosowski :)
http://www.sos.gd
supermael28
Gnoblar
Posts: 7
Joined: Wed Aug 18, 2010 9:59 am

Re: Blender25 Ogre Exporter + extended .scene format

Post by supermael28 »

I've again some problems with the animations... What's the right way to export some animations ? I don't manage to export more than one animation. I'm a beginner with blender, so I d'ont really know how the tracks and actions works, here it's a screenshot of blender when I export my model :
Image

What have I to do in blender to solve my problem ? (Those animations must be separated).
hartsantler
Greenskin
Posts: 107
Joined: Tue Nov 16, 2010 7:33 am
x 15

Re: Blender25 Ogre Exporter + extended .scene format

Post by hartsantler »

supermael28,
you need to convert your actions into NLA action strips. You may only have one strip per NLA track. Actually you don't need to have animation in the actions you convert (other than a single keyframe say on armature translation), the actual data of the action is ignored. The NLA strip is only used as a way to get the name for an Ogre animation track, and also to get the start and end frame.

DO NOT BAKE YOUR ANIMATION.
User avatar
LiMuBei
Goblin
Posts: 297
Joined: Mon Jun 09, 2008 3:56 pm
Location: Karlsruhe, Germany
x 10

Re: Blender25 Ogre Exporter + extended .scene format

Post by LiMuBei »

I'm in the same boat as supermael28. I thought I understood how it's done, but it seems exporting more than one animation is not possible. What I did:
- create an action for each animation
- create an NLA track for each action and import the action therein, thus automatically setting in and out frames
Then I export.

What happens is, that I get an animation for every track with the given lengths (which is what I expect). But every animation then contains the animation data of the top most action in the NLA, cut to the lengths of the respective action. So how is it supposed to work?
User avatar
LiMuBei
Goblin
Posts: 297
Joined: Mon Jun 09, 2008 3:56 pm
Location: Karlsruhe, Germany
x 10

Re: Blender25 Ogre Exporter + extended .scene format

Post by LiMuBei »

I investigated a little further in this. To me it seems the problem is, that when reading out the bone positions on export, the NLA stack is evaluated. So the top most animations in the stack overwrite the lower ones. The solution to this would be that only the currently exported track is unmuted and all the rest muted. I am trying to implement this, but so far haven't gotten it to work. I may also be totally wrong here...
User avatar
LiMuBei
Goblin
Posts: 297
Joined: Mon Jun 09, 2008 3:56 pm
Location: Karlsruhe, Germany
x 10

Re: Blender25 Ogre Exporter + extended .scene format

Post by LiMuBei »

Seems like the muting really was the issue, I hacked the exporter a bit and now for me it works. I attached my version in case anyone wants to give it a try. I tested it with Blender 2.56a Beta from blender.org on Win7 64bit.

Things I changed:
- swapping of y and z axis (didn't need this)
- muting of NLA tracks when exporting animations
- get FPS from render settings (wasn't in the version I grabbed)
Attachments
addon_ogreDotScene.zip
(64.41 KiB) Downloaded 476 times
ComputerAddict
Gnoblar
Posts: 4
Joined: Thu Jan 06, 2011 1:17 am
Location: Germany

Re: Blender25 Ogre Exporter + extended .scene format

Post by ComputerAddict »

Hi,

I've tried to install your Ogre Exporter but I get an error when trying to export a very simple scene (no textures, no animations).
After selecting a file to export to I get this strange error (attachement below) and the scene is not exported.
I installed only the required things described in your README.txt.
OS: Windows 7, 64bit
I hope you can help me with this information.

Thanks in advance,
ComputerAddict

EDIT: I could fix this bug by replacing os.getLogin() with a string (I used 'undefined').
Thanks for reading anyway.
Attachments
screenshot.png
madjan06
Gnoblar
Posts: 10
Joined: Sat Jan 01, 2011 11:28 pm

Re: Blender25 Ogre Exporter + extended .scene format

Post by madjan06 »

Hi,
I'm new to Ogre and searched for a good exporter, which works with blender 2.56a. Then I found yours hartsantler and it works perfect, I want to thank you for this great work and hope you still go on.
mifth
Gnoblar
Posts: 6
Joined: Mon Sep 27, 2010 11:46 am

Re: Blender25 Ogre Exporter + extended .scene format

Post by mifth »

I tried to export an animated model to ogre with http://blender2ogre.googlecode.com/file ... -0.2.8.zip
Blender revision is r33417

Animation was corrupted with 2.55 exporter, but with 2.49 exporter is everything ok.
http://img442.imageshack.us/img442/2995/57764846.jpg
Image

The model - http://files.mail.ru/4VG2VA

I hope this model will help.
racoon
Gnoblar
Posts: 15
Joined: Fri Jul 23, 2010 6:34 pm

Re: Blender25 Ogre Exporter + extended .scene format

Post by racoon »

Hi hartsantler,

first I want to give you high credits for the Blender exporter. It is a pretty usefull tool
for the Ogre community.
I maybe have only one stupid question. Which DotScene Loader are you using to load your DotScene file
in you Ogre program?
Till now I used the DotScene Loader from Ogitor but the DotScene File from Ogitor ist totaly different from
your DotScene Format.

Thx

racoon
Whyte
Gnoblar
Posts: 3
Joined: Fri Jan 14, 2011 5:45 pm

Re: Blender25 Ogre Exporter + extended .scene format

Post by Whyte »

Hi!

I made a little optimization, which on my system (WinServer2008 64bit) resulted in speeding up a largish (6k vertices) mesh export from 8 minutes to just 20 seconds. The output is the same (for the things I tested, and as far as my limited brain can foretell, anyway). This only concerns meshes with UV textures, all other kinds of exports do not benefit from this patch.

The patch also changes os.getlogin() (which doesn't work on Win7) to getpass.getuser()... not sure if it's better, but it's the only one I found.

As for the fix, it's the usual optimization of O(n^2) into O(n log n). I used a dictionary for this, though there were probably other ways to do it too.
Attachments
addon_ogreDotScene.zip
version 3.0 with patch applied
(69.41 KiB) Downloaded 267 times
uvOfVertex.patch
patch against version 3.0
(2.83 KiB) Downloaded 272 times
racoon
Gnoblar
Posts: 15
Joined: Fri Jul 23, 2010 6:34 pm

Re: Blender25 Ogre Exporter + extended .scene format

Post by racoon »

Hi
I now wrote my own DotSceneLoader to load your DotScene format.
While doing this I found yout that there is a bug in Blender 2.56/2.56a.

Blender 2,56 screws up the quaternions.
Here is a small example:
-open blender (you will se se standard cube in the middle)
-in the object propety change the rotation mode to Euler XYZ
- set X rotation to 45deg
-change the rotation mode to Quaternion

you will see that the model changes its orientation (which it shouldn't)
At some point the new Blender messes up the quaternions

2.55 and your 0.29 addon works fine for me.

Can somebody verify that bug???

cya

racoon
User avatar
Klaim
Old One
Posts: 2565
Joined: Sun Sep 11, 2005 1:04 am
Location: Paris, France
x 56
Contact:

Re: Blender25 Ogre Exporter + extended .scene format

Post by Klaim »

Hi,

did you report this problem to the Blender team?
Post Reply