Page 1 of 2

Ogre Mesh and Skeletons

Posted: Sat Sep 15, 2012 10:03 pm
by Thade
Hi (its very quiet here in 3D Programming - no-one interested in 3d?)

Well - my topic is hopefully not sort of demotivation

I have 100s of Models (bought from companies which specialiced on Models for Games)
They come in different versions - 3ds, fbx, x, b3d, iAvatar, dae, blend, ugh, etc ... but not as mesh and skeleton ... I have them all converted to .ugh (Fragmotion) .b3d (Blitz, Nuclear Basic & Fusion) and .x (Directx) ...
Ok, no problem - there are several exporters for Ogre - I use Fragmotion and Milkshape.
Anyway - conversion from any mentioned to others work excellent, once you know which setting you have to use.
My x b3d n3d animations run in every engine I have used - lately 3DRad, Nuclear Basic, Nuclear Fusion, Blitz3D, etc.

Since the PB Beta is out I am quite busy with it making tests and of course are trying to convert models to ogre mesh and skeleton.

Long talk - short result - the Animations do not work controlled.
The animations run actualy normal and as they should. But the positions are freaky. They jump or move up and down and there are no settings in the exporters to control that.
Some Animations let the model sink under the terrain and come back in a curve. Some Animations run 12 Frames normal - then a jump 10 meters in the air and the rest is normal at the ground again.

I see one problem that the exporters are all from 2007 - 2009 - and different exporters produce different animation behaviours ...

I think that is a Problem, I need some help to solve it.

Has anybody expienced the same? Are there newer Exporters than the ones I found so far? Is there experimental PB-Code available which lets you control the skeleton while loading?

Or even better: Is there a working x-loader which converts the model while loading to a working mesh with animations?

Thanks a lot.

Re: Ogre Mesh and Skeletons

Posted: Sun Sep 16, 2012 12:23 am
by Fred
I have built OgreASSIMPConverter (http://www.ogre3d.org/tikiwiki/OgreAssi ... ture=Tools) commandline tool for Ogre 1.8, it will accept in input all formats supported by assimp (see here: http://assimp.sourceforge.net/main_feat ... rmats.html) and output a .mesh with .material and .sekeleton. May be it will work better for you ?

The last version of assimp has been used, and Ogre SDK 1.8.1. I tested with a 3DS model and it loaded correctly in PB.

http://www.purebasic.com/download/OgreA ... verter.zip (Windows only, requiers the VC++2010 runtime)

Have fun !

Re: Ogre Mesh and Skeletons

Posted: Sun Sep 16, 2012 12:45 am
by Comtois
Fred , your archiv is empty.

Re: Ogre Mesh and Skeletons

Posted: Sun Sep 16, 2012 12:45 am
by luis
Comtois wrote:Fred , your archiv is empty.
Nope, it works.

Re: Ogre Mesh and Skeletons

Posted: Sun Sep 16, 2012 12:47 am
by Comtois
luis wrote:
Comtois wrote:Fred , your archiv is empty.
Nope, it works.
Now, yes :P

Re: Ogre Mesh and Skeletons

Posted: Sun Sep 16, 2012 8:52 am
by applePi
Thade write: (its very quiet here in 3D Programming - no-one interested in 3d?)
everyone are interested in 3D because they are 3D's but it is a complex subject with unlimited issues.
some philosophy:
the people like the software which have a 3D capabilities even if they will use it rarely, the 3D resembles a soul in the body, we don't know how to use the soul in practice but we want it to be inside us because it refers to the implicit capabilities and to the mystery. the same thing with the programming language.

Re: Ogre Mesh and Skeletons

Posted: Sun Sep 16, 2012 8:54 am
by Polo
Fred wrote:I have built OgreASSIMPConverter (http://www.ogre3d.org/tikiwiki/OgreAssi ... ture=Tools) commandline tool for Ogre 1.8, it will accept in input all formats supported by assimp (see here: http://assimp.sourceforge.net/main_feat ... rmats.html) and output a .mesh with .material and .sekeleton. May be it will work better for you ?

The last version of assimp has been used, and Ogre SDK 1.8.1. I tested with a 3DS model and it loaded correctly in PB.

http://www.purebasic.com/download/OgreA ... verter.zip (Windows only, requiers the VC++2010 runtime)

Have fun !
Haven't tried yet, but this sounds pretty cool (considering most major formats are supported). Making it part of the PB package in the IDE (Tools / 3D Mesh converter) would be quite nice, within a few clicks meshes would be converted while working on projects ;)

Re: Ogre Mesh and Skeletons

Posted: Sun Sep 16, 2012 11:41 am
by Fred
User tools are here for that :). I will put a mention in the mesh doc so it can be found more easily.

Re: Ogre Mesh and Skeletons

Posted: Sun Sep 16, 2012 6:17 pm
by Thade
@Fred
Thanks - I will check it all out - and it seems I will have a lot to do during the next days :D

Re: Ogre Mesh and Skeletons

Posted: Mon Sep 17, 2012 9:24 am
by J. Baker
OgreASSIMPConverter didn't do well for me. Obj don't convert and crash OgreASSIMPConverter. 3ds files do convert but return an error in PB. Unable to initialize the mesh, or something like that.

As for other methods. Milkshape3D works but textures are messed up. Don't care much for Blender. CharacterFX works with the following lua script but haven't tried it with animation yet. https://gist.github.com/675553

Re: Ogre Mesh and Skeletons

Posted: Mon Sep 17, 2012 9:42 am
by Fred
Could you send me the files which doesn't work ?

Re: Ogre Mesh and Skeletons

Posted: Mon Sep 17, 2012 10:29 am
by J. Baker
Fred wrote:Could you send me the files which doesn't work ?
PM sent. ;)

Re: Ogre Mesh and Skeletons

Posted: Mon Sep 17, 2012 4:15 pm
by Thade
I managed to change the Ogre Skeleton xml with a little code snippet to work without jumping ...

For instance:

Code: Select all

				<track bone="Bip01_L_Hand" >
					<keyframes>
						<keyframe time="0" >
							<translate x="-3.3891e-006" y="1.50758e-005" z="1.91279e-006" />
							<rotate angle="0" >
								<axis x="0" y="0" z="-1" />
							</rotate>
							<scale x="1" y="1" z="1" />
						</keyframe>
						<keyframe time="0.0430556" >
							<translate x="-7.2038e-006" y="7.58421e-008" z="2.91278e-006" />
							<rotate angle="0.0560883" >
								<axis x="-7.16006e-006" y="-0.00078479" z="1" />
							</rotate>
							<scale x="1" y="1" z="1" />
						</keyframe>
						<keyframe time="0.0861111" >
							<translate x="-3.3891e-006" y="1.50758e-005" z="1.91279e-006" />
							<rotate angle="0.120076" >
								<axis x="-1.00143e-005" y="-0.000791681" z="1" />
							</rotate>
							<scale x="1" y="1" z="1" />
						</keyframe>
						<keyframe time="0.129167" >
							<translate x="-3.3891e-006" y="7.58401e-008" z="-2.08722e-006" />
							<rotate angle="0.187223" >
								<axis x="-3.49006e-006" y="-0.000795521" z="1" />
							</rotate>
							<scale x="1" y="1" z="1" />
						</keyframe>
						<keyframe time="0.172222" >
							<translate x="4.2403e-006" y="8.07584e-006" z="-8.72146e-008" />
							<rotate angle="0.252792" >
								<axis x="-3.26011e-006" y="-0.00079292" z="1" />
							</rotate>
							<scale x="1" y="1" z="1" />
						</keyframe>
						<keyframe time="0.215278" >
							<translate x="8.05499e-006" y="7.58397e-008" z="-8.72148e-008" />
							<rotate angle="0.312039" >
								<axis x="-3.21058e-006" y="-0.000796826" z="1" />
							</rotate>
							<scale x="1" y="1" z="1" />
						</keyframe>
had to be changed to:

Code: Select all

				<track bone="Bip01_L_Hand" >
					<keyframes>
						<keyframe time="0" >
							<translate x="-3.3891e-006" y="1.50758e-005" z="1.91279e-006" />
							<rotate angle="0" >
								<axis x="0" y="0" z="-1" />
							</rotate>
							<scale x="1" y="1" z="1" />
						</keyframe>
						<keyframe time="0.0430556" >
							<translate x="-3.3891e-006" y="1.50758e-005" z="1.91279e-006" />
							<rotate angle="0.0560883" >
								<axis x="-7.16006e-006" y="-0.00078479" z="1" />
							</rotate>
							<scale x="1" y="1" z="1" />
						</keyframe>
						<keyframe time="0.0861111" >
							<translate x="-3.3891e-006" y="1.50758e-005" z="1.91279e-006" />
							<rotate angle="0.120076" >
								<axis x="-1.00143e-005" y="-0.000791681" z="1" />
							</rotate>
							<scale x="1" y="1" z="1" />
						</keyframe>
						<keyframe time="0.129167" >
							<translate x="-3.3891e-006" y="1.50758e-005" z="1.91279e-006" />
							<rotate angle="0.187223" >
								<axis x="-3.49006e-006" y="-0.000795521" z="1" />
							</rotate>
							<scale x="1" y="1" z="1" />
						</keyframe>
						<keyframe time="0.172222" >
							<translate x="-3.3891e-006" y="1.50758e-005" z="1.91279e-006" />
							<rotate angle="0.252792" >
								<axis x="-3.26011e-006" y="-0.00079292" z="1" />
							</rotate>
							<scale x="1" y="1" z="1" />
						</keyframe>
						<keyframe time="0.215278" >
							<translate x="-3.3891e-006" y="1.50758e-005" z="1.91279e-006" />
							<rotate angle="0.312039" >
								<axis x="-3.21058e-006" y="-0.000796826" z="1" />
							</rotate>
							<scale x="1" y="1" z="1" />
						</keyframe>
In each animation the translation for each bone had to be set to the first value

It works fine - besides one thing which has to be corrected: The Model flies 2 meters above the ground - although the root is set to 0,0,0 and EntityLocate too

Edit:
The actual solution works obviously only if the bones are only rotated - not translated and/or scaled

Re: Ogre Mesh and Skeletons

Posted: Tue Sep 18, 2012 12:04 am
by Fred
J. Baker wrote:
Fred wrote:Could you send me the files which doesn't work ?
PM sent. ;)
I have fixed the crash, and it does convert correctly (except the material file, you have to create a material from you .bmp file and it does work). The new converter is online.

Re: Ogre Mesh and Skeletons

Posted: Tue Sep 18, 2012 1:41 am
by Thade
Fred wrote:The new converter is online.
Where can I download it? ---- Found it!