problem exporting blender meshes with skeletons

The place for artists, modellers, level designers et al to discuss their approaches for creating content for OGRE.
Post Reply
rconnaug
Gnoblar
Posts: 5
Joined: Mon Dec 06, 2004 9:55 pm

problem exporting blender meshes with skeletons

Post by rconnaug »

Hey all- I'm pretty new both to Ogre and to Blender, but I'm working on exporting some animated models from blender to Ogre and having some problems. I'm trying to animate an ant- I made the model in Blender, rigged it with armatures and set the keyframes etc, and all seemed well. I installed the blender exporter script, and exported the mesh and armature to .mesh.xml and .skeleton.xml files... when I tried to use the XMLConverter I had some problems, so I figured I would try to simplify my first export to find the problem. So, using the same mesh, I only rigged it with one bone, and attached every vertex to it... and obviously didn't even bother animating it the second time around. When I tried to export even this simple case, I had the same problem... so I hope someone can help!

After I exported the model to .skeleton.xml and .mesh.xml files...

I ran XMLConverter on the .skeleton.xml file, and it successfully created a .skeleton file, and produced the following output:

Code: Select all

../../../bin/OgreXMLConverter Armature.skeleton.xml
Creating resource group General
Registering ResourceManager for type Mesh
Registering ResourceManager for type Material
Registering ResourceManager for type Skeleton
 
-- OPTIONS --
source file      = Armature.skeleton.xml
destination file = Armature.skeleton
interactive mode = false
lod levels       = none (or use existing)
Generate edge lists  = 1
Generate tangents = 0
Reorganise vertex buffers = 1
Optimise animations = 1
-- END OPTIONS --
 
XMLSkeletonSerializer: reading XML data from Armature.skeleton.xml...
XMLSkeletonSerializer: Reading Bones name...
XMLSkeletonSerializer: Reading Hierarchy data...
XMLSkeletonSerializer: Reading Bones data...
XMLSkeletonSerializer: Reading Animations data...
XMLSkeletonSerializer: Finished. Running SkeletonSerializer...
Exporting bones..
Bones exported.
Exporting animations, count=0
Unregistering ResourceManager for type Skeleton
Unregistering ResourceManager for type Material
Unregistering ResourceManager for type Mesh
At this point, the OgreXMLConverter.log file read:

Code: Select all

$ cat OgreXMLConverter.log
03:26:54: XMLSkeletonSerializer: reading XML data from Armature.skeleton.xml...
03:26:54: XMLSkeletonSerializer: Reading Bones name...
03:26:54: XMLSkeletonSerializer: Reading Hierarchy data...
03:26:54: XMLSkeletonSerializer: Reading Bones data...
03:26:54: XMLSkeletonSerializer: Reading Animations data...
03:26:54: XMLSkeletonSerializer: Finished. Running SkeletonSerializer...
03:26:54: Exporting bones..
03:26:54: Bones exported.
03:26:54: Exporting animations, count=0
03:26:54: Unregistering ResourceManager for type Skeleton
03:26:54: Unregistering ResourceManager for type Material
03:26:54: Unregistering ResourceManager for type Mesh

Then, I ran XMLConverter on the .mesh.xml file, which was in the same directory as the .skeleton and .skeleton.xml files, and it produced the following output:

Code: Select all

$ ../../../bin/OgreXMLConverter ant.mesh.xml
Creating resource group General
Registering ResourceManager for type Mesh
Registering ResourceManager for type Material
Registering ResourceManager for type Skeleton
 
-- OPTIONS --
source file      = ant.mesh.xml
destination file = ant.mesh
interactive mode = false
lod levels       = none (or use existing)
Generate edge lists  = 1
Generate tangents = 0
Reorganise vertex buffers = 1
Optimise animations = 1
-- END OPTIONS --
 
XMLMeshSerializer reading mesh data from ant.mesh.xml...
Reading submeshes...
Reading geometry...
Geometry done...
Reading bone assignments...
Bone assignments done.
Reading geometry...
Geometry done...
Reading bone assignments...
Bone assignments done.
Reading geometry...
Geometry done...
Reading bone assignments...
Bone assignments done.
Submeshes done.
Skeleton: Loading Armature.skeleton
Unable to load skeleton Armature.skeleton for Mesh conversion. This Mesh will not be animated. You can ignore this message if you are using an offline tool.
XMLMeshSerializer import successful.
Reorganising vertex buffers to automatic layout..
Generating edge lists....
MeshSerializer writing mesh data to ant.mesh...
File header written.
Writing mesh data...
Writing submesh...
Exporting dedicated geometry bone assignments...
Dedicated geometry bone assignments exported.
Submesh exported.
Writing submesh...
Exporting dedicated geometry bone assignments...
Dedicated geometry bone assignments exported.
Submesh exported.
Writing submesh...
Exporting dedicated geometry bone assignments...
Dedicated geometry bone assignments exported.
Submesh exported.
Exporting skeleton link...
Skeleton link exported.
Exporting bounds information....
Bounds information exported.
Exporting submesh name table...
Submesh name table exported.
Exporting edge lists...
Edge lists exported
Mesh data exported.
MeshSerializer export successful.
Unregistering ResourceManager for type Skeleton
Unregistering ResourceManager for type Material
Unregistering ResourceManager for type Mesh
Note the line about being unable to load the .skeleton file.... Checking the log file again showed this:

Code: Select all

$ cat OgreXMLConverter.log
03:31:37: XMLMeshSerializer reading mesh data from ant.mesh.xml...
03:31:38: Reading submeshes...
03:31:38: Reading geometry...
03:31:38: Geometry done...
03:31:38: Reading bone assignments...
03:31:38: Bone assignments done.
03:31:38: Reading geometry...
03:31:38: Geometry done...
03:31:38: Reading bone assignments...
03:31:38: Bone assignments done.
03:31:38: Reading geometry...
03:31:38: Geometry done...
03:31:38: Reading bone assignments...
03:31:38: Bone assignments done.
03:31:38: Submeshes done.
03:31:38: Skeleton: Loading Armature.skeleton
03:31:38: An exception has been thrown!
 
-----------------------------------
Details:
-----------------------------------
Error #: 8
Function: ResourceGroupManager::openResource
Description: Cannot locate resource Armature.skeleton in resource group General..
File: OgreResourceGroupManager.cpp
Line: 501
Stack unwinding: <<beginning of stack>>
03:31:38: Unable to load skeleton Armature.skeleton for Mesh conversion. This Mesh will not be animated. You can ignore this message if you are using an offline tool.
03:31:38: XMLMeshSerializer import successful.
03:31:38: Reorganising vertex buffers to automatic layout..
03:31:38: MeshSerializer writing mesh data to ant.mesh...
03:31:38: File header written.
03:31:38: Writing mesh data...
03:31:38: Writing submesh...
03:31:38: Exporting dedicated geometry bone assignments...
03:31:38: Dedicated geometry bone assignments exported.
03:31:38: Submesh exported.
03:31:38: Writing submesh...
03:31:38: Exporting dedicated geometry bone assignments...
03:31:38: Dedicated geometry bone assignments exported.
03:31:38: Submesh exported.
03:31:38: Writing submesh...
03:31:38: Exporting dedicated geometry bone assignments...
03:31:38: Dedicated geometry bone assignments exported.
03:31:38: Submesh exported.
03:31:38: Exporting skeleton link...
03:31:38: Skeleton link exported.
03:31:38: Exporting bounds information....
03:31:38: Bounds information exported.
03:31:38: Exporting submesh name table...
03:31:38: Submesh name table exported.
03:31:38: Exporting edge lists...
03:31:38: Edge lists exported
03:31:38: Mesh data exported.
03:31:38: MeshSerializer export successful.
03:31:38: Unregistering ResourceManager for type Skeleton
03:31:38: Unregistering ResourceManager for type Material
03:31:38: Unregistering ResourceManager for type Mesh

Anyone have some pointers on what I'm doing wrong? It's probably something simple, but I've tried everything I can think of, including moving files to different directories, like ogre's Media path... etc and I am still clueless.

I'm using Blender v 2.37, and Ogre v 1.0.6, if that helps

pleeeeeease help :D
~ryan~
User avatar
haffax
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 4823
Joined: Fri Jun 18, 2004 1:40 pm
Location: Berlin, Germany
x 8
Contact:

Post by haffax »

Isn't this handled in the FAQ already? If, not it needs to be in there.

Hint: You are using the offline tool OgreXmlConverter.
team-pantheon programmer
creators of Rastullahs Lockenpracht
rconnaug
Gnoblar
Posts: 5
Joined: Mon Dec 06, 2004 9:55 pm

Post by rconnaug »

haha spell it out for me, it's late.. or early, depending on how u look at it :wink:

does that mean i just ignore the error message and truck on?
~ryan~
User avatar
haffax
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 4823
Joined: Fri Jun 18, 2004 1:40 pm
Location: Berlin, Germany
x 8
Contact:

Post by haffax »

Yes
team-pantheon programmer
creators of Rastullahs Lockenpracht
rconnaug
Gnoblar
Posts: 5
Joined: Mon Dec 06, 2004 9:55 pm

Post by rconnaug »

good to know, thanks!

So I'm moving on to reanimate my ant, and now I'm having another problem that I also had before...

I create more than one bone in the skeleton and assign vertex groups etc. When I export the armature, though, it makes duplicate copies of each bone in the xml file. For example, I have a 3 bone structure composed of 'bone', 'bone.001', and 'bone.002'. I export this and the resulting xml file has one copy of bone, but two entries for bone.001 and bone.002, with different bone indexes. As a result, when I run the XMLConverter on the skeleton, it crashes, and I get this in the log:

Code: Select all

17:31:46: XMLSkeletonSerializer: reading XML data from Armature.skeleton.xml...
17:31:46: XMLSkeletonSerializer: Reading Bones name...
17:31:46: An exception has been thrown!

-----------------------------------
Details:
-----------------------------------
Error #: 6
Function: Skeleton::createBone
Description: A bone with the name Bone.002 already exists.
File: OgreSkeleton.cpp
Line: 181
Stack unwinding: <<beginning of stack>>
If I try deleting the duplicate entries in the xml file, the XMLConverter again crashes without any useful error message.

This problem goes away if I go ahead and reindex the remaining boneindexes numerically, but then the bone assignments in the mesh.xml file are incorrect, and I have to go through and adjust alll of them as well (note: only one 'copy' of each bone is referenced in the mesh.xml. For example, if bone.001 had two entries in the skeleton.xml file, one with index 1 and one with index 4, only one of the two would used in the .mesh.xml file). I could go ahead and do this, but I don't know if this is the right idea.... any suggestions?
~ryan~
Post Reply