Author Topic: how to add/remove items in an animated group on the fly?  (Read 1836 times)

Offline Angie

  • byte
  • *
  • Posts: 4
    • View Profile
how to add/remove items in an animated group on the fly?
« on: June 18, 2013, 11:49:56 pm »
hi all!
i am new to bones :) please help me to solve the problem...

in my game i need a character to carry different items in hands, like weapons.
i need to be able to change weapons on the fly without stopping the animation of the character
weapons should be attached to bones so that they can move properly, as if they were parts of character.

how should i do this? what should i export from 3d max and how do i attach things to the animated group?
i would also like to keep things modular, so every item in a separate file.

so far i managed to put a character into my app and successfully roll animation
i am using 3Dmax, android, jpct, bones

maybe asking what was asked already, please link me if it was explained
thanks!

Offline raft

  • Moderator
  • quad
  • *****
  • Posts: 1966
    • View Profile
    • http://www.aptalkarga.com
Re: how to add/remove items in an animated group on the fly?
« Reply #1 on: June 18, 2013, 11:58:06 pm »
you cannot at the moment. but you can export all weapons with your model and make visible one of them at a time.

Offline Angie

  • byte
  • *
  • Posts: 4
    • View Profile
Re: how to add/remove items in an animated group on the fly?
« Reply #2 on: June 19, 2013, 11:38:58 pm »
okay... if that is not possible, can I construct the animation group or whatever from different objects/files?
no animation persistance, just delete the entire animation group and then make a new with another objects

i just want to keep low memory consumption.
there are games on bones API far more advanced than mine, how do people usually solve that problem?

thanks for your reply!

Offline raft

  • Moderator
  • quad
  • *****
  • Posts: 1966
    • View Profile
    • http://www.aptalkarga.com
Re: how to add/remove items in an animated group on the fly?
« Reply #3 on: June 20, 2013, 12:40:34 am »
okay... if that is not possible, can I construct the animation group or whatever from different objects/files?
no animation persistance, just delete the entire animation group and then make a new with another objects.

i just want to keep low memory consumption.
you can create new AnimatedGroup's from Animated3D's of an existing AnimatedGroup (but not from different files).

they will share Skeleton, SkeletonPose and animation data and that will save a lot of memory. you will have a master copy with all objects and some clones which are created on demand with a subset of objects.

there are games on bones API far more advanced than mine..
which games are they? I'd like to know ;)


Offline Angie

  • byte
  • *
  • Posts: 4
    • View Profile
Re: how to add/remove items in an animated group on the fly?
« Reply #4 on: June 20, 2013, 11:48:44 am »
Could you explain how to export multiple objects connected to the same skeletal rig in 3DS Max?
When I export to Ogre file format I get multiple MESH files for each object. Do the invidual objects need to be attached to a single mesh and exported from there? If so, how do I set element ID? Should each object be skinned to the rig with a seperate modifier or do they need to have the same modifier for all objects?

Offline raft

  • Moderator
  • quad
  • *****
  • Posts: 1966
    • View Profile
    • http://www.aptalkarga.com
Re: how to add/remove items in an animated group on the fly?
« Reply #5 on: June 20, 2013, 02:29:54 pm »
I dont have access to 3ds Max at the moment. but I'm sure it's supported and straightforward.

they should be different meshes and rigged with (attached to) same skeleton. I'm not sure if they should share same modifier but I guess not.

try playing with exporter settings. looking at OgreMax documentation and Ogre forums may also help.

Offline Angie

  • byte
  • *
  • Posts: 4
    • View Profile
Re: how to add/remove items in an animated group on the fly?
« Reply #6 on: June 29, 2013, 11:26:37 pm »
All solved, thanks alot!
Pictures show how i switch different items

 


Also, can you give a hint on how to pre-process the mesh to save the memory?
it says "coordinates array is sparsely populated"

.

Offline raft

  • Moderator
  • quad
  • *****
  • Posts: 1966
    • View Profile
    • http://www.aptalkarga.com
Re: how to add/remove items in an animated group on the fly?
« Reply #7 on: June 30, 2013, 02:28:48 pm »
looks cool :)

I dont think such a pre-process is necessary. make sure you use Bones' binary format. and if there is a setting in OgreMax exporter like 'use indexed geometry' make sure it's enabled (if there is, possibly it's default)