From d45032608df26036c6b54883360d33f2915b1f37 Mon Sep 17 00:00:00 2001 From: jborucki Date: Tue, 31 Oct 2023 10:28:22 -0700 Subject: [PATCH] update --- .gitignore | 3 +- README.md | 10 +++--- exts/docs/tutorial.md | 10 ++++-- .../gesture_viewport/tests/__init__.py | 2 +- .../tests/test_hello_world.py | 2 +- .../example/gesture_window/tests/__init__.py | 2 +- .../gesture_window/tests/test_hello_world.py | 2 +- link_app.sh | 8 +++++ tools/packman/bootstrap/configure.bat | 2 +- .../bootstrap/download_file_from_url.ps1 | 2 +- .../fetch_file_from_packman_bootstrap.cmd | 2 +- .../bootstrap/generate_temp_file_name.ps1 | 2 +- .../bootstrap/generate_temp_folder.ps1 | 2 +- tools/packman/bootstrap/install_package.py | 2 +- tools/packman/packman | 2 +- tools/packman/python.sh | 32 +++++++++++++++++++ 16 files changed, 65 insertions(+), 20 deletions(-) create mode 100644 link_app.sh create mode 100644 tools/packman/python.sh diff --git a/.gitignore b/.gitignore index 41161ee..217a6d2 100644 --- a/.gitignore +++ b/.gitignore @@ -12,5 +12,4 @@ _*/ /app exts/omni.example.gesture_adv/* -link_app.sh -tools/packman/python.sh + diff --git a/README.md b/README.md index 8f3096c..48b781d 100644 --- a/README.md +++ b/README.md @@ -53,12 +53,12 @@ Run: ```shell # Linux -~$ link_app.sh +~$ ./link_app.sh ``` If successful you should see `app` folder link in the root of this repo. -If multiple Omniverse apps is installed script will select recommended one. Or you can explicitly pass an app: +If multiple Omniverse apps are installed the script will select the recommended one. Or you can explicitly pass an app: ```bash # Windows @@ -67,10 +67,10 @@ If multiple Omniverse apps is installed script will select recommended one. Or y ```shell # Linux -> link_app.sh --app code +~$ ./link_app.sh --app code ``` -You can also just pass a path to create link to: +You can also pass a path that leads to the Omniverse package folder to create the link: ```bash # Windows @@ -79,7 +79,7 @@ You can also just pass a path to create link to: ```shell # Linux -> link_app.sh --path "home/bob/.local/share/ov/pkg/create-2022.1.3" +~$ ./link_app.sh --path "home/bob/.local/share/ov/pkg/create-2022.1.3" ``` ## Contributing diff --git a/exts/docs/tutorial.md b/exts/docs/tutorial.md index 882a5dd..884f2be 100644 --- a/exts/docs/tutorial.md +++ b/exts/docs/tutorial.md @@ -361,6 +361,7 @@ def move(transform, shape): 2. **Add** the following import at the top of the `window.py`: - `from functools import partial` +- Partial functions allow for a more limited function with fewer parameters and fixed values. 3. **Update** DragGesture's `on_changed_fn` to look like the following: @@ -653,6 +654,7 @@ class GestureWindowExample(ui.Window): ] ) transform = sc.Transform(transform=sc.Matrix44.get_translation_matrix(0,0,-1)) + with transform: sc.Rectangle( 2, 2, @@ -765,6 +767,7 @@ class GestureWindowExample(ui.Window): ] ) transform = sc.Transform(transform=sc.Matrix44.get_translation_matrix(0,0,-1)) + with transform: sc.Rectangle( 2, 2, @@ -903,7 +906,7 @@ class LineManipulator(sc.Manipulator): ## Step 7.4: Add a Gesture Manager -The Gesture Manager works the same way when added in `window.py`. However, this time we will specify which gesture to prevent. +The Gesture Manager works the same way when added in `line.py`. However, this time we will specify which gesture to prevent. 1. **Add** the following code after the imports: ```python @@ -960,6 +963,9 @@ class LineManipulator(sc.Manipulator): ) ``` -**Save** `line.py` and go back to Omniverse. Now we can freely drag the line in the viewport. +**Save** `line.py` and go back to Omniverse. Now we can freely drag the line along the X-Axis in the viewport. ![](./images/step7-4.gif) + + +Scene manipulators are essential tools in NVIDIA Omniverse for controlling, editing, and arranging 3D scenes. Explore [advanced scene manipulator](https://github.com/NVIDIA-Omniverse/kit-extension-sample-ui-scene) options to deepen your understanding of creating custom scene manipulation tools. \ No newline at end of file diff --git a/exts/omni.example.gesture_viewport/omni/example/gesture_viewport/tests/__init__.py b/exts/omni.example.gesture_viewport/omni/example/gesture_viewport/tests/__init__.py index fa877be..1398c15 100644 --- a/exts/omni.example.gesture_viewport/omni/example/gesture_viewport/tests/__init__.py +++ b/exts/omni.example.gesture_viewport/omni/example/gesture_viewport/tests/__init__.py @@ -1,4 +1,4 @@ -# Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved. +# Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation diff --git a/exts/omni.example.gesture_viewport/omni/example/gesture_viewport/tests/test_hello_world.py b/exts/omni.example.gesture_viewport/omni/example/gesture_viewport/tests/test_hello_world.py index b410584..6e38f3f 100644 --- a/exts/omni.example.gesture_viewport/omni/example/gesture_viewport/tests/test_hello_world.py +++ b/exts/omni.example.gesture_viewport/omni/example/gesture_viewport/tests/test_hello_world.py @@ -1,4 +1,4 @@ -# Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved. +# Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation diff --git a/exts/omni.example.gesture_window/omni/example/gesture_window/tests/__init__.py b/exts/omni.example.gesture_window/omni/example/gesture_window/tests/__init__.py index fa877be..1398c15 100644 --- a/exts/omni.example.gesture_window/omni/example/gesture_window/tests/__init__.py +++ b/exts/omni.example.gesture_window/omni/example/gesture_window/tests/__init__.py @@ -1,4 +1,4 @@ -# Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved. +# Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation diff --git a/exts/omni.example.gesture_window/omni/example/gesture_window/tests/test_hello_world.py b/exts/omni.example.gesture_window/omni/example/gesture_window/tests/test_hello_world.py index b410584..6e38f3f 100644 --- a/exts/omni.example.gesture_window/omni/example/gesture_window/tests/test_hello_world.py +++ b/exts/omni.example.gesture_window/omni/example/gesture_window/tests/test_hello_world.py @@ -1,4 +1,4 @@ -# Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved. +# Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation diff --git a/link_app.sh b/link_app.sh new file mode 100644 index 0000000..042ba8a --- /dev/null +++ b/link_app.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +set -e + +SCRIPT_DIR=$(dirname ${BASH_SOURCE}) +cd "$SCRIPT_DIR" + +exec "tools/packman/python.sh" tools/scripts/link_app.py $@ diff --git a/tools/packman/bootstrap/configure.bat b/tools/packman/bootstrap/configure.bat index 8c502b3..93af44f 100644 --- a/tools/packman/bootstrap/configure.bat +++ b/tools/packman/bootstrap/configure.bat @@ -1,4 +1,4 @@ -:: Copyright 2019 NVIDIA CORPORATION +:: Copyright 2023 NVIDIA CORPORATION :: :: Licensed under the Apache License, Version 2.0 (the "License"); :: you may not use this file except in compliance with the License. diff --git a/tools/packman/bootstrap/download_file_from_url.ps1 b/tools/packman/bootstrap/download_file_from_url.ps1 index 5a3e2ed..c8b73b7 100644 --- a/tools/packman/bootstrap/download_file_from_url.ps1 +++ b/tools/packman/bootstrap/download_file_from_url.ps1 @@ -1,5 +1,5 @@ <# -Copyright 2019 NVIDIA CORPORATION +Copyright 2023 NVIDIA CORPORATION Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/packman/bootstrap/fetch_file_from_packman_bootstrap.cmd b/tools/packman/bootstrap/fetch_file_from_packman_bootstrap.cmd index 4339bdc..b26f7fd 100644 --- a/tools/packman/bootstrap/fetch_file_from_packman_bootstrap.cmd +++ b/tools/packman/bootstrap/fetch_file_from_packman_bootstrap.cmd @@ -1,4 +1,4 @@ -:: Copyright 2019 NVIDIA CORPORATION +:: Copyright 2023 NVIDIA CORPORATION :: :: Licensed under the Apache License, Version 2.0 (the "License"); :: you may not use this file except in compliance with the License. diff --git a/tools/packman/bootstrap/generate_temp_file_name.ps1 b/tools/packman/bootstrap/generate_temp_file_name.ps1 index aa3f004..d2df459 100644 --- a/tools/packman/bootstrap/generate_temp_file_name.ps1 +++ b/tools/packman/bootstrap/generate_temp_file_name.ps1 @@ -1,5 +1,5 @@ <# -Copyright 2019 NVIDIA CORPORATION +Copyright 2023 NVIDIA CORPORATION Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/packman/bootstrap/generate_temp_folder.ps1 b/tools/packman/bootstrap/generate_temp_folder.ps1 index d34fc9c..7704ac8 100644 --- a/tools/packman/bootstrap/generate_temp_folder.ps1 +++ b/tools/packman/bootstrap/generate_temp_folder.ps1 @@ -1,5 +1,5 @@ <# -Copyright 2019 NVIDIA CORPORATION +Copyright 2023 NVIDIA CORPORATION Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/packman/bootstrap/install_package.py b/tools/packman/bootstrap/install_package.py index 57b23cb..aa321e2 100644 --- a/tools/packman/bootstrap/install_package.py +++ b/tools/packman/bootstrap/install_package.py @@ -1,4 +1,4 @@ -# Copyright 2019 NVIDIA CORPORATION +# Copyright 2023 NVIDIA CORPORATION # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/tools/packman/packman b/tools/packman/packman index ffba4e8..0f2594c 100644 --- a/tools/packman/packman +++ b/tools/packman/packman @@ -1,6 +1,6 @@ #!/bin/bash -# Copyright 2019-2020 NVIDIA CORPORATION +# Copyright 2023 NVIDIA CORPORATION # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/tools/packman/python.sh b/tools/packman/python.sh new file mode 100644 index 0000000..8d9831d --- /dev/null +++ b/tools/packman/python.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +# Copyright 2023 NVIDIA CORPORATION + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at + +# http://www.apache.org/licenses/LICENSE-2.0 + +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -e + +PACKMAN_CMD="$(dirname "${BASH_SOURCE}")/packman" +if [ ! -f "$PACKMAN_CMD" ]; then + PACKMAN_CMD="${PACKMAN_CMD}.sh" +fi +source "$PACKMAN_CMD" init +export PYTHONPATH="${PM_MODULE_DIR}:${PYTHONPATH}" +export PYTHONNOUSERSITE=1 + +# workaround for our python not shipping with certs +if [[ -z ${SSL_CERT_DIR:-} ]]; then + export SSL_CERT_DIR=/etc/ssl/certs/ +fi + +"${PM_PYTHON}" -u "$@"