mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-14 05:35:58 +08:00
Simplify the _shouldResolve function
This increases the speed of the setting resolvement.
This commit is contained in:
parent
1374c2faa9
commit
9a0264644b
@ -256,8 +256,6 @@ class GlobalStack(CuraContainerStack):
|
|||||||
|
|
||||||
raise Exceptions.InvalidOperationError("Global stack cannot have a next stack!")
|
raise Exceptions.InvalidOperationError("Global stack cannot have a next stack!")
|
||||||
|
|
||||||
# protected:
|
|
||||||
|
|
||||||
# Determine whether or not we should try to get the "resolve" property instead of the
|
# Determine whether or not we should try to get the "resolve" property instead of the
|
||||||
# requested property.
|
# requested property.
|
||||||
def _shouldResolve(self, key: str, property_name: str, context: Optional[PropertyEvaluationContext] = None) -> bool:
|
def _shouldResolve(self, key: str, property_name: str, context: Optional[PropertyEvaluationContext] = None) -> bool:
|
||||||
@ -273,10 +271,8 @@ class GlobalStack(CuraContainerStack):
|
|||||||
# track all settings that are being resolved.
|
# track all settings that are being resolved.
|
||||||
return False
|
return False
|
||||||
|
|
||||||
setting_state = super().getProperty(key, "state", context = context)
|
if self.hasUserValue(key):
|
||||||
if setting_state is not None and setting_state != InstanceState.Default:
|
# When the user has explicitly set a value, we should ignore any resolve and just return that value.
|
||||||
# When the user has explicitly set a value, we should ignore any resolve and
|
|
||||||
# just return that value.
|
|
||||||
return False
|
return False
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
Loading…
x
Reference in New Issue
Block a user