-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Asset task options implementation #556
base: master
Are you sure you want to change the base?
Conversation
Not sure I entirely get the end goal of this? Is it like a per task metadata, so the config can disable/enable plugins? |
Yes, per task metadata that can be applied to each asset, and for example, like in publish plugins, can change the behavior based on those metadata in each asset. |
Our use case is, a rigger can set for one or more assets' rigs that is currently working on, which can be safely auto updated when model is being published. |
Side question about "auto update". How are you tracking this and when does it get triggered? |
I like the fact of having specific rules/settings for an Asset but I do have some doubts about how this works. To get a clear picture I have a question first: Could this also just be an "Asset" specific setting? As in, does it really need to be on the Task? I imagine this could also just be on the asset's
Seems like that was how it was originally intended (to be specific data to that asset). I guess the specification could allow for assetOptions that apply only to specific tasks ( |
@tokejepsen
@BigRoy Yes, it's asset specific settings when you apply options from those has been registered in project's tasks. Before those option being applied to any assets, we need a way to define and present those options, and binding them with tasks seems a good fit.
Ah, need to think about this, organizing those option into project document's |
If we move the option's defenition it into a higher scope like "assetOptions", then the project document would be like: {
"type": "project",
"config": {
"assetOptions": [
{
"name": "rigAutoModelUpdate",
"label": "Auto update model",
"default": false,
"help": "Auto update model to latest version after model publish.",
"onTasks": [
"rigging"
]
},
{
"name": "shotFps",
"label": "Frame rate",
"default": 24,
"help": "Override frame rate for shot.",
"onTasks": [
"layout",
"animating",
"lighting"
]
}
]
}
}
[[assetOptions]]
name = "rigAutoModelUpdate"
label = "Auto update model"
default = false
help = "Auto update model to latest version after model publish."
onTasks = [
"rigging"
] Which is a bit better to write 👍 And the asset document that has been applied would be like: {
"type": "asset",
"name": "Foo",
"data": {
"label": "Foo",
"assetOptions": {
"rigAutoModelUpdate": {
"value": false
}
},
"tasks": [
"rigging"
]
}
} |
A note to self: So to compat (able to edit in GUI) those existing options, new assetOptions may have to live directly under "data" field in asset document, like this: {
"type": "asset",
"name": "Foo",
"data": {
"label": "Foo",
"rigAutoModelUpdate": true,
"tasks": [
"rigging"
]
}
}
{
"type": "asset",
"name": "shot01",
"data": {
"label": "shot 01",
"frameStart": 100,
"frameEnd": 200,
"fps": 24,
"tasks": [
"rigging"
]
}
} And the existing "frameStart" for example, can be defined like: [[assetOptions]]
name = "frameStart"
label = "Start frame"
default = 100
help = "The start frame of the shot."
onTasks = [
"layout",
"animating",
"lighting"
] |
Exactly what I was expecting yes. I imagined these new "rig specific settings" similar to an Asset/Shot specific setting like Resolution/FPS (if overridden from a project's default) or things like that. Would love to know whether that would work for your use cases? |
Yeah, that would work in our case even better 🚀 |
See discussion on getavalon#556
So the new property "assetOptions" can be saved to database.
available_in_all_tasks = not specified_tasks | ||
|
||
if (available_in_all_tasks | ||
or any(task in specified_tasks for task in task_names)): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line break before binary operator
@@ -1,18 +1,141 @@ | |||
import sys | |||
|
|||
from ...vendor.Qt import QtWidgets, QtCore | |||
from ...vendor.Qt import QtWidgets, QtCore, QtGui |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'...vendor.Qt.QtGui' imported but unused
I have refactored to adopt Or should we make a |
Coming late to the party, but good to see what you guys agreed on at the end. It is a lot more flexible and easily expandable to many other types of parameters than the original concept. |
I will add |
What's the status on this? Anyone using this in production? |
I think the last comment I wrote was the last piece but somehow I never finish it. 😮 |
Intooduce Asset Task Option
This feature aims to allow each asset to have different config in different task at different period of production time, which could be useful in publish process or other part of pipeline.
Setup
Register task options by adding "options" into each "config.tasks" field in Avalon database's
project
document.The peroject document would be like this:
And in
.config.toml
file:And the asset document will be added one extra field
data.taskOptions
when it's been applied:Usage
To apply/change task options to each asset, we implement a new widget into Avalon's project manager tool.
With this, you can:
Notes
view
has been enabled multi-selection for editing multiple task option on each asset. (This only applys to Project Manager, does not affect other tools)