@Override
    public void onAction(String name, boolean isPressed, float tpf) {
        if (name.equals("SWITCH_MASKS") && isPressed) {
            useSingleLayerInfMask = !useSingleLayerInfMask;
            animComposer.removeLayer(idleLayer);
            animComposer.removeLayer(danceLayer);
            
            createAnimMasks();
            playAnimations();
            updateUI();
        }
    }
Tests {@link SingleLayerInfluenceMask}.

The test runs two simultaneous looping actions on separate layers.
<p>
The test <strong>fails</strong> if the visible dancing action does <em>not</em>
loop seamlessly when using SingleLayerInfluenceMasks. Note that the action is
not expected to loop seamlessly when <em>not</em> using
SingleLayerArmatureMasks.
<p>
Press the spacebar to switch between using SingleLayerInfluenceMasks and
masks provided by {@link ArmatureMask}.

@author codex
jme3-examples/src/main/java/jme3test/model/anim/TestSingleLayerInfluenceMask.java