예제 #1
0
        public FSmartName(FArchive Ar)
        {
            DisplayName = Ar.ReadFName();
            if (FAnimPhysObjectVersion.Get(Ar) < FAnimPhysObjectVersion.Type.RemoveUIDFromSmartNameSerialize)
            {
                Ar.Read <ushort>(); // TempUID
            }

            // only save if it's editor build and not cooking
            if (FAnimPhysObjectVersion.Get(Ar) < FAnimPhysObjectVersion.Type.SmartNameRefactorForDeterministicCooking)
            {
                Ar.Read <FGuid>(); // TempGUID
            }
        }
예제 #2
0
        public FSmartNameMapping(FArchive Ar)
        {
            var frwObjVer = FFrameworkObjectVersion.Get(Ar);
            var frwAniVer = FAnimPhysObjectVersion.Get(Ar);

            if (frwObjVer >= FFrameworkObjectVersion.Type.SmartNameRefactor)
            {
                if (frwAniVer < FAnimPhysObjectVersion.Type.SmartNameRefactorForDeterministicCooking)
                {
                    var mapLength = Ar.Read <int>();
                    GuidMap = new Dictionary <FName, FGuid>(mapLength);
                    for (var i = 0; i < mapLength; i++)
                    {
                        GuidMap[Ar.ReadFName()] = Ar.Read <FGuid>();
                    }
                }
            }
            else if (Ar.Ver >= UE4Version.VER_UE4_SKELETON_ADD_SMARTNAMES)
            {
                Ar.Read <ushort>();
                var mapLength = Ar.Read <int>();
                UidMap = new Dictionary <ushort, FName>(mapLength);
                for (int i = 0; i < mapLength; i++)
                {
                    UidMap[Ar.Read <ushort>()] = Ar.ReadFName();
                }
            }

            if (frwObjVer >= FFrameworkObjectVersion.Type.MoveCurveTypesToSkeleton)
            {
                var mapLength = Ar.Read <int>();
                CurveMetaDataMap = new Dictionary <FName, FCurveMetaData>(mapLength);
                for (var i = 0; i < mapLength; i++)
                {
                    CurveMetaDataMap[Ar.ReadFName()] = new FCurveMetaData(Ar, frwAniVer);
                }
            }
        }