├── .gitattributes ├── .gitignore ├── CHANGES.md ├── CMakeLists.txt ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── PackmanDeps.cmake ├── README.md ├── SECURITY.md ├── VERSION.md ├── bootstrap.py ├── build.bat ├── build.sh ├── deps ├── host-deps.packman.xml ├── repo-deps.packman.xml ├── target-deps.packman.xml └── usd-deps.packman.xml ├── docs ├── about-openusd-plugins.md └── build-instructions.md ├── images ├── data_sources.png ├── dynamic_payload_architecture.png ├── edf_plugin_example.png ├── file_format_architecture.png ├── file_format_plugin_example.png └── usd_plugin_architecture.png ├── repo.bat ├── repo.sh ├── repo.toml ├── resources ├── assets │ └── materials │ │ ├── ceramic_material.usda │ │ └── cloth_material.usda ├── empty.edf ├── metrics_assembler.usda ├── metrics_assembler_2.usda ├── ocean │ ├── grid_1000.usda │ ├── grid_128.usda │ ├── grid_128_smooth.usda │ ├── grid_256.usda │ └── top.usda ├── scene.usda ├── warp_demo_cloth.usda ├── warp_demo_mesh.usda ├── warp_demo_particles.usda └── wgs84 │ ├── deutschebahn-rails.usda │ ├── quadnode-0.png │ ├── quadnode-1.png │ └── quadnode-4.png ├── scripts └── setup.py ├── setenvlinux ├── setenvwindows ├── setenvwindows.bat ├── src ├── hydra-plugins │ ├── README.md │ ├── images │ │ ├── hydra2_architecture2.png │ │ ├── hydra2_omni_geospatial_datasources.png │ │ ├── hydra2_omni_geospatial_overview.png │ │ ├── hydra2_omni_metrics_assembler_adapter.png │ │ ├── hydra2_xform_data_source.png │ │ ├── hydra_scene_browser.png │ │ ├── hyrdra_overview.png │ │ └── usdview.png │ ├── omniGeoSceneIndex │ │ ├── api.h │ │ ├── computedDependentDataSource.cpp │ │ ├── computedDependentDataSource.h │ │ ├── computedPrimDataSource.cpp │ │ ├── computedPrimDataSource.h │ │ ├── geospatialDataSource.cpp │ │ ├── geospatialDataSource.h │ │ ├── geospatialSceneIndex.cpp │ │ ├── geospatialSceneIndex.h │ │ ├── geospatialSceneIndexPlugin.cpp │ │ ├── geospatialSceneIndexPlugin.h │ │ ├── localPositionAPIAdapter.cpp │ │ ├── localPositionAPIAdapter.h │ │ ├── localPositionDataSource.cpp │ │ ├── localPositionDataSource.h │ │ ├── localPositionSchema.cpp │ │ ├── localPositionSchema.h │ │ ├── plugInfo.json │ │ ├── referencePositionAPIAdapter.cpp │ │ ├── referencePositionAPIAdapter.h │ │ ├── referencePositionDataSource.cpp │ │ ├── referencePositionDataSource.h │ │ ├── referencePositionSchema.cpp │ │ └── referencePositionSchema.h │ ├── omniMetricsAssembler │ │ ├── api.h │ │ ├── metricsAdapter.cpp │ │ ├── metricsAdapter.h │ │ ├── metricsDataSource.cpp │ │ ├── metricsDataSource.h │ │ ├── metricsDoubleDataSource.cpp │ │ ├── metricsDoubleDataSource.h │ │ ├── metricsSceneIndex.cpp │ │ ├── metricsSceneIndex.h │ │ ├── metricsSceneIndexPlugin.cpp │ │ ├── metricsSceneIndexPlugin.h │ │ ├── metricsSchema.cpp │ │ ├── metricsSchema.h │ │ └── plugInfo.json │ └── omniWarpSceneIndex │ │ ├── __init__.py │ │ ├── oceanSim │ │ ├── __init__.py │ │ ├── preferences.py │ │ ├── preferencesUI.py │ │ ├── preferencesUI.ui │ │ └── preferencesUI_pyside6.py │ │ ├── plugInfo.json │ │ ├── schema.usda │ │ ├── warpComputationAPIAdapter.cpp │ │ ├── warpComputationAPIAdapter.h │ │ ├── warpComputationSchema.cpp │ │ ├── warpComputationSchema.h │ │ ├── warpModules │ │ ├── __init__.py │ │ ├── cloth.py │ │ ├── deform01.py │ │ ├── deform02.py │ │ ├── ocean.py │ │ └── particles.py │ │ ├── warpPythonModule.cpp │ │ ├── warpPythonModule.h │ │ ├── warpSceneIndex.cpp │ │ ├── warpSceneIndex.h │ │ ├── warpSceneIndexPlugin.cpp │ │ ├── warpSceneIndexPlugin.h │ │ └── wrapTokens.cpp ├── kit-extension │ └── exts │ │ └── omni.example.schema │ │ ├── config │ │ └── extension.toml │ │ ├── data │ │ └── icon.png │ │ ├── docs │ │ ├── CHANGES.md │ │ └── README.md │ │ └── omni │ │ └── example │ │ └── schema │ │ ├── __init__.py │ │ └── tests │ │ ├── __init__.py │ │ └── test_example_schema.py └── usd-plugins │ ├── README.md │ ├── dynamicPayload │ └── omniMetProvider │ │ ├── api.h │ │ ├── omniMetProvider.cpp │ │ ├── omniMetProvider.h │ │ └── plugInfo.json │ ├── fileFormat │ └── edfFileFormat │ │ ├── api.h │ │ ├── edfData.cpp │ │ ├── edfData.h │ │ ├── edfDataProviderFactory.cpp │ │ ├── edfDataProviderFactory.h │ │ ├── edfFileFormat.cpp │ │ ├── edfFileFormat.h │ │ ├── edfPluginManager.cpp │ │ ├── edfPluginManager.h │ │ ├── iEdfDataProvider.cpp │ │ ├── iEdfDataProvider.h │ │ └── plugInfo.json │ ├── images │ ├── data_sources.png │ ├── dynamic_payload_architecture.png │ ├── edf_plugin_example.png │ └── file_format_architecture.png │ └── schema │ ├── omniExampleCodelessSchema │ ├── CMakeLists.txt │ └── schema.usda │ ├── omniExampleSchema │ ├── CMakeLists.txt │ └── schema.usda │ └── omniMetSchema │ ├── CMakeLists.txt │ └── schema.usda ├── templates └── packman │ ├── nv-usd │ └── 22.11+3.10 │ │ └── usd-deps.packman.xml │ └── openusd-cxx11abi │ ├── 24.05+3.10 │ └── usd-deps.packman.xml │ └── 24.05+3.11 │ └── usd-deps.packman.xml └── tools ├── build ├── cmake │ └── NvPxrPlugin.cmake ├── scripts │ └── genSchema.py └── templates │ ├── __init__.py.in │ ├── moduleDeps.cpp.in │ └── wrapModule.cpp.in ├── packman ├── bootstrap │ ├── configure.bat │ ├── download_file_from_url.ps1 │ ├── fetch_file_from_packman_bootstrap.cmd │ ├── generate_temp_file_name.ps1 │ ├── generate_temp_folder.ps1 │ └── install_package.py ├── config.packman.xml ├── packman ├── packman.cmd ├── packmanconf.py ├── python.bat └── python.sh └── repoman └── repoman.py /.gitattributes: -------------------------------------------------------------------------------- 1 | # Normalize text files on commit to LF endings by default 2 | * text=auto 3 | # Make sure Windows batch files preserve CR/LF line endings, otherwise they may not be able to execute. Windows 4 | # batch files require a CR/LF for labels to work properly, otherwise they may fail when labels straddle 512-byte 5 | # block boundaries. This is important when files are downloaded through a zip archive that was authored on a 6 | # Linux machine (the default behavior on GitHub) 7 | *.bat text eol=crlf 8 | *.cmd text eol=crlf 9 | # Make sure shell scripts have LF line endings, even when checked out on a Windows client with autocrlf=true 10 | *.sh text eol=lf 11 | # packman file needs LF line endings 12 | tools/packman/packman text eol=lf -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # All folders starting with `_` are local 2 | _*/ 3 | 4 | # Byte-compiled Python files 5 | *.py[cod] 6 | 7 | # Packman package files 8 | *@*.7z 9 | *@*.zip 10 | 11 | # Binaries 12 | *.ico 13 | *.bmp 14 | *.gif 15 | *.jpg 16 | *.jpeg 17 | *.tga 18 | *.psd 19 | *.raw 20 | *.exr 21 | *.hdr 22 | *.dds 23 | *.ktx 24 | *.spv 25 | *.dxbc 26 | *.dxil 27 | *.gltf 28 | *.glb 29 | *.fbx 30 | *.usd 31 | *.usdz 32 | *.obj 33 | *.mat 34 | *.suo 35 | 36 | # Visual Studio files 37 | /.vs 38 | **/.vscode/ipch 39 | 40 | # PACKAGE-LICENSES/ 41 | PACKAGE-DEPS.yaml 42 | 43 | # All generated CMakeLists.txt files, other than reference sample schema plugins 44 | **/CMakeLists.txt 45 | !src/usd-plugins/schema/**/CMakeLists.txt 46 | !CMakeLists.txt 47 | 48 | # Generated files under usd-plugins/schema 49 | src/usd-plugins/schema/omniExampleSchema/generated 50 | src/usd-plugins/schema/omniExampleCodelessSchema/generated 51 | src/usd-plugins/schema/omniMetSchema/generated 52 | 53 | # Generated files for hydra-plugins/omniWarpSceneIndex 54 | src/hydra-plugins/omniWarpSceneIndex/__init__.py 55 | src/hydra-plugins/omniWarpSceneIndex/api.h 56 | src/hydra-plugins/omniWarpSceneIndex/generatedSchema.usda 57 | src/hydra-plugins/omniWarpSceneIndex/module.cpp 58 | src/hydra-plugins/omniWarpSceneIndex/moduleDeps.cpp 59 | src/hydra-plugins/omniWarpSceneIndex/tokens.cpp 60 | src/hydra-plugins/omniWarpSceneIndex/tokens.h 61 | src/hydra-plugins/omniWarpSceneIndex/warpComputationAPI.cpp 62 | src/hydra-plugins/omniWarpSceneIndex/warpComputationAPI.h 63 | src/hydra-plugins/omniWarpSceneIndex/wrapWarpComputationAPI.cpp 64 | src/hydra-plugins/omniWarpSceneIndex/wrapTokens.cpp 65 | -------------------------------------------------------------------------------- /CHANGES.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | ## 4.0.0 4 | 5 | - Simplified build infrastructure such that standard tooling is used 6 | everywhere except pulling down packman packages 7 | - Removed kit-extension and updated README with instructions on 8 | integrating schema builds with standard kit-app-template extensions 9 | - Eliminated repo-tooling based generators 10 | 11 | ## 3.0.0 12 | 13 | - Added several examples for Hydra 2 scene index plugins 14 | - Fixed issue in build plugInfo.json file configuration for debug builds 15 | - Updated dependencies to stock USD 23.05 16 | - Updated openssl and libcurl dependencies 17 | 18 | ## 2.0.0 19 | 20 | - Added support for general USD plugins beyond schemas 21 | - Updated repo_usd to support flexible build files 22 | - Updated dependencies to USD 22.11 and Python 3.10 23 | - Added sample for dynamic payloads and file format plugins 24 | 25 | ## 1.0.0 26 | 27 | - Initial open source release -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | cmake_minimum_required(VERSION 3.23.1) 5 | 6 | project(usd-plugins CXX) 7 | 8 | # include our packman dependencies 9 | list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) 10 | include(PackmanDeps) 11 | 12 | # include NVIDIA Pixar Plugin build tools that simplify building OpenUSD plugins 13 | include(NvPxrPlugin) 14 | 15 | if (PXR_VERSION LESS_EQUAL 2311) 16 | set(CMAKE_CXX_STANDARD 14) 17 | else() 18 | set(CMAKE_CXX_STANDARD 17) 19 | endif() 20 | 21 | if (NV_USD) 22 | # if NV_USD is on, we need to compile with the old C++ ABI 23 | add_compile_definitions(_GLIBCXX_USE_CXX11_ABI=0) 24 | endif() 25 | 26 | # set target directories 27 | set(CMAKE_INSTALL_PREFIX "${CMAKE_CURRENT_LIST_DIR}/_install") 28 | set(CMAKE_INSTALL_BINDIR "bin") 29 | set(CMAKE_INSTALL_LIBDIR "lib") 30 | set(CMAKE_INSTALL_INCLUDEDIR "include") 31 | 32 | add_subdirectory(src/usd-plugins/schema/omniExampleCodelessSchema) 33 | add_subdirectory(src/usd-plugins/schema/omniExampleSchema) 34 | add_subdirectory(src/usd-plugins/schema/omniMetSchema) 35 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Overview 4 | 5 | Define the code of conduct followed and enforced for "OpenUSD Plugin Samples". 6 | 7 | ### Intended audience 8 | 9 | Community | Developers | Project Leads 10 | 11 | ## Our Pledge 12 | 13 | In the interest of fostering an open and welcoming environment, we as 14 | contributors and maintainers pledge to making participation in our project and 15 | our community a harassment-free experience for everyone, regardless of age, body 16 | size, disability, ethnicity, sex characteristics, gender identity and expression, 17 | level of experience, education, socio-economic status, nationality, personal 18 | appearance, race, religion, or sexual identity and orientation. 19 | 20 | ## Our Standards 21 | 22 | Examples of behavior that contributes to creating a positive environment 23 | include: 24 | 25 | * Using welcoming and inclusive language 26 | * Being respectful of differing viewpoints and experiences 27 | * Gracefully accepting constructive criticism 28 | * Focusing on what is best for the community 29 | * Showing empathy towards other community members 30 | 31 | Examples of unacceptable behavior by participants include: 32 | 33 | * The use of sexualized language or imagery and unwelcome sexual attention or 34 | advances 35 | * Trolling, insulting/derogatory comments, and personal or political attacks 36 | * Public or private harassment 37 | * Publishing others' private information, such as a physical or electronic 38 | address, without explicit permission 39 | * Other conduct which could reasonably be considered inappropriate in a 40 | professional setting 41 | 42 | ## Our Responsibilities 43 | 44 | Project maintainers are responsible for clarifying the standards of acceptable 45 | behavior and are expected to take appropriate and fair corrective action in 46 | response to any instances of unacceptable behavior. 47 | 48 | Project maintainers have the right and responsibility to remove, edit, or 49 | reject comments, commits, code, wiki edits, issues, and other contributions 50 | that are not aligned to this Code of Conduct, or to ban temporarily or 51 | permanently any contributor for other behaviors that they deem inappropriate, 52 | threatening, offensive, or harmful. 53 | 54 | ## Scope 55 | 56 | This Code of Conduct applies both within project spaces and in public spaces 57 | when an individual is representing the project or its community. Examples of 58 | representing a project or community include using an official project e-mail 59 | address, posting via an official social media account, or acting as an appointed 60 | representative at an online or offline event. Representation of a project may be 61 | further defined and clarified by project maintainers. 62 | 63 | ## Enforcement 64 | 65 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 66 | reported by contacting GitHub_Conduct@nvidia.com. All complaints will be reviewed and 67 | investigated and will result in a response that is deemed necessary and appropriate 68 | to the circumstances. The project team is obligated to maintain confidentiality with 69 | regard to the reporter of an incident. Further details of specific enforcement policies 70 | may be posted separately. 71 | 72 | Project maintainers who do not follow or enforce the Code of Conduct in good 73 | faith may face temporary or permanent repercussions as determined by other 74 | members of the project's leadership. 75 | 76 | ## Attribution 77 | 78 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, 79 | available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html 80 | 81 | [homepage]: https://www.contributor-covenant.org 82 | 83 | For answers to common questions about this code of conduct, see 84 | https://www.contributor-covenant.org/faq 85 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | Thank you for your interest in OpenUSD Plugin Samples. 4 | 5 | At this time, we are not accepting public code contributions to this repository. It is actively maintained by NVIDIA Omniverse with all changes made in accordance with our development processes, but we do not currently accept pull requests or external modifications. Feel free to otherwise modify and rebuild the provided OpenUSD plugin samples and extensions to suite your needs. 6 | 7 | If you have found an issue or have a feature request, please check our [issue tracker](https://github.com/NVIDIA-Omniverse/usd-plugin-samples/issues) to see if it is already being discussed. You are welcome to provide feedback or report bugs via this platform. 8 | 9 | Thank you for your understanding and support. 10 | -------------------------------------------------------------------------------- /PackmanDeps.cmake: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | 5 | # tell usd-plugin-cmake-utils where to find python 6 | set(PXR_OPENUSD_PYTHON_DIR "${CMAKE_CURRENT_LIST_DIR}/_build/usd-deps/python") 7 | 8 | # add the path to OpenUSD to the prefix path 9 | list(APPEND CMAKE_PREFIX_PATH "${CMAKE_CURRENT_LIST_DIR}/_build/usd-deps/usd") 10 | 11 | # add the path to find usd-plugin-cmake-utils 12 | list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/_build/host-deps/usd-plugin-cmake-utils/cmake") -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security 2 | 3 | NVIDIA is dedicated to the security and trust of our software products and services, including all source code repositories managed through our organization. 4 | 5 | If you need to report a security issue, please use the appropriate contact points outlined below. **Please do not report security vulnerabilities through GitHub/GitLab.** 6 | 7 | ## Reporting Potential Security Vulnerability in an NVIDIA Product 8 | 9 | To report a potential security vulnerability in any NVIDIA product: 10 | - Web: [Security Vulnerability Submission Form](https://www.nvidia.com/object/submit-security-vulnerability.html) 11 | - E-Mail: psirt@nvidia.com 12 | - We encourage you to use the following PGP key for secure email communication: [NVIDIA public PGP Key for communication](https://www.nvidia.com/en-us/security/pgp-key) 13 | - Please include the following information: 14 | - Product/Driver name and version/branch that contains the vulnerability 15 | - Type of vulnerability (code execution, denial of service, buffer overflow, etc.) 16 | - Instructions to reproduce the vulnerability 17 | - Proof-of-concept or exploit code 18 | - Potential impact of the vulnerability, including how an attacker could exploit the vulnerability 19 | 20 | While NVIDIA currently does not have a bug bounty program, we do offer acknowledgement when an externally reported security issue is addressed under our coordinated vulnerability disclosure policy. Please visit our [Product Security Incident Response Team (PSIRT)](https://www.nvidia.com/en-us/security/psirt-policies/) policies page for more information. 21 | 22 | ## NVIDIA Product Security 23 | 24 | For all security-related concerns, please visit NVIDIA's Product Security portal at https://www.nvidia.com/en-us/security 25 | -------------------------------------------------------------------------------- /VERSION.md: -------------------------------------------------------------------------------- 1 | 4.0.2 2 | -------------------------------------------------------------------------------- /bootstrap.py: -------------------------------------------------------------------------------- 1 | # Copyright 2023 NVIDIA CORPORATION 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | import contextlib 16 | import io 17 | import packmanapi 18 | import os 19 | import sys 20 | 21 | REPO_ROOT = os.path.dirname(os.path.realpath(__file__)) 22 | REPO_DEPS_FILE = os.path.join(REPO_ROOT, "deps", "repo-deps.packman.xml") 23 | 24 | if __name__ == "__main__": 25 | # pull all repo dependencies first 26 | # and add them to the python path 27 | with contextlib.redirect_stdout(io.StringIO()): 28 | deps = packmanapi.pull(REPO_DEPS_FILE) 29 | 30 | for dep_path in deps.values(): 31 | if dep_path not in sys.path: 32 | sys.path.append(dep_path) 33 | 34 | sys.path.append(REPO_ROOT) 35 | 36 | import omni.repo.usd 37 | omni.repo.usd.bootstrap(REPO_ROOT) -------------------------------------------------------------------------------- /build.bat: -------------------------------------------------------------------------------- 1 | :: Copyright 2023-2024 NVIDIA CORPORATION 2 | :: 3 | :: Licensed under the Apache License, Version 2.0 (the "License"); 4 | :: you may not use this file except in compliance with the License. 5 | :: You may obtain a copy of the License at 6 | :: 7 | :: http://www.apache.org/licenses/LICENSE-2.0 8 | :: 9 | :: Unless required by applicable law or agreed to in writing, software 10 | :: distributed under the License is distributed on an "AS IS" BASIS, 11 | :: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | :: See the License for the specific language governing permissions and 13 | :: limitations under the License. 14 | 15 | @echo off 16 | setlocal enabledelayedexpansion 17 | 18 | pushd %~dp0 19 | 20 | REM options defining what the script runs 21 | set HELP=false 22 | set CLEAN=false 23 | set USD_FLAVOR=nv-usd 24 | set USD_VER=22.11 25 | set PYTHON_VER=3.10 26 | set CONFIG=release 27 | set HELP_EXIT_CODE=0 28 | 29 | set DIRECTORIES_TO_CLEAN=_install _build 30 | 31 | REM default arguments for script 32 | :parseargs 33 | if not "%1"=="" ( 34 | if "%1" == "--clean" ( 35 | set CLEAN=true 36 | ) 37 | if "%1" == "--debug" ( 38 | set CONFIG=debug 39 | ) 40 | if "%1" == "--relwithdebinfo" ( 41 | set CONFIG=relwithdebinfo 42 | ) 43 | if "%1" == "--help" ( 44 | set HELP=true 45 | ) 46 | shift 47 | goto :parseargs 48 | ) 49 | 50 | REM requesting how to run the script 51 | if "%HELP%" == "true" ( 52 | echo build.bat [--clean] [--usd-flavor] [--usd-ver] [--python-ver][--debug | --relwithdebinfo] [--help] 53 | echo --clean: Removes the following directories ^(customize as needed^): 54 | for %%a in (%DIRECTORIES_TO_CLEAN%) DO ( 55 | echo %%a 56 | ) 57 | echo --usd-flavor: The flavor of OpenUSD to use to build ^(options=[nv-usd, openusd], default=nv-usd^) 58 | echo --usd-ver: The version of OpenUSD to use to build ^(options=[22.11, 24.05], default=22.11^) 59 | echo --python-ver: The version of Python to use to build ^(options=[3.10, 3.11], default=3.10^) 60 | echo note that the three options above must have an availble configuration to pull down 61 | echo --debug: Performs the steps with a debug configuration instead of release 62 | echo ^(default = release^) 63 | echo --relwithdebinfo: Performs the steps with a relwithdebinfo configuration instead of release 64 | echo ^(default = release^) 65 | echo --help: Display this help message 66 | exit %HELP_EXIT_CODE% 67 | ) 68 | 69 | REM should we clean the target directory? 70 | if "%CLEAN%" == "true" ( 71 | for %%a in (%DIRECTORIES_TO_CLEAN%) DO ( 72 | if exist "%~dp0%%a/" ( 73 | rmdir /s /q "%~dp0%%a" 74 | ) 75 | ) 76 | 77 | if !errorlevel! neq 0 (goto :Error) 78 | 79 | goto :Success 80 | ) 81 | 82 | REM perform a simple build sequence (customize as needed for your environment) 83 | 84 | REM pull OpenUSD and Python dependencies as well as some helper cmake scripts 85 | call "%~dp0tools\packman\python.bat" scripts\setup.py --usd-flavor=%USD_FLAVOR% --usd-ver=%USD_VER% --python-ver=%PYTHON_VER% --config=%CONFIG% 86 | if !errorlevel! neq 0 (goto :Error) 87 | 88 | REM configure and build using cmake 89 | if "%USD_FLAVOR%" == "nv-usd" ( 90 | cmake -B ./_build/cmake -DNV_USD=ON -T v142 91 | cmake --build ./_build/cmake --config=%CONFIG% --target=install 92 | ) 93 | 94 | if NOT "%USD_FLAVOR%" == "nv-usd" ( 95 | cmake -B ./_build/cmake -T v142 96 | cmake --build ./_build/cmake --config=%CONFIG% --target=install 97 | ) 98 | 99 | :Success 100 | exit /b 0 101 | 102 | :Error 103 | exit /b !errorlevel! -------------------------------------------------------------------------------- /build.sh: -------------------------------------------------------------------------------- 1 | # Copyright 2023 NVIDIA CORPORATION 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | set -e 16 | CWD="$( cd "$( dirname "$0" )" && pwd )" 17 | 18 | # options defining what the script runs 19 | HELP=false 20 | CLEAN=false 21 | USD_FLAVOR=nv-usd 22 | USD_VER=22.11 23 | PYTHON_VER=3.10 24 | CONFIG=release 25 | HELP_EXIT_CODE=0 26 | 27 | DIRECTORIES_TO_CLEAN=( 28 | _install 29 | _build 30 | ) 31 | 32 | while [ $# -gt 0 ] 33 | do 34 | if [[ "$1" == "--clean" ]] 35 | then 36 | CLEAN=true 37 | fi 38 | if [[ "$1" == "--debug" ]] 39 | then 40 | CONFIG=debug 41 | fi 42 | if [[ "$1" == "--relwithdebinfo" ]] 43 | then 44 | CONFIG=relwithdebinfo 45 | fi 46 | if [[ "$1" == "--help" ]] 47 | then 48 | HELP=true 49 | fi 50 | shift 51 | done 52 | 53 | # requesting how to run the script 54 | if [[ "$HELP" == "true" ]] 55 | then 56 | echo "build.sh [--clean] [--usd-flavor] [--usd-ver] [--python-ver] [--debug | --relwithdebinfo] [--help]" 57 | echo "--clean: Removes the following directories (customize as needed):" 58 | for dir_to_clean in "${DIRECTORIES_TO_CLEAN[@]}" ; do 59 | echo " $dir_to_clean" 60 | done 61 | echo "--usd-flavor: The flavor of OpenUSD to use to build (options=[nv-usd, openusd], default=nv-usd)" 62 | echo "--usd-ver: The version of OpenUSD to use to build (options=[22.11, 24.05], default=22.11)" 63 | echo "--python-ver: The version of Python to use to build (options=[3.10, 3.11], default=3.10)" 64 | echo " note that the three options above must have an available configuration to pull down" 65 | echo "--debug: Performs the steps with a debug configuration instead of release" 66 | echo " (default = release)" 67 | echo "--relwithdebinfo: Performs the steps with a relwithdebinfo configuration instead of release" 68 | echo " (default = release)" 69 | echo "--help: Display this help message" 70 | exit $HELP_EXIT_CODE 71 | fi 72 | 73 | # do we need to clean? 74 | if [[ "$CLEAN" == "true" ]] 75 | then 76 | for dir_to_clean in "${DIRECTORIES_TO_CLEAN[@]}" ; do 77 | rm -rf "$CWD/$dir_to_clean" 78 | done 79 | 80 | exit 0 81 | fi 82 | 83 | # perform a simple build seqeuence (customize as needed for your environment) 84 | # pull OpenUSD and python dependencies as well as some helper cmake scripts 85 | $CWD/tools/packman/python.sh scripts/setup.py --usd-flavor=$USD_FLAVOR --usd-ver=$USD_VER --python-ver=$PYTHON_VER --config=$CONFIG 86 | 87 | if [[ "$USD_FLAVOR" == "nv-usd" ]] 88 | then 89 | cmake -B ./_build/cmake -DNV_USD=ON -DCMAKE_BUILD_TYPE=$CONFIG -D_GLIBCXX_USE_CXX11_ABI=0 -DCMAKE_EXPORT_COMPILE_COMMANDS=ON 90 | cmake --build ./_build/cmake --config $CONFIG --target install 91 | else 92 | cmake -B ./_build/cmake -DCMAKE_BUILD_TYPE=$CONFIG -DCMAKE_EXPORT_COMPILE_COMMANDS=ON 93 | cmake --build ./_build/cmake --config $CONFIG --target install 94 | fi 95 | -------------------------------------------------------------------------------- /deps/host-deps.packman.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /deps/repo-deps.packman.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /deps/target-deps.packman.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /deps/usd-deps.packman.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /docs/about-openusd-plugins.md: -------------------------------------------------------------------------------- 1 | # OpenUSD Plugins 2 | 3 | OpenUSD provides many different extensibility points to allow additional data to be represented, loaded, and worked with as prims and attributes within the OpenUSD runtime. These extensiblity points are implemented via _plugins_, which provide definition of additional data (schemas) and certain runtime behaviors (data loading and asset resolution). Plugins are implemented via libraries that contain classes that implement base APIs provided by OpenUSD to interact with the OpenUSD runtime and declared to OpenUSD via information contained in a `plugInfo.json` file. 4 | 5 | In general, the plugin system of OpenUSD works in the same way regardless of plugin type. OpenUSD needs a few things for the plugin system to work: 6 | 7 | - An abstract base class declaring the API for the plugin type that is registered with the type system 8 | - A factory function for creating new instances 9 | - A mechanism for loading the plugin into the system 10 | 11 | For example, in the case of implementing a custom file format extension, OpenUSD provides: 12 | 13 | - An abstract base class via `SdfFileFormat` 14 | - A factory object responsible for creating instances of the plugin type via `Sdf_FileFormatFactory` 15 | - An object that reads information of plugins that implement `SdfFileFormat` and loads them into the runtime via `Sdf_FileFormatRegistry` 16 | 17 | This can be illustrated in the diagram below: 18 | 19 | ![OpenUSD Plugin Architecture](../images/usd_plugin_architecture.png) 20 | 21 | To implement a plugin, a developer needs to do a few things: 22 | 23 | - Create a class that implements the API of the abstract base class 24 | - Register the type with `Tf` 25 | - Declare the plugin and the information contained therein in a `plugInfo.json` file 26 | - Register the plugin with the system (either implicitly by specifying a path to the `plugInfo.json` file in `PXR_PLUGINPATH_NAME` or explicitly via a `RegisterPlugins` call in controlling code) 27 | 28 | From the point of view of the OpenUSD runtime, plugins are read generically by interpreting the `plugInfo.json` file and deriving information about the plugin that can be used to load the plugin into the runtime when requested. This is the responsibility of the `plug` OpenUSD library. The metadata of all plugins (regardless of type) is held in the `PlugRegistry` object. On OpenUSD runtime startup, the information in all `plugInfo.json` files accessible from paths declared in `PXR_PLUGINPATH_NAME` are loaded, interpreted, and stored in the `PlugRegistry` singleton instance. Additionally, any `plugInfo.json` files that are found via a `RegisterPlugins` call on the singleton are loaded, interpreted, and stored (more on this later, because order of operations is important!). The metadata of each plugin is represented by a `PlugPlugin` instance. 29 | 30 | Objects that are interested in plugins of a certain type may query the `PlugRegistry` for all plugins that derive from a type registered in the type system via a call to `GetAllDerivedTypes`. This returns all registered types that derive from the requested type; from this the object can get the actual plugin metadata via a call to `GetPluginForType`. Finally, the object can load the plugin from the metadata via `Load` in order to work with the specific API implemented by the plugin. This loads the library associated with the plugin into memory and makes the types in it accessible to the system. In general, the objects that manage this information are specific for a particular plugin type (e.g. `SdfFileFormat`) and are typically singletons in the OpenUSD runtime (e.g., `Sdf_FileFormatRegistry`). 31 | 32 | The file format objects that implement the OpenUSD plugin architecture for `SdfFileFormat` are given below: 33 | 34 | ![File Format Plugin Example](../images/file_format_plugin_example.png) 35 | 36 | In all cases, the singleton objects that load plugins do so __once__ at the time of first access and cache that information. __This means that any code that performs a call to `RegisterPlugins` must be executed prior to the first call to the singleton object managing plugins of that type!__. 37 | 38 | For illustrative purposes, the [`edf` file format plugin](../src/usd-plugins/fileFormat/edfFileFormat) contained within this sample also has an example of a type that manages plugins (of type `IEdfDataProvider`) in a similar way that the built-in OpenUSD managers manage their own plugin types. 39 | -------------------------------------------------------------------------------- /images/data_sources.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NVIDIA-Omniverse/OpenUSD-plugin-samples/758407febdb5563213e6db80e09194cdfb3b9562/images/data_sources.png -------------------------------------------------------------------------------- /images/dynamic_payload_architecture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NVIDIA-Omniverse/OpenUSD-plugin-samples/758407febdb5563213e6db80e09194cdfb3b9562/images/dynamic_payload_architecture.png -------------------------------------------------------------------------------- /images/edf_plugin_example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NVIDIA-Omniverse/OpenUSD-plugin-samples/758407febdb5563213e6db80e09194cdfb3b9562/images/edf_plugin_example.png -------------------------------------------------------------------------------- /images/file_format_architecture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NVIDIA-Omniverse/OpenUSD-plugin-samples/758407febdb5563213e6db80e09194cdfb3b9562/images/file_format_architecture.png -------------------------------------------------------------------------------- /images/file_format_plugin_example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NVIDIA-Omniverse/OpenUSD-plugin-samples/758407febdb5563213e6db80e09194cdfb3b9562/images/file_format_plugin_example.png -------------------------------------------------------------------------------- /images/usd_plugin_architecture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NVIDIA-Omniverse/OpenUSD-plugin-samples/758407febdb5563213e6db80e09194cdfb3b9562/images/usd_plugin_architecture.png -------------------------------------------------------------------------------- /repo.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | call "%~dp0tools\packman\python.bat" %~dp0tools\repoman\repoman.py %* 4 | if %errorlevel% neq 0 ( goto Error ) 5 | 6 | :Success 7 | exit /b 0 8 | 9 | :Error 10 | exit /b %errorlevel% 11 | -------------------------------------------------------------------------------- /repo.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | SCRIPT_DIR="$(dirname "${BASH_SOURCE}")" 6 | cd "$SCRIPT_DIR" 7 | 8 | exec "tools/packman/python.sh" tools/repoman/repoman.py $@ 9 | -------------------------------------------------------------------------------- /resources/assets/materials/ceramic_material.usda: -------------------------------------------------------------------------------- 1 | #usda 1.0 2 | ( 3 | defaultPrim = "World" 4 | upAxis = "Y" 5 | ) 6 | 7 | def Xform "World" 8 | { 9 | def Material "CeramicMaterial" 10 | { 11 | token outputs:mdl:displacement.connect = 12 | token outputs:mdl:surface.connect = 13 | token outputs:mdl:volume.connect = 14 | 15 | def Shader "Shader" 16 | { 17 | uniform token info:implementationSource = "sourceAsset" 18 | uniform asset info:mdl:sourceAsset = @OmniPBRBase.mdl@ 19 | uniform token info:mdl:sourceAsset:subIdentifier = "OmniPBRBase" 20 | float inputs:coat_roughness = 0.15 ( 21 | customData = { 22 | float default = 0 23 | } 24 | displayGroup = "Clearcoat" 25 | displayName = "Clearcoat Roughness" 26 | doc = "Higher roughness values lead to more blurry reflections" 27 | hidden = false 28 | ) 29 | float inputs:coat_weight = 0.5 ( 30 | customData = { 31 | float default = 1 32 | dictionary range = { 33 | float max = 1 34 | float min = 0 35 | } 36 | } 37 | displayGroup = "Clearcoat" 38 | displayName = "Clearcoat Weight" 39 | doc = "Sets the weight for coat layer" 40 | hidden = false 41 | ) 42 | bool inputs:enable_coat = 1 ( 43 | customData = { 44 | bool default = 0 45 | } 46 | displayGroup = "Clearcoat" 47 | displayName = "Enable Clearcoat Layer" 48 | doc = "Adds a coat layer on top of the material when enabled" 49 | hidden = false 50 | ) 51 | float inputs:specular_level = 0 ( 52 | customData = { 53 | float default = 0.5 54 | dictionary soft_range = { 55 | float max = 1 56 | float min = 0 57 | } 58 | } 59 | displayGroup = "Reflectivity" 60 | displayName = "Specular" 61 | doc = "The specular level (intensity) of the material" 62 | hidden = false 63 | ) 64 | float inputs:specular_reflection_roughness = 0.5 ( 65 | customData = { 66 | float default = 0 67 | } 68 | displayGroup = "Reflectivity" 69 | displayName = "Roughness" 70 | doc = "Higher roughness values lead to more blurry reflections" 71 | hidden = false 72 | ) 73 | token outputs:out ( 74 | renderType = "material" 75 | ) 76 | } 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /resources/assets/materials/cloth_material.usda: -------------------------------------------------------------------------------- 1 | #usda 1.0 2 | ( 3 | defaultPrim = "World" 4 | upAxis = "Y" 5 | ) 6 | 7 | def Xform "World" 8 | { 9 | def Material "ClothMaterial" 10 | { 11 | token outputs:mdl:displacement.connect = 12 | token outputs:mdl:surface.connect = 13 | token outputs:mdl:volume.connect = 14 | 15 | def Shader "Shader" 16 | { 17 | uniform token info:implementationSource = "sourceAsset" 18 | uniform asset info:mdl:sourceAsset = @OmniPBRBase.mdl@ 19 | uniform token info:mdl:sourceAsset:subIdentifier = "OmniPBRBase" 20 | 21 | float inputs:metalness = 0.1 ( 22 | customData = { 23 | float default = 0 24 | dictionary range = { 25 | float max = 1 26 | float min = 0 27 | } 28 | } 29 | displayGroup = "Reflectivity" 30 | displayName = "Metalness" 31 | doc = "Bias towards pure specular reflection" 32 | hidden = false 33 | ) 34 | float inputs:specular_reflection_roughness = 0.5 ( 35 | customData = { 36 | float default = 0 37 | } 38 | displayGroup = "Reflectivity" 39 | displayName = "Roughness" 40 | doc = "Higher roughness values lead to more blurry reflections" 41 | hidden = false 42 | ) 43 | token outputs:out ( 44 | renderType = "material" 45 | ) 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /resources/empty.edf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NVIDIA-Omniverse/OpenUSD-plugin-samples/758407febdb5563213e6db80e09194cdfb3b9562/resources/empty.edf -------------------------------------------------------------------------------- /resources/metrics_assembler.usda: -------------------------------------------------------------------------------- 1 | #usda 1.0 2 | ( 3 | defaultPrim = "World" 4 | metersPerUnit = 1 5 | upAxis = "Y" 6 | subLayers = [ 7 | @./metrics_assembler_2.usda@ 8 | ] 9 | ) 10 | 11 | def Xform "World" 12 | { 13 | def Sphere "TranslatedSphere" 14 | { 15 | double radius = 1.0 16 | float3 xformOp:translate = (0, 10, 0) 17 | uniform token[] xformOpOrder = ["xformOp:translate"] 18 | } 19 | } -------------------------------------------------------------------------------- /resources/metrics_assembler_2.usda: -------------------------------------------------------------------------------- 1 | #usda 1.0 2 | ( 3 | metersPerUnit = 0.5 4 | ) 5 | 6 | def Sphere "Sphere" ( 7 | ) 8 | { 9 | double radius = 1.0 10 | float3 xformOp:scale = (1, 1, 1) 11 | uniform token[] xformOpOrder = ["xformOp:scale"] 12 | } -------------------------------------------------------------------------------- /resources/ocean/top.usda: -------------------------------------------------------------------------------- 1 | #usda 1.0 2 | ( 3 | customLayerData = { 4 | dictionary cameraSettings = { 5 | dictionary Front = { 6 | double3 position = (0, 0, 50000) 7 | double radius = 500 8 | } 9 | dictionary Perspective = { 10 | double3 position = (500, 500, 500) 11 | double3 target = (-0.0000039780385918675165, 0.00000795607684267452, -0.000003978038364493841) 12 | } 13 | dictionary Right = { 14 | double3 position = (-50000, 0, 0) 15 | double radius = 500 16 | } 17 | dictionary Top = { 18 | double3 position = (0, 50000, 0) 19 | double radius = 500 20 | } 21 | string boundCamera = "/OmniverseKit_Persp" 22 | } 23 | dictionary metricsAssembler = { 24 | dictionary "C:/Dev/pixar//grid_256.usda" = { 25 | dictionary "/World/grid_256" = { 26 | string path = "/World/grid_256" 27 | } 28 | } 29 | } 30 | dictionary navmeshSettings = { 31 | double agentHeight = 180 32 | double agentRadius = 20 33 | bool excludeRigidBodies = 1 34 | int ver = 2 35 | double voxelCeiling = 460 36 | } 37 | dictionary omni_layer = { 38 | string authoring_layer = "./top.usda" 39 | dictionary muteness = { 40 | } 41 | } 42 | dictionary renderSettings = { 43 | float3 "rtx:debugView:pixelDebug:textColor" = (0, 1e18, 0) 44 | float3 "rtx:fog:fogColor" = (0.75, 0.75, 0.75) 45 | float3 "rtx:index:regionOfInterestMax" = (0, 0, 0) 46 | float3 "rtx:index:regionOfInterestMin" = (0, 0, 0) 47 | float3 "rtx:iray:environment_dome_ground_position" = (0, 0, 0) 48 | float3 "rtx:iray:environment_dome_ground_reflectivity" = (0, 0, 0) 49 | float3 "rtx:iray:environment_dome_rotation_axis" = (3.4028235e38, 3.4028235e38, 3.4028235e38) 50 | float3 "rtx:post:backgroundZeroAlpha:backgroundDefaultColor" = (0, 0, 0) 51 | float3 "rtx:post:colorcorr:contrast" = (1, 1, 1) 52 | float3 "rtx:post:colorcorr:gain" = (1, 1, 1) 53 | float3 "rtx:post:colorcorr:gamma" = (1, 1, 1) 54 | float3 "rtx:post:colorcorr:offset" = (0, 0, 0) 55 | float3 "rtx:post:colorcorr:saturation" = (1, 1, 1) 56 | float3 "rtx:post:colorgrad:blackpoint" = (0, 0, 0) 57 | float3 "rtx:post:colorgrad:contrast" = (1, 1, 1) 58 | float3 "rtx:post:colorgrad:gain" = (1, 1, 1) 59 | float3 "rtx:post:colorgrad:gamma" = (1, 1, 1) 60 | float3 "rtx:post:colorgrad:lift" = (0, 0, 0) 61 | float3 "rtx:post:colorgrad:multiply" = (1, 1, 1) 62 | float3 "rtx:post:colorgrad:offset" = (0, 0, 0) 63 | float3 "rtx:post:colorgrad:whitepoint" = (1, 1, 1) 64 | float3 "rtx:post:lensDistortion:lensFocalLengthArray" = (10, 30, 50) 65 | float3 "rtx:post:lensFlares:anisoFlareFalloffX" = (450, 475, 500) 66 | float3 "rtx:post:lensFlares:anisoFlareFalloffY" = (10, 10, 10) 67 | float3 "rtx:post:lensFlares:cutoffPoint" = (2, 2, 2) 68 | double "rtx:post:lensFlares:flareScale" = 0.075 69 | float3 "rtx:post:lensFlares:haloFlareFalloff" = (10, 10, 10) 70 | float3 "rtx:post:lensFlares:haloFlareRadius" = (75, 75, 75) 71 | float3 "rtx:post:lensFlares:isotropicFlareFalloff" = (50, 50, 50) 72 | float3 "rtx:post:tonemap:whitepoint" = (1, 1, 1) 73 | float3 "rtx:raytracing:inscattering:singleScatteringAlbedo" = (0.9, 0.9, 0.9) 74 | float3 "rtx:raytracing:inscattering:transmittanceColor" = (0.5, 0.5, 0.5) 75 | float3 "rtx:sceneDb:ambientLightColor" = (0, 0, 0) 76 | } 77 | } 78 | defaultPrim = "World" 79 | endTimeCode = 1000 80 | metersPerUnit = 0.01 81 | startTimeCode = 0 82 | timeCodesPerSecond = 30 83 | upAxis = "Z" 84 | framesPerSecond = 120.0 85 | ) 86 | 87 | def Xform "World" 88 | { 89 | def "grid" ( 90 | prepend references = @./grid_1000.usda@ 91 | ) 92 | { 93 | float3 xformOp:rotateXYZ = (0, 0, 0) 94 | float3 xformOp:scale = (5, 5, 5) 95 | double3 xformOp:translate = (0, 0, 0) 96 | uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] 97 | } 98 | } 99 | 100 | -------------------------------------------------------------------------------- /resources/scene.usda: -------------------------------------------------------------------------------- 1 | #usda 1.0 2 | ( 3 | defaultPrim = "World" 4 | metersPerUnit = 0.01 5 | upAxis = "Y" 6 | ) 7 | 8 | def Xform "World" 9 | { 10 | def "MetropolitanMuseumOfArt" ( 11 | EdfDataParameters = { 12 | string dataProviderId = "omniMet" 13 | dictionary providerArgs = { 14 | string dataLodLevel = "1" 15 | string lod1Count = "20" 16 | string deferredRead = "true" 17 | } 18 | } 19 | 20 | payload = @./empty.edf@ 21 | ) 22 | { 23 | } 24 | } -------------------------------------------------------------------------------- /resources/wgs84/quadnode-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NVIDIA-Omniverse/OpenUSD-plugin-samples/758407febdb5563213e6db80e09194cdfb3b9562/resources/wgs84/quadnode-0.png -------------------------------------------------------------------------------- /resources/wgs84/quadnode-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NVIDIA-Omniverse/OpenUSD-plugin-samples/758407febdb5563213e6db80e09194cdfb3b9562/resources/wgs84/quadnode-1.png -------------------------------------------------------------------------------- /resources/wgs84/quadnode-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NVIDIA-Omniverse/OpenUSD-plugin-samples/758407febdb5563213e6db80e09194cdfb3b9562/resources/wgs84/quadnode-4.png -------------------------------------------------------------------------------- /setenvlinux: -------------------------------------------------------------------------------- 1 | # Copyright 2023 NVIDIA CORPORATION 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | CONFIG=release 16 | if [ $# == 1 ]; then 17 | if [ "$1" == "debug" ]; then 18 | CONFIG=debug 19 | fi 20 | fi 21 | 22 | echo "Setting environment for $CONFIG configuration..." 23 | 24 | if [ ! -d _venv ]; then 25 | $PWD/_build/usd-deps/python/python -m venv _venv 26 | source $PWD/_venv/bin/activate 27 | pip install PySide2 28 | pip install PyOpenGL 29 | pip install warp-lang 30 | else 31 | source $PWD/_venv/bin/activate 32 | fi 33 | 34 | export PYTHONPATH=$PWD/_build/usd-deps/nv-usd/$CONFIG/lib/python:$PWD/_build/target-deps/omni-geospatial:$PWD/_install/linux-$(arch)/$CONFIG/omniWarpSceneIndex 35 | export PATH=$PATH:$PWD/_build/usd-deps/python:$PWD/_build/usd-deps/nv-usd/$CONFIG/bin 36 | export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/_build/usd-deps/python:$PWD/_build/usd-deps/nv-usd/$CONFIG/bin:$PWD/_build/usd-deps/nv-usd/$CONFIG/lib:$PWD/_build/target-deps/zlib/lib:$PWD/_build/target-deps/openssl/lib:$PWD/_install/linux-$(arch)/$CONFIG/edfFileFormat/lib:$PWD/_install/linux-$(arch)/$CONFIG/omniMetProvider/lib:$PWD/_build/target-deps/omni-geospatial/bin:$PWD/_install/linux-$(arch)/$CONFIG/omniWarpSceneIndex/lib 37 | export PXR_PLUGINPATH_NAME=$PWD/_install/linux-$(arch)/$CONFIG/omniMetSchema/resources:$PWD/_install/linux-$(arch)/$CONFIG/edfFileFormat/resources:$PWD/_install/linux-$(arch)/$CONFIG/omniMetProvider/resources:$PWD/_build/target-deps/omni-geospatial/plugins/OmniGeospatial/resources:$PWD/_install/linux-$(arch)/$CONFIG/omniGeoSceneIndex/resources:$PWD/_install/linux-$(arch)/$CONFIG/omniMetricsAssembler/resources:$PWD/_install/linux-$(arch)/$CONFIG/omniWarpSceneIndex/resources 38 | export USDIMAGINGGL_ENGINE_ENABLE_SCENE_INDEX=true -------------------------------------------------------------------------------- /setenvwindows: -------------------------------------------------------------------------------- 1 | # Copyright 2023 NVIDIA CORPORATION 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | CONFIG=release 16 | if [ $# == 1 ]; then 17 | if [ "$1" == "debug" ]; then 18 | CONFIG=debug 19 | fi 20 | fi 21 | 22 | echo "Setting environment for $CONFIG configuration..." 23 | 24 | if [ ! -d _venv ]; then 25 | $PWD/_build/usd-deps/python/python.exe -m venv _venv 26 | source $PWD/_venv/Scripts/activate 27 | pip install PySide2 28 | pip install PyOpenGL 29 | pip install warp-lang 30 | else 31 | source $PWD/_venv/Scripts/activate 32 | fi 33 | 34 | export PYTHONPATH=$PWD/_build/usd-deps/nv-usd/$CONFIG/lib/python:$PWD/_build/target-deps/omni-geospatial:$PWD/_install/windows-x86_64/$CONFIG/omniWarpSceneIndex 35 | export PATH=$PATH:$PWD/_build/usd-deps/python:$PWD/_build/usd-deps/nv-usd/$CONFIG/bin:$PWD/_build/usd-deps/nv-usd/$CONFIG/lib:$PWD/_build/target-deps/zlib/lib/rt_dynamic/release:$PWD/_install/windows-x86_64/$CONFIG/edfFileFormat/lib:$PWD/_install/windows-x86_64/$CONFIG/omniMetProvider/lib:$PWD/_build/target-deps/omni-geospatial/bin:$PWD/_install/windows-x86_64/$CONFIG/omniWarpSceneIndex/lib 36 | export PXR_PLUGINPATH_NAME=$PWD/_install/windows-x86_64/$CONFIG/omniMetSchema/resources:$PWD/_install/windows-x86_64/$CONFIG/edfFileFormat/resources:$PWD/_install/windows-x86_64/$CONFIG/omniMetProvider/resources:$PWD/_build/target-deps/omni-geospatial/plugins/OmniGeospatial/resources:$PWD/_install/windows-x86_64/$CONFIG/omniGeoSceneIndex/resources:$PWD/_install/windows-x86_64/$CONFIG/omniMetricsAssembler/resources:$PWD/_install/windows-x86_64/$CONFIG/omniWarpSceneIndex/resources 37 | export USDIMAGINGGL_ENGINE_ENABLE_SCENE_INDEX=true -------------------------------------------------------------------------------- /setenvwindows.bat: -------------------------------------------------------------------------------- 1 | :: Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved. 2 | :: 3 | :: NVIDIA CORPORATION and its licensors retain all intellectual property 4 | :: and proprietary rights in and to this software, related documentation 5 | :: and any modifications thereto. Any use, reproduction, disclosure or 6 | :: distribution of this software and related documentation without an express 7 | :: license agreement from NVIDIA CORPORATION is strictly prohibited. 8 | 9 | @echo off 10 | 11 | set CONFIG=release 12 | 13 | :parseargs 14 | if not "%1" == "" ( 15 | if "%1" == "debug" ( 16 | set CONFIG=debug 17 | ) 18 | shift 19 | goto parseargs 20 | ) 21 | 22 | echo Setting environment for %CONFIG% configuration... 23 | 24 | if not exist %~dp0_venv ( 25 | %~dp0_build\usd-deps\python\python.exe -m venv %~dp0_venv 26 | call "%~dp0_venv\Scripts\activate.bat" 27 | pip install PySide2 28 | pip install PyOpenGL 29 | pip install warp-lang 30 | ) else ( 31 | call "%~dp0_venv\Scripts\activate.bat" 32 | ) 33 | 34 | set PYTHONPATH=%~dp0_build\usd-deps\nv-usd\%CONFIG%\lib\python;%~dp0_build\target-deps\omni-geospatial;%~dp0_install\windows-x86_64\%CONFIG%\omniWarpSceneIndex 35 | set PATH=%PATH%;%~dp0_build\usd-deps\python;%~dp0_build\usd-deps\nv-usd\%CONFIG%\bin;%~dp0_build\usd-deps\nv-usd\%CONFIG%\lib;%~dp0_build\target-deps\zlib\lib\rt_dynamic\release;%~dp0_install\windows-x86_64\%CONFIG%\edfFileFormat\lib;%~dp0_install\windows-x86_64\%CONFIG%\omniMetProvider\lib;%~dp0_build\target-deps\omni-geospatial\bin;$~dp0_install\windows-x86_64\$CONFIG\omniWarpSceneIndex\lib 36 | set PXR_PLUGINPATH_NAME=%~dp0_install\windows-x86_64\%CONFIG%\omniMetSchema\resources;%~dp0_install\windows-x86_64\%CONFIG%\edfFileFormat\resources;%~dp0_install\windows-x86_64\%CONFIG%\omniMetProvider\resources;%~dp0_build\target-deps\omni-geospatial\plugins\OmniGeospatial\resources;%~dp0_install\windows-x86_64\%CONFIG%\omniGeoSceneIndex\resources;%~dp0_install\windows-x86_64\%CONFIG%\omniMetricsAssembler\resources;%~dp0_install\windows-x86_64\%CONFIG%\omniWarpSceneIndex\resources 37 | set USDIMAGINGGL_ENGINE_ENABLE_SCENE_INDEX=true -------------------------------------------------------------------------------- /src/hydra-plugins/images/hydra2_architecture2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NVIDIA-Omniverse/OpenUSD-plugin-samples/758407febdb5563213e6db80e09194cdfb3b9562/src/hydra-plugins/images/hydra2_architecture2.png -------------------------------------------------------------------------------- /src/hydra-plugins/images/hydra2_omni_geospatial_datasources.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NVIDIA-Omniverse/OpenUSD-plugin-samples/758407febdb5563213e6db80e09194cdfb3b9562/src/hydra-plugins/images/hydra2_omni_geospatial_datasources.png -------------------------------------------------------------------------------- /src/hydra-plugins/images/hydra2_omni_geospatial_overview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NVIDIA-Omniverse/OpenUSD-plugin-samples/758407febdb5563213e6db80e09194cdfb3b9562/src/hydra-plugins/images/hydra2_omni_geospatial_overview.png -------------------------------------------------------------------------------- /src/hydra-plugins/images/hydra2_omni_metrics_assembler_adapter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NVIDIA-Omniverse/OpenUSD-plugin-samples/758407febdb5563213e6db80e09194cdfb3b9562/src/hydra-plugins/images/hydra2_omni_metrics_assembler_adapter.png -------------------------------------------------------------------------------- /src/hydra-plugins/images/hydra2_xform_data_source.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NVIDIA-Omniverse/OpenUSD-plugin-samples/758407febdb5563213e6db80e09194cdfb3b9562/src/hydra-plugins/images/hydra2_xform_data_source.png -------------------------------------------------------------------------------- /src/hydra-plugins/images/hydra_scene_browser.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NVIDIA-Omniverse/OpenUSD-plugin-samples/758407febdb5563213e6db80e09194cdfb3b9562/src/hydra-plugins/images/hydra_scene_browser.png -------------------------------------------------------------------------------- /src/hydra-plugins/images/hyrdra_overview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NVIDIA-Omniverse/OpenUSD-plugin-samples/758407febdb5563213e6db80e09194cdfb3b9562/src/hydra-plugins/images/hyrdra_overview.png -------------------------------------------------------------------------------- /src/hydra-plugins/images/usdview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NVIDIA-Omniverse/OpenUSD-plugin-samples/758407febdb5563213e6db80e09194cdfb3b9562/src/hydra-plugins/images/usdview.png -------------------------------------------------------------------------------- /src/hydra-plugins/omniGeoSceneIndex/api.h: -------------------------------------------------------------------------------- 1 | // Copyright 2023 NVIDIA CORPORATION 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | #ifndef OMNI_GEO_SCENE_INDEX_API_H 15 | #define OMNI_GEO_SCENE_INDEX_API_H 16 | 17 | #include "pxr/base/arch/export.h" 18 | 19 | #if defined(PXR_STATIC) 20 | # define OMNIGEOSCENEINDEX_API 21 | # define OMNIGEOSCENEINDEX_API_TEMPLATE_CLASS(...) 22 | # define OMNIGEOSCENEINDEX_API_TEMPLATE_STRUCT(...) 23 | # define OMNIGEOSCENEINDEX_LOCAL 24 | #else 25 | # if defined(OMNIGEOSCENEINDEX_EXPORTS) 26 | # define OMNIGEOSCENEINDEX_API ARCH_EXPORT 27 | # define OMNIGEOSCENEINDEX_API_TEMPLATE_CLASS(...) ARCH_EXPORT_TEMPLATE(class, __VA_ARGS__) 28 | # define OMNIGEOSCENEINDEX_API_TEMPLATE_STRUCT(...) ARCH_EXPORT_TEMPLATE(struct, __VA_ARGS__) 29 | # else 30 | # define OMNIGEOSCENEINDEX_API ARCH_IMPORT 31 | # define OMNIGEOSCENEINDEX_API_TEMPLATE_CLASS(...) ARCH_IMPORT_TEMPLATE(class, __VA_ARGS__) 32 | # define OMNIGEOSCENEINDEX_API_TEMPLATE_STRUCT(...) ARCH_IMPORT_TEMPLATE(struct, __VA_ARGS__) 33 | # endif 34 | # define OMNIGEOSCENEINDEX_LOCAL ARCH_HIDDEN 35 | #endif 36 | 37 | #endif // OMNI_GEO_INDEX_API_H 38 | -------------------------------------------------------------------------------- /src/hydra-plugins/omniGeoSceneIndex/computedDependentDataSource.h: -------------------------------------------------------------------------------- 1 | // Copyright 2023 NVIDIA CORPORATION 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | #ifndef HD_OMNI_GEOSPATIAL_COMPUTED_DEPENDENT_DATA_SOURCE_H_ 15 | #define HD_OMNI_GEOSPATIAL_COMPUTED_DEPENDENT_DATA_SOURCE_H_ 16 | 17 | #include 18 | #include 19 | 20 | PXR_NAMESPACE_OPEN_SCOPE 21 | 22 | /// \class HdOmniGeospatialComputedDependentDataSource 23 | /// 24 | /// A datasource representing a container data source mimicing 25 | /// that of a container data source for xform data, but returning 26 | /// computed values based on geospatial data applied to the parent 27 | /// (or some parent in the hierarchy) of this prim. 28 | /// 29 | class HdOmniGeospatialComputedDependentDataSource : public HdContainerDataSource 30 | { 31 | public: 32 | 33 | HD_DECLARE_DATASOURCE(HdOmniGeospatialComputedDependentDataSource); 34 | 35 | HdOmniGeospatialComputedDependentDataSource(HdContainerDataSourceHandle inputDataSource, 36 | HdContainerDataSourceHandle parentDataSource); 37 | 38 | // data source overrides 39 | TfTokenVector GetNames() override; 40 | HdDataSourceBaseHandle Get(const TfToken& name) override; 41 | 42 | #if PXR_VERSION < 2302 43 | bool Has(const TfToken& name) override; 44 | #endif 45 | 46 | private: 47 | 48 | HdDataSourceBaseHandle _ComputeGeospatiallyAffectedXform(); 49 | 50 | private: 51 | 52 | HdContainerDataSourceHandle _inputDataSource; 53 | HdContainerDataSourceHandle _parentDataSource; 54 | HdMatrixDataSourceHandle _matrixDataSource; 55 | 56 | class _GeospatiallyAffectedMatrixDataSource : public HdMatrixDataSource 57 | { 58 | public: 59 | 60 | HD_DECLARE_DATASOURCE(_GeospatiallyAffectedMatrixDataSource); 61 | 62 | VtValue GetValue(Time shutterOffset) override; 63 | GfMatrix4d GetTypedValue(Time shutterOffset) override; 64 | bool GetContributingSampleTimesForInterval( 65 | Time startTime, 66 | Time endTime, 67 | std::vector