public FStaticMaterialLayersParameter(FArchive Ar)
        {
            ParameterInfo  = new FMaterialParameterInfo(Ar);
            bOverride      = Ar.ReadBoolean();
            ExpressionGuid = Ar.Read <FGuid>();

            if (FReleaseObjectVersion.Get(Ar) >= FReleaseObjectVersion.Type.MaterialLayersParameterSerializationRefactor)
            {
                Value = new FMaterialLayersFunctions(Ar);
            }
        }
Example #2
0
        public FStaticParameterSet(FArchive Ar)
        {
            StaticSwitchParameters        = Ar.ReadArray(() => new FStaticSwitchParameter(Ar));
            StaticComponentMaskParameters = Ar.ReadArray(() => new FStaticComponentMaskParameter(Ar));
            TerrainLayerWeightParameters  = Ar.ReadArray(() => new FStaticTerrainLayerWeightParameter(Ar));

            if (FReleaseObjectVersion.Get(Ar) >= FReleaseObjectVersion.Type.MaterialLayersParameterSerializationRefactor)
            {
                MaterialLayersParameters = Ar.ReadArray(() => new FStaticMaterialLayersParameter(Ar));
            }
        }
 public override void Deserialize(FAssetArchive Ar, long validPos)
 {
     base.Deserialize(Ar, validPos);
     ArrayDim      = Ar.Read <int>();
     PropertyFlags = Ar.Read <ulong>();
     RepNotifyFunc = Ar.ReadFName();
     if (FReleaseObjectVersion.Get(Ar) >= FReleaseObjectVersion.Type.PropertiesSerializeRepCondition)
     {
         BlueprintReplicationCondition = (ELifetimeCondition)Ar.Read <byte>();
     }
 }
        public FMeshToMeshVertData(FArchive Ar)
        {
            PositionBaryCoordsAndDist = Ar.Read <FVector4>();
            NormalBaryCoordsAndDist   = Ar.Read <FVector4>();
            TangentBaryCoordsAndDist  = Ar.Read <FVector4>();
            SourceMeshVertIndices     = Ar.ReadArray <short>(4);

            if (FReleaseObjectVersion.Get(Ar) < FReleaseObjectVersion.Type.WeightFMeshToMeshVertData)
            {
                // Old version had "uint32 Padding[2]"
                var discard = Ar.Read <uint>();
                Padding = Ar.Read <uint>();
            }
            else
            {
                // New version has "float Weight and "uint32 Padding"
                Weight  = Ar.Read <float>();
                Padding = Ar.Read <uint>();
            }
        }
        public override void Deserialize(FAssetArchive Ar, long validPos)
        {
            base.Deserialize(Ar, validPos);

            ClusterTree = FReleaseObjectVersion.Get(Ar) < FReleaseObjectVersion.Type.HISMCClusterTreeMigration ? Ar.ReadBulkArray(() => new FClusterNode_DEPRECATED(Ar)) : Ar.ReadBulkArray(() => new FClusterNode(Ar));
        }
Example #6
0
        public FFieldPath(FAssetArchive Ar)
        {
            var pathNum = Ar.Read <int>();

            Path = new List <FName>(pathNum);
            for (int i = 0; i < pathNum; i++)
            {
                Path.Add(Ar.ReadFName());
            }

            // The old serialization format could save 'None' paths, they should be just empty
            if (Path.Count == 1 && Path[0].IsNone)
            {
                Path.Clear();
            }

            if (FFortniteMainBranchObjectVersion.Get(Ar) >= FFortniteMainBranchObjectVersion.Type.FFieldPathOwnerSerialization || FReleaseObjectVersion.Get(Ar) >= FReleaseObjectVersion.Type.FFieldPathOwnerSerialization)
            {
                ResolvedOwner = new FPackageIndex(Ar);
            }
        }
Example #7
0
        public FSkelMeshSection(FAssetArchive Ar) : this()
        {
            var stripDataFlags = Ar.Read <FStripDataFlags>();
            var skelMeshVer    = FSkeletalMeshCustomVersion.Get(Ar);

            MaterialIndex = Ar.Read <short>();

            if (skelMeshVer < FSkeletalMeshCustomVersion.Type.CombineSectionWithChunk)
            {
                Ar.Position += 2; // ChunkIndex
            }
            if (!stripDataFlags.IsDataStrippedForServer())
            {
                BaseIndex    = Ar.Read <int>();
                NumTriangles = Ar.Read <int>();
            }
            if (skelMeshVer < FSkeletalMeshCustomVersion.Type.RemoveTriangleSorting)
            {
                Ar.Position += 1; // TEnumAsByte<ETriangleSortOption>
            }
            if (Ar.Ver >= UE4Version.VER_UE4_APEX_CLOTH)
            {
                if (skelMeshVer < FSkeletalMeshCustomVersion.Type.DeprecateSectionDisabledFlag)
                {
                    bDisabled = Ar.ReadBoolean();
                }
                if (skelMeshVer < FSkeletalMeshCustomVersion.Type.RemoveDuplicatedClothingSections)
                {
                    CorrespondClothSectionIndex = Ar.Read <short>();
                }
            }

            if (Ar.Ver >= UE4Version.VER_UE4_APEX_CLOTH_LOD)
            {
                Ar.Position += 1; // bEnableClothLOD_DEPRECATED
            }
            if (FRecomputeTangentCustomVersion.Get(Ar) >= FRecomputeTangentCustomVersion.Type.RuntimeRecomputeTangent)
            {
                Ar.Position += 4; // bRecomputeTangent
            }
            if (FRecomputeTangentCustomVersion.Get(Ar) >= FRecomputeTangentCustomVersion.Type.RecomputeTangentVertexColorMask)
            {
                Ar.Position += 1; // RecomputeTangentsVertexMaskChannel
            }
            if (FEditorObjectVersion.Get(Ar) >= FEditorObjectVersion.Type.RefactorMeshEditorMaterials)
            {
                bCastShadow = Ar.ReadBoolean();
            }

            HasClothData = false;
            if (skelMeshVer >= FSkeletalMeshCustomVersion.Type.CombineSectionWithChunk)
            {
                if (!stripDataFlags.IsDataStrippedForServer())
                {
                    BaseVertexIndex = Ar.Read <uint>();
                }

                if (!stripDataFlags.IsEditorDataStripped())
                {
                    if (skelMeshVer < FSkeletalMeshCustomVersion.Type.CombineSoftAndRigidVerts)
                    {
                        Ar.ReadArray(() => new FRigidVertex(Ar)); // RigidVertices
                    }
                    SoftVertices = Ar.ReadArray(() => new FSoftVertex(Ar));
                }

                BoneMap = Ar.ReadArray <ushort>();
                if (skelMeshVer >= FSkeletalMeshCustomVersion.Type.SaveNumVertices)
                {
                    NumVertices = Ar.Read <int>();
                }
                if (skelMeshVer < FSkeletalMeshCustomVersion.Type.CombineSoftAndRigidVerts)
                {
                    Ar.Position += 8; // NumRigidVerts, NumSoftVerts
                }
                MaxBoneInfluences = Ar.Read <int>();

                FVector[] physicalMeshVertices, physicalMeshNormals;
                var       clothMappingData = Ar.ReadArray(() => new FApexClothPhysToRenderVertData(Ar));
                if (skelMeshVer < FSkeletalMeshCustomVersion.Type.RemoveDuplicatedClothingSections)
                {
                    physicalMeshVertices = Ar.ReadArray <FVector>();
                    physicalMeshNormals  = Ar.ReadArray <FVector>();
                }

                short clothAssetSubmeshIndex;
                var   correspondClothAssetIndex = Ar.Read <short>();
                if (skelMeshVer < FSkeletalMeshCustomVersion.Type.NewClothingSystemAdded)
                {
                    clothAssetSubmeshIndex = Ar.Read <short>();
                }
                else
                {
                    // UE4.16+
                    Ar.Read <FClothingSectionData>();
                }

                HasClothData = clothMappingData.Length > 0;

                if (FOverlappingVerticesCustomVersion.Get(Ar) >= FOverlappingVerticesCustomVersion.Type.DetectOVerlappingVertices)
                {
                    var size = Ar.Read <int>();
                    var overlappingVertices = new Dictionary <int, int[]>();
                    for (var i = 0; i < size; i++)
                    {
                        overlappingVertices[i] = Ar.ReadArray <int>();
                    }
                }
                if (FReleaseObjectVersion.Get(Ar) >= FReleaseObjectVersion.Type.AddSkeletalMeshSectionDisable)
                {
                    bDisabled = Ar.ReadBoolean();
                }
                if (FSkeletalMeshCustomVersion.Get(Ar) >= FSkeletalMeshCustomVersion.Type.SectionIgnoreByReduceAdded)
                {
                    GenerateUpToLodIndex = Ar.Read <int>();
                }
            }
        }