kopia lustrzana https://github.com/inkstitch/inkstitch
Select embroidery elements: autorun underpath selection (#2187)
rodzic
c7819c4971
commit
3ef31628cb
|
@ -49,7 +49,7 @@ class DBusActions:
|
||||||
# start dbus
|
# start dbus
|
||||||
dbus = DBusActions()
|
dbus = DBusActions()
|
||||||
# give it some time to start
|
# give it some time to start
|
||||||
sleep(0.2)
|
sleep(0.5)
|
||||||
# clear previous selection
|
# clear previous selection
|
||||||
dbus.run_action('select-clear', None)
|
dbus.run_action('select-clear', None)
|
||||||
# select with the list of ids
|
# select with the list of ids
|
||||||
|
|
|
@ -21,6 +21,7 @@ class SelectElements(InkstitchExtension):
|
||||||
pars.add_argument("--info", type=str, dest="info")
|
pars.add_argument("--info", type=str, dest="info")
|
||||||
|
|
||||||
pars.add_argument("--select-running-stitch", type=Boolean, dest="running", default=False)
|
pars.add_argument("--select-running-stitch", type=Boolean, dest="running", default=False)
|
||||||
|
pars.add_argument("--running-stitch-condition", type=str, dest="running_stitch_condition", default="all")
|
||||||
pars.add_argument("--select-ripples", type=Boolean, dest="ripples", default=False)
|
pars.add_argument("--select-ripples", type=Boolean, dest="ripples", default=False)
|
||||||
pars.add_argument("--select-zigzag", type=Boolean, dest="zigzag", default=False)
|
pars.add_argument("--select-zigzag", type=Boolean, dest="zigzag", default=False)
|
||||||
pars.add_argument("--select-manual", type=Boolean, dest="manual", default=False)
|
pars.add_argument("--select-manual", type=Boolean, dest="manual", default=False)
|
||||||
|
@ -101,7 +102,7 @@ class SelectElements(InkstitchExtension):
|
||||||
def _select_stroke(self, element):
|
def _select_stroke(self, element):
|
||||||
select = False
|
select = False
|
||||||
method = element.stroke_method
|
method = element.stroke_method
|
||||||
if self.options.running and method == 'running_stitch':
|
if self.options.running and method == 'running_stitch' and self._running_condition(element):
|
||||||
select = True
|
select = True
|
||||||
if self.options.ripples and method == 'ripple_stitch':
|
if self.options.ripples and method == 'ripple_stitch':
|
||||||
select = True
|
select = True
|
||||||
|
@ -130,6 +131,11 @@ class SelectElements(InkstitchExtension):
|
||||||
select = True
|
select = True
|
||||||
return select
|
return select
|
||||||
|
|
||||||
|
def _running_condition(self, element):
|
||||||
|
element_id = element.node.get_id() or ''
|
||||||
|
conditions = {'all': True, 'autorun-top': element_id.startswith('autorun'), 'autorun-underpath': element_id.startswith('underpath')}
|
||||||
|
return conditions[self.options.running_stitch_condition]
|
||||||
|
|
||||||
def _select_fill_underlay(self, element):
|
def _select_fill_underlay(self, element):
|
||||||
underlay = {'all': True, 'no': not element.fill_underlay, 'yes': element.fill_underlay}
|
underlay = {'all': True, 'no': not element.fill_underlay, 'yes': element.fill_underlay}
|
||||||
return underlay[self.options.fill_underlay]
|
return underlay[self.options.fill_underlay]
|
||||||
|
|
|
@ -8,7 +8,15 @@
|
||||||
<page name="stitch-type" gui-text="Select options">
|
<page name="stitch-type" gui-text="Select options">
|
||||||
<label appearance="header">Select Stitch Type</label>
|
<label appearance="header">Select Stitch Type</label>
|
||||||
<label>Stroke type</label>
|
<label>Stroke type</label>
|
||||||
|
<hbox>
|
||||||
<param indent="1" name="select-running-stitch" type="boolean" gui-text="Running Stitch">false</param>
|
<param indent="1" name="select-running-stitch" type="boolean" gui-text="Running Stitch">false</param>
|
||||||
|
<param indent="1" name="running-stitch-condition" type="optiongroup" appearance="combo" gui-text="Select"
|
||||||
|
gui-description="Only select specific running stitches">
|
||||||
|
<option value="all">All</option>
|
||||||
|
<option value="autorun-top">Auto-Run Top Stitching</option>
|
||||||
|
<option value="autorun-underpath">Auto-Run Underpath</option>
|
||||||
|
</param>
|
||||||
|
</hbox>
|
||||||
<param indent="1" name="select-ripples" type="boolean" gui-text="Ripples">false</param>
|
<param indent="1" name="select-ripples" type="boolean" gui-text="Ripples">false</param>
|
||||||
<param indent="1" name="select-zigzag" type="boolean" gui-text="ZigZag Stitch">false</param>
|
<param indent="1" name="select-zigzag" type="boolean" gui-text="ZigZag Stitch">false</param>
|
||||||
<param indent="1" name="select-manual" type="boolean" gui-text="Manual Stitch">false</param>
|
<param indent="1" name="select-manual" type="boolean" gui-text="Manual Stitch">false</param>
|
||||||
|
@ -53,7 +61,7 @@
|
||||||
<label>If this isn't working for you, you may need to insert your path to a python executable manualy.</label>
|
<label>If this isn't working for you, you may need to insert your path to a python executable manualy.</label>
|
||||||
<spacer />
|
<spacer />
|
||||||
<label>* Windows: Open the "Command Prompt" and type "where python". Copy the path and paste it here.</label>
|
<label>* Windows: Open the "Command Prompt" and type "where python". Copy the path and paste it here.</label>
|
||||||
<label>* Linux: Open the command line and type "which python". Copy the path and paste it here.</label>
|
<label>* Linux: Open the command line and type "which python3". Copy the path and paste it here.</label>
|
||||||
<label>* macOS: doesn't work, sorry</label>
|
<label>* macOS: doesn't work, sorry</label>
|
||||||
<param name="python-path" type="string" gui-text="Python Path"></param>
|
<param name="python-path" type="string" gui-text="Python Path"></param>
|
||||||
</page>
|
</page>
|
||||||
|
|
Ładowanie…
Reference in New Issue