Skip to content

Commit 21342ad

Browse files
committed
add a default value arg to use if we can't find the color
1 parent 4b2a3ce commit 21342ad

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Assets/FbxExporters/Editor/FbxExporter.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -239,13 +239,13 @@ public void ExportTexture (Material unityMaterial, string unityPropName,
239239
/// <summary>
240240
/// Get the color of a material, or grey if we can't find it.
241241
/// </summary>
242-
public FbxDouble3 GetMaterialColor (Material unityMaterial, string unityPropName)
242+
public FbxDouble3? GetMaterialColor (Material unityMaterial, string unityPropName, float defaultValue = 1)
243243
{
244244
if (!unityMaterial) {
245-
return new FbxDouble3(1);
245+
return new FbxDouble3(defaultValue);
246246
}
247247
if (!unityMaterial.HasProperty (unityPropName)) {
248-
return new FbxDouble3(1);
248+
return new FbxDouble3(defaultValue);
249249
}
250250
var unityColor = unityMaterial.GetColor (unityPropName);
251251
return new FbxDouble3 (unityColor.r, unityColor.g, unityColor.b);

0 commit comments

Comments
 (0)