Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
FEM: Use built-in None material if there was no previous material
Adding material was using by default transient None material that
has no properties assigned. If use accepted that type of material
an attempt to write CalculiX input file was ending up with a crash.
Using built-in None material prevents that situation.

Reported-by: wmayer
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
  • Loading branch information
PrzemoF authored and wwmayer committed Apr 17, 2015
1 parent 6437bea commit 3066e6b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Mod/Fem/MechanicalMaterial.py
Expand Up @@ -138,9 +138,12 @@ def __init__(self, obj):
previous_mat_path = self.get_material_path(self.previous_material)
if not previous_mat_path:
print "Previously used material cannot be found in material directories. Using transient material."
self.add_transient_material(self.previous_material)
material_name = self.get_material_name(self.previous_material)
index = self.form.cb_materials.findData(material_name)
if material_name != 'None':
self.add_transient_material(self.previous_material)
index = self.form.cb_materials.findData(material_name)
else:
index = self.form.cb_materials.findText(material_name)
self.chooseMat(index)
else:
index = self.form.cb_materials.findData(previous_mat_path)
Expand Down

0 comments on commit 3066e6b

Please sign in to comment.