Author Topic: Multiple meshes with the same skeleton  (Read 18013 times)

Offline efaj

  • byte
  • *
  • Posts: 32
    • View Profile
Multiple meshes with the same skeleton
« on: January 08, 2012, 06:41:12 pm »
Do I just handle them separately, or is there a way that would be more optimized?

Offline raft

  • Moderator
  • quad
  • *****
  • Posts: 1993
    • View Profile
    • http://www.aptalkarga.com
Re: Multiple meshes with the same skeleton
« Reply #1 on: January 08, 2012, 08:57:56 pm »
no, no need to handle them separately. if you export all of them, each of will be an Animated3D in an AnimatedGroup. just like body and sword of ninja

Offline efaj

  • byte
  • *
  • Posts: 32
    • View Profile
Re: Multiple meshes with the same skeleton
« Reply #2 on: January 08, 2012, 11:20:53 pm »
But ninja has 1 single file. I need to have them in separate files and merge them only during execution, for example, to make a ninja wield different swords.
I tried for example loading them all, and then merge them with the AnimatedGroup method, but it sent an error:
Code: [Select]
Number of vertices differ!So, that's not the way to do it, if any.

Offline raft

  • Moderator
  • quad
  • *****
  • Posts: 1993
    • View Profile
    • http://www.aptalkarga.com
Re: Multiple meshes with the same skeleton
« Reply #3 on: January 08, 2012, 11:29:13 pm »
as the merge method name (mergeAnimations) suggests, merging is not meant for that. you cannot merge many objects/groups into a group. you can merge animations of many identical objects/groups. the resulting group will have same skeleton and bone weights and a merged SkinClipSequence.

why do you need your objects in different files? put them in a single one and make visible/unvisible them as required

Offline efaj

  • byte
  • *
  • Posts: 32
    • View Profile
Re: Multiple meshes with the same skeleton
« Reply #4 on: January 08, 2012, 11:34:08 pm »
Because I'm making an online game that will allow character customization. So if I added all clothes and parts in one single file, it would grow in size a lot. And we all know that would make parsing eternal.

I'll just stick to handling them separately... I already got that done, I was just looking if there was a more efficient way.

Offline raft

  • Moderator
  • quad
  • *****
  • Posts: 1993
    • View Profile
    • http://www.aptalkarga.com
Re: Multiple meshes with the same skeleton
« Reply #5 on: January 08, 2012, 11:45:19 pm »
i see. yes, as you said, handling them separately is the only way I can think of. each object will have its own skeleton and animation data. needless to say, this will increase memory and cpu usage. cpu usage will not increase that much since heavy part of calculations are not animating skeleton but applying that pose to mesh.

i once started implement a method to merge objects but then for some reason I can't remember now, i cancelled the idea.