mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-04-30 07:44:22 +08:00
Fix variant handling in VariantNode
CURA-6863
This commit is contained in:
parent
dd8f6dc10e
commit
cc64fb0a93
@ -6,9 +6,13 @@ from UM.Logger import Logger
|
|||||||
from UM.Settings.ContainerRegistry import ContainerRegistry
|
from UM.Settings.ContainerRegistry import ContainerRegistry
|
||||||
from UM.Settings.Interfaces import ContainerInterface
|
from UM.Settings.Interfaces import ContainerInterface
|
||||||
from UM.Signal import Signal
|
from UM.Signal import Signal
|
||||||
|
|
||||||
|
from cura.Settings.cura_empty_instance_containers import empty_variant_container
|
||||||
from cura.Machines.ContainerNode import ContainerNode
|
from cura.Machines.ContainerNode import ContainerNode
|
||||||
from cura.Machines.MaterialNode import MaterialNode
|
from cura.Machines.MaterialNode import MaterialNode
|
||||||
|
|
||||||
import UM.FlameProfiler
|
import UM.FlameProfiler
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from typing import Dict
|
from typing import Dict
|
||||||
from cura.Machines.MachineNode import MachineNode
|
from cura.Machines.MachineNode import MachineNode
|
||||||
@ -110,8 +114,8 @@ class VariantNode(ContainerNode):
|
|||||||
if base_file not in self.materials: # Completely new base file. Always better than not having a file as long as it matches our set-up.
|
if base_file not in self.materials: # Completely new base file. Always better than not having a file as long as it matches our set-up.
|
||||||
if material_definition != "fdmprinter" and material_definition != self.machine.container_id:
|
if material_definition != "fdmprinter" and material_definition != self.machine.container_id:
|
||||||
return
|
return
|
||||||
material_variant = container.getMetaDataEntry("variant_name")
|
material_variant = container.getMetaDataEntry("variant_name", empty_variant_container.getName())
|
||||||
if material_variant is not None and material_variant != self.variant_name:
|
if material_variant != self.variant_name:
|
||||||
return
|
return
|
||||||
else: # We already have this base profile. Replace the base profile if the new one is more specific.
|
else: # We already have this base profile. Replace the base profile if the new one is more specific.
|
||||||
new_definition = container.getMetaDataEntry("definition")
|
new_definition = container.getMetaDataEntry("definition")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user