Skip to content

Commit

Permalink
♻️ restore changes for submitters unused for usd
Browse files Browse the repository at this point in the history
  • Loading branch information
antirotor committed Sep 18, 2024
1 parent 1551d98 commit c6dc72e
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 64 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,6 @@
from ayon_deadline import abstract_submit_deadline
from ayon_deadline.abstract_submit_deadline import DeadlineJobInfo

try:
from ayon_usd import get_usd_pinning_envs
except ImportError:
# usd is not enabled or available, so we just mock the function
def get_usd_pinning_envs(instance):
return {}


@attr.s
class BlenderPluginInfo():
Expand Down Expand Up @@ -126,12 +119,6 @@ def get_job_info(self):
if key in os.environ
}

# TODO (antirotor): there should be better way to handle this.
# see https://github.com/ynput/ayon-core/issues/876
usd_env = get_usd_pinning_envs(instance)
environment.update(usd_env)
keys += list(usd_env.keys())

for key in keys:
value = environment.get(key)
if not value:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,6 @@
)
from ayon_deadline.abstract_submit_deadline import requests_post

try:
from ayon_usd import get_usd_pinning_envs
except ImportError:
# usd is not enabled or available, so we just mock the function
def get_usd_pinning_envs(instance):
return {}


class ProcessSubmittedCacheJobOnFarm(pyblish.api.InstancePlugin,
publish.AYONPyblishPluginMixin,
Expand Down Expand Up @@ -84,13 +77,17 @@ class ProcessSubmittedCacheJobOnFarm(pyblish.api.InstancePlugin,
deadline_pool = ""
deadline_pool_secondary = ""
deadline_group = ""
deadline_chunk_size = 1
deadline_priority = None

# regex for finding frame number in string
R_FRAME_NUMBER = re.compile(r'.+\.(?P<frame>[0-9]+)\..+')

plugin_pype_version = "3.0"

# script path for publish_filesequence.py
publishing_script = None

def _submit_deadline_post_job(self, instance, job):
"""Submit publish job to Deadline.
Expand Down Expand Up @@ -146,10 +143,6 @@ def _submit_deadline_post_job(self, instance, job):
if os.getenv(env_key):
environment[env_key] = os.environ[env_key]

# TODO (antirotor): there should be better way to handle this.
# see https://github.com/ynput/ayon-core/issues/876
environment.update(get_usd_pinning_envs(instance))

priority = self.deadline_priority or instance.data.get("priority", 50)

instance_settings = self.get_attr_values_from_data(instance.data)
Expand All @@ -176,7 +169,7 @@ def _submit_deadline_post_job(self, instance, job):
"Comment": instance.context.data.get("comment", ""),

"Department": self.deadline_department,
"ChunkSize": 1,
"ChunkSize": self.deadline_chunk_size,
"Priority": priority,
"InitialStatus": initial_status,

Expand Down
17 changes: 5 additions & 12 deletions client/ayon_deadline/plugins/publish/global/submit_publish_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,6 @@
)
from ayon_deadline.abstract_submit_deadline import requests_post

try:
from ayon_usd import get_usd_pinning_envs
except ImportError:
# usd is not enabled or available, so we just mock the function
def get_usd_pinning_envs(instance):
return {}


def get_resource_files(resources, frame_range=None):
"""Get resource files at given path.
Expand Down Expand Up @@ -148,6 +141,7 @@ class ProcessSubmittedJobOnFarm(pyblish.api.InstancePlugin,
deadline_pool = ""
deadline_pool_secondary = ""
deadline_group = ""
deadline_chunk_size = 1
deadline_priority = None

# regex for finding frame number in string
Expand All @@ -166,6 +160,9 @@ class ProcessSubmittedJobOnFarm(pyblish.api.InstancePlugin,
families_transfer = ["render3d", "render2d", "ftrack", "slate"]
plugin_pype_version = "3.0"

# script path for publish_filesequence.py
publishing_script = None

# poor man exclusion
skip_integration_repre_list = []

Expand Down Expand Up @@ -219,10 +216,6 @@ def _submit_deadline_post_job(self, instance, job, instances):
),
}

# TODO (antirotor): there should be better way to handle this.
# see https://github.com/ynput/ayon-core/issues/876
environment.update(get_usd_pinning_envs(instance))

# add environments from self.environ_keys
for env_key in self.environ_keys:
if os.getenv(env_key):
Expand Down Expand Up @@ -254,7 +247,7 @@ def _submit_deadline_post_job(self, instance, job, instances):
"Comment": instance.context.data.get("comment", ""),

"Department": self.deadline_department,
"ChunkSize": 1,
"ChunkSize": self.deadline_chunk_size,
"Priority": priority,
"InitialStatus": initial_status,

Expand Down
13 changes: 0 additions & 13 deletions client/ayon_deadline/plugins/publish/max/submit_max_deadline.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,6 @@
from ayon_deadline import abstract_submit_deadline
from ayon_deadline.abstract_submit_deadline import DeadlineJobInfo

try:
from ayon_usd import get_usd_pinning_envs
except ImportError:
# usd is not enabled or available, so we just mock the function
def get_usd_pinning_envs(instance):
return {}


@attr.s
class MaxPluginInfo(object):
Expand Down Expand Up @@ -130,12 +123,6 @@ def get_job_info(self):
if key in os.environ
}

# TODO (antirotor): there should be better way to handle this.
# see https://github.com/ynput/ayon-core/issues/876
usd_env = get_usd_pinning_envs(instance)
environment.update(usd_env)
keys += list(usd_env.keys())

for key in keys:
value = environment.get(key)
if not value:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,6 @@
from ayon_deadline import abstract_submit_deadline
from ayon_deadline.abstract_submit_deadline import DeadlineJobInfo

try:
from ayon_usd import get_usd_pinning_envs
except ImportError:
# usd is not enabled or available, so we just mock the function
def get_usd_pinning_envs(instance):
return {}


@attr.s
class DeadlinePluginInfo():
Expand Down Expand Up @@ -106,13 +99,6 @@ def get_job_info(self):
for key in keys
if key in os.environ
}

# TODO (antirotor): there should be better way to handle this.
# see https://github.com/ynput/ayon-core/issues/876
usd_env = get_usd_pinning_envs(self._instance)
environment.update(usd_env)
keys += list(usd_env.keys())

for key in keys:
value = environment.get(key)
if value:
Expand Down

0 comments on commit c6dc72e

Please sign in to comment.