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

Scene Debugger followup PR #253

Merged
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
24 changes: 23 additions & 1 deletion addons/io_hubs_addon/debugger.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,10 @@ def export_scene(context):
'use_active_collection': export_prefs.use_active_collection,
'export_apply': export_prefs.export_apply,
'export_force_sampling': False,
'use_active_scene': True
}
if bpy.app.version >= (3, 2, 0):
Copy link
Contributor

Choose a reason for hiding this comment

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

Just curious does this do any harm if < 3.2.0? Does it crash?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The use_active_scene export option isn't present in the glTF add-on in Blender versions under 3.2, so trying to include it causes the export to fail in those versions.

args['use_active_scene'] = True

bpy.ops.export_scene.gltf(**args)


Expand Down Expand Up @@ -470,6 +472,11 @@ def draw(self, context: Context):
"use_renderable")
col.prop(context.scene.hubs_scene_debugger_room_export_prefs,
"use_active_collection")
if bpy.app.version >= (3, 2, 0):
col_row = col.row()
col_row.enabled = False
col_row.prop(context.scene.hubs_scene_debugger_room_export_prefs,
"use_active_scene")
row = box.row()
col = row.column(heading="Data:")
col.use_property_split = True
Expand All @@ -483,6 +490,13 @@ def draw(self, context: Context):
col.prop(context.scene.hubs_scene_debugger_room_export_prefs,
"export_apply")
row = box.row()
col = row.column(heading="Animation:")
col.use_property_split = True
col_row = col.row()
col_row.enabled = False
col_row.prop(context.scene.hubs_scene_debugger_room_export_prefs,
"export_force_sampling")
row = box.row()

update_mode = "Update Scene" if context.scene.hubs_scene_debugger_room_create_prefs.debugLocalScene else "Spawn as object"
if isWebdriverAlive():
Expand Down Expand Up @@ -783,6 +797,14 @@ class HubsSceneDebuggerRoomExportPrefs(bpy.types.PropertyGroup):
default=False,
options=set()
)
use_active_scene: bpy.props.BoolProperty(
name='Active Scene',
description='Export objects in the active scene only. This has been forced ON because Hubs can only use one scene anyway',
default=True, options=set())
export_force_sampling: bpy.props.BoolProperty(
name='Sampling Animations',
description='Apply sampling to all animations. This has been forced OFF because it can break animations in Hubs',
default=False, options=set())


@persistent
Expand Down