@Override
    @SuppressWarnings("unchecked")
    public void initEvent(Application app, Cinematic cinematic) {
        super.initEvent(app, cinematic);
        this.cinematic = cinematic;
        if (channel == null) {
            Object s = cinematic.getEventData(MODEL_CHANNELS, model);
            if (s == null) {
                s = new HashMap<Integer, AnimChannel>();
                int numChannels = model.getControl(AnimControl.class).getNumChannels();
                for (int i = 0; i < numChannels; i++) {
                    ((HashMap<Integer, AnimChannel>) s)
                            .put(i, model.getControl(AnimControl.class).getChannel(i));
                }
                cinematic.putEventData(MODEL_CHANNELS, model, s);
            }

            Map<Integer, AnimChannel> map = (Map<Integer, AnimChannel>) s;
            this.channel = map.get(channelIndex);
            if (this.channel == null) {
                if (model == null) {
                    //the model is null we try to find it according to the name
                    //this should occur only when loading an old saved cinematic
                    //otherwise it's an error
                    model = cinematic.getScene().getChild(modelName);
                }
                if (model != null) {
                    if (cinematic.getScene() != null) {
                        Spatial sceneModel = cinematic.getScene().getChild(model.getName());
                        if (sceneModel != null) {
                            Node parent = sceneModel.getParent();
                            parent.detachChild(sceneModel);
                            sceneModel = model;
                            parent.attachChild(sceneModel);
                        } else {
                            cinematic.getScene().attachChild(model);
                        }
                    }

                    channel = model.getControl(AnimControl.class).createChannel();
                    map.put(channelIndex, channel);
                } else {
                    //it's an error
                    throw new UnsupportedOperationException("model should not be null");
                }
            }
        }
    }
creates an animation event

@param model the model on which the animation will be played
@param animationName the name of the animation to play
@param initialDuration the initial duration of the event
@param loopMode the loopMode
@see LoopMode
@param channelIndex the index of the channel default is 0. Events on the
    same channelIndex will use the same channel.
jme3-core/src/main/java/com/jme3/cinematic/events/AnimationEvent.java