Skip to content

Commit

Permalink
Merge pull request #14 from jrz371/MaterialCrash
Browse files Browse the repository at this point in the history
Fixes crash when getting material if none has been assigned
  • Loading branch information
Doerge authored Jan 9, 2021
2 parents 04134e5 + 4bb47be commit 6d2ab4f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion glTF-BinExporter/glTF/GlTFUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ public static Rhino.Geometry.Mesh[] GetMeshes(RhinoObject rhinoObject) {
foreach (var rhinoObject in rhinoObjects)
{
// FIXME: This is broken. Even though objects use the same material, different Materials are returned here.
var renderMatId = rhinoObject.RenderMaterial.Id;
var mat = rhinoObject.GetMaterial(true);
var renderMatId = mat.Id;
bool isPBR = mat.IsPhysicallyBased;

// This is always true when called from the Main plugin command, as it uses the same ObjectType array as filter.
Expand Down

0 comments on commit 6d2ab4f

Please sign in to comment.