@@ -52,12 +52,12 @@ def install(self):
5252 register_creator_plugin_path (CREATE_PATH )
5353
5454 _set_project ()
55+ lib .set_context_setting ()
5556
5657 self .menu = AYONMenu ()
5758
5859 register_event_callback ("workfile.open.before" , on_before_open )
5960 self ._has_been_setup = True
60-
6161 rt .callbacks .addScript (rt .Name ('systemPostNew' ), on_new )
6262
6363 rt .callbacks .addScript (rt .Name ('filePostOpen' ),
@@ -214,13 +214,17 @@ def containerise(name: str, nodes: list, context,
214214def _set_project ():
215215 project_name = get_current_project_name ()
216216 project_settings = get_project_settings (project_name )
217+ workdir = os .getenv ("AYON_WORKDIR" )
218+ os .makedirs (workdir , exist_ok = True )
219+ rt .pathConfig .setCurrentProjectFolder (workdir )
217220 enable_project_creation = project_settings ["max" ].get ("enabled_project_creation" )
218- if not enable_project_creation :
221+ if enable_project_creation :
222+ directory_count = rt .pathConfig .getProjectSubDirectoryCount ()
223+ autobackup_dir = rt .pathConfig .GetDir (rt .Name ("autoback" ))
224+ os .makedirs (autobackup_dir , exist_ok = True )
219225 log .debug ("Project creation disabled. Skipping project creation." )
220226 return
221- workdir = os .getenv ("AYON_WORKDIR" )
222227
223- os .makedirs (workdir , exist_ok = True )
224228 mxp_filepath = os .path .join (workdir , "workspace.mxp" )
225229 if os .path .exists (mxp_filepath ):
226230 rt .pathConfig .load (mxp_filepath )
@@ -229,7 +233,6 @@ def _set_project():
229233 proj_dir = rt .pathConfig .getProjectSubDirectory (count )
230234 if proj_dir :
231235 os .makedirs (proj_dir , exist_ok = True )
232- rt .pathConfig .setCurrentProjectFolder (workdir )
233236
234237
235238def on_before_open ():
0 commit comments