Jump to content

[SOLVED] Failed to create SkinnedMesh with c++ api


photo

Recommended Posts

In order to import animated meshes organised with our private format. i have tried to create SkinnedMesh with c++ api.

 

but i found the SkinnedMesh which i create can not display correctlly. I have ever tried to find out the reason with MeshViewer, only to find the boundary box data is incorrect. but i don't know why.

 

1.i can import our mesh to unigine as a non-skinned mesh.

2.i just need a very simple example to show me how to create a SkinnedMesh with simple animation with c++ api.

for example. there are two square subfaces in the SkinnedMesh, and we have bone A to control subface A, bone B to control subface B, B 's parent is A.

 

thx~

Link to comment

 Hello,
 
 If I understand you correctly, firstly you need to export your model from your custom format to .smesh format.
 Specification for the .smesh format you can find here:
 https://developer.unigine.com/en/docs/1.0/code/file_formats#smesh
 
 Then you can load .smesh into Unigine and interact with model using the following class methods:
 https://developer.unigine.com/en/docs/1.0/cpp_api/reference/api_objectmeshskinned_class

 

Also, you may find some useful information in this forum topic:

https://developer.unigine.com/forum/topic/2355-solved-importing-a-custom-model/

Link to comment
  • 2 weeks later...

Hi,

 

I'm afraid there is no samples to fully solve your problem.
But you can check objects/skinned_06 sample from SDK samples. It perfoms creation ObjectMeshSkinned dynamically from other ObjectMeshSkinned.

To generate Skinned mesh with animation from the script you can follow the instruction below:
 - Generate geometry using ObjectMeshDynamic
 - Save as .smesh
 - Load ObjectMeshSkinned with dynamic flag = 1
 - Add Bones
 - Set Bones
 - Set Bone transformation
 
It's not the perfect way to add skinned mesh to the world but it should solve your problem.

Some additional information about animation you can find in this topic: https://developer.unigine.com/forum/topic/257-blend-animation-layer-with-script-bone-transform/

Link to comment
×
×
  • Create New...