Commit 5a4e5e91 authored by Andrey Filippov's avatar Andrey Filippov

minor bug fix, related to previous changes

parent 01577f6c
...@@ -999,9 +999,12 @@ def prepareX3dExport(freecadObjects, fname=""): ...@@ -999,9 +999,12 @@ def prepareX3dExport(freecadObjects, fname=""):
if (not o.ViewObject) or (o.ViewObject.Visibility): if (not o.ViewObject) or (o.ViewObject.Visibility):
if hasattr(o, "Shape"): if hasattr(o, "Shape"):
color_set=set() color_set=set()
if o.ViewObject: try:
for clr in o.ViewObject.DiffuseColor: dc = o.ViewObject.DiffuseColor
color_set.add(clr) except AttributeError:
for clr in dc:
if (len(color_set)>1): # process multi-color objects if (len(color_set)>1): # process multi-color objects
col_list = list(color_set) col_list = list(color_set)
col_dict={} # index for each color (reverse to list) col_dict={} # index for each color (reverse to list)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment