mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 08:24:53 +01:00
adding pype.templates for improving loading contextual templates / implement templates installing into pype.nuke.__init__
This commit is contained in:
parent
e58948f5ba
commit
ddcb6f88de
5 changed files with 83 additions and 17 deletions
34
pype/templates.py
Normal file
34
pype/templates.py
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
import os
|
||||
|
||||
|
||||
from app.api import (Templates, Logger)
|
||||
|
||||
log = Logger.getLogger(__name__,
|
||||
os.getenv("AVALON_APP", "pype-config"))
|
||||
|
||||
|
||||
def load_data_from_templates():
|
||||
from . import api
|
||||
if not any([
|
||||
api.Dataflow,
|
||||
api.Anatomy,
|
||||
api.Colorspace,
|
||||
api.Metadata]
|
||||
):
|
||||
# base = Templates()
|
||||
t = Templates(type=["anatomy", "metadata", "dataflow", "colorspace"])
|
||||
api.Anatomy = t.anatomy
|
||||
api.Metadata = t.metadata.format()
|
||||
data = {"metadata": api.Metadata}
|
||||
api.Dataflow = t.dataflow.format(data)
|
||||
api.Colorspace = t.colorspace
|
||||
log.info("Data from templates were Loaded...")
|
||||
|
||||
|
||||
def reset_data_from_templates():
|
||||
from . import api
|
||||
api.Dataflow = None
|
||||
api.Anatomy = None
|
||||
api.Colorspace = None
|
||||
api.Metadata = None
|
||||
log.info("Data from templates were Unloaded...")
|
||||
Loading…
Add table
Add a link
Reference in a new issue