Support making maya ExtractGpuCache optional

This commit is contained in:
Roy Nieterau 2024-03-29 10:32:02 +01:00
parent 312e0e7ad4
commit caebcd2b43
2 changed files with 9 additions and 1 deletions

View file

@ -5,7 +5,8 @@ from maya import cmds
from ayon_core.pipeline import publish
class ExtractGPUCache(publish.Extractor):
class ExtractGPUCache(publish.Extractor,
publish.OptionalPyblishPluginMixin):
"""Extract the content of the instance to a GPU cache file."""
label = "GPU Cache"
@ -20,6 +21,9 @@ class ExtractGPUCache(publish.Extractor):
useBaseTessellation = True
def process(self, instance):
if not self.is_active(instance.data):
return
cmds.loadPlugin("gpuCache", quiet=True)
staging_dir = self.staging_dir(instance)

View file

@ -373,6 +373,8 @@ class ExtractLookModel(BaseSettingsModel):
class ExtractGPUCacheModel(BaseSettingsModel):
enabled: bool = True
optional: bool = True
active: bool = True
families: list[str] = SettingsField(default_factory=list, title="Families")
step: float = SettingsField(1.0, ge=1.0, title="Step")
stepSave: int = SettingsField(1, ge=1, title="Step Save")
@ -1341,6 +1343,8 @@ DEFAULT_PUBLISH_SETTINGS = {
},
"ExtractGPUCache": {
"enabled": False,
"optional": False,
"active": True,
"families": [
"model",
"animation",