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

Animation of the skeleton fitted to mesh animation with only rotation change in each keyframe #20

Open
ArcaneShadow82 opened this issue Apr 2, 2022 · 8 comments

Comments

@ArcaneShadow82
Copy link

Hi,
First, I want to say that I'm very impressed with DemBones solution and its possibilities. I'm wondering if it is possible to obtain the output animation of the RIG with changed only the rotation in the joints (translation would be only applied to the root). From the documentation of the parameters, it is not obvious to me how to achieve this. There is a demLock parameter, but it seems to lock the whole transformation of the joint in the animation.

@binhhuyle
Copy link
Contributor

binhhuyle commented Apr 4, 2022

The solution of Dem Bones (SIGGRAPH Asia 2012 paper) is solving the global transformations and then converting them to joint transformations (with the input hierarchy). As the result, Dem Bones does not preserve the length of the bones (or local joint translations are changed on each keyframe).

At this point, I can suggest a cheat (ugly solution?) to achieve translation lock is undoing the translation update of Dem Bones. It can be done by overwriting the old translation values, either by post scripts or a hack into


(just add something like: lt = lbt.replicate(model.nF, 1); // Assigning translations by copies of the bind pose
and also, need to run with bindUpdate=0)

The cheat above will obviously not minimize the reconstruction error. Logically, implementing optimal translation lock would require the solution in the SIGGRAPH 2014 paper. Dem Bones (current version) does not implement this feature (due to low demand - as my personal observation).

@ArcaneShadow82
Copy link
Author

Thanks for the response! I'll try the ugly hack.
The translation lock feature could be interesting for weights optimization in the animation on character RIGs with fixed bones structure. In Your opinion, how much effort it would be to implement this additional translation lock feature as in SIGGRAPH 2014 paper? I'm potentially interested in contributing to implementing this, but I'm not too familiar with the DemBones code.

@binhhuyle
Copy link
Contributor

Technically, the data structures is ready for adding translation lock so implementation will not be difficult.
If you can help with testing, I think I can do the implementation.
Would be perfect if you could provide me some test cases (failure cases are especially important). However, in a case that you have difficulty with disclosing the assets, it will be nice if you could run the tests and describe the issues.

@huhai463127310
Copy link

The solution of Dem Bones (SIGGRAPH Asia 2012 paper) is solving the global transformations and then converting them to joint transformations (with the input hierarchy). As the result, Dem Bones does not preserve the length of the bones (or local joint translations are changed on each keyframe).

At this point, I can suggest a cheat (ugly solution?) to achieve translation lock is undoing the translation update of Dem Bones. It can be done by overwriting the old translation values, either by post scripts or a hack into

(just add something like: lt = lbt.replicate(model.nF, 1); // Assigning translations by copies of the bind pose
and also, need to run with bindUpdate=0)
The cheat above will obviously not minimize the reconstruction error. Logically, implementing optimal translation lock would require the solution in the SIGGRAPH 2014 paper. Dem Bones (current version) does not implement this feature (due to low demand - as my personal observation).

I meet the same problem. I think the cheat maybe just lock transform when writing fbx file, it would not lock the length of bones when optimization. So the translation and rotation is not we want.

@huhai463127310
Copy link

@binhhuyle I have send a case for you by email. please check your gmail box. And I can help testing your implementation.

@binhhuyle
Copy link
Contributor

The solution of Dem Bones (SIGGRAPH Asia 2012 paper) is solving the global transformations and then converting them to joint transformations (with the input hierarchy). As the result, Dem Bones does not preserve the length of the bones (or local joint translations are changed on each keyframe).
At this point, I can suggest a cheat (ugly solution?) to achieve translation lock is undoing the translation update of Dem Bones. It can be done by overwriting the old translation values, either by post scripts or a hack into

(just add something like: lt = lbt.replicate(model.nF, 1); // Assigning translations by copies of the bind pose
and also, need to run with bindUpdate=0)
The cheat above will obviously not minimize the reconstruction error. Logically, implementing optimal translation lock would require the solution in the SIGGRAPH 2014 paper. Dem Bones (current version) does not implement this feature (due to low demand - as my personal observation).

I meet the same problem. I think the cheat maybe just lock transform when writing fbx file, it would not lock the length of bones when optimization. So the translation and rotation is not we want.

@huhai463127310,

This cheat locks the translate parts of the joints. But as the joints are organized in a hierarchy (skeleton), that is the same as locking bone lengths.

And I have received your email.

@ArcaneShadow82
Copy link
Author

Technically, the data structures is ready for adding translation lock so implementation will not be difficult. If you can help with testing, I think I can do the implementation. Would be perfect if you could provide me some test cases (failure cases are especially important). However, in a case that you have difficulty with disclosing the assets, it will be nice if you could run the tests and describe the issues.

That would be great. I can provide You a synthetic animation with noised rotation angles to test transformation estimation without translation change. This would be helpful?

@MrCairo90
Copy link

Hi.
@binhhuyle - is there any chance to add this feature in the nearest feature?

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

4 participants