Ejemplo n.º 1
0
        public bool SaveAnimation(MeshAnimator meshanim)
        {
            String name = AnimName;
            bool   rc;
            Engine simroot;
            Engine oldroot;

            if (meshanim == null)
            {
                return(false);
            }
            if (BaseName != null)
            {
                name += "_" + BaseName;
            }
            oldroot = meshanim.Parent();
            meshanim.Remove(false);
            simroot      = new Engine();
            simroot.Name = name + ".simroot";
            meshanim.Stop();
            meshanim.Disable(MeshAnimator.RECORD, Engine.CONTROL_CHILDREN);
            simroot.Append(meshanim);
            rc = SharedWorld.Get().SaveAsVix(simroot, name + ".vix");
            if (!rc)
            {
                SharedWorld.LogError("Cannot save cloth animations " + name + ".vix");
            }
            meshanim.Remove(false);
            oldroot.Append(meshanim);
            return(rc);
        }
Ejemplo n.º 2
0
        public void Record(bool record)
        {
            Scene        scene    = SharedWorld.MainScene;
            MeshAnimator animroot = _meshAnimRoot;

            if (animroot != null)
            {
                animroot.Stop();
                if (record)
                {
                    if (TimeInc > 0)
                    {
                        scene.TimeInc = TimeInc;
                    }
                    animroot.Enable(MeshAnimator.RECORD);
                }
                else
                {
                    animroot.Disable(MeshAnimator.RECORD);
                    scene.TimeInc = 0.0f;
                }
            }
        }