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

Fix Generating from Opened Blend File #730

merged 1 commit into from
Nov 6, 2023

Conversation

NullSenseStudio
Copy link
Collaborator

fixes #729

@@ -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.

@@ -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.

Comment on lines -368 to -369
except Exception as e:
print(e)
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.

Copy link
Owner

@carson-katri carson-katri left a comment

Choose a reason for hiding this comment

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

Good catch

@carson-katri carson-katri merged commit 1d18097 into main Nov 6, 2023
@carson-katri carson-katri deleted the validation-fix branch November 6, 2023 22:57
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

Successfully merging this pull request may close these issues.

Generate is Disabled When Opening a Blend File
2 participants