Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is multi layers animation feature supported? #23

Open
ggslayer opened this issue Oct 24, 2023 · 10 comments
Open

Is multi layers animation feature supported? #23

ggslayer opened this issue Oct 24, 2023 · 10 comments

Comments

@ggslayer
Copy link

Hi, In my scene, I have a human fbx model, which have multi animations: "idle" and "mouse open", and "idle" run looped, "mouse open" duration controlled by my program logic, so , I want run animations concurrently, is this multi layers animation feature supported? please give me some advises, thank you!

@NickHardeman
Copy link
Owner

Hello,
Thank you for checking out the add-on.
Transitioning between animations is supported, see https://github.com/NickHardeman/ofxFBX/tree/master/example-AnimTransitions
Do different animations affect different parts of the model with different weights?
If two animations are playing at the same time, ie. "Idle" and "Run looped" and both affect the entire skeleton, what would the skeleton look like? Do you have an image to help illustration what you are trying to achieve.

@ggslayer
Copy link
Author

ggslayer commented Oct 24, 2023

Than you for relay so quick, I saw the transaction, It's useful for me, but my question is not the transaction.
The two animations is not "idle" and "Run looped", is "idle" and "mouse open", In my situation, the human do idle animation looply, concurrently when the human need to speak, I play another animation called "mouse open". this is common usage in digital human scene. In this situation, I think when mouse open, corresponding mouse skeleton is affect by only "mouse open" animation? I'm not sure. In before I done this in 2d digital human app which used a library called spine2d, In which, have a freature called animation track, the deatil is here: https://esotericsoftware.com/spine-applying-animations. I think this can help me to illustration what I want. thank you again

@NickHardeman
Copy link
Owner

Ah, I think I understand. Having certain animations apply to specific skeletons? Currently the animations apply to the entire scene. You could export the two separate meshes with animations from your 3D program of choice and then import separately via ofxFBX to have control over each.

This would be a helpful feature!

@ggslayer
Copy link
Author

" export the two separate meshes with animations from your 3D program and then import them separately", I think there will have problem, because the "mouse" position is moving in the idle animation loaded by ofxFBX instance A, if I play the "mouse open" in another ofxFBX instance B concurrently, I guess the B's "mouse" position is not the same as A's mouse postion ? and will show two mouse on sceen?

@ggslayer
Copy link
Author

I submit the question in of issues again, I want to know if ofAssimpModelLoader can support this?

1 similar comment
@ggslayer
Copy link
Author

I submit the question in of issues again, I want to know if ofAssimpModelLoader can support this?

@ggslayer
Copy link
Author

ggslayer commented Oct 24, 2023 via email

@NickHardeman
Copy link
Owner

Hello, currently ofxAssimpModelLoader does not support this feature. I added the feature request to a discussion about ofxAssimpModelLoader openframeworks/openFrameworks#7722

@NickHardeman
Copy link
Owner

I have been putting my free time towards improving ofxAssimp and can add this feature in the future, but I don't have a timeline of when this might happen. Each node has an update function that can take an animation index. ofxFBX could be modified to store an animation per skeleton and then passed to each node.

ofxFBX/src/ofxFBX.cpp

Lines 321 to 332 in f032fd4

for( auto& node : mAllNodes ) {
if( bUsingKeyframes ) {
if( mAnimTrans.bActive ) {
node->update( mAnimTrans.animIndex1, tFbxAnimTime, mAnimTrans.animIndex2, tFbxAnimTime2, mAnimTrans.percent );
} else {
node->update( animationIndex, tFbxAnimTime );
}
} else {
node->update( animations[animationIndex].fbxCurrentTime, lPose );
}
node->update();
}

@ggslayer
Copy link
Author

ggslayer commented Oct 24, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants