jMonkeyEngine / jmonkeyengine

A complete 3-D game development suite written in Java.
http://jmonkeyengine.org
BSD 3-Clause "New" or "Revised" License
3.81k stars 1.12k forks source link

AnimationMask is not dispatched to internal actions #1199

Closed Ali-RS closed 2 years ago

Ali-RS commented 5 years ago

Here in this line https://github.com/jMonkeyEngine/jmonkeyengine/blob/b1db497a0027ae7f142be5c5f2852539196a1d70/jme3-core/src/main/java/com/jme3/anim/AnimComposer.java#L242

where the mask is set to running action in the layer, it does not dispatch the mask to child actions as well. Actually, we can set a mask to each child action separately when we create it but my understanding is the mask is supposed to be provided directly from AnimComposer to the whole action including the chained actions. This means that internal actions can not have a different mask.

If my assumption is true then following method on 'Action' https://github.com/jMonkeyEngine/jmonkeyengine/blob/b1db497a0027ae7f142be5c5f2852539196a1d70/jme3-core/src/main/java/com/jme3/anim/tween/action/Action.java#L54-L56

should be changed to this

this.mask = mask;
for(Action action : actions) {
     action.setMask(mask);
}

I can make a PR if everyone is agree with this change.

Ali-RS commented 2 years ago

Fixed in https://github.com/jMonkeyEngine/jmonkeyengine/pull/1845.