Skip to content

feat: Move and improve USD to HTML logic to visualization interface#575

Merged
AlejandroFernandezLuces merged 33 commits into
mainfrom
feat/usd-html-converter
Jul 20, 2026
Merged

feat: Move and improve USD to HTML logic to visualization interface#575
AlejandroFernandezLuces merged 33 commits into
mainfrom
feat/usd-html-converter

Conversation

@AlejandroFernandezLuces

@AlejandroFernandezLuces AlejandroFernandezLuces commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

The rationale behind this migration is mainly because for this conversion we do not need to have the compiled version of OpenUSD. I think it is better to just have the functionality here, since most packages are already consuming this one.

AlejandroFernandezLuces and others added 24 commits July 16, 2026 11:19
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…all]

- Add line_color validation (CSS hex color regex) in export_usd_to_html
- Fix source type annotation: str | Path | object (was missing object)
- Add upper-bound to usd-core: >= 24.0,< 26
- Add usd-core and ansys-tools-usdviewer to [all] extra
- Add test_invalid_line_color_raises and test_valid_line_color_passes
- Fix integration test to capture and assert return value
- Ensure EOF newline in usdviewer.rst

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ests

pytest.importorskip finds the mock pxr injected by unit-test sys.modules.setdefault,
so add a sentinel check that skips when pxr.Usd.Stage.CreateInMemory is absent.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Covers four scenarios: file-path input, in-memory Stage input,
wireframe overlay options, and opening the result in a browser.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Required so doc builds can execute the USD-to-HTML export example.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…vious SDD scratch

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Cross-file test order can shadow this file's pxr mocks because
test_usd_interface.py assigns sys.modules['pxr'] = MagicMock()
while this file used setdefault. Whichever module loads last wins,
and _inject_mesh_lines does 'from pxr import UsdGeom' at call time,
so setting _mock_usd_geom.Mesh.return_value became a silent no-op.

Switch to plain assignment and add an autouse fixture that reinstalls
the mocks and resets _mock_usd_geom before every test in the class.
This unblocks test_with_triangle_prim_injects_eighteen_floats, which
now passes in both isolated and full-suite runs.

Also amend the migration plan to drop 'ruff format --check' from Task 10:
the repo's pre-commit only runs the ruff linter, and indent-style=tab
would convert every space-indented file to tabs — a policy change out
of scope for this migration.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot added documentation Improvements or additions to documentation maintenance Package and maintenance related testing Anything related to testing enhancement New features or code improvements labels Jul 17, 2026
@AlejandroFernandezLuces
AlejandroFernandezLuces marked this pull request as ready for review July 17, 2026 10:46

@RobPasMue RobPasMue left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Overall logic seems good but a lot of code.. i'm guessing it's all necessary but it's hard to review such a big PR

Comment thread examples/02-basic-usd-examples/usd_to_html_export.py Outdated
Comment thread examples/02-basic-usd-examples/usd_to_html_export.py Outdated
Comment thread examples/02-basic-usd-examples/usd_to_html_export.py Outdated
Comment thread pyproject.toml Outdated
Comment thread pyproject.toml Outdated
Comment thread src/ansys/tools/visualization_interface/backends/usd/web/templates.py Outdated
AlejandroFernandezLuces and others added 2 commits July 20, 2026 11:08
Co-authored-by: Roberto Pastor Muela <37798125+RobPasMue@users.noreply.github.com>
@RobPasMue

Copy link
Copy Markdown
Member

Documenting how to create a custom template will be needed - apart from that all good!

@AlejandroFernandezLuces
AlejandroFernandezLuces merged commit da15c22 into main Jul 20, 2026
25 checks passed
@AlejandroFernandezLuces
AlejandroFernandezLuces deleted the feat/usd-html-converter branch July 20, 2026 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New features or code improvements maintenance Package and maintenance related testing Anything related to testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants