name changes

CURA-10685
This commit is contained in:
saumya.jain 2023-08-25 15:46:30 +02:00
parent 2c6e3fb813
commit ab8b7c3ab5
4 changed files with 6 additions and 6 deletions

View file

@ -409,7 +409,7 @@ class CuraApplication(QtApplication):
SettingFunction.registerOperator("extruderValue", self._cura_formula_functions.getValueInExtruder)
SettingFunction.registerOperator("extruderValues", self._cura_formula_functions.getValuesInAllExtruders)
SettingFunction.registerOperator("anyExtruderNrWithOrDefault", self._cura_formula_functions.getAnyExtruderPositionWithOrDefault)
SettingFunction.registerOperator("anyExtruderWithMaterial", self._cura_formula_functions.getExtruderPositionWithMaterial)
SettingFunction.registerOperator("resolveOrValue", self._cura_formula_functions.getResolveOrValue)
SettingFunction.registerOperator("defaultExtruderPosition", self._cura_formula_functions.getDefaultExtruderPosition)
SettingFunction.registerOperator("valueFromContainer", self._cura_formula_functions.getValueFromContainerAtIndex)

View file

@ -97,14 +97,14 @@ class CuraFormulaFunctions:
return result
# Get the first extruder that adheres to a specific (boolean) property, like 'material_is_support_material'.
def getAnyExtruderPositionWithOrDefault(self, filter_key: str,
# Get the first extruder with material that adheres to a specific (boolean) property, like 'material_is_support_material'.
def getExtruderPositionWithMaterial(self, filter_key: str,
context: Optional["PropertyEvaluationContext"] = None) -> str:
for extruder in self._getActiveExtruders(context):
material_container = extruder.material
value = material_container.getProperty(filter_key, "value", context)
if value is not None:
return extruder.position
return str(extruder.position)
return self.getDefaultExtruderPosition()
# Get the resolve value or value for a given key.

View file

@ -54,7 +54,7 @@ There are also a few extra things that can be used in these expressions:
* The function `extruderValue(extruder, key)` will evaluate a particular setting for a particular extruder.
* The function `resolveOrValue(key)` will perform the full setting evaluation as described in this document for the current context (so if this setting is being evaluated for the second extruder it would perform it as if coming from the second extruder).
* The function `defaultExtruderPosition()` will get the first extruder that is not disabled. For instance, if a printer has three extruders but the first is disabled, this would return `1` to indicate the second extruder (0-indexed).
* The function `anyExtruderNrWithOrDefault(key)` will filter the list of extruders on the key, and then give the first index for which it is true, or if none of them are, the default one as specified by the 'default extruder position' function above.
* The function `anyExtruderWithMaterial(key)` will filter the list of extruders on the key of material quality, and then give the first index for which it is true, or if none of them are, the default one as specified by the 'default extruder position' function above.
* The function `valueFromContainer(key, index)` will get a setting value from the global stack, but skip the first few containers in that stack. It will skip until it reaches a particular index in the container stack.
* The function `extruderValueFromContainer(key, index)` will get a setting value from the current extruder stack, but skip the first few containers in that stack. It will skip until it reaches a particular index in the container stack.

View file

@ -4500,7 +4500,7 @@
"type": "extruder",
"default_value": "0",
"enabled": "(support_enable or support_meshes_present) and extruders_enabled_count > 1",
"value": "int(anyExtruderNrWithOrDefault('material_is_support_material'))",
"value": "int(anyExtruderWithMaterial('material_is_support_material'))",
"settable_per_mesh": false,
"settable_per_extruder": false,
"children":