mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-26 05:42:15 +01:00
Merge pull request #2225 from Ellipsanime/add_global_versioning
Add a "following workfile versioning" option on publish
This commit is contained in:
commit
a9a28bb444
4 changed files with 28 additions and 5 deletions
|
|
@ -38,6 +38,8 @@ class CollectAnatomyInstanceData(pyblish.api.ContextPlugin):
|
|||
order = pyblish.api.CollectorOrder + 0.49
|
||||
label = "Collect Anatomy Instance data"
|
||||
|
||||
follow_workfile_version = False
|
||||
|
||||
def process(self, context):
|
||||
self.log.info("Collecting anatomy data for all instances.")
|
||||
|
||||
|
|
@ -213,7 +215,10 @@ class CollectAnatomyInstanceData(pyblish.api.ContextPlugin):
|
|||
context_asset_doc = context.data["assetEntity"]
|
||||
|
||||
for instance in context:
|
||||
version_number = instance.data.get("version")
|
||||
if self.follow_workfile_version:
|
||||
version_number = context.data('version')
|
||||
else:
|
||||
version_number = instance.data.get("version")
|
||||
# If version is not specified for instance or context
|
||||
if version_number is None:
|
||||
# TODO we should be able to change default version by studio
|
||||
|
|
|
|||
|
|
@ -21,8 +21,9 @@ class ValidateVersion(pyblish.api.InstancePlugin):
|
|||
|
||||
if latest_version is not None:
|
||||
msg = (
|
||||
"Version `{0}` that you are trying to publish, already exists"
|
||||
" in the database. Version in database: `{1}`. Please version "
|
||||
"up your workfile to a higher version number than: `{1}`."
|
||||
).format(version, latest_version)
|
||||
"Version `{0}` from instance `{1}` that you are trying to"
|
||||
" publish, already exists in the database. Version in"
|
||||
" database: `{2}`. Please version up your workfile to a higher"
|
||||
" version number than: `{2}`."
|
||||
).format(version, instance.data["name"], latest_version)
|
||||
assert (int(version) > int(latest_version)), msg
|
||||
|
|
|
|||
|
|
@ -1,5 +1,8 @@
|
|||
{
|
||||
"publish": {
|
||||
"CollectAnatomyInstanceData": {
|
||||
"follow_workfile_version": false
|
||||
},
|
||||
"ValidateEditorialAssetName": {
|
||||
"enabled": true,
|
||||
"optional": false
|
||||
|
|
|
|||
|
|
@ -4,6 +4,20 @@
|
|||
"key": "publish",
|
||||
"label": "Publish plugins",
|
||||
"children": [
|
||||
{
|
||||
"type": "dict",
|
||||
"collapsible": true,
|
||||
"key": "CollectAnatomyInstanceData",
|
||||
"label": "Collect Anatomy Instance Data",
|
||||
"is_group": true,
|
||||
"children": [
|
||||
{
|
||||
"type": "boolean",
|
||||
"key": "follow_workfile_version",
|
||||
"label": "Follow workfile version"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "dict",
|
||||
"collapsible": true,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue