예제 #1
0
        /// <summary>
        /// Can this texture be randomized?
        /// </summary>
        /// <param name="export"></param>
        /// <returns></returns>
        private static bool CanRandomize(ExportEntry export, out string instancedFullPath)
        {
            instancedFullPath = null;
            if (export.IsDefaultObject || !export.IsTexture())
            {
                return(false);
            }
            var fpath = instancedFullPath = export.InstancedFullPath;

            return(ActiveBuilder != null && ActiveBuilder.TextureRandomizations.Any(x => x.TextureInstancedFullPath == fpath));
        }
예제 #2
0
        public static ObjectBinary ConvertPostPropBinary(ExportEntry export, MEGame newGame, PropertyCollection newProps)
        {
            if (export.propsEnd() == export.DataSize)
            {
                return(Array.Empty <byte>());
            }

            if (export.IsTexture())
            {
                return(ConvertTexture2D(export, newGame));
            }

            if (From(export) is ObjectBinary objbin)
            {
                if (objbin is AnimSequence animSeq)
                {
                    animSeq.UpdateProps(newProps, newGame);
                }
                return(objbin);
            }

            switch (export.ClassName)
            {
            case "DirectionalLightComponent":
            case "PointLightComponent":
            case "SkyLightComponent":
            case "SphericalHarmonicLightComponent":
            case "SpotLightComponent":
            case "DominantSpotLightComponent":
            case "DominantPointLightComponent":
            case "DominantDirectionalLightComponent":
                if (newGame == MEGame.UDK)
                {
                    return(Array.Empty <byte>());
                }
                else if (export.Game == MEGame.UDK && newGame != MEGame.UDK)
                {
                    return(new byte[8]);
                }
                break;
            }

            //no conversion neccesary
            return(export.GetBinaryData());
        }
예제 #3
0
        public static ObjectBinary ConvertPostPropBinary(ExportEntry export, MEGame newGame)
        {
            if (export.getBinaryData().Length == 0)
            {
                return(new GenericObjectBinary(new byte[0]));
            }

            if (From(export) is ObjectBinary objbin)
            {
                return(objbin);
            }

            if (export.IsTexture())
            {
                return(new GenericObjectBinary(ConvertTexture2D(export, newGame)));
            }

            //no conversion neccesary
            return(new GenericObjectBinary(export.getBinaryData()));
        }
        public static ObjectBinary ConvertPostPropBinary(ExportEntry export, MEGame newGame)
        {
            if (export.getBinaryData().Length == 0)
            {
                return(Array.Empty <byte>());
            }

            if (From(export) is ObjectBinary objbin)
            {
                return(objbin);
            }

            if (export.IsTexture())
            {
                return(ConvertTexture2D(export, newGame));
            }

            switch (export.ClassName)
            {
            case "DirectionalLightComponent":
            case "PointLightComponent":
            case "SkyLightComponent":
            case "SphericalHarmonicLightComponent":
            case "SpotLightComponent":
            case "DominantSpotLightComponent":
            case "DominantPointLightComponent":
            case "DominantDirectionalLightComponent":
                if (newGame == MEGame.UDK)
                {
                    return(Array.Empty <byte>());
                }
                else if (export.Game == MEGame.UDK && newGame != MEGame.UDK)
                {
                    return(new byte[8]);
                }
                break;
            }

            //no conversion neccesary
            return(export.getBinaryData());
        }