Revert "Ignore per-meshgroup settings in per object stack"

CURA-5767

This reverts commit 54afa799c5.
This commit is contained in:
Lipu Fei 2018-10-30 07:33:55 +01:00
parent 54afa799c5
commit 39158a643c
2 changed files with 2 additions and 18 deletions

View file

@ -5,7 +5,6 @@ from typing import Any, Optional
from UM.Application import Application from UM.Application import Application
from UM.Decorators import override from UM.Decorators import override
from UM.Logger import Logger
from UM.Settings.Interfaces import PropertyEvaluationContext from UM.Settings.Interfaces import PropertyEvaluationContext
from UM.Settings.SettingInstance import InstanceState from UM.Settings.SettingInstance import InstanceState
@ -58,22 +57,7 @@ class PerObjectContainerStack(CuraContainerStack):
return result return result
@override(CuraContainerStack) @override(CuraContainerStack)
def setProperty(self, key: str, property_name: str, property_value: Any, container: "ContainerInterface" = None, set_from_cache: bool = False) -> None: def setNextStack(self, stack: CuraContainerStack) -> None:
application = Application.getInstance()
machine_manager = application.getMachineManager()
global_stack = machine_manager.activeMachine
# Ignore all settable-per-meshgroup settings for now because the current CuraEngine architecture cannot handle
# that correctly. This check is also here is because if an old project file includes per-object settings that
# are settable-per-meshgroup, when it is loaded, we need to filter out those settings.
if not global_stack.getProperty(key, "settable_per_mesh"):
Logger.log("i", "Setting [%s] ignored as a per-object setting because it's not settable-per-mesh.", key)
return
super().setProperty(self, key, property_name, property_value,
container = container, set_from_cache = set_from_cache)
@override(CuraContainerStack)
def setNextStack(self, stack: "CuraContainerStack") -> None:
super().setNextStack(stack) super().setNextStack(stack)
# trigger signal to re-evaluate all default settings # trigger signal to re-evaluate all default settings

View file

@ -135,7 +135,7 @@ class ThreeMFReader(MeshReader):
definition_id = getMachineDefinitionIDForQualitySearch(global_container_stack.definition) definition_id = getMachineDefinitionIDForQualitySearch(global_container_stack.definition)
um_node.callDecoration("getStack").getTop().setDefinition(definition_id) um_node.callDecoration("getStack").getTop().setDefinition(definition_id)
setting_container = um_node.callDecoration("getStack") setting_container = um_node.callDecoration("getStack").getTop()
for key in settings: for key in settings:
setting_value = settings[key] setting_value = settings[key]