public void setKeyframe(float frame)
        {
            CodeBehind.ShapeEditor.ShapeEdSeqSlider    ShapeEdSeqSlider    = "ShapeEdSeqSlider";
            CodeBehind.ShapeEditor.ShapeEdThreadSlider ShapeEdThreadSlider = "ShapeEdThreadSlider";
            CodeBehind.ShapeEditor ShapeEditor = "ShapeEditor";
            CodeBehind.ShapeEditor.ShapeEdShapeView    ShapeEdShapeView    = "ShapeEdShapeView";
            CodeBehind.ShapeEditor.ShapeEdThreadWindow ShapeEdThreadWindow = "ShapeEdThreadWindow";
            GuiPopUpMenuCtrl transitionTo = ShapeEdThreadWindow.FOT("transitionTo");

            ShapeEdSeqSlider.setValue(frame, true);
            if (transitionTo.getText() == "synched position")
            {
                ShapeEdThreadSlider.setValue(frame, true);
            }

            // Update the position of the active thread => if outside the in/out range,
            // need to switch to the proxy sequence
            if (!this.usingProxySeq)
            {
                if ((frame < this.seqStartFrame) || (frame > this.seqEndFrame))
                {
                    this.usingProxySeq = true;
                    string proxyName = ShapeEditor.getProxyName(ShapeEdShapeView.getThreadSequence());
                    ShapeEdShapeView.setThreadSequence(proxyName, 0, 0, false);
                }
            }

            ShapeEdShapeView["threadPos"] = this.keyframeToThreadPos(frame).AsString();
        }
        public void setSequence(string seqName)
        {
            CodeBehind.ShapeEditor.ShapeEdThreadWindow ShapeEdThreadWindow = "ShapeEdThreadWindow";
            GuiCheckBoxCtrl  useTransitions   = ShapeEdThreadWindow.FOT("useTransitions");
            GuiTextEditCtrl  transitionTime   = ShapeEdThreadWindow.FOT("transitionTime");
            GuiPopUpMenuCtrl transitionTo     = ShapeEdThreadWindow.FOT("transitionTo");
            GuiPopUpMenuCtrl transitionTarget = ShapeEdThreadWindow.FOT("transitionTarget");

            CodeBehind.ShapeEditor.ShapeEdThreadSlider ShapeEdThreadSlider = "ShapeEdThreadSlider";
            CodeBehind.ShapeEditor.ShapeEdShapeView    ShapeEdShapeView    = "ShapeEdShapeView";
            CodeBehind.ShapeEditor ShapeEditor = "ShapeEditor";

            float transPos;
            float transTime;
            bool  transPlay;

            this.usingProxySeq = false;

            if (useTransitions.getValue().AsBool())
            {
                transTime = transitionTime.getText().AsFloat();
                if (transitionTo.getText() == "synched position")
                {
                    transPos = -1;
                }
                else
                {
                    transPos = this.keyframeToThreadPos(ShapeEdThreadSlider.getValue());
                }
                transPlay = (transitionTarget.getText() == "plays during transition");
            }
            else
            {
                transTime = 0;
                transPos  = 0;
                transPlay = false;
            }

            // No transition when sequence is not changing
            if (seqName == ShapeEdShapeView.getThreadSequence())
            {
                transTime = 0;
            }

            if (seqName != "")
            {
                // To be able to effectively scrub through the animation, we need to have all
                // frames available, even if it was added with only a subset. If that is the
                // case, then create a proxy sequence that has all the frames instead.
                string sourceData = ShapeEditor.getSequenceSource(seqName);
                string from       = Util.rtrim(Util.getFields(sourceData, 0, 1));
                int    startFrame = Util.getField(sourceData, 2).AsInt();
                int    endFrame   = Util.getField(sourceData, 3).AsInt();
                int    frameCount = Util.getField(sourceData, 4).AsInt();

                if ((startFrame != 0) || (endFrame != (frameCount - 1)))
                {
                    string proxyName = ShapeEditor.getProxyName(seqName);
                    if (ShapeEditor.shape.getSequenceIndex(proxyName) != -1)
                    {
                        ShapeEditor.shape.removeSequence(proxyName);
                        ShapeEdShapeView.refreshThreadSequences();
                    }
                    ShapeEditor.shape.addSequence(from, proxyName);

                    // Limit the transition position to the in/out range
                    transPos = Util.mClamp(transPos, 0, 1);
                }
            }

            ShapeEdShapeView.setThreadSequence(seqName, transTime, transPos, transPlay);
        }