diff --git a/src/Mod/Material/MaterialEditor.py b/src/Mod/Material/MaterialEditor.py index 8a1e671b8bea..496d46126716 100644 --- a/src/Mod/Material/MaterialEditor.py +++ b/src/Mod/Material/MaterialEditor.py @@ -235,7 +235,11 @@ def getDict(self): for i2 in range(w.childCount()): c = w.child(i2) # TODO the following should be translated back to english,since text(0) could be translated - d[self.collapseKey(str(c.text(0)))] = unicode(c.text(1)) + matkey = self.collapseKey(str(c.text(0))) + matvalue = unicode(c.text(1)) + if matvalue or (matkey == 'Name'): + # use only keys which are not empty and the name even if empty + d[matkey] = matvalue return d diff --git a/src/Mod/Material/importFCMat.py b/src/Mod/Material/importFCMat.py index f12a77b72fab..2c0b290be2ad 100644 --- a/src/Mod/Material/importFCMat.py +++ b/src/Mod/Material/importFCMat.py @@ -144,7 +144,8 @@ def write(filename,dictionary): # if the section has no contents, we don't write it f.write("[" + s["keyname"] + "]\n") for k,i in s.iteritems(): - if k != "keyname": + if (k != "keyname" and i != '') or k == "Name": + # use only keys which are not empty and the name even if empty f.write(k + "=" + i.encode('utf-8') + "\n") f.write("\n") f.close()