diff --git a/__init__.py b/__init__.py index 8233d1aab..cdba9256d 100644 --- a/__init__.py +++ b/__init__.py @@ -219,6 +219,11 @@ class Fast64Settings_Properties(bpy.types.PropertyGroup): internal_game_update_ver: bpy.props.IntProperty(default=0) + internal_background_mode: bpy.props.BoolProperty( + default=False, + description="Used to disable certain parts of the codebase when Fast64 is ran with Blender in CLI mode", + ) + def to_repo_settings(self): data = {} data["autoLoad"] = self.auto_repo_load_settings diff --git a/fast64_internal/utility.py b/fast64_internal/utility.py index 61b503dcd..a9b3d8460 100644 --- a/fast64_internal/utility.py +++ b/fast64_internal/utility.py @@ -155,7 +155,10 @@ def unhideAllAndGetHiddenState(scene): if bpy.context.mode != "OBJECT": bpy.ops.object.mode_set(mode="OBJECT") - bpy.ops.object.hide_view_clear() + + if not scene.fast64.settings.internal_background_mode: + # the viewport is disabled when blender is ran in background mode, so we need to disable this to avoid errors + bpy.ops.object.hide_view_clear() hiddenLayerCols = []