Skip to content
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

Unsaved .blend cause error #7

Closed
tin2tin opened this issue Sep 2, 2018 · 6 comments
Closed

Unsaved .blend cause error #7

tin2tin opened this issue Sep 2, 2018 · 6 comments

Comments

@tin2tin
Copy link

tin2tin commented Sep 2, 2018

If the .blend project isn't saved before running Parallel Render, it will cause an error and stop the export.

image

On the same note, if ex. resolution is changed after the .blend is saved it will not have an effect on the Parallel Rendered file. So, in other words, you'll have to save the .blend each time anything has been changed, to have effect on the render.

Here's a bit on how to check it: https://blender.stackexchange.com/questions/58711/python-check-if-file-was-saved

@elmopl
Copy link
Owner

elmopl commented Sep 2, 2018

I had this issue and I thought I fixed it with latest commit (77b90a5).
The version without latest changes showed above.

I do check if file needs saving. If you save it (there should be no '*' in title of Blender window to indicate that) just before running add-on it will not try to save temporary file.

I've been trying to reproduce it with latest code, but I can't find a way for it to fail.
Generally issue happened when file I tried to save already existed. However newest version of code should be creating a whole temporary directory (with random name as returned by mkdtemp), so those clashes should never happen.

On the same note, if ex. resolution is changed after the .blend is saved it will not have an effect on the Parallel Rendered file. So, in other words, you'll have to save the .blend each time anything has been changed, to have effect on the render.

Which is why I am trying to save a copy and work on copy. I would rather not make "render" add-on make "changes" to your project (i.e. save it).

To be perfectly honest I am a bit stuck here, as not being able to reproduce makes it quite hard to find a fix.

@tin2tin
Copy link
Author

tin2tin commented Sep 2, 2018

Here's what I do. I am using the latest code. I start Blender 2.79 on Win 8 with factory settings and I do not load any .blend file. I install the add on. Go to vse add a movie clip(.mov). Open preferences. Set file format to Ffmpeg video. Container to mpeg-4 and codec to h.264. Run the add on. Check all boxes and hit okay. Then this error shows up. The only way to proceed is to save the .blend. Maybe it is an OS problem?

@elmopl
Copy link
Owner

elmopl commented Sep 2, 2018

Oh, ok. Condition to reproduce is that you never saved your file (and not that you don't have most recent changes save in otherwise already save project).
Now I understand why you were pointing me at that stackoverflow question.

I only check is_dirty. I don't look at is_saved.
As you have never saved the file weird things might happen when I ask Blender to give me path to current project file (so that I can save a temporary in the same place to make sure all relative paths work).
This probably ends up generating odd path that then screws up attempts to save a bit later.

I will play with it.

@tin2tin
Copy link
Author

tin2tin commented Sep 6, 2018

[I just want to mention that I posted about your add on a few days ago in the VSE group on Facebook - I hope that's okay? https://www.facebook.com/groups/1981104845289453/permalink/1991843484215589/ Maybe you want to join the group?]

@elmopl
Copy link
Owner

elmopl commented Jan 1, 2019

Quite annoyingly it seems is_dirty is a bit unreliable in test set up I currently have (https://blender.stackexchange.com/questions/127040/how-to-get-bpy-data-is-dirty-updating-when-changes-are-done-by-script).
Not sure how to workaround that specific issue.

I believe I have fixed this, but I will have to manually play with Blender to make sure that it works better than it did before.

@tin2tin
Copy link
Author

tin2tin commented Jan 1, 2019

I don't know about these things. Maybe you can also post your question here: https://devtalk.blender.org/c/python

I wonder if the poll can be used to detect if the file has been saved?
https://docs.blender.org/api/2.79/bpy.types.Operator.html?highlight=poll#bpy.types.Operator.poll

@tin2tin tin2tin closed this as completed Nov 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants