Пример #1
0
        public override void ExecutePlugin()
        {
            string modelFile = null;

            // when running tests we don't want file selection dialog to pop up.
            if (!TestManager.IsRunning)
            {
                modelFile = @"Models\curtainmedi.V3O"; // default model file
                if (!EditorManager.EngineManager.File_Exists(modelFile))
                {
                    // show a file open dialog to select a model file
                    OpenFileDlg fileDlg = new OpenFileDlg();
                    fileDlg.Caption          = "Selecting the Cloth Model File";
                    fileDlg.Description      = "Please select the cloth model file you want to use and press OK to continue.";
                    fileDlg.InitialDirectory = EditorManager.Project.ProjectDir;
                    fileDlg.Filter           = new string[] { ".model" };
                    if (fileDlg.ShowDialog() != DialogResult.OK)
                    {
                        return;
                    }
                    modelFile = fileDlg.FileName;
                }
            }
            ClothObjectShape shape = new ClothObjectShape("ClothObject", modelFile);

            shape.Position = EditorManager.Scene.CurrentShapeSpawnPosition;
            Layer layer = EditorManager.Scene.ActiveLayer;

            EditorManager.Actions.Add(AddShapeAction.CreateAddShapeAction(shape, layer.ActiveShape, layer, true));
        }
Пример #2
0
        /// <summary>
        /// This function must be overridden, since we have to reset the hotspots
        /// </summary>
        /// <returns></returns>
        public override ShapeBase Clone()
        {
            ClothObjectShape copy = (ClothObjectShape)base.Clone();

            copy._hotSpotGravity      = null;
            copy._hotSpotLightGridOfs = null;
            System.Diagnostics.Debug.Assert(!copy.Selected); // turned off in ShapeBase

            return(copy);
        }
Пример #3
0
        public override void ExecutePlugin()
        {
            string modelFile = null;

              // when running tests we don't want file selection dialog to pop up.
              if (!TestManager.IsRunning)
              {
            modelFile = @"Models\curtainmedi.V3O"; // default model file
            if (!EditorManager.EngineManager.File_Exists(modelFile))
            {
              // show a file open dialog to select a model file
              OpenFileDlg fileDlg = new OpenFileDlg();
              fileDlg.Caption = "Selecting the Cloth Model File";
              fileDlg.Description = "Please select the cloth model file you want to use and press OK to continue.";
              fileDlg.InitialDirectory = EditorManager.Project.ProjectDir;
              fileDlg.Filter = new string[] {".model"};
              if (fileDlg.ShowDialog() != DialogResult.OK)
            return;
              modelFile = fileDlg.FileName;
            }
              }
              ClothObjectShape shape = new ClothObjectShape("ClothObject",modelFile);
              shape.Position = EditorManager.Scene.CurrentShapeSpawnPosition;
              Layer layer = EditorManager.Scene.ActiveLayer;
              EditorManager.Actions.Add(AddShapeAction.CreateAddShapeAction(shape, layer.ActiveShape, layer, true));
        }
Пример #4
0
 public override ShapeBase CreateShapeInstance()
 {
     ClothObjectShape shape = new ClothObjectShape("ClothObject","");
       return shape;
 }
Пример #5
0
        public override ShapeBase CreateShapeInstance()
        {
            ClothObjectShape shape = new ClothObjectShape("ClothObject", "");

            return(shape);
        }