Error: A bone with the handle already exists when using OgreXMLConverter

Anything and everything that's related to OGRE or the wider graphics field that doesn't fit into the other forums.
phuvinh1408
Halfling
Posts: 45
Joined: Tue Aug 09, 2022 7:55 am
x 1

Error: A bone with the handle already exists when using OgreXMLConverter

Post by phuvinh1408 »

Hi guys, I am using OgreXMLConverter to convert mesh and skeleton into XML file and import into blender, but whenever I used the tool that through out the error log "Error : A bone with the handle (number) already exists", I did not know what happent here. and I looked at the OgreSkeleton.h line 353 that is the bone handle from skeleton. Is that will convert the animation from binary into XML structures? If so , the name of the animation that I made by Chinese letters not alphabet will affect that problem? Can someone help my out this issue, thank you.

loath
Platinum Sponsor
Platinum Sponsor
Posts: 290
Joined: Tue Jan 17, 2012 5:18 am
x 67

Re: Error: A bone with the handle already exists when using OgreXMLConverter

Post by loath »

sounds like a bug. try using english characters and if that fixes the issue then open a bug.

rpgplayerrobin
Gnoll
Posts: 685
Joined: Wed Mar 18, 2009 3:03 am
x 379

Re: Error: A bone with the handle already exists when using OgreXMLConverter

Post by rpgplayerrobin »

It is very hard to know where the bug is though.
Since you are converting a mesh/skeleton to XML, you have first exported that mesh/skeleton from a 3D program, which means bug can even be in the exporter.
The bug can also be in the XML converter of course, but if it is, can you debug it and see why it happens from code?
Because if that mesh actually do have two bones with the same handle/number, there must be a reason for it shown in the code (which is most likely the bug).

You can also upload the mesh you are trying to convert here so other people can help.

paroj
OGRE Team Member
OGRE Team Member
Posts: 2108
Joined: Sun Mar 30, 2014 2:51 pm
x 1134

Re: Error: A bone with the handle already exists when using OgreXMLConverter

Post by paroj »

is this a continuation of viewtopic.php?p=553349 ?

phuvinh1408
Halfling
Posts: 45
Joined: Tue Aug 09, 2022 7:55 am
x 1

Re: Error: A bone with the handle already exists when using OgreXMLConverter

Post by phuvinh1408 »

paroj wrote: Tue Oct 11, 2022 1:23 pm

is this a continuation of viewtopic.php?p=553349 ?

No It is not a continuation from that topic. I already figured out that problem, but in this case I got an error with the handle in the code. So I did get some help from my friend to convert the skeleton file from different tool, and I looked at It, but nothing in the file contain a dupplicate bone or like the error showed up. I did look through the code and notice that a function createBone(unsigned short handle) It contain a variable called ERR_DUPLICATE_ITEM, I know this mean the tool will check the exception from the file, but my file is new, and does not have any issue. I want to know that any way to cross out that exception. And sometime I use XMLConverter did not show up any error message while nothing changed or succesful.

phuvinh1408
Halfling
Posts: 45
Joined: Tue Aug 09, 2022 7:55 am
x 1

Re: Error: A bone with the handle already exists when using OgreXMLConverter

Post by phuvinh1408 »

rpgplayerrobin wrote: Tue Oct 11, 2022 9:34 am

It is very hard to know where the bug is though.
Since you are converting a mesh/skeleton to XML, you have first exported that mesh/skeleton from a 3D program, which means bug can even be in the exporter.
The bug can also be in the XML converter of course, but if it is, can you debug it and see why it happens from code?
Because if that mesh actually do have two bones with the same handle/number, there must be a reason for it shown in the code (which is most likely the bug).

You can also upload the mesh you are trying to convert here so other people can help.

So my skeleton file does not uncorrupted or damge because my friend use a different decompile tool, that worked perfect, except the OgreXMLConverter. Even the number of bone in my skeleton lower then 256, some of them just have 5 or 10 bones, the tool still through out an exception message. I wonder to know the keyframe of animation will affect that issue or not, because my animation contain like a ton of keyframes. If you guys want take a look in my original skeleton file I can upload here.

phuvinh1408
Halfling
Posts: 45
Joined: Tue Aug 09, 2022 7:55 am
x 1

Re: Error: A bone with the handle already exists when using OgreXMLConverter

Post by phuvinh1408 »

loath wrote: Mon Oct 10, 2022 7:27 pm

sounds like a bug. try using english characters and if that fixes the issue then open a bug.

So my friend use different tool to decode the file, that worked without issue, and the animation name is not the one cause problem. I dont know why the OgreXMLConverter get error like that because in my file does not contain any dupplicate bone and the number of bones were lower 256.

rpgplayerrobin
Gnoll
Posts: 685
Joined: Wed Mar 18, 2009 3:03 am
x 379

Re: Error: A bone with the handle already exists when using OgreXMLConverter

Post by rpgplayerrobin »

For anyone to be able to help you understand why this bug happens in OgreXMLConverter but not in your friends version of that program, you must upload a file which will generate the error.
Because it is impossible for us to know the differences in your friends program compared to OgreXMLConverter.

Also, which version of Ogre are you using? Is that version the same as OgreXMLConverter? And what version is the mesh file using (it shows up on the top if you open the .mesh file in notepad)?

phuvinh1408
Halfling
Posts: 45
Joined: Tue Aug 09, 2022 7:55 am
x 1

Re: Error: A bone with the handle already exists when using OgreXMLConverter

Post by phuvinh1408 »

rpgplayerrobin wrote: Wed Oct 12, 2022 8:39 am

For anyone to be able to help you understand why this bug happens in OgreXMLConverter but not in your friends version of that program, you must upload a file which will generate the error.
Because it is impossible for us to know the differences in your friends program compared to OgreXMLConverter.

Also, which version of Ogre are you using? Is that version the same as OgreXMLConverter? And what version is the mesh file using (it shows up on the top if you open the .mesh file in notepad)?

So this is the link of my skeleton file:
https://drive.google.com/file/d/1hLj0OJ ... sp=sharing

You can take a look of these files. I am using Ogre latest version 13.4, but I did change the OgreXML tool into v1.10 when It compressing. and the skeleton file using is v1.10.

rpgplayerrobin
Gnoll
Posts: 685
Joined: Wed Mar 18, 2009 3:03 am
x 379

Re: Error: A bone with the handle already exists when using OgreXMLConverter

Post by rpgplayerrobin »

When I try OgreXMLConverter.exe with your skeleton files, both of them output this error:
"Error: Exceeded the maximum number of bones per skeleton."

That is not the same error that you are encountering.
But the skeleton files are huge, and having that many bones (256+) is really bad. What are you trying to do if you want that many bones?

Last edited by rpgplayerrobin on Fri Oct 14, 2022 6:17 am, edited 1 time in total.
rpgplayerrobin
Gnoll
Posts: 685
Joined: Wed Mar 18, 2009 3:03 am
x 379

Re: Error: A bone with the handle already exists when using OgreXMLConverter

Post by rpgplayerrobin »

Further, when I create an entity with one of the skeleton files (using any mesh file, since it was not specified in this post) it shows a bone that is completely corrupt.
Its name is "ÿ8¸?ÿ8 ð@8?ÿ¸#~?ÿ8Ë~?<ª3?‚¨{·ÿ8¼<€?‚¨{·ÿ8“Z·¸@âL½t['=l.€¼Æo?„Ú¼0Ñ
½Êô~?=Y8½ÔR~?§=CU½+â}?¸@Ú8¤Œ87?~?ÿ¸ó~?@Ú¸¬~? ðÀ7¤Œ87‚¨{7š™™?yâ<ÚY½—(ɽ»~~?½Î‘~?2¼\
" and its handle is 36029, so that probably explains the problem you are facing.
The skeleton files in question are corrupt/incorrect and you need to export them from the 3D program again to know exactly what went wrong.
Since you mentioned that you used Chinese symbols as animation names, try to make everything in english.

phuvinh1408
Halfling
Posts: 45
Joined: Tue Aug 09, 2022 7:55 am
x 1

Re: Error: A bone with the handle already exists when using OgreXMLConverter

Post by phuvinh1408 »

rpgplayerrobin wrote: Fri Oct 14, 2022 6:01 am

When I try OgreXMLConverter.exe with your skeleton files, both of them output this error:
"Error: Exceeded the maximum number of bones per skeleton."

That is not the same error that you are encountering.
But the skeleton files are huge, and having that many bones (256+) is really bad. What are you trying to do if you want that many bones?

this is the link of my skeleton XML that was decode by my friend tool. So like you said the bone number will count by the index or by the name, If It count by the ID, so for mine just have 162 bones that not over 256, but It still get into the error maximum bones. And the second error was a dupplicate bone that I was known so far. Can you check my XMl file and tell me what was wrong with my bone that I can fix, because I just ask my friend and he told me that his tool also used the ogreMain for library And he cannot spread out because that for private use in company only. So in this issue that I want to make my own tool for a backup If sometime I loose my backup file so I can decode from the original skeleton and mesh file into XML.

https://drive.google.com/file/d/1SiGMAE ... sp=sharing

rpgplayerrobin
Gnoll
Posts: 685
Joined: Wed Mar 18, 2009 3:03 am
x 379

Re: Error: A bone with the handle already exists when using OgreXMLConverter

Post by rpgplayerrobin »

If you read everything I wrote, I suggested you to remove all Chinese characters.
Only use English, otherwise it might cause the corrupted file that I wrote about above.

There are many lines in that xml file that still contain Chinese characters, one of which is:

Code: Select all

<boneparent bone="Bone眼睛" parent="Bone16" />

Since it would take a lot of time to do this for me, you will have to do it yourself.
It is pretty easy to do though:

  1. Remove all non-English characters from the xml file.
  2. Convert the xml file into a .skeleton file.
  3. Check if it works to load the skeleton file into an Ogre scene without a crash/error/warning.
  4. Check if it works to convert the skeleton file back to an xml file without a crash/error/warning.

If all steps above works, the issue is gone.

paroj
OGRE Team Member
OGRE Team Member
Posts: 2108
Joined: Sun Mar 30, 2014 2:51 pm
x 1134

Re: Error: A bone with the handle already exists when using OgreXMLConverter

Post by paroj »

phuvinh1408 wrote: Sat Oct 15, 2022 9:34 pm

this is the link of my skeleton XML that was decode by my friend tool.

I could convert this XML to binary and back with XMLConverter from 13.4.4. Can you confirm this works for you too?

I also dont think that chinese characters break anything. Ogre does not really care what is inside a string, as long as it is NUL terminated.

rpgplayerrobin
Gnoll
Posts: 685
Joined: Wed Mar 18, 2009 3:03 am
x 379

Re: Error: A bone with the handle already exists when using OgreXMLConverter

Post by rpgplayerrobin »

I re-read it again and it seems his friends program has outputted that xml file from the corrupted .skeleton file. I thought it was an xml file that was exported from a 3D program or something like that.

The .skeleton file is corrupted and your friends program converted it in a different way than OgreXMLConverter (probably skips these corrupted sections in it, but that can cause other errors in the future, since there is for sure information there that might be needed).

It is still not explained how the .skeleton file got corrupted though. If you don't have the original file (in Blender for example) and export it to reproduce the corrupted file, it is impossible for anyone here to help you.

phuvinh1408
Halfling
Posts: 45
Joined: Tue Aug 09, 2022 7:55 am
x 1

Re: Error: A bone with the handle already exists when using OgreXMLConverter

Post by phuvinh1408 »

paroj wrote: Sun Oct 16, 2022 1:08 pm
phuvinh1408 wrote: Sat Oct 15, 2022 9:34 pm

this is the link of my skeleton XML that was decode by my friend tool.

I could convert this XML to binary and back with XMLConverter from 13.4.4. Can you confirm this works for you too?

I also dont think that chinese characters break anything. Ogre does not really care what is inside a string, as long as it is NUL terminated.

Yes, I can use that XML and convert back and forward, but that XML file came from my friend's tool. He used my original skeleton file and decrypt into XML above by his tool, but my OgreXMLConveter cannot do that. So I did attach the skeleton files above, can you check them out what happen here.

phuvinh1408
Halfling
Posts: 45
Joined: Tue Aug 09, 2022 7:55 am
x 1

Re: Error: A bone with the handle already exists when using OgreXMLConverter

Post by phuvinh1408 »

rpgplayerrobin wrote: Sun Oct 16, 2022 6:54 pm

I re-read it again and it seems his friends program has outputted that xml file from the corrupted .skeleton file. I thought it was an xml file that was exported from a 3D program or something like that.

The .skeleton file is corrupted and your friends program converted it in a different way than OgreXMLConverter (probably skips these corrupted sections in it, but that can cause other errors in the future, since there is for sure information there that might be needed).

It is still not explained how the .skeleton file got corrupted though. If you don't have the original file (in Blender for example) and export it to reproduce the corrupted file, it is impossible for anyone here to help you.

I also think like you, because I don't have the original 3D file, so I can't tell what tool I used to access the skeleton file. My friend also uses Ogre lib to build his tool, but apparently he didn't check for exception errors, which can be dangerous when repacking the skeleton file. I want to know more is it possible in current ogre version to ignore exception errors? because I just want to decode them to XML for readability.

phuvinh1408
Halfling
Posts: 45
Joined: Tue Aug 09, 2022 7:55 am
x 1

Re: Error: A bone with the handle already exists when using OgreXMLConverter

Post by phuvinh1408 »

rpgplayerrobin wrote: Sun Oct 16, 2022 10:59 am

If you read everything I wrote, I suggested you to remove all Chinese characters.
Only use English, otherwise it might cause the corrupted file that I wrote about above.

There are many lines in that xml file that still contain Chinese characters, one of which is:

Code: Select all

<boneparent bone="Bone眼睛" parent="Bone16" />

Since it would take a lot of time to do this for me, you will have to do it yourself.
It is pretty easy to do though:

  1. Remove all non-English characters from the xml file.
  2. Convert the xml file into a .skeleton file.
  3. Check if it works to load the skeleton file into an Ogre scene without a crash/error/warning.
  4. Check if it works to convert the skeleton file back to an xml file without a crash/error/warning.

If all steps above works, the issue is gone.

So I did use Ogre Meshy to load those skeleton and mesh, but the tool can load mesh, not the skeleton file, It will through out an exception maximum bone like the OgreXML tool. But you can take a look in the XML file that not over 256 bones.

rpgplayerrobin
Gnoll
Posts: 685
Joined: Wed Mar 18, 2009 3:03 am
x 379

Re: Error: A bone with the handle already exists when using OgreXMLConverter

Post by rpgplayerrobin »

phuvinh1408 wrote: Tue Oct 18, 2022 12:04 am
rpgplayerrobin wrote: Sun Oct 16, 2022 6:54 pm

I re-read it again and it seems his friends program has outputted that xml file from the corrupted .skeleton file. I thought it was an xml file that was exported from a 3D program or something like that.

The .skeleton file is corrupted and your friends program converted it in a different way than OgreXMLConverter (probably skips these corrupted sections in it, but that can cause other errors in the future, since there is for sure information there that might be needed).

It is still not explained how the .skeleton file got corrupted though. If you don't have the original file (in Blender for example) and export it to reproduce the corrupted file, it is impossible for anyone here to help you.

I also think like you, because I don't have the original 3D file, so I can't tell what tool I used to access the skeleton file. My friend also uses Ogre lib to build his tool, but apparently he didn't check for exception errors, which can be dangerous when repacking the skeleton file. I want to know more is it possible in current ogre version to ignore exception errors? because I just want to decode them to XML for readability.

I think you need to build the source and alter it after your needs to ignore all corrupted sections. But that is not perfect, as the information is then lost.