mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2025-01-31 12:50:52 +00:00
OBJ Exporter: fixed a crash when trying to export geometry with missing textures
This commit is contained in:
parent
c333501f34
commit
6705f261a6
1 changed files with 12 additions and 5 deletions
|
@ -106,6 +106,9 @@ namespace CodeImp.DoomBuilder.BuilderModes.IO
|
||||||
Obj = string.Empty;
|
Obj = string.Empty;
|
||||||
Textures = null;
|
Textures = null;
|
||||||
Flats = null;
|
Flats = null;
|
||||||
|
|
||||||
|
if (ExportForGZDoom)
|
||||||
|
SkipTextures.Add("-");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -393,7 +396,7 @@ namespace CodeImp.DoomBuilder.BuilderModes.IO
|
||||||
}
|
}
|
||||||
|
|
||||||
//sort geometry
|
//sort geometry
|
||||||
List<Dictionary<string, List<WorldVertex[]>>> geometryByTexture = SortGeometry(visualSectors, data.SkipTextures);
|
List<Dictionary<string, List<WorldVertex[]>>> geometryByTexture = SortGeometry(visualSectors, data.SkipTextures, !data.ExportForGZDoom);
|
||||||
|
|
||||||
//restore vm settings
|
//restore vm settings
|
||||||
if(renderingEffectsDisabled) mode.ToggleEnhancedRendering();
|
if(renderingEffectsDisabled) mode.ToggleEnhancedRendering();
|
||||||
|
@ -427,14 +430,18 @@ namespace CodeImp.DoomBuilder.BuilderModes.IO
|
||||||
data.Valid = true;
|
data.Valid = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static List<Dictionary<string, List<WorldVertex[]>>> SortGeometry(List<BaseVisualSector> visualSectors, List<string>skipTextures)
|
private static List<Dictionary<string, List<WorldVertex[]>>> SortGeometry(List<BaseVisualSector> visualSectors, List<string>skipTextures, bool defaultOnMissingTextures)
|
||||||
{
|
{
|
||||||
var texturegeo = new Dictionary<string, List<WorldVertex[]>>(StringComparer.Ordinal);
|
var texturegeo = new Dictionary<string, List<WorldVertex[]>>(StringComparer.Ordinal);
|
||||||
//texturegeo.Add(DEFAULT, new List<WorldVertex[]>());
|
|
||||||
var flatgeo = new Dictionary<string, List<WorldVertex[]>>(StringComparer.Ordinal);
|
var flatgeo = new Dictionary<string, List<WorldVertex[]>>(StringComparer.Ordinal);
|
||||||
//flatgeo.Add(DEFAULT, new List<WorldVertex[]>());
|
|
||||||
|
|
||||||
foreach(BaseVisualSector vs in visualSectors)
|
if (defaultOnMissingTextures)
|
||||||
|
{
|
||||||
|
texturegeo.Add(DEFAULT, new List<WorldVertex[]>());
|
||||||
|
flatgeo.Add(DEFAULT, new List<WorldVertex[]>());
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (BaseVisualSector vs in visualSectors)
|
||||||
{
|
{
|
||||||
//floor
|
//floor
|
||||||
string texture;
|
string texture;
|
||||||
|
|
Loading…
Reference in a new issue