mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-26 05:42:15 +01:00
Added few featers that are from different unmerged branches
This commit is contained in:
parent
6a94143cc8
commit
e71b3aef8d
4 changed files with 36 additions and 38 deletions
|
|
@ -77,7 +77,7 @@ class SyncToAvalon(BaseAction):
|
|||
duplicates = []
|
||||
|
||||
for e in self.importable:
|
||||
lib.avalon_check_name(e)
|
||||
ftrack_utils.avalon_check_name(e)
|
||||
if e['name'] in all_names:
|
||||
duplicates.append("'{}'".format(e['name']))
|
||||
else:
|
||||
|
|
|
|||
|
|
@ -74,6 +74,8 @@ class AppAction(object):
|
|||
self._launch
|
||||
)
|
||||
|
||||
self.log.info("Application '{}' - Registered successfully".format(self.label))
|
||||
|
||||
def _discover(self, event):
|
||||
args = self._translate_event(
|
||||
self.session, event
|
||||
|
|
@ -435,7 +437,8 @@ class BaseAction(object):
|
|||
),
|
||||
self._launch
|
||||
)
|
||||
self.log.info("----- action - <" + self.__class__.__name__ + "> - Has been registered -----")
|
||||
|
||||
self.log.info("Action '{}' - Registered successfully".format(self.__class__.__name__))
|
||||
|
||||
def _discover(self, event):
|
||||
args = self._translate_event(
|
||||
|
|
|
|||
|
|
@ -4,10 +4,38 @@ import ftrack_api
|
|||
import os
|
||||
from pprint import *
|
||||
|
||||
def avalon_check_name(self, entity, inSchema = None):
|
||||
alright = True
|
||||
name = entity['name']
|
||||
if " " in name:
|
||||
alright = False
|
||||
|
||||
def checkLogin():
|
||||
# check Environments FTRACK_API_USER, FTRACK_API_KEY
|
||||
pass
|
||||
data = {}
|
||||
data['data'] = {}
|
||||
data['type'] = 'asset'
|
||||
schema = "avalon-core:asset-2.0"
|
||||
# TODO have project any REGEX check?
|
||||
if entity.entity_type in ['Project']:
|
||||
# data['type'] = 'project'
|
||||
name = entity['full_name']
|
||||
# schema = get_avalon_project_template_schema()['schema']
|
||||
# elif entity.entity_type in ['AssetBuild','Library']:
|
||||
# data['silo'] = 'Assets'
|
||||
# else:
|
||||
# data['silo'] = 'Film'
|
||||
data['silo'] = 'Film'
|
||||
|
||||
if inSchema is not None:
|
||||
schema = inSchema
|
||||
data['schema'] = schema
|
||||
data['name'] = name
|
||||
try:
|
||||
avalon.schema.validate(data)
|
||||
except ValidationError:
|
||||
alright = False
|
||||
|
||||
if alright is False:
|
||||
raise ValueError("{} includes unsupported symbols like 'dash' or 'space'".format(name))
|
||||
|
||||
|
||||
def checkRegex():
|
||||
|
|
|
|||
33
pype/lib.py
33
pype/lib.py
|
|
@ -364,36 +364,3 @@ def get_avalon_project_template():
|
|||
# proj_template['work'] = template.anatomy.avalon.work
|
||||
# proj_template['publish'] = template.anatomy.avalon.publish
|
||||
return proj_template
|
||||
|
||||
def avalon_check_name(self, entity, inSchema = None):
|
||||
alright = True
|
||||
name = entity['name']
|
||||
if " " in name:
|
||||
alright = False
|
||||
|
||||
data = {}
|
||||
data['data'] = {}
|
||||
data['type'] = 'asset'
|
||||
schema = "avalon-core:asset-2.0"
|
||||
# TODO have project any REGEX check?
|
||||
if entity.entity_type in ['Project']:
|
||||
# data['type'] = 'project'
|
||||
name = entity['full_name']
|
||||
# schema = get_avalon_project_template_schema()['schema']
|
||||
# elif entity.entity_type in ['AssetBuild','Library']:
|
||||
# data['silo'] = 'Assets'
|
||||
# else:
|
||||
# data['silo'] = 'Film'
|
||||
data['silo'] = 'Film'
|
||||
|
||||
if inSchema is not None:
|
||||
schema = inSchema
|
||||
data['schema'] = schema
|
||||
data['name'] = name
|
||||
try:
|
||||
avalon.schema.validate(data)
|
||||
except ValidationError:
|
||||
alright = False
|
||||
|
||||
if alright is False:
|
||||
raise ValueError("{} includes unsupported symbols like 'dash' or 'space'".format(name))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue