Beispiel #1
0
        private BabylonCamera ExportCameraAnimations(BabylonCamera babylonCamera, IIGameCamera camera, BabylonExporter exporter)
        {
            var animations = new List <BabylonAnimation>();

            int numProps = camera.IPropertyContainer.NumberOfProperties;

            for (int i = 0; i < numProps; ++i)
            {
                IIGameProperty property = camera.IPropertyContainer.GetProperty(i);

                if (property == null)
                {
                    continue;
                }

                IParamDef paramDef     = property.MaxParamBlock2?.GetParamDef(property.ParamID);
                string    propertyName = property.Name.ToUpperInvariant();

                switch (propertyName)
                {
                default:
                    break;
                }
            }

            babylonCamera.animations = animations.ToArray();
            return(babylonCamera);
        }
 internal ParamDef(IParamDef def) { this.def = def; }
Beispiel #3
0
        private BabylonMaterial ExportMaterialAnimations(BabylonMaterial babylonMaterial, IIGameMaterial material, BabylonExporter exporter)
        {
            var animations = new List <BabylonAnimation>();

            int numProps = material.IPropertyContainer.NumberOfProperties;

            for (int i = 0; i < numProps; ++i)
            {
                IIGameProperty property = material.IPropertyContainer.GetProperty(i);

                if (property == null)
                {
                    continue;
                }

                if (!property.IsPropAnimated)
                {
                    continue;
                }

                IParamDef paramDef     = property.MaxParamBlock2?.GetParamDef(property.ParamID);
                string    propertyName = property.Name.ToUpperInvariant();

                switch (propertyName)
                {
                case "BASECOLOR":
                {
                    if (property.IGameControl.GetMaxControl(IGameControlType.Point4).NumKeys > 0)
                    {
                        exporter.ExportColor4Animation(property.Name, animations,
                                                       key => material.IPropertyContainer.GetPoint4Property(property.Name, key).ToArray());
                    }
                    break;
                }

                case "EMISSIVE":
                {
                    if (property.IGameControl.GetMaxControl(IGameControlType.Point3).NumKeys > 0)
                    {
                        exporter.ExportColor3Animation(property.Name, animations,
                                                       key => material.IPropertyContainer.GetPoint3Property(property.Name, key).ToArray());
                    }
                    break;
                }

                case "WIPERANIMSTATE1":
                case "WIPERANIMSTATE2":
                case "WIPERANIMSTATE3":
                case "WIPERANIMSTATE4":
                case "METALLIC":
                case "ROUGHNESS":
                case "UVOFFSETU":
                case "UVOFFSETV":
                case "UVTILINGU":
                case "UVTILINGV":
                case "UVROTATION":
                {
                    if (property.IGameControl.GetMaxControl(IGameControlType.Float).NumKeys > 0)
                    {
                        exporter.ExportFloatAnimation(property.Name, animations,
                                                      key => new[] { material.IPropertyContainer.GetFloatProperty(property.Name, key, 0) });
                    }
                    break;
                }

                default:
                    break;
                }
            }

            babylonMaterial.animations = animations.ToArray();
            return(babylonMaterial);
        }
Beispiel #4
0
 internal ParamDef(IParamDef def)
 {
     this.def = def;
 }