Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperLicht
Skinned animations for child scene nodes

sweaver
Registered User
Quote
2013-10-01 20:23:01

In CopperLicht, is it possible to have a simple root scene node that contains a skeleton with an animation and then add child nodes to the root that move along with the root animation? The use case I have in mind is being able to customize your character's appearance, but no matter how it looks, it always controls the same and has the same animations. For example, one character might have a human head with a thin body and another might have a robot head with a fat body, all depending on what the user chooses, but ultimately they play and animate exactly the same.


niko
Moderator
Quote
2013-10-02 06:05:15

Ah, you mean attaching a 3d object to a joint of an animated character? Currently, this is not possible, no, sorry. But it is already on the TODO list.


sweaver
Registered User
Quote
2013-10-02 15:52:59

Oh ok, thanks for the quick response. Any idea of roughly when that functionality will be available?

EDIT: Is it possible to swap parts of meshes at runtime? So for example, if I had an animated mesh of a character holding a crowbar, and I wanted to swap the crowbar with a baseball bat, would that be possible? Or are all the components of a mesh treated as one giant mesh once it gets loaded?


sweaver
Registered User
Quote
2013-10-03 21:56:58

I've been printing the scene node to the console to try to figure out how it stores mesh data for each sub-mesh and I've been playing around with some of the values to see if I could replace sub-meshes with other meshes.

I have an AnimatedMeshSceneNode, and from what I can tell the data has to be under "Mesh." The mesh I'm using is comprised of 9 sub-meshes, so I basically tried to find everything under "Mesh" that was an array of size 9. I came up with the following fields:

Mesh.LocalBuffers
Mesh.RootJoints[0].Children
Mesh.Vertices_Moved

Is there any way I could swap one mesh with another simply by overwriting the data in one or more of those arrays? If so, which ones would I change and which ones would stay the same?


niko
Moderator
Quote
2013-10-04 06:06:07

I don't think that would work, but what you could do is to search the joint you are looking for (in AllJoints), by name (each joint has a property 'name'). After animation, joints have a property .GlobalAnimatedMatrix. You can get its rotation (getRotationDegrees()) and translation (getTranslation()) and set this as new rotation and position for your new mesh.


sweaver
Registered User
Quote
2013-10-07 16:08:34

If I did manage to attach a mesh with the correct rotation and translation, will it then animate with the rest of the parent model without having to manually update it every frame?

Also, when do you expect to have official support ready for attaching a 3D object to a joint of an animated character?


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Int?rnational" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact