Skip to content

Commit 160e6db

Browse files
committed
Fixing color issue with exporter
1 parent 60de94c commit 160e6db

File tree

1 file changed

+9
-4
lines changed
  • exporter/SynthesisFusionAddin/src/Parser/SynthesisParser

1 file changed

+9
-4
lines changed

exporter/SynthesisFusionAddin/src/Parser/SynthesisParser/Materials.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -210,13 +210,16 @@ def getMaterialAppearance(
210210

211211
if matModelType == 0:
212212
baseColor = properties.itemById("opaque_albedo").value
213-
baseColor.opacity = 255
213+
if baseColor:
214+
baseColor.opacity = 255
214215
elif matModelType == 1:
215216
baseColor = properties.itemById("metal_f0").value
216-
baseColor.opacity = 255
217+
if baseColor:
218+
baseColor.opacity = 255
217219
elif matModelType == 2:
218220
baseColor = properties.itemById("layered_diffuse").value
219-
baseColor.opacity = 255
221+
if baseColor:
222+
baseColor.opacity = 255
220223
elif matModelType == 3:
221224
baseColor = properties.itemById("transparent_color").value
222225
transparent_distance = properties.itemById("transparent_distance").value
@@ -228,7 +231,9 @@ def getMaterialAppearance(
228231
opac = 255
229232
elif opac < 0:
230233
opac = 0
231-
baseColor.opacity = int(round(opac))
234+
235+
if baseColor:
236+
baseColor.opacity = int(round(opac))
232237

233238
if baseColor:
234239
color.R = baseColor.red

0 commit comments

Comments
 (0)