Skip to content
Merged
Show file tree
Hide file tree
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: 17 additions & 7 deletions tests/test_imgui_overlay.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,23 @@ def _init_imgui_deterministic(self):

monkeypatch.setattr(ImGuiOverlayPlugin, "_init_imgui", _init_imgui_deterministic)

# The Scene tab prints each FileMorph's resolved path, an absolute machine-specific location, via text_wrapped.
# Reduce it to its basename for two reasons: the captured frame must be reproducible across the snapshot host and
# CI runners, and the panel auto-resizes its height to fit the wrapped path - so a long path (two wrapped lines)
# makes the panel taller than the basename (one line). The substitution must happen before the panel first
# renders, otherwise build() lays out the long path and the auto-resized window stays one frame behind when
# captured, giving a taller, non-reproducible frame. Hook the plugin's entity capture to apply it up front.
orig_capture = ImGuiOverlayPlugin._capture_pending_entities_kwargs

def _capture_pending_entities_basename(self):
orig_capture(self)
for entity_kwargs in self._pending_entities_kwargs.values():
morph = entity_kwargs["morph"]
if isinstance(morph, gs.morphs.FileMorph):
morph.file = os.path.basename(morph.file)

monkeypatch.setattr(ImGuiOverlayPlugin, "_capture_pending_entities_kwargs", _capture_pending_entities_basename)


def _build_default_scene(*, enable_gui):
scene = gs.Scene(
Expand Down Expand Up @@ -180,13 +197,6 @@ def test_editing_controls(png_snapshot, monkeypatch):

scene.build()

# The Scene tab prints each FileMorph's resolved path, which is an absolute machine-specific location. Reduce it
# to its basename so the captured frame is reproducible across the snapshot host and CI runners.
for entity_kwargs in plugin._pending_entities_kwargs.values():
morph = entity_kwargs["morph"]
if isinstance(morph, gs.morphs.FileMorph):
morph.file = os.path.basename(morph.file)

pyrender_viewer = scene.viewer._pyrender_viewer
pyrender_viewer.switch_to()
pyrender_viewer.on_draw()
Expand Down
2 changes: 1 addition & 1 deletion tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
DEFAULT_BRANCH_NAME = "main"

HUGGINGFACE_ASSETS_REVISION = "8ae68c5236abf310367345dfb6dd6e6e8affe3c6"
HUGGINGFACE_SNAPSHOT_REVISION = "3a51972d4831ad1f9bc8bb7e41e3f4fbcdb3a044"
HUGGINGFACE_SNAPSHOT_REVISION = "fe84ed8bdef4866078b9e18456be025008bfafe9"

MESH_EXTENSIONS = (".mtl", *MESH_FORMATS, *GLTF_FORMATS, *USD_FORMATS)
IMAGE_EXTENSIONS = (".png", ".jpg")
Expand Down
Loading