public CubeMapGraphics(AampFile aamp) { foreach (var obj in aamp.RootNode.childParams) { CubeMapObjects.Add(new CubeMapObject(obj)); } }
public void Load(Stream stream) { CanSave = true; IsSaveDialog = IFileInfo != null && IFileInfo.InArchive; aampFile = AampFile.LoadFile(stream); }
static void Main(string[] args) { var aamp = "g3ds_packunslider.bgenv"; AampFile file = AampFile.LoadFile(aamp); GetChildNodes(file.RootNode); ToYaml(file); file.Save("New.aamp"); Console.Read(); }
public AglLightMap(Stream stream) { var aamp = AampFile.LoadFile(stream); LightAreas.Clear(); foreach (var ob in aamp.RootNode.paramObjects) { if (ob.HashString == "lut_param") { //32 curves. for (int i = 0; i < 32; i++) { LUTParameter param = new LUTParameter(); param.Name = ob.GetEntryValue <StringEntry>($"name{i}").ToString(); param.Intensity = GetCurve(ob, $"intensity{i}")[0]; LutTable[i] = param; } } } foreach (var lightAreaParam in aamp.RootNode.childParams) { var lightArea = new LightArea(); LightAreas.Add(lightArea); foreach (var ob in lightAreaParam.paramObjects) { if (ob.HashString == "setting") { lightArea.Settings = new LightSettings(ob); } } foreach (var c in lightAreaParam.childParams) { if (c.HashString == "env_obj_ref_array") { foreach (var childObj in c.paramObjects) { lightArea.Lights.Add(new LightEnvObject(childObj)); } } } } Console.WriteLine(); }
public ShadowGraphics(AampFile aamp) { foreach (var obj in aamp.RootNode.paramObjects) { if (obj.HashString == "4137089673") { ShadowColors = new ShadowColorParams(obj); } else if (obj.HashString.Contains("depth_shadow_parameter_")) { DepthParams.Add(new DepthShadowParams(obj)); } else if (obj.HashString.Contains("static_depth_shadow_parameter")) { StaticDepthShadowParams = new StaticDepthShadowParams(obj); } else if (obj.HashString.Contains("projection_shadow_")) { ProjectionParams.Add(new ProjectionShadowParams(obj)); } } }
public void LoadFile(AampFile aampFile, TreeNode parentNode) { LoadChildNodes(aampFile.RootNode, parentNode); }
public ColorCorrection(AampFile aamp) { //Note this file always has only one object Parent = aamp.RootNode.paramObjects.FirstOrDefault(); }
public EnvironmentGraphics(AampFile aamp) { Root = aamp.RootNode; HemisphereLights.Clear(); FogObjects.Clear(); DirectionalLights.Clear(); BloomObjects.Clear(); SpotLights.Clear(); PointLights.Clear(); foreach (var obj in aamp.RootNode.childParams) { switch (obj.HashString) { case "AmbientLight": break; case "DirectionalLight": foreach (var child in obj.paramObjects) { DirectionalLights.Add(new DirectionalLight(child)); } break; case "HemisphereLight": foreach (var child in obj.paramObjects) { HemisphereLights.Add(new HemisphereLight(child)); } break; case "Fog": foreach (var child in obj.paramObjects) { FogObjects.Add(new Fog(child)); } break; case "BloomObj": foreach (var child in obj.paramObjects) { BloomObjects.Add(new BloomObj(child)); } break; case "PointLightRig": foreach (var child in obj.paramObjects) { PointLights.Add(new PointLightRig(child)); } Console.WriteLine($"PointLights {PointLights.Count}"); break; case "SpotLightRig": foreach (var child in obj.paramObjects) { SpotLights.Add(new SpotLightRig(child)); } Console.WriteLine($"SpotLights {SpotLights.Count}"); break; case "OfxLargeLensFlareRig": foreach (var child in obj.paramObjects) { LensFlareRigs.Add(new OfxLargeLensFlareRig(child)); } break; } } }
static void ToYaml(AampFile file) { string yaml = YamlConverter.ToYaml(file); System.IO.File.WriteAllText("test.yaml", yaml); }
private ColorCorrection LoadColorCorrection(Stream file) { var aamp = AampFile.LoadFile(file); return(new ColorCorrection(aamp)); }
private CubeMapGraphics LoadCubemapGraphics(Stream file) { var aamp = AampFile.LoadFile(file); return(new CubeMapGraphics(aamp)); }
private ShadowGraphics LoadShadowGraphics(Stream file) { var aamp = AampFile.LoadFile(file); return(new ShadowGraphics(aamp)); }
private EnvironmentGraphics LoadEnvironmentGraphics(Stream file) { var aamp = AampFile.LoadFile(file); return(new EnvironmentGraphics(aamp)); }
private void LoadParameters(AampFile aamp) { if (aamp.EffectType == "Probe Data") { probeLightingConfig = new ProbeLighting(); viewport.AddDrawable(probeLightingConfig); var probeRoot = new ProbeLightingWrapper(probeLightingConfig); treeView1.Nodes.Add(probeRoot); uint index = 0; foreach (var val in aamp.RootNode.childParams) { var entry = new ProbeLighting.Entry(); entry.Index = index++; probeLightingConfig.Entries.Add(entry); probeRoot.Nodes.Add(new ProbeLightingEntryWrapper(entry)); foreach (var param in val.paramObjects) { switch (param.HashString) { case "param_obj": foreach (var data in param.paramEntries) { if (data.HashString == "index") { entry.Index = (uint)data.Value; } if (data.HashString == "type") { entry.Type = (uint)data.Value; } } break; case "grid": entry.Grid = LoadGridData(param.paramEntries); break; case "sh_index_buffer": LoadIndexBuffer(param.paramEntries, entry); break; case "sh_data_buffer": LoadDataBuffer(param.paramEntries, entry); break; } } } aamp.Save($"{CourseFolder}/DEBUG_PROBE.aamp"); foreach (var entry in probeLightingConfig.Entries) { Console.WriteLine(entry.Name); Console.WriteLine($"IndexType {entry.IndexType}"); Console.WriteLine($"DataType {entry.DataType}"); Console.WriteLine($"MaxIndexNum {entry.MaxIndexNum}"); Console.WriteLine($"UsedIndexNum {entry.UsedIndexNum}"); Console.WriteLine($"MaxShDataNum {entry.MaxShDataNum}"); Console.WriteLine($"UsedShDataNum {entry.UsedShDataNum}"); Console.WriteLine($"AABB_Max_Position {entry.Grid.AABB_Max_Position}"); Console.WriteLine($"AABB_Min_Position {entry.Grid.AABB_Min_Position}"); Console.WriteLine($"Voxel_Step_Position {entry.Grid.Voxel_Step_Position}"); Console.WriteLine($"DataBuffer {entry.DataBuffer.Length}"); Console.WriteLine($"IndexBuffer {entry.IndexBuffer.Length}"); } } }
public static void Prepare(byte[] fileData) { ProbeLighting = new ProbeLighting(); ProbeLighting.LoadValues(AampFile.LoadFile(new System.IO.MemoryStream(fileData))); }
public void LoadValues(AampFile aamp) { Params = new ProbeParams(); foreach (var val in aamp.RootNode.paramObjects) { if (val.HashString == "root_grid") { RootGrid = LoadGridData(val.paramEntries); } if (val.HashString == "param_obj") { foreach (var param in val.paramEntries) { if (param.HashString == "version") { Params.Version = (uint)param.Value; } if (param.HashString == "dir_light_indirect") { Params.IndirectDirectionLight = (float)param.Value; } if (param.HashString == "point_light_indirect") { Params.IndirectPointLight = (float)param.Value; } if (param.HashString == "spot_light_indirect") { Params.IndirectSpotLight = (float)param.Value; } if (param.HashString == "emission_scale") { Params.EmissionScale = (float)param.Value; } } } } foreach (var val in aamp.RootNode.childParams) { ProbeVolume box = new ProbeVolume(); Boxes.Add(box); foreach (var param in val.paramObjects) { if (param.HashString == "grid") { box.Grid = LoadGridData(param.paramEntries); } if (param.HashString == "param_obj") { foreach (var p in param.paramEntries) { if (p.HashString == "index") { box.Index = (uint)p.Value; } if (p.HashString == "type") { box.Type = (uint)p.Value; } } } if (param.HashString == "sh_data_buffer") { box.DataBuffer = LoadDataBuffer(param.paramEntries); } if (param.HashString == "sh_index_buffer") { box.IndexBuffer = LoadIndexBuffer(param.paramEntries); } } } }