Delete Command Group on Auto-Route and Cut Satin (#1125)

pull/1134/head
Kaalleen 2021-04-05 11:45:57 +02:00 zatwierdzone przez GitHub
rodzic 22d7aa9305
commit 767ead9081
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
2 zmienionych plików z 12 dodań i 4 usunięć

Wyświetl plik

@ -31,6 +31,10 @@ class CutSatin(InkstitchExtension):
'Please use the "Attach commands" extension and attach the "Satin Column cut point" command first.'))
split_point = command.target_point
command_group = command.use.getparent()
if command_group is not None and command_group.get('id').startswith('command_group'):
command_group.getparent().remove(command_group)
else:
command.use.getparent().remove(command.use)
command.connector.getparent().remove(command.connector)

Wyświetl plik

@ -628,6 +628,10 @@ def operations_to_elements_and_trims(operations, preserve_order):
def remove_original_elements(elements):
for element in elements:
for command in element.commands:
command_group = command.use.getparent()
if command_group is not None and command_group.get('id').startswith('command_group'):
remove_from_parent(command_group)
else:
remove_from_parent(command.connector)
remove_from_parent(command.use)
remove_from_parent(element.node)