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 uploading in 4.0 #37

Merged
merged 2 commits into from
Nov 29, 2023
Merged
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
28 changes: 16 additions & 12 deletions lib/get_selected_objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,21 @@ def get_selected_objects(context):
if area == current_area:
continue
if area.type == "OUTLINER" or area.type == "VIEW_3D":
# Temporary context override requires Blender version >= 3.2.0
with context.temp_override(area=area):
for selected_object in context.selected_ids:
# Avoid double-counting objects that are selected in multiple outliners
if selected_object in objects:
continue

# Avoid counting objects that can't be uploaded (Open Cloud servers require a mesh inside the asset)
if not (__is_uploadable_object(selected_object) or __contains_uploadable_object(selected_object)):
continue

objects.append(selected_object)
for region in area.regions:
if region.type == "WINDOW":
# Temporary context override requires Blender version >= 3.2.0
with context.temp_override(area=area, region=region):
for selected_object in context.selected_ids:
# Avoid double-counting objects that are selected in multiple outliners
if selected_object in objects:
continue

# Avoid counting objects that can't be uploaded (Open Cloud servers require a mesh inside the asset)
if not (
__is_uploadable_object(selected_object) or __contains_uploadable_object(selected_object)
):
continue

objects.append(selected_object)

return objects
Loading