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

Fix Generating from Opened Blend File #730

Merged
merged 1 commit into from
Nov 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion generator_process/future.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def cancel(self):
def _run_on_main_thread(self, func):
try:
import bpy
bpy.app.timers.register(func)
bpy.app.timers.register(func, persistent=True)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sure that model fetching completes when loading a file. Often when loading a file first it would fetch the models, then it gets queued in this timer, then the file actually loads and discards the timer. On rare occasions model fetching would complete along with the timer before the .blend file loads.

except:
func()

Expand Down
2 changes: 1 addition & 1 deletion preferences.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ class model_lookup:

@classmethod
def get(cls, item):
return cls._models.get(item, item)
return cls._models.get(item, None)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't want to default to returning the model id string in case if the id is invalid or the models haven't loaded yet.


def fetch_installed_models(blocking=True):
def on_done(future):
Expand Down
2 changes: 0 additions & 2 deletions ui/panels/dream_texture.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,4 @@ def draw(self, context):
for i, line in enumerate(e.args[0].split('\n')):
error_box.label(text=line, icon="ERROR" if i == 0 else "NONE")
e._draw(prompt, context, error_box)
except Exception as e:
print(e)
Comment on lines -368 to -369
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These exceptions can be safely propagated since its at the end of the draw function, now it can properly show traceback info on errors it encounters.

return ActionsPanel