-
Notifications
You must be signed in to change notification settings - Fork 128
#180 - Enrich tasks with additional information #516
Conversation
Tasks in project config or on assets were stored only as names. This changes them into dictionaries to enhance information that could be stored and used elsewhere later.
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.
Looking at this in detail and trying out using it and retrieving data in plugins and other places, I think we should re-structure both of these to be dictionaries, rather than lists.
With lists, we'll need to iterate and compare asset tasks against project task types everytime we need to assemble data for anatomy, which will be a major PITA. Switching to dict we could simply do
project_data["config"]["task_type"][asset["tasks"]["myTaskName"]["type"]]['short_code']
to get the correct short code or any other info.
Second point is that with this we also need to adjust GUI on a few places.
class TasksModel(TreeModel)
in avalon/tools/models
for example (maybe just there actually)
Changed both for config ("tasks":{TYPE: {"short_name":""}}) and assets ("tasks": {"TASK_NAME": {"type":config.tasks.TYPE}})
Modifications based on change
Modifications based on change
for tt in task_types: | ||
tasks[tt["name"]] = { | ||
"short_name": get_task_short_name(tt["name"]) | ||
} |
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.
continuation line over-indented for hanging indent
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.
Some files could not be reviewed due to errors:
./pype/tools/pyblish_pype/model.py:967:34: B008: Do not perform function call...
./pype/tools/pyblish_pype/model.py:967:34: B008: Do not perform function calls in argument defaults. The call is performed only once at function definition time. All calls to your function will reuse the result of that definition-time function call. If this is intended, assign the function call to a module-level variable and use that variable as a default value. ./pype/tools/pyblish_pype/model.py:971:31: B008: Do not perform function calls in argument defaults. The call is performed only once at function definition time. All calls to your function will reuse the result of that definition-time function call. If this is intended, assign the function call to a module-level variable and use that variable as a default value. ./pype/tools/pyblish_pype/model.py:996:41: B008: Do not perform function calls in argument defaults. The call is performed only once at function definition time. All calls to your function will reuse the result of that definition-time function call. If this is intended, assign the function call to a module-level variable and use that variable as a default value.
if "jpg" in self.formats: | ||
save_options.append('jpg') | ||
save_options["jpg"] = photoshop.com_objects.JPEGSaveOptions() |
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 too long (81 > 79 characters)
if "png" in self.formats: | ||
save_options.append('png') | ||
save_options["png"] = photoshop.com_objects.PNGSaveOptions() |
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 too long (80 > 79 characters)
len(data.get("comments", [])) | ||
) | ||
len(data["comments"]) | ||
) |
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.
closing bracket does not match indentation of opening bracket's line
@@ -40,13 +40,13 @@ def process(self, instance): | |||
data["name"] = data["subset"] + "_" + data["asset"] | |||
|
|||
data["label"] = ( | |||
"{} - {} - tasks: {} - assetbuilds: {} - comments: {}".format( | |||
"{} - {} - tasks:{} - assetbuilds:{} - comments:{}".format( |
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.
continuation line over-indented for hanging indent
Solves: pypeclub/pype/#180
Currently task info is stored in both project config and assets as list of task names only. This PR enhances it to list of dictionaries.
I kept both config and asset as LISTs to follow getavalon/core#556 and it felt wrong to have
project.config.tasks
as a dictionary and `asset.tasks' as a list.Schemas already expect list of dictionaries, so no change is needed there.
(Could be changed easily if necessary.)
I added task name to short_name mapping. This short_name could be used in paths.. in the future.
Requires:
pype-config:ynput/pype-config#81
avalon-core:ynput/avalon-core#196
These queries need to be run on MongoDB: