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

Inconsistencies with Anim component. #6390

Open
AdionNn opened this issue May 17, 2024 · 0 comments
Open

Inconsistencies with Anim component. #6390

AdionNn opened this issue May 17, 2024 · 0 comments
Labels
area: animation Animation related issue bug

Comments

@AdionNn
Copy link

AdionNn commented May 17, 2024

Description

Recently I was working with animations and met with various problems. Two of them I was able to isolate and reproduce consistenly.

  1. Adding layer via code seems to overwrite Base layer temporary if no animations are added to anim base layer.

https://playcanvas.com/project/1216249/overview/anim-layer-bug

var upperBodyLayer = this.entity.anim.addLayer(
        'UpperBody',
        this.blend,
        upperBodyMask,
        pc.ANIM_LAYER_ADDITIVE
    );

After adding new layer, logs shows that baseLayer name becomes added layer name. However if you assign any animation to base layer it becomes a mess.

-----------------------BEFORE ASSIGNING ANIMATION----------------------
this.entity.anim.baseLayer.name= : UpperBody
upperBodyLayer.name= : UpperBody
this.entity.anim.findAnimationLayer(`UpperBody`).name = : UpperBody
this.entity.anim.assignAnimation(“ClapAnim”, this.clapAnim.resource);

Animation layers are corrupted after assigning animation via code.

----------------------AFTER ASSIGNING ANIMATION----------------------
this.entity.anim.baseLayer.name= : Base
upperBodyLayer.name= : UpperBody
this.entity.anim.findAnimationLayer(`UpperBody`).name = : Base

That follows transitions not working and other weird behaviors.

  1. Anim component additive layer mode does not work correctly if anim component is not on entity with Render component.
    https://playcanvas.com/project/1215543/overview/breaking-the-rig 1
    If Anim component is on different entity than Render component, then animations in same Base layer works correctly, but if you add another layer and set blend type to additive weird scaling behavior happens. It scales down model in weird proporsions.
    image

  2. There were more problems, but them was on editor and harder to reproduce. Like changing root bone, then trying to create new Mask, sometimes the root bone change is not updated until you create mask, delete mask and create again. Sometimes you need to hcange root bone several times. I was not able to find correct sequence to reproduce these, but layers with mask should be reviewed by someone a bit.

I created forum post about it as well:
https://forum.playcanvas.com/t/confusion-about-animation-blending/35772/9

@mvaligursky mvaligursky added bug area: animation Animation related issue labels May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: animation Animation related issue bug
Projects
None yet
Development

No branches or pull requests

2 participants