Skip to content

Commit

Permalink
Merge pull request #254 from MozillaReality/formatting-updates
Browse files Browse the repository at this point in the history
Formatting updates
  • Loading branch information
keianhzo authored Dec 13, 2023
2 parents ed69fde + 513c532 commit f172034
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 18 deletions.
5 changes: 4 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,8 @@
],
"editor.defaultFormatter": "ms-python.autopep8",
"editor.formatOnSave": true,
"editor.formatOnSaveMode": "file"
"editor.formatOnSaveMode": "file",
"autopep8.args": [
"--exclude=models", "--max-line-length", "120", "--experimental"
],
}
31 changes: 18 additions & 13 deletions addons/io_hubs_addon/debugger.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@ def is_user_in_room():


def get_room_name():
return web_driver.execute_script('try { return APP?.hub?.name || APP?.hub?.slug || APP?.hub?.hub_id; } catch(e) { return ""; }')
return web_driver.execute_script(
'try { return APP?.hub?.name || APP?.hub?.slug || APP?.hub?.hub_id; } catch(e) { return ""; }')


def bring_to_front(context):
Expand Down Expand Up @@ -172,10 +173,8 @@ def execute(self, context):
return {'FINISHED'}
except Exception as err:
print(err)
bpy.ops.wm.hubs_report_viewer('INVOKE_DEFAULT', title="Hubs scene debugger report",
report_string='\n\n'.join(["The scene export has failed",
"Check the export logs or quit the browser instance and try again",
f'{err}']))
bpy.ops.wm.hubs_report_viewer('INVOKE_DEFAULT', title="Hubs scene debugger report", report_string='\n\n'.join(
["The scene export has failed", "Check the export logs or quit the browser instance and try again", f'{err}']))
return {'CANCELLED'}


Expand Down Expand Up @@ -738,26 +737,32 @@ class HubsSceneDebuggerPrefs(bpy.types.PropertyGroup):

class HubsSceneDebuggerRoomCreatePrefs(bpy.types.PropertyGroup):
newLoader: bpy.props.BoolProperty(
name=PARAMS_TO_STRING["newLoader"]["name"], default=True, description=PARAMS_TO_STRING["newLoader"]["description"])
name=PARAMS_TO_STRING["newLoader"]["name"],
default=True, description=PARAMS_TO_STRING["newLoader"]["description"])
ecsDebug: bpy.props.BoolProperty(
name=PARAMS_TO_STRING["ecsDebug"]["name"], default=True, description=PARAMS_TO_STRING["ecsDebug"]["description"])
name=PARAMS_TO_STRING["ecsDebug"]["name"],
default=True, description=PARAMS_TO_STRING["ecsDebug"]["description"])
vr_entry_type: bpy.props.BoolProperty(
name=PARAMS_TO_STRING["vr_entry_type"]["name"], default=True, description=PARAMS_TO_STRING["vr_entry_type"]["description"])
name=PARAMS_TO_STRING["vr_entry_type"]["name"],
default=True, description=PARAMS_TO_STRING["vr_entry_type"]["description"])
debugLocalScene: bpy.props.BoolProperty(name=PARAMS_TO_STRING["debugLocalScene"]["name"], default=True,
description=PARAMS_TO_STRING["debugLocalScene"]["description"])


class HubsSceneDebuggerRoomExportPrefs(bpy.types.PropertyGroup):
export_cameras: bpy.props.BoolProperty(name="Export Cameras", default=True,
description="Export cameras", options=set())
export_lights: bpy.props.BoolProperty(name="Export Lights",
default=True, description="Punctual Lights, Export directional, point, and spot lights. Uses \"KHR_lights_punctual\" glTF extension", options=set())
export_lights: bpy.props.BoolProperty(
name="Export Lights", default=True,
description="Punctual Lights, Export directional, point, and spot lights. Uses \"KHR_lights_punctual\" glTF extension",
options=set())
use_selection: bpy.props.BoolProperty(name="Selection Only", default=False,
description="Selection Only, Export selected objects only.",
options=set())
export_apply: bpy.props.BoolProperty(name="Apply Modifiers", default=True,
description="Apply Modifiers, Apply modifiers (excluding Armatures) to mesh objects -WARNING: prevents exporting shape keys.",
options=set())
export_apply: bpy.props.BoolProperty(
name="Apply Modifiers", default=True,
description="Apply Modifiers, Apply modifiers (excluding Armatures) to mesh objects -WARNING: prevents exporting shape keys.",
options=set())
use_visible: bpy.props.BoolProperty(
name='Visible Objects',
description='Export visible objects only',
Expand Down
10 changes: 6 additions & 4 deletions addons/io_hubs_addon/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,9 @@ def save_prefs(context):

except Exception as err:
import bpy
bpy.ops.wm.hubs_report_viewer('INVOKE_DEFAULT', title="Hubs scene debugger report",
report_string=f'An error happened while saving the preferences from {out_path}: {err}')
bpy.ops.wm.hubs_report_viewer(
'INVOKE_DEFAULT', title="Hubs scene debugger report",
report_string=f'An error happened while saving the preferences from {out_path}: {err}')


def load_prefs(context):
Expand All @@ -150,8 +151,9 @@ def load_prefs(context):

except Exception as err:
import bpy
bpy.ops.wm.hubs_report_viewer('INVOKE_DEFAULT', title="Hubs scene debugger report",
report_string=f'An error happened while loading the preferences from {out_path}: {err}')
bpy.ops.wm.hubs_report_viewer(
'INVOKE_DEFAULT', title="Hubs scene debugger report",
report_string=f'An error happened while loading the preferences from {out_path}: {err}')

if not data:
return
Expand Down

0 comments on commit f172034

Please sign in to comment.