mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
Merge pull request #4071 from quadproduction/221-wizz_burn-ins-on-published-videos-should-show-the-kitsu-user
Get kitsu login to fill username burnin
This commit is contained in:
commit
794127f73c
1 changed files with 28 additions and 0 deletions
|
|
@ -0,0 +1,28 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
import os
|
||||
import re
|
||||
|
||||
import pyblish.api
|
||||
|
||||
|
||||
class CollectKitsuUsername(pyblish.api.ContextPlugin):
|
||||
"""Collect Kitsu username from the kitsu login"""
|
||||
|
||||
order = pyblish.api.CollectorOrder + 0.499
|
||||
label = "Kitsu username"
|
||||
|
||||
def process(self, context):
|
||||
kitsu_login = os.environ.get('KITSU_LOGIN')
|
||||
|
||||
if not kitsu_login:
|
||||
return
|
||||
|
||||
kitsu_username = kitsu_login.split("@")[0].replace('.', ' ')
|
||||
new_username = re.sub('[^a-zA-Z]', ' ', kitsu_username).title()
|
||||
|
||||
for instance in context:
|
||||
# Don't override customData if it already exists
|
||||
if 'customData' not in instance.data:
|
||||
instance.data['customData'] = {}
|
||||
|
||||
instance.data['customData']["kitsuUsername"] = new_username
|
||||
Loading…
Add table
Add a link
Reference in a new issue