Skip to content

Commit 17a96cc

Browse files
committed
filter cases when LeBail class is used, which can not have a texture model.
1 parent fab0e95 commit 17a96cc

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

hexrdgui/calibration/wppf_options_dialog.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2024,14 +2024,18 @@ def _copy_texture_figs(self, obj1, obj2):
20242024
if obj1 is None or obj2 is None:
20252025
return
20262026

2027-
for model_key, model1 in obj1.texture_model.items():
2028-
model2 = obj2.texture_model[model_key]
2029-
if model1 is None or model2 is None:
2030-
continue
2027+
if isinstance(obj1, LeBail):
2028+
return
2029+
2030+
if hasattr(obj1, 'texture_model'):
2031+
for model_key, model1 in obj1.texture_model.items():
2032+
model2 = obj2.texture_model[model_key]
2033+
if model1 is None or model2 is None:
2034+
continue
20312035

2032-
if hasattr(model1, 'fig_new'):
2033-
model2.fig_new = model1.fig_new
2034-
model2.ax_new = model1.ax_new
2036+
if hasattr(model1, 'fig_new'):
2037+
model2.fig_new = model1.fig_new
2038+
model2.ax_new = model1.ax_new
20352039

20362040
def clear_texture_data(self):
20372041
obj = self._wppf_object

0 commit comments

Comments
 (0)