Code Monkey home page Code Monkey logo

Comments (19)

luoxz-ai avatar luoxz-ai commented on June 30, 2024

I want to use the application provided by the fbx2ozz.exe ozz engine to generate bones and animations, use The-Forge Engine AssimpImporter code to import skins, do not need AssetPipelineCmd.exe, is it ok?

OZZ engine fbx2ozz generated bones and animations are very accurate

from the-forge.

timoconffx avatar timoconffx commented on June 30, 2024

The version of Assimp we used while this unit test was written had an issue that caused all meshes to be 100x larger than intended and rotated on the x-axis. This is because in the FBX the mesh is stored in centimeters instead of meters and because most modelling tools use a different coordinate system. We added a workaround for this behaviour in the AssetPipeline. If the scale of your model is incorrect, try exporting it in meters using your favourite modeling tool. Our model is only a couple of units(meters) tall. Make sure yours is the about the same.

We used to use animations and skeletons exported through fbx2ozz.exe internally for testing purposes. I can't think if any reason why they wouldn't work now.

from the-forge.

luoxz-ai avatar luoxz-ai commented on June 30, 2024

Hi.

Thanks for the reply.

I used the example simpleTest\riggedMesh.fbx, simpleTest\twistShift.fbx bones and animations to test, import the animation into max, and then export the FBX file, whether it is Y axis or Z axis up, the animation is always put down 90 degrees, but Maya import and then export That's right, I think it's a good resource to handle this piece of code.

I hope to improve the code of this piece.

from the-forge.

wolfgangfengel avatar wolfgangfengel commented on June 30, 2024

Any more questions or can we close this issue?

from the-forge.

luoxz-ai avatar luoxz-ai commented on June 30, 2024

MM_Big.zip
AssetPipelineCmd , If you import this model, what are the steps and specifications?

I tested a lot of models and found that there will be problems. It is my use method is wrong, or the program itself is a BUG, ​​basically can not be used. Please give a detailed production process specification.

I hope to improve AssetPipeline and Assimporter to make it robust.

Show Bind Sketelal Pose
image

Runtime Sketelal Animation Pose
image

image

	rawAnimation.tracks.resize(skeleton->num_joints());
	for (uint i = 0; i < (uint)skeleton->num_joints(); ++i)
	{
		const char* jointName = skeleton->joint_names()[i];

		ozz::animation::offline::RawAnimation::JointTrack* track = &rawAnimation.tracks[i];

		tinystl::unordered_map<tinystl::string, aiNodeAnim*>::iterator it = jointMap.find(jointName);
		if (it != jointMap.end())
		{
                    ... ...
                }
                else  
                      If the root bone is not animated ??
                

If the root bone is not animated or has no animated bones? The number of bones is wrong when the animation is running.

thanks..

from the-forge.

luoxz-ai avatar luoxz-ai commented on June 30, 2024

JL.zip

AssimpPipeline Create Runtime Animation There seems to be some problems
image
Show Bind Pose
image
Runtime Animation Pose
image

thanks..

from the-forge.

timoconffx avatar timoconffx commented on June 30, 2024

The AssetPipeline requires you to seperate your bind pose mesh with skeleton and the animations into seperate files. For example:
Examples_3/Unit_Tests/UnitTestResources/Animation/fbx/simpleTest contains riggedMesh.fbx. This FBX file contains only the mesh and the skeleton in bind pose.
Examples_3/Unit_Tests/UnitTestResources/Animation/fbx/simpleTest/animations contains two files. Each only contains an animated skeleton. No triangle data is stored in this file.

Our animation middleware has the same requirement. It expects the bind pose and animation seperetly.

If seperating the model from the animation doesn't fix your issue, please send us the code and the assets in FBX format so we can evaluate the problem.

from the-forge.

luoxz-ai avatar luoxz-ai commented on June 30, 2024

FBX model :
riggedMesh.zip

@timoconffx
Thank you very much for your reply.

The animation is confusing. What is the reason?

image

result.Position = mul(1, float4(input.Position, 1.0f));

image

from the-forge.

timoconffx avatar timoconffx commented on June 30, 2024

Please create two fbx files. One containing only the mesh and the skeleton in bindpose and one with only the animation. Look at the assets in the Examples_3/Unit_Tests/UnitTestResources/Animation/fbx/simpleTest directory if you need an example.

from the-forge.

luoxz-ai avatar luoxz-ai commented on June 30, 2024

Hello, @timoconffx
One containing only the mesh and the skeleton in bindpose and one with only the animation.
I did this.
FBX Model:
riggedMesh.zip

Exported with maya, Validate raw animation failure.
Exported with max, There will be such an error. As shown above.

Why? What 3D modeling software did you use to export?

One containing only the mesh and the skeleton in bindpose and one with only the animation.

Same FBX, What is the difference between the two methods?

There are indeed such problems. Can you find the reason?
thanks..

from the-forge.

timoconffx avatar timoconffx commented on June 30, 2024

@myluoxz
The zip file you send us contains only one fbx file. This FBX contains both the mesh and the animation. They should be in seperate files. We can't help you if we don't have the files.

FBX files are tricky. There are often problems when importing FBX files, just because all exporters seem to export them differently. A mesh exporter from Blender might work fine. That same mesh exported from Maya might not. We primarily use Blender. You could try exporting the mesh using Blender instead.

from the-forge.

luoxz-ai avatar luoxz-ai commented on June 30, 2024

LuoxzTest.zip

Complete data structure

Exported with maya

@timoconffx , thanks..

from the-forge.

luoxz-ai avatar luoxz-ai commented on June 30, 2024

LuoxzTest-3dsMax.zip

Complete data structure

Exported with 3ds-Max

image

I added keyframes to bone without animation and solved some problems, but there are still some models that have problems.

If the root bone has no animation or no animated bones? The number of bones is incorrect when the animation is running.

Show Bind Sketelal Pose
image

Runtime Sketelal Animation Pose
image

The model exported by blender will also go wrong.

I use Blender for export testing, and the The-Forge importer is also problematic.

anim2

Skeletal animation is the soul of the game, hoping to make it perfect work!

@timoconffx , thanks..

from the-forge.

timoconffx avatar timoconffx commented on June 30, 2024

@myluoxz
You can fix the problem by freezing/applying the transform of your meshes before exporting.

The body and hair mesh both reference "Bip01 Head" and a couple of other bones. The bone offset matrices are stored in mesh local space. Because your meshes are split the bone offset matrix of "Bip01 Head" is different for the body than it is for the hair. Currently the last bone offset that is written to the boneOffsetMatrices vector is taken even if a matrix has already been assigned. Because of this the body was using the bone offset matrix of the hair. This is what is causing the stretching. The problem can be fixed by freezing/applying the transform of your meshes before exporting. Effectively making them use the same local space.

Thank you for helping us figure out this problem. We will try to include a more permanent fix for this problem in our next release.

from the-forge.

luoxz-ai avatar luoxz-ai commented on June 30, 2024

@timoconffx
Thank you very much for your reply.

image
NewAnim2
NewAnim3

Is it because the head is not in the right position?

freezing/applying the transformation of the grid before exporting, Can it be completely correct?

Solve the problem by freezing/applying the transformation of the grid before exporting.

Is this step done in blender? Still doing it in 3DS Max?

How to do it in the blender?

I am not familiar with Blender, ask, in which menu to set the freeze and apply grid transformation, please give a detailed step?

thanks..

from the-forge.

timoconffx avatar timoconffx commented on June 30, 2024

@myluoxz
In the next release of the Forge your issue has been fixed.

For now here are the steps to freeze the transform in Blender:

  1. Open RiggedMesh.fbx in Blender.
  2. Right click the body mesh to select it.
  3. Press Ctrl+A while your cursor is over the viewport to open the apply menu.
  4. Select Location.
  5. Press Ctrl+A again.
  6. Select Rotation & Scale.
  7. Right click in the hair mesh to select it.
  8. Repeat steps 3 to 6.

from the-forge.

luoxz-ai avatar luoxz-ai commented on June 30, 2024

@timoconffx
Thank you very much, it has been perfect for it to work, I look forward to the next version, thank you!!

from the-forge.

wolfgangfengel avatar wolfgangfengel commented on June 30, 2024

This should be fixed. Please let us know.

from the-forge.

wolfgangfengel avatar wolfgangfengel commented on June 30, 2024

@myluoxz can you confirm it works for you? In that case, I would close this issue.

from the-forge.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.