Put back getAnyExtruderPositionWithOrDefault api function

CURA-10685
This commit is contained in:
c.lamboo 2023-08-29 14:11:36 +02:00
parent ef4665a55f
commit 6e045e8b37
3 changed files with 14 additions and 0 deletions

View file

@ -97,6 +97,15 @@ 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,
context: Optional["PropertyEvaluationContext"] = None) -> str:
for extruder in self._getActiveExtruders(context):
value = extruder.getRawProperty(filter_key, "value", context=context)
if value is None or not value:
continue
return str(extruder.position)
# 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: