Skip to content

Commit

Permalink
fix: hotfix for the festival MVMF2024 (#155)
Browse files Browse the repository at this point in the history
  • Loading branch information
dalkia authored Nov 19, 2024
1 parent 50978f4 commit aada3ad
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public override PXZModel InstantiateMesh(PiXYZAPI pxz, string entityID, uint par
{
//TODO (Juani) : This is confusing. If you modify the material and it doesnt fail; but it fails on export of modified model, you wont know it
ModifyModelMaterials(modelPath);
ExportModifiedModel(modelPath, lodLevel);
ExportModifiedModel(modelPath, lodLevel, pathHandler.sceneBasePointer.Contains("-66,-56"));
}
catch (Exception e)
{
Expand Down Expand Up @@ -85,7 +85,7 @@ private void SaveModel(ModelRoot model, string modelPath)
model.SaveGLTF(modelPath, new WriteSettings(ValidationMode.Skip));
}

private void ExportModifiedModel(string modelPath, int lodLevel)
private void ExportModifiedModel(string modelPath, int lodLevel, bool forceIgnoreSMR = false)
{
var model = ModelRoot.Load(modelPath, new ReadSettings(ValidationMode.Skip));
var modelRoot = ModelRoot.CreateModel();
Expand All @@ -96,7 +96,7 @@ private void ExportModifiedModel(string modelPath, int lodLevel)
//If we arent, we dont want to throw a SMR to the merge since PiXYZ offers inconsistent results
if (modelLogicalNode.Skin != null)
{
if (lodLevel == 0)
if (lodLevel == 0 && !forceIgnoreSMR)
throw new Exception("Model has a SMR");
else
continue;
Expand Down
4 changes: 3 additions & 1 deletion DCL_PiXYZ/Utils/SceneConversionPathHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ public struct SceneConversionPathHandler
public string ManifestOutputJsonFile;
public string ManifestOutputJsonDirectory;
public string ManifestProjectDirectory;
public string sceneBasePointer;

private readonly string DefaultOutputPath;

Expand All @@ -33,11 +34,12 @@ public SceneConversionPathHandler(bool isDebug, string defaultOutputPath, string
FailFile = "";
PolygonCountFile = "";
FailGLBImporterFile = "";
sceneBasePointer = "";
}

public void SetOutputPath(SceneImporter sceneSceneImporter)
{
string sceneBasePointer = sceneSceneImporter.GetSceneBasePointer();
sceneBasePointer = sceneSceneImporter.GetSceneBasePointer();
DownloadPath = Path.Combine(PXZConstants.RESOURCES_DIRECTORY, sceneBasePointer);
OutputPath = Path.Combine(DefaultOutputPath, sceneBasePointer);
ManifestOutputJsonDirectory = Path.Combine(ManifestProjectDirectory, "output-manifests");
Expand Down

0 comments on commit aada3ad

Please sign in to comment.