Skip to content

Commit 7b91198

Browse files
authored
Treat checkbox-driven uniforms as bool in Viewer (AcademySoftwareFoundation#2437) (AcademySoftwareFoundation#2463)
This PR seeks to address AcademySoftwareFoundation#2437, wherein toggling a checkbox off and on in the Property Editor causes the corresponding uniform to stop updating, remaining in the "off" state indefinitely thereafter. The proposed fix is to pass the value of the checkbox to shaders as a bool rather than a float. Tested in MaterialXView on macOS 15.5 (OpenGL and Metal rendering paths).
1 parent 9754e6a commit 7b91198

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

source/MaterialXView/Editor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ void PropertyEditor::addItemToForm(const mx::UIPropertyItem& item, const std::st
303303
mx::MaterialPtr material = viewer->getSelectedMaterial();
304304
if (material)
305305
{
306-
material->modifyUniform(path, mx::Value::createValue((float) v));
306+
material->modifyUniform(path, mx::Value::createValue((bool) v));
307307
}
308308
});
309309
}

0 commit comments

Comments
 (0)