Jump to content

Keeping skeleton[] in non-mesh babylon file.


MicroEyes
 Share

Recommended Posts

Hi,

I have 3 babylon files to test with (say SectionA):

  1. Base model with mesh & skeleton (no animation): After opening file as JSON,
    1. meshes[] with respective mesh data and meshes[mesh_index].animations array as empty.
    2. skeleton[skeleton_index].bones[bones_index].animation object with just two objects in keys array with first object contains first frame values and second object contains last frame values.
  2. With no mesh, with skeleton & animation: As JSON,
    1. meshes[] with respective mesh data and meshes[mesh_index].animations[animations_index] object with property and respective keys array.
    2. skeleton array is empty here.
  3. Base model with mesh, skeleton & animation: As JSON,
    1. meshes[] with respective mesh data and meshes[mesh_index].animations array as empty.
    2. skeleton[skeleton_index].bones[bones_index].animation.keys[] array with frame property values.

In my case, My aim is to keep (say SectionB):

  1. One babylon file with mesh, skeleton and no animation
  2. One babylon file with no mesh but with skeleton and animations.

But my test is failing with #2 (from SectionA) where my animation data is not skeleton[] array and when i run below code, i get undefined in return from this.getSkeleton().

let l_newSkeleton:Babylon.Skeleton = this.getSkeleton("skeleton").clone("skeleton #0", "0");    //getSkeleton() is my function, which returns Skeleton object.
this.m_baseMesh.skeleton = l_newSkeleton;       //Replacing skeleton on base mesh.
this.m_game._scene.beginAnimation(this.m_baseMesh.skeleton, 0, 200, true);   //playing animation on base mesh's new skeleton.

 

How can i maintain skeleton[] array with animations in non-mesh babylon file, while exporting?

 

We are using 3DsMAX 2013 and Exporter_version is '0.4.5'.

Link to comment
Share on other sites

Hi @Deltakosh,

Thanks for contacting back.

Please find attached ZIP file with "son.babylon" as base mesh and "[email protected]" as animation file.

But [email protected] have empty skeleton and animations are in meshes[mesh_index ].animations[animations_index] object with property and respective keys array.

My expectation is to use [email protected] to keep only animation and skeleton data (no mesh information), assigning skeleton to son.babylon and play animation, it should get played.

forum.zip

Link to comment
Share on other sites

Apologies for the delay in response. We had a project delivery to make.

On 7/18/2018 at 10:06 PM, Deltakosh said:

Just to make sure: Why not just keeping a dummy mesh root to host your animation data?

I don't want to download two babylon files with same mesh data.

In my case, i want to download base mesh babylon file with T-pose at start and download animation babylon files on demand or depends on conditions at every stage in my project. On the other hand, downloading mesh data with each animation will make the size of each file larger and its also not good to keep duplicate & unusable mesh data in memory.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...