www.jpct.net

Bones - Skeletal and Pose Animations for jPCT/jPCT-AE => Bones => Topic started by: efaj on January 08, 2012, 06:41:12 pm

Title: Multiple meshes with the same skeleton
Post by: efaj on January 08, 2012, 06:41:12 pm
Do I just handle them separately, or is there a way that would be more optimized?
Title: Re: Multiple meshes with the same skeleton
Post by: raft 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
Title: Re: Multiple meshes with the same skeleton
Post by: efaj 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.
Title: Re: Multiple meshes with the same skeleton
Post by: raft 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
Title: Re: Multiple meshes with the same skeleton
Post by: efaj 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.
Title: Re: Multiple meshes with the same skeleton
Post by: raft 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.