diff --git a/meshroom/core/desc/attribute.py b/meshroom/core/desc/attribute.py index f58ba70632..434d39e731 100644 --- a/meshroom/core/desc/attribute.py +++ b/meshroom/core/desc/attribute.py @@ -341,7 +341,7 @@ def __init__(self, name, label, description, value, range=None, group="allParams self._valueType = int def validateValue(self, value): - if value is None or isinstance(value, str): + if value is None: return value # Handle unsigned int values that are translated to int by shiboken and may overflow try: @@ -371,7 +371,7 @@ def __init__(self, name, label, description, value, range=None, group="allParams self._valueType = float def validateValue(self, value): - if value is None or isinstance(value, str): + if value is None: return value try: return float(value) diff --git a/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml b/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml index 2dc2d3be78..96247f1e99 100644 --- a/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml +++ b/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml @@ -260,8 +260,7 @@ RowLayout { case "IntParam": case "FloatParam": // We don't set a number because we want to keep the invalid expression - // _reconstruction.setAttribute(root.attribute, Number(value)) - _reconstruction.setAttribute(root.attribute, value) + _reconstruction.setAttribute(root.attribute, Number(value)) updateAttributeLabel() break case "File": @@ -623,15 +622,11 @@ RowLayout { isInt: attribute.type === "FloatParam" ? false : true onEditingFinished: { - if (hasExprError) - setTextFieldAttribute(expressionTextField.text) // On the undo stack we keep the expression - else + if (!hasExprError) setTextFieldAttribute(expressionTextField.evaluatedValue) } onAccepted: { - if (hasExprError) - setTextFieldAttribute(expressionTextField.text) // On the undo stack we keep the expression - else + if (!hasExprError) setTextFieldAttribute(expressionTextField.evaluatedValue) // When the text is too long, display the left part // (with the most important values and cut the floating point details) @@ -640,9 +635,7 @@ RowLayout { Component.onDestruction: { if (activeFocus) { - if (hasExprError) - setTextFieldAttribute(expressionTextField.text) - else + if (!hasExprError) setTextFieldAttribute(expressionTextField.evaluatedValue) } }