Skip to content

Commit

Permalink
rename extensions to be consistent with new repo (#408)
Browse files Browse the repository at this point in the history
Co-authored-by: Randy Frank <randy.frank@ansys.com>
Co-authored-by: Randy Frank <89219420+randallfrank@users.noreply.github.com>
  • Loading branch information
3 people authored Aug 14, 2024
1 parent 9185014 commit d12d735
Show file tree
Hide file tree
Showing 42 changed files with 294 additions and 228 deletions.
Binary file modified doc/source/_static/omniverse_app_exts.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified doc/source/_static/omniverse_extension.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 16 additions & 16 deletions doc/source/user_guide/omniverse_info.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ or later.

The API is available through a PyEnSight session instance, from EnSight
Python directly as (ensight.utils.omniverse for 2025 R1 and later) and
from within Omniverse applications via the ansys.geometry.service and
ansys.geometry.serviceui kit extensions.
from within Omniverse applications via the ansys.tools.omniverse.core and
ansys.tools.omniverse.dsgui kit extensions.

The Python API is defined here: :class:`Omniverse<ansys.pyensight.core.utils.omniverse.Omniverse>`.

Expand Down Expand Up @@ -107,7 +107,7 @@ an EnSight session or the GUI panel can be used to connect to a
copy of EnSight that was launched with the ``-grpc_server {port}``
option specified.

The ``ansys.geometry.serviceui`` kit includes a GUI similar to the
The ``ansys.tools.omniverse.dsgui`` kit includes a GUI similar to the
EnSight 2025 R1 user-defined tool. It allows one to select a
target URI in Omniverse and the details of a gRPC connection
to a running EnSight. For example, if one launches EnSight with
Expand All @@ -117,7 +117,7 @@ scene to Omniverse.

.. note::

If the ``ansys.geometry.service`` and ``ansys.geometry.serviceui``
If the ``ansys.tools.omniverse.core`` and ``ansys.tools.omniverse.dsgui``
do not show up in the Community extensions list in Omniverse, then
it can be added to the ``Extension Search Paths`` list as:
``git://github.com/ansys/pyensight.git?branch=main&dir=exts``.
Expand All @@ -137,7 +137,7 @@ From the Command Line
^^^^^^^^^^^^^^^^^^^^^

Omniverse kits can be run as command line tools and
the ``ansys.geometry.service`` is designed to support this mode
the ``ansys.tools.omniverse.core`` is designed to support this mode
of operation as well. For this to work, one needs a copy of the
pyensight wheel and the name of a ``kit`` executable. The pyensight wheel
can be built by checking out the repo and building it. One can
Expand All @@ -155,29 +155,29 @@ from the command line like this:
.. code-block:: bat
cd "C:\Users\user1\AppData\Local\ov\pkg\create-2023.2.5"
.\kit.bat --ext-folder "D:\repos\pyensight\src\ansys\pyensight\core\exts" --enable ansys.geometry.service --/exts/ansys.geometry.service/help=1
.\kit.bat --ext-folder "D:\repos\pyensight\src\ansys\pyensight\core\exts" --enable ansys.tools.omniverse.core --/exts/ansys.tools.omniverse.core/help=1
Will generate the following output in the logs:

.. code-block::
ANSYS Omniverse Geometry Service: ansys.geometry.service-0.8.5
--/exts/ansys.geometry.service/help=1
ANSYS Tools Omniverse Core:: ansys.tools.omniverse.core-0.1.0
--/exts/ansys.tools.omniverse.core/help=1
Display this help.
--/exts/ansys.geometry.service/run=1
--/exts/ansys.tools.omniverse.core/run=1
Run the server.
--/exts/ansys.geometry.service/omniUrl=URL
--/exts/ansys.tools.omniverse.core/omniUrl=URL
Omniverse pathname. (default: omniverse://localhost/Users/test)
--/exts/ansys.geometry.service/dsgUrl=URL
--/exts/ansys.tools.omniverse.core/dsgUrl=URL
Dynamic Scene Graph connection URL. (default: grpc://127.0.0.1:5234)
--/exts/ansys.geometry.service/securityCode=TOKEN
--/exts/ansys.tools.omniverse.core/securityCode=TOKEN
Dynamic Scene Graph security token. (default: )
--/exts/ansys.geometry.service/temporal=0|1
--/exts/ansys.tools.omniverse.core/temporal=0|1
If non-zero, include all timeseteps in the scene. (default: False)
--/exts/ansys.geometry.service/vrmode=0|1
--/exts/ansys.tools.omniverse.core/vrmode=0|1
If non-zero, do not include a camera in the scene. (default: False)
--/exts/ansys.geometry.service/normalizeGeometry=0|1
--/exts/ansys.tools.omniverse.core/normalizeGeometry=0|1
If non-zero, remap the geometry to the domain [-1,-1,-1]-[1,1,1]. (default: False)
Expand All @@ -186,7 +186,7 @@ from the command line. This version of the service will be run using the versio
installed in the specified ``--ext-folder``. When run as above, the service will use the
latest released of the ansys.pyensight.core wheel. It is important the the ``--ext-folder`` option
point to the ``exts`` directory inside of the ``ansys\pyensight\core`` directories as this will
cause the kit to use the ``ansys.pyensight.core`` module from the directories above the kit
cause the kit to use the ``ansys.tools.omniverse.core`` module from the directories above the kit
instead of the any version installed in the kit Python itself.


Expand Down
14 changes: 0 additions & 14 deletions exts/ansys.geometry.service/docs/CHANGELOG.md

This file was deleted.

14 changes: 0 additions & 14 deletions exts/ansys.geometry.serviceui/docs/CHANGELOG.md

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.9.0-dev0
Original file line number Diff line number Diff line change
Expand Up @@ -20,34 +20,55 @@
build of ansys-pyensight-core. If the appropriate environmental variables
are set, a pip install from another repository can be forced.
"""
extra_args = []
if "ANSYS_PYPI_INDEX_URL" in os.environ:
extra_args.append(os.environ["ANSYS_PYPI_INDEX_URL"])
pyensight_version_file = os.path.join(os.path.dirname(__file__), "PYENSIGHT_VERSION")
pyensight_version = None
with open(pyensight_version_file, "r") as version_file:
pyensight_version = str(version_file.read()).strip()

if os.environ.get("ANSYS_PYPI_REINSTALL", "") == "1":
extra_args.extend(["--upgrade", "--no-deps", "--no-cache-dir", "--force-reinstall", "--pre"])
version = f"{pyensight_version}" if pyensight_version else None

logging.warning("ansys.geometry.server - Forced reinstall ansys-pyensight-core")
omni.kit.pipapi.install("ansys-pyensight-core", extra_args=extra_args)
extra_args = []
if "dev0" in version and "ANSYS_PYPI_INDEX_URL" in os.environ:
# Get PyEnSight from the private PyPi repo - dev environment
extra_args.append(str(os.environ["ANSYS_PYPI_INDEX_URL"]))
extra_args.append("--pre")

if os.environ.get("ANSYS_PYPI_REINSTALL", "") == "1":
package_name = "ansys-pyensight-core"

# Add possibility of installing local wheels
if os.environ.get("ANSYS_PYENSIGHT_LOCAL_WHEEL"):
package_name = os.environ.get("ANSYS_PYENSIGHT_LOCAL_WHEEL")

extra_args.extend(
[
"--upgrade",
"--no-cache-dir",
"--force-reinstall",
]
)

logging.warning("ansys.tools.omniverse.server - Forced reinstall ansys-pyensight-core")
# Add ignore cache attribute when reinstalling so that you can switch between dev and released versions if needed
omni.kit.pipapi.install(package_name, extra_args=extra_args, version=version, ignore_cache=True)
try:
# Checking to see if we need to install the module
import ansys.pyensight.core
import ansys.pyensight.core.utils.dsg_server as tmp_dsg_server # noqa: F401
import ansys.pyensight.core.utils.omniverse_dsg_server as tmp_ov_dsg_server # noqa: F401
except ModuleNotFoundError:
logging.warning("ansys.geometry.server - Installing ansys-pyensight-core")
omni.kit.pipapi.install("ansys-pyensight-core", extra_args=extra_args)
logging.warning("ansys.tools.omniverse.server - Installing ansys-pyensight-core")
omni.kit.pipapi.install("ansys-pyensight-core", extra_args=extra_args, version=version)

"""
If we have a local copy of the module, the above installed the correct
dependencies, but we want to use the local copy. Do this by prefixing
the path and (re)load the modules. The pyensight wheel includes the
following for this file:
ansys\pyensight\core\exts\ansys.geometry.service\ansys\geometry\service\extension.py
ansys\pyensight\core\exts\ansys.tools.omniverse.core\ansys\tools\omniverse\core\extension.py
"""
kit_dir = __file__
for _ in range(5):
for _ in range(6):
kit_dir = os.path.dirname(kit_dir)
"""
At this point, the name should be: {something}\ansys\pyensight\core\exts
Expand All @@ -70,11 +91,19 @@

# force a reload if we changed the path or had a partial failure that lead
# to a pipapi install.
_ = reload(ansys.pyensight.core)
try:
_ = reload(ansys.pyensight.core)
except Exception:
pass

import ansys.pyensight.core.utils # noqa: F811, E402

_ = reload(ansys.pyensight.core.utils)

import ansys.pyensight.core.utils.dsg_server as dsg_server # noqa: E402

_ = reload(ansys.pyensight.core.utils.dsg_server)

import ansys.pyensight.core.utils.omniverse_dsg_server as ov_dsg_server # noqa: E402

_ = reload(ansys.pyensight.core.utils.omniverse_dsg_server)
Expand All @@ -87,7 +116,7 @@ def find_kit_filename() -> Optional[str]:
Use a combination of the current omniverse application and the information
in the local .nvidia-omniverse/config/omniverse.toml file to come up with
the pathname of a kit executable suitable for hosting another copy of the
ansys.geometry.server kit.
ansys.tools.omniverse.server kit.
Returns
-------
Expand Down Expand Up @@ -128,7 +157,7 @@ def find_kit_filename() -> Optional[str]:
return None


class AnsysGeometryServiceServerExtension(omni.ext.IExt):
class AnsysToolsOmniverseCoreServerExtension(omni.ext.IExt):
"""
This class is an Omniverse kit. The kit is capable of creating a
connection to an Ansys Distributed Scene Graph service and pushing
Expand Down Expand Up @@ -160,6 +189,8 @@ def __init__(self, *args, **kwargs) -> None:
@property
def pyensight_version(self) -> str:
"""The ansys.pyensight.core version"""
if version:
return version
return ansys.pyensight.core.VERSION

@property
Expand Down Expand Up @@ -226,7 +257,7 @@ def time_scale(self, value: float) -> None:
self._time_scale = value

@classmethod
def get_instance(cls) -> Optional["AnsysGeometryServiceServerExtension"]:
def get_instance(cls) -> Optional["AnsysToolsOmniverseCoreServerExtension"]:
return cls._service_instance

@classmethod
Expand Down Expand Up @@ -302,8 +333,8 @@ def on_startup(self, ext_id: str) -> None:
The specific version of the kit.
"""
self._version = ext_id
self.info(f"ANSYS geometry service server startup: {self._version}")
AnsysGeometryServiceServerExtension._service_instance = self
self.info(f"ANSYS tools omniverse core server startup: {self._version}")
AnsysToolsOmniverseCoreServerExtension._service_instance = self
if self._setting("help") is not None:
self.help()
elif self._setting("run") is not None:
Expand All @@ -313,38 +344,38 @@ def on_shutdown(self) -> None:
"""
Called by Omniverse when the kit instance is shutting down.
"""
self.info("ANSYS geometry service server shutdown")
self.info("ANSYS tools omniverse core server shutdown")
self.shutdown()
AnsysGeometryServiceServerExtension._service_instance = None
AnsysToolsOmniverseCoreServerExtension._service_instance = None

def help(self) -> None:
"""
Send the CLI help output to logging.
"""
self.warning(f"ANSYS Omniverse Geometry Service: {self._version}")
self.warning(" --/exts/ansys.geometry.service/help=1")
self.warning(f"ANSYS Tools Omniverse Core: {self._version}")
self.warning(" --/exts/ansys.tools.omniverse.core/help=1")
self.warning(" Display this help.")
self.warning(" --/exts/ansys.geometry.service/run=1")
self.warning(" --/exts/ansys.tools.omniverse.core/run=1")
self.warning(" Run the server.")
self.warning(" --/exts/ansys.geometry.service/omniUrl=URL")
self.warning(" --/exts/ansys.tools.omniverse.core/omniUrl=URL")
self.warning(f" Omniverse pathname. (default: {self.omni_uri})")
self.warning(" --/exts/ansys.geometry.service/dsgUrl=URL")
self.warning(" --/exts/ansys.tools.omniverse.core/dsgUrl=URL")
self.warning(f" Dynamic Scene Graph connection URL. (default: {self.dsg_uri})")
self.warning(" --/exts/ansys.geometry.service/securityCode=TOKEN")
self.warning(" --/exts/ansys.tools.omniverse.core/securityCode=TOKEN")
self.warning(f" Dynamic Scene Graph security token. (default: {self.security_token})")
self.warning(" --/exts/ansys.geometry.service/temporal=0|1")
self.warning(" --/exts/ansys.tools.omniverse.core/temporal=0|1")
self.warning(
f" If non-zero, include all timeseteps in the scene. (default: {self.temporal})"
)
self.warning(" --/exts/ansys.geometry.service/vrmode=0|1")
self.warning(" --/exts/ansys.tools.omniverse.core/vrmode=0|1")
self.warning(
f" If non-zero, do not include a camera in the scene. (default: {self.vrmode})"
)
self.warning(" --/exts/ansys.geometry.service/normalizeGeometry=0|1")
self.warning(" --/exts/ansys.tools.omniverse.core/normalizeGeometry=0|1")
self.warning(
f" If non-zero, remap the geometry to the domain [-1,-1,-1]-[1,1,1]. (default: {self.normalize_geometry})"
)
self.warning(" --/exts/ansys.geometry.service/timeScale=FLOAT")
self.warning(" --/exts/ansys.tools.omniverse.core/timeScale=FLOAT")
self.warning(
f" Multiply all DSG time values by this value. (default: {self.time_scale})"
)
Expand Down Expand Up @@ -397,20 +428,20 @@ def launch_server(self) -> None:
for _ in range(5):
kit_dir = os.path.dirname(kit_dir)
cmd.extend(["--ext-folder", kit_dir])
cmd.extend(["--enable", "ansys.geometry.service"])
cmd.extend(["--enable", "ansys.tools.omniverse.core"])
if self.security_token:
cmd.append(f'--/exts/ansys.geometry.service/securityCode="{self.security_token}"')
cmd.append(f'--/exts/ansys.tools.omniverse.core/securityCode="{self.security_token}"')
if self.temporal:
cmd.append("--/exts/ansys.geometry.service/temporal=1")
cmd.append("--/exts/ansys.tools.omniverse.core/temporal=1")
if self.vrmode:
cmd.append("--/exts/ansys.geometry.service/vrmode=1")
cmd.append("--/exts/ansys.tools.omniverse.core/vrmode=1")
if self.normalize_geometry:
cmd.append("--/exts/ansys.geometry.service/normalizeGeometry=1")
cmd.append("--/exts/ansys.tools.omniverse.core/normalizeGeometry=1")
if self.time_scale != 1.0:
cmd.append(f"--/exts/ansys.geometry.service/timeScale={self.time_scale}")
cmd.append(f"--/exts/ansys.geometry.service/omniUrl={self.omni_uri}")
cmd.append(f"--/exts/ansys.geometry.service/dsgUrl={self.dsg_uri}")
cmd.append("--/exts/ansys.geometry.service/run=1")
cmd.append(f"--/exts/ansys.tools.omniverse.core/timeScale={self.time_scale}")
cmd.append(f"--/exts/ansys.tools.omniverse.core/omniUrl={self.omni_uri}")
cmd.append(f"--/exts/ansys.tools.omniverse.core/dsgUrl={self.dsg_uri}")
cmd.append("--/exts/ansys.tools.omniverse.core/run=1")
env_vars = os.environ.copy()
# we are launching the kit from an Omniverse app. In this case, we
# inform the kit instance of:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
[package]
# Semantic Versioning is used: https://semver.org/
version = "0.9.0-dev0"
version = "0.1.0"

# Lists people or organizations that are considered the "authors" of the package.
authors = ["ANSYS"]

# The title and description fields are primarily for displaying extension info in UI
title = "ANSYS Omniverse Geometry Service Server"
title = "ANSYS Tools Omniverse Core Server"
description = "A geometry synchronization service that enables export of geometry scenes from ANSYS products to Omniverse."

# Path (relative to the root) or content of readme markdown file for UI.
readme = "docs/README.md"

# URL of the extension source repository.
repository = "https://github.com/ansys/pyensight"
repository = "https://github.com/ansys-internal/ansys-tools-omniverse"

# One of categories for UI.
category = "simulation"
Expand All @@ -38,9 +38,9 @@ icon = "data/icon.png"
"omni.client" = {}
"omni.usd" = {}

# Main python module this extension provides, it will be publicly available as "import ansys.geometry.service".
# Main python module this extension provides, it will be publicly available as "import ansys.tools.omniverse.core".
[[python.module]]
name = "ansys.geometry.service"
name = "ansys.tools.omniverse.core"

[[test]]
# Extra dependencies only to be used during test run
Expand All @@ -50,10 +50,10 @@ dependencies = [

[settings]
# CLI setting defaults (note: "help" and "run" are also supported)
exts."ansys.geometry.service".dsgUrl = "grpc://127.0.0.1:5234"
exts."ansys.geometry.service".omniUrl = "omniverse://localhost/Users/test"
exts."ansys.geometry.service".securityCode = ""
exts."ansys.geometry.service".temporal = "0"
exts."ansys.geometry.service".vrmode = "0"
exts."ansys.geometry.service".normalizeGeometry = "0"
exts."ansys.geometry.service".timeScale = "1.0"
exts."ansys.tools.omniverse.core".dsgUrl = "grpc://127.0.0.1:5234"
exts."ansys.tools.omniverse.core".omniUrl = "omniverse://localhost/Users/test"
exts."ansys.tools.omniverse.core".securityCode = ""
exts."ansys.tools.omniverse.core".temporal = "0"
exts."ansys.tools.omniverse.core".vrmode = "0"
exts."ansys.tools.omniverse.core".normalizeGeometry = "0"
exts."ansys.tools.omniverse.core".timeScale = "1.0"
File renamed without changes
8 changes: 8 additions & 0 deletions exts/ansys.tools.omniverse.core/docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changelog

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).


## [0.1.0] - 2024-07-30
- First version

Loading

0 comments on commit d12d735

Please sign in to comment.