-
Notifications
You must be signed in to change notification settings - Fork 18
Support creating first workfile with TemplateBuilder #307
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
base: develop
Are you sure you want to change the base?
Support creating first workfile with TemplateBuilder #307
Conversation
…uild_settings_create_first_version
|
i did notice a performance degradation in launching maya. |
I'd say this is quite important to solve. Any ideas on how to improve best @antirotor ? |
BigRoy
left a comment
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.
This errors if no workfile templates are currently enabled for current context - other than that it looks good and seems to work as inteded.
@antirotor could you take a look at the code as well please?
antirotor
left a comment
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.
With catching of the missing template it works, but we need to find out way not to execute the logic on startup when AYON_LAST_WORKFILE is set. So what about just not executing workfile_template_builder.build_workfile_template() if AYON_LAST_WORKFILE exists?
...
try:
if not os.getenv("AYON_LAST_WORKFILE"):
workfile_template_builder.build_workfile_template(
workfile_creation_enabled=True)
except TemplateProfileNotFound:
log.debug(
"No workfile template profile enabled for current context. "
"Skipping workfile creation."
)
...Ideally we should not query AYON_LAST_WORKFILE directly but call some ayon-core function but I don't think there is one (yet) :)
This wouldn't work unfortunately, because normally on CTRL+N the workfile template should kick in.. but in this case, it would now never kick in during that session because |
You are right. But that means we should unset |
|
okay i never tried using CTRL+N for new scenes. always used AYON. |
my testing lead me to this docstring from it i'm wondering... is it correct that so that variable seems to be always set and my workfile is built as expected. also when already working on it for a couple of versions the template builder does not kick in. but I might be too stoopid to really get the issue here |
|
@tweak-wtf it was related to this comment by @antirotor where he proposed a code change: #307 (review) I was referring to the case if the code was changed to that.. that it wouldn't behave as expected. And the source issue we are trying to solve is what Ondrej wrote there: it should not build if it opens workfile on launch... |
|
ah thanks for clarifying, i think i understood.
i'm quite sure that this is how it currently behaves. however, i checked for nuke/houdini and noticed that there too the template always gets executed but existing workfiles aren't modified. it bails before modifying. so isn't this rather a thing for the AbstractTemplateBuilder? |
The logic there is that if when the build triggers, and the current scene is alread a saved/named file then it'll not trigger due to the assumption you have opened a workfile. However, in Maya we have the post initialize last workfile settings (enabled by default?) And hence likely the workfile is only opened 'later' than when the template build triggers perhaps? |
|
so i managed to not run the template builder on any file open but it comes with some gotchas:
i'm wondering if there are cases where what do u think? |
|
I tested in my side, it is successfully built the workfile by |


Changelog Description
Supports creating the first initial workfile version from a built template.
Additional review information
This picks up and continues #301.
I took the following commit as reference ynput/ayon-houdini@65db6d3
When testing u have to build and upload this addon as it contains server-side settings changes⚠️
Testing notes:
create_first_version = Truenow falsify
create_first_version = Falseand check already imported templates