mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-02 00:44:52 +01:00
Get task tags from project config.
This commit is contained in:
parent
acb4cebbf5
commit
d864fb0cfa
1 changed files with 19 additions and 1 deletions
|
|
@ -1,9 +1,12 @@
|
|||
import hiero
|
||||
import re
|
||||
|
||||
from pypeapp import (
|
||||
config,
|
||||
Logger
|
||||
)
|
||||
from avalon import io
|
||||
|
||||
import hiero
|
||||
|
||||
log = Logger().get_logger(__name__, "nukestudio")
|
||||
|
||||
|
|
@ -59,6 +62,21 @@ def add_tags_from_presets():
|
|||
nks_pres = presets['nukestudio']
|
||||
nks_pres_tags = nks_pres.get("tags", None)
|
||||
|
||||
# Get project task types.
|
||||
tasks = io.find_one({"type": "project"})["config"]["tasks"]
|
||||
nks_pres_tags["[Tasks]"] = {}
|
||||
for task in tasks:
|
||||
nks_pres_tags["[Tasks]"][task["name"]] = {
|
||||
"editable": "1",
|
||||
"note": "Tag note",
|
||||
"icon": {
|
||||
"path": ""
|
||||
},
|
||||
"metadata": {
|
||||
"family": "task"
|
||||
}
|
||||
}
|
||||
|
||||
# get project and root bin object
|
||||
project = hiero.core.projects()[-1]
|
||||
root_bin = project.tagsBin()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue