pxr-kind-dev 25.5.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,91 @@
1
+ # Prerequisites
2
+ *.d
3
+
4
+ # Compiled Object files
5
+ *.slo
6
+ *.lo
7
+ *.o
8
+ *.obj
9
+
10
+ # Precompiled Headers
11
+ *.gch
12
+ *.pch
13
+
14
+ # Compiled Dynamic libraries
15
+ *.so
16
+ *.dylib
17
+ *.dll
18
+
19
+ # Fortran module files
20
+ *.mod
21
+ *.smod
22
+
23
+ # Compiled Static libraries
24
+ *.lai
25
+ *.la
26
+ *.a
27
+ *.lib
28
+
29
+ # Executables
30
+ *.exe
31
+ *.out
32
+ *.app
33
+ !test/baseline/**/*.out
34
+
35
+ # Environment
36
+ .DS_Store
37
+ .AppleDouble
38
+
39
+ # Development
40
+ build/
41
+ .vscode
42
+ .project
43
+ .settings
44
+ .idea/
45
+ .history/
46
+
47
+ # CMake
48
+ cmake-build-*/
49
+
50
+ # Python byte-compiled / optimized / DLL files
51
+ __pycache__/
52
+ *.py[cod]
53
+ *$py.class
54
+
55
+ # Python Distribution / packaging
56
+ .Python
57
+ build/
58
+ develop-eggs/
59
+ dist/
60
+ downloads/
61
+ eggs/
62
+ .eggs/
63
+ lib/
64
+ lib64/
65
+ parts/
66
+ sdist/
67
+ var/
68
+ wheels/
69
+ share/python-wheels/
70
+ *.egg-info/
71
+ .installed.cfg
72
+ *.egg
73
+ MANIFEST
74
+ _skbuild/
75
+ wheelhouse/
76
+
77
+ # Unit test / coverage reports
78
+ .coverage
79
+ .coverage.*
80
+ .cache
81
+ .pytest_cache/
82
+ .benchmarks/
83
+
84
+ # Environments
85
+ .env
86
+ .venv
87
+ env/
88
+ venv/
89
+ ENV/
90
+ env.bak/
91
+ venv.bak/
@@ -0,0 +1,102 @@
1
+ cmake_minimum_required(VERSION 3.21...3.31)
2
+
3
+ # Default build type value.
4
+ set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the build type")
5
+
6
+ project(pxr-kind
7
+ VERSION 0.25.5
8
+ HOMEPAGE_URL "https://github.com/untwine/pxr-kind"
9
+ LANGUAGES C CXX
10
+ )
11
+
12
+ if (NOT "${CMAKE_CXX_STANDARD}")
13
+ set(CMAKE_CXX_STANDARD 17 CACHE STRING "Default C++ standard")
14
+ endif()
15
+
16
+ set(CMAKE_CXX_STANDARD_REQUIRED ON)
17
+ set(CMAKE_CXX_EXTENSIONS OFF)
18
+
19
+ # Default options.
20
+ option(BUILD_TESTS "Build tests" ON)
21
+ option(BUILD_SHARED_LIBS "Build Shared Library" ON)
22
+ option(BUILD_PYTHON_BINDINGS "Build Python Bindings" ON)
23
+ option(ENABLE_PRECOMPILED_HEADERS "Enable precompiled headers." OFF)
24
+
25
+ if (NOT BUILD_SHARED_LIBS)
26
+ add_compile_definitions(PXR_STATIC)
27
+ endif()
28
+
29
+ include(GNUInstallDirs)
30
+
31
+ if (WIN32)
32
+ # Prevent WinDef.h from defining min/max macros.
33
+ add_definitions(-DNOMINMAX)
34
+
35
+ # Exclude unnecessary Windows APIs for faster builds and fewer macro conflicts.
36
+ add_definitions(-DWIN32_LEAN_AND_MEAN)
37
+
38
+ # Disable /Zc:inline in VS 2019+ to retain "arch_ctor_<name>" symbols in release.
39
+ # https://developercommunity.visualstudio.com/t/914943
40
+ if (MSVC_VERSION GREATER_EQUAL 1920)
41
+ set(CMAKE_CXX_FLAGS "/Zc:inline- ${CMAKE_CXX_FLAGS}")
42
+ else()
43
+ set(CMAKE_CXX_FLAGS "/Zc:inline ${CMAKE_CXX_FLAGS}")
44
+ endif()
45
+
46
+ # Disable harmless Visual Studio warning C4003 (non-standard preprocessor).
47
+ # https://developercommunity.visualstudio.com/t/364698
48
+ set(CMAKE_CXX_FLAGS "/wd4003 ${CMAKE_CXX_FLAGS}")
49
+ endif()
50
+
51
+ # Update build type from environment for CMake < 3.22
52
+ if (DEFINED ENV{CMAKE_BUILD_TYPE})
53
+ set(CMAKE_BUILD_TYPE $ENV{CMAKE_BUILD_TYPE}
54
+ CACHE STRING "Specifies the build type" FORCE)
55
+ endif()
56
+
57
+ find_package(pxr-tf 0.25.5 REQUIRED)
58
+ find_package(pxr-plug 0.25.5 REQUIRED)
59
+
60
+ if(BUILD_PYTHON_BINDINGS)
61
+ add_compile_definitions(PXR_PYTHON_SUPPORT_ENABLED=1)
62
+ find_package(pxr-boost 0.25.5 REQUIRED)
63
+
64
+ if (NOT CMAKE_INSTALL_PYTHON_LIBDIR)
65
+ set(py_version "${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}")
66
+ set(CMAKE_INSTALL_PYTHON_LIBDIR
67
+ "${CMAKE_INSTALL_LIBDIR}/python${py_version}/site-packages"
68
+ CACHE INTERNAL "Installation Python library path.")
69
+ endif ()
70
+ endif()
71
+
72
+ add_subdirectory(src)
73
+
74
+ # Build and setup tests if required.
75
+ if (BUILD_TESTS)
76
+ # Python is needed to run the tests.
77
+ find_package(Python COMPONENTS Interpreter Development REQUIRED)
78
+ find_package(Pytest)
79
+
80
+ enable_testing()
81
+ add_subdirectory(test)
82
+ endif()
83
+
84
+ include(CMakePackageConfigHelpers)
85
+
86
+ configure_package_config_file(
87
+ "cmake/pxr-kind-config.cmake.in"
88
+ "${CMAKE_CURRENT_BINARY_DIR}/pxr-kind-config.cmake"
89
+ INSTALL_DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/cmake/pxr-kind
90
+ )
91
+
92
+ write_basic_package_version_file(
93
+ "pxr-kind-config-version.cmake"
94
+ COMPATIBILITY AnyNewerVersion
95
+ )
96
+
97
+ install(
98
+ FILES
99
+ "${CMAKE_CURRENT_BINARY_DIR}/pxr-kind-config.cmake"
100
+ "${CMAKE_CURRENT_BINARY_DIR}/pxr-kind-config-version.cmake"
101
+ DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/cmake/pxr-kind
102
+ )
@@ -0,0 +1,180 @@
1
+ ============================================================
2
+ OpenUSD
3
+ ============================================================
4
+
5
+ Note: The Tomorrow Open Source Technology License 1.0 differs from the
6
+ original Apache License 2.0 in the following manner. Section 6 ("Trademarks")
7
+ is different.
8
+
9
+ TOMORROW OPEN SOURCE TECHNOLOGY LICENSE 1.0
10
+
11
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
12
+
13
+ 1. Definitions.
14
+
15
+ "License" shall mean the terms and conditions for use, reproduction,
16
+ and distribution as defined by Sections 1 through 9 of this document.
17
+
18
+ "Licensor" shall mean the copyright owner or entity authorized by
19
+ the copyright owner that is granting the License.
20
+
21
+ "Legal Entity" shall mean the union of the acting entity and all
22
+ other entities that control, are controlled by, or are under common
23
+ control with that entity. For the purposes of this definition,
24
+ "control" means (i) the power, direct or indirect, to cause the
25
+ direction or management of such entity, whether by contract or
26
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
27
+ outstanding shares, or (iii) beneficial ownership of such entity.
28
+
29
+ "You" (or "Your") shall mean an individual or Legal Entity
30
+ exercising permissions granted by this License.
31
+
32
+ "Source" form shall mean the preferred form for making modifications,
33
+ including but not limited to software source code, documentation
34
+ source, and configuration files.
35
+
36
+ "Object" form shall mean any form resulting from mechanical
37
+ transformation or translation of a Source form, including but
38
+ not limited to compiled object code, generated documentation,
39
+ and conversions to other media types.
40
+
41
+ "Work" shall mean the work of authorship, whether in Source or
42
+ Object form, made available under the License, as indicated by a
43
+ copyright notice that is included in or attached to the work
44
+ (an example is provided in the Appendix below).
45
+
46
+ "Derivative Works" shall mean any work, whether in Source or Object
47
+ form, that is based on (or derived from) the Work and for which the
48
+ editorial revisions, annotations, elaborations, or other modifications
49
+ represent, as a whole, an original work of authorship. For the purposes
50
+ of this License, Derivative Works shall not include works that remain
51
+ separable from, or merely link (or bind by name) to the interfaces of,
52
+ the Work and Derivative Works thereof.
53
+
54
+ "Contribution" shall mean any work of authorship, including
55
+ the original version of the Work and any modifications or additions
56
+ to that Work or Derivative Works thereof, that is intentionally
57
+ submitted to Licensor for inclusion in the Work by the copyright owner
58
+ or by an individual or Legal Entity authorized to submit on behalf of
59
+ the copyright owner. For the purposes of this definition, "submitted"
60
+ means any form of electronic, verbal, or written communication sent
61
+ to the Licensor or its representatives, including but not limited to
62
+ communication on electronic mailing lists, source code control systems,
63
+ and issue tracking systems that are managed by, or on behalf of, the
64
+ Licensor for the purpose of discussing and improving the Work, but
65
+ excluding communication that is conspicuously marked or otherwise
66
+ designated in writing by the copyright owner as "Not a Contribution."
67
+
68
+ "Contributor" shall mean Licensor and any individual or Legal Entity
69
+ on behalf of whom a Contribution has been received by Licensor and
70
+ subsequently incorporated within the Work.
71
+
72
+ 2. Grant of Copyright License. Subject to the terms and conditions of
73
+ this License, each Contributor hereby grants to You a perpetual,
74
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
75
+ copyright license to reproduce, prepare Derivative Works of,
76
+ publicly display, publicly perform, sublicense, and distribute the
77
+ Work and such Derivative Works in Source or Object form.
78
+
79
+ 3. Grant of Patent License. Subject to the terms and conditions of
80
+ this License, each Contributor hereby grants to You a perpetual,
81
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
82
+ (except as stated in this section) patent license to make, have made,
83
+ use, offer to sell, sell, import, and otherwise transfer the Work,
84
+ where such license applies only to those patent claims licensable
85
+ by such Contributor that are necessarily infringed by their
86
+ Contribution(s) alone or by combination of their Contribution(s)
87
+ with the Work to which such Contribution(s) was submitted. If You
88
+ institute patent litigation against any entity (including a
89
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
90
+ or a Contribution incorporated within the Work constitutes direct
91
+ or contributory patent infringement, then any patent licenses
92
+ granted to You under this License for that Work shall terminate
93
+ as of the date such litigation is filed.
94
+
95
+ 4. Redistribution. You may reproduce and distribute copies of the
96
+ Work or Derivative Works thereof in any medium, with or without
97
+ modifications, and in Source or Object form, provided that You
98
+ meet the following conditions:
99
+
100
+ (a) You must give any other recipients of the Work or
101
+ Derivative Works a copy of this License; and
102
+
103
+ (b) You must cause any modified files to carry prominent notices
104
+ stating that You changed the files; and
105
+
106
+ (c) You must retain, in the Source form of any Derivative Works
107
+ that You distribute, all copyright, patent, trademark, and
108
+ attribution notices from the Source form of the Work,
109
+ excluding those notices that do not pertain to any part of
110
+ the Derivative Works; and
111
+
112
+ (d) If the Work includes a "NOTICE" text file as part of its
113
+ distribution, then any Derivative Works that You distribute must
114
+ include a readable copy of the attribution notices contained
115
+ within such NOTICE file, excluding those notices that do not
116
+ pertain to any part of the Derivative Works, in at least one
117
+ of the following places: within a NOTICE text file distributed
118
+ as part of the Derivative Works; within the Source form or
119
+ documentation, if provided along with the Derivative Works; or,
120
+ within a display generated by the Derivative Works, if and
121
+ wherever such third-party notices normally appear. The contents
122
+ of the NOTICE file are for informational purposes only and
123
+ do not modify the License. You may add Your own attribution
124
+ notices within Derivative Works that You distribute, alongside
125
+ or as an addendum to the NOTICE text from the Work, provided
126
+ that such additional attribution notices cannot be construed
127
+ as modifying the License.
128
+
129
+ You may add Your own copyright statement to Your modifications and
130
+ may provide additional or different license terms and conditions
131
+ for use, reproduction, or distribution of Your modifications, or
132
+ for any such Derivative Works as a whole, provided Your use,
133
+ reproduction, and distribution of the Work otherwise complies with
134
+ the conditions stated in this License.
135
+
136
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
137
+ any Contribution intentionally submitted for inclusion in the Work
138
+ by You to the Licensor shall be under the terms and conditions of
139
+ this License, without any additional terms or conditions.
140
+ Notwithstanding the above, nothing herein shall supersede or modify
141
+ the terms of any separate license agreement you may have executed
142
+ with Licensor regarding such Contributions.
143
+
144
+ 6. Trademarks. This License does not grant permission to use the trade
145
+ names, trademarks, service marks, or product names of the Licensor
146
+ and its affiliates, except as required to comply with Section 4(c) of
147
+ the License and to reproduce the content of the NOTICE file.
148
+
149
+ 7. Disclaimer of Warranty. Unless required by applicable law or
150
+ agreed to in writing, Licensor provides the Work (and each
151
+ Contributor provides its Contributions) on an "AS IS" BASIS,
152
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
153
+ implied, including, without limitation, any warranties or conditions
154
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
155
+ PARTICULAR PURPOSE. You are solely responsible for determining the
156
+ appropriateness of using or redistributing the Work and assume any
157
+ risks associated with Your exercise of permissions under this License.
158
+
159
+ 8. Limitation of Liability. In no event and under no legal theory,
160
+ whether in tort (including negligence), contract, or otherwise,
161
+ unless required by applicable law (such as deliberate and grossly
162
+ negligent acts) or agreed to in writing, shall any Contributor be
163
+ liable to You for damages, including any direct, indirect, special,
164
+ incidental, or consequential damages of any character arising as a
165
+ result of this License or out of the use or inability to use the
166
+ Work (including but not limited to damages for loss of goodwill,
167
+ work stoppage, computer failure or malfunction, or any and all
168
+ other commercial damages or losses), even if such Contributor
169
+ has been advised of the possibility of such damages.
170
+
171
+ 9. Accepting Warranty or Additional Liability. While redistributing
172
+ the Work or Derivative Works thereof, You may choose to offer,
173
+ and charge a fee for, acceptance of support, warranty, indemnity,
174
+ or other liability obligations and/or rights consistent with this
175
+ License. However, in accepting such obligations, You may act only
176
+ on Your own behalf and on Your sole responsibility, not on behalf
177
+ of any other Contributor, and only if You agree to indemnify,
178
+ defend, and hold each Contributor harmless for any liability
179
+ incurred by, or claims asserted against, such Contributor by reason
180
+ of your accepting any such warranty or additional liability.
@@ -0,0 +1,8 @@
1
+ Universal Scene Description
2
+ Copyright 2016 Pixar
3
+
4
+ All rights reserved.
5
+
6
+ This product includes software developed at:
7
+
8
+ Pixar (http://www.pixar.com/).
@@ -0,0 +1,38 @@
1
+ Metadata-Version: 2.4
2
+ Name: pxr-kind-dev
3
+ Version: 25.5.1
4
+ Summary: C++ headers and CMake config for developing with pxr-kind
5
+ Keywords: pixar,open-usd,dev
6
+ License-File: LICENSE.txt
7
+ License-File: NOTICE.txt
8
+ Classifier: Intended Audience :: Developers
9
+ Classifier: Programming Language :: Python :: 3
10
+ Classifier: Operating System :: POSIX :: Linux
11
+ Classifier: Operating System :: MacOS :: MacOS X
12
+ Classifier: Operating System :: Microsoft :: Windows :: Windows 10
13
+ Project-URL: Repository, https://github.com/untwine/pxr-kind
14
+ Requires-Python: >=3.8
15
+ Requires-Dist: pxr-tf-dev==25.5.1.*
16
+ Requires-Dist: pxr-plug-dev==25.5.1.*
17
+ Description-Content-Type: text/markdown
18
+
19
+ # Pixar Plug
20
+
21
+ [![PyPi version](https://img.shields.io/pypi/v/pxr-kind.svg?logo=pypi&label=PyPI&logoColor=gold)](https://pypi.python.org/pypi/pxr-kind)
22
+ [![CMake](https://img.shields.io/badge/CMake-3.21...3.31-blue.svg?logo=CMake&logoColor=blue)](https://cmake.org)
23
+ [![Linux](https://github.com/untwine/pxr-kind/actions/workflows/linux.yml/badge.svg?branch=main)](https://github.com/untwine/pxr-kind/actions/workflows/linux.yml)
24
+ [![MacOs](https://github.com/untwine/pxr-kind/actions/workflows/macos.yml/badge.svg?branch=main)](https://github.com/untwine/pxr-kind/actions/workflows/macos.yml)
25
+ [![Windows](https://github.com/untwine/pxr-kind/actions/workflows/windows.yml/badge.svg?branch=main)](https://github.com/untwine/pxr-kind/actions/workflows/windows.yml)
26
+ [![License](https://img.shields.io/badge/License-TOST-yellow.svg)](https://github.com/untwine/pxr-kind/blob/main/LICENSE.txt)
27
+
28
+ Runtime-extensible taxonomy system used in OpenUSD.
29
+
30
+ This repository is a decoupled version of the "kind" library from the
31
+ [OpenUSD](https://graphics.pixar.com/usd/release/index.html) library, created
32
+ by Pixar.
33
+
34
+ It is regularly rebased over the "release" branch of the original
35
+ [repository](https://github.com/PixarAnimationStudios/OpenUSD) to provide
36
+ explicit divergence information from the latest updates and is currently
37
+ synchronized with
38
+ [v25.05.01](https://github.com/PixarAnimationStudios/OpenUSD/releases/tag/v25.05.01).
@@ -0,0 +1,20 @@
1
+ # Pixar Plug
2
+
3
+ [![PyPi version](https://img.shields.io/pypi/v/pxr-kind.svg?logo=pypi&label=PyPI&logoColor=gold)](https://pypi.python.org/pypi/pxr-kind)
4
+ [![CMake](https://img.shields.io/badge/CMake-3.21...3.31-blue.svg?logo=CMake&logoColor=blue)](https://cmake.org)
5
+ [![Linux](https://github.com/untwine/pxr-kind/actions/workflows/linux.yml/badge.svg?branch=main)](https://github.com/untwine/pxr-kind/actions/workflows/linux.yml)
6
+ [![MacOs](https://github.com/untwine/pxr-kind/actions/workflows/macos.yml/badge.svg?branch=main)](https://github.com/untwine/pxr-kind/actions/workflows/macos.yml)
7
+ [![Windows](https://github.com/untwine/pxr-kind/actions/workflows/windows.yml/badge.svg?branch=main)](https://github.com/untwine/pxr-kind/actions/workflows/windows.yml)
8
+ [![License](https://img.shields.io/badge/License-TOST-yellow.svg)](https://github.com/untwine/pxr-kind/blob/main/LICENSE.txt)
9
+
10
+ Runtime-extensible taxonomy system used in OpenUSD.
11
+
12
+ This repository is a decoupled version of the "kind" library from the
13
+ [OpenUSD](https://graphics.pixar.com/usd/release/index.html) library, created
14
+ by Pixar.
15
+
16
+ It is regularly rebased over the "release" branch of the original
17
+ [repository](https://github.com/PixarAnimationStudios/OpenUSD) to provide
18
+ explicit divergence information from the latest updates and is currently
19
+ synchronized with
20
+ [v25.05.01](https://github.com/PixarAnimationStudios/OpenUSD/releases/tag/v25.05.01).
@@ -0,0 +1,13 @@
1
+ include(CMakeFindDependencyMacro)
2
+
3
+ @PACKAGE_INIT@
4
+
5
+ find_dependency(pxr-tf 0.25.5 REQUIRED)
6
+ find_dependency(pxr-plug 0.25.5 REQUIRED)
7
+
8
+ set(_with_py_bindings "@BUILD_PYTHON_BINDINGS@")
9
+ if(_with_py_bindings)
10
+ find_dependency(pxr-boost 0.25.5 REQUIRED)
11
+ endif()
12
+
13
+ include(${CMAKE_CURRENT_LIST_DIR}/pxr-kind-targets.cmake)
@@ -0,0 +1,43 @@
1
+ [build-system]
2
+ requires = [
3
+ "scikit-build-core",
4
+ "pxr-tf-dev==25.5.1.*",
5
+ "pxr-plug-dev==25.5.1.*",
6
+ ]
7
+ build-backend = "scikit_build_core.build"
8
+
9
+ [project]
10
+ name = "pxr-kind-dev"
11
+ version = "25.5.1"
12
+ description = "C++ headers and CMake config for developing with pxr-kind"
13
+ readme = "README.md"
14
+ requires-python = ">=3.8"
15
+ license-files = ["LICENSE.txt", "NOTICE.txt"]
16
+ keywords = ["pixar", "open-usd", "dev"]
17
+ classifiers = [
18
+ "Intended Audience :: Developers",
19
+ "Programming Language :: Python :: 3",
20
+ "Operating System :: POSIX :: Linux",
21
+ "Operating System :: MacOS :: MacOS X",
22
+ "Operating System :: Microsoft :: Windows :: Windows 10",
23
+ ]
24
+ dependencies = [
25
+ "pxr-tf-dev==25.5.1.*",
26
+ "pxr-plug-dev==25.5.1.*",
27
+ ]
28
+
29
+ [project.urls]
30
+ Repository = "https://github.com/untwine/pxr-kind"
31
+
32
+ [tool.scikit-build]
33
+ cmake.version = ">=3.21,<4"
34
+ cmake.args = [
35
+ "-DBUILD_TESTS=OFF",
36
+ "-DBUILD_SHARED_LIBS=ON",
37
+ "-DBUILD_PYTHON_BINDINGS=ON",
38
+ "-DCMAKE_INSTALL_LIBDIR=pxr-kind/lib",
39
+ "-DCMAKE_INSTALL_INCLUDEDIR=pxr-kind/include",
40
+ "-DCMAKE_INSTALL_DATAROOTDIR=pxr-kind",
41
+ "-DCMAKE_INSTALL_PYTHON_LIBDIR=pxr-kind/lib/python",
42
+ ]
43
+ sdist.exclude = ["test", ".github"]
@@ -0,0 +1,43 @@
1
+ [build-system]
2
+ requires = [
3
+ "scikit-build-core",
4
+ "pxr-tf-dev==25.5.1.*",
5
+ "pxr-plug-dev==25.5.1.*",
6
+ ]
7
+ build-backend = "scikit_build_core.build"
8
+
9
+ [project]
10
+ name = "pxr-kind-dev"
11
+ version = "25.5.1"
12
+ description = "C++ headers and CMake config for developing with pxr-kind"
13
+ readme = "README.md"
14
+ requires-python = ">=3.8"
15
+ license-files = ["LICENSE.txt", "NOTICE.txt"]
16
+ keywords = ["pixar", "open-usd", "dev"]
17
+ classifiers = [
18
+ "Intended Audience :: Developers",
19
+ "Programming Language :: Python :: 3",
20
+ "Operating System :: POSIX :: Linux",
21
+ "Operating System :: MacOS :: MacOS X",
22
+ "Operating System :: Microsoft :: Windows :: Windows 10",
23
+ ]
24
+ dependencies = [
25
+ "pxr-tf-dev==25.5.1.*",
26
+ "pxr-plug-dev==25.5.1.*",
27
+ ]
28
+
29
+ [project.urls]
30
+ Repository = "https://github.com/untwine/pxr-kind"
31
+
32
+ [tool.scikit-build]
33
+ cmake.version = ">=3.21,<4"
34
+ cmake.args = [
35
+ "-DBUILD_TESTS=OFF",
36
+ "-DBUILD_SHARED_LIBS=ON",
37
+ "-DBUILD_PYTHON_BINDINGS=ON",
38
+ "-DCMAKE_INSTALL_LIBDIR=pxr-kind/lib",
39
+ "-DCMAKE_INSTALL_INCLUDEDIR=pxr-kind/include",
40
+ "-DCMAKE_INSTALL_DATAROOTDIR=pxr-kind",
41
+ "-DCMAKE_INSTALL_PYTHON_LIBDIR=pxr-kind/lib/python",
42
+ ]
43
+ sdist.exclude = ["test", ".github"]
@@ -0,0 +1,71 @@
1
+ add_library(kind
2
+ pxr/kind/registry.cpp
3
+ )
4
+
5
+ target_include_directories(kind
6
+ PUBLIC
7
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
8
+ $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
9
+ )
10
+
11
+ target_link_libraries(kind
12
+ PUBLIC
13
+ pxr::tf
14
+ pxr::plug
15
+ )
16
+
17
+ if(BUILD_PYTHON_BINDINGS)
18
+ target_sources(kind
19
+ PRIVATE
20
+ pxr/kind/moduleDeps.cpp
21
+ )
22
+
23
+ target_link_libraries(kind
24
+ PUBLIC
25
+ pxr::boost-python
26
+ )
27
+
28
+ add_subdirectory(python)
29
+ endif()
30
+
31
+ if (ENABLE_PRECOMPILED_HEADERS)
32
+ target_precompile_headers(kind
33
+ PRIVATE
34
+ pxr/kind/pch.h
35
+ )
36
+ endif()
37
+
38
+ set_target_properties(kind
39
+ PROPERTIES
40
+ POSITION_INDEPENDENT_CODE ON
41
+ OUTPUT_NAME "PxrKind"
42
+ )
43
+
44
+ target_compile_definitions(kind
45
+ PRIVATE
46
+ KIND_EXPORTS=1
47
+ MFB_PACKAGE_MODULE=Kind
48
+ MFB_PACKAGE_NAME=kind
49
+ MFB_ALT_PACKAGE_NAME=kind
50
+ )
51
+
52
+ install(
53
+ TARGETS kind EXPORT ${PROJECT_NAME}
54
+ RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}
55
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
56
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
57
+ )
58
+
59
+ install(
60
+ FILES
61
+ pxr/kind/api.h
62
+ pxr/kind/registry.h
63
+ DESTINATION
64
+ ${CMAKE_INSTALL_INCLUDEDIR}/pxr/kind
65
+ )
66
+
67
+ install(EXPORT ${PROJECT_NAME}
68
+ FILE pxr-kind-targets.cmake
69
+ NAMESPACE pxr::
70
+ DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/cmake/pxr-kind
71
+ )
@@ -0,0 +1,31 @@
1
+ // Copyright 2017 Pixar
2
+ //
3
+ // Licensed under the terms set forth in the LICENSE.txt file available at
4
+ // https://openusd.org/license.
5
+ //
6
+ // Modified by Jeremy Retailleau.
7
+
8
+ #ifndef PXR_KIND_API_H
9
+ #define PXR_KIND_API_H
10
+
11
+ #include <pxr/arch/export.h>
12
+
13
+ #if defined(PXR_STATIC)
14
+ # define KIND_API
15
+ # define KIND_API_TEMPLATE_CLASS(...)
16
+ # define KIND_API_TEMPLATE_STRUCT(...)
17
+ # define KIND_LOCAL
18
+ #else
19
+ # if defined(KIND_EXPORTS)
20
+ # define KIND_API ARCH_EXPORT
21
+ # define KIND_API_TEMPLATE_CLASS(...) ARCH_EXPORT_TEMPLATE(class, __VA_ARGS__)
22
+ # define KIND_API_TEMPLATE_STRUCT(...) ARCH_EXPORT_TEMPLATE(struct, __VA_ARGS__)
23
+ # else
24
+ # define KIND_API ARCH_IMPORT
25
+ # define KIND_API_TEMPLATE_CLASS(...) ARCH_IMPORT_TEMPLATE(class, __VA_ARGS__)
26
+ # define KIND_API_TEMPLATE_STRUCT(...) ARCH_IMPORT_TEMPLATE(struct, __VA_ARGS__)
27
+ # endif
28
+ # define KIND_LOCAL ARCH_HIDDEN
29
+ #endif
30
+
31
+ #endif
@@ -0,0 +1,27 @@
1
+ // Copyright 2016 Pixar
2
+ //
3
+ // Licensed under the terms set forth in the LICENSE.txt file available at
4
+ // https://openusd.org/license.
5
+ //
6
+ // Modified by Jeremy Retailleau.
7
+ ////////////////////////////////////////////////////////////////////////
8
+
9
+ #include <pxr/tf/registryManager.h>
10
+ #include <pxr/tf/scriptModuleLoader.h>
11
+ #include <pxr/tf/token.h>
12
+
13
+ #include <vector>
14
+
15
+ namespace pxr {
16
+
17
+ TF_REGISTRY_FUNCTION(pxr::TfScriptModuleLoader) {
18
+ // List of direct dependencies for this library.
19
+ const std::vector<TfToken> reqs = {
20
+ TfToken("tf"),
21
+ TfToken("plug"),
22
+ };
23
+ TfScriptModuleLoader::GetInstance().
24
+ RegisterLibrary(TfToken("kind"), TfToken("pxr.Kind"), reqs);
25
+ }
26
+
27
+ } // namespace pxr
@@ -0,0 +1,67 @@
1
+ ///
2
+ /// \page kind_page_front Kind : Extensible Categorization
3
+ /// \if ( PIXAR_MFB_BUILD )
4
+ /// \mainpage Kind : Extensible Categorization
5
+ /// \endif
6
+ /// \anchor mainpage_kind
7
+ ///
8
+ /// The Kind library provides a runtime-extensible taxonomy known as "kinds".
9
+ ///
10
+ /// Kinds are just TfToken symbols, but the KindRegistry allows
11
+ /// for organizing kinds into taxonomies of related/refined concepts,
12
+ /// and the KindRegistry::GetBaseKind() and KindRegistry::IsA() queries
13
+ /// enable reasoning about the hierarchy and classifying objects by kind.
14
+ ///
15
+ /// Kinds are useful for classifying scenegraph objects, such as by tagging
16
+ /// objects representing the roots of models with the kind of model it
17
+ /// represents; it is scenegraph taxonomy that motivates the "builtin"
18
+ /// kind hierarchy.
19
+ ///
20
+ /// \section kind_coreKinds The Core Kind Hierarchy
21
+ ///
22
+ /// The KindRegistry begins its life pre-loaded with the following hierarchy
23
+ /// of kinds that define our concept of "model hierarchy", which is so
24
+ /// central to our organization and discovery of scene description. Of course,
25
+ /// as described in the next section, unlimited new, entirely unrelated
26
+ /// taxonomies can be created by extension.
27
+ /// <ul>
28
+ /// <li><b>model</b> - Everything in the model hierarchy is a kind of model.</li>
29
+ /// <ul>
30
+ /// <li><b>component</b> - A component model is a terminal model in the model
31
+ /// hierarchy - it can have no child models.</li>
32
+ /// <li><b>group</b> - a model that is simply a container for other models.</li>
33
+ /// <ul>
34
+ /// <li><b>assembly</b> - An "important" group model - often because it is
35
+ /// itself a published asset.</li>
36
+ /// </ul>
37
+ /// </ul>
38
+ /// <li><b>subcomponent</b> - Within a component model, subcomponents identify
39
+ /// important (generally articulable) sub-trees.
40
+ /// Subcomponents are "stopping points" when
41
+ /// dynamically unrolling/expanding a component.</li>
42
+ /// </ul>
43
+ ///
44
+ /// \section kind_extensions Extending the KindRegistry
45
+ ///
46
+ /// The kind registry can be \em extended using the facilities provided by
47
+ /// PlugRegistry, by adding a 'Kinds' sub-dictionary to the \em plugInfo.json
48
+ /// file of any module within your "pixar-base aware" build environment.
49
+ /// The dictionary entries will look like the following:
50
+ /// \code{.json}
51
+ /// "Info": {
52
+ /// "Kinds": {
53
+ /// "chargroup": {
54
+ /// "baseKind": "assembly",
55
+ /// "description": "A chargroup is an assembly comprised of a single character plus some associated models -- typically hair, garments, and charprops."
56
+ /// },
57
+ /// "charprop": {
58
+ /// "baseKind": "component"
59
+ /// },
60
+ /// "newRootKind": {
61
+ /// }
62
+ /// }
63
+ /// }
64
+ /// \endcode
65
+ /// \note One cannot alter core kinds or their place in the hierarchy or any
66
+ /// other data associated with them by attempting to override them in the
67
+ /// extension file. Attempting to do so will result in a registration error.
@@ -0,0 +1,53 @@
1
+ // Copyright 2017 Pixar
2
+ //
3
+ // Licensed under the terms set forth in the LICENSE.txt file available at
4
+ // https://openusd.org/license.
5
+ //
6
+ // Modified by Jeremy Retailleau.
7
+
8
+ #define TF_MAX_ARITY 7
9
+ #include <pxr/arch/defines.h>
10
+ #if defined(ARCH_OS_LINUX)
11
+ #include <unistd.h>
12
+ #endif
13
+ #include <algorithm>
14
+ #include <any>
15
+ #include <atomic>
16
+ #include <cinttypes>
17
+ #include <cmath>
18
+ #include <complex>
19
+ #include <cstdarg>
20
+ #include <cstddef>
21
+ #include <cstdint>
22
+ #include <cstdlib>
23
+ #include <cstring>
24
+ #include <functional>
25
+ #include <iosfwd>
26
+ #include <iostream>
27
+ #include <iterator>
28
+ #include <limits>
29
+ #include <list>
30
+ #include <locale>
31
+ #include <map>
32
+ #include <math.h>
33
+ #include <memory>
34
+ #include <mutex>
35
+ #include <ostream>
36
+ #include <set>
37
+ #include <sstream>
38
+ #include <stdarg.h>
39
+ #include <stddef.h>
40
+ #include <string>
41
+ #include <sys/types.h>
42
+ #include <thread>
43
+ #include <tuple>
44
+ #include <type_traits>
45
+ #include <typeindex>
46
+ #include <typeinfo>
47
+ #include <unordered_map>
48
+ #include <unordered_set>
49
+ #include <utility>
50
+ #include <vector>
51
+ #ifdef PXR_PYTHON_SUPPORT_ENABLED
52
+ #include <pxr/tf/pySafePython.h>
53
+ #endif // PXR_PYTHON_SUPPORT_ENABLED
@@ -0,0 +1,240 @@
1
+ // Copyright 2016 Pixar
2
+ //
3
+ // Licensed under the terms set forth in the LICENSE.txt file available at
4
+ // https://openusd.org/license.
5
+ //
6
+ // Modified by Jeremy Retailleau.
7
+
8
+ #include "./registry.h"
9
+ #include <pxr/plug/plugin.h>
10
+ #include <pxr/plug/registry.h>
11
+ #include <pxr/tf/instantiateSingleton.h>
12
+ #include <pxr/tf/iterator.h>
13
+ #include <pxr/tf/stringUtils.h>
14
+
15
+ namespace pxr {
16
+
17
+ TF_INSTANTIATE_SINGLETON(KindRegistry);
18
+ TF_DEFINE_PUBLIC_TOKENS(KindTokens, KIND_TOKENS);
19
+
20
+ TF_DEFINE_PRIVATE_TOKENS(_tokens,
21
+ ((PluginKindsKey, "Kinds"))
22
+ );
23
+
24
+
25
+ KindRegistry::KindRegistry()
26
+ {
27
+ _RegisterDefaults();
28
+ }
29
+
30
+ KindRegistry::~KindRegistry()
31
+ {
32
+ // do nothing
33
+ }
34
+
35
+ /* static */
36
+ KindRegistry&
37
+ KindRegistry::GetInstance()
38
+ {
39
+ return TfSingleton<KindRegistry>::GetInstance();
40
+ }
41
+
42
+ void
43
+ KindRegistry::_Register(const TfToken& kind,
44
+ const TfToken& baseKind)
45
+ {
46
+ if (!TfIsValidIdentifier(kind.GetString())) {
47
+ TF_CODING_ERROR("Invalid kind: '%s'", kind.GetText());
48
+ return;
49
+ }
50
+
51
+ _KindMap::const_iterator it = _kindMap.find(kind);
52
+
53
+ if (it != _kindMap.end()) {
54
+ TF_CODING_ERROR("Kind '%s' has already been registered",
55
+ kind.GetText());
56
+ return;
57
+ }
58
+
59
+ _KindData data;
60
+ data.baseKind = baseKind;
61
+ _kindMap[kind] = data;
62
+ }
63
+
64
+ /* static */
65
+ bool
66
+ KindRegistry::HasKind(const TfToken& kind)
67
+ {
68
+ return KindRegistry::GetInstance()._HasKind(kind);
69
+ }
70
+
71
+ bool
72
+ KindRegistry::_HasKind(const TfToken& kind) const
73
+ {
74
+ return _kindMap.count(kind) != 0;
75
+ }
76
+
77
+ /* static */
78
+ TfToken
79
+ KindRegistry::GetBaseKind(const TfToken &kind)
80
+ {
81
+ return KindRegistry::GetInstance()._GetBaseKind(kind);
82
+ }
83
+
84
+ TfToken
85
+ KindRegistry::_GetBaseKind(const TfToken &kind) const
86
+ {
87
+ _KindMap::const_iterator it = _kindMap.find(kind);
88
+
89
+ if (it == _kindMap.end()) {
90
+ TF_CODING_ERROR("Unknown kind: '%s'", kind.GetText());
91
+ return TfToken();
92
+ }
93
+
94
+ return it->second.baseKind;
95
+ }
96
+
97
+ /* static */
98
+ bool
99
+ KindRegistry::IsA(const TfToken& derivedKind, const TfToken &baseKind)
100
+ {
101
+ return KindRegistry::GetInstance()._IsA(derivedKind, baseKind);
102
+ }
103
+
104
+ /* static */
105
+ bool
106
+ KindRegistry::IsModel(const TfToken &kind)
107
+ {
108
+ return IsA(kind, KindTokens->model);
109
+ }
110
+
111
+ /* static */
112
+ bool
113
+ KindRegistry::IsAssembly(const TfToken &kind)
114
+ {
115
+ return IsA(kind, KindTokens->assembly);
116
+ }
117
+
118
+ /* static */
119
+ bool
120
+ KindRegistry::IsGroup(const TfToken &kind)
121
+ {
122
+ return IsA(kind, KindTokens->group);
123
+ }
124
+
125
+ /* static */
126
+ bool
127
+ KindRegistry::IsComponent(const TfToken &kind)
128
+ {
129
+ return IsA(kind, KindTokens->component);
130
+ }
131
+
132
+ /* static */
133
+ bool
134
+ KindRegistry::IsSubComponent(const TfToken &kind)
135
+ {
136
+ return IsA(kind, KindTokens->subcomponent);
137
+ }
138
+
139
+ bool
140
+ KindRegistry::_IsA(const TfToken& derivedKind, const TfToken &baseKind) const
141
+ {
142
+ if (derivedKind == baseKind) {
143
+ return true;
144
+ }
145
+
146
+ _KindMap::const_iterator it = _kindMap.find(derivedKind);
147
+
148
+ if (it == _kindMap.end()) {
149
+ // Don't make this a coding error; it's very convenient to allow
150
+ // querying about IsA for any random kind without having to e.g.
151
+ // verify that it's not an empty string first.
152
+ return false;
153
+ }
154
+
155
+ if (it->second.baseKind.IsEmpty()) {
156
+ return false;
157
+ }
158
+
159
+ return _IsA(it->second.baseKind, baseKind);
160
+ }
161
+
162
+ std::vector<TfToken>
163
+ KindRegistry::GetAllKinds()
164
+ {
165
+ return KindRegistry::GetInstance()._GetAllKinds();
166
+ }
167
+
168
+ std::vector<TfToken>
169
+ KindRegistry::_GetAllKinds() const
170
+ {
171
+ std::vector<TfToken> r;
172
+ r.reserve(_kindMap.size());
173
+ for (const auto &entry: _kindMap) {
174
+ r.push_back(entry.first);
175
+ }
176
+ return r;
177
+ }
178
+
179
+ // Helper function to make reading from dictionaries easier
180
+ static bool
181
+ _GetKey(const JsObject &dict, const std::string &key, JsObject *value)
182
+ {
183
+ JsObject::const_iterator i = dict.find(key);
184
+ if (i != dict.end() && i->second.IsObject()) {
185
+ *value = i->second.GetJsObject();
186
+ return true;
187
+ }
188
+ return false;
189
+ }
190
+
191
+
192
+ void
193
+ KindRegistry::_RegisterDefaults()
194
+ {
195
+ // Initialize builtin kind hierarchy.
196
+ _Register(KindTokens->subcomponent);
197
+ _Register(KindTokens->model);
198
+ _Register(KindTokens->component, KindTokens->model);
199
+ _Register(KindTokens->group, KindTokens->model);
200
+ _Register(KindTokens->assembly, KindTokens->group);
201
+
202
+ // Check plugInfo for extensions to the kind hierarchy.
203
+ //
204
+ // XXX We only do this once, and do not re-build the kind hierarchy
205
+ // if someone manages to add more plugins while the app is running.
206
+ // This allows the KindRegistry to be threadsafe without locking.
207
+ const PlugPluginPtrVector& plugins =
208
+ PlugRegistry::GetInstance().GetAllPlugins();
209
+ TF_FOR_ALL(plug, plugins){
210
+ JsObject kinds;
211
+ const JsObject &metadata = (*plug)->GetMetadata();
212
+ if (!_GetKey(metadata, _tokens->PluginKindsKey, &kinds)) continue;
213
+
214
+ TF_FOR_ALL(kindEntry, kinds){
215
+ // Each entry is a map from kind -> metadata dict.
216
+ TfToken kind(kindEntry->first);
217
+ JsObject kindDict;
218
+ if (!_GetKey(kinds, kind, &kindDict)){
219
+ TF_RUNTIME_ERROR("Expected dict for kind '%s'",
220
+ kind.GetText());
221
+ continue;
222
+ }
223
+
224
+ // Check for baseKind.
225
+ TfToken baseKind;
226
+ JsObject::const_iterator i = kindDict.find("baseKind");
227
+ if (i != kindDict.end()) {
228
+ if (i->second.IsString()) {
229
+ baseKind = TfToken(i->second.GetString());
230
+ } else {
231
+ TF_RUNTIME_ERROR("Expected string for baseKind");
232
+ continue;
233
+ }
234
+ }
235
+ _Register(kind, baseKind);
236
+ }
237
+ }
238
+ }
239
+
240
+ } // namespace pxr
@@ -0,0 +1,135 @@
1
+ // Copyright 2016 Pixar
2
+ //
3
+ // Licensed under the terms set forth in the LICENSE.txt file available at
4
+ // https://openusd.org/license.
5
+ //
6
+ // Modified by Jeremy Retailleau.
7
+
8
+ #ifndef PXR_KIND_REGISTRY_H
9
+ #define PXR_KIND_REGISTRY_H
10
+
11
+ /// \file kind/registry.h
12
+
13
+ #include "./api.h"
14
+ #include <pxr/tf/weakBase.h>
15
+ #include <pxr/tf/singleton.h>
16
+ #include <pxr/tf/staticTokens.h>
17
+ #include <pxr/tf/token.h>
18
+
19
+ #include <unordered_map>
20
+ #include <vector>
21
+
22
+ namespace pxr {
23
+
24
+ /// \hideinitializer
25
+ #define KIND_TOKENS \
26
+ (model) \
27
+ (component) \
28
+ (group) \
29
+ (assembly) \
30
+ (subcomponent)
31
+
32
+ /// \anchor KindTokens
33
+ /// Provides static, efficient TfToken's for built-in Kinds
34
+ ///
35
+ /// See \ref kind_coreKinds for description of the builtin kinds.
36
+ TF_DECLARE_PUBLIC_TOKENS(KindTokens, KIND_API, KIND_TOKENS);
37
+
38
+ /// \class KindRegistry
39
+ ///
40
+ /// A singleton that holds known kinds and information about them. See
41
+ /// \ref mainpage_kind "Kind Overview" for a description of why kind exists,
42
+ /// what the builtin registered kinds are, and how to extend the core kinds.
43
+ ///
44
+ /// \section kind_threadsafety KindRegistry Threadsafty
45
+ ///
46
+ /// KindRegistry serves performance-critical clients that operate under the
47
+ /// stl threading model, and therefore itself follows that model in order
48
+ /// to avoid locking during HasKind() and IsA() queries.
49
+ ///
50
+ /// To make this robust, KindRegistry exposes no means to mutate the registry.
51
+ /// All extensions must be accomplished via plugInfo.json files, which are
52
+ /// consumed once during the registry initialization (See \ref kind_extensions )
53
+ class KindRegistry : public TfWeakBase
54
+ {
55
+ KindRegistry(const KindRegistry&) = delete;
56
+ KindRegistry& operator=(const KindRegistry&) = delete;
57
+ public:
58
+ /// Return the single \c KindRegistry instance.
59
+ KIND_API static KindRegistry& GetInstance();
60
+
61
+ /// Test whether \a kind is known to the registry.
62
+ KIND_API static bool HasKind(const TfToken& kind);
63
+
64
+ /// Return the base kind of the given kind.
65
+ /// If there is no base, the result will be an empty token.
66
+ /// Issues a coding error if \a kind is unknown to the registry.
67
+ KIND_API static TfToken GetBaseKind(const TfToken &kind);
68
+
69
+ /// Test whether \a derivedKind is the same as \a baseKind or
70
+ /// has it as a base kind (either directly or indirectly).
71
+ ///
72
+ /// It is \em not required that \a derivedKind or \a baseKind
73
+ /// be known to the registry: if they are unknown but equal,
74
+ /// IsA will return \c true; otherwise if either is unknown, we
75
+ /// will simply return false.
76
+ ///
77
+ /// Therefore this method will not raise any errors.
78
+ KIND_API static bool IsA(const TfToken& derivedKind, const TfToken &baseKind);
79
+
80
+ /// Return an unordered vector of all kinds known to the registry.
81
+ KIND_API static std::vector<TfToken> GetAllKinds();
82
+
83
+ /// Returns true if \p kind IsA model kind
84
+ KIND_API static bool IsModel(const TfToken& kind);
85
+
86
+ /// Returns true if \p kind IsA group kind
87
+ KIND_API static bool IsGroup(const TfToken& kind);
88
+
89
+ /// Return true if \p kind IsA assembly kind
90
+ KIND_API static bool IsAssembly(const TfToken& kind);
91
+
92
+ /// Returns true if \p kind IsA component kind
93
+ KIND_API static bool IsComponent(const TfToken& kind);
94
+
95
+ /// Returns true if \p kind IsA subcomponent kind
96
+ KIND_API static bool IsSubComponent(const TfToken& kind);
97
+
98
+ private:
99
+ friend class TfSingleton<KindRegistry>;
100
+
101
+ KindRegistry();
102
+ virtual ~KindRegistry();
103
+
104
+ bool _HasKind(const TfToken& kind) const;
105
+
106
+ TfToken _GetBaseKind(const TfToken &kind) const;
107
+
108
+ bool _IsA(const TfToken& derivedKind, const TfToken &baseKind) const;
109
+
110
+ std::vector<TfToken> _GetAllKinds() const;
111
+
112
+ /// Register the given \a kind with the given \a baseKind.
113
+ /// It is valid for \a baseKind to be empty (the default),
114
+ /// in which case \a kind represents a root of the kind hierarchy.
115
+ void _Register(const TfToken& kind,
116
+ const TfToken& baseKind = TfToken());
117
+
118
+ void _RegisterDefaults();
119
+
120
+ struct _KindData {
121
+ TfToken baseKind;
122
+ };
123
+
124
+ typedef std::unordered_map<TfToken, _KindData, TfToken::HashFunctor>
125
+ _KindMap;
126
+
127
+ private:
128
+ _KindMap _kindMap;
129
+ };
130
+
131
+ KIND_API_TEMPLATE_CLASS(TfSingleton<KindRegistry>);
132
+
133
+ } // namespace pxr
134
+
135
+ #endif // PXR_KIND_REGISTRY_H
@@ -0,0 +1,71 @@
1
+ add_library(pyKind SHARED
2
+ module.cpp
3
+ wrapRegistry.cpp
4
+ wrapTokens.cpp
5
+ )
6
+
7
+ set_target_properties(pyKind
8
+ PROPERTIES
9
+ PREFIX ""
10
+ OUTPUT_NAME _kind
11
+ RUNTIME_OUTPUT_DIRECTORY "$<CONFIG>/pxr/Kind"
12
+ LIBRARY_OUTPUT_DIRECTORY "$<CONFIG>/pxr/Kind"
13
+ ARCHIVE_OUTPUT_DIRECTORY "$<CONFIG>/pxr/Kind"
14
+ POSITION_INDEPENDENT_CODE ON
15
+ )
16
+
17
+ target_include_directories(pyKind
18
+ PUBLIC
19
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
20
+ $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
21
+ )
22
+
23
+ target_link_libraries(pyKind
24
+ PUBLIC
25
+ kind
26
+ pxr::boost-python
27
+ )
28
+
29
+ if(SKBUILD AND NOT WIN32)
30
+ set(_rpath_prefix "$ORIGIN")
31
+ if(APPLE)
32
+ set(_rpath_prefix "@loader_path")
33
+ endif()
34
+ set_target_properties(pyKind
35
+ PROPERTIES
36
+ INSTALL_RPATH "${_rpath_prefix}/../.libs"
37
+ INSTALL_RPATH_USE_LINK_PATH TRUE
38
+ )
39
+ endif()
40
+
41
+ if(WIN32)
42
+ set_target_properties(pyKind PROPERTIES SUFFIX ".pyd")
43
+ elseif(APPLE)
44
+ set_target_properties(pyKind PROPERTIES SUFFIX ".so")
45
+ endif()
46
+
47
+ target_compile_definitions(
48
+ pyKind
49
+ PRIVATE
50
+ BOOST_BIND_GLOBAL_PLACEHOLDERS
51
+ BOOST_PYTHON_NO_PY_SIGNATURES
52
+ MFB_PACKAGE_MODULE=Kind
53
+ MFB_PACKAGE_NAME=kind
54
+ MFB_ALT_PACKAGE_NAME=kind
55
+ )
56
+
57
+ file(
58
+ GENERATE
59
+ OUTPUT "$<TARGET_FILE_DIR:pyKind>/__init__.py"
60
+ INPUT "__init__.py"
61
+ )
62
+
63
+ install(
64
+ TARGETS pyKind EXPORT ${PROJECT_NAME}
65
+ LIBRARY DESTINATION ${CMAKE_INSTALL_PYTHON_LIBDIR}/pxr/Kind
66
+ RUNTIME DESTINATION ${CMAKE_INSTALL_PYTHON_LIBDIR}/pxr/Kind
67
+ )
68
+ install(
69
+ FILES __init__.py
70
+ DESTINATION ${CMAKE_INSTALL_PYTHON_LIBDIR}/pxr/Kind
71
+ )
@@ -0,0 +1,12 @@
1
+ # Copyright 2016 Pixar
2
+ #
3
+ # Licensed under the terms set forth in the LICENSE.txt file available at
4
+ # https://openusd.org/license.
5
+ #
6
+ # Modified by Jeremy Retailleau.
7
+
8
+ """Python bindings for libKind"""
9
+
10
+ from pxr import Tf
11
+ Tf.PreparePythonModule()
12
+ del Tf
@@ -0,0 +1,16 @@
1
+ // Copyright 2016 Pixar
2
+ //
3
+ // Licensed under the terms set forth in the LICENSE.txt file available at
4
+ // https://openusd.org/license.
5
+ //
6
+ // Modified by Jeremy Retailleau.
7
+
8
+ #include <pxr/tf/pyModule.h>
9
+
10
+ using namespace pxr;
11
+
12
+ TF_WRAP_MODULE
13
+ {
14
+ TF_WRAP( Registry );
15
+ TF_WRAP( Tokens );
16
+ }
@@ -0,0 +1,40 @@
1
+ // Copyright 2016 Pixar
2
+ //
3
+ // Licensed under the terms set forth in the LICENSE.txt file available at
4
+ // https://openusd.org/license.
5
+ //
6
+ // Modified by Jeremy Retailleau.
7
+
8
+ #include <pxr/kind/registry.h>
9
+ #include <pxr/tf/pyResultConversions.h>
10
+ #include <pxr/tf/pySingleton.h>
11
+
12
+ #include <pxr/boost/python.hpp>
13
+
14
+ using namespace pxr;
15
+
16
+ using namespace pxr::boost::python;
17
+
18
+ void wrapRegistry()
19
+ {
20
+ typedef KindRegistry This;
21
+ typedef TfWeakPtr<KindRegistry> ThisPtr;
22
+
23
+ class_<This, ThisPtr, noncopyable>("Registry", no_init)
24
+ .def(TfPySingleton())
25
+ .def("HasKind", &This::HasKind)
26
+ .staticmethod("HasKind")
27
+ .def("GetAllKinds", &This::GetAllKinds,
28
+ return_value_policy<TfPySequenceToList>())
29
+ .staticmethod("GetAllKinds")
30
+ .def("GetBaseKind", &This::GetBaseKind)
31
+ .staticmethod("GetBaseKind")
32
+ .def("IsA", &This::IsA)
33
+ .def("IsModel", &This::IsModel)
34
+ .def("IsGroup", &This::IsGroup)
35
+ .def("IsAssembly", &This::IsAssembly)
36
+ .def("IsComponent", &This::IsComponent)
37
+ .def("IsSubComponent", &This::IsSubComponent)
38
+ .staticmethod("IsA")
39
+ ;
40
+ }
@@ -0,0 +1,17 @@
1
+ // Copyright 2016 Pixar
2
+ //
3
+ // Licensed under the terms set forth in the LICENSE.txt file available at
4
+ // https://openusd.org/license.
5
+ //
6
+ // Modified by Jeremy Retailleau.
7
+
8
+ #include <pxr/kind/registry.h>
9
+ #include <pxr/tf/pyStaticTokens.h>
10
+
11
+ using namespace pxr;
12
+
13
+ void wrapTokens()
14
+ {
15
+ TF_PY_WRAP_PUBLIC_TOKENS("Tokens", KindTokens,
16
+ KIND_TOKENS);
17
+ }