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

Mostieri/omniverse api hint #357

Merged
merged 2 commits into from
Mar 13, 2024
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
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ classifiers = [

dependencies = [
"importlib-metadata>=4.0; python_version<='3.8'",
"ansys-api-pyensight==0.3.6",
"ansys-api-pyensight==0.3.7",
"requests>=2.28.2",
"docker>=6.1.0",
"urllib3<2",
Expand Down
5 changes: 5 additions & 0 deletions src/ansys/pyensight/core/utils/omniverse.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import os
import subprocess
import sys
from types import ModuleType
from typing import TYPE_CHECKING, Optional, Union

import psutil
Expand Down Expand Up @@ -121,6 +122,8 @@ def create_connection(
the connection between EnSight and Omniverse.

"""
if not isinstance(self._ensight, ModuleType):
self._ensight._session.ensight_version_check("2023 R2")
self._check_modules()
if self._is_running_omniverse():
raise RuntimeError("An Omniverse server connection is already active.")
Expand Down Expand Up @@ -191,6 +194,8 @@ def update(self) -> None:
Push the current EnSight scene to the current Omniverse connection.

"""
if not isinstance(self._ensight, ModuleType):
self._ensight._session.ensight_version_check("2023 R2")
self._check_modules()
if not self._is_running_omniverse():
raise RuntimeError("No Omniverse server connection is currently active.")
Expand Down
2 changes: 2 additions & 0 deletions src/ansys/pyensight/core/utils/omniverse_dsg_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,8 @@ def clean_name(name: str, id_name: Any = None) -> str:
name = name.replace("[", "_").replace("]", "_")
name = name.replace("(", "_").replace(")", "_")
name = name.replace("<", "_").replace(">", "_")
name = name.replace("/", "_").replace("=", "_")
name = name.replace(",", "_")
if id is not None:
name = name + "_" + str(id_name)
return name
Expand Down
Loading