Beispiel #1
0
        /// <summary>
        /// Process the Data stored in the passed Stream, and change/replace the passed Gmdc
        /// </summary>
        /// <param name="input">A Stream with the Input Data</param>
        /// <param name="gmdc">The Gmdc that should receive the Data</param>
        /// <param name="animationonly">true, if only the Animation Data should be imported</param>
        public virtual bool Process(System.IO.Stream input, GeometryDataContainer gmdc, bool animationonly)
        {
            animonly = animationonly;

            this.input = new System.IO.StreamReader(input);
            this.gmdc  = gmdc;
            SetUpAnimationData();

            if (gmdc == null || input == null)
            {
                return(false);
            }

            ImportedGroups g = LoadGroups();
            ImportedBones  b = LoadBones();

            if (!animonly)
            {
                if (ValidateImportedGroups(g, b))
                {
                    ChangeGmdc(g, b);
                }
            }
            this.ChangeAnim();

            return(true);
        }
Beispiel #2
0
        /// <summary>
        /// Create the export for the given Groups
        /// </summary>
        /// <param name="gmdc"></param>
        /// <param name="groups"></param>
        /// <returns>The created Stream</returns>
        public System.IO.Stream Process(GeometryDataContainer gmdc, GmdcGroups groups)
        {
            this.gmdc = gmdc;
            LoadGroups(groups);

            return(this.FileContent.BaseStream);
        }
Beispiel #3
0
 /// <summary>
 /// Constructor
 /// </summary>
 public GmdcGroup(GeometryDataContainer parent) : base(parent)
 {
     items1    = new IntArrayList();
     items2    = new IntArrayList();
     name      = "";
     alternate = -1;
 }
Beispiel #4
0
 public GenericMeshImport(Scene scn, GeometryDataContainer gmdc, ElementOrder component)
 {
     eo                  = component;
     this.scn            = scn;
     this.gmdc           = gmdc;
     ClearGroupsOnImport = false;
 }
Beispiel #5
0
 /// <summary>
 /// Create a new Instance
 /// </summary>
 /// <param name="parent">The gmdc that should act as Parent</param>
 public ImportedGroup(GeometryDataContainer parent) : base()
 {
     keeporder  = true;
     group      = new GmdcGroup(parent);
     link       = new GmdcLink(parent);
     elements   = new GmdcElements();
     useinbmesh = false;
 }
Beispiel #6
0
 /// <summary>
 /// Constructor
 /// </summary>
 public GmdcLink(GeometryDataContainer parent) : base(parent)
 {
     items1 = new IntArrayList();
     refs   = new IntArrayList[3];
     for (int i = 0; i < refs.Length; i++)
     {
         refs[i] = new IntArrayList();
     }
 }
Beispiel #7
0
        public bool Process(System.IO.Stream input, GeometryDataContainer gmdc, bool animationonly)
        {
            System.IO.StreamReader       sr  = new StreamReader(input);
            Ambertation.XSI.IO.AsciiFile xsi = Ambertation.XSI.IO.AsciiFile.FromStream(sr, FileName);

            GenericMeshImport gmi = new GenericMeshImport(xsi.ToScene(), gmdc, Component);

            return(gmi.Run());
        }
Beispiel #8
0
        public static bool Execute(ImportedFrameBlocks amb, GeometryDataContainer gmdc)
        {
            ImportJointAnim f = new ImportJointAnim();

            f.cbCorrect.Checked = amb.AuskelCorrection;
            f.ok = false;
            f.cbnames.Items.Clear();
            foreach (AnimationFrameBlock afb in gmdc.LinkedAnimation.Part2)
            {
                f.cbnames.Items.Add(afb);
            }


            f.lv.Items.Clear();
            foreach (ImportedFrameBlock ifb in amb)
            {
                ListViewItem lvi = new ListViewItem();
                lvi.Text = ifb.ImportedName;
                lvi.SubItems.Add(ifb.Action.ToString());
                if (ifb.Target != null)
                {
                    lvi.SubItems.Add(ifb.Target.ToString());
                }
                else
                {
                    lvi.SubItems.Add("---");
                }
                lvi.SubItems.Add(ifb.FrameBlock.FrameCount.ToString());
                lvi.SubItems.Add(ifb.FrameBlock.GetDuration().ToString());
                if (ifb.DiscardZeroFrame)
                {
                    lvi.SubItems.Add("no");
                }
                else
                {
                    lvi.SubItems.Add("yes");
                }

                lvi.ForeColor = ifb.MarkColor;
                lvi.Tag       = ifb;

                if (ifb.Target != null)
                {
                    f.lv.Items.Insert(0, lvi);
                }
                else
                {
                    f.lv.Items.Add(lvi);
                }
            }
            f.ShowDialog();

            amb.AuskelCorrection = f.cbCorrect.Checked;
            return(f.ok);
        }
Beispiel #9
0
        /// <summary>
        /// Create a new Instance
        /// </summary>
        /// <param name="parent">The gmdc that should act as Parent</param>
        public ImportedBone(GeometryDataContainer parent)
        {
            bone       = new GmdcJoint(parent);
            name       = "";
            parentname = "";
            index      = -1;
            action     = GmdcImporterAction.Add;
            sourcepos  = new VectorTransformation(SimPe.Geometry.VectorTransformation.TransformOrder.TranslateRotate);

            scale = (float)(1.0);
        }
Beispiel #10
0
        private void llExport_LinkClicked(object sender, System.Windows.Forms.LinkLabelLinkClickedEventArgs e)
        {
            AnimationMeshBlock ab1  = (AnimationMeshBlock)cbSubMesh.SelectedItem;
            GenericRcol        gmdc = ab1.FindUsedGMDC(ab1.FindDefiningCRES());

            if (gmdc != null)
            {
                GeometryDataContainer gdc = (GeometryDataContainer)gmdc.Blocks[0];
                gdc.LinkedAnimation = ab1;

                fGeometryDataContainer.StartExport(new System.Windows.Forms.SaveFileDialog(), gdc, ".txt", gdc.Groups, (SimPe.Plugin.Gmdc.ElementSorting)fGeometryDataContainer.DefaultSelectedAxisIndex, this.cbCorrect.Checked);
            }
            else
            {
                Helper.ExceptionMessage(new Warning("Unable to Find Model File for \"" + ab1.Name + "\".", "SimPe was not able to Find the Model File that defines the specified Hirarchy. The Animation will not get exported!"));
            }
        }
Beispiel #11
0
 /// <summary>
 /// Constructor
 /// </summary>
 public GmdcLinkBlock(GeometryDataContainer parent)
 {
     this.parent = parent;
 }
Beispiel #12
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="gmdc">The Gmdc File the Export is based on</param>
 /// <param name="groups">The list of Groups you want to export</param>
 /// <remarks><see cref="AbstractGmdcExporter.FileContent"/> will contain the Exported .x File</remarks>
 public GmdcExportToXSI(GeometryDataContainer gmdc, GmdcGroups groups) : base(gmdc, groups)
 {
 }
Beispiel #13
0
 /// <summary>
 /// Create a new Instance
 /// </summary>
 /// <param name="gmdc">The gmdc File you want to use</param>
 /// <param name="groups"></param>
 public AbstractGmdcExporter(GeometryDataContainer gmdc, GmdcGroups groups) : this()
 {
     this.gmdc = gmdc;
     LoadGroups(groups);
 }
Beispiel #14
0
 /// <summary>
 /// Constructor
 /// </summary>
 public GmdcModel(GeometryDataContainer parent) : base(parent)
 {
     transforms = new VectorTransformations();
     names      = new GmdcNamePairs();
     subset     = new GmdcJoint(parent);
 }
Beispiel #15
0
 /// <summary>
 /// Constructor
 /// </summary>
 public GmdcJoint(GeometryDataContainer parent) : base(parent)
 {
     verts = new Vectors3f();
     items = new IntArrayList();
 }
Beispiel #16
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="gmdc">The Gmdc File the Export is based on</param>
 /// <param name="groups">The list of Groups you want to export</param>
 /// <remarks><see cref="AbstractGmdcExporter.FileContent"/> will contain the Exported .txt File</remarks>
 public GmdcExportToMilkShapeAscii(GeometryDataContainer gmdc, GmdcGroups groups) : base(gmdc, groups)
 {
 }
Beispiel #17
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="gmdc">The Gmdc File the Export is based on</param>
 /// <remarks><see cref="AbstractGmdcExporter.FileContent"/> will contain the Exported .txt File</remarks>
 public GmdcExportToMilkShapeAscii(GeometryDataContainer gmdc) : base(gmdc)
 {
 }
Beispiel #18
0
 /// <summary>
 /// Create a new Instance
 /// </summary>
 /// <param name="gmdc">The gmdc File you want to use</param>
 public AbstractGmdcExporter(GeometryDataContainer gmdc) : this(gmdc, gmdc.Groups)
 {
 }
Beispiel #19
0
 /// <summary>
 /// Create a New Instace
 /// </summary>
 public AbstractGmdcExporter()
 {
     this.gmdc  = null;
     this.order = new ElementOrder(ElementSorting.XZY);
     this.cjs   = false;
 }
Beispiel #20
0
 /// <summary>
 /// Create the export for all available Groups
 /// </summary>
 /// <param name="gmdc"></param>
 /// <returns>The created Stream</returns>
 public System.IO.Stream Process(GeometryDataContainer gmdc)
 {
     return(Process(gmdc, gmdc.Groups));
 }
Beispiel #21
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="gmdc">The Gmdc File the Export is based on</param>
 /// <remarks><see cref="AbstractGmdcExporter.FileContent"/> will contain the Exported .x File</remarks>
 public GmdcExportToXSI(GeometryDataContainer gmdc) : base(gmdc)
 {
 }
Beispiel #22
0
 /// <summary>
 /// Constructor
 /// </summary>
 public GmdcElement(GeometryDataContainer parent) : base(parent)
 {
     data  = new GmdcElementValues();
     items = new IntArrayList();
 }