summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorKaalleen <36401965+kaalleen@users.noreply.github.com>2023-05-01 12:03:06 +0200
committerGitHub <noreply@github.com>2023-05-01 12:03:06 +0200
commit2542f124eb4e741687ebc7e0d69b27e2291310c6 (patch)
tree1bfa54fd6ed249994400baa82f6fdaee1f71a25a /lib
parent76af7ffcf29b7b604693117af6e8766ee6977a34 (diff)
remove random seed param from unaffected stitch types (#2251)
Diffstat (limited to 'lib')
-rw-r--r--lib/elements/element.py16
-rw-r--r--lib/elements/fill_stitch.py17
-rw-r--r--lib/elements/satin_column.py16
3 files changed, 33 insertions, 16 deletions
diff --git a/lib/elements/element.py b/lib/elements/element.py
index 30cce418..43cbc8a2 100644
--- a/lib/elements/element.py
+++ b/lib/elements/element.py
@@ -357,22 +357,6 @@ class EmbroideryElement(object):
return self.get_boolean_param('stop_after', False)
@property
- @param('random_seed',
- _('Random seed'),
- tooltip=_('Use a specific seed for randomized attributes. Uses the element ID if empty.'),
- type='random_seed',
- default='',
- sort_index=100)
- @cache
- def random_seed(self) -> str:
- seed = self.get_param('random_seed', '')
- if not seed:
- seed = self.node.get_id() or ''
- # TODO(#1696): When inplementing grouped clones, join this with the IDs of any shadow roots,
- # letting each instance without a specified seed get a different default.
- return seed
-
- @property
def path(self):
# A CSP is a "cubic superpath".
#
diff --git a/lib/elements/fill_stitch.py b/lib/elements/fill_stitch.py
index b310ce47..ec115ce7 100644
--- a/lib/elements/fill_stitch.py
+++ b/lib/elements/fill_stitch.py
@@ -480,6 +480,23 @@ class FillStitch(EmbroideryElement):
return self.get_boolean_param('underlay_underpath', True)
@property
+ @param('random_seed',
+ _('Random seed'),
+ tooltip=_('Use a specific seed for randomized attributes. Uses the element ID if empty.'),
+ select_items=[('fill_method', 'meander_fill')],
+ type='random_seed',
+ default='',
+ sort_index=100)
+ @cache
+ def random_seed(self) -> str:
+ seed = self.get_param('random_seed', '')
+ if not seed:
+ seed = self.node.get_id() or ''
+ # TODO(#1696): When inplementing grouped clones, join this with the IDs of any shadow roots,
+ # letting each instance without a specified seed get a different default.
+ return seed
+
+ @property
@cache
def paths(self):
paths = self.flatten(self.parse_path())
diff --git a/lib/elements/satin_column.py b/lib/elements/satin_column.py
index dafc9c6b..0cc33203 100644
--- a/lib/elements/satin_column.py
+++ b/lib/elements/satin_column.py
@@ -430,6 +430,22 @@ class SatinColumn(EmbroideryElement):
return self.get_float_param("zigzag_underlay_max_stitch_length_mm") or None
@property
+ @param('random_seed',
+ _('Random seed'),
+ tooltip=_('Use a specific seed for randomized attributes. Uses the element ID if empty.'),
+ type='random_seed',
+ default='',
+ sort_index=100)
+ @cache
+ def random_seed(self) -> str:
+ seed = self.get_param('random_seed', '')
+ if not seed:
+ seed = self.node.get_id() or ''
+ # TODO(#1696): When inplementing grouped clones, join this with the IDs of any shadow roots,
+ # letting each instance without a specified seed get a different default.
+ return seed
+
+ @property
@cache
def shape(self):
# This isn't used for satins at all, but other parts of the code