-
Notifications
You must be signed in to change notification settings - Fork 3
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
Bugfix/add tmp dir for deadline submission #21
base: develop
Are you sure you want to change the base?
Conversation
@@ -347,8 +347,9 @@ def prepare_rendering(asset_group): | |||
|
|||
# Clear the render filepath, so that the output is handled only by the | |||
# output node in the compositor. | |||
bpy.context.scene.render.filepath = "" | |||
|
|||
bpy.context.scene.render.filepath = ( |
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 BigRoy question is still valid #17 (comment)
(eg. why the "\")
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.
Indeed, the empty path for bpy.context.scene.render.filepath
is working for some cases. So guess we need to investigate deadline submission issue(e.g. some permission denied eror etc.)
I get inspiration from this website: https://blender.stackexchange.com/questions/119851/render-stops-after-1-frame-render-error-permission-denied-cannot-save-0001
@BigRoy, we gonna dismiss the use of this output setting as we discussed in the meeting, so are we gonna close this PR or? |
I'd say that setting it to So, the only remaining alternative is putting the files somewhere that makes sense in production. Like, somehow enforce it to the correct temp dir locally like |
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.
It correctly kicks in the validator when output dir left blank (empty) as seen below:
but once hitting Repair
it triggers error and do not perform repair action:
Traceback (most recent call last):
File "C:\Users\lbate\AppData\Local\Ynput\AYON\dependency_packages\ayon_2406251801_windows.zip\dependencies\pyblish\plugin.py", line 528, in __explicit_process
runner(*args)
File "C:\Users\lbate\AppData\Local\Ynput\AYON\addons\core_1.0.11\ayon_core\pipeline\publish\publish_plugins.py", line 350, in process
plugin.repair(instance)
File "C:\Users\lbate\AppData\Local\Ynput\AYON\addons\blender_0.2.6+dev\ayon_blender\plugins\publish\validate_deadline_publish.py", line 83, in repair
prepare_rendering(container)
File "C:\Users\lbate\AppData\Local\Ynput\AYON\addons\blender_0.2.6+dev\ayon_blender\api\render_lib.py", line 350, in prepare_rendering
bpy.context.scene.render.filepath = temp_render_dir
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: bpy_struct: item.attr = val: RenderSettings.filepath doesn't support None from string types
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.
Ok so now the Repair
action works without any errors!
There is one caveat with temp folder path which had been set like this:
C:\projects\Blender\Shots\sh010\work\lighting\renders\tmp
which leads to a staging renders been in incorrect place sitting next to that tmp folder as follows:
I guess its because we miss the last slash in the path so it probably should look more like this instead:
C:\projects\Blender\Shots\sh010\work\lighting\renders\tmp\
but thats just me guessing.
Maybe also including host name within the folder path could be preferable so it would end up below lighting\renders\blender\tmp\
again not sure if possible.
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.
Now all behaves correctly!
LGTM
side note: it seems that by filling up the output directory, Blender produces redundant rendered frames in that tmp
folder and those arent cleaned up after publish job
been finnished. Thats something we should think about in future and how to deal with it... as its a kind of blender specific side product outside AYON templating system...
@@ -82,5 +82,4 @@ def repair(cls, instance): | |||
container = instance.data["transientData"]["instance_node"] | |||
prepare_rendering(container) | |||
bpy.ops.wm.save_as_mainfile(filepath=bpy.data.filepath) | |||
bpy.context.scene.render.filepath = "/tmp/" | |||
cls.log.debug("Reset the render output folder...") | |||
cls.log.debug("Reset the render output folder...") |
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 logged message is now in a very odd place.
cls.log.debug("Reset the render output folder...") |
Note that the changes in 9b0bba3 do not make it cross-compatible on the farm OR in some case even cross-compatible between machines. It is totally valid to override Basically this HARDCODES the path on publish to the temp directory location for that particular machine. |
Guess it would be much safer for us to revert the change and store the path into the workdir/renders instead? And we can think about how to clean up that tmp directory lasted in workdir later? |
Changelog Description
Add temp directory for deadline submission so that it would not error out during deadline submission.
Continuity of #17
*Support different system platform
Additional info
n/a
Testing notes: