Ejemplo n.º 1
0
        // Token: 0x060000C6 RID: 198 RVA: 0x0000DAB4 File Offset: 0x0000BCB4
        public static PmxBaseMorph CreateOffsetObject(PmxMorph.OffsetKind kind)
        {
            PmxBaseMorph result = null;

            switch (kind)
            {
            case PmxMorph.OffsetKind.Group:
            case PmxMorph.OffsetKind.Flip:
                result = new PmxGroupMorph();
                break;

            case PmxMorph.OffsetKind.Vertex:
                result = new PmxVertexMorph();
                break;

            case PmxMorph.OffsetKind.Bone:
                result = new PmxBoneMorph();
                break;

            case PmxMorph.OffsetKind.UV:
            case PmxMorph.OffsetKind.UVA1:
            case PmxMorph.OffsetKind.UVA2:
            case PmxMorph.OffsetKind.UVA3:
            case PmxMorph.OffsetKind.UVA4:
                result = new PmxUVMorph();
                break;

            case PmxMorph.OffsetKind.Material:
                result = new PmxMaterialMorph();
                break;

            case PmxMorph.OffsetKind.Impulse:
                result = new PmxImpulseMorph();
                break;
            }
            return(result);
        }
Ejemplo n.º 2
0
        // Token: 0x060001F6 RID: 502 RVA: 0x00010F20 File Offset: 0x0000F120
        public void FromStreamEx(Stream s, PmxElementFormat f)
        {
            this.Name  = PmxStreamHelper.ReadString(s, f);
            this.NameE = PmxStreamHelper.ReadString(s, f);
            this.Panel = PmxStreamHelper.ReadElement_Int32(s, 1, true);
            this.Kind  = (PmxMorph.OffsetKind)PmxStreamHelper.ReadElement_Int32(s, 1, true);
            int num = PmxStreamHelper.ReadElement_Int32(s, 4, true);

            this.OffsetList.Clear();
            this.OffsetList.Capacity = num;
            for (int i = 0; i < num; i++)
            {
                switch (this.Kind)
                {
                case PmxMorph.OffsetKind.Group:
                case PmxMorph.OffsetKind.Flip:
                {
                    PmxGroupMorph pmxGroupMorph = new PmxGroupMorph();
                    pmxGroupMorph.FromStreamEx(s, f);
                    this.OffsetList.Add(pmxGroupMorph);
                    break;
                }

                case PmxMorph.OffsetKind.Vertex:
                {
                    PmxVertexMorph pmxVertexMorph = new PmxVertexMorph();
                    pmxVertexMorph.FromStreamEx(s, f);
                    this.OffsetList.Add(pmxVertexMorph);
                    break;
                }

                case PmxMorph.OffsetKind.Bone:
                {
                    PmxBoneMorph pmxBoneMorph = new PmxBoneMorph();
                    pmxBoneMorph.FromStreamEx(s, f);
                    this.OffsetList.Add(pmxBoneMorph);
                    break;
                }

                case PmxMorph.OffsetKind.UV:
                case PmxMorph.OffsetKind.UVA1:
                case PmxMorph.OffsetKind.UVA2:
                case PmxMorph.OffsetKind.UVA3:
                case PmxMorph.OffsetKind.UVA4:
                {
                    PmxUVMorph pmxUVMorph = new PmxUVMorph();
                    pmxUVMorph.FromStreamEx(s, f);
                    this.OffsetList.Add(pmxUVMorph);
                    break;
                }

                case PmxMorph.OffsetKind.Material:
                {
                    PmxMaterialMorph pmxMaterialMorph = new PmxMaterialMorph();
                    pmxMaterialMorph.FromStreamEx(s, f);
                    this.OffsetList.Add(pmxMaterialMorph);
                    break;
                }

                case PmxMorph.OffsetKind.Impulse:
                {
                    PmxImpulseMorph pmxImpulseMorph = new PmxImpulseMorph();
                    pmxImpulseMorph.FromStreamEx(s, f);
                    this.OffsetList.Add(pmxImpulseMorph);
                    break;
                }
                }
            }
        }
Ejemplo n.º 3
0
        public void FromStreamEx(Stream s, PmxElementFormat f = null)
        {
            Name  = PmxStreamHelper.ReadString(s, f);
            NameE = PmxStreamHelper.ReadString(s, f);
            Panel = PmxStreamHelper.ReadElement_Int32(s, 1);
            Kind  = (OffsetKind)PmxStreamHelper.ReadElement_Int32(s, 1);
            int num = PmxStreamHelper.ReadElement_Int32(s);

            OffsetList.Clear();
            OffsetList.Capacity = num;
            for (int i = 0; i < num; i++)
            {
                switch (Kind)
                {
                case OffsetKind.Group:
                case OffsetKind.Flip:
                {
                    PmxGroupMorph pmxGroupMorph = new PmxGroupMorph();
                    pmxGroupMorph.FromStreamEx(s, f);
                    OffsetList.Add(pmxGroupMorph);
                    break;
                }

                case OffsetKind.Vertex:
                {
                    PmxVertexMorph pmxVertexMorph = new PmxVertexMorph();
                    pmxVertexMorph.FromStreamEx(s, f);
                    OffsetList.Add(pmxVertexMorph);
                    break;
                }

                case OffsetKind.Bone:
                {
                    PmxBoneMorph pmxBoneMorph = new PmxBoneMorph();
                    pmxBoneMorph.FromStreamEx(s, f);
                    OffsetList.Add(pmxBoneMorph);
                    break;
                }

                case OffsetKind.Impulse:
                {
                    PmxImpulseMorph pmxImpulseMorph = new PmxImpulseMorph();
                    pmxImpulseMorph.FromStreamEx(s, f);
                    OffsetList.Add(pmxImpulseMorph);
                    break;
                }

                case OffsetKind.Material:
                {
                    PmxMaterialMorph pmxMaterialMorph = new PmxMaterialMorph();
                    pmxMaterialMorph.FromStreamEx(s, f);
                    OffsetList.Add(pmxMaterialMorph);
                    break;
                }

                case OffsetKind.UV:
                case OffsetKind.UVA1:
                case OffsetKind.UVA2:
                case OffsetKind.UVA3:
                case OffsetKind.UVA4:
                {
                    PmxUVMorph pmxUVMorph = new PmxUVMorph();
                    pmxUVMorph.FromStreamEx(s, f);
                    OffsetList.Add(pmxUVMorph);
                    break;
                }
                }
            }
            if (f.WithID)
            {
                base.UID = PmxStreamHelper.ReadElement_UInt(s);
                base.CID = PmxStreamHelper.ReadElement_UInt(s);
            }
        }
Ejemplo n.º 4
0
 public void FromPmxBoneMorph(PmxBoneMorph sv)
 {
     FromPmxBaseMorph(sv);
     Translation = sv.Translation;
     Rotaion     = sv.Rotaion;
 }
Ejemplo n.º 5
0
 public PmxBoneMorph(PmxBoneMorph sv)
     : this()
 {
     FromPmxBoneMorph(sv);
 }
Ejemplo n.º 6
0
 // Token: 0x06000112 RID: 274 RVA: 0x0000E8DE File Offset: 0x0000CADE
 public void FromPmxBoneMorph(PmxBoneMorph sv)
 {
     this.Index       = sv.Index;
     this.Translation = sv.Translation;
     this.Rotaion     = sv.Rotaion;
 }