From 73e50fa03fcc6efccbcf49cfac120e3dbb4bf01a Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Sun, 5 Jan 2020 14:24:56 +0100 Subject: [PATCH 1/3] change label to see whole label value --- pype/ftrack/actions/action_seed.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pype/ftrack/actions/action_seed.py b/pype/ftrack/actions/action_seed.py index cf0a4b0445..5cbc5d1cec 100644 --- a/pype/ftrack/actions/action_seed.py +++ b/pype/ftrack/actions/action_seed.py @@ -9,7 +9,7 @@ class SeedDebugProject(BaseAction): #: Action identifier. identifier = "seed.debug.project" #: Action label. - label = "SeedDebugProject" + label = "Seed Debug Project" #: Action description. description = "Description" #: priority From 0024688a449a81919ab4b3331126a4f451a112ff Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Sun, 5 Jan 2020 14:25:50 +0100 Subject: [PATCH 2/3] convert input values to integer and set to 0 if not successful --- pype/ftrack/actions/action_seed.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/pype/ftrack/actions/action_seed.py b/pype/ftrack/actions/action_seed.py index 5cbc5d1cec..260e854d14 100644 --- a/pype/ftrack/actions/action_seed.py +++ b/pype/ftrack/actions/action_seed.py @@ -265,6 +265,11 @@ class SeedDebugProject(BaseAction): def create_assets(self, project, asset_count): self.log.debug("*** Creating assets:") + try: + asset_count = int(asset_count) + except ValueError: + asset_count = 0 + main_entity = self.session.create("Folder", { "name": "Assets", "parent": project @@ -305,6 +310,19 @@ class SeedDebugProject(BaseAction): def create_shots(self, project, seq_count, shots_count): self.log.debug("*** Creating shots:") + + # Convert counts to integers + try: + seq_count = int(seq_count) + except ValueError: + seq_count = 0 + + try: + shots_count = int(shots_count) + except ValueError: + shots_count = 0 + + # Create Folder "Shots" main_entity = self.session.create("Folder", { "name": "Shots", "parent": project From 080f1f6819d09b5c7d9ca8c3f3bc061998e9933b Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Sun, 5 Jan 2020 14:26:13 +0100 Subject: [PATCH 3/3] check if input values of seeder are greater than 0 --- pype/ftrack/actions/action_seed.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/pype/ftrack/actions/action_seed.py b/pype/ftrack/actions/action_seed.py index 260e854d14..1238e73e72 100644 --- a/pype/ftrack/actions/action_seed.py +++ b/pype/ftrack/actions/action_seed.py @@ -270,6 +270,10 @@ class SeedDebugProject(BaseAction): except ValueError: asset_count = 0 + if asset_count <= 0: + self.log.debug("No assets to create") + return + main_entity = self.session.create("Folder", { "name": "Assets", "parent": project @@ -322,6 +326,18 @@ class SeedDebugProject(BaseAction): except ValueError: shots_count = 0 + # Check if both are higher than 0 + missing = [] + if seq_count <= 0: + missing.append("sequences") + + if shots_count <= 0: + missing.append("shots") + + if missing: + self.log.debug("No {} to create".format(" and ".join(missing))) + return + # Create Folder "Shots" main_entity = self.session.create("Folder", { "name": "Shots",