Skip to content

Commit

Permalink
Fixed saving project when no mtl file is present for an obj
Browse files Browse the repository at this point in the history
  • Loading branch information
TomSimons committed Jan 6, 2025
1 parent fda6d88 commit 938cbc0
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions Assets/_Functionalities/ObjImporter/Scripts/OBJPropertyData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,25 +27,33 @@ public Uri ObjFile
OnObjUriChanged.Invoke(value);
}
}

[JsonIgnore]
public Uri MtlFile
{
get => mtlFile;
set
{
mtlFile= value;
mtlFile = value;
OnMtlUriChanged.Invoke(value);
}
}

public IEnumerable<LayerAsset> GetAssets()
{
return new List<LayerAsset>()
var existingAssets = new List<LayerAsset>();

if (objFile != null)
{
new (this, objFile != null ? objFile : null),
new (this, mtlFile != null ? mtlFile : null)
};
existingAssets.Add(new(this, objFile));
}

if (mtlFile != null)
{
existingAssets.Add(new(this, mtlFile));
}

return existingAssets;
}
}
}
}

0 comments on commit 938cbc0

Please sign in to comment.