mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-02 00:44:52 +01:00
follow workfile version exists in creator's tab
This commit is contained in:
parent
d1951f3b51
commit
c97c98420c
2 changed files with 28 additions and 6 deletions
|
|
@ -58,7 +58,7 @@ class CreateTextures(Creator):
|
|||
"exportPadding",
|
||||
"exportDilationDistance",
|
||||
"useCustomExportPreset",
|
||||
"exportChannel"
|
||||
"exportChannel",
|
||||
]:
|
||||
if key in pre_create_data:
|
||||
creator_attributes[key] = pre_create_data[key]
|
||||
|
|
@ -153,9 +153,6 @@ class CreateTextures(Creator):
|
|||
}
|
||||
|
||||
return [
|
||||
BoolDef("follow_workfile_version",
|
||||
label="Follow Workfile Version",
|
||||
default=self.follow_workfile_version),
|
||||
EnumDef("exportChannel",
|
||||
items=export_channel_enum,
|
||||
multiselection=True,
|
||||
|
|
@ -247,9 +244,15 @@ class CreateTextures(Creator):
|
|||
def get_pre_create_attr_defs(self):
|
||||
# Use same attributes as for instance attributes
|
||||
attr_defs = []
|
||||
if substance_painter.application.version_info()[0] >= 10:
|
||||
if substance_painter.application.version_info()[0] >= 10:
|
||||
attr_defs.append(
|
||||
BoolDef("use_selection", label="Use selection",
|
||||
tooltip="Select Layer Stack(s) for exporting")
|
||||
tooltip="Select Layer Stack(s) for exporting"),
|
||||
|
||||
)
|
||||
|
||||
attr_defs.append(BoolDef("follow_workfile_version",
|
||||
label="Follow Workfile Version",
|
||||
default=self.follow_workfile_version))
|
||||
|
||||
return attr_defs + self.get_instance_attr_defs()
|
||||
|
|
|
|||
|
|
@ -0,0 +1,19 @@
|
|||
import pyblish.api
|
||||
|
||||
from ayon_core.pipeline import registered_host
|
||||
from ayon_core.lib import get_version_from_path
|
||||
|
||||
|
||||
class CollectWorkfileVersion(pyblish.api.ContextPlugin):
|
||||
"""Inject the current working file into context"""
|
||||
|
||||
order = pyblish.api.CollectorOrder - 0.5
|
||||
label = "Current Workfile Version"
|
||||
hosts = ["substancepainter"]
|
||||
|
||||
def process(self, context):
|
||||
host = registered_host()
|
||||
path = host.get_current_workfile()
|
||||
version = int(get_version_from_path(path))
|
||||
context.data["version"] = version
|
||||
self.log.debug(f"Current Version: {version}")
|
||||
Loading…
Add table
Add a link
Reference in a new issue