Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions hexrdgui/calibration/wppf_options_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -1330,7 +1330,8 @@ def recursively_format_mat(mat, this_config, this_template):
texture_dict = tree_dict.setdefault('Texture', {})
for mat_name in self.textured_materials:
# Look for param names that match
prefix = f'{mat_name}_c_'
mat_name_sanitized = mat_name.replace('-', '_')
prefix = f'{mat_name_sanitized}_c_'
matching_names = [k for k in params if k.startswith(prefix)]
if not matching_names:
continue
Expand Down Expand Up @@ -1839,6 +1840,7 @@ def update_texture_model_gui(self):
self.ui.texture_ell_max.setValue(settings['ell_max'])

self.update_texture_model_enable_states()
self.update_texture_index_label()

def update_texture_model_enable_states(self):
# Determine whether we should disable the model texture
Expand Down Expand Up @@ -1976,7 +1978,7 @@ def polar_extent(self) -> list[float] | None:

@property
def varying_texture_params(self):
for mat_name in self.textured_materials:
for mat_name in self.textured_materials_sanitized:
prefix = f'{mat_name}_c_'
for param in self.params.values():
if param.name.startswith(prefix) and param.vary:
Expand All @@ -1989,7 +1991,10 @@ def varying_texture_and_non_texture_params(self):
if not self.varying_texture_params:
return False

prefixes = [f'{mat_name}_c_' for mat_name in self.textured_materials]
prefixes = [
f'{mat_name}_c_' for mat_name in
self.textured_materials_sanitized
]
for name, param in self.params.items():
if param.vary and not any(name.startswith(x) for x in prefixes):
return True
Expand Down Expand Up @@ -2228,6 +2233,10 @@ def textured_materials(self) -> list[str]:

return list(self.texture_model_kwargs)

@property
def textured_materials_sanitized(self) -> list[str]:
return [name.replace('-', '_') for name in self.textured_materials]

@property
def texture_model_kwargs(self) -> dict[str]:
return self.texture_settings['model_kwargs']
Expand Down
Loading