www.jpct.net

Bones - Skeletal and Pose Animations for jPCT/jPCT-AE => Bones => Topic started by: kkl on March 31, 2014, 03:26:59 am

Title: Different meshes with same skeleton
Post by: kkl on March 31, 2014, 03:26:59 am
Hi,

I have different 3d models that have the same animation. Is it doable if the skeleton is shared among all the meshes? Can it be achieved by linked-duplicating the skeleton and adjust the vertex group to the same bones in Blender? I'm building an Android app and I need to save as much memory and processing power as possible. Thanks.
Title: Re: Different meshes with same skeleton
Post by: raft on March 31, 2014, 09:32:48 am
yes that is what OgreMax exporter does at 3dsMax. multiple objects are attached to same skeleton, when they are exported together they share the same skeleton.

i'm not sure how exporter works at blender, but it should -hopefully- work the same way.
Title: Re: Different meshes with same skeleton
Post by: kkl on March 31, 2014, 12:14:26 pm
Quote
multiple objects are attached to same skeleton
Did you mean the ninja and sword example? If yes, i think i meant different context. My case is abit different though. E.g. I have a group of fish sharing the same skeleton animation. Each fish has different meshes but with same animation skeleton and has its own animation frame. Is it doable by using same skeleton?

How do we do it in 3dsmax to share the same skeleton? Do we just export the skeleton along with all objects without any further setup? I'll try to reproduce it in Blender and see if it works.
Title: Re: Different meshes with same skeleton
Post by: raft on March 31, 2014, 12:56:40 pm
Quote
How do we do it in 3dsmax to share the same skeleton? Do we just export the skeleton along with all objects without any further setup? I'll try to reproduce it in Blender and see if it works.
you dont export skeleton seperately. you attach many objects to same skeleton with a proper modifier (pysique or skin). in OgreMax setup, you define animations (start - end frames). i'm not sure if you can define different animations for different objects but i dont think soo. finally you export your objects (not the skeleton) and skeleton is also automatically exported to a seperate file

Quote
My case is abit different though. E.g. I have a group of fish sharing the same skeleton animation. Each fish has different meshes but with same animation skeleton and has its own animation frame. Is it doable by using same skeleton?
I dont think so. even if so, (i.e. different objects have different animation sequences) Bones cannot import it.

but, if your objects will have different animations, sharing skeleton will not reduce memory usage that much. it will reduce but not that much. that's because the skeleton data itself is not that big (assuming you dont have too many joints in your skeleton). animation data itself is much bigger than that.
Title: Re: Different meshes with same skeleton
Post by: kkl on April 01, 2014, 04:34:11 am
I guess I have to make a different skeleton for each fish in this case. BTW, how do we see the memory usage for Bones, e.g. the skeleton data and animation data? It would be easier for me to plan how many skeletons should be fit into scene with the limit of android phones.
Title: Re: Different meshes with same skeleton
Post by: raft on April 01, 2014, 08:42:09 am
Quote
I guess I have to make a different skeleton for each fish in this case.
I guess so.

Quote
BTW, how do we see the memory usage for Bones, e.g. the skeleton data and animation data? It would be easier for me to plan how many skeletons should be fit into scene with the limit of android phones.
You can inspect memory with android's DDMS tools. I've never used it for memory profiling  but I know it can do that
Title: Re: Different meshes with same skeleton
Post by: kkl on April 02, 2014, 03:41:53 pm
Is there any way to track the memory before making them into java objects? DDMS tools seems to track memory by java objects. I'm trying to track memory while compiling .bones file so I can estimate the memory usage, to skip one process. 
Title: Re: Different meshes with same skeleton
Post by: raft on April 02, 2014, 04:48:50 pm
you mean a method like sizeOf(skeleton) ? no. i'm not aware of such a thing.

I'll suggest dont worry about memory. the overhead a skeleton adds is really negligible unless you have a huge skeleton(with many many bones). have a look at code of Skeleton class to convince yourself.
Title: Re: Different meshes with same skeleton
Post by: kkl on April 02, 2014, 04:57:33 pm
Haha.. sure.. I guess I'll check with DDMS tools. I have been having alot of problems with memory issue, especially low end devices, mostly caused by texture data. That's why I'm trying my best to save memory. Thank you so much for your help btw. Appreciate it ;)
Title: Re: Different meshes with same skeleton
Post by: raft on April 02, 2014, 05:15:28 pm
you are welcome ;) a texture consumes much more memory than a skeletom btw if you keep a copy in memory.