diff --git a/BUILDING.md b/BUILDING.md index 83fbc72fdf..58d1a9d412 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -379,6 +379,12 @@ ctest -C Release -R testUsdShade -V See the [ctest documentation](https://cmake.org/cmake/help/latest/manual/ctest.1.html) for more options. +##### Test Run Directories + +Each test is run out of an automatically-created temporary directory containing any additional files required by the test. Set the cmake +option `PXR_TEST_RUN_TEMP_DIR_PREFIX` to prepend a prefix string to the name of these directories. For example, setting this option to +"foo-" will create test run directories named "foo-" + ##### Diagnosing Failed Tests In order to aid with diagnosing of failing tests, test generated files for failing test are explicitly put in the following directories, where diff --git a/CHANGELOG.md b/CHANGELOG.md index 9d37dcf43d..68e0ca21cf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,629 @@ # Change Log +## [24.08] - 2024-07-25 + +OpenUSD is now licensed under the Tomorrow Open Source Technology license. This +is a renaming of the license, but the terms and conditions are the same as +before. See [this forum post](https://forum.aousd.org/t/upcoming-openusd-license-update/1561) +for details. + +### Build + +- boost is now an optional dependency that is only required for building Python + bindings. + (PR: [#3028](https://github.com/PixarAnimationStudios/OpenUSD/pull/3028)) + +- Added support for optionally building with oneTBB. + (PR: [#2457](https://github.com/PixarAnimationStudios/OpenUSD/pull/2457), + [#2458](https://github.com/PixarAnimationStudios/OpenUSD/pull/2458), + [#2459](https://github.com/PixarAnimationStudios/OpenUSD/pull/2459), + [#2462](https://github.com/PixarAnimationStudios/OpenUSD/pull/2462), + [#2463](https://github.com/PixarAnimationStudios/OpenUSD/pull/2463), + [#2464](https://github.com/PixarAnimationStudios/OpenUSD/pull/2464), + [#2465](https://github.com/PixarAnimationStudios/OpenUSD/pull/2465), + [#2466](https://github.com/PixarAnimationStudios/OpenUSD/pull/2466)) + +- Various fixes and changes to build_usd.py: + - Added "--onetbb" option to use oneTBB instead of TBB. + - Added support for cross-compiling for iOS and visionOS. + (PR: [#2949](https://github.com/PixarAnimationStudios/OpenUSD/pull/2949), + [#2950](https://github.com/PixarAnimationStudios/OpenUSD/pull/2950), + [#3052](https://github.com/PixarAnimationStudios/OpenUSD/pull/3052)) + - Disabled argument abbreviations. For example, "--debug" will no longer match + "--debug-python". + - Updated to build with MaterialX v1.38.10. + +- Added support for Python 3.12 and deprecated support for 3.6 for usd-core + PyPI package. + +- Added the build type to the absolute path used to store the PCH result, + preventing Debug/Release PCH files from over-writing each other causing linker + issues. + (PR: [#2698](https://github.com/PixarAnimationStudios/OpenUSD/pull/2698)) + +- Fixed absolute paths to GL libraries and libm.so in pxrConfig.cmake. + (PR: [#2827](https://github.com/PixarAnimationStudios/OpenUSD/pull/2827), + [#2796](https://github.com/PixarAnimationStudios/OpenUSD/pull/2796)) + +- Added support for MSVC's standards-conformant preprocessor. + (PR: [#2990](https://github.com/PixarAnimationStudios/OpenUSD/pull/2990)) + +- Added the ability to set a string prefix for test run temp directory names. + +### USD + +- Continued progress on namespace editing: + - Completed the work of adding relocates composition. + - UsdNamespaceEditor can now handle moving and deleting prims with opinions + across composition arcs by authoring relocates. + +- Various updates for UsdCollectionAPI and path expressions: + - Allow leading & trailing whitespace in the SdfPathExpression constructor. + - Added PathExpression complement-of-complement cancellation. + - Allow path patterns that start with '//' to pass unchanged through both + PcpMapFunction and UsdStage's prototype-to-instance path mapping. + - Added missing Python bindings for + UsdCollectionMembershipQuery::UsesPathExpansionRuleMap and + UsdCollectionAPI::ResolveCompleteMembershipExpression(). + - Added UsdComputePathExpressionFromCollectionMembershipQueryRuleMap() + which computes an SdfPathExpression that matches the same paths as the + given UsdCollectionMembershipQuery::PathExpansionRuleMap. + - Allow PathExpression atoms to be constructed from SdfPaths directly. + +- Completed the first phase of the +[UsdValidation framework](https://github.com/PixarAnimationStudios/OpenUSD-proposals/tree/5a3c03b339db80052e45d2bda768ac0327653cb6/proposals/usd-validation-framework). +Users can now register UsdValidator validation functions with the +UsdValidationRegistry. Validation functions can be invoked by +UsdValidator::Validate() and will return any UsdValidationErrors. The following +validators were also added: + - CompositionErrorTest validator, which reports composition errors on a stage. + - UsdShade ShaderPropertyTypeConformance validator, which reports various + errors associated with UsdShadeShader and SdrShader compliance. + +- Added TraceReporter::LoadReport(), which can be used to read reports generated + by TraceReporters. + +- Added TfMallocTag::CallTree::LoadReport(), which can be used to read malloc + tag reports generated by calling TfMallocTag::CallTree::Report(). + +- Changed TfNormPath's and TfRealPath's behavior to match Python os.normpath and + os.realpath. In particular, the casing of drive letters on Windows will be + retained instead of forced to lower-case. + (Issue: [#3020](https://github.com/PixarAnimationStudios/OpenUSD/issues/3020)) + +- Deprecated functions on GfMatrix{2,3,4}d and GfRotation that take and return + GfVec3f values as they can potentially result in loss of precision. These + functions will be removed in a subsequent release. + +- Added GfColor and GfColorSpace to represent colors and provide color + space transformations. This includes a set of built-in color spaces that + are always known to USD. Note that as before, USD represents colors + in scene description as float3, and properties and attributes may have + an associated color space token. + +- URI schemes used by Ar URI resolvers must now conform to the character set + requirements in RFC2396. Support for the environment variable + PXR_AR_DISABLE_STRICT_SCHEME_VALIDATION has been removed. Support for + non-compliant schemes was deprecated in 23.11. + (PR: [#2997](https://github.com/PixarAnimationStudios/OpenUSD/pull/2997)) + +- Added support for sub-root default prims. + (Issue: [#2951](https://github.com/PixarAnimationStudios/OpenUSD/issues/2951)) + +- Added a named sentinel value that is returned from SdfListProxy::Find when the + value is not present in the list of operations. + +- Fixed an issue in PcpMapFunction where some functions wouldn't compose + correctly. + +- Compose dynamic file format arguments through all non-dynamic arcs, which + allows variant selections to impact dynamic payload arguments. + +- Added SdrShaderNode::CheckCompliance static method which checks if the same + named properties of a given SdrShaderNode have matching types and default + values. + +- usdGenSchema now correctly generates code when namespaces are used in a + propertyNamespacePrefix. + (PR: [#3090](https://github.com/PixarAnimationStudios/OpenUSD/pull/3090)) + +- We are deprecating the inclusion of API documentation in the "documentation" + field of the schema prim and property definitions. This will be fully removed + in 24.11. + +- Fixed issue with concurrent schema registry initialization and the Python GIL. + (Issue: [#3087](https://github.com/PixarAnimationStudios/OpenUSD/issues/3087)) + +- Added UsdStage::GetAllCompositionErrors() for retrieving composition errors + for all prims and layer stacks on the stage. + +- Added UsdGeomBasisCurves::ComputeSegmentCounts(). + +- Fixed the code for calculating mesh points on Capsule_1 prims with different + bottom and top radii. + (PR: [#3129](https://github.com/PixarAnimationStudios/OpenUSD/pull/3129)) + +- UsdRenderPass schema refinements: + - Removed lightsRenderVisibility and geomRenderVisibility to consolidate with + the existing renderVisibility collection. + - Specify that renderVisibility and cameraVisibility only apply to + "renderable" prims, defined as geometry and lights but not render settings + related types such as display or sample filters (which do otherwise obey the + Hydra visibility schema). If a render pass intends to remove such types, a + prune collection should be used instead. + - renderVisibility and cameraVisibility can only make scene objects invisible; + they cannot make invisible objects visible again. The intuitive basis for + this is that render pass visibility is used to partition the upstream scene, + not to pull hidden things back into view. + +- Added 'deepRaster' to the allowed tokens list for the UsdRenderProduct's + productType attribute. + +- Added an option to UsdUtilsModifyAssetPaths which will preserve the length of + asset array attributes/metadata when empty paths are present or the modify + function returns an empty string. + (Issue: [#3060](https://github.com/PixarAnimationStudios/OpenUSD/issues/3060), + PR: [#3063](https://github.com/PixarAnimationStudios/OpenUSD/pull/3063)) + +### Hydra + +- **Important**: HgiGL now defaults to using nearest sampling and not enabling + anisotropic filtering for depth and stencil textures. + +- **Important**: Fixed a bug in the HdMergingSceneIndex that was not properly + re-adding prims when removed in another input scene. + +- Added native support for .avif image files via the new hioAvif plugin. This + plugin only supports reading these image files. + +- Optimized removal of rprims from HdRenderIndex. These changes improved many + of the examples in the performance test by more than 100x. + +- HdxSelectionSceneIndexObserver::SetSceneIndex() now populates its initial + selection in parallel, improving performance for consumers such as + HdxColorizeSelectionTask::Prepare(). + +- Certain Hdx task types now internally retain the GLSLFX form of their shaders + to avoid re-parsing them each time a task is constructed. This improves + render startup time. + +- Made change to ensure that HdsiPinnedCurveExpandingSceneIndex does not pull on + the basisCurves schema when asked for unrelated scene index keys. This was + causing a performance hit in the presence of generative procedurals producing + curve data. + +- The Hydra Scene Browser can now display SdfPathVector values. + +- Added Hydra schema for render passes. Added activeRenderPassPrim to + HdSceneGlobals schema. Added render pass support to UsdImaging (when in scene + index mode). + +- HdxFullscreenShader now supports specifying samplers for any textures bound + to it. + +- HdGetSamplerParameters has a new overload that operates on a std::map. + +- Added current frame to the scene globals scene index and render settings + schemas, and updated Prman to use this ri:Frame attribute. + +- Fixed the transformation of camera lights when using a scene camera for + renderers other than Storm. + +- Updated TetMesh to use surfaceFaceVertexIndices instead of the + tetVertexIndices. + +- Removed down cast of world space hit point in HdxPickHit. + +- Added HdUtils::ConvertHdMaterialNetworkToHdMaterialSchema() and + ConvertHdMaterialNetworkToHdMaterialNetworkSchema(). + +- Added HdEncapsulatingSceneIndex. The mix-in class allows inspection tools to + traverse the directed acyclic graph of scene indices at different levels of + detail. Note that hdui is not (yet) aware of encapsulating scenes and thus + their use is protected by an env var. The use of encapsulating scene indices + will eventually make env vars such as + USDIMAGING_SHOW_POINT_PROTOTYPE_SCENE_INDICES unnecessary. + +- In HdSceneDelegate added overloads of SampleFOO methods explicitly taking the + sampling interval as startTime and endTime. HdSceneIndexAdapterSceneDelegate + is passing these arguments to + HdSampledDataSource::GetContributingSampleTimesForInterval. This will allow us + to get rid of HdPrman_MotionBlurSceneIndexPlugin::SetShutterInterval and the + associated global variables in the future. + +- Moved HdTextureType out of Hydra core into Storm. + +- Added support to provide finer grained invalidation for light filter prims in + emulation. + +- Added HdsiLightLinkingSceneIndex to implement light linking semantics in a + scene index. + +- Fixed a bug in the evaluation of path expressions for collections with pruning + semantics. + +- Fixed backend emulation handling of PrimsAdded messages for already-populated + prims, to properly resync them. + +- Fixed a theoretical bug in HdDirtyList that would leave stale render tag prim + state if Sync() was called without any render tags activated. + +- Fixed a linking error some builds would hit related to + HdRenderIndex::InsertTask. + (PR: [#3000](https://github.com/PixarAnimationStudios/OpenUSD/pull/3000)) + +- Added missing include to several files. + (PR: [#3021](https://github.com/PixarAnimationStudios/OpenUSD/pull/3021)) + +- Fixed a comment on the struct definition of HdDisplayStyle. + (Issue: [#3033](https://github.com/PixarAnimationStudios/OpenUSD/issues/3033)) + +- Made HdRendererPluginRegistry more consistent about setting display name + correctly, and added an HD_RENDERER_PLUGINS debug flag. + +- Added API tags to the pxr/imaging/hdui library. + (PR: [#2689](https://github.com/PixarAnimationStudios/OpenUSD/pull/2689)) + +- Added a debug flag to provide detail when Hgi::IsBackendSupported() returns + false. + +- Optimized HdSceneIndexAdapterSceneDelegate's usage of SdfPathTable to be more + correct and cache-friendly. + +- Added deep picking support to HdxPickTask, via the "resolveDeep" resolve mode + which is similar to "resolveUnique" but also includes results that are + occluded in a typical id-render. + (PR: [#3044](https://github.com/PixarAnimationStudios/OpenUSD/pull/3044)). + +- Updated stb_image to 2.29, and stb_image_resize to 2.07. + (PR: [#2880](https://github.com/PixarAnimationStudios/OpenUSD/pull/2880)) + +- Added defensive coding in HioOIIOImage and switched int for size_t where + appropriate + (PR: [#3119](https://github.com/PixarAnimationStudios/OpenUSD/pull/3119)) + +- When calling HdSceneDelegate::SamplePrimvar() for a time-varying primvar when + the time sampling interval's start or end time falls between authored sample + times, the bracketing authored sample times are now included in the output. + Previously, only authored sample times within the interval were included, + along with interpolated values at the interval start and end, as needed. + For example, if the primvar has authored values at T = [1, 2, 3], and the + sampling interval is [1.5, 2.5], the new behavior provides the authored values + at T = [1, 2, 3], whereas the old behavior would provide values at + T = [1.5, 2, 2.5], with the values at 1.5 and 2.5 being linear interpolations + between the adjacent authored values. + +- The behavior of HdSampledDataSource::GetContributingSampleTimesForInterval() + for data sources coming out of UsdImaging has been corrected consistent with + the change to HdSceneDelegate::SamplePrimvar() described above. + +- HdsiVelocityMotionResolvingSceneIndex, a reference implementation of USD + velocity-based motion, has been added to the Hydra scene index library. It has + been added to the Storm renderer, but is not a part of the UsdImaging default + scene index stack. + +- HdGeomSubsetsSchema (plural 'Subsets') has been removed. In Hydra 2, geom + subsets are no longer properties of the parent geometry. They now traverse the + Hydra 2 scene indices as child prims of the parent geometry, so this schema is + no longer required. This change should be transparent to consumers of the + legacy HdSceneDelegate interface, but authors of Hydra 2 scene indices that + need to be subset-aware will need to revise their implementations. + +- HdGeomSubsetSchema (singular 'Subset') now has a non-empty default locator, + consistent with subsets' promotion from properties to prims. Data sources for + geom subset fields will now be found under the "geomSubset" property of the + geom subset prim, rather than at the top level of the prim. + This change should be transparent to consumers of the legacy HdSceneDelegate + interface. + +### UsdImaging + +- Fixed an issue when scene lights are enabled and disabled. + +- Made fix to assign ReplacePrefix() return value to newLocators when changing + directMaterialBindings locators to materialBindings locators. + +- Made sure the results of UsdImagingStageSceneIndex's GetPrim and + GetChildPrim are consistent by using the same prim predicate. + +- UsdImagingDataSourceCustomPrimvars no longer stores attribute queries in a map + but creates it every time a particular primvar is queried. This fixes a bug + where a client would not see a primvar that has an authored value now but had + no authored value when the primvars container was retrieved by the client. + More generally, it also fixes bugs where the resolution info in the previous + attribute query is no longer valid. + +- Replaced UsdImagingDataSourceSchemaBased with the more flexible + UsdImagingDataSourceMapped. + +- Transport USD collections as data sources when using the stage scene index. + +- Fixed performance issue where UsdImagingFieldAdapter would unnecessarily + compute the total number of time samples for attributes, which could cause + all value clip layers to be loaded. + +- Fixed sizing of result array when calling GetScenePrimPaths with some invalid + instance indices. + (PR: [#2960](https://github.com/PixarAnimationStudios/OpenUSD/pull/2960)) + +- Added imaging transport for uniform and constant primvars on + UsdGeomPointInstancer, and fixed transport of "velocities", "accelerations", + and "angularVelocities" on point instancers. + (PR: [#1731](https://github.com/PixarAnimationStudios/OpenUSD/pull/1731), + [#1734](https://github.com/PixarAnimationStudios/OpenUSD/pull/1734)) + +- Added null-prim checks when computing Hydra materials. + (PR: [#2930](https://github.com/PixarAnimationStudios/OpenUSD/pull/2930)) + +- Fixed incorrect API tags in UsdSkelImaging and UsdVolImaging. + (PR: [#2691](https://github.com/PixarAnimationStudios/OpenUSD/pull/2691)) + +- Added StageSceneIndex support for UsdLuxCylinderLight, and fixed support for + UsdGeomSubset. + +- Fixed UsdImagingGLEngine::TestIntersection instancing-related out-params when + using StageSceneIndex. + +- Ratcheted usdImagingGL test thresholds. + (PR: [#2970](https://github.com/PixarAnimationStudios/OpenUSD/pull/2970)) + +- Fixed a bug where UsdImagingDelegate would sometimes end up with duplicate + primvar entries. + (PR: [#2096](https://github.com/PixarAnimationStudios/OpenUSD/pull/2096)) + +- Added StageSceneIndex invalidation support for UsdVolField prims. + +- Fixed UsdImagingGLEngine::DecodeIntersection when using StageSceneIndex + +- Added a new version of UsdImagingGL::TestIntersection that takes resolve mode, + and returns a result vector instead of a single result. + (PR: [#3044](https://github.com/PixarAnimationStudios/OpenUSD/pull/3044)) + +- UsdImagingPrimAdapter::SamplePrimvar() now includes bracketing authored sample + times in certain scenarios, similar to the updated behavior of + HdSceneDelegate::SamplePrimvar() described above. + +- Point instancer prototype prims are now relocated as children of the point + instancer, rather than properties of it. Previously, each drawable leaf prim + within the prototype of a point instancer was relocated as a direct child of + the point instancer, but with a property path of the form + `.proto0__id0`. This property form of path precluded the relocated + prototype prim from having child prims of its own. The promotion of geom + subsets from properties to prims therefore required also promoting the + relocated prototype prims from property paths to prim paths. + +### Storm + +- Updated the default compute shader local size to (64, 1, 1) for compute + shaders executed for GPU ext computations and the frustum culling compute + pipeline. + +- Improved shader interstage slot calculation for Hgi resource generation, + reducing the total number of interstage locations needed, and accounting for + resources that take up more than one slot. Fixed adaptive subdivision shader + compilation when using HgiVulkan. + +- Added function Hgi::CreateNamedHgi, which can be used to create a specific Hgi + instance given a valid Hgi token. + (PR: [#2850](https://github.com/PixarAnimationStudios/OpenUSD/pull/2850)) + +- Use HgiHandle unique id in hashes rather than the pointer address, as the + latter can be reused between different objects. + +- Added tests testHgiGL and testHgiVulkan. + +- Various HgiVulkan fixes and improvements: + - Improved handling of Vulkan viewport. Rather than flipping the Vulkan + viewport in the Y-direction, instead allow the geometry to render upside + down by using the same projection matrix and viewport used for OpenGL, but + flipping the winding order. This change greatly simplifies and circumvents + coordinate system differences between Vulkan and other graphics backends in + Storm. + - Added MaterialX support for Vulkan, using MaterialX::VkShaderGenerator. + - Added implementations for HgiVulkanBlitCmds::CopyTextureToBuffer and + CopyBufferToTexture. + - Fixed a bug in HgiVulkanBlitCmds::CopyBufferGpuToCpu. + - Fixed bugs around HgiVulkan access masks for layout transition barriers. + - Added correct read usage flags for depth and stencil buffers in Vulkan. + - Fixed color correction shader and volume shader compilation bugs for Vulkan. + +- Fixed the behavior of HgiSubmitWaitTypeWaitUntilCompleted when submitting + command buffers on Metal. + (PR: [#2794](https://github.com/PixarAnimationStudios/OpenUSD/pull/2794)) + +- Fixed shading with Metal when geometry is flipped (e.g. scale -1,1,1). + (Issue: [#2536](https://github.com/PixarAnimationStudios/OpenUSD/issues/2536)) + +- Fixed MaterialX shader gen for EDF type declarations. + (Issue: [#3049](https://github.com/PixarAnimationStudios/OpenUSD/issues/3049), + [#3105](https://github.com/PixarAnimationStudios/OpenUSD/issues/3105), + PR: [#3106](https://github.com/PixarAnimationStudios/OpenUSD/pull/3106)) + +- Fixed Ptex GLSL layout sampler declaration and binding. + +- Fixed adaptive tessellation of subdivision surfaces to avoid + under-tessellation artifacts. + (Issue: [#2981](https://github.com/PixarAnimationStudios/OpenUSD/issues/2981)) + +- Fixed subdivision surface refinement of faceVarying primvar to avoid crashes + when the faceVarying primvar topology is invalid. + +- Fixed an issue pulling fallback values from Sdr that was affecting material + wrap modes, among others. + (PR: [#2519](https://github.com/PixarAnimationStudios/OpenUSD/pull/2519)) + +- Fixed incorrect GPU skinning of meshes with blendshapes but no skeleton. + (Issue: [#2425](https://github.com/PixarAnimationStudios/OpenUSD/issues/2425), + PR: [#2696](https://github.com/PixarAnimationStudios/OpenUSD/pull/2696)) + +- Added NAN guards to dome light convolution shader. + (PR: [#2383](https://github.com/PixarAnimationStudios/OpenUSD/pull/2383)) + +- Fixed a bug where some BasisCurves pipelines were applying color overrides + twice. + (PR: [#3124](https://github.com/PixarAnimationStudios/OpenUSD/pull/3124)) + +- Storm now supports velocity-based motion of points-based geometry and point + instances consistent with the USD velocity motion specification. + Velocity-based motion will now be correctly applied to geometry points and to + point instance positions and rotations at subframe sample times. Note that + velocity-based motion is intended primarily for subframe sampling and should + not be used as a physics engine or as a substitute for definitive, authored, + per-frame position data. + (Issue: [#2571](https://github.com/PixarAnimationStudios/OpenUSD/issues/2571)) + +### RenderMan Hydra Plugin + +- hdPrman for RenderMan 25 is deprecated. Support for hdPrman for RenderMan 25 + will be removed in the 24.11 release. + +- Updated usdRiPxr to include schemas for Renderman 26.1. Also updated usdRiPxr + CMakeLists to gather bundled schemas from yet to be released Renderman 26.2 + and above. + +- Added code to take advantage of new display APIs for RenderMan 26 and also + add #ifdefs so that building against RenderMan 25 still works. + +- Fixed an issue where gprim Sync() would cause extra rounds of edit requests + to the Riley API, stopping & restarting the render even when there were no + actual edits required. + +- RenderMan requires Ri:Frame to be an integer so force it to int(floor(time)). + This ensures that it produces an independent sampling sequence per integer + frame. + +- HdPrman now supports field-less RiVolume primitives. These are used for + homogeneous fog volumes which do not require voxel data. Field-less volumes + need the standard RenderMan parameters, Ri:type and Ri:Bounds. + +- HdPrman now applies the render pass specified byHdSceneGlobalsSchema using an + internal RenderPassSceneIndex. + +- Fixed a bug where a crash could occur when AOV names are received as a string + rather than a TfToken. + +- Added support for usdRiPxr's PxrCameraAPI schema. This required a + corresponding adapter in usdRiPxrImaging as well as removing the default + values for shutterOpen/shutterClose/shutterOpening in hdPrman. The old default + values were hard-coded and different between the interactive and + non-interactive modes. + +- Removed code to dirty all rprims in + HdPrmanRenderDelegate::SetRenderSetting("renderCameraPath", value). This is a + performance improvement when switching cameras. However, it also means that + clients of hdPrman need to invalidate all animated primvars if the shutter + interval between the old and new camera is different. Note that even before + the change, clients need to invalidate all animated primvars if the shutter + interval changes for reasons other than the camera path changing. This + behavior of hdPrman might be revisited in the future. + +- Register scene index plugin to perform light linking when the light linking + collections are transported. For legacy clients (e.g. UsdImagingDelegate) that + don't transport collections, light linking is performed at the scene delegate + end and this scene index should not affect that behavior. + +- Improved determination of the display driver to factor the product type. + +- Renamed rtx_glfImage to rtx_hioImage. + +- Added RMAN_DISPLAYPATH environment variable to populate 3rd-party RenderMan + display driver search paths. + +- Added HDPRMAN_TESSELLATE_IMPLICIT_SURFACES environment variable to make + hdPrman tessellated implicit surfaces into meshes rather than use builtin + representations. + +- PxrPathTracer support for purpose-based visibility has been temporarily + removed, as it could cause unexpected problems for lights. An improved + approach to this feature is now available via PbsPathTracer and will be + applied to PxrPathTracer in a future release of RenderMan. + +### MaterialX + +- Added support for MaterialX v1.38.10. + +- Added the ability to control Dome Light intensity with MaterialX materials. + +- Fixed MaterialX shader generation for simple surface shaders like + ND_convert_color3_surfaceshader. + (PR: [#3045](https://github.com/PixarAnimationStudios/OpenUSD/pull/3045)) + +- Added traces to hdMtlx. + (PR: [#2665](https://github.com/PixarAnimationStudios/OpenUSD/pull/2665)) + +- Fixed MaterialX shader objects getting garbage collected too early. + (PR: [#3051](https://github.com/PixarAnimationStudios/OpenUSD/pull/3051)) + +- Fixed MaterialX material tag detection for glTF PBR. + (Issue: [#1882](https://github.com/PixarAnimationStudios/OpenUSD/issues/1882), + PR: [#3069](https://github.com/PixarAnimationStudios/OpenUSD/pull/3069)) + +- Optimized MaterialX shader generation and reuse; improved material tag + detection; added support for triplanar texture nodes. + (Issue: [#2330](https://github.com/PixarAnimationStudios/OpenUSD/issues/2330), + [#3004](https://github.com/PixarAnimationStudios/OpenUSD/issues/3004), + PR: [#3073](https://github.com/PixarAnimationStudios/OpenUSD/pull/3073)) + +### usdrecord + +- Updated to support specifying an active render pass, which is set in + HdsiSceneGlobalSceneIndex for use within Hydra. + +- Updated to use the startTimeCode from the USD stage as the default + time code. + +- Changed default dome light camera visibility to false, and added an + "--enableDomeLightVisibility" flag. + (PR: [#2352](https://github.com/PixarAnimationStudios/OpenUSD/pull/2352)) + +### usdview + +- Added the 'bboxStandin' command line argument to allow for unloaded prims to + be displayed by their bounding boxes. + (Issue: [#2720](https://github.com/PixarAnimationStudios/OpenUSD/issues/2720)) + +- Added workaround for issue in PySide that can cause the viewport to + render incorrectly. + (Issue: [#2996](https://github.com/PixarAnimationStudios/OpenUSD/issues/2996), + [#3009](https://github.com/PixarAnimationStudios/OpenUSD/issues/3009)) + +- Added a keyboard shortcut (Ctrl + Shift + R) to reload stage. + +- Refactored Usdviewq.Launcher to make it easier to extend, e.g. by testusdview. + +- Fixed a bug in layer stack view when the root layer stack contained both muted + and unloaded sublayers. + +- Fixed an issue where the OCIO menus would occasionally select an invalid + colorspace, for certain OCIO configurations. + (PR: [#3017](https://github.com/PixarAnimationStudios/OpenUSD/pull/3017)) + +### Documentation + +- Added infrastructure and [usdVol example content](https://openusd.org/release/user_guides/schemas/usdVol/usdVol_toc.html) + for a new schema user documentation process. User documentation can be added + to schema definition files, using Markdown format. User documentation will be + processed by usdGenSchema and added to the schema registry. User documentation + can also be generated into HTML output using a script that generates + Sphinx-compatible content files. See "Generating Schema User Docs" in + docs/README.md for more details. + +- Added new [testing guidelines](https://openusd.org/release/api/_page__testing__guidelines.html) + and [code guidelines](https://openusd.org/release/api/_page__coding__guidelines.html) + to documentation. + +- Added new [Collections and Patterns](https://openusd.org/release/user_guides/collections_and_patterns.html) + user guide to documentation. + +- Made clarifications to Hydra 2.0 Getting Started Guide. + +- Revised UsdCollectionAPI documentation to explain what makes an instance be + in relationship-mode vs expression-mode, and how the built-in properties + affect membership determination in each mode. + +
+ Previous Releases + ## [24.05] - 2024-04-19 ### Build @@ -360,9 +984,6 @@ (PR: [#2974](https://github.com/PixarAnimationStudios/OpenUSD/pull/2974)) - Added some additional documentation for using Vulkan. -
- Previous Releases - ## [24.03] - 2024-02-23 ### Build diff --git a/LICENSE.txt b/LICENSE.txt index 2341d8e8bc..a2cdda092e 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,6 +1,12 @@ +============================================================ +OpenUSD +============================================================ - Modified Apache 2.0 License +Note: The Tomorrow Open Source Technology License 1.0 differs from the +original Apache License 2.0 in the following manner. Section 6 ("Trademarks") +is different. +TOMORROW OPEN SOURCE TECHNOLOGY LICENSE 1.0 TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION @@ -679,7 +685,7 @@ The Art of C++ : PEGTL (Parsing Expression Grammar Template Library) The MIT License (MIT) -Copyright (c) 2007-2020 Dr. Colin Hirsch and Daniel Frey +Copyright (c) 2007-2022 Dr. Colin Hirsch and Daniel Frey Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -699,31 +705,6 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -================================================================ -invoke.hpp -================================================================ - -MIT License - -Copyright (C) 2018-2023, by Matvey Cherevko (blackmatov@gmail.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - ================================================================ Doxygen Awesome ================================================================ @@ -748,4 +729,124 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file +SOFTWARE. + +================================================================ +LibAvif v1.0.4 +================================================================ + +Copyright 2019 Joe Drago. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +================================================================ +AVIF/src/obu.c, renamed in this repository as AVIF/src/avif_obu.c +================================================================ + +Copyright © 2018-2019, VideoLAN and dav1d authors +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +================================================================ +AVIF/third_party/libyuv/* +================================================================ + +Copyright 2011 The LibYuv Project Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + * Neither the name of Google nor the names of its contributors may + be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +================================================================ +libaom +================================================================ + +Copyright (c) 2016, Alliance for Open Media. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. diff --git a/README.md b/README.md index 77a2b28646..19ad9ce782 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,9 @@ Supported Platforms USD is primarily developed on Linux platforms (CentOS 7), but is built, tested and supported on macOS and Windows. +It is also possible to build USD libraries that can be embedded +in iOS and visionOS apps. + Please see [VERSIONS.md](VERSIONS.md) for explicitly tested versions. Dependencies @@ -46,12 +49,8 @@ Dependencies Required: - C/C++ compiler - [CMake](https://cmake.org/documentation/) - - [Boost](https://boost.org) - [Intel TBB](https://www.threadingbuildingblocks.org/) -Optional: - - [Python](https://python.org) - See [3rd Party Library and Application Versions](VERSIONS.md) for version information. Additional dependencies are required for the following components. These @@ -70,10 +69,16 @@ Optional: - [OSL (OpenShadingLanguage)](https://github.com/imageworks/OpenShadingLanguage) - [Ptex](http://ptex.us/) -**usdview** +**Python Bindings** Required: + - [Python](https://python.org) + - [Boost](https://boost.org) + +**usdview** +Required: + - Python bindings - [PySide6](http://wiki.qt.io/PySide6) or [PySide2](http://wiki.qt.io/PySide2) - [PyOpenGL](https://pypi.python.org/pypi/PyOpenGL/) @@ -129,7 +134,7 @@ then build and install USD into `/path/to/my_usd_install_dir`. > python OpenUSD/build_scripts/build_usd.py /path/to/my_usd_install_dir ``` -##### MacOS: +##### macOS: In a terminal, run `xcode-select` to ensure command line developer tools are installed. Then run the script. @@ -141,6 +146,33 @@ then build and install USD into `/path/to/my_usd_install_dir`. > python OpenUSD/build_scripts/build_usd.py /path/to/my_usd_install_dir ``` +##### iOS and visionOS: + +When building from a macOS system, you can cross compile +for iOS based platforms. + +Cross compilation builds are restricted to building libraries that can be +embedded in applications built for the target platform. It can be helpful +to use a monolithic build when embedding USD +(see [Advanced Build Configuration](BUILDING.md)). + +These builds do not support Python bindings or command line tools. + +Currently, these builds also do not support Imaging or USD Imaging. + +For example, the following will download, build, and install USD's dependencies, +then build and install USD for iOS into `/path/to/my_usd_install_dir`. + +``` +> python OpenUSD/build_scripts/build_usd.py --build-target iOS --build-monolithic /path/to/my_usd_install_dir +``` + +Or for visionOS: + +``` +> python OpenUSD/build_scripts/build_usd.py --build-target visionOS --build-monolithic /path/to/my_usd_install_dir +``` + ##### Windows: Launch the "x64 Native Tools Command Prompt" for your version of Visual Studio diff --git a/VERSIONS.md b/VERSIONS.md index 72bc5a8e85..c3caf2ed56 100644 --- a/VERSIONS.md +++ b/VERSIONS.md @@ -13,8 +13,8 @@ Our test machines have the following software versions installed. | Software | Linux | macOS | Windows | | ------------- | -------------------- | ---------------------------- | ------------------------------ | -| OS | CentOS Linux 7 | 12.6.3 | Windows 10 | -| C++ Compiler | gcc 9.3.1 | Apple clang 13.1.6 (Xcode 13.3) | Visual Studio 2017 15.9 | +| OS | CentOS Linux 7 | 12.6.3, 14.5 for visionOS | Windows 10 | +| C++ Compiler | gcc 9.3.1 | Apple clang 13.1.6 (Xcode 13.3)
Apple clang 15.0.0 (Xcode 15.4) for visionOS | Visual Studio 2017 15.9 | | CMake | 3.17.5 | 3.19.5 | 3.25.3 | | Python | 3.9.16 | 3.9.13 | 3.9.13 | | Boost | 1.76.0 | 1.78.0 | 1.76.0 | @@ -30,7 +30,7 @@ Our test machines have the following software versions installed. | RenderMan | 25.3 | 25.3 | 25.3 | | Alembic | 1.8.5 | 1.8.5 | 1.8.5 | | OpenEXR | 3.1.11 | 3.1.11 | 3.1.11 | -| MaterialX | 1.38.8 | 1.38.8 | 1.38.8 | +| MaterialX | 1.38.10 | 1.38.10 | 1.38.10 | | Jinja2 | 2.0 | | | | Flex | 2.5.39 | | | | Bison | 2.4.1 | | | diff --git a/azure-pypi-pipeline.yml b/azure-pypi-pipeline.yml index f7f4d5dfa9..23a20bfad7 100644 --- a/azure-pypi-pipeline.yml +++ b/azure-pypi-pipeline.yml @@ -63,6 +63,9 @@ stages: Python311: PYTHON_INTERPRETER: /opt/python/cp311-cp311/bin/python PYTHON_TAG: cp311 + Python312: + PYTHON_INTERPRETER: /opt/python/cp312-cp312/bin/python + PYTHON_TAG: cp312 timeoutInMinutes: 90 pool: vmImage: Ubuntu-20.04 @@ -134,6 +137,9 @@ stages: Python311: PYTHON_VERSION_SPEC: 3.11 PYTHON_TAG: cp311 + Python312: + PYTHON_VERSION_SPEC: 3.12 + PYTHON_TAG: cp312 timeoutInMinutes: 90 pool: vmImage: 'windows-2019' @@ -158,7 +164,7 @@ stages: dir D:\packaging\inst displayName: "Creating packaging directory" - script: | - python -m pip install wheel + python -m pip install wheel setuptools displayName: 'Installing python packages' - script: | cd D:\packaging @@ -197,9 +203,13 @@ stages: PYTHON_VERSION_SPEC: 3.11 PYTHON_INTERPRETER: python3.11 PYTHON_TAG: cp311 + Python312: + PYTHON_VERSION_SPEC: 3.12 + PYTHON_INTERPRETER: python3.12 + PYTHON_TAG: cp312 timeoutInMinutes: 180 pool: - vmImage: 'macOS-11' + vmImage: 'macOS-12' steps: - task: UsePythonVersion@0 inputs: @@ -210,7 +220,7 @@ stages: $(PYTHON_INTERPRETER) build_scripts/build_usd.py --build-args USD,"-DPXR_PY_UNDEFINED_DYNAMIC_LOOKUP=ON -DPXR_BUILD_USD_TOOLS=OFF -DPXR_INSTALL_LOCATION=../pluginfo" --no-materialx --no-imaging --no-examples --no-tutorials --generator Xcode --build-target universal --build $HOME/USDgen/build --src $HOME/USDgen/src $HOME/USDinst -v displayName: 'Building USD' - bash: | - $(PYTHON_INTERPRETER) -m pip install delocate~=0.10.2 wheel + $(PYTHON_INTERPRETER) -m pip install delocate~=0.10.2 wheel setuptools displayName: 'Installing python packages' - bash: | mkdir ./packaging @@ -298,6 +308,10 @@ stages: PYTHON_VERSION_SPEC: 3.11 IMAGE: 'Ubuntu-20.04' PYTHON_INTERPRETER: python3 + Linux_Python312: + PYTHON_VERSION_SPEC: 3.12 + IMAGE: 'Ubuntu-20.04' + PYTHON_INTERPRETER: python3 Windows_Python36: PYTHON_VERSION_SPEC: 3.6 IMAGE: 'windows-2019' @@ -322,29 +336,37 @@ stages: PYTHON_VERSION_SPEC: 3.11 IMAGE: 'windows-2019' PYTHON_INTERPRETER: python + Windows_Python312: + PYTHON_VERSION_SPEC: 3.12 + IMAGE: 'windows-2019' + PYTHON_INTERPRETER: python Mac_Python36: PYTHON_VERSION_SPEC: 3.6 - IMAGE: 'macOS-11' + IMAGE: 'macOS-12' PYTHON_INTERPRETER: python3 Mac_Python37: PYTHON_VERSION_SPEC: 3.7 - IMAGE: 'macOS-11' + IMAGE: 'macOS-12' PYTHON_INTERPRETER: python3 Mac_Python38: PYTHON_VERSION_SPEC: 3.8 - IMAGE: 'macOS-11' + IMAGE: 'macOS-12' PYTHON_INTERPRETER: python3 Mac_Python39: PYTHON_VERSION_SPEC: 3.9 - IMAGE: 'macOS-11' + IMAGE: 'macOS-12' PYTHON_INTERPRETER: python3 Mac_Python310: PYTHON_VERSION_SPEC: 3.10 - IMAGE: 'macOS-11' + IMAGE: 'macOS-12' PYTHON_INTERPRETER: python3 Mac_Python311: PYTHON_VERSION_SPEC: 3.11 - IMAGE: 'macOS-11' + IMAGE: 'macOS-12' + PYTHON_INTERPRETER: python3 + Mac_Python312: + PYTHON_VERSION_SPEC: 3.12 + IMAGE: 'macOS-12' PYTHON_INTERPRETER: python3 timeoutInMinutes: 10 pool: diff --git a/build_scripts/apple_utils.py b/build_scripts/apple_utils.py index 2c82243896..d2039a3d03 100644 --- a/build_scripts/apple_utils.py +++ b/build_scripts/apple_utils.py @@ -1,25 +1,8 @@ # # Copyright 2022 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # # Utilities for managing Apple OS build concerns. @@ -35,36 +18,45 @@ import platform import shlex import subprocess +from typing import Optional, List TARGET_NATIVE = "native" TARGET_X86 = "x86_64" TARGET_ARM64 = "arm64" TARGET_UNIVERSAL = "universal" +TARGET_IOS = "iOS" +TARGET_VISIONOS = "visionOS" + +EMBEDDED_PLATFORMS = [TARGET_IOS, TARGET_VISIONOS] def GetBuildTargets(): return [TARGET_NATIVE, TARGET_X86, TARGET_ARM64, - TARGET_UNIVERSAL] + TARGET_UNIVERSAL, + TARGET_IOS, + TARGET_VISIONOS] def GetBuildTargetDefault(): - return TARGET_NATIVE; + return TARGET_NATIVE def MacOS(): return platform.system() == "Darwin" +def TargetEmbeddedOS(context): + return context.buildTarget in EMBEDDED_PLATFORMS + def GetLocale(): return sys.stdout.encoding or locale.getdefaultlocale()[1] or "UTF-8" -def GetCommandOutput(command): +def GetCommandOutput(command, **kwargs): """Executes the specified command and returns output or None.""" try: return subprocess.check_output( - shlex.split(command), - stderr=subprocess.STDOUT).decode(GetLocale(), 'replace').strip() - except subprocess.CalledProcessError: - pass - return None + command, stderr=subprocess.STDOUT, **kwargs).decode( + GetLocale(), 'replace').strip() + except: + return None def GetTargetArmArch(): # Allows the arm architecture string to be overridden by @@ -72,7 +64,7 @@ def GetTargetArmArch(): return os.environ.get('MACOS_ARM_ARCHITECTURE') or TARGET_ARM64 def GetHostArch(): - macArch = GetCommandOutput('arch').strip() + macArch = GetCommandOutput(["arch"]) if macArch == "i386" or macArch == TARGET_X86: macArch = TARGET_X86 else: @@ -80,6 +72,9 @@ def GetHostArch(): return macArch def GetTargetArch(context): + if TargetEmbeddedOS(context): + return GetTargetArmArch() + if context.targetNative: macTargets = GetHostArch() else: @@ -106,6 +101,8 @@ def GetTargetArchPair(context): primaryArch = TARGET_X86 if context.targetARM64: primaryArch = GetTargetArmArch() + if context.buildTarget in EMBEDDED_PLATFORMS: + primaryArch = GetTargetArmArch() if context.targetUniversal: primaryArch = GetHostArch() if (primaryArch == TARGET_X86): @@ -118,18 +115,34 @@ def GetTargetArchPair(context): def SupportsMacOSUniversalBinaries(): if not MacOS(): return False - XcodeOutput = GetCommandOutput('/usr/bin/xcodebuild -version') + XcodeOutput = GetCommandOutput(["/usr/bin/xcodebuild", "-version"]) XcodeFind = XcodeOutput.rfind('Xcode ', 0, len(XcodeOutput)) XcodeVersion = XcodeOutput[XcodeFind:].split(' ')[1] return (XcodeVersion > '11.0') +def GetSDKRoot(context) -> Optional[str]: + sdk = "macosx" + if context.buildTarget == TARGET_IOS: + sdk = "iphoneos" + elif context.buildTarget == TARGET_VISIONOS: + sdk = "xros" + + for arg in (context.cmakeBuildArgs or '').split(): + if "CMAKE_OSX_SYSROOT" in arg: + override = arg.split('=')[1].strip('"').strip() + if override: + sdk = override + return GetCommandOutput(["xcrun", "--sdk", sdk, "--show-sdk-path"]) + def SetTarget(context, targetName): context.targetNative = (targetName == TARGET_NATIVE) context.targetX86 = (targetName == TARGET_X86) context.targetARM64 = (targetName == GetTargetArmArch()) context.targetUniversal = (targetName == TARGET_UNIVERSAL) + context.targetIOS = (targetName == TARGET_IOS) + context.targetVisionOS = (targetName == TARGET_VISIONOS) if context.targetUniversal and not SupportsMacOSUniversalBinaries(): - self.targetUniversal = False + context.targetUniversal = False raise ValueError( "Universal binaries only supported in macOS 11.0 and later.") @@ -138,7 +151,7 @@ def GetTargetName(context): TARGET_X86 if context.targetX86 else GetTargetArmArch() if context.targetARM64 else TARGET_UNIVERSAL if context.targetUniversal else - "") + context.buildTarget) devout = open(os.devnull, 'w') @@ -217,3 +230,19 @@ def CreateUniversalBinaries(context, libNames, x86Dir, armDir): instDir=context.instDir, libName=targetName), outputName) return lipoCommands + +def ConfigureCMakeExtraArgs(context, args:List[str]) -> List[str]: + system_name = None + if TargetEmbeddedOS(context): + system_name = context.buildTarget + + if system_name: + args.append(f"-DCMAKE_SYSTEM_NAME={system_name}") + args.append(f"-DCMAKE_OSX_SYSROOT={GetSDKRoot(context)}") + + # Required to find locally built libs not from the sysroot. + args.append(f"-DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=BOTH") + args.append(f"-DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=BOTH") + args.append(f"-DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=BOTH") + + return args diff --git a/build_scripts/build_usd.py b/build_scripts/build_usd.py index b66fd12def..f31eecd19f 100644 --- a/build_scripts/build_usd.py +++ b/build_scripts/build_usd.py @@ -1,25 +1,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # # Check whether this script is being run under Python 2 first. Otherwise, # any Python 3-only code below will cause the script to fail with an @@ -34,7 +17,6 @@ import contextlib import ctypes import datetime -import distutils import fnmatch import glob import locale @@ -92,6 +74,9 @@ def MacOS(): if MacOS(): import apple_utils +def MacOSTargetEmbedded(context): + return MacOS() and apple_utils.TargetEmbeddedOS(context) + def GetLocale(): if Windows(): # Windows handles encoding a little differently then Linux / Mac @@ -252,7 +237,7 @@ def GetCPUCount(): except NotImplementedError: return 1 -def Run(cmd, logCommandOutput = True): +def Run(cmd, logCommandOutput = True, env = None): """Run the specified command in a subprocess.""" PrintInfo('Running "{cmd}"'.format(cmd=cmd)) @@ -266,7 +251,7 @@ def Run(cmd, logCommandOutput = True): # code will handle them. if logCommandOutput: p = subprocess.Popen(shlex.split(cmd), stdout=subprocess.PIPE, - stderr=subprocess.STDOUT) + stderr=subprocess.STDOUT, env=env) while True: l = p.stdout.readline().decode(GetLocale(), 'replace') if l: @@ -275,7 +260,7 @@ def Run(cmd, logCommandOutput = True): elif p.poll() is not None: break else: - p = subprocess.Popen(shlex.split(cmd)) + p = subprocess.Popen(shlex.split(cmd), env=env) p.wait() if p.returncode != 0: @@ -303,6 +288,13 @@ def CopyFiles(context, src, dest): raise RuntimeError("File(s) to copy {src} not found".format(src=src)) instDestDir = os.path.join(context.instDir, dest) + if not os.path.isdir(instDestDir): + try: + os.mkdir(instDestDir) + except Exception as e: + raise RuntimeError( + "Unable to create {destDir}".format(destDir=instDestDir)) from e + for f in filesToCopy: PrintCommandOutput("Copying {file} to {destDir}\n" .format(file=f, destDir=instDestDir)) @@ -421,6 +413,7 @@ def RunCMake(context, force, extraArgs = None): extraArgs.append('-DCMAKE_XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH=NO') extraArgs.append('-DCMAKE_OSX_ARCHITECTURES={0}'.format(targetArch)) + extraArgs = apple_utils.ConfigureCMakeExtraArgs(context, extraArgs) if context.ignorePaths: ignoredPaths = ";".join(context.ignorePaths) @@ -690,6 +683,20 @@ def AnyPythonDependencies(deps): def InstallZlib(context, force, buildArgs): with CurrentWorkingDirectory(DownloadURL(ZLIB_URL, context, force)): + # The following test files aren't portable to embedded platforms. + # They're not required for use on any platforms, so we elide them + # for efficiency + PatchFile("CMakeLists.txt", + [("add_executable(example test/example.c)", + ""), + ("add_executable(minigzip test/minigzip.c)", + ""), + ("target_link_libraries(example zlib)", + ""), + ("target_link_libraries(minigzip zlib)", + ""), + ("add_test(example example)", + "")]) RunCMake(context, force, buildArgs) ZLIB = Dependency("zlib", InstallZlib, "include/zlib.h") @@ -941,6 +948,19 @@ def InstallBoost(context, force, buildArgs): BOOST = Dependency("boost", InstallBoost, *BOOST_VERSION_FILES) +############################################################ +# Intel oneTBB + +ONETBB_URL = "https://github.com/oneapi-src/oneTBB/archive/refs/tags/v2021.9.0.zip" + +def InstallOneTBB(context, force, buildArgs): + with CurrentWorkingDirectory(DownloadURL(ONETBB_URL, context, force)): + RunCMake(context, force, + ['-DTBB_TEST=OFF', + '-DTBB_STRICT=OFF'] + buildArgs) + +ONETBB = Dependency("oneTBB", InstallOneTBB, "include/oneapi/tbb.h") + ############################################################ # Intel TBB @@ -991,6 +1011,31 @@ def InstallTBB_MacOS(context, force, buildArgs): "ifeq ($(arch),$(filter $(arch),armv7 armv7s {0}))" .format(apple_utils.GetTargetArmArch()))]) + if context.buildTarget == apple_utils.TARGET_VISIONOS: + # Create visionOS config from iOS config + shutil.copy( + src="build/ios.macos.inc", + dst="build/visionos.macos.inc") + + PatchFile("build/visionos.macos.inc", + [("ios","visionos"), + ("iOS", "visionOS"), + ("iPhone", "XR"), + ("IPHONEOS","XROS"), + ("?= 8.0", "?= 1.0")]) + + # iOS clang just reuses the macOS one, + # so it's easier to copy it directly. + shutil.copy(src="build/macos.clang.inc", + dst="build/visionos.clang.inc") + + PatchFile("build/visionos.clang.inc", + [("ios","visionos"), + ("-miphoneos-version-min=", "-target arm64-apple-xros"), + ("iOS", "visionOS"), + ("iPhone", "XR"), + ("IPHONEOS","XROS")]) + (primaryArch, secondaryArch) = apple_utils.GetTargetArchPair(context) # tbb uses different arch names @@ -1004,10 +1049,14 @@ def InstallTBB_MacOS(context, force, buildArgs): def _RunBuild(arch): if not arch: return + env = os.environ.copy() + if MacOSTargetEmbedded(context): + env["SDKROOT"] = apple_utils.GetSDKRoot(context) + buildArgs.append(f' compiler=clang arch=arm64 extra_inc=big_iron.inc target={context.buildTarget.lower()}') makeTBBCmd = 'make -j{procs} arch={arch} {buildArgs}'.format( arch=arch, procs=context.numJobs, buildArgs=" ".join(buildArgs)) - Run(makeTBBCmd) + Run(makeTBBCmd, env=env) _RunBuild(primaryArch) _RunBuild(secondaryArch) @@ -1476,13 +1525,20 @@ def InstallDraco(context, force, buildArgs): ############################################################ # MaterialX -MATERIALX_URL = "https://github.com/materialx/MaterialX/archive/v1.38.8.zip" +MATERIALX_URL = "https://github.com/materialx/MaterialX/archive/v1.38.10.zip" def InstallMaterialX(context, force, buildArgs): with CurrentWorkingDirectory(DownloadURL(MATERIALX_URL, context, force)): cmakeOptions = ['-DMATERIALX_BUILD_SHARED_LIBS=ON', '-DMATERIALX_BUILD_TESTS=OFF' ] + + if MacOSTargetEmbedded(context): + cmakeOptions.extend([ + '-DMATERIALX_BUILD_GEN_MSL=ON', + '-DMATERIALX_BUILD_GEN_GLSL=OFF', + '-DMATERIALX_BUILD_IOS=ON']) + cmakeOptions += buildArgs RunCMake(context, force, cmakeOptions) @@ -1767,6 +1823,11 @@ def InstallUSD(context, force, buildArgs): specified library and do not conflict with other options, otherwise build errors may occur. +- Embedded Build Targets +When cross compiling for an embedded target operating system, e.g. iOS, the +following components are disabled: python, tools, imaging, tests, examples, +tutorials. + - Python Versions and DCC Plugins: Some DCCs may ship with and run using their own version of Python. In that case, it is important that USD and the plugins for that DCC are built using the DCC's @@ -1796,7 +1857,7 @@ def InstallUSD(context, force, buildArgs): parser = argparse.ArgumentParser( formatter_class=argparse.RawDescriptionHelpFormatter, - description=programDescription) + allow_abbrev=False, description=programDescription) parser.add_argument("install_dir", type=str, help="Directory where USD will be installed") @@ -2049,6 +2110,14 @@ def InstallUSD(context, force, buildArgs): subgroup.add_argument("--no-materialx", dest="build_materialx", action="store_false", help="Disable MaterialX support") +group = parser.add_argument_group(title="TBB Options") +subgroup = group.add_mutually_exclusive_group() +subgroup.add_argument("--onetbb", dest="build_onetbb", action="store_true", + default=False, + help="Build using oneTBB instead of TBB") +subgroup.add_argument("--no-onetbb", dest="build_onetbb", action="store_false", + help="Build using TBB (default)") + group = parser.add_argument_group(title="Spline Test Options") subgroup = group.add_mutually_exclusive_group() subgroup.add_argument("--mayapy-tests", @@ -2169,12 +2238,15 @@ def __init__(self, args): self.forceBuildAll = args.force_all self.forceBuild = [dep.lower() for dep in args.force_build] + # Some components are disabled for embedded build targets + embedded = MacOSTargetEmbedded(self) + # Optional components - self.buildTests = args.build_tests - self.buildPython = args.build_python - self.buildExamples = args.build_examples - self.buildTutorials = args.build_tutorials - self.buildTools = args.build_tools + self.buildTests = args.build_tests and not embedded + self.buildPython = args.build_python and not embedded + self.buildExamples = args.build_examples and not embedded + self.buildTutorials = args.build_tutorials and not embedded + self.buildTools = args.build_tools and not embedded # - Documentation self.buildDocs = args.build_docs or args.build_python_docs @@ -2183,7 +2255,7 @@ def __init__(self, args): # - Imaging self.buildImaging = (args.build_imaging == IMAGING or - args.build_imaging == USD_IMAGING) + args.build_imaging == USD_IMAGING) and not embedded self.enablePtex = self.buildImaging and args.enable_ptex self.enableOpenVDB = self.buildImaging and args.enable_openvdb @@ -2213,9 +2285,12 @@ def __init__(self, args): self.dracoLocation = (os.path.abspath(args.draco_location) if args.draco_location else None) - # - MaterialX Plugin + # - MaterialX self.buildMaterialX = args.build_materialx + # - TBB + self.buildOneTBB = args.build_onetbb + # - Spline Tests self.buildMayapyTests = args.build_mayapy_tests self.mayapyLocation = args.mayapy_location @@ -2257,7 +2332,13 @@ def ForceBuildDependency(self, dep): # Determine list of dependencies that are required based on options # user has selected. -requiredDependencies = [ZLIB, BOOST, TBB] +if context.buildOneTBB: + TBB = ONETBB + +requiredDependencies = [ZLIB, TBB] + +if context.buildPython: + requiredDependencies += [BOOST] if context.buildAlembic: if context.enableHDF5: @@ -2307,6 +2388,33 @@ def ForceBuildDependency(self, dep): PrintError("Draco plugin can not be enabled for monolithic build on Windows") sys.exit(1) +# The versions of Embree we currently support do not support oneTBB. +if context.buildOneTBB and context.buildEmbree: + PrintError("Embree support cannot be enabled when building against oneTBB") + sys.exit(1) + +# Error out if user explicitly enabled components which aren't +# supported for embedded build targets. +if MacOSTargetEmbedded(context): + if "--tests" in sys.argv: + PrintError("Cannot build tests for embedded build targets") + sys.exit(1) + if "--python" in sys.argv: + PrintError("Cannot build python components for embedded build targets") + sys.exit(1) + if "--examples" in sys.argv: + PrintError("Cannot build examples for embedded build targets") + sys.exit(1) + if "--tutorials" in sys.argv: + PrintError("Cannot build tutorials for embedded build targets") + sys.exit(1) + if "--tools" in sys.argv: + PrintError("Cannot build tools for embedded build targets") + sys.exit(1) + if "--imaging" in sys.argv: + PrintError("Cannot build imaging for embedded build targets") + sys.exit(1) + # Error out if user explicitly specified building usdview without required # components. Otherwise, usdview will be silently disabled. This lets users # specify "--no-python" without explicitly having to specify "--no-usdview", @@ -2360,6 +2468,10 @@ def ForceBuildDependency(self, dep): elif MacOS(): # Apple Silicon is not supported prior to 3.19 cmake_required_version = (3, 19) + + # visionOS support was added in CMake 3.28 + if context.buildTarget == apple_utils.TARGET_VISIONOS: + cmake_required_version = (3, 28) else: # Linux, and vfx platform CY2020, are verified to work correctly with 3.14 cmake_required_version = (3, 14) @@ -2469,6 +2581,7 @@ def _JoinVersion(v): PRMan support: {buildPrman} UsdImaging {buildUsdImaging} usdview: {buildUsdview} + MaterialX support {buildMaterialX} Python support {buildPython} Python Debug: {debugPython} Python docs: {buildPythonDocs} @@ -2482,7 +2595,6 @@ def _JoinVersion(v): Alembic Plugin {buildAlembic} HDF5 support: {enableHDF5} Draco Plugin {buildDraco} - MaterialX Plugin {buildMaterialX} Dependencies {dependencies}""" @@ -2610,8 +2722,11 @@ def FormatBuildArguments(buildArgs): if context.macOSCodesign: apple_utils.Codesign(context.usdInstDir, verbosity > 1) -Print(""" -Success! To use USD, please ensure that you have:""") +additionalInstructions = any([context.buildPython, context.buildTools, context.buildPrman]) +if additionalInstructions: + Print("\nSuccess! To use USD, please ensure that you have:") +else: + Print("\nSuccess! USD libraries were built.") if context.buildPython: Print(""" @@ -2619,10 +2734,11 @@ def FormatBuildArguments(buildArgs): {requiredInPythonPath}""".format( requiredInPythonPath="\n ".join(sorted(requiredInPythonPath)))) -Print(""" +if context.buildPython or context.buildTools: + Print(""" The following in your PATH environment variable: - {requiredInPath} -""".format(requiredInPath="\n ".join(sorted(requiredInPath)))) + {requiredInPath}""".format( + requiredInPath="\n ".join(sorted(requiredInPath)))) if context.buildPrman: Print("See documentation at http://openusd.org/docs/RenderMan-USD-Imaging-Plugin.html " diff --git a/build_scripts/pypi/docker/Dockerfile b/build_scripts/pypi/docker/Dockerfile index 5929c04847..c685a68a24 100644 --- a/build_scripts/pypi/docker/Dockerfile +++ b/build_scripts/pypi/docker/Dockerfile @@ -1,13 +1,8 @@ -FROM quay.io/pypa/manylinux2014_x86_64:2022-05-14-b55b680 +FROM quay.io/pypa/manylinux2014_x86_64:2023-10-03-72cdc42 ENV LANG en_US.UTF-8 ENV LANGUAGE en_US:en WORKDIR /opt/USD -# XXX: -# The above manylinux2014 image contains CMake 3.22, but we require -# 3.27+ for Python 3.11 support. So we install 3.27 manually here. -RUN pipx install --force cmake==3.27.9 - CMD bash diff --git a/build_scripts/pypi/package_files/setup.py b/build_scripts/pypi/package_files/setup.py index 094478476f..bcfcfa4e09 100644 --- a/build_scripts/pypi/package_files/setup.py +++ b/build_scripts/pypi/package_files/setup.py @@ -1,25 +1,8 @@ # # Copyright 2020 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # import setuptools import argparse, glob, os, platform, re, shutil, sys @@ -151,5 +134,5 @@ def windows(): "Environment :: Console", "Topic :: Multimedia :: Graphics", ], - python_requires='>=3.6, <3.12', + python_requires='>=3.6, <3.13', ) diff --git a/build_scripts/pypi/test.py b/build_scripts/pypi/test.py index 6b1746c8f4..ce7be96737 100644 --- a/build_scripts/pypi/test.py +++ b/build_scripts/pypi/test.py @@ -1,25 +1,8 @@ # # Copyright 2020 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # import unittest diff --git a/build_scripts/pypi/updatePluginfos.py b/build_scripts/pypi/updatePluginfos.py index f8fc8cc2b6..8fc119aadf 100644 --- a/build_scripts/pypi/updatePluginfos.py +++ b/build_scripts/pypi/updatePluginfos.py @@ -1,25 +1,8 @@ # # Copyright 2020 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # '''Rewrite pluginfo library paths for changed library locations. diff --git a/cmake/defaults/CTestCustom.cmake b/cmake/defaults/CTestCustom.cmake index 5eb114ad1a..886db15bbb 100644 --- a/cmake/defaults/CTestCustom.cmake +++ b/cmake/defaults/CTestCustom.cmake @@ -1,3 +1,9 @@ +# +# Copyright 2016 Pixar +# +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. +# # set a timestamp id to identify this run of tests in the environment, if not # already set if (NOT DEFINED ENV{PXR_CTEST_RUN_ID}) diff --git a/cmake/defaults/CXXDefaults.cmake b/cmake/defaults/CXXDefaults.cmake index c59d70c8b7..e9eee14f06 100644 --- a/cmake/defaults/CXXDefaults.cmake +++ b/cmake/defaults/CXXDefaults.cmake @@ -1,25 +1,8 @@ # # Copyright 2016 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # include(CXXHelpers) include(Version) diff --git a/cmake/defaults/CXXHelpers.cmake b/cmake/defaults/CXXHelpers.cmake index b5670659aa..c0108f2f9e 100644 --- a/cmake/defaults/CXXHelpers.cmake +++ b/cmake/defaults/CXXHelpers.cmake @@ -1,25 +1,8 @@ # # Copyright 2016 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # function(_add_define definition) list(APPEND _PXR_CXX_DEFINITIONS "-D${definition}") diff --git a/cmake/defaults/Options.cmake b/cmake/defaults/Options.cmake index b37ff6f16e..6c118a9479 100644 --- a/cmake/defaults/Options.cmake +++ b/cmake/defaults/Options.cmake @@ -1,25 +1,8 @@ # # Copyright 2016 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # option(PXR_STRICT_BUILD_MODE "Turn on additional warnings. Enforce all warnings as errors." OFF) option(PXR_VALIDATE_GENERATED_CODE "Validate script generated code" OFF) @@ -111,6 +94,14 @@ set(PXR_OVERRIDE_PLUGINPATH_NAME "" "Name of the environment variable that will be used to get plugin paths." ) +set(PXR_TEST_RUN_TEMP_DIR_PREFIX "" + CACHE + STRING + "Prefix for test run temporary directory names. \ + Setting this option to \"foo-\" will create directories like \ + \"/foo-\"." +) + set(PXR_ALL_LIBS "" CACHE INTERNAL diff --git a/cmake/defaults/Packages.cmake b/cmake/defaults/Packages.cmake index 3f1400f617..fe60570b34 100644 --- a/cmake/defaults/Packages.cmake +++ b/cmake/defaults/Packages.cmake @@ -1,25 +1,8 @@ # # Copyright 2016 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # # Save the current value of BUILD_SHARED_LIBS and restore it at @@ -37,23 +20,25 @@ set(CMAKE_THREAD_PREFER_PTHREAD TRUE) find_package(Threads REQUIRED) set(PXR_THREAD_LIBS "${CMAKE_THREAD_LIBS_INIT}") -# Find Boost package before getting any boost specific components as we need to -# disable boost-provided cmake config, based on the boost version found. -find_package(Boost REQUIRED) - -# Boost provided cmake files (introduced in boost version 1.70) result in -# inconsistent build failures on different platforms, when trying to find boost -# component dependencies like python, etc. Refer some related -# discussions: -# https://github.com/boostorg/python/issues/262#issuecomment-483069294 -# https://github.com/boostorg/boost_install/issues/12#issuecomment-508683006 -# -# Hence to avoid issues with Boost provided cmake config, Boost_NO_BOOST_CMAKE -# is enabled by default for boost version 1.70 and above. If a user explicitly -# set Boost_NO_BOOST_CMAKE to Off, following will be a no-op. -option(Boost_NO_BOOST_CMAKE "Disable boost-provided cmake config" ON) -if (Boost_NO_BOOST_CMAKE) - message(STATUS "Disabling boost-provided cmake config") +if(PXR_ENABLE_PYTHON_SUPPORT OR PXR_ENABLE_OPENVDB_SUPPORT) + # Find Boost package before getting any boost specific components as we need to + # disable boost-provided cmake config, based on the boost version found. + find_package(Boost REQUIRED) + + # Boost provided cmake files (introduced in boost version 1.70) result in + # inconsistent build failures on different platforms, when trying to find boost + # component dependencies like python, etc. Refer some related + # discussions: + # https://github.com/boostorg/python/issues/262#issuecomment-483069294 + # https://github.com/boostorg/boost_install/issues/12#issuecomment-508683006 + # + # Hence to avoid issues with Boost provided cmake config, Boost_NO_BOOST_CMAKE + # is enabled by default for boost version 1.70 and above. If a user explicitly + # set Boost_NO_BOOST_CMAKE to Off, following will be a no-op. + option(Boost_NO_BOOST_CMAKE "Disable boost-provided cmake config" ON) + if (Boost_NO_BOOST_CMAKE) + message(STATUS "Disabling boost-provided cmake config") + endif() endif() if(PXR_ENABLE_PYTHON_SUPPORT) @@ -159,11 +144,8 @@ add_definitions(${TBB_DEFINITIONS}) if(WIN32) # Math functions are linked automatically by including math.h on Windows. set(M_LIB "") -elseif (APPLE) - # On Apple platforms, its idiomatic to just provide the -l linkage for sdk libs to be portable across SDK versions - set(M_LIB "-lm") else() - find_library(M_LIB m) + set(M_LIB m) endif() if (NOT PXR_MALLOC_LIBRARY) @@ -231,11 +213,7 @@ if (PXR_BUILD_IMAGING) if (POLICY CMP0072) cmake_policy(SET CMP0072 OLD) endif() - if (APPLE) - set(OPENGL_gl_LIBRARY "-framework OpenGL") - else () - find_package(OpenGL REQUIRED) - endif() + find_package(OpenGL REQUIRED) add_definitions(-DPXR_GL_SUPPORT_ENABLED) endif() # --Metal @@ -361,4 +339,4 @@ if(REQUIRES_Imath) endif() endif() -set(BUILD_SHARED_LIBS "${build_shared_libs}") \ No newline at end of file +set(BUILD_SHARED_LIBS "${build_shared_libs}") diff --git a/cmake/defaults/ProjectDefaults.cmake b/cmake/defaults/ProjectDefaults.cmake index 5e5f3f4144..a12889eeb2 100644 --- a/cmake/defaults/ProjectDefaults.cmake +++ b/cmake/defaults/ProjectDefaults.cmake @@ -1,25 +1,8 @@ # # Copyright 2016 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # if(APPLE) set(OSX_ARCHITECTURES "x86_64" CACHE STRING "Build architectures for OSX") diff --git a/cmake/defaults/Version.cmake b/cmake/defaults/Version.cmake index 34ffd4e4f3..427608ca83 100644 --- a/cmake/defaults/Version.cmake +++ b/cmake/defaults/Version.cmake @@ -1,29 +1,12 @@ # # Copyright 2016 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # # Versioning information set(PXR_MAJOR_VERSION "0") set(PXR_MINOR_VERSION "24") -set(PXR_PATCH_VERSION "5") # NOTE: Must not have leading 0 for single digits +set(PXR_PATCH_VERSION "8") # NOTE: Must not have leading 0 for single digits math(EXPR PXR_VERSION "${PXR_MAJOR_VERSION} * 10000 + ${PXR_MINOR_VERSION} * 100 + ${PXR_PATCH_VERSION}") diff --git a/cmake/defaults/clangdefaults.cmake b/cmake/defaults/clangdefaults.cmake index 4e20af3210..326c15f607 100644 --- a/cmake/defaults/clangdefaults.cmake +++ b/cmake/defaults/clangdefaults.cmake @@ -1,25 +1,8 @@ # # Copyright 2016 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # include(gccclangshareddefaults) diff --git a/cmake/defaults/gccclangshareddefaults.cmake b/cmake/defaults/gccclangshareddefaults.cmake index 0c13711f5e..cb5d21c5c2 100644 --- a/cmake/defaults/gccclangshareddefaults.cmake +++ b/cmake/defaults/gccclangshareddefaults.cmake @@ -1,25 +1,8 @@ # # Copyright 2016 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # # This file contains a set of flags/settings shared between our diff --git a/cmake/defaults/gccdefaults.cmake b/cmake/defaults/gccdefaults.cmake index 6bc015d9ca..8dd147345f 100644 --- a/cmake/defaults/gccdefaults.cmake +++ b/cmake/defaults/gccdefaults.cmake @@ -1,25 +1,8 @@ # # Copyright 2016 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # include(gccclangshareddefaults) diff --git a/cmake/defaults/msvcdefaults.cmake b/cmake/defaults/msvcdefaults.cmake index 0f7fb7ef64..78bde7a77e 100644 --- a/cmake/defaults/msvcdefaults.cmake +++ b/cmake/defaults/msvcdefaults.cmake @@ -1,25 +1,8 @@ # # Copyright 2016 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # # Enable exception handling. diff --git a/cmake/macros/Private.cmake b/cmake/macros/Private.cmake index f0bc34ed80..48fe107dd7 100644 --- a/cmake/macros/Private.cmake +++ b/cmake/macros/Private.cmake @@ -1,25 +1,8 @@ # # Copyright 2016 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # include(Version) @@ -540,7 +523,7 @@ function(_pxr_enable_precompiled_header TARGET_NAME) # Headers live in subdirectories. set(rel_output_header_path "${PXR_PREFIX}/${TARGET_NAME}/${output_header_name}") set(abs_output_header_path "${PROJECT_BINARY_DIR}/include/${rel_output_header_path}") - set(abs_precompiled_path ${PROJECT_BINARY_DIR}/include/${PXR_PREFIX}/${TARGET_NAME}/${precompiled_name}) + set(abs_precompiled_path ${PROJECT_BINARY_DIR}/include/${PXR_PREFIX}/${TARGET_NAME}/${CMAKE_BUILD_TYPE}/${precompiled_name}) # Additional compile flags to use precompiled header. This will be set(compile_flags "") diff --git a/cmake/macros/Public.cmake b/cmake/macros/Public.cmake index a9687afe12..9f3d358377 100644 --- a/cmake/macros/Public.cmake +++ b/cmake/macros/Public.cmake @@ -1,25 +1,8 @@ # # Copyright 2016 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # include(Private) @@ -850,6 +833,10 @@ function(pxr_register_test TEST_NAME) set(testWrapperCmd ${testWrapperCmd} --env-var=${PXR_PLUGINPATH_NAME}=${CMAKE_INSTALL_PREFIX}/lib/usd) endif() + if (PXR_TEST_RUN_TEMP_DIR_PREFIX) + set(testWrapperCmd ${testWrapperCmd} --tempdirprefix=${PXR_TEST_RUN_TEMP_DIR_PREFIX}) + endif() + # Ensure that Python imports the Python files built by this build. # On Windows convert backslash to slash and don't change semicolons # to colons. diff --git a/cmake/macros/compilePython.py b/cmake/macros/compilePython.py index d1b561c49b..f9c537bc37 100755 --- a/cmake/macros/compilePython.py +++ b/cmake/macros/compilePython.py @@ -1,25 +1,8 @@ # # Copyright 2016 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # # # Usage: compilePython source.py dest.pyc diff --git a/cmake/macros/copyHeaderForBuild.cmake b/cmake/macros/copyHeaderForBuild.cmake index e4ffaa7d97..0eaf6eff73 100644 --- a/cmake/macros/copyHeaderForBuild.cmake +++ b/cmake/macros/copyHeaderForBuild.cmake @@ -1,25 +1,8 @@ # # Copyright 2018 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # file(READ ${infile} _tmp_file_content) file(WRITE ${outfile} "\#line 1 \"${infile}\"\n") diff --git a/cmake/macros/shebang.py b/cmake/macros/shebang.py index 75e0a93f15..53bdb0cb4a 100644 --- a/cmake/macros/shebang.py +++ b/cmake/macros/shebang.py @@ -1,25 +1,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # # # Usage: diff --git a/cmake/macros/testWrapper.py b/cmake/macros/testWrapper.py index a570e2d9f4..9e4104028d 100644 --- a/cmake/macros/testWrapper.py +++ b/cmake/macros/testWrapper.py @@ -1,25 +1,8 @@ # # Copyright 2016 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # # # Usage: testWrapper.py @@ -104,7 +87,9 @@ def _parseArgs(): 'directory; if " is in the value, it is ' 'replaced with a timestamp identifying a given ctest ' 'invocation')) - + parser.add_argument('--tempdirprefix', metavar='PREFIX', type=str, + help='temp directory names will begin with PREFIX', + default=None) parser.add_argument('--expected-return-code', type=int, default=0, help='Expected return code of this test.') parser.add_argument('--env-var', dest='envVars', default=[], type=str, @@ -346,7 +331,7 @@ def _runCommand(raw_command, stdout_redir, stderr_redir, env, "--clean-output-paths.") sys.exit(1) - testDir = tempfile.mkdtemp() + testDir = tempfile.mkdtemp(prefix=args.tempdirprefix) os.chdir(testDir) if args.verbose: print("chdir: {0}".format(testDir)) diff --git a/cmake/modules/FindAnimX.cmake b/cmake/modules/FindAnimX.cmake index 1b6c593c03..4d50cea89a 100644 --- a/cmake/modules/FindAnimX.cmake +++ b/cmake/modules/FindAnimX.cmake @@ -1,25 +1,8 @@ # # Copyright 2023 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # # Finds AnimX library. Provides the results by defining the variables # ANIMX_LIBRARY and ANIMX_INCLUDES. diff --git a/cmake/modules/FindDraco.cmake b/cmake/modules/FindDraco.cmake index 6d25cb3c13..a822d29e98 100644 --- a/cmake/modules/FindDraco.cmake +++ b/cmake/modules/FindDraco.cmake @@ -1,25 +1,8 @@ # # Copyright 2019 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # # Find Draco Compression Library using DRACO_ROOT as a hint location and # provides the results by defining the variables DRACO_INCLUDES and diff --git a/cmake/modules/FindEmbree.cmake b/cmake/modules/FindEmbree.cmake index e12639d6d9..cd52f6b7f5 100644 --- a/cmake/modules/FindEmbree.cmake +++ b/cmake/modules/FindEmbree.cmake @@ -1,25 +1,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # #============================================================================= # diff --git a/cmake/modules/FindJinja2.cmake b/cmake/modules/FindJinja2.cmake index 820b19af71..72ca67648c 100644 --- a/cmake/modules/FindJinja2.cmake +++ b/cmake/modules/FindJinja2.cmake @@ -1,25 +1,8 @@ # # Copyright 2016 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # # Jinja2 is a python library, ensure that it is available for use with our # specified version of Python. diff --git a/cmake/modules/FindOSL.cmake b/cmake/modules/FindOSL.cmake index 42392361f6..f5c77c5d24 100644 --- a/cmake/modules/FindOSL.cmake +++ b/cmake/modules/FindOSL.cmake @@ -1,25 +1,8 @@ # # Copyright 2018 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # # Find OSL header. diff --git a/cmake/modules/FindOpenColorIO.cmake b/cmake/modules/FindOpenColorIO.cmake index 26b8229a1f..8df6fe35f3 100644 --- a/cmake/modules/FindOpenColorIO.cmake +++ b/cmake/modules/FindOpenColorIO.cmake @@ -1,25 +1,8 @@ # # Copyright 2019 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # if(UNIX) diff --git a/cmake/modules/FindOpenEXR.cmake b/cmake/modules/FindOpenEXR.cmake index cd77c50a3a..7cf5d46810 100644 --- a/cmake/modules/FindOpenEXR.cmake +++ b/cmake/modules/FindOpenEXR.cmake @@ -1,25 +1,8 @@ # # Copyright 2016 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # find_path(OPENEXR_INCLUDE_DIR diff --git a/cmake/modules/FindOpenImageIO.cmake b/cmake/modules/FindOpenImageIO.cmake index eca0607deb..4d2ff1ec4f 100644 --- a/cmake/modules/FindOpenImageIO.cmake +++ b/cmake/modules/FindOpenImageIO.cmake @@ -1,25 +1,8 @@ # # Copyright 2016 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # if(UNIX) diff --git a/cmake/modules/FindOpenVDB.cmake b/cmake/modules/FindOpenVDB.cmake index 2968a2294b..7919827297 100644 --- a/cmake/modules/FindOpenVDB.cmake +++ b/cmake/modules/FindOpenVDB.cmake @@ -1,25 +1,8 @@ # # Copyright 2019 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # # Find OpenVDB header. diff --git a/cmake/modules/FindPyOpenGL.cmake b/cmake/modules/FindPyOpenGL.cmake index 03aec92b81..a6b427857a 100644 --- a/cmake/modules/FindPyOpenGL.cmake +++ b/cmake/modules/FindPyOpenGL.cmake @@ -1,25 +1,8 @@ # # Copyright 2016 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # if (NOT PYTHON_EXECUTABLE) message(FATAL_ERROR "Unable to find Python executable - PyOpenGL not present") diff --git a/cmake/modules/FindPySide.cmake b/cmake/modules/FindPySide.cmake index 94d9199f37..1fd02ff886 100644 --- a/cmake/modules/FindPySide.cmake +++ b/cmake/modules/FindPySide.cmake @@ -1,25 +1,8 @@ # # Copyright 2016 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # if (NOT PYTHON_EXECUTABLE) message(FATAL_ERROR "Unable to find Python executable - PySide not present") diff --git a/cmake/modules/FindRenderman.cmake b/cmake/modules/FindRenderman.cmake index aa032edc2d..8d4e325de5 100644 --- a/cmake/modules/FindRenderman.cmake +++ b/cmake/modules/FindRenderman.cmake @@ -1,25 +1,8 @@ # # Copyright 2018 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # #============================================================================= # @@ -138,8 +121,13 @@ get_filename_component(RENDERMAN_BINARY_DIR if (RENDERMAN_INCLUDE_DIR AND EXISTS "${RENDERMAN_INCLUDE_DIR}/prmanapi.h" ) file(STRINGS "${RENDERMAN_INCLUDE_DIR}/prmanapi.h" TMP REGEX "^#define _PRMANAPI_VERSION_MAJOR_.*$") string(REGEX MATCHALL "[0-9]+" MAJOR ${TMP}) - set (RENDERMAN_VERSION_MAJOR ${MAJOR}) + + file(STRINGS "${RENDERMAN_INCLUDE_DIR}/prmanapi.h" TMP REGEX "^#define _PRMANAPI_VERSION_MINOR_.*$") + string(REGEX MATCHALL "[0-9]+" MINOR ${TMP}) + set (RENDERMAN_VERSION_MINOR ${MINOR}) + # Combine major and minor version numbers into a single version string + set(RENDERMAN_VERSION "${RENDERMAN_VERSION_MAJOR}.${RENDERMAN_VERSION_MINOR}") endif() # will set RENDERMAN_FOUND @@ -150,6 +138,7 @@ list(APPEND required_vars "RENDERMAN_INCLUDE_DIR") list(APPEND required_vars "RENDERMAN_EXECUTABLE") list(APPEND required_vars "RENDERMAN_BINARY_DIR") list(APPEND required_vars "RENDERMAN_VERSION_MAJOR") +list(APPEND required_vars "RENDERMAN_VERSION") list(APPEND required_vars "PRMAN_LIBRARY") list(APPEND required_vars "PRMAN_STATS_LIBRARY") list(APPEND required_vars "PXRCORE_LIBRARY") diff --git a/cmake/modules/FindTBB.cmake b/cmake/modules/FindTBB.cmake index 9bf69a0229..1da6fe695a 100644 --- a/cmake/modules/FindTBB.cmake +++ b/cmake/modules/FindTBB.cmake @@ -197,7 +197,12 @@ if(NOT TBB_FOUND) ################################## if(TBB_INCLUDE_DIRS) - file(READ "${TBB_INCLUDE_DIRS}/tbb/tbb_stddef.h" _tbb_version_file) + # Use new oneTBB version header if it exists. + if(EXISTS "${TBB_INCLUDE_DIRS}/oneapi/tbb/version.h") + file(READ "${TBB_INCLUDE_DIRS}/oneapi/tbb/version.h" _tbb_version_file) + else() + file(READ "${TBB_INCLUDE_DIRS}/tbb/tbb_stddef.h" _tbb_version_file) + endif() string(REGEX REPLACE ".*#define TBB_VERSION_MAJOR ([0-9]+).*" "\\1" TBB_VERSION_MAJOR "${_tbb_version_file}") string(REGEX REPLACE ".*#define TBB_VERSION_MINOR ([0-9]+).*" "\\1" @@ -211,6 +216,13 @@ if(NOT TBB_FOUND) # Find TBB components ################################## + # oneTBB on Windows has interface version in the name. + if(WIN32 AND TBB_INTERFACE_VERSION GREATER_EQUAL 12000) + set(_tbb_library_name tbb12) + else() + set(_tbb_library_name tbb) + endif() + if(TBB_VERSION VERSION_LESS 4.3) set(TBB_SEARCH_COMPOMPONENTS tbb_preview tbbmalloc tbb) else() @@ -219,15 +231,21 @@ if(NOT TBB_FOUND) # Find each component foreach(_comp ${TBB_SEARCH_COMPOMPONENTS}) - if(";${TBB_FIND_COMPONENTS};tbb;" MATCHES ";${_comp};") + if(";${TBB_FIND_COMPONENTS};tbb" MATCHES ";${_comp};") + + if(${_comp} STREQUAL tbb) + set(_lib_name ${_tbb_library_name}) + else() + set(_lib_name ${_comp}) + endif() # Search for the libraries - find_library(TBB_${_comp}_LIBRARY_RELEASE ${_comp} + find_library(TBB_${_comp}_LIBRARY_RELEASE ${_lib_name} HINTS ${TBB_LIBRARY} ${TBB_SEARCH_DIR} PATHS ${TBB_DEFAULT_SEARCH_DIR} ENV LIBRARY_PATH PATH_SUFFIXES ${TBB_LIB_PATH_SUFFIX}) - find_library(TBB_${_comp}_LIBRARY_DEBUG ${_comp}_debug + find_library(TBB_${_comp}_LIBRARY_DEBUG ${_lib_name}_debug HINTS ${TBB_LIBRARY} ${TBB_SEARCH_DIR} PATHS ${TBB_DEFAULT_SEARCH_DIR} ENV LIBRARY_PATH PATH_SUFFIXES ${TBB_LIB_PATH_SUFFIX}) diff --git a/docs/README.md b/docs/README.md index 90b44c4c9d..0b164acec0 100644 --- a/docs/README.md +++ b/docs/README.md @@ -174,4 +174,99 @@ sphinx-build . /tmp/usddocs ``` Sphinx tracks changed files, so subsequent builds will be faster than the first. - \ No newline at end of file + +### Generating Schema User Docs + +Use the python/genSchemaDocs.py tool to generate Sphinx content files from +USD schemas. The process for authoring schema user doc is as follows: + +- Create (if it doesn't already exist) a sub-directory named "userDoc" where + your schema.usda lives. +- In your userDoc directory, create (or update) overview "guide" markdown files + for your schemas, using the + [Myst Markdown](https://myst-parser.readthedocs.io/en/v0.15.1/sphinx/intro.html) + format. Add any local image files to the user_doc directory as well. +- In your userDoc directory, create (or update) "schemaUserDoc.usda". This + will contain reference user doc for your schema classes and properties. Your + schemaUserDoc.usda should sublayer your schema.usda, and provide overs for + schema classes you want to add user doc for. Each over should add "userDoc" + and "userDocBrief" customData metadata strings for each schema class and + property. The "userDoc" string is used to generate the Sphinx output, and + should be in + [Myst Markdown](https://myst-parser.readthedocs.io/en/v0.15.1/sphinx/intro.html) + format. The "userDocBrief" string is not used for Sphinx output, and is used + for brief user doc presented in the UI of DCC Tools. The custom data will + look something like the following: + +``` +over SchemaClass "SchemaClass" ( + customData = { + string userDocBrief = """A short sentence or two describing the schema.""" + string userDoc = """A longer set of paragraphs describing the schema +in detail. Use Markdown format to include images, links, etc. Use Myst Markdown +to add Sphinx directives like references and labels. +""" +) +{ + asset schemaAssetProperty ( + customData = { + string userDocBrief = """A short sentence or two describing the + property.""" + string userDoc = """A longer set of paragraphs describing the property + in detail, again using Markdown and Sphinx directives as needed.""" + } + ) +} +``` + + Your "schemaUserDoc.usda" should also provide a "GLOBAL" prim that contains + custom metadata for the schema domain name ("libraryName") and a short title + for the table-of-contents page for the generated Sphinx files + ("userDocTitle"). For example, for usdVol, the GLOBAL over in + schemaUserDoc.usda looks like the following: + +``` +over "GLOBAL" ( + customData = { + string libraryName = "usdVol" + string userDocTitle = "Volumes" + } +) +{ +} +``` + +See pxr/usd/usdVol/userDoc/ for examples of the files mentioned above. Some +additional notes: + +- Don't have any leading whitespace in your multiline doc strings. The +generation process doesn't strip this out (because that would break spacing in +things like codeblocks), and the extra whitespace will show up in the generated +HTML. +- Don't add your own markdown headers (e.g. "# Title") in schemaUserDoc.usda. +The generation tool automatically creates headers and Sphinx labels for +classes and properties, and extra headers might result in confusing output. +You don't need to add RST labels for schema classes and attributes +- The generation tool automatically adds Sphinx labels for classes and +properties, using a `_` format. +- In your overview guide markdown files, feel free to add labels to any +sections you might need to link to from your schemaUserDoc.usda content. +Using Myst Markdown, the syntax is "(label name)=" on its own line. + +To generate the Sphinx files from your schema user doc files, run the +genSchemaDocs.py tool pointing it at your userDocs directory and the +desired output path. For example, if your current working directory was +docs/, you could generate usdVol Sphinx files into +docs/user_guides/schemas/usdVol/ using the following command: + +``` +python python/genSchemaDocs.py ../pxr/usd/usdVol/userDocs user_guides/schemas -t +``` + +This will parse the content in pxr/usd/usdVol/userDocs and generate Sphinx +files into user_guides/schemas/usdVol, along with a usdVol_toc.rst +table-of-contents file that can be included in any Sphinx RST file (like +docs/user_guides/schemas/index.rst). + +Current content in docs/user_guides/schemas have been generating using the +genSchemaDocs.py tool. \ No newline at end of file diff --git a/docs/conf.py b/docs/conf.py index f8fe3c3119..e6511ffb70 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -135,7 +135,7 @@ def GetSphinxLogger(): 'display_version': False, 'collapse_navigation': False, 'sticky_navigation': False, - 'navigation_depth': 3, + 'navigation_depth': 4, 'style_nav_header_background': '#606060' } diff --git a/docs/contributing_to_usd.rst b/docs/contributing_to_usd.rst index a43946e5c6..98bf013555 100644 --- a/docs/contributing_to_usd.rst +++ b/docs/contributing_to_usd.rst @@ -105,7 +105,10 @@ Here is the workflow we recommend for contributing changes to USD: - #. Now you can work in your branch locally. + #. Now you can work in your branch locally. Please review the USD + `Coding Guidelines `__ and + `Testing Guidelines `__ + when making code changes. .. | space | diff --git a/docs/doxygen/Doxyfile.in b/docs/doxygen/Doxyfile.in index a2a8abd152..d8c444a718 100644 --- a/docs/doxygen/Doxyfile.in +++ b/docs/doxygen/Doxyfile.in @@ -757,6 +757,7 @@ WARN_LOGFILE = INPUT = docs/doxygen/externalOverview.dox \ docs/doxygen/developer_guides.dox \ docs/doxygen/architecture-guides \ + docs/doxygen/developer-guidelines \ docs/include/pxr/extras/imaging \ docs/include/pxr/base \ docs/include/pxr/usd \ diff --git a/docs/doxygen/developer-guidelines/coding_guidelines.dox b/docs/doxygen/developer-guidelines/coding_guidelines.dox new file mode 100644 index 0000000000..9a5cf08f57 --- /dev/null +++ b/docs/doxygen/developer-guidelines/coding_guidelines.dox @@ -0,0 +1,139 @@ +/*! +\page Page_Coding_Guidelines Coding Guidelines for OpenUSD + +Use the following coding guidelines when making code changes to OpenUSD. + +\section Coding_Conventions_And_Formatting OpenUSD Code Conventions and Formatting Guidelines + +Code should follow the formatting rules: + +
    +
  • Each line shouldn't exceed 80 characters.
  • +
  • K&R style braces are required, even for: `if`, `for`, `while`, and similar +control-flow statements that have a single line in their bodies. Always put the +body code for a function or control-flow statement on a separate line.
  • +
  • Naming conventions:
  • +
      +
    • Class names should be upper camel case nouns, and should be preceded by the +library prefix (for example, `UsdLuxLightFilter`).
    • +
    • Use CapWords style for method names (for example, `ReadImage()`). If +possible, prefix method and function names with a verb.
    • +
    • Instance variables (data members) should start with a lowercase letter and +should use the mixedCase style for multiple words (for example, `imageData`).
    • +
    • Begin private and protected methods, functions, and member variables with an +underscore (for example, `_PrivateMethod()`, `_privateData`).
    • +
    +
  • Make sure your code is wrapped in the `PXR` namespace. To do this:
  • +
      +
    • Add `PXR_NAMESPACE_OPEN_SCOPE` at the top of every C++ file, header and cpp, +after the includes.
    • +
    • Add `PXR_NAMESPACE_CLOSE_SCOPE` at the bottom of every C++ file, header and +cpp.
    • +
    • Add `PXR_NAMESPACE_USING_DIRECTIVE` at the top of any C++ test code, after +the includes.
    • +
    +
  • Protect header files from multiple inclusion by using guard macros, using a +macro name of the form `PACKAGENAME_HEADERNAME_H`. For example, in +`pxr/usd/usd/tokens.h` the following guard macros are used: + +\code{.c} +#ifndef USD_TOKENS_H +#define USD_TOKENS_H +...header content… +#endif +\endcode + +Use guard macros rather than `#pragma once` directives.
  • +
  • For libraries, export your symbols by doing the following:
  • +
      +
    • Add an api.h file if needed (these are mostly boilerplate and you can copy and +edit an existing one from any existing library). Define a `LIBNAME_API` macro +for your library (e.g. `USD_API`, `SDF_API`, etc).
    • +
    • API tags should go on (non-inlined) methods rather than classes. The only +exception is for subclasses of Qt classes; for these, you should use the macro +name `LIBNAME_API_CLASS` rather than `LIBNAME_API` for code-search purposes.
    • +
    • Use your appropriate `LIBNAME_API` macro for any declaration you need to +export. This will typically include:
    • +
        +
      • On non-templated public members of public classes, including statics and +operators.
      • +
      • On non-templated public free functions and global data.
      • +
      • On destructors of public classes.
      • +
      • On protected members of public base classes that may be subclassed outside +the library.
      • +
      • On public pure-virtual declarations of public base classes.
      • +
      • On any function or datum (even private) that may be referenced from a +wrapping implementation, referenced from a public method marked inline, or that +may be called from a public templated function definition in a header file.
      • +
      • On full specializations of public templated functions (i.e., `template<>` +with empty parameters).
      • +
      • As a special declaration for templates that must have a common +instantiation, e.g. because of global data.
      • +
      +
    • Use your `LIBNAME_API` macro on declarations, not definitions. It should be +added after `template`, `class`, and/or `struct`, if present, and before `static` +and/or `virtual`, if present, and before the symbol's type. For classes, you'll +typically mark individual methods/members, and not entire classes, although +small public structs may be exported in their entirety.
    • +
    +
  • License header: please add this text at the top of each new source file +(in comments): + +\code{.unparsed} +Copyright YYYY Pixar + +Licensed under the terms set forth in the LICENSE.txt file available at https://openusd.org/license +\endcode +
  • +
+ +\section Coding_General_Guidelines General Guidelines + +\subsection Coding_Small_Changes Make Small Atomic Changes + +Keep your changes small and atomic so it's easier to do code reviews, and, if +necessary, to troubleshoot regressions. + +For example, split features into their own changelists; split API changes and +behavior changes into different changelists; split schema changes and +implementation into different changelists. Splitting up larger changes makes it +easier and less risky to incorporate these changes into the codebase. + +\subsection Coding_Testing Test Your Changes + +All code changes should have proper test coverage to ensure code quality. See +\ref Page_Testing_Guidelines for more information on writing tests. + +\subsection Coding_Add_Documentation Add Documentation + +Changes should be accompanied by API documentation and user documentation, if +applicable, to help other developers and users make the most of your changes. + +\subsubsection Coding_API_Documentation API Documentation + +If you are adding new or modifying existing APIs, please update the +corresponding documentation. This should be completed prior to getting a code +review, so the reviewer has more context and can also help identify anything in +the documentation that may cause confusion. + +For C++ code we use doxygen-style comments +for documentation and generate HTML documentation from these comments. + +If you are adding or updating USD schemas that will get generated into C++ code +from the schema.usda file (i.e. not codeless schemas), you should add your API +documentation (in doxygen-style format) in the "doc" metadata field string of +the schema class or attribute. These strings will be converted into C++ comments +in the generated code (via usdGenSchema.py). + +\subsubsection Coding_User_Documentation User Documentation + +User documentation is usually written in reStructured Text +(as .rst files) or Myst Markdown +(as .md files) format, and generated into HTML using Sphinx. +Content files and Sphinx scripts are currently in the `docs/` directory. + +If you are adding or updating USD schemas, you should also add user +documentation for the schema classes and properties using the "userDocBrief" +and "userDoc" custom metadata fields. See `docs/README.md` for more details. + +*/ \ No newline at end of file diff --git a/docs/doxygen/developer-guidelines/testing_guidelines.dox b/docs/doxygen/developer-guidelines/testing_guidelines.dox new file mode 100644 index 0000000000..d6f4f1e762 --- /dev/null +++ b/docs/doxygen/developer-guidelines/testing_guidelines.dox @@ -0,0 +1,413 @@ +/*! +\page Page_Testing_Guidelines Testing Guidelines for OpenUSD + +All USD code changes should have proper test coverage to ensure code quality. +USD uses CMake's built-in CTest program for testing. Use the following +guidelines to understand how to write and run USD tests. + +\section Testing_Writing_Unit_Tests Writing Unit Tests + +Unit tests are required for all changes to a USD module. Unit tests can be +written in C++ and/or Python. USD unit test source files and asset files are +located in a testenv directory in the appropriate USD module's directory, +and are added to the USD module's CMakeLists.txt, as described below. + +\subsection Testing_Naming_Conventions Test Naming Conventions + +Tests should be named using the format "test". +For example, "testUsdFlatten", or "testUsdGeomExtentTransform". + +Within the test code, test methods should be named using the format +"test_". For example, "test_Flatten", "test_Export", etc. + +\subsection Testing_Adding_Test_Files Adding or Updating Test Files + +Test source files and resources (such as USD files, images, etc) should be +located as follows. + +
    +
  • Test source (C++, Python) files should be added to the `testenv` directory for +a given USD module. For example, all test source files for usdLux are in +`pxr/usd/usdLux/testenv/`.
  • +
  • Test resources, if needed, should be added to a subdirectory in `testenv` named +for the test. For example, USD files needed for the testUsdLuxLightListAPI test +are in `pxr/usd/usdLux/testenv/testUsdLuxLightListAPI/`.
  • +
+ +\note Some test resource directories in USD currently are named with `.testenv` +appended to the test name. Appending `.testenv` is an older convention that is +not needed anymore. + +\subsection Testing_Registering_Tests Registering Tests + +Register your test in the USD module's CMakeLists.txt to ensure the CTest +harness runs your test. Tests are registered using the +`pxr_register_test wrapper` function, which also provides a list of steps the +harness will do to run your test. A list of common options for +`pxr_register_test` follows (note this is not a complete list of options, see +`cmake/macros/Public.cmake` for details on `pxr_register_test`): + +Option | Meaning +--------------------------- | ------------- +`STDOUT_REDIRECT ` | Redirect stdout from a test to the file name specified. +`STDERR_REDIRECT ` | Redirect stderr from a test to the file name specified. +`DIFF_COMPARE +` | After the test has completed, diff file-name(s) against the corresponding file(s) in `/baseline/` +`ENV +` | A set of key-value pairs specifying environment configuration to set. +`EXPECTED_RETURN_CODE ` | An exit code to match against after running the test. +`PYTHON` | Indicates that the test is Python based. +`REQUIRES_DISPLAY` | Indicates that the test requires a connected display to run. If there is no display at the time of running the test, the wrapper will skip it. +`COMMAND ` | The main command to run. +`PRE_COMMAND ` / `POST_COMMAND ` | Commands to run before or after the main command. These currently don't provide output redirection and expect an exit code of 0. + +Example + +The test registration for the testUsdFlatten Python test looks as follows: + +\code{.unparsed} +pxr_register_test(testUsdFlatten + PYTHON + COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdFlatten" + EXPECTED_RETURN_CODE 0 +) +\endcode + +\subsection Testing_Test_InstallationTest Installation + +Use `pxr_install_test_dir` to specify where test assets should get installed +when the test harness is run. Note that the name used for `DEST` must exactly +match the name used in test registration. If your test does not use any +additional assets, you don't need to add a `pxr_install_test_dir` call nor add +the "" directory to `testenv/`. + +Example + +The install for testUsdFlatten assets looks like: + +\code{.unparsed} +pxr_install_test_dir( + SRC testenv/testUsdFlatten + DEST testUsdFlatten +) +\endcode + +\subsection Testing_Python_Unit_Tests Python Unit Tests + +Python tests need to be added to CMakeLists.txt using the `pxr_test_scripts` +function. Python unit tests should use Python's unittest module. + +\subsection Testing_CPP_Unit_Tests C++ Unit Tests + +Use the `pxr_build_test` function to CMakeLists.txt to specify how your C++ +test is built. Test binaries will be installed to +`${CMAKE_INSTALL_PREFIX}/tests/`. Any libraries needed by the test itself must +be explicitly listed in the `LIBRARIES` section. + +Example + +The `pxr_build_test` for the C++ testUsdAttributeBlockingCpp test looks like: + +\code{.unparsed} +pxr_build_test(testUsdAttributeBlockingCpp + LIBRARIES + tf + usd + CPPFILES + testenv/testUsdAttributeBlocking.cpp +) +\endcode + +\section Testing_Building_Tests Building Tests + +To build the USD tests, use the `PXR_BUILD_TESTS` CMake build configuration +(this defaults to `ON` if not set), or use the `--tests` command line argument +if you are building using the build_usd.py script. + +\section Testing_Running_Tests Running Tests + +To run tests, use CMake's ctest command +and run from the build directory. + +To run all tests: + +\code{.unparsed} +$ cd /my-build-directory/build/USD +$ ctest -C Release +\endcode + +To run an individual test: + +\code{.unparsed} +$ cd /my-build-directory/build/USD +$ ctest -C Release -R test-to-run +\endcode + +An example individual test run will look something like the following: + +\code{.unparsed} +$ ctest -C Release -R testUsdFlatten +Test project /Users/dsyu/temp/tests-build/build/USD + Start 452: testUsdFlatten +1/5 Test #452: testUsdFlatten ................... Passed 0.55 sec + Start 453: testUsdFlatten2 +2/5 Test #453: testUsdFlatten2 .................. Passed 0.33 sec + Start 454: testUsdFlatten3 +3/5 Test #454: testUsdFlatten3 .................. Passed 0.31 sec + Start 455: testUsdFlatten4 +4/5 Test #455: testUsdFlatten4 .................. Passed 0.33 sec + Start 456: testUsdFlattenLayerStack +5/5 Test #456: testUsdFlattenLayerStack ......... Passed 0.33 sec + +100% tests passed, 0 tests failed out of 5 + +Total Test time (real) = 1.92 sec +\endcode + +\section Testing_Walkthroughs Unit Test Example Walkthroughs + +\subsection Testing_Python_Walkthrough Python Unit Test Example Walkthrough + +The following simple walkthrough describes the basic steps for adding a new +"testUsdGeomMyFeature" Python unit test to the usdGeom module. + +We add our Python test code by creating a new Python script, +testUsdGeomMyFeature.py, in `pxr/usd/usdGeom/testenv/`. + +\code{.py} +#!/pxrpythonsubst +# +# Copyright 2024 Pixar +# +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. + +import unittest + +from pxr import Vt, Gf, Sdf, Usd, UsdGeom + +class TestUsdGeomMyFeature(unittest.TestCase): + + def test_MyFeaturePart1(self): + stage = Usd.Stage.CreateInMemory() + + # ...various test and verification code... + # Use unittest asserts (assertTrue, assertFalse, assertEquals, etc) + # for verifying test conditions + self.assertTrue(myTestCondition) + + # ...more test methods as needed... + +if __name__ == "__main__": + unittest.main() +\endcode + +We create a testUsdGeomMyFeature directory in `testenv/` for any test resources, +such as USD files, images, etc. We configure CTest to copy test resources from +this directory by adding the following to `pxr/usd/usdGeom/CMakeLists.txt`. + +\code{.unparsed} +pxr_install_test_dir( + SRC testenv/testUsdGeomMyFeature + DEST testUsdGeomMyFeature +) +\endcode + +In CMakeLists.txt we register our new test by adding the following registration +steps: + +\code{.unparsed} +pxr_register_test(testUsdGeomMyFeature + PYTHON + COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdGeomMyFeature" + EXPECTED_RETURN_CODE 0 +) +\endcode + +We then add our test to `pxr_test_scripts`: + +\code{.unparsed} +pxr_test_scripts( + ... + testenv/testUsdGeomMyFeature.py +) +\endcode + +At this point, we can now build USD with our new test: + +\code{.unparsed} +$ python3 build_scripts/build_usd.py /my-build-directory --no-examples --no-tutorials --tools --python --no-docs --tests + ... + Building Shared libraries + Variant Release + Target native + Imaging On + Ptex support: Off + OpenVDB support: Off + OpenImageIO support: On + OpenColorIO support: Off + PRMan support: Off + UsdImaging On + usdview: On + MaterialX support On + Python support On + Python Debug: Off + Python docs: Off + Documentation Off + Tests On + ... +\endcode + +Once the build is complete and we've set the appropriate environment variables +(`PYTHONPATH` and `PATH`) for our build, we can cd to our build directory and +run our test: + +\code{.unparsed} +$ cd /my-build-directory/build/USD +$ ctest -C Release -R testUsdGeomMyFeature +Test project /my-build-directory/build/USD + Start 501: testUsdGeomMyFeature +1/1 Test #501: testUsdGeomMyFeature ............. Passed 0.48 sec + +100% tests passed, 0 tests failed out of 1 + +Total Test time (real) = 0.53 sec +\endcode + +\subsection Testing_CPP_Walkthrough C++ Unit Test Example Walkthrough + +The following simple walkthrough describes the basic steps for adding a new +"testUsdGeomMyFeature" C++ unit test to the usdGeom module. + +We start by adding our C++ test code to a new testUsdGeomMyFeature.cpp file in +`pxr/usd/usdGeom/testenv/`. + +\code{.c} +// +// Copyright 2024 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// + +#include "pxr/pxr.h" +#include "pxr/usd/usd/stage.h" +#include "pxr/usd/sdf/layer.h" +#include "pxr/base/vt/value.h" +#include "pxr/base/arch/fileSystem.h" +// ...other includes as needed... + +PXR_NAMESPACE_USING_DIRECTIVE + +void +TestMyFeature() +{ + // ...various test and verification code... + // You can use Tf macros like TF_VERIFY to verify test conditions + TF_VERIFY(myTestCondition); +} + +int main() +{ + TestMyFeature(); + + printf("\n\n>>> Test SUCCEEDED\n"); +} +\endcode + +We create a testUsdGeomMyFeature directory in `testenv/` for any test resources, +such as USD files, images, etc. We configure CTest to copy test resources from +this directory by adding the following to `pxr/usd/usdGeom/CMakeLists.txt`. + +\code{.unparsed} +pxr_install_test_dir( + SRC testenv/testUsdGeomMyFeature + DEST testUsdGeomMyFeature +) +\endcode + +In CMakeLists.txt we register our new test by adding the following registration +steps: + +\code{.unparsed} +pxr_register_test(testUsdGeomMyFeature + COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdGeomMyFeature" + EXPECTED_RETURN_CODE 0 +) +\endcode + +We add the build steps for our test to CMakeLists.txt using `pxr_build_test`: + +\code{.unparsed} +pxr_build_test(testUsdGeomMyFeature + LIBRARIES + usd + usdGeom + CPPFILES + testenv/testUsdGeomMyFeature.cpp +) +\endcode + +At this point, we can now build USD with our new test: + +\code{.unparsed} +$ python3 build_scripts/build_usd.py /my-build-directory --no-examples --no-tutorials --tools --python --no-docs --tests + + ... + Building Shared libraries + Variant Release + Target native + Imaging On + Ptex support: Off + OpenVDB support: Off + OpenImageIO support: On + OpenColorIO support: Off + PRMan support: Off + UsdImaging On + usdview: On + MaterialX support On + Python support On + Python Debug: Off + Python docs: Off + Documentation Off + Tests On + ... +\endcode + +Once the build is complete and we've set the appropriate environment variables +(`PYTHONPATH` and `PATH`) for our build, we can cd to our build directory and +run our test: + +\code{.unparsed} +$ cd /my-build-directory/build/USD +$ ctest -C Release -R testUsdGeomMyFeature +Test project /my-build-directory/build/USD + Start 501: testUsdGeomMyFeature +1/1 Test #501: testUsdGeomMyFeature ............. Passed 0.48 sec + +100% tests passed, 0 tests failed out of 1 + +Total Test time (real) = 0.53 sec +\endcode + +\section Testing_Expectations Test Expectations for Open Source Submissions + +Please include unit tests for your changes in your submission. Don't forget to +include any additional resources (USD files, image files, etc) that your tests +use with your submission. + +Please make sure all unit tests are passing (including any tests you have added) +before submitting a PR. Note that currently the USD github CI/CD for PRs only +does verification builds and does not run tests. Please run and verify tests on +all platforms (Linux, macOS, Windows) if possible. + +If you do any additional testing, using your own test integrations, please note +the types of tests run and their results in the comments submitted with your +commits/PRs. This helps inform code reviewers and helps with troubleshooting +down the line. + +For submissions, Pixar will run an internal suite of tests to try to find +correctness or performance regressions before code is checked into the central +code repository. These tests often take several hours to complete. If test +issues crop up, a Pixar developer will do initial research into the errors and +reach out for help if needed. + +*/ \ No newline at end of file diff --git a/docs/doxygen/developer_guides.dox b/docs/doxygen/developer_guides.dox index 084691d514..7942726e80 100644 --- a/docs/doxygen/developer_guides.dox +++ b/docs/doxygen/developer_guides.dox @@ -1,13 +1,18 @@ /*! \page Developer_Guides Developer Guides -\section Developer_Guides_Hydra Hydra Guides +General Guidelines + +- \subpage Page_Coding_Guidelines +- \subpage Page_Testing_Guidelines + +Hydra Guides - \subpage Page_Hydra_Getting_Started_Guide - \subpage Page_Hydra_Scene_Browser - \subpage Page_Hydra_Prim_Schemas -\section Developer_Guides_MaterialX MaterialX Guides +MaterialX Guides - \subpage Page_MaterialX_In_Hydra_USD diff --git a/docs/doxygen/externalOverview.dox b/docs/doxygen/externalOverview.dox index 60ae3d09a3..3f410a5d85 100644 --- a/docs/doxygen/externalOverview.dox +++ b/docs/doxygen/externalOverview.dox @@ -28,7 +28,7 @@ or jump directly into the core of the \ref usd_page_front "Usd API."
-USD is distributed under a modified Apache 2.0 license +USD is distributed under the TOST license */ /*! diff --git a/docs/glossary.rst b/docs/glossary.rst index fbad4e4bfd..ded8b663d9 100644 --- a/docs/glossary.rst +++ b/docs/glossary.rst @@ -571,6 +571,10 @@ down the asset into meaningful groups) with other collections. We create and query Collections using :usdcpp:`UsdCollectionAPI`. +For more details on Collections, including pattern-based collections that use +a path expression to determine collection membership, +see :ref:`collections_and_patterns`.` + .. _usdglossary-component: Component diff --git a/docs/intro.rst b/docs/intro.rst index 43f09a1d75..03305bbb50 100644 --- a/docs/intro.rst +++ b/docs/intro.rst @@ -33,9 +33,8 @@ In addition, because USD's core scenegraph and :ref:`composition engine extended in a maintainable way to encode and compose data in other domains. Concretely, USD is an `open source project -`_ released under a `modified -Apache license -`_. +`_ released under the +`TOST license `_. Why use USD? ============ diff --git a/docs/plugins_renderman.rst b/docs/plugins_renderman.rst index 77ca3481ef..fecb224ca0 100644 --- a/docs/plugins_renderman.rst +++ b/docs/plugins_renderman.rst @@ -83,6 +83,12 @@ variables. We'll refer to the install location of your USD build with * - :envvar:`RMAN_TEXTUREPATH` - Search path for textures and RenderMan Rtx plugins - :filename:`$RMANTREE/lib/textures:$RMANTREE/lib/plugins:/plugin/usd` + * - :envvar:`RMAN_DISPLAYPATH` + - Search path for Renderman display plugins + - :filename:`$RMANTREE/lib/plugins` + * - :envvar:`RMAN_PROCEDURALPATH` + - Search path for Renderman procedural plugins + - :filename:`$RMANTREE/lib/plugins` Developer ######### diff --git a/docs/python/convertDoxygen.py b/docs/python/convertDoxygen.py index 680d294370..f1073f897e 100644 --- a/docs/python/convertDoxygen.py +++ b/docs/python/convertDoxygen.py @@ -1,26 +1,8 @@ # # Copyright 2023 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. -# +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # # convertDoxygen.py # diff --git a/docs/python/doxygenlib/cdDocElement.py b/docs/python/doxygenlib/cdDocElement.py index 0215a51880..c2c82f0bf7 100644 --- a/docs/python/doxygenlib/cdDocElement.py +++ b/docs/python/doxygenlib/cdDocElement.py @@ -1,26 +1,8 @@ # # Copyright 2023 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. -# +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # # cdDocElement.py # diff --git a/docs/python/doxygenlib/cdParser.py b/docs/python/doxygenlib/cdParser.py index 78cdc335d0..c0d5b23c24 100644 --- a/docs/python/doxygenlib/cdParser.py +++ b/docs/python/doxygenlib/cdParser.py @@ -1,26 +1,8 @@ # # Copyright 2023 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. -# +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # # cdParser.py # diff --git a/docs/python/doxygenlib/cdUtils.py b/docs/python/doxygenlib/cdUtils.py index 7ef9a7e502..5f1d55656a 100644 --- a/docs/python/doxygenlib/cdUtils.py +++ b/docs/python/doxygenlib/cdUtils.py @@ -1,26 +1,8 @@ # # Copyright 2023 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. -# +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # # cdUtils.py # diff --git a/docs/python/doxygenlib/cdWriterDocstring.py b/docs/python/doxygenlib/cdWriterDocstring.py index 8ccf771a02..7cb4d58144 100644 --- a/docs/python/doxygenlib/cdWriterDocstring.py +++ b/docs/python/doxygenlib/cdWriterDocstring.py @@ -1,26 +1,8 @@ # # Copyright 2023 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. -# +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # # cdWriterDocstring.py # diff --git a/docs/python/genSchemaDocs.py b/docs/python/genSchemaDocs.py new file mode 100644 index 0000000000..2960d72782 --- /dev/null +++ b/docs/python/genSchemaDocs.py @@ -0,0 +1,617 @@ +#!/pxrpythonsubst +# +# Copyright 2024 Pixar +# +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. +# +""" +This script generates Sphinx documentation (in "Myst" Markdown form) +for USD schemas with user documentation content. It takes as input +a schema's "schemaUserDoc.usda" (and path) and produces markdown content +with the schema class and property docs, along with any overview documentation +(if provided by the schema). +""" + +import sys +import os +from argparse import ArgumentParser +import re +import shutil +import datetime +from collections import namedtuple + +# Need to set the environment variable for disabling the schema registry's +# loading of schema type prim definitions before importing any pxr libraries, +# otherwise this setting won't take. We disable this to make sure we don't try +# to load generatedSchema.usda files (which usdGenSchema generates) during +# our processing of schema definitions, to ensure this script is really only +# looking at our loaded schema.usda / schemaUserDoc.usda information. +os.environ["USD_DISABLE_PRIM_DEFINITIONS_FOR_USDGENSCHEMA"] = "1" +from pxr import Ar, Plug, Sdf, Usd, Vt, Tf + +#------------------------------------------------------------------------------# +# Tokens # +#------------------------------------------------------------------------------# + +# Name of script, e.g. "genSchemaDocs" +PROGRAM_NAME = os.path.splitext(os.path.basename(sys.argv[0]))[0] + +# Custom metadata tokens for user doc +USERDOC_BRIEF = "userDocBrief" +USERDOC_FULL = "userDoc" + +SCHEMAUSERDOC_FILENAME = "schemaUserDoc.usda" +SCHEMA_FILENAME = "schema.usda" +SCHEMAUSERDOC_DIRNAME = "userDoc" + +#------------------------------------------------------------------------------# +# Helper classes # +#------------------------------------------------------------------------------# + +class _Printer(): + """ + Object used for printing. This gives us a way to control output with regards + to program arguments such as --quiet. + """ + def __init__(self, quiet=False): + self._quiet = quiet + + def __PrintImpl(self, stream, *args): + if len(args): + print(*args, file=stream) + else: + print(file=stream) + + def __call__(self, *args): + if not self._quiet: + self.__PrintImpl(sys.stdout, *args) + + def Err(self, *args): + self.__PrintImpl(sys.stderr, *args) + + def SetQuiet(self, quiet): + self._quiet = quiet + +Print = _Printer() + +# Named tuple to hold data needed to document a property +_PropertyData = namedtuple("_PropertyData", + "name className doc valueType defaultValue") + +class _SchemaDoc: + """ + Convenience data class for schema class userDoc + """ + def __init__(self, schemaDomain, schemaName, userDoc): + self.schemaDomain = schemaDomain + self.schemaName = schemaName + self.userDoc = userDoc + self.propertyDoc = {} + self.resourceFiles = [] + resourceFiles = _GetResourceFilesFromMarkdownString(userDoc) + self.resourceFiles.extend(resourceFiles) + self.markdownWriter = _SchemaDocMarkdownGenerator(self.schemaDomain, + self.schemaName) + self.inheritsList = [] + + def SetInheritsList(self, inheritsClassList): + """ + Set the inherits list for this schema + """ + self.inheritsList = list(inheritsClassList) + + def AddPropertyDoc(self, className, propertyName, propertyDoc, propertyType, + defaultValue): + """ + Add the userDoc for a property. className refers to the class where + the property was defined, and helps track inherited properties. + """ + if className not in self.propertyDoc: + self.propertyDoc[className] = {} + self.propertyDoc[className][propertyName] = _PropertyData(propertyName, + className, propertyDoc, propertyType, defaultValue) + # Extract image/resource files in propertyDoc, if any + resourceFiles = _GetResourceFilesFromMarkdownString(propertyDoc) + self.resourceFiles.extend(resourceFiles) + + def WriteMystMarkdownFile(self, filepath): + """ + Write schema class and property user doc to "schema.md" Myst markdown file + Returns path+filename to written file + """ + # For now, writing as basic markdown. If we need additional features + # (e.g. tables, etc), consider using https://python-markdown.github.io/ + filename = os.path.join(os.path.abspath(filepath), self.schemaName + ".md") + try: + with open(filename, 'w') as file: + self.markdownWriter.WriteHeader(file) + self.markdownWriter.WriteSchema(file, self.userDoc) + if len(self.propertyDoc) > 0: + self.markdownWriter.WritePropertiesTitle(file) + # List non-inherited properties first (if any) + if self.schemaName in self.propertyDoc: + nonInheritedProps = self.propertyDoc[self.schemaName] + for prop in sorted(nonInheritedProps): + self.markdownWriter.WriteProperty(file, nonInheritedProps[prop]) + # Followed by list of inherited properties (again, if any) + if len(self.propertyDoc) > 1 or (len(self.propertyDoc) == 1 and + self.schemaName not in self.propertyDoc): + # Add in inherits hierarchy order + for inheritsClass in self.inheritsList: + if inheritsClass in self.propertyDoc: + self.markdownWriter.WriteInheritedPropertiesTitle( + file, inheritsClass) + for prop in sorted(self.propertyDoc[inheritsClass]): + self.markdownWriter.WriteProperty( + file, self.propertyDoc[inheritsClass][prop]) + # Add any "unknown" at the end? + if "unknown" in self.propertyDoc: + self.markdownWriter.WriteInheritedPropertiesTitle( + file, "unknown") + for prop in sorted(self.propertyDoc["unknown"]): + self.markdownWriter.WriteProperty( + file, self.propertyDoc["unknown"][prop]) + except IOError as openException: + Print.Err("Failed to write to " + filename + ": " + str(openException)) + return filename + + def GetResourceFiles(self): + """ + Returns a list of discovered resource files, such as images, referenced + in class or property userdoc + """ + return self.resourceFiles + + +class _SchemaDocMarkdownGenerator: + """ + Utility class for writing data from a _SchemaDoc to a Myst Markdown file + """ + def __init__(self, schemaDomain, schemaName): + self.schemaDomain = schemaDomain + self.schemaName = schemaName + + def __WriteSphinxLabel(self, file, labelString): + """ + Writes a Sphinx/RST-style label to the file, which for Myst Markdown + is a line on its own of the format "(labelString)=" + Note that in most circumstances you need to place the label _before_ + a header for Sphinx to use it (as an anchor) + """ + label = "(" + labelString + ")=" + file.write("\n" + label + "\n") + + def WriteHeader(self, file): + """ + Write "header" markdown content (non-rendered file metadata) + """ + # Write "comments" + workStr = ("% WARNING: THIS FILE IS GENERATED BY " + PROGRAM_NAME + + ". DO NOT EDIT.\n") + file.write(workStr) + workStr = "% Generated: " + datetime.datetime.now().strftime( + "%I:%M%p on %B %d, %Y") + "\n\n" + file.write(workStr) + + def WriteSchema(self, file, schemaUserDoc): + """ + Write markdown content for schema class (but not its properties) + """ + # Add a label for the schema for other files to link/refer to + # This needs to come before the header + #workStr = self.schemaDomain + "_" + self.schemaName + workStr = self.schemaName + self.__WriteSphinxLabel(file, workStr) + # Write main title of page, which is the schema name + workStr = "# " + self.schemaName + "\n" + file.write(workStr) + workStr = "\n" + schemaUserDoc + "\n" + file.write(workStr) + # Add an in-page TOC for convenience + workStr = "```{contents}\n" + file.write(workStr) + workStr = ":depth: 2\n" + file.write(workStr) + workStr = ":local:\n" + file.write(workStr) + workStr = ":backlinks: none\n" + file.write(workStr) + workStr = "```\n" + file.write(workStr) + + def WritePropertiesTitle(self, file): + """ + Write markdown for properties section title + """ + workStr = self.schemaName + "_properties" + self.__WriteSphinxLabel(file, workStr) + workStr = "\n" + "## Properties" + "\n" + file.write(workStr) + + def WriteInheritedPropertiesTitle(self, file, parentClass): + """ + Write markdown for inherited properties section title + Adds Sphinx reference to parentClass + """ + workStr = self.schemaName + "_inheritedproperties_" + parentClass + self.__WriteSphinxLabel(file, workStr) + workStr = "\n" + "## Inherited Properties (" + workStr += "{ref}`" + parentClass + "`" + workStr += ")" + "\n" + file.write(workStr) + + def WriteProperty(self, file, propData): + """ + Write markdown content for a schema property + """ + # Add a label for the property for linking/referring to + # note that this must come before the header for the property + workStr = self.schemaName + "_" + propData.name + self.__WriteSphinxLabel(file, workStr) + # Write a header for the property + workStr = "\n### " + propData.name + "\n" + file.write(workStr) + # Check if valueType is "rel" and note that the property is + # really a relationship + if propData.valueType == "rel": + workStr = ("\n**USD type**: `" + str(propData.valueType) + + "` (relationship)\n") + else: + workStr = ("\n**USD type**: `" + str(propData.valueType) + "`\n") + file.write(workStr) + if propData.defaultValue is not None: + workStr = ("\n**Fallback value**: `" + str(propData.defaultValue) + + "`\n") + file.write(workStr) + workStr = "\n" + propData.doc + "\n" + file.write(workStr) + +#------------------------------------------------------------------------------# +# Helper functions # +#------------------------------------------------------------------------------# + +def _GetResourceFilesFromMarkdownString(markdown): + """ + Scans markdown string for any referenced local resource files (e.g. images) + and returns list of any files found. Used to determine what image files + might need to get copied over to output dir + """ + imageFileList = [] + # Look for markdown-style image links of the format: ![link text](image link) + # via this regex: !\[[^\]]*\]\((.*?)\s*\) + imageMatches = re.findall(r'!\[[^\]]*\]\((.*?)\s*\)', markdown) + for match in imageMatches: + # We're only looking for local image files, so skip any URLs + if not match.startswith("http"): + imageFileList.append(match) + # We ignore HTML-style image links, as these most likely point to URLs, + # not local files + # Eventually we will also look for other possible resources: + # - Videos: through
+ : , } ) @@ -82,8 +80,7 @@ def "Model_3" ( } } -# This case exercises a relocation that would move the prim to be a -# descendant of a different root prim. +# This case exercises a relocation that would move from a root prim. # This is a composition error and the relocation is ignored. # def "Model_4" ( @@ -104,25 +101,3 @@ def "Model_4" ( } } } - -# This case exercises a relocations that would move to or from root prims. -# These are composition errors and the relocations are ignored. -# -def "Model_5" ( - add references = @./model.sdf@ -) -{ - over "LocalClass" - { - def Scope "Test" - { - } - } - - over "Instance" - { - over "Test" - { - } - } -} diff --git a/pxr/usd/pcp/testenv/testPcpMuseum_ErrorInvalidAuthoredRelocates.testenv/baseline/compositionErrors_ErrorInvalidAuthoredRelocates.txt b/pxr/usd/pcp/testenv/testPcpMuseum_ErrorInvalidAuthoredRelocates.testenv/baseline/compositionErrors_ErrorInvalidAuthoredRelocates.txt index 019bf88df8..cf433bebfb 100644 --- a/pxr/usd/pcp/testenv/testPcpMuseum_ErrorInvalidAuthoredRelocates.testenv/baseline/compositionErrors_ErrorInvalidAuthoredRelocates.txt +++ b/pxr/usd/pcp/testenv/testPcpMuseum_ErrorInvalidAuthoredRelocates.testenv/baseline/compositionErrors_ErrorInvalidAuthoredRelocates.txt @@ -4,7 +4,5 @@ Errors while computing Layer Stack Relocation from to authored at @ErrorInvalidAuthoredRelocates/root.sdf@ is invalid and will be ignored: The target of a relocate cannot be the same as its source. Relocation from to authored at @ErrorInvalidAuthoredRelocates/root.sdf@ is invalid and will be ignored: The target of a relocate cannot be an ancestor of its source. Relocation from to authored at @ErrorInvalidAuthoredRelocates/root.sdf@ is invalid and will be ignored: The target of a relocate cannot be a descendant of its source. -Relocation from to authored at @ErrorInvalidAuthoredRelocates/root.sdf@ is invalid and will be ignored: Prims cannot be relocated to be a descendant of a different root prim. -Relocation from to authored at @ErrorInvalidAuthoredRelocates/root.sdf@ is invalid and will be ignored: Root prims cannot be the source or target of a relocate. -Relocation from to authored at @ErrorInvalidAuthoredRelocates/root.sdf@ is invalid and will be ignored: Root prims cannot be the source or target of a relocate. +Relocation from to authored at @ErrorInvalidAuthoredRelocates/root.sdf@ is invalid and will be ignored: Root prims cannot be the source of a relocate. diff --git a/pxr/usd/pcp/testenv/testPcpMuseum_ErrorInvalidAuthoredRelocates.testenv/baseline/compositionResults_ErrorInvalidAuthoredRelocates.txt b/pxr/usd/pcp/testenv/testPcpMuseum_ErrorInvalidAuthoredRelocates.testenv/baseline/compositionResults_ErrorInvalidAuthoredRelocates.txt index 1f5c10ceaa..26c9240d22 100644 --- a/pxr/usd/pcp/testenv/testPcpMuseum_ErrorInvalidAuthoredRelocates.testenv/baseline/compositionResults_ErrorInvalidAuthoredRelocates.txt +++ b/pxr/usd/pcp/testenv/testPcpMuseum_ErrorInvalidAuthoredRelocates.testenv/baseline/compositionResults_ErrorInvalidAuthoredRelocates.txt @@ -184,48 +184,3 @@ Prim Stack: root.sdf /Model_4/Instance/Test root.sdf /Model_4/LocalClass/Test ------------------------------------------------------------------------- -Results for composing - -Prim Stack: - root.sdf /Model_5 - model.sdf /Model - -Child names: - ['LocalClass', 'Instance'] - ------------------------------------------------------------------------- -Results for composing - -Prim Stack: - root.sdf /Model_5/LocalClass - model.sdf /Model/LocalClass - -Child names: - ['Test'] - ------------------------------------------------------------------------- -Results for composing - -Prim Stack: - root.sdf /Model_5/LocalClass/Test - ------------------------------------------------------------------------- -Results for composing - -Prim Stack: - root.sdf /Model_5/Instance - root.sdf /Model_5/LocalClass - model.sdf /Model/Instance - model.sdf /Model/LocalClass - -Child names: - ['Test'] - ------------------------------------------------------------------------- -Results for composing - -Prim Stack: - root.sdf /Model_5/Instance/Test - root.sdf /Model_5/LocalClass/Test - diff --git a/pxr/usd/pcp/testenv/testPcpMuseum_ErrorInvalidConflictingRelocates.testenv/ErrorInvalidConflictingRelocates/model.sdf b/pxr/usd/pcp/testenv/testPcpMuseum_ErrorInvalidConflictingRelocates.testenv/ErrorInvalidConflictingRelocates/model.sdf index 76bd672150..1c8bc60f90 100644 --- a/pxr/usd/pcp/testenv/testPcpMuseum_ErrorInvalidConflictingRelocates.testenv/ErrorInvalidConflictingRelocates/model.sdf +++ b/pxr/usd/pcp/testenv/testPcpMuseum_ErrorInvalidConflictingRelocates.testenv/ErrorInvalidConflictingRelocates/model.sdf @@ -24,3 +24,22 @@ def Prim "Model" } } } + +def Prim "OtherModel" +{ + def Prim "A" + { + def Prim "B" + { + def Prim "C" + { + def Prim "D" + { + def Prim "E" + { + } + } + } + } + } +} \ No newline at end of file diff --git a/pxr/usd/pcp/testenv/testPcpMuseum_ErrorInvalidConflictingRelocates.testenv/ErrorInvalidConflictingRelocates/root.sdf b/pxr/usd/pcp/testenv/testPcpMuseum_ErrorInvalidConflictingRelocates.testenv/ErrorInvalidConflictingRelocates/root.sdf index abe673879c..4c9c5160a8 100644 --- a/pxr/usd/pcp/testenv/testPcpMuseum_ErrorInvalidConflictingRelocates.testenv/ErrorInvalidConflictingRelocates/root.sdf +++ b/pxr/usd/pcp/testenv/testPcpMuseum_ErrorInvalidConflictingRelocates.testenv/ErrorInvalidConflictingRelocates/root.sdf @@ -9,15 +9,29 @@ relocates = { : , : , + : , : , + : , : , : , + : , : , + : , - : + : , + + : , + : , + : , + : , + : , + + : , + : , + : , } ) @@ -26,7 +40,7 @@ # and both are ignored. # def "Model_1" ( - add references = @./model.sdf@ + references = @./model.sdf@ ) { over "LocalClass" @@ -49,7 +63,7 @@ def "Model_1" ( # for both relocates and both are ignored. # def "Model_2" ( - add references = @./model.sdf@ + references = @./model.sdf@ ) { over "LocalClass" @@ -74,7 +88,7 @@ def "Model_2" ( # found and reported. # def "Model_3" ( - add references = @./model.sdf@ + references = @./model.sdf@ ) { over "LocalClass" @@ -96,7 +110,7 @@ def "Model_3" ( # former relocate will report an error and be ignored. # def "Model_4" ( - add references = @./model.sdf@ + references = @./model.sdf@ ) { over "LocalClass" @@ -118,7 +132,7 @@ def "Model_4" ( # former relocate will report an error and be ignored. # def "Model_5" ( - add references = @./model.sdf@ + references = @./model.sdf@ ) { over "LocalClass" @@ -134,3 +148,29 @@ def "Model_5" ( } } } + +# This case exercises relocates on individual prims down a namespace +# hierarchy using alternating "most relocated" source paths and +# "original source" source paths. Relocates using original source paths +# are rejected when a "more relocated" path exists. But legacy relocates +# allow this to work. This case is to demonstrate these behavior +# differences. +def "OtherModel_1" ( + references = @./model.sdf@ +) +{ +} + +# This case exercises two different relocates on where their source paths +# are an ancestrally relocated and that path's "original source" path. +# The relocate with the original source path is an error and is rejected. +# But legacy relocates don't automatically reject original source paths and +# ends up processing two different relocates from the same effective source +# path (just represented differently) This case is to demonstrate that legacy +# relocates still chooses a single relocate for shared source though it +# doesn't log an official error. +def "OtherModel_2" ( + references = @./model.sdf@ +) +{ +} \ No newline at end of file diff --git a/pxr/usd/pcp/testenv/testPcpMuseum_ErrorInvalidConflictingRelocates.testenv/baseline/compositionErrors_ErrorInvalidConflictingRelocates.txt b/pxr/usd/pcp/testenv/testPcpMuseum_ErrorInvalidConflictingRelocates.testenv/baseline/compositionErrors_ErrorInvalidConflictingRelocates.txt index 7a15b47b17..a5dc62b926 100644 --- a/pxr/usd/pcp/testenv/testPcpMuseum_ErrorInvalidConflictingRelocates.testenv/baseline/compositionErrors_ErrorInvalidConflictingRelocates.txt +++ b/pxr/usd/pcp/testenv/testPcpMuseum_ErrorInvalidConflictingRelocates.testenv/baseline/compositionErrors_ErrorInvalidConflictingRelocates.txt @@ -9,4 +9,8 @@ Relocation from to authored at Relocation from to authored at @ErrorInvalidConflictingRelocates/root.sdf@ conflicts with another relocation from to authored at @ErrorInvalidConflictingRelocates/root.sdf@ and will be ignored: The source of a relocate cannot be the target of another relocate in the same layer stack. Relocation from to authored at @ErrorInvalidConflictingRelocates/root.sdf@ conflicts with another relocation from to authored at @ErrorInvalidConflictingRelocates/root.sdf@ and will be ignored: The source of a relocate cannot be a descendant of the source of another relocate. Relocation from to authored at @ErrorInvalidConflictingRelocates/root.sdf@ conflicts with another relocation from to authored at @ErrorInvalidConflictingRelocates/root.sdf@ and will be ignored: The target of a relocate cannot be a descendant of the source of another relocate. +Relocation from to authored at @ErrorInvalidConflictingRelocates/root.sdf@ conflicts with another relocation from to authored at @ErrorInvalidConflictingRelocates/root.sdf@ and will be ignored: The source of a relocate cannot be a descendant of the source of another relocate. +Relocation from to authored at @ErrorInvalidConflictingRelocates/root.sdf@ conflicts with another relocation from to authored at @ErrorInvalidConflictingRelocates/root.sdf@ and will be ignored: The source of a relocate cannot be a descendant of the source of another relocate. +Relocation from to authored at @ErrorInvalidConflictingRelocates/root.sdf@ conflicts with another relocation from to authored at @ErrorInvalidConflictingRelocates/root.sdf@ and will be ignored: The source of a relocate cannot be a descendant of the source of another relocate. +Relocation from to authored at @ErrorInvalidConflictingRelocates/root.sdf@ conflicts with another relocation from to authored at @ErrorInvalidConflictingRelocates/root.sdf@ and will be ignored: The source of a relocate cannot be a descendant of the source of another relocate. diff --git a/pxr/usd/pcp/testenv/testPcpMuseum_ErrorInvalidConflictingRelocates.testenv/baseline/compositionErrors_ErrorInvalidConflictingRelocates_Legacy.txt b/pxr/usd/pcp/testenv/testPcpMuseum_ErrorInvalidConflictingRelocates.testenv/baseline/compositionErrors_ErrorInvalidConflictingRelocates_Legacy.txt new file mode 100644 index 0000000000..72b89297c6 --- /dev/null +++ b/pxr/usd/pcp/testenv/testPcpMuseum_ErrorInvalidConflictingRelocates.testenv/baseline/compositionErrors_ErrorInvalidConflictingRelocates_Legacy.txt @@ -0,0 +1,6 @@ +------------------------------------------------------------------------ +Errors while computing Layer Stack + +The path is the target of multiple relocations from different sources. The following relocates to this target are invalid and will be ignored: relocation from authored at @ErrorInvalidConflictingRelocates/root.sdf@; relocation from authored at @ErrorInvalidConflictingRelocates/root.sdf@. +The path is the target of multiple relocations from different sources. The following relocates to this target are invalid and will be ignored: relocation from authored at @ErrorInvalidConflictingRelocates/root.sdf@; relocation from authored at @ErrorInvalidConflictingRelocates/root.sdf@. + diff --git a/pxr/usd/pcp/testenv/testPcpMuseum_ErrorInvalidConflictingRelocates.testenv/baseline/compositionResults_ErrorInvalidConflictingRelocates.txt b/pxr/usd/pcp/testenv/testPcpMuseum_ErrorInvalidConflictingRelocates.testenv/baseline/compositionResults_ErrorInvalidConflictingRelocates.txt index dbe3208408..eba9a3662a 100644 --- a/pxr/usd/pcp/testenv/testPcpMuseum_ErrorInvalidConflictingRelocates.testenv/baseline/compositionResults_ErrorInvalidConflictingRelocates.txt +++ b/pxr/usd/pcp/testenv/testPcpMuseum_ErrorInvalidConflictingRelocates.testenv/baseline/compositionResults_ErrorInvalidConflictingRelocates.txt @@ -460,3 +460,116 @@ Results for composing Prim Stack: model.sdf /Model/Instance/InstanceChild/InstanceGrandChild +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + root.sdf /OtherModel_1 + model.sdf /OtherModel + +Child names: + ['W'] + +Prohibited child names: + ['A'] + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + model.sdf /OtherModel/A + +Child names: + ['X'] + +Prohibited child names: + ['B'] + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + model.sdf /OtherModel/A/B + +Child names: + ['C'] + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + model.sdf /OtherModel/A/B/C + +Child names: + ['D'] + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + model.sdf /OtherModel/A/B/C/D + +Child names: + ['E'] + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + model.sdf /OtherModel/A/B/C/D/E + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + root.sdf /OtherModel_2 + model.sdf /OtherModel + +Child names: + ['W', 'J'] + +Prohibited child names: + ['A'] + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + model.sdf /OtherModel/A + +Prohibited child names: + ['B'] + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + model.sdf /OtherModel/A/B + +Child names: + ['C'] + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + model.sdf /OtherModel/A/B/C + +Child names: + ['D'] + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + model.sdf /OtherModel/A/B/C/D + +Child names: + ['E'] + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + model.sdf /OtherModel/A/B/C/D/E + diff --git a/pxr/usd/pcp/testenv/testPcpMuseum_ErrorInvalidConflictingRelocates.testenv/baseline/compositionResults_ErrorInvalidConflictingRelocates_Legacy.txt b/pxr/usd/pcp/testenv/testPcpMuseum_ErrorInvalidConflictingRelocates.testenv/baseline/compositionResults_ErrorInvalidConflictingRelocates_Legacy.txt index e97f207d61..b4e00d6e00 100644 --- a/pxr/usd/pcp/testenv/testPcpMuseum_ErrorInvalidConflictingRelocates.testenv/baseline/compositionResults_ErrorInvalidConflictingRelocates_Legacy.txt +++ b/pxr/usd/pcp/testenv/testPcpMuseum_ErrorInvalidConflictingRelocates.testenv/baseline/compositionResults_ErrorInvalidConflictingRelocates_Legacy.txt @@ -55,27 +55,45 @@ Prim Stack: model.sdf /Model/LocalClass Child names: - ['Test'] + ['ClassChild', 'InstanceChild', 'Test'] -Prohibited child names: - ['ClassChild', 'InstanceChild'] +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + model.sdf /Model/LocalClass/ClassChild + +Child names: + ['ClassGrandChild'] ------------------------------------------------------------------------ -Results for composing +Results for composing + +Prim Stack: + model.sdf /Model/LocalClass/ClassChild/ClassGrandChild + +------------------------------------------------------------------------ +Results for composing Prim Stack: - root.sdf /Model_1/Instance/Test model.sdf /Model/Instance/InstanceChild Child names: ['InstanceGrandChild'] ------------------------------------------------------------------------ -Results for composing +Results for composing Prim Stack: model.sdf /Model/Instance/InstanceChild/InstanceGrandChild +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + root.sdf /Model_1/Instance/Test + root.sdf /Model_1/LocalClass/Test + ------------------------------------------------------------------------ Results for composing @@ -164,10 +182,7 @@ Prim Stack: model.sdf /Model Child names: - ['LocalClass', 'Instance'] - -Prohibited child names: - ['Test'] + ['LocalClass', 'Instance', 'Test'] ------------------------------------------------------------------------ Results for composing @@ -210,16 +225,47 @@ Prim Stack: model.sdf /Model/LocalClass Child names: - ['Test'] + ['ClassChild', 'Test'] Prohibited child names: - ['ClassChild', 'InstanceChild'] + ['InstanceChild'] + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + model.sdf /Model/LocalClass/ClassChild + +Child names: + ['ClassGrandChild'] + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + model.sdf /Model/LocalClass/ClassChild/ClassGrandChild ------------------------------------------------------------------------ Results for composing Prim Stack: root.sdf /Model_3/Instance/Test + root.sdf /Model_3/LocalClass/Test + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + model.sdf /Model/Instance/InstanceChild + +Child names: + ['InstanceGrandChild'] + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + model.sdf /Model/Instance/InstanceChild/InstanceGrandChild ------------------------------------------------------------------------ Results for composing @@ -387,7 +433,7 @@ Prim Stack: model.sdf /Model/Instance/InstanceChild Child names: - ['InstanceGrandChild', 'ClassChild'] + ['InstanceGrandChild'] ------------------------------------------------------------------------ Results for composing @@ -396,17 +442,124 @@ Prim Stack: model.sdf /Model/Instance/InstanceChild/InstanceGrandChild ------------------------------------------------------------------------ -Results for composing +Results for composing Prim Stack: - model.sdf /Model/LocalClass/ClassChild + root.sdf /OtherModel_1 + model.sdf /OtherModel Child names: - ['ClassGrandChild'] + ['W'] + +Prohibited child names: + ['A'] ------------------------------------------------------------------------ -Results for composing +Results for composing Prim Stack: - model.sdf /Model/LocalClass/ClassChild/ClassGrandChild + model.sdf /OtherModel/A + +Child names: + ['X'] + +Prohibited child names: + ['B'] + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + model.sdf /OtherModel/A/B + +Child names: + ['Y'] + +Prohibited child names: + ['C'] + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + model.sdf /OtherModel/A/B/C + +Child names: + ['Z'] + +Prohibited child names: + ['D'] + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + model.sdf /OtherModel/A/B/C/D + +Child names: + ['Foo'] + +Prohibited child names: + ['E'] + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + model.sdf /OtherModel/A/B/C/D/E + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + root.sdf /OtherModel_2 + model.sdf /OtherModel + +Child names: + ['W', 'J'] + +Prohibited child names: + ['A'] + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + model.sdf /OtherModel/A + +Prohibited child names: + ['B'] + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + model.sdf /OtherModel/A/B + +Child names: + ['C'] + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + model.sdf /OtherModel/A/B/C + +Child names: + ['D'] + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + model.sdf /OtherModel/A/B/C/D + +Child names: + ['E'] + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + model.sdf /OtherModel/A/B/C/D/E diff --git a/pxr/usd/pcp/testenv/testPcpMuseum_ErrorInvalidInstanceTargetPath.testenv/baseline/compositionErrors_ErrorInvalidInstanceTargetPath.txt b/pxr/usd/pcp/testenv/testPcpMuseum_ErrorInvalidInstanceTargetPath.testenv/baseline/compositionErrors_ErrorInvalidInstanceTargetPath.txt index 064d00a4a1..8050f72f37 100644 --- a/pxr/usd/pcp/testenv/testPcpMuseum_ErrorInvalidInstanceTargetPath.testenv/baseline/compositionErrors_ErrorInvalidInstanceTargetPath.txt +++ b/pxr/usd/pcp/testenv/testPcpMuseum_ErrorInvalidInstanceTargetPath.testenv/baseline/compositionErrors_ErrorInvalidInstanceTargetPath.txt @@ -13,22 +13,12 @@ The attribute connection from -Cycle detected: -@ErrorInvalidInstanceTargetPath/root.sdf@ -CANNOT inherit from: -@ErrorInvalidInstanceTargetPath/root.sdf@ - The attribute connection from in layer @ErrorInvalidInstanceTargetPath/ref.sdf@ is authored in a class but refers to an instance of that class. Ignoring. -The attribute connection from in layer @ErrorInvalidInstanceTargetPath/ref.sdf@ is authored in a class but refers to an instance of that class. Ignoring. +The attribute connection from in layer @ErrorInvalidInstanceTargetPath/ref.sdf@ is invalid. This may be because the path is the pre-relocated source path of a relocated prim. Ignoring. ------------------------------------------------------------------------ Errors while composing -Cycle detected: -@ErrorInvalidInstanceTargetPath/root.sdf@ -CANNOT inherit from: -@ErrorInvalidInstanceTargetPath/root.sdf@ - -The attribute connection from in layer @ErrorInvalidInstanceTargetPath/ref.sdf@ is authored in a class but refers to an instance of that class. Ignoring. +The attribute connection from in layer @ErrorInvalidInstanceTargetPath/ref.sdf@ is invalid. This may be because the path is the pre-relocated source path of a relocated prim. Ignoring. The attribute connection from in layer @ErrorInvalidInstanceTargetPath/ref.sdf@ is authored in a class but refers to an instance of that class. Ignoring. diff --git a/pxr/usd/pcp/testenv/testPcpMuseum_ErrorInvalidInstanceTargetPath.testenv/baseline/compositionErrors_ErrorInvalidInstanceTargetPath_usd.txt b/pxr/usd/pcp/testenv/testPcpMuseum_ErrorInvalidInstanceTargetPath.testenv/baseline/compositionErrors_ErrorInvalidInstanceTargetPath_usd.txt new file mode 100644 index 0000000000..c54a3b56c8 --- /dev/null +++ b/pxr/usd/pcp/testenv/testPcpMuseum_ErrorInvalidInstanceTargetPath.testenv/baseline/compositionErrors_ErrorInvalidInstanceTargetPath_usd.txt @@ -0,0 +1,22 @@ +------------------------------------------------------------------------ +Errors while composing + +The attribute connection from in layer @ErrorInvalidInstanceTargetPath/root.sdf@ refers to a path outside the scope of the inherit from . Ignoring. +The attribute connection from in layer @ErrorInvalidInstanceTargetPath/root.sdf@ is authored in a class but refers to an instance of that class. Ignoring. + +------------------------------------------------------------------------ +Errors while composing + +The attribute connection from in layer @ErrorInvalidInstanceTargetPath/root.sdf@ is authored in a class but refers to an instance of that class. Ignoring. +The attribute connection from in layer @ErrorInvalidInstanceTargetPath/root.sdf@ refers to a path outside the scope of the inherit from . Ignoring. + +------------------------------------------------------------------------ +Errors while composing + +The attribute connection from in layer @ErrorInvalidInstanceTargetPath/ref.sdf@ is authored in a class but refers to an instance of that class. Ignoring. + +------------------------------------------------------------------------ +Errors while composing + +The attribute connection from in layer @ErrorInvalidInstanceTargetPath/ref.sdf@ is authored in a class but refers to an instance of that class. Ignoring. + diff --git a/pxr/usd/pcp/testenv/testPcpMuseum_ErrorInvalidInstanceTargetPath.testenv/baseline/compositionResults_ErrorInvalidInstanceTargetPath_usd.txt b/pxr/usd/pcp/testenv/testPcpMuseum_ErrorInvalidInstanceTargetPath.testenv/baseline/compositionResults_ErrorInvalidInstanceTargetPath_usd.txt new file mode 100644 index 0000000000..9f715762f5 --- /dev/null +++ b/pxr/usd/pcp/testenv/testPcpMuseum_ErrorInvalidInstanceTargetPath.testenv/baseline/compositionResults_ErrorInvalidInstanceTargetPath_usd.txt @@ -0,0 +1,248 @@ +Loading @ErrorInvalidInstanceTargetPath/root.sdf@ + +------------------------------------------------------------------------ +Layer Stack: + root.sdf + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + root.sdf /ConnectionToLocalClass + +Child names: + ['LocalClass', 'Instance_1', 'Instance_2'] + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + root.sdf /ConnectionToLocalClass/LocalClass + +Property names: + ['x', 'y'] + +Property stacks: +/ConnectionToLocalClass/LocalClass.x: + root.sdf /ConnectionToLocalClass/LocalClass.x +/ConnectionToLocalClass/LocalClass.y: + root.sdf /ConnectionToLocalClass/LocalClass.y + +Attribute connections: +/ConnectionToLocalClass/LocalClass.x: + /ConnectionToLocalClass/Instance_1.y + /ConnectionToLocalClass/Instance_2.y + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + root.sdf /ConnectionToLocalClass/Instance_1 + root.sdf /ConnectionToLocalClass/LocalClass + +Property names: + ['x', 'y'] + +Property stacks: +/ConnectionToLocalClass/Instance_1.x: + root.sdf /ConnectionToLocalClass/LocalClass.x +/ConnectionToLocalClass/Instance_1.y: + root.sdf /ConnectionToLocalClass/LocalClass.y + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + root.sdf /ConnectionToLocalClass/Instance_2 + root.sdf /ConnectionToLocalClass/LocalClass + +Property names: + ['x', 'y'] + +Property stacks: +/ConnectionToLocalClass/Instance_2.x: + root.sdf /ConnectionToLocalClass/LocalClass.x +/ConnectionToLocalClass/Instance_2.y: + root.sdf /ConnectionToLocalClass/LocalClass.y + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + root.sdf /FaceRig + +Child names: + ['BrowRig', 'Anim'] + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + root.sdf /FaceRig/BrowRig + ref.sdf /BrowRig + +Child names: + ['SymBrow', 'LBrow', 'RBrow', 'Anim'] + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + ref.sdf /BrowRig/SymBrow + +Child names: + ['BrowInnUDPosBrowInnUDNeg_sculpt', 'Anim'] + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + ref.sdf /BrowRig/SymBrow/BrowInnUDPosBrowInnUDNeg_sculpt + +Property names: + ['amount'] + +Property stacks: +/FaceRig/BrowRig/SymBrow/BrowInnUDPosBrowInnUDNeg_sculpt.amount: + ref.sdf /BrowRig/SymBrow/BrowInnUDPosBrowInnUDNeg_sculpt.amount + +Attribute connections: +/FaceRig/BrowRig/SymBrow/BrowInnUDPosBrowInnUDNeg_sculpt.amount: + /FaceRig/Anim/Face/Eyes/RBrow.InnUD + /FaceRig/Anim/Face/Eyes/LBrow.InnUD + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + ref.sdf /BrowRig/SymBrow/Anim + +Child names: + ['Brow'] + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + ref.sdf /BrowRig/SymBrow/Anim/Brow + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + ref.sdf /BrowRig/LBrow + ref.sdf /BrowRig/SymBrow + +Child names: + ['BrowInnUDPosBrowInnUDNeg_sculpt', 'Anim'] + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + ref.sdf /BrowRig/SymBrow/BrowInnUDPosBrowInnUDNeg_sculpt + +Property names: + ['amount'] + +Property stacks: +/FaceRig/BrowRig/LBrow/BrowInnUDPosBrowInnUDNeg_sculpt.amount: + ref.sdf /BrowRig/SymBrow/BrowInnUDPosBrowInnUDNeg_sculpt.amount + +Attribute connections: +/FaceRig/BrowRig/LBrow/BrowInnUDPosBrowInnUDNeg_sculpt.amount: + /FaceRig/BrowRig/Anim/LBrow.InnUD + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + ref.sdf /BrowRig/SymBrow/Anim + +Prohibited child names: + ['Brow'] + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + ref.sdf /BrowRig/RBrow + ref.sdf /BrowRig/SymBrow + +Child names: + ['BrowInnUDPosBrowInnUDNeg_sculpt', 'Anim'] + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + ref.sdf /BrowRig/SymBrow/BrowInnUDPosBrowInnUDNeg_sculpt + +Property names: + ['amount'] + +Property stacks: +/FaceRig/BrowRig/RBrow/BrowInnUDPosBrowInnUDNeg_sculpt.amount: + ref.sdf /BrowRig/SymBrow/BrowInnUDPosBrowInnUDNeg_sculpt.amount + +Attribute connections: +/FaceRig/BrowRig/RBrow/BrowInnUDPosBrowInnUDNeg_sculpt.amount: + /FaceRig/BrowRig/Anim/RBrow.InnUD + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + ref.sdf /BrowRig/SymBrow/Anim + +Prohibited child names: + ['Brow'] + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + ref.sdf /BrowRig/Anim + +Prohibited child names: + ['LBrow', 'RBrow'] + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + root.sdf /FaceRig/Anim + +Child names: + ['Face'] + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + root.sdf /FaceRig/Anim/Face + +Child names: + ['Eyes'] + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + root.sdf /FaceRig/Anim/Face/Eyes + +Child names: + ['LBrow', 'RBrow'] + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + ref.sdf /BrowRig/SymBrow/Anim/Brow + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + ref.sdf /BrowRig/SymBrow/Anim/Brow + diff --git a/pxr/usd/pcp/testenv/testPcpMuseum_ErrorInvalidReferenceToRelocationSource.testenv/ErrorInvalidReferenceToRelocationSource/char.sdf b/pxr/usd/pcp/testenv/testPcpMuseum_ErrorInvalidReferenceToRelocationSource.testenv/ErrorInvalidReferenceToRelocationSource/char.sdf new file mode 100644 index 0000000000..93fe4f2af6 --- /dev/null +++ b/pxr/usd/pcp/testenv/testPcpMuseum_ErrorInvalidReferenceToRelocationSource.testenv/ErrorInvalidReferenceToRelocationSource/char.sdf @@ -0,0 +1,35 @@ +#sdf 1.4.32 +( + relocates = { + : , + } +) + +def "Char" ( + references = @model.sdf@ +) +{ + over "Relocated" + ( + doc = """Valid opinion at post-relocation path""" + ) + { + def "RelocatedChild" + { + } + } + + + over "PreRelo" + ( + doc = """Invalid opinion at pre-relocation path""" + ) + { + def "PreReloChild" + { + } + } + +} + + diff --git a/pxr/usd/pcp/testenv/testPcpMuseum_ErrorInvalidReferenceToRelocationSource.testenv/ErrorInvalidReferenceToRelocationSource/model.sdf b/pxr/usd/pcp/testenv/testPcpMuseum_ErrorInvalidReferenceToRelocationSource.testenv/ErrorInvalidReferenceToRelocationSource/model.sdf new file mode 100644 index 0000000000..14858f9b99 --- /dev/null +++ b/pxr/usd/pcp/testenv/testPcpMuseum_ErrorInvalidReferenceToRelocationSource.testenv/ErrorInvalidReferenceToRelocationSource/model.sdf @@ -0,0 +1,11 @@ +#sdf 1.4.32 + +def "Model" +{ + def "PreRelo" + { + def "ModelChild" + { + } + } +} diff --git a/pxr/usd/pcp/testenv/testPcpMuseum_ErrorInvalidReferenceToRelocationSource.testenv/ErrorInvalidReferenceToRelocationSource/root.sdf b/pxr/usd/pcp/testenv/testPcpMuseum_ErrorInvalidReferenceToRelocationSource.testenv/ErrorInvalidReferenceToRelocationSource/root.sdf new file mode 100644 index 0000000000..1412561e52 --- /dev/null +++ b/pxr/usd/pcp/testenv/testPcpMuseum_ErrorInvalidReferenceToRelocationSource.testenv/ErrorInvalidReferenceToRelocationSource/root.sdf @@ -0,0 +1,51 @@ +#sdf 1.4.32 +( + """ + These cases exercise invalid reference and relocation arcs to prim + paths that are prohibited for being the source of a relocation. + """ + + relocates = { + : , + : , + } +) + +def "Good_RefToRelocated" ( + doc = """Reference to post-relocation prim is allowed""" + references = @char.sdf@ +) +{ +} + +def "Good_RefToChildOfRelocated" ( + doc = """Reference to a child of post-relocation prim is allowed""" + references = @char.sdf@ +) +{ +} + +def "Bad_RefToPreRelo" ( + doc = """Reference to pre-relocation prim is invalid""" + references = @char.sdf@ +) +{ +} + +def "Bad_RefToChildOfPreRelo" ( + doc = """Reference to a child of pre-relocation prim is invalid""" + references = @char.sdf@ +) +{ +} + +def "ReferencedChar" ( + doc = """Reference to /Char for testing local relocations of pre + and post relocation children. The relocates in this layer + try to relocate the reference's relocated child, 'Relocated', + and its pre-relocation child 'PreRelo'. The former succeeds + while the latter emits a composition error.""" + references = @char.sdf@ +) +{ +} \ No newline at end of file diff --git a/pxr/usd/pcp/testenv/testPcpMuseum_ErrorInvalidReferenceToRelocationSource.testenv/baseline/compositionErrors_ErrorInvalidReferenceToRelocationSource.txt b/pxr/usd/pcp/testenv/testPcpMuseum_ErrorInvalidReferenceToRelocationSource.testenv/baseline/compositionErrors_ErrorInvalidReferenceToRelocationSource.txt new file mode 100644 index 0000000000..976558d5ac --- /dev/null +++ b/pxr/usd/pcp/testenv/testPcpMuseum_ErrorInvalidReferenceToRelocationSource.testenv/baseline/compositionErrors_ErrorInvalidReferenceToRelocationSource.txt @@ -0,0 +1,39 @@ +------------------------------------------------------------------------ +Errors while composing + +@ErrorInvalidReferenceToRelocationSource/root.sdf@ +CANNOT be relocated from: +@ErrorInvalidReferenceToRelocationSource/root.sdf@ +which is a prohibited child of its parent because it would require allowing opinions from the source of a relocation at @ErrorInvalidReferenceToRelocationSource/char.sdf@. + +------------------------------------------------------------------------ +Errors while composing + +The layer @ErrorInvalidReferenceToRelocationSource/char.sdf@ has an invalid opinion at the relocation source path , which will be ignored. + +------------------------------------------------------------------------ +Errors while composing + +The layer @ErrorInvalidReferenceToRelocationSource/char.sdf@ has an invalid opinion at the relocation source path , which will be ignored. + +------------------------------------------------------------------------ +Errors while composing + +The layer @ErrorInvalidReferenceToRelocationSource/char.sdf@ has an invalid opinion at the relocation source path , which will be ignored. + +------------------------------------------------------------------------ +Errors while composing + +@ErrorInvalidReferenceToRelocationSource/root.sdf@ +CANNOT reference: +@ErrorInvalidReferenceToRelocationSource/char.sdf@ +which is a prohibited child of its parent because it would require allowing opinions from the source of a relocation at @ErrorInvalidReferenceToRelocationSource/char.sdf@. + +------------------------------------------------------------------------ +Errors while composing + +@ErrorInvalidReferenceToRelocationSource/root.sdf@ +CANNOT reference: +@ErrorInvalidReferenceToRelocationSource/char.sdf@ +which is a prohibited child of its parent because it would require allowing opinions from the source of a relocation at @ErrorInvalidReferenceToRelocationSource/char.sdf@. + diff --git a/pxr/usd/pcp/testenv/testPcpMuseum_ErrorInvalidReferenceToRelocationSource.testenv/baseline/compositionResults_ErrorInvalidReferenceToRelocationSource.txt b/pxr/usd/pcp/testenv/testPcpMuseum_ErrorInvalidReferenceToRelocationSource.testenv/baseline/compositionResults_ErrorInvalidReferenceToRelocationSource.txt new file mode 100644 index 0000000000..5c3beee105 --- /dev/null +++ b/pxr/usd/pcp/testenv/testPcpMuseum_ErrorInvalidReferenceToRelocationSource.testenv/baseline/compositionResults_ErrorInvalidReferenceToRelocationSource.txt @@ -0,0 +1,86 @@ +Loading @ErrorInvalidReferenceToRelocationSource/root.sdf@ + +------------------------------------------------------------------------ +Layer Stack: + root.sdf + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + char.sdf /Char/Relocated + model.sdf /Model/PreRelo + +Child names: + ['ModelChild', 'RelocatedChild'] + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + model.sdf /Model/PreRelo/ModelChild + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + char.sdf /Char/Relocated/RelocatedChild + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + root.sdf /Good_RefToRelocated + char.sdf /Char/Relocated + model.sdf /Model/PreRelo + +Child names: + ['ModelChild', 'RelocatedChild'] + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + model.sdf /Model/PreRelo/ModelChild + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + char.sdf /Char/Relocated/RelocatedChild + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + root.sdf /Good_RefToChildOfRelocated + model.sdf /Model/PreRelo/ModelChild + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + root.sdf /Bad_RefToPreRelo + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + root.sdf /Bad_RefToChildOfPreRelo + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + root.sdf /ReferencedChar + char.sdf /Char + model.sdf /Model + +Prohibited child names: + ['PreRelo', 'Relocated'] + diff --git a/pxr/usd/pcp/testenv/testPcpMuseum_PayloadsAndAncestralArcs3.testenv/baseline/compositionResults_PayloadsAndAncestralArcs3_refpayloadsonly.txt b/pxr/usd/pcp/testenv/testPcpMuseum_PayloadsAndAncestralArcs3.testenv/baseline/compositionResults_PayloadsAndAncestralArcs3_refpayloadsonly.txt index f63a114ea0..fc7ca72d08 100644 --- a/pxr/usd/pcp/testenv/testPcpMuseum_PayloadsAndAncestralArcs3.testenv/baseline/compositionResults_PayloadsAndAncestralArcs3_refpayloadsonly.txt +++ b/pxr/usd/pcp/testenv/testPcpMuseum_PayloadsAndAncestralArcs3.testenv/baseline/compositionResults_PayloadsAndAncestralArcs3_refpayloadsonly.txt @@ -60,6 +60,11 @@ Prim Stack: Child names: ['Anim'] +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + ------------------------------------------------------------------------ Results for composing diff --git a/pxr/usd/pcp/testenv/testPcpMuseum_RelocatePrimsWithSameName.testenv/baseline/compositionErrors_RelocatePrimsWithSameName.txt b/pxr/usd/pcp/testenv/testPcpMuseum_RelocatePrimsWithSameName.testenv/baseline/compositionErrors_RelocatePrimsWithSameName.txt new file mode 100644 index 0000000000..380839be7e --- /dev/null +++ b/pxr/usd/pcp/testenv/testPcpMuseum_RelocatePrimsWithSameName.testenv/baseline/compositionErrors_RelocatePrimsWithSameName.txt @@ -0,0 +1,8 @@ +------------------------------------------------------------------------ +Errors while composing + +@RelocatePrimsWithSameName/root.sdf@ +CANNOT be relocated from: +@RelocatePrimsWithSameName/root.sdf@ +which is a prohibited child of its parent because it would require allowing opinions from the source of a relocation at @RelocatePrimsWithSameName/root.sdf@. + diff --git a/pxr/usd/pcp/testenv/testPcpMuseum_RelocatePrimsWithSameName.testenv/baseline/compositionResults_RelocatePrimsWithSameName.txt b/pxr/usd/pcp/testenv/testPcpMuseum_RelocatePrimsWithSameName.testenv/baseline/compositionResults_RelocatePrimsWithSameName.txt index 567f761635..82f2c51525 100644 --- a/pxr/usd/pcp/testenv/testPcpMuseum_RelocatePrimsWithSameName.testenv/baseline/compositionResults_RelocatePrimsWithSameName.txt +++ b/pxr/usd/pcp/testenv/testPcpMuseum_RelocatePrimsWithSameName.testenv/baseline/compositionResults_RelocatePrimsWithSameName.txt @@ -109,7 +109,6 @@ Prim Stack: Results for composing Prim Stack: - root.sdf /ChainedRef_1/Child ------------------------------------------------------------------------ Results for composing diff --git a/pxr/usd/pcp/testenv/testPcpMuseum_RelocateToNone.testenv/RelocateToNone/model.sdf b/pxr/usd/pcp/testenv/testPcpMuseum_RelocateToNone.testenv/RelocateToNone/model.sdf new file mode 100644 index 0000000000..5e65f29d68 --- /dev/null +++ b/pxr/usd/pcp/testenv/testPcpMuseum_RelocateToNone.testenv/RelocateToNone/model.sdf @@ -0,0 +1,36 @@ +#sdf 1.4.32 + +def "Model" +{ + def "ToBeDeleted" + { + def "Child" + { + } + } + + def "ToBeRelocated" + { + def "Child" + { + } + + def "ToBeDeletedChild" + { + } + } + + rel relationship1 = ( + doc = """This relationship target will be invalid in root.sdf + when ToBeDeleted is deleted via relocation""" + ) + rel relationship2 = ( + doc = """This relationship target will be valid and remapped in + root.sdf when ToBeRelocated is relocated to Relocated""" + ) + rel relationship3 = ( + doc = """This relationship target will be invalid in root.sdf + when its mapped path Relocated/ToBeDeletedChild is deleted + via relocation""" + ) +} diff --git a/pxr/usd/pcp/testenv/testPcpMuseum_RelocateToNone.testenv/RelocateToNone/root.sdf b/pxr/usd/pcp/testenv/testPcpMuseum_RelocateToNone.testenv/RelocateToNone/root.sdf new file mode 100644 index 0000000000..f07ab7c11c --- /dev/null +++ b/pxr/usd/pcp/testenv/testPcpMuseum_RelocateToNone.testenv/RelocateToNone/root.sdf @@ -0,0 +1,78 @@ +#sdf 1.4.32 +( + """ + These cases exercise deleting prims via relocation. + """ + + relocates = { + : <>, + : , + : <>, + } +) + +def "Char" ( + references = @model.sdf@ +) +{ + over "ToBeDeleted" + ( + doc = """Invalid opinion at deleted via relocation path""" + ) + { + } + + over "Relocated" ( + doc = """Valid opinion at relocated path""" + ) + { + over "Child" ( + doc = """Valid opinion at child of relocated path""" + ) + { + } + + over "ToBeDeletedChild" + ( + doc = """Invalid opinion at deleted via relocation path""" + ) + { + } + } +} + +def "Good_SubrootRefToRelocated" ( + doc = """Reference to post-relocation prim is valid""" + references = +) +{ +} + +def "Good_SubrootRefToRelocatedChild" ( + doc = """Reference to post-relocation prim child is valid""" + references = +) +{ +} + +def "Bad_SubrootRefToDeleted" ( + doc = """Reference to deleted via relocation prim is invalid""" + references = +) +{ +} + +def "Bad_SubrootRefToPreRelocated" ( + doc = """Reference to pre-relocation prim is invalid""" + references = +) +{ +} + +def "Bad_SubrootRefToDeletedRelocatedChild" ( + doc = """Reference to post-relocation prim child that has been + deleted via relocation prim is invalid""" + references = +) +{ +} diff --git a/pxr/usd/pcp/testenv/testPcpMuseum_RelocateToNone.testenv/baseline/compositionErrors_RelocateToNone.txt b/pxr/usd/pcp/testenv/testPcpMuseum_RelocateToNone.testenv/baseline/compositionErrors_RelocateToNone.txt new file mode 100644 index 0000000000..edab361d9e --- /dev/null +++ b/pxr/usd/pcp/testenv/testPcpMuseum_RelocateToNone.testenv/baseline/compositionErrors_RelocateToNone.txt @@ -0,0 +1,30 @@ +------------------------------------------------------------------------ +Errors while composing + +The relationship target from in layer @RelocateToNone/model.sdf@ is invalid. This may be because the path is the pre-relocated source path of a relocated prim. Ignoring. +The relationship target from in layer @RelocateToNone/model.sdf@ is invalid. This may be because the path is the pre-relocated source path of a relocated prim. Ignoring. + +------------------------------------------------------------------------ +Errors while composing + +@RelocateToNone/root.sdf@ +CANNOT reference: +@RelocateToNone/root.sdf@ +which is a prohibited child of its parent because it would require allowing opinions from the source of a relocation at @RelocateToNone/root.sdf@. + +------------------------------------------------------------------------ +Errors while composing + +@RelocateToNone/root.sdf@ +CANNOT reference: +@RelocateToNone/root.sdf@ +which is a prohibited child of its parent because it would require allowing opinions from the source of a relocation at @RelocateToNone/root.sdf@. + +------------------------------------------------------------------------ +Errors while composing + +@RelocateToNone/root.sdf@ +CANNOT reference: +@RelocateToNone/root.sdf@ +which is a prohibited child of its parent because it would require allowing opinions from the source of a relocation at @RelocateToNone/root.sdf@. + diff --git a/pxr/usd/pcp/testenv/testPcpMuseum_RelocateToNone.testenv/baseline/compositionErrors_RelocateToNone_usd.txt b/pxr/usd/pcp/testenv/testPcpMuseum_RelocateToNone.testenv/baseline/compositionErrors_RelocateToNone_usd.txt new file mode 100644 index 0000000000..ca8862ebde --- /dev/null +++ b/pxr/usd/pcp/testenv/testPcpMuseum_RelocateToNone.testenv/baseline/compositionErrors_RelocateToNone_usd.txt @@ -0,0 +1,24 @@ +------------------------------------------------------------------------ +Errors while composing + +@RelocateToNone/root.sdf@ +CANNOT reference: +@RelocateToNone/root.sdf@ +which is a prohibited child of its parent because it would require allowing opinions from the source of a relocation at @RelocateToNone/root.sdf@. + +------------------------------------------------------------------------ +Errors while composing + +@RelocateToNone/root.sdf@ +CANNOT reference: +@RelocateToNone/root.sdf@ +which is a prohibited child of its parent because it would require allowing opinions from the source of a relocation at @RelocateToNone/root.sdf@. + +------------------------------------------------------------------------ +Errors while composing + +@RelocateToNone/root.sdf@ +CANNOT reference: +@RelocateToNone/root.sdf@ +which is a prohibited child of its parent because it would require allowing opinions from the source of a relocation at @RelocateToNone/root.sdf@. + diff --git a/pxr/usd/pcp/testenv/testPcpMuseum_RelocateToNone.testenv/baseline/compositionResults_RelocateToNone.txt b/pxr/usd/pcp/testenv/testPcpMuseum_RelocateToNone.testenv/baseline/compositionResults_RelocateToNone.txt new file mode 100644 index 0000000000..fee6ac31e5 --- /dev/null +++ b/pxr/usd/pcp/testenv/testPcpMuseum_RelocateToNone.testenv/baseline/compositionResults_RelocateToNone.txt @@ -0,0 +1,101 @@ +Loading @RelocateToNone/root.sdf@ + +------------------------------------------------------------------------ +Layer Stack: + root.sdf + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + root.sdf /Char + model.sdf /Model + +Child names: + ['Relocated'] + +Prohibited child names: + ['ToBeDeleted', 'ToBeRelocated'] + +Property names: + ['relationship1', 'relationship2', 'relationship3'] + +Property stacks: +/Char.relationship1: + model.sdf /Model.relationship1 +/Char.relationship2: + model.sdf /Model.relationship2 +/Char.relationship3: + model.sdf /Model.relationship3 + +Relationship targets: +/Char.relationship2: + /Char/Relocated/Child + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + root.sdf /Char/Relocated + model.sdf /Model/ToBeRelocated + +Child names: + ['Child'] + +Prohibited child names: + ['ToBeDeletedChild'] + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + root.sdf /Char/Relocated/Child + model.sdf /Model/ToBeRelocated/Child + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + root.sdf /Good_SubrootRefToRelocated + root.sdf /Char/Relocated + model.sdf /Model/ToBeRelocated + +Child names: + ['Child'] + +Prohibited child names: + ['ToBeDeletedChild'] + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + root.sdf /Char/Relocated/Child + model.sdf /Model/ToBeRelocated/Child + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + root.sdf /Good_SubrootRefToRelocatedChild + root.sdf /Char/Relocated/Child + model.sdf /Model/ToBeRelocated/Child + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + root.sdf /Bad_SubrootRefToDeleted + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + root.sdf /Bad_SubrootRefToPreRelocated + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + root.sdf /Bad_SubrootRefToDeletedRelocatedChild + diff --git a/pxr/usd/pcp/testenv/testPcpMuseum_RelocateToNone.testenv/baseline/compositionResults_RelocateToNone_usd.txt b/pxr/usd/pcp/testenv/testPcpMuseum_RelocateToNone.testenv/baseline/compositionResults_RelocateToNone_usd.txt new file mode 100644 index 0000000000..208d9e3237 --- /dev/null +++ b/pxr/usd/pcp/testenv/testPcpMuseum_RelocateToNone.testenv/baseline/compositionResults_RelocateToNone_usd.txt @@ -0,0 +1,105 @@ +Loading @RelocateToNone/root.sdf@ + +------------------------------------------------------------------------ +Layer Stack: + root.sdf + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + root.sdf /Char + model.sdf /Model + +Child names: + ['Relocated'] + +Prohibited child names: + ['ToBeDeleted', 'ToBeRelocated'] + +Property names: + ['relationship1', 'relationship2', 'relationship3'] + +Property stacks: +/Char.relationship1: + model.sdf /Model.relationship1 +/Char.relationship2: + model.sdf /Model.relationship2 +/Char.relationship3: + model.sdf /Model.relationship3 + +Relationship targets: +/Char.relationship1: + /Char/ToBeDeleted/Child +/Char.relationship2: + /Char/Relocated/Child +/Char.relationship3: + /Char/Relocated/ToBeDeletedChild + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + root.sdf /Char/Relocated + model.sdf /Model/ToBeRelocated + +Child names: + ['Child'] + +Prohibited child names: + ['ToBeDeletedChild'] + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + root.sdf /Char/Relocated/Child + model.sdf /Model/ToBeRelocated/Child + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + root.sdf /Good_SubrootRefToRelocated + root.sdf /Char/Relocated + model.sdf /Model/ToBeRelocated + +Child names: + ['Child'] + +Prohibited child names: + ['ToBeDeletedChild'] + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + root.sdf /Char/Relocated/Child + model.sdf /Model/ToBeRelocated/Child + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + root.sdf /Good_SubrootRefToRelocatedChild + root.sdf /Char/Relocated/Child + model.sdf /Model/ToBeRelocated/Child + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + root.sdf /Bad_SubrootRefToDeleted + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + root.sdf /Bad_SubrootRefToPreRelocated + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + root.sdf /Bad_SubrootRefToDeletedRelocatedChild + diff --git a/pxr/usd/pcp/testenv/testPcpMuseum_TrickyInheritsAndRelocates.testenv/baseline/compositionErrors_TrickyInheritsAndRelocates.txt b/pxr/usd/pcp/testenv/testPcpMuseum_TrickyInheritsAndRelocates.testenv/baseline/compositionErrors_TrickyInheritsAndRelocates.txt index e962dfae0a..97e8bb800f 100644 --- a/pxr/usd/pcp/testenv/testPcpMuseum_TrickyInheritsAndRelocates.testenv/baseline/compositionErrors_TrickyInheritsAndRelocates.txt +++ b/pxr/usd/pcp/testenv/testPcpMuseum_TrickyInheritsAndRelocates.testenv/baseline/compositionErrors_TrickyInheritsAndRelocates.txt @@ -24,3 +24,11 @@ Errors while composing The layer @TrickyInheritsAndRelocates/root.sdf@ has an invalid opinion at the relocation source path , which will be ignored. +------------------------------------------------------------------------ +Errors while composing + +@TrickyInheritsAndRelocates/root.sdf@ +CANNOT inherit from: +@TrickyInheritsAndRelocates/root.sdf@ +which is a prohibited child of its parent because it would require allowing opinions from the source of a relocation at @TrickyInheritsAndRelocates/root.sdf@. + diff --git a/pxr/usd/pcp/testenv/testPcpMuseum_TrickyInheritsAndRelocates.testenv/baseline/compositionResults_TrickyInheritsAndRelocates.txt b/pxr/usd/pcp/testenv/testPcpMuseum_TrickyInheritsAndRelocates.testenv/baseline/compositionResults_TrickyInheritsAndRelocates.txt index ed02ed8fa1..2159fa5d0f 100644 --- a/pxr/usd/pcp/testenv/testPcpMuseum_TrickyInheritsAndRelocates.testenv/baseline/compositionResults_TrickyInheritsAndRelocates.txt +++ b/pxr/usd/pcp/testenv/testPcpMuseum_TrickyInheritsAndRelocates.testenv/baseline/compositionResults_TrickyInheritsAndRelocates.txt @@ -135,5 +135,4 @@ Results for composing Prim Stack: root.sdf /Rig/Anim/BadRigInstance - rig.sdf /Rig/RigClass diff --git a/pxr/usd/pcp/testenv/testPcpMuseum_TrickyInheritsAndRelocatesToNewRootPrim.testenv/TrickyInheritsAndRelocatesToNewRootPrim/group.sdf b/pxr/usd/pcp/testenv/testPcpMuseum_TrickyInheritsAndRelocatesToNewRootPrim.testenv/TrickyInheritsAndRelocatesToNewRootPrim/group.sdf new file mode 100644 index 0000000000..33a02cfbeb --- /dev/null +++ b/pxr/usd/pcp/testenv/testPcpMuseum_TrickyInheritsAndRelocatesToNewRootPrim.testenv/TrickyInheritsAndRelocatesToNewRootPrim/group.sdf @@ -0,0 +1,10 @@ +#sdf 1.4.32 + +def Scope "Group" +{ + def "Model" ( + add references = @./model.sdf@ + ) + { + } +} diff --git a/pxr/usd/pcp/testenv/testPcpMuseum_TrickyInheritsAndRelocatesToNewRootPrim.testenv/TrickyInheritsAndRelocatesToNewRootPrim/model.sdf b/pxr/usd/pcp/testenv/testPcpMuseum_TrickyInheritsAndRelocatesToNewRootPrim.testenv/TrickyInheritsAndRelocatesToNewRootPrim/model.sdf new file mode 100644 index 0000000000..1956eac1d8 --- /dev/null +++ b/pxr/usd/pcp/testenv/testPcpMuseum_TrickyInheritsAndRelocatesToNewRootPrim.testenv/TrickyInheritsAndRelocatesToNewRootPrim/model.sdf @@ -0,0 +1,20 @@ +#sdf 1.4.32 + +def Model "Model" +{ + class Scope "A" + { + } + + class Scope "B" ( + add inherits = + ) + { + } + + def Scope "Scope" ( + add inherits = + ) + { + } +} \ No newline at end of file diff --git a/pxr/usd/pcp/testenv/testPcpMuseum_TrickyInheritsAndRelocatesToNewRootPrim.testenv/TrickyInheritsAndRelocatesToNewRootPrim/rig.sdf b/pxr/usd/pcp/testenv/testPcpMuseum_TrickyInheritsAndRelocatesToNewRootPrim.testenv/TrickyInheritsAndRelocatesToNewRootPrim/rig.sdf new file mode 100644 index 0000000000..155e201dcf --- /dev/null +++ b/pxr/usd/pcp/testenv/testPcpMuseum_TrickyInheritsAndRelocatesToNewRootPrim.testenv/TrickyInheritsAndRelocatesToNewRootPrim/rig.sdf @@ -0,0 +1,8 @@ +#sdf 1.4.32 + +def Scope "Rig" +{ + class Scope "RigClass" + { + } +} \ No newline at end of file diff --git a/pxr/usd/pcp/testenv/testPcpMuseum_TrickyInheritsAndRelocatesToNewRootPrim.testenv/TrickyInheritsAndRelocatesToNewRootPrim/root.sdf b/pxr/usd/pcp/testenv/testPcpMuseum_TrickyInheritsAndRelocatesToNewRootPrim.testenv/TrickyInheritsAndRelocatesToNewRootPrim/root.sdf new file mode 100644 index 0000000000..f030f1c0fd --- /dev/null +++ b/pxr/usd/pcp/testenv/testPcpMuseum_TrickyInheritsAndRelocatesToNewRootPrim.testenv/TrickyInheritsAndRelocatesToNewRootPrim/root.sdf @@ -0,0 +1,76 @@ +#sdf 1.4.32 +( + """ + This museum case is a copy of testPcpMuseum_TrickyInheritsAndRelocates + changed to have the relocates move the prims to be new root level prims. + The composition results are almost identical the composition for + testPcpMuseum_TrickyInheritsAndRelocates. + """ + relocates = { + : , + : + } +) + +reorder rootPrims = ["Group", "Model_Renamed", "Rig", "RigClass"] + +def Scope "Group" ( + add references = @./group.sdf@ +) +{ + over "Model" + { + over "A" + { + custom string a_src = "bad" + } + + over "B" + { + custom string b_src = "bad" + } + } +} + +over "Model_Renamed" +{ + over "A" + { + custom string a_target = "good" + } + + over "B" + { + custom string b_target = "good" + } +} + +def Scope "Rig" ( + add references = @./rig.sdf@ +) +{ + over "RigClass" + { + custom string r_src = "bad" + } + + def Scope "Anim" + { + def Scope "RigInstance" ( + add inherits = + ) + { + } + + def Scope "BadRigInstance" ( + add inherits = + ) + { + } + } +} + +over "RigClass" +{ + custom string r_target = "good" +} diff --git a/pxr/usd/pcp/testenv/testPcpMuseum_TrickyInheritsAndRelocatesToNewRootPrim.testenv/baseline/compositionErrors_TrickyInheritsAndRelocatesToNewRootPrim.txt b/pxr/usd/pcp/testenv/testPcpMuseum_TrickyInheritsAndRelocatesToNewRootPrim.testenv/baseline/compositionErrors_TrickyInheritsAndRelocatesToNewRootPrim.txt new file mode 100644 index 0000000000..deb73eaee7 --- /dev/null +++ b/pxr/usd/pcp/testenv/testPcpMuseum_TrickyInheritsAndRelocatesToNewRootPrim.testenv/baseline/compositionErrors_TrickyInheritsAndRelocatesToNewRootPrim.txt @@ -0,0 +1,34 @@ +------------------------------------------------------------------------ +Errors while composing + +The layer @TrickyInheritsAndRelocatesToNewRootPrim/root.sdf@ has an invalid opinion at the relocation source path , which will be ignored. + +------------------------------------------------------------------------ +Errors while composing + +The layer @TrickyInheritsAndRelocatesToNewRootPrim/root.sdf@ has an invalid opinion at the relocation source path , which will be ignored. + +------------------------------------------------------------------------ +Errors while composing + +The layer @TrickyInheritsAndRelocatesToNewRootPrim/root.sdf@ has an invalid opinion at the relocation source path , which will be ignored. +The layer @TrickyInheritsAndRelocatesToNewRootPrim/root.sdf@ has an invalid opinion at the relocation source path , which will be ignored. + +------------------------------------------------------------------------ +Errors while composing + +The layer @TrickyInheritsAndRelocatesToNewRootPrim/root.sdf@ has an invalid opinion at the relocation source path , which will be ignored. + +------------------------------------------------------------------------ +Errors while composing + +@TrickyInheritsAndRelocatesToNewRootPrim/root.sdf@ +CANNOT inherit from: +@TrickyInheritsAndRelocatesToNewRootPrim/root.sdf@ +which is a prohibited child of its parent because it would require allowing opinions from the source of a relocation at @TrickyInheritsAndRelocatesToNewRootPrim/root.sdf@. + +------------------------------------------------------------------------ +Errors while composing + +The layer @TrickyInheritsAndRelocatesToNewRootPrim/root.sdf@ has an invalid opinion at the relocation source path , which will be ignored. + diff --git a/pxr/usd/pcp/testenv/testPcpMuseum_TrickyInheritsAndRelocatesToNewRootPrim.testenv/baseline/compositionResults_TrickyInheritsAndRelocatesToNewRootPrim.txt b/pxr/usd/pcp/testenv/testPcpMuseum_TrickyInheritsAndRelocatesToNewRootPrim.testenv/baseline/compositionResults_TrickyInheritsAndRelocatesToNewRootPrim.txt new file mode 100644 index 0000000000..82d77dbcf3 --- /dev/null +++ b/pxr/usd/pcp/testenv/testPcpMuseum_TrickyInheritsAndRelocatesToNewRootPrim.testenv/baseline/compositionResults_TrickyInheritsAndRelocatesToNewRootPrim.txt @@ -0,0 +1,135 @@ +Loading @TrickyInheritsAndRelocatesToNewRootPrim/root.sdf@ + +------------------------------------------------------------------------ +Layer Stack: + root.sdf + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + root.sdf /Group + group.sdf /Group + +Prohibited child names: + ['Model'] + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + root.sdf /Model_Renamed + group.sdf /Group/Model + model.sdf /Model + +Child names: + ['A', 'B', 'Scope'] + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + root.sdf /Model_Renamed/A + model.sdf /Model/A + +Property names: + ['a_target'] + +Property stacks: +/Model_Renamed/A.a_target: + root.sdf /Model_Renamed/A.a_target + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + root.sdf /Model_Renamed/B + root.sdf /Model_Renamed/A + model.sdf /Model/B + model.sdf /Model/A + +Property names: + ['a_target', 'b_target'] + +Property stacks: +/Model_Renamed/B.a_target: + root.sdf /Model_Renamed/A.a_target +/Model_Renamed/B.b_target: + root.sdf /Model_Renamed/B.b_target + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + root.sdf /Model_Renamed/B + root.sdf /Model_Renamed/A + model.sdf /Model/Scope + model.sdf /Model/B + model.sdf /Model/A + +Property names: + ['a_target', 'b_target'] + +Property stacks: +/Model_Renamed/Scope.a_target: + root.sdf /Model_Renamed/A.a_target +/Model_Renamed/Scope.b_target: + root.sdf /Model_Renamed/B.b_target + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + root.sdf /Rig + rig.sdf /Rig + +Child names: + ['Anim'] + +Prohibited child names: + ['RigClass'] + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + root.sdf /Rig/Anim + +Child names: + ['RigInstance', 'BadRigInstance'] + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + root.sdf /Rig/Anim/RigInstance + root.sdf /RigClass + rig.sdf /Rig/RigClass + +Property names: + ['r_target'] + +Property stacks: +/Rig/Anim/RigInstance.r_target: + root.sdf /RigClass.r_target + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + root.sdf /Rig/Anim/BadRigInstance + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + root.sdf /RigClass + rig.sdf /Rig/RigClass + +Property names: + ['r_target'] + +Property stacks: +/RigClass.r_target: + root.sdf /RigClass.r_target + diff --git a/pxr/usd/pcp/testenv/testPcpMuseum_TrickyRelocationOfPrimFromVariant.testenv/baseline/compositionResults_TrickyRelocationOfPrimFromVariant.txt b/pxr/usd/pcp/testenv/testPcpMuseum_TrickyRelocationOfPrimFromVariant.testenv/baseline/compositionResults_TrickyRelocationOfPrimFromVariant.txt index e7e4a2d480..1e2d587c79 100644 --- a/pxr/usd/pcp/testenv/testPcpMuseum_TrickyRelocationOfPrimFromVariant.testenv/baseline/compositionResults_TrickyRelocationOfPrimFromVariant.txt +++ b/pxr/usd/pcp/testenv/testPcpMuseum_TrickyRelocationOfPrimFromVariant.testenv/baseline/compositionResults_TrickyRelocationOfPrimFromVariant.txt @@ -66,3 +66,8 @@ Prim Stack: Child names: ['Tail'] +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + diff --git a/pxr/usd/pcp/testenv/testPcpMuseum_VariantSpecializesAndReference.testenv/VariantSpecializesAndReference/root.sdf b/pxr/usd/pcp/testenv/testPcpMuseum_VariantSpecializesAndReference.testenv/VariantSpecializesAndReference/root.sdf new file mode 100644 index 0000000000..34f819ac09 --- /dev/null +++ b/pxr/usd/pcp/testenv/testPcpMuseum_VariantSpecializesAndReference.testenv/VariantSpecializesAndReference/root.sdf @@ -0,0 +1,65 @@ +#sdf 1.4.32 +( + """ + In this example, the prim /Model sets its 'shadingVariant' variantSet + selection to be 'New_Shading_Variant'. + The prim spec /New_Shading_Variant/Material_Child has a 'specializes' arc to + /New_Shading_Variant/Material. + + This example demonstrates the expected behavior. When + /Model/Material_Child is composed, the prim spec at + /New_Shading_Variant/Material is stronger than + /Model_defaultShadingVariant/Material: + + Results for composing + + Prim Stack: + root.sdf /New_Shading_Variant/Material_Child + root.sdf /New_Shading_Variant/Material + root.sdf /Model_defaultShadingVariant/Material + """ +) + +over "Model_defaultShadingVariant" +{ + def Material "Material" + { + int myInt = 0 + } + +} + +def Xform "Model" ( + variants = { + string shadingVariant = "New_Shading_Variant" + } + add variantSets = "shadingVariant" +) +{ + variantSet "shadingVariant" = { + "New_Shading_Variant" ( + add references = + ) { + + } + "default" { + + } + } +} + +over "New_Shading_Variant" ( + prepend references = +) +{ + def Material "Material_Child" ( + specializes = + ) + { + } + + over "Material" + { + int myInt = 1 + } +} diff --git a/pxr/usd/pcp/testenv/testPcpMuseum_VariantSpecializesAndReference.testenv/baseline/compositionResults_VariantSpecializesAndReference.txt b/pxr/usd/pcp/testenv/testPcpMuseum_VariantSpecializesAndReference.testenv/baseline/compositionResults_VariantSpecializesAndReference.txt new file mode 100644 index 0000000000..b0c54ef9fa --- /dev/null +++ b/pxr/usd/pcp/testenv/testPcpMuseum_VariantSpecializesAndReference.testenv/baseline/compositionResults_VariantSpecializesAndReference.txt @@ -0,0 +1,115 @@ +Loading @VariantSpecializesAndReference/root.sdf@ + +------------------------------------------------------------------------ +Layer Stack: + root.sdf + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + root.sdf /Model_defaultShadingVariant + +Child names: + ['Material'] + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + root.sdf /Model_defaultShadingVariant/Material + +Property names: + ['myInt'] + +Property stacks: +/Model_defaultShadingVariant/Material.myInt: + root.sdf /Model_defaultShadingVariant/Material.myInt + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + root.sdf /Model + root.sdf /Model{shadingVariant=New_Shading_Variant} + root.sdf /New_Shading_Variant + root.sdf /Model_defaultShadingVariant + +Variant Selections: + {shadingVariant = New_Shading_Variant} + +Child names: + ['Material', 'Material_Child'] + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + root.sdf /New_Shading_Variant/Material + root.sdf /Model_defaultShadingVariant/Material + +Property names: + ['myInt'] + +Property stacks: +/Model/Material.myInt: + root.sdf /New_Shading_Variant/Material.myInt + root.sdf /Model_defaultShadingVariant/Material.myInt + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + root.sdf /New_Shading_Variant/Material_Child + root.sdf /New_Shading_Variant/Material + root.sdf /Model_defaultShadingVariant/Material + +Property names: + ['myInt'] + +Property stacks: +/Model/Material_Child.myInt: + root.sdf /New_Shading_Variant/Material.myInt + root.sdf /Model_defaultShadingVariant/Material.myInt + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + root.sdf /New_Shading_Variant + root.sdf /Model_defaultShadingVariant + +Child names: + ['Material', 'Material_Child'] + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + root.sdf /New_Shading_Variant/Material + root.sdf /Model_defaultShadingVariant/Material + +Property names: + ['myInt'] + +Property stacks: +/New_Shading_Variant/Material.myInt: + root.sdf /New_Shading_Variant/Material.myInt + root.sdf /Model_defaultShadingVariant/Material.myInt + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + root.sdf /New_Shading_Variant/Material_Child + root.sdf /New_Shading_Variant/Material + root.sdf /Model_defaultShadingVariant/Material + +Property names: + ['myInt'] + +Property stacks: +/New_Shading_Variant/Material_Child.myInt: + root.sdf /New_Shading_Variant/Material.myInt + root.sdf /Model_defaultShadingVariant/Material.myInt + diff --git a/pxr/usd/pcp/testenv/testPcpMuseum_VariantSpecializesAndReferenceSurprisingBehavior.testenv/VariantSpecializesAndReferenceSurprisingBehavior/root.sdf b/pxr/usd/pcp/testenv/testPcpMuseum_VariantSpecializesAndReferenceSurprisingBehavior.testenv/VariantSpecializesAndReferenceSurprisingBehavior/root.sdf new file mode 100644 index 0000000000..f194d4ffc6 --- /dev/null +++ b/pxr/usd/pcp/testenv/testPcpMuseum_VariantSpecializesAndReferenceSurprisingBehavior.testenv/VariantSpecializesAndReferenceSurprisingBehavior/root.sdf @@ -0,0 +1,63 @@ +#sdf 1.4.32 +( + """ + In this example, the prim /Model sets its 'shadingVariant' variantSet + selection to be 'New_Shading_Variant'. + The prim spec /New_Shading_Variant/Material_Child has a 'specializes' arc to + /New_Shading_Variant/Material. + + The surprising behavior is that when /Model/Material_Child is composed, + the prim spec at /Model_defaultShadingVariant/Material is stronger than + /New_Shading_Variant/Material: + + Results for composing + + Prim Stack: + root.sdf /New_Shading_Variant/Material_Child + root.sdf /Model_defaultShadingVariant/Material + root.sdf /New_Shading_Variant/Material + """ +) + +over "Model_defaultShadingVariant" +{ + def Material "Material" + { + int myInt = 0 + } + +} + +def Xform "Model" ( + prepend references = + variants = { + string shadingVariant = "New_Shading_Variant" + } + add variantSets = "shadingVariant" +) +{ + variantSet "shadingVariant" = { + "New_Shading_Variant" ( + add references = + ) { + + } + "default" { + + } + } +} + +over "New_Shading_Variant" +{ + def Material "Material_Child" ( + specializes = + ) + { + } + + over "Material" + { + int myInt = 1 + } +} diff --git a/pxr/usd/pcp/testenv/testPcpMuseum_VariantSpecializesAndReferenceSurprisingBehavior.testenv/baseline/compositionResults_VariantSpecializesAndReferenceSurprisingBehavior.txt b/pxr/usd/pcp/testenv/testPcpMuseum_VariantSpecializesAndReferenceSurprisingBehavior.testenv/baseline/compositionResults_VariantSpecializesAndReferenceSurprisingBehavior.txt new file mode 100644 index 0000000000..08831fdd8c --- /dev/null +++ b/pxr/usd/pcp/testenv/testPcpMuseum_VariantSpecializesAndReferenceSurprisingBehavior.testenv/baseline/compositionResults_VariantSpecializesAndReferenceSurprisingBehavior.txt @@ -0,0 +1,110 @@ +Loading @VariantSpecializesAndReferenceSurprisingBehavior/root.sdf@ + +------------------------------------------------------------------------ +Layer Stack: + root.sdf + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + root.sdf /Model_defaultShadingVariant + +Child names: + ['Material'] + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + root.sdf /Model_defaultShadingVariant/Material + +Property names: + ['myInt'] + +Property stacks: +/Model_defaultShadingVariant/Material.myInt: + root.sdf /Model_defaultShadingVariant/Material.myInt + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + root.sdf /Model + root.sdf /Model{shadingVariant=New_Shading_Variant} + root.sdf /New_Shading_Variant + root.sdf /Model_defaultShadingVariant + +Variant Selections: + {shadingVariant = New_Shading_Variant} + +Child names: + ['Material', 'Material_Child'] + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + root.sdf /New_Shading_Variant/Material + root.sdf /Model_defaultShadingVariant/Material + +Property names: + ['myInt'] + +Property stacks: +/Model/Material.myInt: + root.sdf /New_Shading_Variant/Material.myInt + root.sdf /Model_defaultShadingVariant/Material.myInt + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + root.sdf /New_Shading_Variant/Material_Child + root.sdf /Model_defaultShadingVariant/Material + root.sdf /New_Shading_Variant/Material + +Property names: + ['myInt'] + +Property stacks: +/Model/Material_Child.myInt: + root.sdf /Model_defaultShadingVariant/Material.myInt + root.sdf /New_Shading_Variant/Material.myInt + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + root.sdf /New_Shading_Variant + +Child names: + ['Material_Child', 'Material'] + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + root.sdf /New_Shading_Variant/Material_Child + root.sdf /New_Shading_Variant/Material + +Property names: + ['myInt'] + +Property stacks: +/New_Shading_Variant/Material_Child.myInt: + root.sdf /New_Shading_Variant/Material.myInt + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + root.sdf /New_Shading_Variant/Material + +Property names: + ['myInt'] + +Property stacks: +/New_Shading_Variant/Material.myInt: + root.sdf /New_Shading_Variant/Material.myInt + diff --git a/pxr/usd/pcp/testenv/testPcpOwner.py b/pxr/usd/pcp/testenv/testPcpOwner.py index 06894fada3..f07c898039 100644 --- a/pxr/usd/pcp/testenv/testPcpOwner.py +++ b/pxr/usd/pcp/testenv/testPcpOwner.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from __future__ import print_function from pxr import Tf, Pcp, Sdf diff --git a/pxr/usd/pcp/testenv/testPcpPathTranslation.py b/pxr/usd/pcp/testenv/testPcpPathTranslation.py index 05d2d5fbf6..ea09f6698c 100644 --- a/pxr/usd/pcp/testenv/testPcpPathTranslation.py +++ b/pxr/usd/pcp/testenv/testPcpPathTranslation.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from __future__ import print_function from pxr import Sdf, Tf, Pcp diff --git a/pxr/usd/pcp/testenv/testPcpPathTranslation_HardToReach.cpp b/pxr/usd/pcp/testenv/testPcpPathTranslation_HardToReach.cpp index c92df919b8..7d473f28c5 100644 --- a/pxr/usd/pcp/testenv/testPcpPathTranslation_HardToReach.cpp +++ b/pxr/usd/pcp/testenv/testPcpPathTranslation_HardToReach.cpp @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/pcp/testenv/testPcpPrimIndex.py b/pxr/usd/pcp/testenv/testPcpPrimIndex.py index f32d03798d..3f5aed0afe 100644 --- a/pxr/usd/pcp/testenv/testPcpPrimIndex.py +++ b/pxr/usd/pcp/testenv/testPcpPrimIndex.py @@ -2,25 +2,8 @@ # # Copyright 2023 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. import unittest @@ -965,6 +948,35 @@ def "Root" ( ] ]) + def test_RecursivePrimIndexComputationLocalErrors(self): + """Test to make sure recursive primIndex computation correctly stores + composition errors""" + rootLayer = Sdf.Layer.CreateAnonymous() + rootLayer.ImportFromString(''' + #sdf 1.4.32 + + def "Main" ( + ) + { + def "First" ( + prepend references = + ) + { + } + + def "Second" ( + prepend references = + ) + { + } + } + '''.strip()) + pcp = Pcp.Cache(Pcp.LayerStackIdentifier(rootLayer)) + pi, errs = pcp.ComputePrimIndex('/Main/First') + self.assertEqual(len(errs), 1) + self.assertEqual(len(errs), len(pi.localErrors)) + self.assertEqual(str(errs[0]), str(pi.localErrors[0])) + def test_TestInvalidPcpNodeRef(self): """Test to ensure that a invalid PcpNodeRef will return false when cast to a bool""" @@ -972,6 +984,39 @@ def test_TestInvalidPcpNodeRef(self): nullPcpNodeRef = Pcp._GetInvalidPcpNode() self.assertFalse(bool(nullPcpNodeRef)) + def test_UnresolvedPrimPathError_Variants(self): + """Test to ensure unresolved prim path errors are handles correctly + when the node path includes a variant selection""" + rootLayer = Sdf.Layer.CreateAnonymous() + rootLayer.ImportFromString(''' + #sdf 1.4.32 + + def "scene" ( + prepend variantSets = "MatVars1" + variants = { + string "MatVars1" = "red" + } + ) + { + variantSet "MatVars1" = { + "red" { + over "Cubes_materials" + { + over "TexTarget" ( + prepend references = + ) + { + } + } + } + } + } + '''.strip()) + + pcp = Pcp.Cache(Pcp.LayerStackIdentifier(rootLayer)) + _, errs = pcp.ComputePrimIndex('/scene/Cubes_materials/TexTarget') + self.assertEqual(len(errs), 1) + self.assertTrue('Unresolved reference prim path' in str(errs[0])) if __name__ == "__main__": unittest.main() diff --git a/pxr/usd/pcp/testenv/testPcpRegressionBugs_bug101300.py b/pxr/usd/pcp/testenv/testPcpRegressionBugs_bug101300.py index c599c10731..6a9dcf8232 100644 --- a/pxr/usd/pcp/testenv/testPcpRegressionBugs_bug101300.py +++ b/pxr/usd/pcp/testenv/testPcpRegressionBugs_bug101300.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # Regression test for bug 101300. This bug was due to PcpLayerStack not # recomputing its relocation tables when a prim that supplies diff --git a/pxr/usd/pcp/testenv/testPcpRegressionBugs_bug70951.py b/pxr/usd/pcp/testenv/testPcpRegressionBugs_bug70951.py index c6e0cade56..45c70ba9d2 100644 --- a/pxr/usd/pcp/testenv/testPcpRegressionBugs_bug70951.py +++ b/pxr/usd/pcp/testenv/testPcpRegressionBugs_bug70951.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # Regression test case for bug 70951. Adding inert prim specs was not # properly updating the 'hasSpecs' field on the associated node in the diff --git a/pxr/usd/pcp/testenv/testPcpRegressionBugs_bug82180.py b/pxr/usd/pcp/testenv/testPcpRegressionBugs_bug82180.py index 43cd6d42f2..1ac99e5816 100644 --- a/pxr/usd/pcp/testenv/testPcpRegressionBugs_bug82180.py +++ b/pxr/usd/pcp/testenv/testPcpRegressionBugs_bug82180.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # Regression test for bug 82180. The ultimate cause of that bug was # PcpLayerStack erroneously blowing its relocations when an insignificant diff --git a/pxr/usd/pcp/testenv/testPcpRegressionBugs_bug90508.py b/pxr/usd/pcp/testenv/testPcpRegressionBugs_bug90508.py index 11bb12b908..9e132002ef 100644 --- a/pxr/usd/pcp/testenv/testPcpRegressionBugs_bug90508.py +++ b/pxr/usd/pcp/testenv/testPcpRegressionBugs_bug90508.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # Regression test for bug 90508. This bug was due to PcpCache incorrectly # evicting prim indexes for all descendent prims when processing a change diff --git a/pxr/usd/pcp/testenv/testPcpRegressionBugs_bug90706.py b/pxr/usd/pcp/testenv/testPcpRegressionBugs_bug90706.py index 54eb0cd250..32e8a16382 100644 --- a/pxr/usd/pcp/testenv/testPcpRegressionBugs_bug90706.py +++ b/pxr/usd/pcp/testenv/testPcpRegressionBugs_bug90706.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # Regression test for bug 90706. Adding a new prim spec # within a variant that's being used by a prim index should diff --git a/pxr/usd/pcp/testenv/testPcpRegressionBugs_bug92827.testenv/baseline/compositionResults_bug92827.txt b/pxr/usd/pcp/testenv/testPcpRegressionBugs_bug92827.testenv/baseline/compositionResults_bug92827.txt index 65cbb38804..8e78b8dd9a 100644 --- a/pxr/usd/pcp/testenv/testPcpRegressionBugs_bug92827.testenv/baseline/compositionResults_bug92827.txt +++ b/pxr/usd/pcp/testenv/testPcpRegressionBugs_bug92827.testenv/baseline/compositionResults_bug92827.txt @@ -13,6 +13,11 @@ Prim Stack: Child names: ['B', 'Class', 'Other'] +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + ------------------------------------------------------------------------ Results for composing diff --git a/pxr/usd/pcp/testenv/testPcpRegressionBugs_bug92955.py b/pxr/usd/pcp/testenv/testPcpRegressionBugs_bug92955.py index 23772a6d5f..cd2dadfba7 100644 --- a/pxr/usd/pcp/testenv/testPcpRegressionBugs_bug92955.py +++ b/pxr/usd/pcp/testenv/testPcpRegressionBugs_bug92955.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # Regression test for bug 92955. Removing a class should not cause # unrelated spooky sites to be flushed. diff --git a/pxr/usd/pcp/testenv/testPcpResolvedPathChange.py b/pxr/usd/pcp/testenv/testPcpResolvedPathChange.py index 71a987cfd4..5a8a6e5d6a 100644 --- a/pxr/usd/pcp/testenv/testPcpResolvedPathChange.py +++ b/pxr/usd/pcp/testenv/testPcpResolvedPathChange.py @@ -2,25 +2,8 @@ # # Copyright 2021 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. import contextlib import os diff --git a/pxr/usd/pcp/testenv/testPcpStreamingLayerReload.py b/pxr/usd/pcp/testenv/testPcpStreamingLayerReload.py index fe74bc5b54..c517ddb194 100644 --- a/pxr/usd/pcp/testenv/testPcpStreamingLayerReload.py +++ b/pxr/usd/pcp/testenv/testPcpStreamingLayerReload.py @@ -2,25 +2,8 @@ # # Copyright 2021 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from __future__ import print_function diff --git a/pxr/usd/pcp/traversalCache.h b/pxr/usd/pcp/traversalCache.h index db621d6d32..51448c622c 100644 --- a/pxr/usd/pcp/traversalCache.h +++ b/pxr/usd/pcp/traversalCache.h @@ -1,25 +1,8 @@ // // Copyright 2024 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_PCP_TRAVERSAL_CACHE_H #define PXR_USD_PCP_TRAVERSAL_CACHE_H diff --git a/pxr/usd/pcp/types.cpp b/pxr/usd/pcp/types.cpp index 479cf36781..2faacbef85 100644 --- a/pxr/usd/pcp/types.cpp +++ b/pxr/usd/pcp/types.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/pcp/types.h b/pxr/usd/pcp/types.h index f2a5db5c24..3cdb0b5ad0 100644 --- a/pxr/usd/pcp/types.h +++ b/pxr/usd/pcp/types.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_PCP_TYPES_H #define PXR_USD_PCP_TYPES_H diff --git a/pxr/usd/pcp/utils.cpp b/pxr/usd/pcp/utils.cpp index ceebc39f08..229626abfa 100644 --- a/pxr/usd/pcp/utils.cpp +++ b/pxr/usd/pcp/utils.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // /// /// \file Pcp/Utils.cpp diff --git a/pxr/usd/pcp/utils.h b/pxr/usd/pcp/utils.h index 1ca22790e6..4e45144eb0 100644 --- a/pxr/usd/pcp/utils.h +++ b/pxr/usd/pcp/utils.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_PCP_UTILS_H #define PXR_USD_PCP_UTILS_H diff --git a/pxr/usd/pcp/wrapCache.cpp b/pxr/usd/pcp/wrapCache.cpp index 2fddbf114b..251b44c821 100644 --- a/pxr/usd/pcp/wrapCache.cpp +++ b/pxr/usd/pcp/wrapCache.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/pcp/wrapDependency.cpp b/pxr/usd/pcp/wrapDependency.cpp index 631ffe4e10..6b02e620bc 100644 --- a/pxr/usd/pcp/wrapDependency.cpp +++ b/pxr/usd/pcp/wrapDependency.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/pcp/wrapDynamicFileFormatDependencyData.cpp b/pxr/usd/pcp/wrapDynamicFileFormatDependencyData.cpp index 3c12396685..297ccde3ee 100644 --- a/pxr/usd/pcp/wrapDynamicFileFormatDependencyData.cpp +++ b/pxr/usd/pcp/wrapDynamicFileFormatDependencyData.cpp @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/pcp/wrapErrors.cpp b/pxr/usd/pcp/wrapErrors.cpp index 556d8a0bcb..ec7d0a39cb 100644 --- a/pxr/usd/pcp/wrapErrors.cpp +++ b/pxr/usd/pcp/wrapErrors.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" @@ -42,6 +25,11 @@ static TfEnum _GetErrorType(PcpErrorBasePtr const& err) return err->errorType; } +static PcpSite _GetRootSite(PcpErrorBasePtr const& err) +{ + return err->rootSite; +} + void wrapErrors() { @@ -57,6 +45,7 @@ wrapErrors() class_ ("ErrorBase", "", no_init) .add_property("errorType", _GetErrorType) + .add_property("rootSite", _GetRootSite) .def("__str__", &PcpErrorBase::ToString) ; @@ -79,6 +68,11 @@ wrapErrors() ("ErrorArcPermissionDenied", "", no_init) ; + class_, + PcpErrorArcToProhibitedChildPtr> + ("ErrorArcToProhibitedChild", "", no_init) + ; + class_, PcpErrorCapacityExceededPtr > ("ErrorCapacityExceeded", "", no_init) diff --git a/pxr/usd/pcp/wrapExpressionVariables.cpp b/pxr/usd/pcp/wrapExpressionVariables.cpp index c1b8d9b8cc..57273ba1cb 100644 --- a/pxr/usd/pcp/wrapExpressionVariables.cpp +++ b/pxr/usd/pcp/wrapExpressionVariables.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/pcp/expressionVariables.h" diff --git a/pxr/usd/pcp/wrapExpressionVariablesSource.cpp b/pxr/usd/pcp/wrapExpressionVariablesSource.cpp index d3a11f64e4..4abe13dcb5 100644 --- a/pxr/usd/pcp/wrapExpressionVariablesSource.cpp +++ b/pxr/usd/pcp/wrapExpressionVariablesSource.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/pcp/wrapInstanceKey.cpp b/pxr/usd/pcp/wrapInstanceKey.cpp index a523c05038..d4b03454a5 100644 --- a/pxr/usd/pcp/wrapInstanceKey.cpp +++ b/pxr/usd/pcp/wrapInstanceKey.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/pcp/wrapLayerRelocatesEditBuilder.cpp b/pxr/usd/pcp/wrapLayerRelocatesEditBuilder.cpp new file mode 100644 index 0000000000..d710fabbf9 --- /dev/null +++ b/pxr/usd/pcp/wrapLayerRelocatesEditBuilder.cpp @@ -0,0 +1,72 @@ +// +// Copyright 2024 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// + +#include "pxr/pxr.h" +#include "pxr/usd/pcp/layerRelocatesEditBuilder.h" +#include "pxr/base/tf/pyAnnotatedBoolResult.h" +#include "pxr/base/tf/pyContainerConversions.h" +#include "pxr/base/tf/pyResultConversions.h" + +#include + +using namespace boost::python; + +PXR_NAMESPACE_USING_DIRECTIVE + +namespace { + +struct Pcp_LayerRelocatesEditBuilderRelocateResult : + public TfPyAnnotatedBoolResult +{ + Pcp_LayerRelocatesEditBuilderRelocateResult(bool val, const std::string &msg) : + TfPyAnnotatedBoolResult(val, std::move(msg)) {} +}; + +Pcp_LayerRelocatesEditBuilderRelocateResult +_Relocate(PcpLayerRelocatesEditBuilder &self, + const SdfPath &source, const SdfPath &target) +{ + std::string whyNot; + bool result = self.Relocate(source, target, &whyNot); + return Pcp_LayerRelocatesEditBuilderRelocateResult(result, whyNot); +} + +Pcp_LayerRelocatesEditBuilderRelocateResult +_RemoveRelocate(PcpLayerRelocatesEditBuilder &self, + const SdfPath &source) +{ + std::string whyNot; + bool result = self.RemoveRelocate(source, &whyNot); + return Pcp_LayerRelocatesEditBuilderRelocateResult(result, whyNot); +} + +} // anonymous namespace + +void wrapLayerRelocatesEditBuilder() +{ + Pcp_LayerRelocatesEditBuilderRelocateResult + ::Wrap( + "_LayerRelocatesEditBuilderRelocateResult", "whyNot"); + + class_( + "LayerRelocatesEditBuilder", no_init) + .def(init()) + .def(init()) + .def("Relocate", &_Relocate) + .def("RemoveRelocate", &_RemoveRelocate) + .def("GetEditedRelocatesMap", + &PcpLayerRelocatesEditBuilder::GetEditedRelocatesMap, + return_value_policy()) + .def("GetEdits", + &PcpLayerRelocatesEditBuilder::GetEdits, + return_value_policy()) + ; + + to_python_converter>(); +} diff --git a/pxr/usd/pcp/wrapLayerStack.cpp b/pxr/usd/pcp/wrapLayerStack.cpp index 0d0c4bf5e5..0224ece825 100644 --- a/pxr/usd/pcp/wrapLayerStack.cpp +++ b/pxr/usd/pcp/wrapLayerStack.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/pcp/wrapLayerStackIdentifier.cpp b/pxr/usd/pcp/wrapLayerStackIdentifier.cpp index 4e3b2d1091..da309700e0 100644 --- a/pxr/usd/pcp/wrapLayerStackIdentifier.cpp +++ b/pxr/usd/pcp/wrapLayerStackIdentifier.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // /// \file wrapLayerStackIdentifier.cpp diff --git a/pxr/usd/pcp/wrapMapExpression.cpp b/pxr/usd/pcp/wrapMapExpression.cpp index 00998d1599..e2a9aec953 100644 --- a/pxr/usd/pcp/wrapMapExpression.cpp +++ b/pxr/usd/pcp/wrapMapExpression.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include diff --git a/pxr/usd/pcp/wrapMapFunction.cpp b/pxr/usd/pcp/wrapMapFunction.cpp index f76326fdd4..397fa57c16 100644 --- a/pxr/usd/pcp/wrapMapFunction.cpp +++ b/pxr/usd/pcp/wrapMapFunction.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/pcp/wrapNode.cpp b/pxr/usd/pcp/wrapNode.cpp index 4bd448ea50..2a5cfc9ed8 100644 --- a/pxr/usd/pcp/wrapNode.cpp +++ b/pxr/usd/pcp/wrapNode.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/pcp/wrapPathTranslation.cpp b/pxr/usd/pcp/wrapPathTranslation.cpp index ed7d721601..0178e1b225 100644 --- a/pxr/usd/pcp/wrapPathTranslation.cpp +++ b/pxr/usd/pcp/wrapPathTranslation.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/pcp/wrapPrimIndex.cpp b/pxr/usd/pcp/wrapPrimIndex.cpp index 5ae0ea14c2..221d41268f 100644 --- a/pxr/usd/pcp/wrapPrimIndex.cpp +++ b/pxr/usd/pcp/wrapPrimIndex.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/pcp/wrapPropertyIndex.cpp b/pxr/usd/pcp/wrapPropertyIndex.cpp index 8946cf10a2..4c1112d458 100644 --- a/pxr/usd/pcp/wrapPropertyIndex.cpp +++ b/pxr/usd/pcp/wrapPropertyIndex.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/pcp/wrapSite.cpp b/pxr/usd/pcp/wrapSite.cpp index 344795527f..e7f43556c6 100644 --- a/pxr/usd/pcp/wrapSite.cpp +++ b/pxr/usd/pcp/wrapSite.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/pcp/wrapTestChangeProcessor.cpp b/pxr/usd/pcp/wrapTestChangeProcessor.cpp index ebd5572ee9..307d9f8230 100644 --- a/pxr/usd/pcp/wrapTestChangeProcessor.cpp +++ b/pxr/usd/pcp/wrapTestChangeProcessor.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/pcp/wrapTypes.cpp b/pxr/usd/pcp/wrapTypes.cpp index 1fce4d46f2..b91fd2bd38 100644 --- a/pxr/usd/pcp/wrapTypes.cpp +++ b/pxr/usd/pcp/wrapTypes.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/plugin/sdrOsl/__init__.py b/pxr/usd/plugin/sdrOsl/__init__.py index 85c7173035..5e0d06a196 100644 --- a/pxr/usd/plugin/sdrOsl/__init__.py +++ b/pxr/usd/plugin/sdrOsl/__init__.py @@ -1,25 +1,8 @@ # # Copyright 2018 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # from pxr import Tf Tf.PreparePythonModule() diff --git a/pxr/usd/plugin/sdrOsl/api.h b/pxr/usd/plugin/sdrOsl/api.h index 46f8dc518b..cd81d0e51a 100644 --- a/pxr/usd/plugin/sdrOsl/api.h +++ b/pxr/usd/plugin/sdrOsl/api.h @@ -1,25 +1,8 @@ // // Copyright 2018 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_PLUGIN_SDR_OSL_API_H #define PXR_USD_PLUGIN_SDR_OSL_API_H diff --git a/pxr/usd/plugin/sdrOsl/module.cpp b/pxr/usd/plugin/sdrOsl/module.cpp index db6714e8d3..97b7449584 100644 --- a/pxr/usd/plugin/sdrOsl/module.cpp +++ b/pxr/usd/plugin/sdrOsl/module.cpp @@ -1,25 +1,8 @@ // // Copyright 2018 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/plugin/sdrOsl/moduleDeps.cpp b/pxr/usd/plugin/sdrOsl/moduleDeps.cpp index 9316a18676..8aa2918554 100644 --- a/pxr/usd/plugin/sdrOsl/moduleDeps.cpp +++ b/pxr/usd/plugin/sdrOsl/moduleDeps.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/pxr/usd/plugin/sdrOsl/oslParser.cpp b/pxr/usd/plugin/sdrOsl/oslParser.cpp index 6f187d62ac..3d765b2b5b 100644 --- a/pxr/usd/plugin/sdrOsl/oslParser.cpp +++ b/pxr/usd/plugin/sdrOsl/oslParser.cpp @@ -1,25 +1,8 @@ // // Copyright 2018 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/base/gf/vec2f.h" diff --git a/pxr/usd/plugin/sdrOsl/oslParser.h b/pxr/usd/plugin/sdrOsl/oslParser.h index 980e53fc68..46734ef6de 100644 --- a/pxr/usd/plugin/sdrOsl/oslParser.h +++ b/pxr/usd/plugin/sdrOsl/oslParser.h @@ -1,25 +1,8 @@ // // Copyright 2018 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_PLUGIN_SDR_OSL_OSL_PARSER_H diff --git a/pxr/usd/plugin/sdrOsl/pch.h b/pxr/usd/plugin/sdrOsl/pch.h index f1a725cd6d..d10a719f4b 100644 --- a/pxr/usd/plugin/sdrOsl/pch.h +++ b/pxr/usd/plugin/sdrOsl/pch.h @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // // WARNING: THIS FILE IS GENERATED. DO NOT EDIT. // @@ -31,6 +14,7 @@ #include #endif #if defined(ARCH_OS_LINUX) +#include #include #endif #if defined(ARCH_OS_WINDOWS) @@ -38,12 +22,11 @@ #define WIN32_LEAN_AND_MEAN #endif +#include #include -#include -#include -#include #endif #include +#include #include #include #include @@ -55,20 +38,20 @@ #include #include #include -#include #include +#include #include #include #include #include #include #include -#include +#include +#include #include #include #include #include -#include #include #include #include @@ -80,42 +63,6 @@ #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #ifdef PXR_PYTHON_SUPPORT_ENABLED #include #include @@ -127,17 +74,6 @@ #undef toupper #endif #endif // PXR_PYTHON_SUPPORT_ENABLED -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #ifdef PXR_PYTHON_SUPPORT_ENABLED #include "pxr/base/tf/pySafePython.h" #endif // PXR_PYTHON_SUPPORT_ENABLED diff --git a/pxr/usd/plugin/sdrOsl/testenv/testOslParser.py b/pxr/usd/plugin/sdrOsl/testenv/testOslParser.py index 8010636e31..49a14c3703 100644 --- a/pxr/usd/plugin/sdrOsl/testenv/testOslParser.py +++ b/pxr/usd/plugin/sdrOsl/testenv/testOslParser.py @@ -2,25 +2,8 @@ # # Copyright 2018 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. import os import unittest diff --git a/pxr/usd/plugin/sdrOsl/wrapOslParser.cpp b/pxr/usd/plugin/sdrOsl/wrapOslParser.cpp index f371ea64ea..bc6ef1a287 100644 --- a/pxr/usd/plugin/sdrOsl/wrapOslParser.cpp +++ b/pxr/usd/plugin/sdrOsl/wrapOslParser.cpp @@ -1,25 +1,8 @@ // // Copyright 2018 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/plugin/usdAbc/__init__.py b/pxr/usd/plugin/usdAbc/__init__.py index 21792ee990..d830462be1 100644 --- a/pxr/usd/plugin/usdAbc/__init__.py +++ b/pxr/usd/plugin/usdAbc/__init__.py @@ -1,25 +1,8 @@ # # Copyright 2016 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # from pxr import Tf Tf.PreparePythonModule() diff --git a/pxr/usd/plugin/usdAbc/alembicData.cpp b/pxr/usd/plugin/usdAbc/alembicData.cpp index d65eeea839..2bb5551d72 100644 --- a/pxr/usd/plugin/usdAbc/alembicData.cpp +++ b/pxr/usd/plugin/usdAbc/alembicData.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // /// \file alembicData.cpp diff --git a/pxr/usd/plugin/usdAbc/alembicData.h b/pxr/usd/plugin/usdAbc/alembicData.h index 0988bb8c3c..856fa52e4a 100644 --- a/pxr/usd/plugin/usdAbc/alembicData.h +++ b/pxr/usd/plugin/usdAbc/alembicData.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_PLUGIN_USD_ABC_ALEMBIC_DATA_H #define PXR_USD_PLUGIN_USD_ABC_ALEMBIC_DATA_H diff --git a/pxr/usd/plugin/usdAbc/alembicFileFormat.cpp b/pxr/usd/plugin/usdAbc/alembicFileFormat.cpp index 7267a7d41c..8df07270db 100644 --- a/pxr/usd/plugin/usdAbc/alembicFileFormat.cpp +++ b/pxr/usd/plugin/usdAbc/alembicFileFormat.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/plugin/usdAbc/alembicFileFormat.h" diff --git a/pxr/usd/plugin/usdAbc/alembicFileFormat.h b/pxr/usd/plugin/usdAbc/alembicFileFormat.h index f62cbb143d..e8257a07a8 100644 --- a/pxr/usd/plugin/usdAbc/alembicFileFormat.h +++ b/pxr/usd/plugin/usdAbc/alembicFileFormat.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_PLUGIN_USD_ABC_ALEMBIC_FILE_FORMAT_H #define PXR_USD_PLUGIN_USD_ABC_ALEMBIC_FILE_FORMAT_H diff --git a/pxr/usd/plugin/usdAbc/alembicReader.cpp b/pxr/usd/plugin/usdAbc/alembicReader.cpp index a712d4a82b..7f3d28ce3c 100644 --- a/pxr/usd/plugin/usdAbc/alembicReader.cpp +++ b/pxr/usd/plugin/usdAbc/alembicReader.cpp @@ -1,25 +1,8 @@ // // Copyright 2016-2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // /// \file alembicReader.cpp diff --git a/pxr/usd/plugin/usdAbc/alembicReader.h b/pxr/usd/plugin/usdAbc/alembicReader.h index e1dec840d7..be2e8c9d63 100644 --- a/pxr/usd/plugin/usdAbc/alembicReader.h +++ b/pxr/usd/plugin/usdAbc/alembicReader.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_PLUGIN_USD_ABC_ALEMBIC_READER_H #define PXR_USD_PLUGIN_USD_ABC_ALEMBIC_READER_H diff --git a/pxr/usd/plugin/usdAbc/alembicTest.cpp b/pxr/usd/plugin/usdAbc/alembicTest.cpp index 9aa26a396c..9ec995ccfe 100644 --- a/pxr/usd/plugin/usdAbc/alembicTest.cpp +++ b/pxr/usd/plugin/usdAbc/alembicTest.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/plugin/usdAbc/alembicTest.h" diff --git a/pxr/usd/plugin/usdAbc/alembicTest.h b/pxr/usd/plugin/usdAbc/alembicTest.h index b1ea00258f..82d37c96ee 100644 --- a/pxr/usd/plugin/usdAbc/alembicTest.h +++ b/pxr/usd/plugin/usdAbc/alembicTest.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_PLUGIN_USD_ABC_ALEMBIC_TEST_H #define PXR_USD_PLUGIN_USD_ABC_ALEMBIC_TEST_H diff --git a/pxr/usd/plugin/usdAbc/alembicUtil.cpp b/pxr/usd/plugin/usdAbc/alembicUtil.cpp index 7265fae3b6..f47b7dcaba 100644 --- a/pxr/usd/plugin/usdAbc/alembicUtil.cpp +++ b/pxr/usd/plugin/usdAbc/alembicUtil.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // /// \file alembicUtil.cpp diff --git a/pxr/usd/plugin/usdAbc/alembicUtil.h b/pxr/usd/plugin/usdAbc/alembicUtil.h index 6d84c66999..6edd66bcfe 100644 --- a/pxr/usd/plugin/usdAbc/alembicUtil.h +++ b/pxr/usd/plugin/usdAbc/alembicUtil.h @@ -1,25 +1,8 @@ // // Copyright 2016-2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_PLUGIN_USD_ABC_ALEMBIC_UTIL_H #define PXR_USD_PLUGIN_USD_ABC_ALEMBIC_UTIL_H diff --git a/pxr/usd/plugin/usdAbc/alembicWriter.cpp b/pxr/usd/plugin/usdAbc/alembicWriter.cpp index 8f36cf9d11..a377d7f8f1 100644 --- a/pxr/usd/plugin/usdAbc/alembicWriter.cpp +++ b/pxr/usd/plugin/usdAbc/alembicWriter.cpp @@ -1,25 +1,8 @@ // // Copyright 2016-2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // /// \file alembicWriter.cpp diff --git a/pxr/usd/plugin/usdAbc/alembicWriter.h b/pxr/usd/plugin/usdAbc/alembicWriter.h index 1fa58c9177..4628e9e34e 100644 --- a/pxr/usd/plugin/usdAbc/alembicWriter.h +++ b/pxr/usd/plugin/usdAbc/alembicWriter.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_PLUGIN_USD_ABC_ALEMBIC_WRITER_H #define PXR_USD_PLUGIN_USD_ABC_ALEMBIC_WRITER_H diff --git a/pxr/usd/plugin/usdAbc/api.h b/pxr/usd/plugin/usdAbc/api.h index 6645bb338b..8c1ef63dfc 100644 --- a/pxr/usd/plugin/usdAbc/api.h +++ b/pxr/usd/plugin/usdAbc/api.h @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_PLUGIN_USD_ABC_API_H #define PXR_USD_PLUGIN_USD_ABC_API_H diff --git a/pxr/usd/plugin/usdAbc/module.cpp b/pxr/usd/plugin/usdAbc/module.cpp index d9457565e4..b72ca40ef7 100644 --- a/pxr/usd/plugin/usdAbc/module.cpp +++ b/pxr/usd/plugin/usdAbc/module.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/base/tf/pyModule.h" diff --git a/pxr/usd/plugin/usdAbc/moduleDeps.cpp b/pxr/usd/plugin/usdAbc/moduleDeps.cpp index 0eee7d1400..75dacb148f 100644 --- a/pxr/usd/plugin/usdAbc/moduleDeps.cpp +++ b/pxr/usd/plugin/usdAbc/moduleDeps.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/pxr/usd/plugin/usdAbc/pch.h b/pxr/usd/plugin/usdAbc/pch.h index f5c7e6fb6c..7dcdb4422f 100644 --- a/pxr/usd/plugin/usdAbc/pch.h +++ b/pxr/usd/plugin/usdAbc/pch.h @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // // WARNING: THIS FILE IS GENERATED. DO NOT EDIT. // @@ -48,13 +31,13 @@ #define WIN32_LEAN_AND_MEAN #endif +#include #include #include -#include -#include -#include +#include #endif #include +#include #include #include #include @@ -81,6 +64,8 @@ #include #include #include +#include +#include #include #include #include @@ -91,12 +76,14 @@ #include #include #include +#include #include #include #include #include #include #include +#include #include #include #include @@ -108,6 +95,7 @@ #include #include #include +#include #include #include #include @@ -124,54 +112,6 @@ #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #ifdef PXR_PYTHON_SUPPORT_ENABLED #include #include @@ -187,27 +127,9 @@ #undef toupper #endif #endif // PXR_PYTHON_SUPPORT_ENABLED -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include #include +#include #include #include #include @@ -215,7 +137,7 @@ #include #include #include -#include +#include #ifdef PXR_PYTHON_SUPPORT_ENABLED #include "pxr/base/tf/pySafePython.h" #endif // PXR_PYTHON_SUPPORT_ENABLED diff --git a/pxr/usd/plugin/usdAbc/testenv/testUsdAbcAlembicData.py b/pxr/usd/plugin/usdAbc/testenv/testUsdAbcAlembicData.py index 67434ceb2b..3340157c58 100644 --- a/pxr/usd/plugin/usdAbc/testenv/testUsdAbcAlembicData.py +++ b/pxr/usd/plugin/usdAbc/testenv/testUsdAbcAlembicData.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from pxr import Sdf, Usd, Vt, Gf, Tf, UsdAbc import sys, os, tempfile, unittest diff --git a/pxr/usd/plugin/usdAbc/testenv/testUsdAbcBugs.py b/pxr/usd/plugin/usdAbc/testenv/testUsdAbcBugs.py index d6da9b8c2f..1d32bb5c74 100644 --- a/pxr/usd/plugin/usdAbc/testenv/testUsdAbcBugs.py +++ b/pxr/usd/plugin/usdAbc/testenv/testUsdAbcBugs.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from pxr import Sdf, Usd, UsdAbc import unittest diff --git a/pxr/usd/plugin/usdAbc/testenv/testUsdAbcCamera.py b/pxr/usd/plugin/usdAbc/testenv/testUsdAbcCamera.py index 14c9eea413..3d1fdb6e86 100644 --- a/pxr/usd/plugin/usdAbc/testenv/testUsdAbcCamera.py +++ b/pxr/usd/plugin/usdAbc/testenv/testUsdAbcCamera.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from pxr import Sdf, Usd, UsdGeom, UsdAbc, UsdUtils, Gf import unittest diff --git a/pxr/usd/plugin/usdAbc/testenv/testUsdAbcConversionBasisCurves.py b/pxr/usd/plugin/usdAbc/testenv/testUsdAbcConversionBasisCurves.py index aca69d8e11..d87936e6bb 100644 --- a/pxr/usd/plugin/usdAbc/testenv/testUsdAbcConversionBasisCurves.py +++ b/pxr/usd/plugin/usdAbc/testenv/testUsdAbcConversionBasisCurves.py @@ -2,25 +2,8 @@ # # Copyright 2018 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. import unittest diff --git a/pxr/usd/plugin/usdAbc/testenv/testUsdAbcConversionHermiteCurves.py b/pxr/usd/plugin/usdAbc/testenv/testUsdAbcConversionHermiteCurves.py index fadd44baff..d209cebbea 100644 --- a/pxr/usd/plugin/usdAbc/testenv/testUsdAbcConversionHermiteCurves.py +++ b/pxr/usd/plugin/usdAbc/testenv/testUsdAbcConversionHermiteCurves.py @@ -2,25 +2,8 @@ # # Copyright 2020 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. import unittest diff --git a/pxr/usd/plugin/usdAbc/testenv/testUsdAbcConversionSubdiv.py b/pxr/usd/plugin/usdAbc/testenv/testUsdAbcConversionSubdiv.py index f6157043b8..a235844a27 100644 --- a/pxr/usd/plugin/usdAbc/testenv/testUsdAbcConversionSubdiv.py +++ b/pxr/usd/plugin/usdAbc/testenv/testUsdAbcConversionSubdiv.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from pxr import Usd, UsdAbc, UsdGeom, Gf import unittest diff --git a/pxr/usd/plugin/usdAbc/testenv/testUsdAbcFaceset.py b/pxr/usd/plugin/usdAbc/testenv/testUsdAbcFaceset.py index 9530ba33e0..383ef7cdfa 100644 --- a/pxr/usd/plugin/usdAbc/testenv/testUsdAbcFaceset.py +++ b/pxr/usd/plugin/usdAbc/testenv/testUsdAbcFaceset.py @@ -2,25 +2,8 @@ # # Copyright 2019 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from pxr import Usd, UsdAbc, UsdGeom, Gf import unittest diff --git a/pxr/usd/plugin/usdAbc/testenv/testUsdAbcIndexedProperties.py b/pxr/usd/plugin/usdAbc/testenv/testUsdAbcIndexedProperties.py index 354275dbba..ef81654484 100644 --- a/pxr/usd/plugin/usdAbc/testenv/testUsdAbcIndexedProperties.py +++ b/pxr/usd/plugin/usdAbc/testenv/testUsdAbcIndexedProperties.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from pxr import Sdf, Usd, UsdAbc import unittest, os diff --git a/pxr/usd/plugin/usdAbc/testenv/testUsdAbcInstancing.py b/pxr/usd/plugin/usdAbc/testenv/testUsdAbcInstancing.py index f615a84ab3..5f4be4bedc 100644 --- a/pxr/usd/plugin/usdAbc/testenv/testUsdAbcInstancing.py +++ b/pxr/usd/plugin/usdAbc/testenv/testUsdAbcInstancing.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from pxr import Sdf, Usd, UsdAbc import unittest, os diff --git a/pxr/usd/plugin/usdAbc/testenv/testUsdAbcIsConstant.py b/pxr/usd/plugin/usdAbc/testenv/testUsdAbcIsConstant.py index b6e74eb97f..f284ff8e33 100644 --- a/pxr/usd/plugin/usdAbc/testenv/testUsdAbcIsConstant.py +++ b/pxr/usd/plugin/usdAbc/testenv/testUsdAbcIsConstant.py @@ -2,25 +2,8 @@ # # Copyright 2020 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from pxr import Usd, UsdGeom import unittest diff --git a/pxr/usd/plugin/usdAbc/testenv/testUsdAbcP_OldEncoding.py b/pxr/usd/plugin/usdAbc/testenv/testUsdAbcP_OldEncoding.py index 56db11c277..fed87f9119 100644 --- a/pxr/usd/plugin/usdAbc/testenv/testUsdAbcP_OldEncoding.py +++ b/pxr/usd/plugin/usdAbc/testenv/testUsdAbcP_OldEncoding.py @@ -2,25 +2,8 @@ # # Copyright 2018 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from pxr import Usd, UsdGeom, Gf, Vt import unittest diff --git a/pxr/usd/plugin/usdAbc/testenv/testUsdAbcSDFArguments.py b/pxr/usd/plugin/usdAbc/testenv/testUsdAbcSDFArguments.py index a3a53fb68c..794665e252 100644 --- a/pxr/usd/plugin/usdAbc/testenv/testUsdAbcSDFArguments.py +++ b/pxr/usd/plugin/usdAbc/testenv/testUsdAbcSDFArguments.py @@ -2,25 +2,8 @@ # # Copyright 2020 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from pxr import Usd, UsdGeom import unittest diff --git a/pxr/usd/plugin/usdAbc/testenv/testUsdAbcUvReadWrite.py b/pxr/usd/plugin/usdAbc/testenv/testUsdAbcUvReadWrite.py index c105c5a4c1..7a5c23b4f1 100644 --- a/pxr/usd/plugin/usdAbc/testenv/testUsdAbcUvReadWrite.py +++ b/pxr/usd/plugin/usdAbc/testenv/testUsdAbcUvReadWrite.py @@ -2,25 +2,8 @@ # # Copyright 2018 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from pxr import Usd, UsdAbc, UsdGeom import tempfile, unittest diff --git a/pxr/usd/plugin/usdAbc/testenv/testUsdAbcUvReadWrite_OldEncoding.py b/pxr/usd/plugin/usdAbc/testenv/testUsdAbcUvReadWrite_OldEncoding.py index e162546acd..4137001b48 100644 --- a/pxr/usd/plugin/usdAbc/testenv/testUsdAbcUvReadWrite_OldEncoding.py +++ b/pxr/usd/plugin/usdAbc/testenv/testUsdAbcUvReadWrite_OldEncoding.py @@ -2,25 +2,8 @@ # # Copyright 2018 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from pxr import Usd, UsdAbc, UsdGeom import tempfile, unittest diff --git a/pxr/usd/plugin/usdAbc/testenv/testUsdAbcXformPrimCollapsing.py b/pxr/usd/plugin/usdAbc/testenv/testUsdAbcXformPrimCollapsing.py index 88c8e40cb5..d360de4206 100644 --- a/pxr/usd/plugin/usdAbc/testenv/testUsdAbcXformPrimCollapsing.py +++ b/pxr/usd/plugin/usdAbc/testenv/testUsdAbcXformPrimCollapsing.py @@ -2,25 +2,8 @@ # # Copyright 2022 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from pxr import Usd from pxr import UsdGeom diff --git a/pxr/usd/plugin/usdAbc/wrapAlembicTest.cpp b/pxr/usd/plugin/usdAbc/wrapAlembicTest.cpp index 8f0328dfbd..31a5862c0b 100644 --- a/pxr/usd/plugin/usdAbc/wrapAlembicTest.cpp +++ b/pxr/usd/plugin/usdAbc/wrapAlembicTest.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/plugin/usdDraco/__init__.py b/pxr/usd/plugin/usdDraco/__init__.py index 362927c080..9e37da7762 100644 --- a/pxr/usd/plugin/usdDraco/__init__.py +++ b/pxr/usd/plugin/usdDraco/__init__.py @@ -1,25 +1,8 @@ # # Copyright 2019 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # from pxr import Tf Tf.PreparePythonModule() diff --git a/pxr/usd/plugin/usdDraco/attributeDescriptor.cpp b/pxr/usd/plugin/usdDraco/attributeDescriptor.cpp index f5566ed7bb..b15fbc9b88 100644 --- a/pxr/usd/plugin/usdDraco/attributeDescriptor.cpp +++ b/pxr/usd/plugin/usdDraco/attributeDescriptor.cpp @@ -1,25 +1,8 @@ // // Copyright 2019 Google LLC // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "attributeDescriptor.h" diff --git a/pxr/usd/plugin/usdDraco/attributeDescriptor.h b/pxr/usd/plugin/usdDraco/attributeDescriptor.h index 964888aeeb..35f22ea8f3 100644 --- a/pxr/usd/plugin/usdDraco/attributeDescriptor.h +++ b/pxr/usd/plugin/usdDraco/attributeDescriptor.h @@ -1,25 +1,8 @@ // // Copyright 2019 Google LLC // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_PLUGIN_USD_DRACO_ATTRIBUTE_DESCRIPTOR_H diff --git a/pxr/usd/plugin/usdDraco/attributeFactory.cpp b/pxr/usd/plugin/usdDraco/attributeFactory.cpp index 2a3560c07b..c7f47fb25c 100644 --- a/pxr/usd/plugin/usdDraco/attributeFactory.cpp +++ b/pxr/usd/plugin/usdDraco/attributeFactory.cpp @@ -1,25 +1,8 @@ // // Copyright 2019 Google LLC // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "attributeFactory.h" diff --git a/pxr/usd/plugin/usdDraco/attributeFactory.h b/pxr/usd/plugin/usdDraco/attributeFactory.h index 6de11846e5..d6d57a8847 100644 --- a/pxr/usd/plugin/usdDraco/attributeFactory.h +++ b/pxr/usd/plugin/usdDraco/attributeFactory.h @@ -1,25 +1,8 @@ // // Copyright 2019 Google LLC // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_PLUGIN_USD_DRACO_ATTRIBUTE_FACTORY_H diff --git a/pxr/usd/plugin/usdDraco/exportAttribute.h b/pxr/usd/plugin/usdDraco/exportAttribute.h index 9e3905e628..7a94b378ed 100644 --- a/pxr/usd/plugin/usdDraco/exportAttribute.h +++ b/pxr/usd/plugin/usdDraco/exportAttribute.h @@ -1,25 +1,8 @@ // // Copyright 2019 Google LLC // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_PLUGIN_USD_DRACO_EXPORT_ATTRIBUTE_H diff --git a/pxr/usd/plugin/usdDraco/exportTranslator.cpp b/pxr/usd/plugin/usdDraco/exportTranslator.cpp index b5f5ba72f5..529f4854d2 100644 --- a/pxr/usd/plugin/usdDraco/exportTranslator.cpp +++ b/pxr/usd/plugin/usdDraco/exportTranslator.cpp @@ -1,25 +1,8 @@ // // Copyright 2019 Google LLC // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "attributeDescriptor.h" diff --git a/pxr/usd/plugin/usdDraco/exportTranslator.h b/pxr/usd/plugin/usdDraco/exportTranslator.h index 2957b4ca9a..b002b4603a 100644 --- a/pxr/usd/plugin/usdDraco/exportTranslator.h +++ b/pxr/usd/plugin/usdDraco/exportTranslator.h @@ -1,25 +1,8 @@ // // Copyright 2019 Google LLC // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_PLUGIN_USD_DRACO_EXPORT_TRANSLATOR_H diff --git a/pxr/usd/plugin/usdDraco/fileFormat.cpp b/pxr/usd/plugin/usdDraco/fileFormat.cpp index 55899b581a..790420db26 100644 --- a/pxr/usd/plugin/usdDraco/fileFormat.cpp +++ b/pxr/usd/plugin/usdDraco/fileFormat.cpp @@ -1,25 +1,8 @@ // // Copyright 2019 Google LLC // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "fileFormat.h" diff --git a/pxr/usd/plugin/usdDraco/fileFormat.h b/pxr/usd/plugin/usdDraco/fileFormat.h index aa64022c06..c6e419017a 100644 --- a/pxr/usd/plugin/usdDraco/fileFormat.h +++ b/pxr/usd/plugin/usdDraco/fileFormat.h @@ -1,25 +1,8 @@ // // Copyright 2019 Google LLC // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_PLUGIN_USD_DRACO_FILE_FORMAT_H diff --git a/pxr/usd/plugin/usdDraco/flag.h b/pxr/usd/plugin/usdDraco/flag.h index 62317570e1..d3f1acc5b8 100644 --- a/pxr/usd/plugin/usdDraco/flag.h +++ b/pxr/usd/plugin/usdDraco/flag.h @@ -1,25 +1,8 @@ // // Copyright 2019 Google LLC // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_PLUGIN_USD_DRACO_FLAG_H diff --git a/pxr/usd/plugin/usdDraco/importAttribute.h b/pxr/usd/plugin/usdDraco/importAttribute.h index fcc55b2eaa..e2e9e653dd 100644 --- a/pxr/usd/plugin/usdDraco/importAttribute.h +++ b/pxr/usd/plugin/usdDraco/importAttribute.h @@ -1,25 +1,8 @@ // // Copyright 2019 Google LLC // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_PLUGIN_USD_DRACO_IMPORT_ATTRIBUTE_H diff --git a/pxr/usd/plugin/usdDraco/importTranslator.cpp b/pxr/usd/plugin/usdDraco/importTranslator.cpp index 81348a4554..504084d2a4 100644 --- a/pxr/usd/plugin/usdDraco/importTranslator.cpp +++ b/pxr/usd/plugin/usdDraco/importTranslator.cpp @@ -1,25 +1,8 @@ // // Copyright 2019 Google LLC // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "importTranslator.h" diff --git a/pxr/usd/plugin/usdDraco/importTranslator.h b/pxr/usd/plugin/usdDraco/importTranslator.h index 7025aa43b3..789d74e3ab 100644 --- a/pxr/usd/plugin/usdDraco/importTranslator.h +++ b/pxr/usd/plugin/usdDraco/importTranslator.h @@ -1,25 +1,8 @@ // // Copyright 2019 Google LLC // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_PLUGIN_USD_DRACO_IMPORT_TRANSLATOR_H diff --git a/pxr/usd/plugin/usdDraco/module.cpp b/pxr/usd/plugin/usdDraco/module.cpp index 725c5ed5ca..041401e3f9 100644 --- a/pxr/usd/plugin/usdDraco/module.cpp +++ b/pxr/usd/plugin/usdDraco/module.cpp @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/plugin/usdDraco/moduleDeps.cpp b/pxr/usd/plugin/usdDraco/moduleDeps.cpp index 161ab63f8f..088737c878 100644 --- a/pxr/usd/plugin/usdDraco/moduleDeps.cpp +++ b/pxr/usd/plugin/usdDraco/moduleDeps.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/pxr/usd/plugin/usdDraco/pch.h b/pxr/usd/plugin/usdDraco/pch.h index aff99924d4..75f23d1712 100644 --- a/pxr/usd/plugin/usdDraco/pch.h +++ b/pxr/usd/plugin/usdDraco/pch.h @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // // WARNING: THIS FILE IS GENERATED. DO NOT EDIT. // @@ -31,6 +14,7 @@ #include #endif #if defined(ARCH_OS_LINUX) +#include #include #endif #if defined(ARCH_OS_WINDOWS) @@ -38,12 +22,11 @@ #define WIN32_LEAN_AND_MEAN #endif +#include #include -#include -#include -#include #endif #include +#include #include #include #include @@ -68,8 +51,9 @@ #include #include #include -#include #include +#include +#include #include #include #include @@ -78,60 +62,15 @@ #include #include #include +#include #include #include #include #include #include #include +#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #ifdef PXR_PYTHON_SUPPORT_ENABLED #include #include @@ -147,30 +86,14 @@ #undef toupper #endif #endif // PXR_PYTHON_SUPPORT_ENABLED -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include #include +#include #include #include -#include +#include #include +#include #include #include #include @@ -178,7 +101,7 @@ #include #include #include -#include +#include #ifdef PXR_PYTHON_SUPPORT_ENABLED #include "pxr/base/tf/pySafePython.h" #endif // PXR_PYTHON_SUPPORT_ENABLED diff --git a/pxr/usd/plugin/usdDraco/wrapDraco.cpp b/pxr/usd/plugin/usdDraco/wrapDraco.cpp index cfb2788e0d..27766fe6e7 100644 --- a/pxr/usd/plugin/usdDraco/wrapDraco.cpp +++ b/pxr/usd/plugin/usdDraco/wrapDraco.cpp @@ -1,25 +1,8 @@ // // Copyright 2019 Google LLC // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "writer.h" diff --git a/pxr/usd/plugin/usdDraco/writer.cpp b/pxr/usd/plugin/usdDraco/writer.cpp index b13dfd630f..2bc9d20047 100644 --- a/pxr/usd/plugin/usdDraco/writer.cpp +++ b/pxr/usd/plugin/usdDraco/writer.cpp @@ -1,25 +1,8 @@ // // Copyright 2019 Google LLC // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "exportTranslator.h" diff --git a/pxr/usd/plugin/usdDraco/writer.h b/pxr/usd/plugin/usdDraco/writer.h index 9e9fd924df..2ceabca472 100644 --- a/pxr/usd/plugin/usdDraco/writer.h +++ b/pxr/usd/plugin/usdDraco/writer.h @@ -1,25 +1,8 @@ // // Copyright 2019 Google LLC // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_PLUGIN_USD_DRACO_WRITER_H diff --git a/pxr/usd/sdf/CMakeLists.txt b/pxr/usd/sdf/CMakeLists.txt index c4c76c96d1..b7fc0afc1c 100644 --- a/pxr/usd/sdf/CMakeLists.txt +++ b/pxr/usd/sdf/CMakeLists.txt @@ -6,14 +6,17 @@ pxr_library(sdf arch tf gf + pegtl trace vt work ar ${Boost_PYTHON_LIBRARY} + ${TBB_tbb_LIBRARY} INCLUDE_DIRS ${Boost_INCLUDE_DIRS} + ${TBB_INCLUDE_DIRS} PUBLIC_CLASSES abstractData @@ -51,6 +54,7 @@ pxr_library(sdf pathExpression pathExpressionEval pathNode + pathPattern pathTable payload pool @@ -94,8 +98,8 @@ pxr_library(sdf api.h accessorHelpers.h declareSpec.h - invoke.hpp layerHints.h + pathPatternParser.h predicateExpressionParser.h predicateProgram.h schemaTypeRegistration.h @@ -152,6 +156,7 @@ pxr_library(sdf wrapOpaqueValue.cpp wrapPath.cpp wrapPathExpression.cpp + wrapPathPattern.cpp wrapPayload.cpp wrapPredicateExpression.cpp wrapPredicateFunctionResult.cpp diff --git a/pxr/usd/sdf/__init__.py b/pxr/usd/sdf/__init__.py index a60b822189..9d07ac61f5 100644 --- a/pxr/usd/sdf/__init__.py +++ b/pxr/usd/sdf/__init__.py @@ -1,25 +1,8 @@ # # Copyright 2016 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # from pxr import Tf Tf.PreparePythonModule() diff --git a/pxr/usd/sdf/abstractData.cpp b/pxr/usd/sdf/abstractData.cpp index 816cbf7657..4670ba1d3d 100644 --- a/pxr/usd/sdf/abstractData.cpp +++ b/pxr/usd/sdf/abstractData.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/sdf/abstractData.h" diff --git a/pxr/usd/sdf/abstractData.h b/pxr/usd/sdf/abstractData.h index 493d4c3ab0..fb5e23e235 100644 --- a/pxr/usd/sdf/abstractData.h +++ b/pxr/usd/sdf/abstractData.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDF_ABSTRACT_DATA_H #define PXR_USD_SDF_ABSTRACT_DATA_H diff --git a/pxr/usd/sdf/accessorHelpers.h b/pxr/usd/sdf/accessorHelpers.h index c11b260fe2..8d879996e4 100644 --- a/pxr/usd/sdf/accessorHelpers.h +++ b/pxr/usd/sdf/accessorHelpers.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDF_ACCESSOR_HELPERS_H #define PXR_USD_SDF_ACCESSOR_HELPERS_H diff --git a/pxr/usd/sdf/allowed.cpp b/pxr/usd/sdf/allowed.cpp index cc122e8acb..43cab846a7 100644 --- a/pxr/usd/sdf/allowed.cpp +++ b/pxr/usd/sdf/allowed.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // /// \file Allowed.cpp diff --git a/pxr/usd/sdf/allowed.h b/pxr/usd/sdf/allowed.h index 10977bd7a2..0cc0bcd072 100644 --- a/pxr/usd/sdf/allowed.h +++ b/pxr/usd/sdf/allowed.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDF_ALLOWED_H #define PXR_USD_SDF_ALLOWED_H diff --git a/pxr/usd/sdf/api.h b/pxr/usd/sdf/api.h index 8400c4d857..2bc13e3c05 100644 --- a/pxr/usd/sdf/api.h +++ b/pxr/usd/sdf/api.h @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDF_API_H #define PXR_USD_SDF_API_H diff --git a/pxr/usd/sdf/assetPath.cpp b/pxr/usd/sdf/assetPath.cpp index 071e5a9a08..67d71e6cb5 100644 --- a/pxr/usd/sdf/assetPath.cpp +++ b/pxr/usd/sdf/assetPath.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/sdf/assetPath.h" diff --git a/pxr/usd/sdf/assetPath.h b/pxr/usd/sdf/assetPath.h index 05a00072fa..4477e048e0 100644 --- a/pxr/usd/sdf/assetPath.h +++ b/pxr/usd/sdf/assetPath.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDF_ASSET_PATH_H #define PXR_USD_SDF_ASSET_PATH_H diff --git a/pxr/usd/sdf/assetPathResolver.cpp b/pxr/usd/sdf/assetPathResolver.cpp index 80b9892b9a..9cef5cafac 100644 --- a/pxr/usd/sdf/assetPathResolver.cpp +++ b/pxr/usd/sdf/assetPathResolver.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // /// /// \file Sdf/AssetPathResolver.cpp diff --git a/pxr/usd/sdf/assetPathResolver.h b/pxr/usd/sdf/assetPathResolver.h index ff5f4868a9..eee3624c8f 100644 --- a/pxr/usd/sdf/assetPathResolver.h +++ b/pxr/usd/sdf/assetPathResolver.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDF_ASSET_PATH_RESOLVER_H #define PXR_USD_SDF_ASSET_PATH_RESOLVER_H diff --git a/pxr/usd/sdf/attributeSpec.cpp b/pxr/usd/sdf/attributeSpec.cpp index f54d0b0620..85c27c4310 100644 --- a/pxr/usd/sdf/attributeSpec.cpp +++ b/pxr/usd/sdf/attributeSpec.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // /// \file AttributeSpec.cpp diff --git a/pxr/usd/sdf/attributeSpec.h b/pxr/usd/sdf/attributeSpec.h index 6f37ba73ff..d34d22cf7d 100644 --- a/pxr/usd/sdf/attributeSpec.h +++ b/pxr/usd/sdf/attributeSpec.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDF_ATTRIBUTE_SPEC_H #define PXR_USD_SDF_ATTRIBUTE_SPEC_H diff --git a/pxr/usd/sdf/changeBlock.cpp b/pxr/usd/sdf/changeBlock.cpp index 4b52505745..c21a1ddca0 100644 --- a/pxr/usd/sdf/changeBlock.cpp +++ b/pxr/usd/sdf/changeBlock.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/sdf/changeBlock.h b/pxr/usd/sdf/changeBlock.h index 8d8c272a35..1e314beafd 100644 --- a/pxr/usd/sdf/changeBlock.h +++ b/pxr/usd/sdf/changeBlock.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDF_CHANGE_BLOCK_H #define PXR_USD_SDF_CHANGE_BLOCK_H diff --git a/pxr/usd/sdf/changeList.cpp b/pxr/usd/sdf/changeList.cpp index 9167765f78..4138d49f0d 100644 --- a/pxr/usd/sdf/changeList.cpp +++ b/pxr/usd/sdf/changeList.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/sdf/changeList.h b/pxr/usd/sdf/changeList.h index 99c77088c5..4e07718656 100644 --- a/pxr/usd/sdf/changeList.h +++ b/pxr/usd/sdf/changeList.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDF_CHANGE_LIST_H #define PXR_USD_SDF_CHANGE_LIST_H diff --git a/pxr/usd/sdf/changeManager.cpp b/pxr/usd/sdf/changeManager.cpp index 7ea592d04b..8d34e6e181 100644 --- a/pxr/usd/sdf/changeManager.cpp +++ b/pxr/usd/sdf/changeManager.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" @@ -34,7 +17,7 @@ #include "pxr/base/tf/instantiateSingleton.h" #include "pxr/base/tf/stackTrace.h" -#include +#include using std::string; using std::vector; @@ -150,9 +133,9 @@ Sdf_ChangeManager::_ProcessRemoveIfInert(_Data *data) TF_VERIFY(data->outermostBlock); } -static tbb::atomic & +static std::atomic & _InitChangeSerialNumber() { - static tbb::atomic value; + static std::atomic value; value = 1; return value; } @@ -191,8 +174,8 @@ Sdf_ChangeManager::_SendNotices(_Data *data) } // Obtain a serial number for this round of change processing. - static tbb::atomic &changeSerialNumber = _InitChangeSerialNumber(); - size_t serialNumber = changeSerialNumber.fetch_and_increment(); + static std::atomic &changeSerialNumber = _InitChangeSerialNumber(); + size_t serialNumber = changeSerialNumber.fetch_add(1); // Send global notice. SdfNotice::LayersDidChange(changes, serialNumber).Send(); diff --git a/pxr/usd/sdf/changeManager.h b/pxr/usd/sdf/changeManager.h index 42789d7085..ab193e75e6 100644 --- a/pxr/usd/sdf/changeManager.h +++ b/pxr/usd/sdf/changeManager.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDF_CHANGE_MANAGER_H #define PXR_USD_SDF_CHANGE_MANAGER_H diff --git a/pxr/usd/sdf/children.cpp b/pxr/usd/sdf/children.cpp index 8a5b3b61f5..55eb4a9747 100644 --- a/pxr/usd/sdf/children.cpp +++ b/pxr/usd/sdf/children.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/sdf/children.h b/pxr/usd/sdf/children.h index d5434c1d1b..668cb52834 100644 --- a/pxr/usd/sdf/children.h +++ b/pxr/usd/sdf/children.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDF_CHILDREN_H #define PXR_USD_SDF_CHILDREN_H diff --git a/pxr/usd/sdf/childrenPolicies.cpp b/pxr/usd/sdf/childrenPolicies.cpp index cba4baa6d7..41c834f16a 100644 --- a/pxr/usd/sdf/childrenPolicies.cpp +++ b/pxr/usd/sdf/childrenPolicies.cpp @@ -1,24 +1,7 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/sdf/childrenPolicies.h" diff --git a/pxr/usd/sdf/childrenPolicies.h b/pxr/usd/sdf/childrenPolicies.h index 57fefb710b..b13d852035 100644 --- a/pxr/usd/sdf/childrenPolicies.h +++ b/pxr/usd/sdf/childrenPolicies.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDF_CHILDREN_POLICIES_H #define PXR_USD_SDF_CHILDREN_POLICIES_H diff --git a/pxr/usd/sdf/childrenProxy.cpp b/pxr/usd/sdf/childrenProxy.cpp index 57aa6db094..94d2d19de8 100644 --- a/pxr/usd/sdf/childrenProxy.cpp +++ b/pxr/usd/sdf/childrenProxy.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // /// \file ChildrenProxy.cpp diff --git a/pxr/usd/sdf/childrenProxy.h b/pxr/usd/sdf/childrenProxy.h index 651d1ed082..f51552853d 100644 --- a/pxr/usd/sdf/childrenProxy.h +++ b/pxr/usd/sdf/childrenProxy.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDF_CHILDREN_PROXY_H #define PXR_USD_SDF_CHILDREN_PROXY_H diff --git a/pxr/usd/sdf/childrenUtils.cpp b/pxr/usd/sdf/childrenUtils.cpp index 55e00ade84..3024c42557 100644 --- a/pxr/usd/sdf/childrenUtils.cpp +++ b/pxr/usd/sdf/childrenUtils.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // /// \file ChildrenUtils.cpp diff --git a/pxr/usd/sdf/childrenUtils.h b/pxr/usd/sdf/childrenUtils.h index 60f6f9d46f..1f216ccb15 100644 --- a/pxr/usd/sdf/childrenUtils.h +++ b/pxr/usd/sdf/childrenUtils.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDF_CHILDREN_UTILS_H #define PXR_USD_SDF_CHILDREN_UTILS_H diff --git a/pxr/usd/sdf/childrenView.cpp b/pxr/usd/sdf/childrenView.cpp index cf5b87cea6..b954aefbee 100644 --- a/pxr/usd/sdf/childrenView.cpp +++ b/pxr/usd/sdf/childrenView.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // /// \file ChildrenView.cpp diff --git a/pxr/usd/sdf/childrenView.h b/pxr/usd/sdf/childrenView.h index 0990fee688..85f84626d7 100644 --- a/pxr/usd/sdf/childrenView.h +++ b/pxr/usd/sdf/childrenView.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDF_CHILDREN_VIEW_H #define PXR_USD_SDF_CHILDREN_VIEW_H diff --git a/pxr/usd/sdf/cleanupEnabler.cpp b/pxr/usd/sdf/cleanupEnabler.cpp index b849bd9c62..530ea3ecf2 100644 --- a/pxr/usd/sdf/cleanupEnabler.cpp +++ b/pxr/usd/sdf/cleanupEnabler.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/sdf/cleanupEnabler.h" diff --git a/pxr/usd/sdf/cleanupEnabler.h b/pxr/usd/sdf/cleanupEnabler.h index e947db77c4..06875b2957 100644 --- a/pxr/usd/sdf/cleanupEnabler.h +++ b/pxr/usd/sdf/cleanupEnabler.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDF_CLEANUP_ENABLER_H #define PXR_USD_SDF_CLEANUP_ENABLER_H diff --git a/pxr/usd/sdf/cleanupTracker.cpp b/pxr/usd/sdf/cleanupTracker.cpp index fa5c345c5c..7ec665863c 100644 --- a/pxr/usd/sdf/cleanupTracker.cpp +++ b/pxr/usd/sdf/cleanupTracker.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/sdf/cleanupTracker.h" diff --git a/pxr/usd/sdf/cleanupTracker.h b/pxr/usd/sdf/cleanupTracker.h index 185aab28ce..6044cc9f4c 100644 --- a/pxr/usd/sdf/cleanupTracker.h +++ b/pxr/usd/sdf/cleanupTracker.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDF_CLEANUP_TRACKER_H #define PXR_USD_SDF_CLEANUP_TRACKER_H diff --git a/pxr/usd/sdf/connectionListEditor.cpp b/pxr/usd/sdf/connectionListEditor.cpp index 7c5337421b..c6195eede7 100644 --- a/pxr/usd/sdf/connectionListEditor.cpp +++ b/pxr/usd/sdf/connectionListEditor.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/sdf/connectionListEditor.h" diff --git a/pxr/usd/sdf/connectionListEditor.h b/pxr/usd/sdf/connectionListEditor.h index e1b5decf03..404ba0442e 100644 --- a/pxr/usd/sdf/connectionListEditor.h +++ b/pxr/usd/sdf/connectionListEditor.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDF_CONNECTION_LIST_EDITOR_H #define PXR_USD_SDF_CONNECTION_LIST_EDITOR_H diff --git a/pxr/usd/sdf/copyUtils.cpp b/pxr/usd/sdf/copyUtils.cpp index 3a01d9b3b7..c82e892a1a 100644 --- a/pxr/usd/sdf/copyUtils.cpp +++ b/pxr/usd/sdf/copyUtils.cpp @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/sdf/copyUtils.h" diff --git a/pxr/usd/sdf/copyUtils.h b/pxr/usd/sdf/copyUtils.h index d4ae81f6c0..552185d3d3 100644 --- a/pxr/usd/sdf/copyUtils.h +++ b/pxr/usd/sdf/copyUtils.h @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDF_COPY_UTILS_H #define PXR_USD_SDF_COPY_UTILS_H diff --git a/pxr/usd/sdf/data.cpp b/pxr/usd/sdf/data.cpp index fdd74e2e3a..ba2dda3c80 100644 --- a/pxr/usd/sdf/data.cpp +++ b/pxr/usd/sdf/data.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/sdf/data.h b/pxr/usd/sdf/data.h index 96ffc7104d..59abefa603 100644 --- a/pxr/usd/sdf/data.h +++ b/pxr/usd/sdf/data.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDF_DATA_H #define PXR_USD_SDF_DATA_H diff --git a/pxr/usd/sdf/debugCodes.cpp b/pxr/usd/sdf/debugCodes.cpp index 8ade0d52a3..036e2f250c 100644 --- a/pxr/usd/sdf/debugCodes.cpp +++ b/pxr/usd/sdf/debugCodes.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/sdf/debugCodes.h" diff --git a/pxr/usd/sdf/debugCodes.h b/pxr/usd/sdf/debugCodes.h index 42ec367e99..9e9240bb85 100644 --- a/pxr/usd/sdf/debugCodes.h +++ b/pxr/usd/sdf/debugCodes.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDF_DEBUG_CODES_H #define PXR_USD_SDF_DEBUG_CODES_H diff --git a/pxr/usd/sdf/declareHandles.cpp b/pxr/usd/sdf/declareHandles.cpp index 49db4b8431..fc7008d776 100644 --- a/pxr/usd/sdf/declareHandles.cpp +++ b/pxr/usd/sdf/declareHandles.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/sdf/declareHandles.h b/pxr/usd/sdf/declareHandles.h index 2d3c86d682..a58d758b72 100644 --- a/pxr/usd/sdf/declareHandles.h +++ b/pxr/usd/sdf/declareHandles.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDF_DECLARE_HANDLES_H #define PXR_USD_SDF_DECLARE_HANDLES_H diff --git a/pxr/usd/sdf/declareSpec.h b/pxr/usd/sdf/declareSpec.h index dedd8133c6..e12442b5fd 100644 --- a/pxr/usd/sdf/declareSpec.h +++ b/pxr/usd/sdf/declareSpec.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDF_DECLARE_SPEC_H #define PXR_USD_SDF_DECLARE_SPEC_H diff --git a/pxr/usd/sdf/fileFormat.cpp b/pxr/usd/sdf/fileFormat.cpp index d5cbe18f41..9170c58ab0 100644 --- a/pxr/usd/sdf/fileFormat.cpp +++ b/pxr/usd/sdf/fileFormat.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // /// /// \file Sdf/fileFormat.cpp diff --git a/pxr/usd/sdf/fileFormat.h b/pxr/usd/sdf/fileFormat.h index a35f999d44..cec63c4423 100644 --- a/pxr/usd/sdf/fileFormat.h +++ b/pxr/usd/sdf/fileFormat.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDF_FILE_FORMAT_H #define PXR_USD_SDF_FILE_FORMAT_H diff --git a/pxr/usd/sdf/fileFormatRegistry.cpp b/pxr/usd/sdf/fileFormatRegistry.cpp index d78713d4a2..14976e881e 100644 --- a/pxr/usd/sdf/fileFormatRegistry.cpp +++ b/pxr/usd/sdf/fileFormatRegistry.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // /// /// \file Sdf/fileFormatRegistry.cpp diff --git a/pxr/usd/sdf/fileFormatRegistry.h b/pxr/usd/sdf/fileFormatRegistry.h index e0d422c0ed..d298731866 100644 --- a/pxr/usd/sdf/fileFormatRegistry.h +++ b/pxr/usd/sdf/fileFormatRegistry.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDF_FILE_FORMAT_REGISTRY_H #define PXR_USD_SDF_FILE_FORMAT_REGISTRY_H diff --git a/pxr/usd/sdf/fileIO.cpp b/pxr/usd/sdf/fileIO.cpp index 97279b41f2..74ad2dbaf9 100644 --- a/pxr/usd/sdf/fileIO.cpp +++ b/pxr/usd/sdf/fileIO.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // /// /// \file sdf/fileIO.cpp diff --git a/pxr/usd/sdf/fileIO.h b/pxr/usd/sdf/fileIO.h index 1c05f11be7..00fae21ece 100644 --- a/pxr/usd/sdf/fileIO.h +++ b/pxr/usd/sdf/fileIO.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDF_FILE_IO_H #define PXR_USD_SDF_FILE_IO_H diff --git a/pxr/usd/sdf/fileIO_Common.cpp b/pxr/usd/sdf/fileIO_Common.cpp index aef25670ff..aacedddccd 100644 --- a/pxr/usd/sdf/fileIO_Common.cpp +++ b/pxr/usd/sdf/fileIO_Common.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // // // FileIO_Common.cpp diff --git a/pxr/usd/sdf/fileIO_Common.h b/pxr/usd/sdf/fileIO_Common.h index 5cb64d07ca..8eb7196636 100644 --- a/pxr/usd/sdf/fileIO_Common.h +++ b/pxr/usd/sdf/fileIO_Common.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDF_FILE_IO_COMMON_H #define PXR_USD_SDF_FILE_IO_COMMON_H diff --git a/pxr/usd/sdf/identity.cpp b/pxr/usd/sdf/identity.cpp index 19b010c194..bfe04b98ed 100644 --- a/pxr/usd/sdf/identity.cpp +++ b/pxr/usd/sdf/identity.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/sdf/identity.h b/pxr/usd/sdf/identity.h index a956221403..338c2bca94 100644 --- a/pxr/usd/sdf/identity.h +++ b/pxr/usd/sdf/identity.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDF_IDENTITY_H #define PXR_USD_SDF_IDENTITY_H diff --git a/pxr/usd/sdf/instantiatePool.h b/pxr/usd/sdf/instantiatePool.h index 749b2d11ef..c89a33d8cd 100644 --- a/pxr/usd/sdf/instantiatePool.h +++ b/pxr/usd/sdf/instantiatePool.h @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // /* * This header is not meant to be included in a .h file. diff --git a/pxr/usd/sdf/invoke.hpp b/pxr/usd/sdf/invoke.hpp deleted file mode 100644 index b39e9ffe52..0000000000 --- a/pxr/usd/sdf/invoke.hpp +++ /dev/null @@ -1,286 +0,0 @@ -/******************************************************************************* - * This file is part of the "https://github.com/blackmatov/invoke.hpp" - * For conditions of distribution and use, see copyright notice in LICENSE.md - * Copyright (C) 2018-2023, by Matvey Cherevko (blackmatov@gmail.com) - ******************************************************************************/ - -#pragma once - -#include -#include -#include -#include - -#define INVOKE_HPP_NOEXCEPT_DECLTYPE_RETURN(...) \ - noexcept(noexcept(__VA_ARGS__)) -> decltype (__VA_ARGS__) { return __VA_ARGS__; } - -#include "pxr/pxr.h" - -PXR_NAMESPACE_OPEN_SCOPE - -// -// void_t -// - -namespace invoke_hpp -{ - namespace impl - { - template < typename... Args > - struct make_void { - using type = void; - }; - } - - template < typename... Args > - using void_t = typename impl::make_void::type; -} - -// -// integer_sequence -// - -namespace invoke_hpp -{ - template < typename T, T... Ints > - struct integer_sequence { - using value_type = T; - static constexpr std::size_t size() noexcept { return sizeof...(Ints); } - }; - - template < std::size_t... Ints > - using index_sequence = integer_sequence; - - namespace impl - { - template < typename T, std::size_t N, T... Ints > - struct make_integer_sequence_impl - : make_integer_sequence_impl {}; - - template < typename T, T... Ints > - struct make_integer_sequence_impl - : integer_sequence {}; - } - - template < typename T, std::size_t N > - using make_integer_sequence = impl::make_integer_sequence_impl; - - template < std::size_t N > - using make_index_sequence = make_integer_sequence; - - template < typename... Ts > - using index_sequence_for = make_index_sequence; -} - -// -// is_reference_wrapper -// - -namespace invoke_hpp -{ - namespace impl - { - template < typename T > - struct is_reference_wrapper_impl - : std::false_type {}; - - template < typename U > - struct is_reference_wrapper_impl> - : std::true_type {}; - } - - template < typename T > - struct is_reference_wrapper - : impl::is_reference_wrapper_impl::type> {}; -} - -// -// invoke -// - -namespace invoke_hpp -{ - namespace impl - { - // - // invoke_member_object_impl - // - - template - < - typename Base, typename F, typename Derived, - typename std::enable_if::type>::value, int>::type = 0 - > - constexpr auto invoke_member_object_impl(F Base::* f, Derived&& ref) - INVOKE_HPP_NOEXCEPT_DECLTYPE_RETURN( - std::forward(ref).*f) - - template - < - typename Base, typename F, typename RefWrap, - typename std::enable_if::type>::value, int>::type = 0 - > - constexpr auto invoke_member_object_impl(F Base::* f, RefWrap&& ref) - INVOKE_HPP_NOEXCEPT_DECLTYPE_RETURN( - ref.get().*f) - - template - < - typename Base, typename F, typename Pointer, - typename std::enable_if< - !std::is_base_of::type>::value && - !is_reference_wrapper::type>::value - , int>::type = 0 - > - constexpr auto invoke_member_object_impl(F Base::* f, Pointer&& ptr) - INVOKE_HPP_NOEXCEPT_DECLTYPE_RETURN( - (*std::forward(ptr)).*f) - - // - // invoke_member_function_impl - // - - template - < - typename Base, typename F, typename Derived, typename... Args, - typename std::enable_if::type>::value, int>::type = 0 - > - constexpr auto invoke_member_function_impl(F Base::* f, Derived&& ref, Args&&... args) - INVOKE_HPP_NOEXCEPT_DECLTYPE_RETURN( - (std::forward(ref).*f)(std::forward(args)...)) - - template - < - typename Base, typename F, typename RefWrap, typename... Args, - typename std::enable_if::type>::value, int>::type = 0 - > - constexpr auto invoke_member_function_impl(F Base::* f, RefWrap&& ref, Args&&... args) - INVOKE_HPP_NOEXCEPT_DECLTYPE_RETURN( - (ref.get().*f)(std::forward(args)...)) - - template - < - typename Base, typename F, typename Pointer, typename... Args, - typename std::enable_if< - !std::is_base_of::type>::value && - !is_reference_wrapper::type>::value - , int>::type = 0 - > - constexpr auto invoke_member_function_impl(F Base::* f, Pointer&& ptr, Args&&... args) - INVOKE_HPP_NOEXCEPT_DECLTYPE_RETURN( - ((*std::forward(ptr)).*f)(std::forward(args)...)) - } - - template - < - typename F, typename... Args, - typename std::enable_if::type>::value, int>::type = 0 - > - constexpr auto invoke(F&& f, Args&&... args) - INVOKE_HPP_NOEXCEPT_DECLTYPE_RETURN( - std::forward(f)(std::forward(args)...)) - - template - < - typename F, typename T, - typename std::enable_if::type>::value, int>::type = 0 - > - constexpr auto invoke(F&& f, T&& t) - INVOKE_HPP_NOEXCEPT_DECLTYPE_RETURN( - impl::invoke_member_object_impl(std::forward(f), std::forward(t))) - - template - < - typename F, typename... Args, - typename std::enable_if::type>::value, int>::type = 0 - > - constexpr auto invoke(F&& f, Args&&... args) - INVOKE_HPP_NOEXCEPT_DECLTYPE_RETURN( - impl::invoke_member_function_impl(std::forward(f), std::forward(args)...)) -} - -// -// invoke_result -// - -namespace invoke_hpp -{ - namespace impl - { - struct invoke_result_impl_tag {}; - - template < typename Void, typename F, typename... Args > - struct invoke_result_impl {}; - - template < typename F, typename... Args > - struct invoke_result_impl(), std::declval()...))>, F, Args...> { - using type = decltype(invoke_hpp::invoke(std::declval(), std::declval()...)); - }; - } - - template < typename F, typename... Args > - struct invoke_result - : impl::invoke_result_impl {}; - - template < typename F, typename... Args > - using invoke_result_t = typename invoke_result::type; -} - -// -// is_invocable -// - -namespace invoke_hpp -{ - namespace impl - { - struct is_invocable_r_impl_tag {}; - - template < typename Void, typename R, typename F, typename... Args > - struct is_invocable_r_impl - : std::false_type {}; - - template < typename R, typename F, typename... Args > - struct is_invocable_r_impl>, R, F, Args...> - : std::conditional< - std::is_void::value, - std::true_type, - std::is_convertible, R>>::type {}; - } - - template < typename R, typename F, typename... Args > - struct is_invocable_r - : impl::is_invocable_r_impl {}; - - template < typename F, typename... Args > - using is_invocable = is_invocable_r; -} - -// -// apply -// - -namespace invoke_hpp -{ - namespace impl - { - template < typename F, typename Tuple, std::size_t... I > - constexpr auto apply_impl(F&& f, Tuple&& args, index_sequence) - INVOKE_HPP_NOEXCEPT_DECLTYPE_RETURN( - invoke_hpp::invoke( - std::forward(f), - std::get(std::forward(args))...)) - } - - template < typename F, typename Tuple > - constexpr auto apply(F&& f, Tuple&& args) - INVOKE_HPP_NOEXCEPT_DECLTYPE_RETURN( - impl::apply_impl( - std::forward(f), - std::forward(args), - make_index_sequence::type>::value>())) -} - -#undef INVOKE_HPP_NOEXCEPT_DECLTYPE_RETURN - -PXR_NAMESPACE_CLOSE_SCOPE diff --git a/pxr/usd/sdf/layer.cpp b/pxr/usd/sdf/layer.cpp index f938908774..b1a12e583e 100644 --- a/pxr/usd/sdf/layer.cpp +++ b/pxr/usd/sdf/layer.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // /// /// \file Sdf/layer.cpp @@ -1597,6 +1580,21 @@ SdfLayer::GetDefaultPrim() const return _GetValue(SdfFieldKeys->DefaultPrim); } +SdfPath +SdfLayer::GetDefaultPrimAsPath() const +{ + std::string pathString = + _GetValue(SdfFieldKeys->DefaultPrim).GetString(); + SdfPath path = SdfPath::IsValidPathString(pathString) + ? SdfPath(pathString) + : SdfPath(); + return path.IsPrimPath() + ? path.IsAbsolutePath() + ? path + : path.MakeAbsolutePath(SdfPath::AbsoluteRootPath()) + : SdfPath(); +} + void SdfLayer::ClearDefaultPrim() { @@ -3065,9 +3063,10 @@ SdfLayer::IsEmpty() const // XXX: What about documentation/frames? I don't // think these get composed or exposed through composition, so I don't think // they matter for the sake of this query. - return GetRootPrims().empty() && + return GetRootPrims().empty() && GetRootPrimOrder().empty() && - GetSubLayerPaths().empty(); + GetSubLayerPaths().empty() && + GetRelocates().empty(); } bool @@ -3971,7 +3970,12 @@ SdfLayer::_SetData(const SdfAbstractDataPtr &newData, if (!specDefinition->IsRequiredField(*field)) _PrimSetField(path, *field, VtValue()); } - _PrimDeleteSpec(*i, _IsInertSubtree(*i)); + + // Since we are deleting bottom up, we should only ever be + // considering prims which do not have children to determine + // inertness + _PrimDeleteSpec(*i, _IsInert(*i, true /*ignoreChildren*/, + true /* requiredFieldOnlyPropertiesAreInert */)); } } diff --git a/pxr/usd/sdf/layer.h b/pxr/usd/sdf/layer.h index e21bb3f100..1f11f49f39 100644 --- a/pxr/usd/sdf/layer.h +++ b/pxr/usd/sdf/layer.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDF_LAYER_H #define PXR_USD_SDF_LAYER_H @@ -836,18 +819,31 @@ class SdfLayer void SetComment(const std::string &comment); /// Return the defaultPrim metadata for this layer. This field - /// indicates the name of which root prim should be targeted by a reference - /// or payload to this layer that doesn't specify a prim path. + /// indicates the name or path of which prim should be targeted by a + /// reference or payload to this layer that doesn't specify a prim path. /// /// The default value is the empty token. SDF_API TfToken GetDefaultPrim() const; - /// Set the default prim metadata for this layer. The root prim with this - /// name will be targeted by a reference or a payload to this layer that - /// doesn't specify a prim path. Note that this must be a root prim - /// name not a path. E.g. "rootPrim" rather than "/rootPrim". See - /// GetDefaultPrim(). + /// Return this layer's default prim metadata interpreted as an absolute + /// prim path regardless of whether it was authored as a root prim name or a + /// prim path. For example, if the authored default prim value is + /// "rootPrim", return . If the authored default prim value is + /// "/path/to/non/root/prim", return . If the + /// authored default prim value cannot be interpreted as a prim path, + /// return the empty SdfPath. + /// + /// The default value is an empty path. + SDF_API + SdfPath GetDefaultPrimAsPath() const; + + /// Set the default prim metadata for this layer. The prim at this path + /// will be targeted by a reference or a payload to this layer that doesn't + /// specify a prim path. + /// Note that this can be a name if it refers to a root prim, or a path to + /// any prim in this layer. E.g. "rootPrim", "/path/to/non/root/prim" or + /// "/rootPrim". See GetDefaultPrim(). SDF_API void SetDefaultPrim(const TfToken &name); diff --git a/pxr/usd/sdf/layerHints.h b/pxr/usd/sdf/layerHints.h index 44554d0b38..d96c8ba662 100644 --- a/pxr/usd/sdf/layerHints.h +++ b/pxr/usd/sdf/layerHints.h @@ -1,25 +1,8 @@ // // Copyright 2020 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDF_LAYER_HINTS_H #define PXR_USD_SDF_LAYER_HINTS_H diff --git a/pxr/usd/sdf/layerOffset.cpp b/pxr/usd/sdf/layerOffset.cpp index 8bc5d73980..edad0d581c 100644 --- a/pxr/usd/sdf/layerOffset.cpp +++ b/pxr/usd/sdf/layerOffset.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // /// /// LayerOffset.cpp diff --git a/pxr/usd/sdf/layerOffset.h b/pxr/usd/sdf/layerOffset.h index c21ad9802b..a789f5ed65 100644 --- a/pxr/usd/sdf/layerOffset.h +++ b/pxr/usd/sdf/layerOffset.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDF_LAYER_OFFSET_H #define PXR_USD_SDF_LAYER_OFFSET_H diff --git a/pxr/usd/sdf/layerRegistry.cpp b/pxr/usd/sdf/layerRegistry.cpp index dd507ae449..2d6e5c28b5 100644 --- a/pxr/usd/sdf/layerRegistry.cpp +++ b/pxr/usd/sdf/layerRegistry.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // /// /// \file Sdf/LayerRegistry.cpp diff --git a/pxr/usd/sdf/layerRegistry.h b/pxr/usd/sdf/layerRegistry.h index 4c616bc4e8..fb507875ec 100644 --- a/pxr/usd/sdf/layerRegistry.h +++ b/pxr/usd/sdf/layerRegistry.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDF_LAYER_REGISTRY_H #define PXR_USD_SDF_LAYER_REGISTRY_H diff --git a/pxr/usd/sdf/layerStateDelegate.cpp b/pxr/usd/sdf/layerStateDelegate.cpp index 48647721d2..8e76da8e74 100644 --- a/pxr/usd/sdf/layerStateDelegate.cpp +++ b/pxr/usd/sdf/layerStateDelegate.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/sdf/layerStateDelegate.h b/pxr/usd/sdf/layerStateDelegate.h index e1d5bf90fb..a5a52b5df5 100644 --- a/pxr/usd/sdf/layerStateDelegate.h +++ b/pxr/usd/sdf/layerStateDelegate.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDF_LAYER_STATE_DELEGATE_H #define PXR_USD_SDF_LAYER_STATE_DELEGATE_H diff --git a/pxr/usd/sdf/layerTree.cpp b/pxr/usd/sdf/layerTree.cpp index 87e59fd3f2..51874f916b 100644 --- a/pxr/usd/sdf/layerTree.cpp +++ b/pxr/usd/sdf/layerTree.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // /// \file LayerTree.cpp diff --git a/pxr/usd/sdf/layerTree.h b/pxr/usd/sdf/layerTree.h index 9f127a1208..bb27b2ecbf 100644 --- a/pxr/usd/sdf/layerTree.h +++ b/pxr/usd/sdf/layerTree.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDF_LAYER_TREE_H #define PXR_USD_SDF_LAYER_TREE_H diff --git a/pxr/usd/sdf/layerUtils.cpp b/pxr/usd/sdf/layerUtils.cpp index 57f6df4214..828e948e5f 100644 --- a/pxr/usd/sdf/layerUtils.cpp +++ b/pxr/usd/sdf/layerUtils.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // /// /// \file sdf/layerUtils.cpp diff --git a/pxr/usd/sdf/layerUtils.h b/pxr/usd/sdf/layerUtils.h index e0d2fd4e77..17893823c3 100644 --- a/pxr/usd/sdf/layerUtils.h +++ b/pxr/usd/sdf/layerUtils.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDF_LAYER_UTILS_H #define PXR_USD_SDF_LAYER_UTILS_H diff --git a/pxr/usd/sdf/listEditor.cpp b/pxr/usd/sdf/listEditor.cpp index be5531b177..9b3d5f9e5c 100644 --- a/pxr/usd/sdf/listEditor.cpp +++ b/pxr/usd/sdf/listEditor.cpp @@ -1,24 +1,7 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/sdf/listEditor.h" diff --git a/pxr/usd/sdf/listEditor.h b/pxr/usd/sdf/listEditor.h index f7a636e625..4127769f36 100644 --- a/pxr/usd/sdf/listEditor.h +++ b/pxr/usd/sdf/listEditor.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDF_LIST_EDITOR_H #define PXR_USD_SDF_LIST_EDITOR_H diff --git a/pxr/usd/sdf/listEditorProxy.cpp b/pxr/usd/sdf/listEditorProxy.cpp index 8ebda381c0..e18be7d04c 100644 --- a/pxr/usd/sdf/listEditorProxy.cpp +++ b/pxr/usd/sdf/listEditorProxy.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // /// \file ListEditorProxy.cpp diff --git a/pxr/usd/sdf/listEditorProxy.h b/pxr/usd/sdf/listEditorProxy.h index 5f0f223349..20931281bd 100644 --- a/pxr/usd/sdf/listEditorProxy.h +++ b/pxr/usd/sdf/listEditorProxy.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDF_LIST_EDITOR_PROXY_H #define PXR_USD_SDF_LIST_EDITOR_PROXY_H diff --git a/pxr/usd/sdf/listOp.cpp b/pxr/usd/sdf/listOp.cpp index 9a2d4b9472..8a31c5adb4 100644 --- a/pxr/usd/sdf/listOp.cpp +++ b/pxr/usd/sdf/listOp.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/sdf/listOp.h b/pxr/usd/sdf/listOp.h index 01824396d0..19b24e087c 100644 --- a/pxr/usd/sdf/listOp.h +++ b/pxr/usd/sdf/listOp.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDF_LIST_OP_H #define PXR_USD_SDF_LIST_OP_H diff --git a/pxr/usd/sdf/listOpListEditor.cpp b/pxr/usd/sdf/listOpListEditor.cpp index 405b1f76e0..aa4401de0b 100644 --- a/pxr/usd/sdf/listOpListEditor.cpp +++ b/pxr/usd/sdf/listOpListEditor.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/sdf/listOpListEditor.h" diff --git a/pxr/usd/sdf/listOpListEditor.h b/pxr/usd/sdf/listOpListEditor.h index 218d675d18..3e1a3740b6 100644 --- a/pxr/usd/sdf/listOpListEditor.h +++ b/pxr/usd/sdf/listOpListEditor.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDF_LIST_OP_LIST_EDITOR_H #define PXR_USD_SDF_LIST_OP_LIST_EDITOR_H diff --git a/pxr/usd/sdf/listProxy.cpp b/pxr/usd/sdf/listProxy.cpp index 2aa4febd0c..88b2ae10f0 100644 --- a/pxr/usd/sdf/listProxy.cpp +++ b/pxr/usd/sdf/listProxy.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // /// \file ListProxy.cpp diff --git a/pxr/usd/sdf/listProxy.h b/pxr/usd/sdf/listProxy.h index 913617bbe8..895aa9ee63 100644 --- a/pxr/usd/sdf/listProxy.h +++ b/pxr/usd/sdf/listProxy.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDF_LIST_PROXY_H #define PXR_USD_SDF_LIST_PROXY_H @@ -58,6 +41,10 @@ class SdfListProxy { typedef typename TypePolicy::value_type value_type; typedef std::vector value_vector_type; + /// Returned from \ref Find when a value could not be located in the + /// list of operations. + static const size_t invalidIndex = -1; + private: // Proxies an item in a list editor list. class _ItemProxy { @@ -600,9 +587,11 @@ class SdfListProxy { return (_Validate() ? _listEditor->Count(_op, value) : 0); } + /// Returns the index of \p value in the list of operations. If \p value + /// is not found, then \ref invalidIndex is returned instead. size_t Find(const value_type& value) const { - return (_Validate() ? _listEditor->Find(_op, value) : size_t(-1)); + return (_Validate() ? _listEditor->Find(_op, value) : invalidIndex); } void Insert(int index, const value_type& value) @@ -616,7 +605,7 @@ class SdfListProxy { void Remove(const value_type& value) { size_t index = Find(value); - if (index != size_t(-1)) { + if (index != invalidIndex) { Erase(index); } else { diff --git a/pxr/usd/sdf/mapEditProxy.cpp b/pxr/usd/sdf/mapEditProxy.cpp index 5011473ebb..a63abca734 100644 --- a/pxr/usd/sdf/mapEditProxy.cpp +++ b/pxr/usd/sdf/mapEditProxy.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // /// \file MapEditProxy.cpp diff --git a/pxr/usd/sdf/mapEditProxy.h b/pxr/usd/sdf/mapEditProxy.h index fcd5f7d3eb..60344c359f 100644 --- a/pxr/usd/sdf/mapEditProxy.h +++ b/pxr/usd/sdf/mapEditProxy.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDF_MAP_EDIT_PROXY_H #define PXR_USD_SDF_MAP_EDIT_PROXY_H diff --git a/pxr/usd/sdf/mapEditor.cpp b/pxr/usd/sdf/mapEditor.cpp index b37ab857c6..410942cec7 100644 --- a/pxr/usd/sdf/mapEditor.cpp +++ b/pxr/usd/sdf/mapEditor.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/sdf/mapEditor.h b/pxr/usd/sdf/mapEditor.h index 161a81581c..c807890916 100644 --- a/pxr/usd/sdf/mapEditor.h +++ b/pxr/usd/sdf/mapEditor.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDF_MAP_EDITOR_H #define PXR_USD_SDF_MAP_EDITOR_H diff --git a/pxr/usd/sdf/module.cpp b/pxr/usd/sdf/module.cpp index 3df9a7612e..e04898f6bf 100644 --- a/pxr/usd/sdf/module.cpp +++ b/pxr/usd/sdf/module.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" @@ -45,7 +28,8 @@ TF_WRAP_MODULE TF_WRAP( OpaqueValue ); TF_WRAP( Path ); TF_WRAP( PredicateExpression ); - TF_WRAP( PathExpression ); // needs PredicateExpression for default args. + TF_WRAP( PathPattern ); + TF_WRAP( PathExpression ); // needs PathPattern & PredicateExpression. TF_WRAP( Payload ); TF_WRAP( PredicateFunctionResult ); TF_WRAP( Reference ); diff --git a/pxr/usd/sdf/moduleDeps.cpp b/pxr/usd/sdf/moduleDeps.cpp index f741db332f..636883c719 100644 --- a/pxr/usd/sdf/moduleDeps.cpp +++ b/pxr/usd/sdf/moduleDeps.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// @@ -38,6 +21,7 @@ TF_REGISTRY_FUNCTION(TfScriptModuleLoader) { TfToken("ar"), TfToken("arch"), TfToken("gf"), + TfToken("pegtl"), TfToken("plug"), TfToken("tf"), TfToken("trace"), diff --git a/pxr/usd/sdf/namespaceEdit.cpp b/pxr/usd/sdf/namespaceEdit.cpp index daa08a7c47..67a4ffb993 100644 --- a/pxr/usd/sdf/namespaceEdit.cpp +++ b/pxr/usd/sdf/namespaceEdit.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // /// \file namespaceEdit.cpp diff --git a/pxr/usd/sdf/namespaceEdit.h b/pxr/usd/sdf/namespaceEdit.h index 04ed4910c0..31d7ddafe8 100644 --- a/pxr/usd/sdf/namespaceEdit.h +++ b/pxr/usd/sdf/namespaceEdit.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDF_NAMESPACE_EDIT_H #define PXR_USD_SDF_NAMESPACE_EDIT_H diff --git a/pxr/usd/sdf/notice.cpp b/pxr/usd/sdf/notice.cpp index d15f010b52..640b1c2d0d 100644 --- a/pxr/usd/sdf/notice.cpp +++ b/pxr/usd/sdf/notice.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/sdf/notice.h b/pxr/usd/sdf/notice.h index 2cdda8a7b0..14fd2e182a 100644 --- a/pxr/usd/sdf/notice.h +++ b/pxr/usd/sdf/notice.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDF_NOTICE_H #define PXR_USD_SDF_NOTICE_H diff --git a/pxr/usd/sdf/opaqueValue.cpp b/pxr/usd/sdf/opaqueValue.cpp index a83aab40ef..edfcd39492 100644 --- a/pxr/usd/sdf/opaqueValue.cpp +++ b/pxr/usd/sdf/opaqueValue.cpp @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/sdf/opaqueValue.h" diff --git a/pxr/usd/sdf/opaqueValue.h b/pxr/usd/sdf/opaqueValue.h index d642b6c7a3..ccb0b2250b 100644 --- a/pxr/usd/sdf/opaqueValue.h +++ b/pxr/usd/sdf/opaqueValue.h @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDF_OPAQUE_VALUE_H #define PXR_USD_SDF_OPAQUE_VALUE_H diff --git a/pxr/usd/sdf/parserHelpers.cpp b/pxr/usd/sdf/parserHelpers.cpp index fe8f593eb1..6c78f58979 100644 --- a/pxr/usd/sdf/parserHelpers.cpp +++ b/pxr/usd/sdf/parserHelpers.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" @@ -66,7 +49,7 @@ using std::vector; if (index + count > vars.size()) { \ TF_CODING_ERROR("Not enough values to parse value of type %s", \ name); \ - throw boost::bad_get(); \ + throw std::bad_variant_access(); \ } inline void @@ -306,7 +289,7 @@ inline void MakeScalarValueImpl( SdfOpaqueValue *out, vector const &vars, size_t &index) { TF_CODING_ERROR("Found authored opinion for opaque attribute"); - throw boost::bad_get(); + throw std::bad_variant_access(); } template @@ -318,7 +301,7 @@ MakeScalarValueTemplate(vector const &, size_t origIndex = index; try { MakeScalarValueImpl(&t, vars, index); - } catch (const boost::bad_get &) { + } catch (const std::bad_variant_access &) { *errStrPtr = TfStringPrintf("Failed to parse value (at sub-part %zd " "if there are multiple parts)", (index - origIndex) - 1); @@ -347,7 +330,7 @@ MakeShapedValueTemplate(vector const &shape, MakeScalarValueImpl(&(*i), vars, index); shapeIndex++; } - } catch (const boost::bad_get &) { + } catch (const std::bad_variant_access &) { *errStrPtr = TfStringPrintf("Failed to parse at element %zd " "(at sub-part %zd if there are " "multiple parts)", shapeIndex, diff --git a/pxr/usd/sdf/parserHelpers.h b/pxr/usd/sdf/parserHelpers.h index 53a0eb7084..ec169d736c 100644 --- a/pxr/usd/sdf/parserHelpers.h +++ b/pxr/usd/sdf/parserHelpers.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDF_PARSER_HELPERS_H #define PXR_USD_SDF_PARSER_HELPERS_H @@ -31,8 +14,6 @@ #include "pxr/base/gf/numericCast.h" #include "pxr/base/vt/value.h" -#include - #include #include #include @@ -68,8 +49,8 @@ struct _GetImpl //////////////////////////////////////////////////////////////////////// // _GetImpl for integral type T. Convert finite doubles by static_cast, -// throw bad_get for non-finite doubles. Throw bad_get for out-of-range -// integral values. +// throw bad_variant_access for non-finite doubles. Throw bad_variant_access +// for out-of-range integral values. template struct _GetImpl< T, std::enable_if_t::value>> @@ -80,9 +61,9 @@ struct _GetImpl< return std::visit(*this, variant); } - // Fallback case: throw bad_get. + // Fallback case: throw bad_variant_access. template - T operator()(Held held) { throw boost::bad_get(); } + T operator()(Held held) { throw std::bad_variant_access(); } // Attempt to cast unsigned and signed int64_t. T operator()(uint64_t in) { return _Cast(in); } @@ -92,7 +73,7 @@ struct _GetImpl< T operator()(double in) { if (std::isfinite(in)) return _Cast(in); - throw boost::bad_get(); + throw std::bad_variant_access(); } private: @@ -101,7 +82,7 @@ struct _GetImpl< try { return GfNumericCast(in).value(); } catch (const std::bad_optional_access &) { - throw boost::bad_get(); + throw std::bad_variant_access(); } } }; @@ -121,9 +102,9 @@ struct _GetImpl< return std::visit(*this, variant); } - // Fallback case: throw bad_get. + // Fallback case: throw bad_variant_access. template - T operator()(Held held) { throw boost::bad_get(); } + T operator()(Held held) { throw std::bad_variant_access(); } // For numeric types, attempt to cast. T operator()(uint64_t in) { return _Cast(in); } @@ -143,7 +124,7 @@ struct _GetImpl< return -std::numeric_limits::infinity(); if (str == "nan") return std::numeric_limits::quiet_NaN(); - throw boost::bad_get(); + throw std::bad_variant_access(); } template @@ -151,7 +132,7 @@ struct _GetImpl< try { return GfNumericCast(in).value(); } catch (const std::bad_optional_access &) { - throw boost::bad_get(); + throw std::bad_variant_access(); } } }; @@ -159,7 +140,8 @@ struct _GetImpl< //////////////////////////////////////////////////////////////////////// -// Get an asset path: converts string to asset path, otherwise throw bad_get. +// Get an asset path: converts string to asset path, otherwise throw +// bad_variant_access. template <> struct _GetImpl { @@ -174,7 +156,7 @@ struct _GetImpl // Get a bool. Numbers are considered true if nonzero, false otherwise. // Strings and tokens get parsed via Sdf_BoolFromString. Otherwise throw -// bad_get. +// bad_variant_access. template <> struct _GetImpl { @@ -189,7 +171,7 @@ struct _GetImpl bool parseOK = false; bool result = Sdf_BoolFromString(str, &parseOK); if (!parseOK) - throw boost::bad_get(); + throw std::bad_variant_access(); return result; } @@ -203,10 +185,10 @@ struct _GetImpl return val != static_cast(0); } - // For anything else, throw bad_get(). + // For anything else, throw bad_variant_access(). template std::enable_if_t::value, bool> - operator()(T) { throw boost::bad_get(); } + operator()(T) { throw std::bad_variant_access(); } }; // A parser value. This is used as the fundamental value object in the text @@ -223,8 +205,9 @@ struct _GetImpl // to call Get() on a Value that's holding an integral type, a double, or // a string if that string's value is one of 'inf', '-inf', or 'nan'. Similarly // Get() works on numbers and strings like 'yes', 'no', 'on', 'off', -// 'true', 'false'. If a Get() call fails, it throws boost::bad_get, which -// the parser responds to and raises a parse error. +// 'true', 'false'. If a Get() call fails, it throws +// std::bad_variant_access, which the parser responds to and raises a parse +// error. // // The lexer constructs Value objects from input tokens. It creates them to // retain all the input information possible. For example, negative integers @@ -266,13 +249,13 @@ struct Value // Attempt to get a value of type T from this Value, applying appropriate // conversions. If this value cannot be converted to T, throw - // boost::bad_get. + // std::bad_variant_access. template typename _GetImpl::ResultType Get() const { try { return _GetImpl().Visit(_variant); } catch (std::bad_variant_access& e) { - throw boost::bad_get(); + throw std::bad_variant_access(); } } diff --git a/pxr/usd/sdf/parserValueContext.cpp b/pxr/usd/sdf/parserValueContext.cpp index 864df22c99..7cab031025 100644 --- a/pxr/usd/sdf/parserValueContext.cpp +++ b/pxr/usd/sdf/parserValueContext.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/sdf/parserValueContext.h b/pxr/usd/sdf/parserValueContext.h index e813df876b..01631ffb12 100644 --- a/pxr/usd/sdf/parserValueContext.h +++ b/pxr/usd/sdf/parserValueContext.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDF_PARSER_VALUE_CONTEXT_H #define PXR_USD_SDF_PARSER_VALUE_CONTEXT_H diff --git a/pxr/usd/sdf/path.cpp b/pxr/usd/sdf/path.cpp index b07ab3787d..7ac424c475 100644 --- a/pxr/usd/sdf/path.cpp +++ b/pxr/usd/sdf/path.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/sdf/path.h" @@ -393,25 +376,38 @@ SdfPath::GetPrefixes(SdfPathVector *prefixes) const void SdfPath::GetPrefixes(SdfPathVector *prefixes, size_t numPrefixes) const { - Sdf_PathNode const *prop = _propPart.get(); - Sdf_PathNode const *prim = _primPart.get(); - const size_t elemCount = GetPathElementCount(); if (numPrefixes == 0 || numPrefixes > elemCount) { numPrefixes = elemCount; } - prefixes->resize(numPrefixes); + GetPrefixes(TfSpan(*prefixes)); +} + +TfSpan +SdfPath::GetPrefixes(TfSpan prefixes) const +{ + // We can fill up to prefixes.size() elements. + size_t numPrefixes = std::min(prefixes.size(), GetPathElementCount()); + // If we are not filling the whole span, cut it to the subspan we will fill. + if (numPrefixes < prefixes.size()) { + prefixes = prefixes.first(numPrefixes); + } + + Sdf_PathNode const *prim = _primPart.get(); + Sdf_PathNode const *prop = _propPart.get(); - SdfPathVector::reverse_iterator iter = prefixes->rbegin(); + TfSpan::reverse_iterator iter = prefixes.rbegin(); for (; prop && numPrefixes; --numPrefixes) { *iter++ = SdfPath(prim, prop); prop = prop->GetParentNode(); } - for (; prim && numPrefixes; --numPrefixes) { + // no need to check 'prim' in the loop since we range-checked above. + for (; numPrefixes; --numPrefixes) { *iter++ = SdfPath(prim, nullptr); prim = prim->GetParentNode(); } + return prefixes; } SdfPathAncestorsRange diff --git a/pxr/usd/sdf/path.h b/pxr/usd/sdf/path.h index 8ff326a0f0..494c744ef6 100644 --- a/pxr/usd/sdf/path.h +++ b/pxr/usd/sdf/path.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDF_PATH_H #define PXR_USD_SDF_PATH_H @@ -30,6 +13,7 @@ #include "pxr/usd/sdf/tokens.h" #include "pxr/base/arch/defines.h" #include "pxr/base/tf/delegatedCountPtr.h" +#include "pxr/base/tf/span.h" #include "pxr/base/tf/stl.h" #include "pxr/base/tf/token.h" #include "pxr/base/vt/traits.h" @@ -505,6 +489,20 @@ class SdfPath /// number of this path's prefixes, fill all prefixes. SDF_API void GetPrefixes(SdfPathVector *prefixes, size_t numPrefixes) const; + /// Fill \p prefixes with up to \p prefixes.size() prefixes of this path. + /// Return the subspan of prefixes filled. + /// + /// Prefixes are filled in order of shortest to longest. The path itself is + /// always included as the last prefix. If \p prefixes is not large enough + /// to contain all prefixes, the shortest prefixes are omitted. If \p + /// prefixes is larger than the number of prefixes filled, return the + /// subspan filled by calling TfSpan::first() with the number of filled + /// prefixes. Note that if the prefix order does not need to be from + /// shortest to longest, it can be more efficient to use + /// GetAncestorsRange(), which produces an equivalent set of paths, ordered + /// from longest to shortest. + SDF_API TfSpan GetPrefixes(TfSpan prefixes) const; + /// Return a range for iterating over the ancestors of this path. /// /// The range provides iteration over the prefixes of a path, ordered diff --git a/pxr/usd/sdf/pathExpression.cpp b/pxr/usd/sdf/pathExpression.cpp index faefcce7fa..91189011da 100644 --- a/pxr/usd/sdf/pathExpression.cpp +++ b/pxr/usd/sdf/pathExpression.cpp @@ -1,30 +1,14 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/sdf/predicateExpression.h" #include "pxr/usd/sdf/pathExpression.h" +#include "pxr/usd/sdf/pathPatternParser.h" #include "pxr/base/tf/diagnostic.h" #include "pxr/base/tf/type.h" @@ -130,7 +114,13 @@ SdfPathExpression::MakeComplement(SdfPathExpression &&right) ret._ops = std::move(right._ops); ret._refs = std::move(right._refs); ret._patterns = std::move(right._patterns); - ret._ops.push_back(Complement); + // Complement of complement cancels. + if (ret._ops.back() == Complement) { + ret._ops.pop_back(); + } + else { + ret._ops.push_back(Complement); + } } return ret; } @@ -454,162 +444,6 @@ SdfPathExpression::GetText() const return result; } -//////////////////////////////////////////////////////////////////////// -// PathPattern - -SdfPathExpression::PathPattern::PathPattern() - : _prefix(SdfPath::ReflexiveRelativePath()) - , _isProperty(false) -{ -} - -static inline bool -IsLiteralProperty(std::string const &text) -{ - return SdfPath::IsValidNamespacedIdentifier(text); -} - -static inline bool -IsLiteralPrim(std::string const &text) -{ - return SdfPath::IsValidIdentifier(text); -} - -void -SdfPathExpression::PathPattern::AppendChild(std::string const &text) -{ - return AppendChild(text, {}); -} - -void -SdfPathExpression::PathPattern -::AppendChild(std::string const &text, - SdfPredicateExpression const &predExpr) -{ - return AppendChild(text, SdfPredicateExpression(predExpr)); -} - -void -SdfPathExpression::PathPattern::AppendChild(std::string const &text, - SdfPredicateExpression &&predExpr) -{ - if (_isProperty) { - TF_WARN("Cannot append child '%s' to property path expression '%s'", - text.c_str(), GetText().c_str()); - return; - } - - bool isLiteral = IsLiteralPrim(text); - if ((isLiteral || text == "..") && !predExpr && _components.empty()) { - _prefix = _prefix.AppendChild(TfToken(text)); - } - else { - int predIndex = -1; - if (predExpr) { - predIndex = static_cast(_predExprs.size()); - _predExprs.push_back(std::move(predExpr)); - } - _components.push_back({ text, predIndex, isLiteral }); - } -} - -void -SdfPathExpression::PathPattern::AppendProperty(std::string const &text) -{ - return AppendProperty(text, {}); -} - -void -SdfPathExpression::PathPattern::AppendProperty(std::string const &text, - SdfPredicateExpression const &predExpr) -{ - return AppendProperty(text, SdfPredicateExpression(predExpr)); -} - -void -SdfPathExpression::PathPattern::AppendProperty(std::string const &text, - SdfPredicateExpression &&predExpr) -{ - bool isLiteral = IsLiteralProperty(text); - if (isLiteral && !predExpr && _components.empty()) { - _prefix = _prefix.AppendProperty(TfToken(text)); - } - else { - int predIndex = -1; - if (predExpr) { - predIndex = static_cast(_predExprs.size()); - _predExprs.push_back(std::move(predExpr)); - } - _components.push_back({ text, predIndex, isLiteral }); - } - _isProperty = true; -} - -void -SdfPathExpression::PathPattern::SetPrefix(SdfPath &&p) -{ - // If we have any components at all, then p must be a prim path or the - // absolute root path. Otherwise it can be a prim or prim property path. - if (!_components.empty()) { - if (!p.IsAbsoluteRootOrPrimPath()) { - TF_WARN("Path patterns with match components require " - "prim paths or the absolute root path ('/') as a prefix: " - "<%s> -- ignoring.", p.GetAsString().c_str()); - return; - } - } - else { - if (!(p.IsAbsoluteRootOrPrimPath() || p.IsPrimPropertyPath())) { - TF_WARN("Path pattern prefixes must be prim paths or prim-property " - "paths: <%s> -- ignoring.", p.GetAsString().c_str()); - return; - } - } - _prefix = std::move(p); - if (_components.empty()) { - _isProperty = _prefix.IsPrimPropertyPath(); - } -} - -std::string -SdfPathExpression::PathPattern::GetText() const -{ - std::string result; - - if (_prefix == SdfPath::ReflexiveRelativePath()) { - if (_components.empty() || _components.front().IsStretch()) { - // If components is empty, or first component is a stretch, then we - // emit a leading '.', otherwise nothing. - result = "."; - } - } - else { - result = _prefix.GetAsString(); - } - - const bool prefixIsAbsRoot = _prefix == SdfPath::AbsoluteRootPath(); - for (size_t i = 0, end = _components.size(); i != end; ++i) { - if (_components[i].text.empty() && - _components[i].predicateIndex == -1) { - result += (i == 0 && prefixIsAbsRoot) ? "/" : "//"; - continue; - } - if (!result.empty() && result.back() != '/') { - if ((i + 1 == end) && _isProperty) { - result.push_back('.'); - } else { - result.push_back('/'); - } - } - result += _components[i].text; - if (_components[i].predicateIndex != -1) { - result += "{" + _predExprs[ - _components[i].predicateIndex].GetText() + "}"; - } - } - return result; -} - std::ostream & operator<<(std::ostream &out, SdfPathExpression const &expr) { @@ -618,16 +452,6 @@ operator<<(std::ostream &out, SdfPathExpression const &expr) //////////////////////////////////////////////////////////////////////// // Parsing code. - -class Sdf_PathPatternBuilder -{ -public: - SdfPathExpression::PathPattern pattern; - - std::string curElemText; - SdfPredicateExpression curPredExpr; -}; - struct Sdf_PathExprBuilder { Sdf_PathExprBuilder() { OpenGroup(); } @@ -638,9 +462,8 @@ struct Sdf_PathExprBuilder _stacks.back().PushExpressionRef(std::move(path), std::move(name)); } - void PushPattern() { - _stacks.back().PushPattern(std::move(_patternBuilder.pattern)); - _patternBuilder = Sdf_PathPatternBuilder(); + void PushPattern(SdfPathPattern &&pattern) { + _stacks.back().PushPattern(std::move(pattern)); } void OpenGroup() { _stacks.emplace_back(); } @@ -657,10 +480,6 @@ struct Sdf_PathExprBuilder return result; } - Sdf_PathPatternBuilder &GetPatternBuilder() { - return _patternBuilder; - } - private: struct _Stack { @@ -679,7 +498,7 @@ struct Sdf_PathExprBuilder } - void PushPattern(SdfPathExpression::PathPattern &&pattern) { + void PushPattern(SdfPathPattern &&pattern) { exprStack.push_back( SdfPathExpression::MakeAtom(std::move(pattern))); } @@ -726,182 +545,25 @@ struct Sdf_PathExprBuilder }; std::vector<_Stack> _stacks; - - Sdf_PathPatternBuilder _patternBuilder; }; - - //////////////////////////////////////////////////////////////////////// // Path expression grammar namespace { -using namespace tao::TAO_PEGTL_NAMESPACE; - -//////////////////////////////////////////////////////////////////////// -// Path patterns with predicates. -struct PathPatStretch : two<'/'> {}; -struct PathPatSep : sor> {}; - -struct EmbeddedPredExpr : disable {}; - -struct BracedPredExpr - : if_must, OptSpaced, one<'}'>> {}; - -struct PrimPathWildCard : - seq< - plus>>, - opt,plus>>> - > {}; - -struct PropPathWildCard : - seq< - plus>>, - opt,plus>>> - > {}; - -struct PrimPathPatternElemText : PrimPathWildCard {}; -struct PropPathPatternElemText : PropPathWildCard {}; +using namespace PXR_PEGTL_NAMESPACE; -struct PrimPathPatternElem - : if_then_else, - BracedPredExpr> {}; +template +using LookaheadList = seq, Sep, Rule>>; -struct PropPathPatternElem - : if_then_else, - BracedPredExpr> {}; - -struct PathPatternElems - : seq, - opt, - opt_must, PropPathPatternElem>> {}; - -struct AbsPathPattern : seq> {}; +template using OptSpaced = pad; +//////////////////////////////////////////////////////////////////////// +// Expression references. struct DotDot : two<'.'> {}; struct DotDots : list> {}; -struct ReflexiveRelative : one<'.'> {}; - -struct AbsoluteStart : at> {}; - -struct PathPattern : - sor< - if_must, - seq, success>>, - PathPatternElems, - seq>> - > -{}; - -// Actions ///////////////////////////////////////////////////////////// - -template -struct PathExprAction : nothing {}; - -template <> -struct PathExprAction -{ - template - static void apply(Input const &in, Sdf_PathExprBuilder &builder) { - builder.GetPatternBuilder().pattern.SetPrefix( - SdfPath::AbsoluteRootPath()); - } -}; - -template <> -struct PathExprAction -{ - template - static void apply(Input const &in, Sdf_PathExprBuilder &builder) { - // '//' appends a component representing arbitrary elements. - builder.GetPatternBuilder().pattern.AppendChild(std::string()); - } -}; - -template <> -struct PathExprAction -{ - template - static void apply(Input const &in, Sdf_PathExprBuilder &builder) { - builder.GetPatternBuilder().curPredExpr = - SdfPredicateExpression(in.string()); - } -}; - -template <> -struct PathExprAction -{ - template - static void apply(Input const &in, Sdf_PathExprBuilder &builder) { - builder.GetPatternBuilder().curElemText = in.string(); - } -}; - -template <> -struct PathExprAction -{ - template - static void apply(Input const &in, Sdf_PathExprBuilder &builder) { - builder.GetPatternBuilder().curElemText = in.string(); - } -}; - -template <> -struct PathExprAction -{ - template - static void apply(Input const &in, Sdf_PathExprBuilder &builder) { - auto &pb = builder.GetPatternBuilder(); - pb.pattern.AppendChild(pb.curElemText, pb.curPredExpr); - pb.curElemText.clear(); - pb.curPredExpr = SdfPredicateExpression(); - } -}; - -template <> -struct PathExprAction -{ - template - static void apply(Input const &in, Sdf_PathExprBuilder &builder) { - auto &pb = builder.GetPatternBuilder(); - pb.pattern.AppendProperty(pb.curElemText, pb.curPredExpr); - pb.curElemText.clear(); - pb.curPredExpr = SdfPredicateExpression(); - } -}; - -template <> -struct PathExprAction -{ - template - static void apply(Input const &in, Sdf_PathExprBuilder &builder) { - builder.GetPatternBuilder().pattern.SetPrefix( - SdfPath::ReflexiveRelativePath()); - } -}; - -template <> -struct PathExprAction -{ - template - static void apply(Input const &in, Sdf_PathExprBuilder &builder) { - builder.GetPatternBuilder().pattern.AppendChild(".."); - } -}; - -template <> -struct PathExprAction -{ - template - static void apply(Input const &in, Sdf_PathExprBuilder &builder) { - builder.PushPattern(); - } -}; - -//////////////////////////////////////////////////////////////////////// -// Expression references. struct ExpressionRefName : seq, identifier> {}; struct ExpressionRefPathAndName : @@ -924,28 +586,6 @@ struct ExpressionReference : sor< seq, ExpressionRefPath> > {}; -// Actions ///////////////////////////////////////////////////////////// - -template <> -struct PathExprAction -{ - template - static void apply(Input const &in, Sdf_PathExprBuilder &builder) { - builder.PushExpressionRef(SdfPath(), "_"); - } -}; - -template <> -struct PathExprAction -{ - template - static void apply(Input const &in, Sdf_PathExprBuilder &builder) { - std::string pathPart = TfStringGetBeforeSuffix(in.string(), ':'); - builder.PushExpressionRef( - pathPart.empty() ? SdfPath() : SdfPath(pathPart), - TfStringGetSuffix(in.string(), ':')); - } -}; //////////////////////////////////////////////////////////////////////// // Path exprs. @@ -958,7 +598,7 @@ struct PathExprCloseGroup : one<')'> {}; struct PathExprAtom : sor< ExpressionReference, - PathPattern, + SdfPathPatternParser::PathPattern, if_must, PathExprCloseGroup> > {}; @@ -979,6 +619,31 @@ struct PathOperator : sor, struct PathExpr : LookaheadList {}; //////////////////////////////////////////////////////////////////////// +// Actions ///////////////////////////////////////////////////////////// + +template +struct PathExprAction : nothing {}; + +template <> +struct PathExprAction +{ + template + static void apply(Input const &in, Sdf_PathExprBuilder &builder) { + builder.PushExpressionRef(SdfPath(), "_"); + } +}; + +template <> +struct PathExprAction +{ + template + static void apply(Input const &in, Sdf_PathExprBuilder &builder) { + std::string pathPart = TfStringGetBeforeSuffix(in.string(), ':'); + builder.PushExpressionRef( + pathPart.empty() ? SdfPath() : SdfPath(pathPart), + TfStringGetSuffix(in.string(), ':')); + } +}; template struct PathExprOpAction @@ -1018,12 +683,28 @@ struct PathExprAction } }; +// This rule dispatches to the PathPatternAction to build the pattern, then we +// can consume it in the 'success' member function. +template <> +struct PathExprAction + : change_action_and_states< + SdfPathPatternActions::PathPatternAction, + SdfPathPatternActions::PatternBuilder> +{ + template + static void success(Input const &, + SdfPathPatternActions::PatternBuilder &patternBuilder, + Sdf_PathExprBuilder &builder) { + builder.PushPattern(std::move(patternBuilder.pattern)); + } +}; + } // anon //////////////////////////////////////////////////////////////////////// // Parsing drivers. -bool +static bool ParsePathExpression(std::string const &inputStr, std::string const &parseContext, SdfPathExpression *expr, @@ -1031,7 +712,7 @@ ParsePathExpression(std::string const &inputStr, { Sdf_PathExprBuilder builder; try { - parse, PathExprAction/*, tracer*/>( + parse, eolf>, PathExprAction>( string_input<> { inputStr, parseContext.empty() ? "" : parseContext.c_str() }, builder); @@ -1043,7 +724,7 @@ ParsePathExpression(std::string const &inputStr, std::string errMsg = err.what(); errMsg += " -- "; bool first = true; - for (position const &p: err.positions) { + for (position const &p: err.positions()) { if (!first) { errMsg += ", "; } diff --git a/pxr/usd/sdf/pathExpression.h b/pxr/usd/sdf/pathExpression.h index 2a08ae663c..fb931360ed 100644 --- a/pxr/usd/sdf/pathExpression.h +++ b/pxr/usd/sdf/pathExpression.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDF_PATH_EXPRESSION_H #define PXR_USD_SDF_PATH_EXPRESSION_H @@ -27,7 +10,7 @@ #include "pxr/pxr.h" #include "pxr/usd/sdf/api.h" #include "pxr/usd/sdf/path.h" -#include "pxr/usd/sdf/predicateExpression.h" +#include "pxr/usd/sdf/pathPattern.h" #include "pxr/base/tf/hash.h" #include @@ -41,8 +24,8 @@ PXR_NAMESPACE_OPEN_SCOPE /// \class SdfPathExpression /// /// Objects of this class represent a logical expression syntax tree consisting -/// of SdfPath matching patterns (with optionally embedded predicate -/// expressions) joined by the set-algebraic operators `+` (union), `&` +/// of SdfPathPattern s, (with optionally embedded predicate expressions), and +/// Expression References joined by the set-algebraic operators `+` (union), `&` /// (intersection), `-` (difference), `~` (complement) and an implied-union /// operator represented by two subexpressions joined by whitespace. /// @@ -71,178 +54,8 @@ PXR_NAMESPACE_OPEN_SCOPE class SdfPathExpression { public: - /// \class PathPattern - /// - /// Objects of this class represent SdfPath matching patterns, consisting of - /// an SdfPath prefix followed by a sequence of components, which may - /// contain wildcards and optional embedded predicate expressions (see - /// SdfPredicateExpression). - class PathPattern - { - public: - /// Construct the empty pattern whose bool-conversion operator returns - /// false. - SDF_API - PathPattern(); - - /// A component represents a pattern matching component past the initial - /// SdfPath prefix. A component's text can contain wildcard characters, - /// and if the component references a predicate expression, its - /// predicateIndex indicates which one in the owning PathPattern's list - /// of expressions. A component whose text is empty represents an - /// "arbitrary levels of hierarchy" element (the //) in a path pattern. - struct Component { - bool IsStretch() const { - return predicateIndex == -1 && text.empty(); - } - - std::string text; - int predicateIndex = -1; - bool isLiteral = false; - - friend bool operator==(Component const &l, Component const &r) { - return std::tie(l.text, l.predicateIndex, l.isLiteral) == - std::tie(r.text, r.predicateIndex, r.isLiteral); - } - - friend bool operator!=(Component const &l, Component const &r) { - return !(l == r); - } - - template - friend void TfHashAppend(HashState &h, Component const &c) { - h.Append(c.text, c.predicateIndex, c.isLiteral); - } - - friend void swap(Component &l, Component &r) { - auto lt = std::tie(l.text, l.predicateIndex, l.isLiteral); - auto rt = std::tie(r.text, r.predicateIndex, r.isLiteral); - swap(lt, rt); - } - }; - - /// Append a prim child component to this pattern, with optional - /// predicate expression \p predExpr. If this pattern does not yet - /// contain any wildcards or components with predicate expressions, and - /// the input text does not contain wildcards, and \p predExpr is empty, - /// then append a child component to this pattern's prefix path (see - /// GetPrefix()). Otherwise append this component to the sequence of - /// components. - SDF_API - void AppendChild(std::string const &text, - SdfPredicateExpression &&predExpr); - /// \overload - SDF_API - void AppendChild(std::string const &text, - SdfPredicateExpression const &predExpr); - /// \overload - SDF_API - void AppendChild(std::string const &text); - - /// Append a prim property component to this pattern, with optional - /// predicate expression \p predExpr. If this pattern does not yet - /// contain any wildcards or components with predicate expressions, and - /// the input text does not contain wildcards, and \p predExpr is empty, - /// then append a property component to this pattern's prefix path (see - /// GetPrefix()). Otherwise append this component to the sequence of - /// components. - SDF_API - void AppendProperty(std::string const &text, - SdfPredicateExpression &&predExpr); - /// \overload - SDF_API - void AppendProperty(std::string const &text, - SdfPredicateExpression const &predExpr); - /// \overload - SDF_API - void AppendProperty(std::string const &text); - - /// Return this pattern's non-speculative prefix (leading path - /// components with no wildcards and no predicates). - SdfPath const &GetPrefix() const & { - return _prefix; - } - - /// \overload - SdfPath GetPrefix() && { - return std::move(_prefix); - } - - /// Set this pattern's non-speculative prefix (leading path - /// components with no wildcards and no predicates). - SDF_API - void SetPrefix(SdfPath &&p); - - /// \overload - void SetPrefix(SdfPath const &p) { - SetPrefix(SdfPath(p)); - } - - /// Return the string representation of this pattern. - SDF_API - std::string GetText() const; - - std::vector const &GetComponents() const & { - return _components; - } - - std::vector GetComponents() && { - return _components; - } - - std::vector const & - GetPredicateExprs() const & { - return _predExprs; - } - - std::vector - GetPredicateExprs() && { - return _predExprs; - } - - bool IsProperty() const { - return _isProperty; - } - - /// Return true if this pattern is not empty, false if it is. - explicit operator bool() const { - return !_prefix.IsEmpty(); - } - - private: - template - friend void TfHashAppend(HashState &h, PathPattern const &pat) { - h.Append(pat._prefix, pat._components, - pat._predExprs, pat._isProperty); - } - - friend bool - operator==(PathPattern const &l, PathPattern const &r) { - return std::tie(l._prefix, l._components, - l._predExprs, l._isProperty) == - std::tie(r._prefix, r._components, - r._predExprs, r._isProperty); - } - - friend bool - operator!=(PathPattern const &l, PathPattern const &r) { - return !(l == r); - } - - friend void swap(PathPattern &l, PathPattern &r) { - auto lt = std::tie( - l._prefix, l._components, l._predExprs, l._isProperty); - auto rt = std::tie( - r._prefix, r._components, r._predExprs, r._isProperty); - swap(lt, rt); - } - - SdfPath _prefix; - std::vector _components; - std::vector _predExprs; - bool _isProperty; - }; - + using PathPattern = SdfPathPattern; + /// \class ExpressionReference /// /// Objects of this class represent references to other path expressions, @@ -380,6 +193,18 @@ class SdfPathExpression return MakeAtom(PathPattern(pattern)); } + /// Produce a new expression that matches \p path exactly. + static SdfPathExpression + MakeAtom(SdfPath const &path) { + return MakeAtom(PathPattern(path)); + } + + /// \overload + static SdfPathExpression + MakeAtom(SdfPath &&path) { + return MakeAtom(PathPattern(path)); + } + /// Walk this expression's syntax tree in depth-first order, calling \p /// pattern with the current PathPattern when one is encountered, \p ref /// with the current ExpressionReference when one is encountered, and \p diff --git a/pxr/usd/sdf/pathExpressionEval.cpp b/pxr/usd/sdf/pathExpressionEval.cpp index 91a2c19a8e..8c2238696d 100644 --- a/pxr/usd/sdf/pathExpressionEval.cpp +++ b/pxr/usd/sdf/pathExpressionEval.cpp @@ -1,31 +1,15 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/sdf/pathExpressionEval.h" #include "pxr/base/tf/errorMark.h" +#include "pxr/base/tf/ostreamMethods.h" PXR_NAMESPACE_OPEN_SCOPE @@ -94,6 +78,8 @@ Sdf_PathExpressionEvalBase::_EvalExpr( break; case And: case Or: { + DEBUG_MSG("- %s (lhs = %s)\n", + *opIter == And ? "And" : "Or", result ? "true" : "false"); const bool decidingValue = *opIter != And; // If the And/Or result is already the deciding value, // short-circuit. Otherwise the result is the rhs, so continue. @@ -105,8 +91,8 @@ Sdf_PathExpressionEvalBase::_EvalExpr( } } break; - case Open: ++nest; break; - case Close: --nest; break; + case Open: DEBUG_MSG("- Open\n"); ++nest; break; + case Close: DEBUG_MSG("- Close\n"); --nest; break; }; } return result; @@ -120,7 +106,7 @@ _PatternImplBase::_Init( { // Build a matcher. _prefix = pattern.GetPrefix(); - _isProperty = pattern.IsProperty(); + // _matchObjType set below. _stretchBegin = false; _stretchEnd = false; auto const &predicateExprs = pattern.GetPredicateExprs(); @@ -176,6 +162,29 @@ _PatternImplBase::_Init( } _segments.back().end = _components.size(); } + + // Set the object types this pattern can match. If the pattern isn't + // explicitly a property, then it can match only prims if the final + // component's text is not empty. That is, patterns like '/foo//' or '//' + // or '/predicate//{test}' can match either prims or properties, but + // patterns like '/foo//bar', '//baz{test}', '/foo/[Bb]' can only match + // prims. + if (pattern.IsProperty()) { + // The pattern demands a property. + _matchObjType = _MatchPropOnly; + } + else if (_stretchEnd || + (!_components.empty() && _components.back().type == ExplicitName && + _explicitNames[_components.back().patternIndex].empty())) { + // Trailing stretch, or last component has empty text means this can + // match both prims & properties. + _matchObjType = _MatchPrimOrProp; + } + else { + // No trailing stretch, and the final component requires a prim + // name/regex match means this pattern can only match prims. + _matchObjType = _MatchPrimOnly; + } } SdfPredicateFunctionResult @@ -212,11 +221,17 @@ _PatternImplBase::_Match( Stringify(result)); return result; } - if (_isProperty && !path.IsPrimPropertyPath()) { - DEBUG_MSG("pattern demands a property; <%s> is not -> varying false\n", - path.GetAsString().c_str()); + const bool isPrimPropertyPath = path.IsPrimPropertyPath(); + if (_matchObjType == _MatchPropOnly && !isPrimPropertyPath) { + DEBUG_MSG("pattern demands a property; <%s> is a prim path -> " + "varying false\n", path.GetAsString().c_str()); return Result::MakeVarying(false); } + if (_matchObjType == _MatchPrimOnly && isPrimPropertyPath) { + DEBUG_MSG("pattern demands a prim; <%s> is a property path -> " + "constant false\n", path.GetAsString().c_str()); + return Result::MakeConstant(false); + } // If this pattern has no components, it matches if it is the same as the // prefix, or if it has the prefix if there's a stretch following. @@ -239,12 +254,23 @@ _PatternImplBase::_Match( path.GetAsString().c_str()); return Result::MakeConstant(false); } + // If the pattern has components then the path must be longer than the + // prefix, otherwise those components have nothing to match. + else if (path.GetPathElementCount() == _prefix.GetPathElementCount()) { + DEBUG_MSG("path matches prefix but pattern requires additional " + "components -> varying false\n"); + return Result::MakeVarying(false); + } // Split the path into prefixes but skip any covered by _prefix. // XXX:TODO Plumb-in caller-supplied vector for reuse by GetPrefixes(). SdfPathVector prefixes; path.GetPrefixes( &prefixes, path.GetPathElementCount() - _prefix.GetPathElementCount()); + + DEBUG_MSG("Examining paths not covered by pattern prefix <%s>:\n %s\n", + _prefix.GetAsString().c_str(), + TfStringify(prefixes).c_str()); SdfPathVector::const_iterator matchLoc = prefixes.begin(); const SdfPathVector::const_iterator matchEnd = prefixes.end(); @@ -357,9 +383,9 @@ _PatternImplBase::_Match( // First segment must match at the beginning. if (!_stretchBegin && segment.StartsAt(0)) { const Result result = checkMatch(segment, matchLoc); + DEBUG_MSG("segment %smatch at start -> %s\n", + result ? "" : "does not ", Stringify(result)); if (!result) { - DEBUG_MSG("segment does not match at start -> %s\n", - Stringify(result)); return result; } matchLoc += segment.GetSize(); @@ -375,9 +401,9 @@ _PatternImplBase::_Match( else if (!_stretchEnd && segment.EndsAt(componentsSize)) { const Result result = checkMatch(segment, matchEnd - segment.GetSize()); + DEBUG_MSG("segment %smatch at end -> %s\n", + result ? "" : "does not ", Stringify(result)); if (!result) { - DEBUG_MSG("segment does not match at end -> %s\n", - Stringify(result)); return result; } matchLoc = matchEnd; @@ -388,9 +414,9 @@ _PatternImplBase::_Match( // components we have remaining to match against. const Result result = searchMatch(segment, matchLoc, matchEnd - numComponentsLeft); + DEBUG_MSG("found %smatch in interior -> %s\n", + result ? "" : "no ", Stringify(result)); if (!result) { - DEBUG_MSG("found no match in interior -> %s\n", - Stringify(result)); return result; } matchLoc += segment.GetSize(); @@ -461,14 +487,19 @@ ::_PatternImplBase::_Next( return Result::MakeVarying(false); } - // If this pattern demands a property path then we can early-out if the path - // in question is not a property path. Otherwise this path may or may not - // match properties. - if (_isProperty && !path.IsPrimPropertyPath()) { + // If this pattern demands a either a prim or a property path then we can + // early-out if the path in question is not the required type. + const bool isPrimPropertyPath = path.IsPrimPropertyPath(); + if (_matchObjType == _MatchPropOnly && !isPrimPropertyPath) { DEBUG_MSG("_Next(<%s>) isn't a property path -> varying false\n", path.GetAsString().c_str()); return Result::MakeVarying(false); } + if (_matchObjType == _MatchPrimOnly && isPrimPropertyPath) { + DEBUG_MSG("_Next(<%s>) isn't a prim path -> constant false\n", + path.GetAsString().c_str()); + return Result::MakeConstant(false); + } // If this pattern has no components, it matches if there's a stretch or if // it is the same length as the prefix (which means it is identical to the diff --git a/pxr/usd/sdf/pathExpressionEval.h b/pxr/usd/sdf/pathExpressionEval.h index b950768128..e7ebb2ca6e 100644 --- a/pxr/usd/sdf/pathExpressionEval.h +++ b/pxr/usd/sdf/pathExpressionEval.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDF_PATH_EXPRESSION_EVAL_H #define PXR_USD_SDF_PATH_EXPRESSION_EVAL_H @@ -151,7 +134,10 @@ class Sdf_PathExpressionEvalBase bool _stretchBegin; bool _stretchEnd; - bool _isProperty; // true if this pattern matches only properties. + enum : uint8_t { + // The kind of objects this pattern is capable of matching. + _MatchPrimOrProp, _MatchPrimOnly, _MatchPropOnly + } _matchObjType; }; diff --git a/pxr/usd/sdf/pathNode.cpp b/pxr/usd/sdf/pathNode.cpp index 4402c33b5f..6a26affbf2 100644 --- a/pxr/usd/sdf/pathNode.cpp +++ b/pxr/usd/sdf/pathNode.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/sdf/pathNode.h b/pxr/usd/sdf/pathNode.h index 4582e9f5de..b96cacadc1 100644 --- a/pxr/usd/sdf/pathNode.h +++ b/pxr/usd/sdf/pathNode.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDF_PATH_NODE_H #define PXR_USD_SDF_PATH_NODE_H diff --git a/pxr/usd/sdf/pathParser.cpp b/pxr/usd/sdf/pathParser.cpp index 1fac7fc949..ec3e150136 100644 --- a/pxr/usd/sdf/pathParser.cpp +++ b/pxr/usd/sdf/pathParser.cpp @@ -1,32 +1,15 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. #include "pxr/pxr.h" #include "pxr/usd/sdf/pathParser.h" PXR_NAMESPACE_OPEN_SCOPE -using namespace tao::TAO_PEGTL_NAMESPACE; +using namespace PXR_PEGTL_NAMESPACE; namespace Sdf_PathParser { diff --git a/pxr/usd/sdf/pathParser.h b/pxr/usd/sdf/pathParser.h index d4ae61eae9..972ae4d84b 100644 --- a/pxr/usd/sdf/pathParser.h +++ b/pxr/usd/sdf/pathParser.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDF_PATH_PARSER_H #define PXR_USD_SDF_PATH_PARSER_H @@ -29,7 +12,7 @@ #include "pxr/base/tf/unicodeUtils.h" #include "pxr/usd/sdf/path.h" -#include "pxr/base/tf/pxrPEGTL/pegtl.h" +#include "pxr/base/pegtl/pegtl.hpp" PXR_NAMESPACE_OPEN_SCOPE @@ -38,7 +21,7 @@ Sdf_ParsePath(std::string const &pathStr, SdfPath *path, std::string *errMsg); namespace Sdf_PathParser { -namespace PEGTL_NS = tao::TAO_PEGTL_NAMESPACE; +namespace PEGTL_NS = PXR_PEGTL_NAMESPACE; //////////////////////////////////////////////////////////////////////// // Helper rules for parsing UTF8 content @@ -51,7 +34,7 @@ struct XidStart { // peek at the next character in the input // if the size is not 0, it was a valid code point - auto utf8_char = tao::TAO_PEGTL_NAMESPACE::internal::peek_utf8::peek(in); + auto utf8_char = PEGTL_NS::internal::peek_utf8::peek(in); if (utf8_char.size != 0) { // valid utf8_char, data has the code point @@ -77,7 +60,7 @@ struct XidContinue { // peek at the next character in the input // if the size is not 0, it was a valid code point - auto utf8_char = tao::TAO_PEGTL_NAMESPACE::internal::peek_utf8::peek(in); + auto utf8_char = PEGTL_NS::internal::peek_utf8::peek(in); if (utf8_char.size != 0) { // valid utf8_char, data has the code point @@ -166,7 +149,7 @@ struct BracketPath : PEGTL_NS::if_must, BracketPath, PEGTL_NS::opt> {}; -struct Expression : TAO_PEGTL_KEYWORD("expression") {}; +struct Expression : PXR_PEGTL_KEYWORD("expression") {}; struct RelAttrSeq : PEGTL_NS::if_must< PEGTL_NS::one<'.'>, RelationalAttributeName, @@ -242,4 +225,4 @@ struct Action : PEGTL_NS::nothing {}; PXR_NAMESPACE_CLOSE_SCOPE -#endif // PXR_USD_SDF_PATH_PARSER_H \ No newline at end of file +#endif // PXR_USD_SDF_PATH_PARSER_H diff --git a/pxr/usd/sdf/pathPattern.cpp b/pxr/usd/sdf/pathPattern.cpp new file mode 100644 index 0000000000..0c22d85ec8 --- /dev/null +++ b/pxr/usd/sdf/pathPattern.cpp @@ -0,0 +1,338 @@ +// +// Copyright 2023 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// + +#include "pxr/pxr.h" +#include "pxr/usd/sdf/predicateExpression.h" +#include "pxr/usd/sdf/pathPattern.h" + +#include "pxr/base/tf/diagnostic.h" +#include "pxr/base/tf/type.h" +#include "pxr/base/vt/array.h" +#include "pxr/base/vt/value.h" + +#include "predicateExpressionParser.h" + +#include + +PXR_NAMESPACE_OPEN_SCOPE + +SdfPathPattern::SdfPathPattern() + : _isProperty(false) +{ +} + +SdfPathPattern::SdfPathPattern(SdfPath &&prefix) +{ + SetPrefix(std::move(prefix)); +} + +SdfPathPattern::SdfPathPattern(SdfPath const &prefix) + : SdfPathPattern(SdfPath(prefix)) +{ +} + +// private ctor, does no validation. +SdfPathPattern::SdfPathPattern(SdfPath prefix, + std::vector &&components, + std::vector &&predExprs, + bool isProperty) + : _prefix(std::move(prefix)) + , _components(std::move(components)) + , _predExprs(std::move(predExprs)) + , _isProperty(isProperty) +{ +} + +SdfPathPattern const & +SdfPathPattern::Everything() +{ + static SdfPathPattern const *theEverything = + new SdfPathPattern(SdfPath::AbsoluteRootPath(), {{}}, {}, false); + return *theEverything; +} + +SdfPathPattern const & +SdfPathPattern::EveryDescendant() +{ + static SdfPathPattern const *theEveryDescendant = + new SdfPathPattern(SdfPath::ReflexiveRelativePath(), {{}}, {}, false); + return *theEveryDescendant; +} + +static inline bool +IsLiteralProperty(std::string const &text) +{ + return SdfPath::IsValidNamespacedIdentifier(text); +} + +static inline bool +IsLiteralPrim(std::string const &text) +{ + return SdfPath::IsValidIdentifier(text); +} + +bool +SdfPathPattern::CanAppendChild(std::string const &text, + SdfPredicateExpression const &predExpr, + std::string *reason) const +{ + auto setReason = [reason](auto ...args) { + if (reason) { *reason = TfStringPrintf(args...); } + }; + + if (_isProperty) { + setReason("Cannot append child '%s' to a property path pattern '%s'", + text.c_str(), GetText().c_str()); + return false; + } + + if (text.empty() && !predExpr && HasTrailingStretch()) { + setReason("Cannot append stretch to a path pattern that has trailing " + "stretch '%s'", GetText().c_str()); + return false; + } + + return true; +} + +SdfPathPattern & +SdfPathPattern::AppendChild(std::string const &text) +{ + return AppendChild(text, {}); +} + +SdfPathPattern & +SdfPathPattern::AppendChild(std::string const &text, + SdfPredicateExpression const &predExpr) +{ + return AppendChild(text, SdfPredicateExpression(predExpr)); +} + + +SdfPathPattern & +SdfPathPattern::AppendChild(std::string const &text, + SdfPredicateExpression &&predExpr) +{ + std::string reason; + if (!CanAppendChild(text, predExpr, &reason)) { + TF_WARN(reason); + return *this; + } + + if (_prefix.IsEmpty()) { + _prefix = SdfPath::ReflexiveRelativePath(); + } + + bool isLiteral = IsLiteralPrim(text); + if ((isLiteral || text == "..") && !predExpr && _components.empty()) { + _prefix = _prefix.AppendChild(TfToken(text)); + } + else { + int predIndex = -1; + if (predExpr) { + predIndex = static_cast(_predExprs.size()); + _predExprs.push_back(std::move(predExpr)); + } + _components.push_back({ text, predIndex, isLiteral }); + } + return *this; +} + +SdfPathPattern & +SdfPathPattern::AppendStretchIfPossible() { + if (CanAppendChild({})) { + AppendChild({}); + } + return *this; +} + +bool +SdfPathPattern::HasLeadingStretch() const +{ + return GetPrefix().IsAbsoluteRootPath() && + !_components.empty() && _components.front().IsStretch(); +} + +bool +SdfPathPattern::HasTrailingStretch() const +{ + return !_isProperty && + !_components.empty() && _components.back().IsStretch(); +} + +SdfPathPattern & +SdfPathPattern::RemoveTrailingStretch() +{ + if (HasTrailingStretch()) { + // We don't have to do all the other work that RemoveTrailingComponent() + // has to do, since a stretch component doesn't have a predicate, and + // cannot be a property pattern. + _components.pop_back(); + } + return *this; +} + +SdfPathPattern & +SdfPathPattern::RemoveTrailingComponent() +{ + if (!_components.empty()) { + // If this component has a predicate, it must be the last one. + const int predIndex = _components.back().predicateIndex; + if (predIndex >= 0) { + if (TF_VERIFY( + static_cast(predIndex) == _predExprs.size()-1)) { + _predExprs.pop_back(); + } + } + // If this pattern identified a property, it no longer will. + if (_isProperty) { + _isProperty = false; + } + // Remove the final component. + _components.pop_back(); + } + return *this; +} + +bool +SdfPathPattern::CanAppendProperty(std::string const &text, + SdfPredicateExpression const &predExpr, + std::string *reason) const +{ + auto setReason = [reason](auto ...args) { + if (reason) { *reason = TfStringPrintf(args...); } + }; + + if (_isProperty) { + setReason("Cannot append additional property '%s' to property path " + "pattern '%s'", text.c_str(), GetText().c_str()); + return false; + } + + if (text.empty() && !predExpr) { + setReason("Cannot append empty property element to path pattern '%s'", + GetText().c_str()); + return false; + } + + return true; +} + +SdfPathPattern & +SdfPathPattern::AppendProperty(std::string const &text) +{ + return AppendProperty(text, {}); +} + +SdfPathPattern & +SdfPathPattern::AppendProperty(std::string const &text, + SdfPredicateExpression const &predExpr) +{ + return AppendProperty(text, SdfPredicateExpression(predExpr)); +} + +SdfPathPattern & +SdfPathPattern::AppendProperty(std::string const &text, + SdfPredicateExpression &&predExpr) +{ + std::string reason; + if (!CanAppendProperty(text, predExpr, &reason)) { + TF_WARN(reason); + return *this; + } + + if (_prefix.IsEmpty()) { + _prefix = SdfPath::ReflexiveRelativePath(); + } + + bool isLiteral = IsLiteralProperty(text); + if (isLiteral && !predExpr && _components.empty()) { + _prefix = _prefix.AppendProperty(TfToken(text)); + } + else { + // If this path ends with a stretch component, we have to append a + // wildcard prim child component first. That is, AppendProperty('/x//', + // 'foo') -> '/x//*.foo'. + if (HasTrailingStretch()) { + AppendChild("*"); + } + int predIndex = -1; + if (predExpr) { + predIndex = static_cast(_predExprs.size()); + _predExprs.push_back(std::move(predExpr)); + } + _components.push_back({ text, predIndex, isLiteral }); + } + _isProperty = true; + return *this; +} + +SdfPathPattern & +SdfPathPattern::SetPrefix(SdfPath &&p) +{ + // If we have any components at all, then p must be a prim path or the + // absolute root path. Otherwise it can be a prim or prim property path. + if (!_components.empty()) { + if (!p.IsAbsoluteRootOrPrimPath()) { + TF_WARN("Path patterns with match components require " + "prim paths or the absolute root path ('/') as a prefix: " + "<%s> -- ignoring.", p.GetAsString().c_str()); + return *this; + } + } + else { + if (!(p.IsAbsoluteRootOrPrimPath() || p.IsPrimPropertyPath())) { + TF_WARN("Path pattern prefixes must be prim paths or prim-property " + "paths: <%s> -- ignoring.", p.GetAsString().c_str()); + return *this; + } + } + _prefix = std::move(p); + if (_components.empty()) { + _isProperty = _prefix.IsPrimPropertyPath(); + } + return *this; +} + +std::string +SdfPathPattern::GetText() const +{ + std::string result; + + if (_prefix == SdfPath::ReflexiveRelativePath()) { + if (_components.empty() || _components.front().IsStretch()) { + // If components is empty, or first component is a stretch, then we + // emit a leading '.', otherwise nothing. + result = "."; + } + } + else { + result = _prefix.GetAsString(); + } + + const bool prefixIsAbsRoot = _prefix == SdfPath::AbsoluteRootPath(); + for (size_t i = 0, end = _components.size(); i != end; ++i) { + if (_components[i].IsStretch()) { + result += (i == 0 && prefixIsAbsRoot) ? "/" : "//"; + continue; + } + if ((i + 1 == end) && _isProperty) { + result.push_back('.'); + } + else if (!result.empty() && result.back() != '/') { + result.push_back('/'); + } + result += _components[i].text; + if (_components[i].predicateIndex != -1) { + result += "{" + _predExprs[ + _components[i].predicateIndex].GetText() + "}"; + } + } + return result; +} + +PXR_NAMESPACE_CLOSE_SCOPE diff --git a/pxr/usd/sdf/pathPattern.h b/pxr/usd/sdf/pathPattern.h new file mode 100644 index 0000000000..7011e0c18a --- /dev/null +++ b/pxr/usd/sdf/pathPattern.h @@ -0,0 +1,295 @@ +// +// Copyright 2023 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// +#ifndef PXR_USD_SDF_PATH_PATTERN_H +#define PXR_USD_SDF_PATH_PATTERN_H + +#include "pxr/pxr.h" +#include "pxr/usd/sdf/api.h" +#include "pxr/usd/sdf/path.h" +#include "pxr/usd/sdf/predicateExpression.h" +#include "pxr/base/tf/hash.h" + +#include +#include +#include +#include +#include + +PXR_NAMESPACE_OPEN_SCOPE + +/// \class SdfPathPattern +/// +/// Objects of this class represent SdfPath matching patterns, consisting of +/// an SdfPath prefix followed by a sequence of components, which may +/// contain wildcards and optional embedded predicate expressions (see +/// SdfPredicateExpression). +class SdfPathPattern +{ +public: + /// Construct the empty pattern whose bool-conversion operator returns + /// false. + SDF_API + SdfPathPattern(); + + /// Construct a SdfPathPattern with the \p prefix path. + SDF_API + explicit SdfPathPattern(SdfPath const &prefix); + + /// Construct a SdfPathPattern with the \p prefix path. + SDF_API + explicit SdfPathPattern(SdfPath &&prefix); + + /// Return the pattern "//" which matches all paths. + SDF_API + static SdfPathPattern const &Everything(); + + /// Return the pattern ".//" which matches all paths descendant to an anchor + /// path. + SDF_API + static SdfPathPattern const &EveryDescendant(); + + /// Return a default constructed SdfPathPattern that matches nothing. + static SdfPathPattern Nothing() { + return {}; + } + + /// A component represents a pattern matching component past the initial + /// SdfPath prefix. A component's text can contain wildcard characters, and + /// if the component references a predicate expression, its predicateIndex + /// indicates which one in the owning SdfPathPattern's list of expressions. + /// A component that returns true for IsStretch() represents an "arbitrary + /// levels of hierarchy" element (the "//") in a path pattern. + struct Component { + bool IsStretch() const { + return predicateIndex == -1 && text.empty(); + } + + std::string text; + int predicateIndex = -1; + bool isLiteral = false; + + friend bool operator==(Component const &l, Component const &r) { + return std::tie(l.text, l.predicateIndex, l.isLiteral) == + std::tie(r.text, r.predicateIndex, r.isLiteral); + } + + friend bool operator!=(Component const &l, Component const &r) { + return !(l == r); + } + + template + friend void TfHashAppend(HashState &h, Component const &c) { + h.Append(c.text, c.predicateIndex, c.isLiteral); + } + + friend void swap(Component &l, Component &r) { + auto lt = std::tie(l.text, l.predicateIndex, l.isLiteral); + auto rt = std::tie(r.text, r.predicateIndex, r.isLiteral); + swap(lt, rt); + } + }; + + /// Return true if it is valid to append the child element \p text to this + /// pattern. If not, and \p reason is not nullptr, set it to an explanatory + /// reason why not. + bool CanAppendChild(std::string const &text, + std::string *reason = nullptr) const { + return CanAppendChild(text, {}, reason); + } + + /// Return true if it is valid to append the child element \p text and \p + /// predExpr to this pattern. If not, and \p reason is not nullptr, set it + /// to an explanatory reason why not. + SDF_API + bool CanAppendChild(std::string const &text, + SdfPredicateExpression const &predExpr, + std::string *reason = nullptr) const; + + /// Append a prim child component to this pattern, with optional + /// predicate expression \p predExpr. If this pattern does not yet + /// contain any wildcards or components with predicate expressions, and + /// the input text does not contain wildcards, and \p predExpr is empty, + /// then append a child component to this pattern's prefix path (see + /// GetPrefix()). Otherwise append this component to the sequence of + /// components. Return *this. + SDF_API + SdfPathPattern &AppendChild(std::string const &text, + SdfPredicateExpression &&predExpr); + /// \overload + SDF_API + SdfPathPattern &AppendChild(std::string const &text, + SdfPredicateExpression const &predExpr); + /// \overload + SDF_API + SdfPathPattern &AppendChild(std::string const &text); + + /// Return true if it is valid to append the property element \p text to + /// this pattern. If not, and \p reason is not nullptr, set it to an + /// explanatory reason why not. + bool CanAppendProperty(std::string const &text, + std::string *reason = nullptr) const { + return CanAppendProperty(text, {}, reason); + } + + /// Return true if it is valid to append the property element \p text and \p + /// predExpr to this pattern. If not, and \p reason is not nullptr, set it + /// to an explanatory reason why not. + SDF_API + bool CanAppendProperty(std::string const &text, + SdfPredicateExpression const &predExpr, + std::string *reason = nullptr) const; + + /// Append a prim property component to this pattern, with optional + /// predicate expression \p predExpr. If this pattern does not yet + /// contain any wildcards or components with predicate expressions, and + /// the input text does not contain wildcards, and \p predExpr is empty, + /// then append a property component to this pattern's prefix path (see + /// GetPrefix()). Otherwise append this component to the sequence of + /// components. Return *this. + SDF_API + SdfPathPattern &AppendProperty(std::string const &text, + SdfPredicateExpression &&predExpr); + /// \overload + SDF_API + SdfPathPattern &AppendProperty(std::string const &text, + SdfPredicateExpression const &predExpr); + /// \overload + SDF_API + SdfPathPattern &AppendProperty(std::string const &text); + + /// Return this pattern's non-speculative prefix (leading path + /// components with no wildcards and no predicates). + SdfPath const &GetPrefix() const & { + return _prefix; + } + + /// \overload + SdfPath GetPrefix() && { + return std::move(_prefix); + } + + /// Set this pattern's non-speculative prefix (leading path + /// components with no wildcards and no predicates). Return *this. + SDF_API + SdfPathPattern &SetPrefix(SdfPath &&p); + + /// \overload + SdfPathPattern &SetPrefix(SdfPath const &p) { + return SetPrefix(SdfPath(p)); + } + + /// Return true if this pattern's prefix is the absolute root path and and + /// its first component is a stretch component -- that is, the pattern + /// starts with `//`, false otherwise. + SDF_API + bool HasLeadingStretch() const; + + /// Return true if this pattern ends with a stretch component: `//`, false + /// otherwise. + SDF_API + bool HasTrailingStretch() const; + + /// Append a stretch component (i.e. `//`) to this pattern if it's possible + /// to do so. Otherwise do nothing. It is not possible to append a stretch + /// component to a pattern that already ends in a stretch component, or a + /// pattern that identifies a property. Return *this. + SDF_API + SdfPathPattern &AppendStretchIfPossible(); + + /// Remove trailing stretch from this pattern if it has trailing stretch. + /// Otherwise do nothing. Return *this. See HasTrailingStretch(). + SDF_API + SdfPathPattern &RemoveTrailingStretch(); + + /// If this pattern has components, remove the final component. Otherwise + /// do nothing. Return *this. To inspect and modify the prefix path, use + /// GetPrefix(), SetPrefix(). + SDF_API + SdfPathPattern &RemoveTrailingComponent(); + + /// Return the string representation of this pattern. + SDF_API + std::string GetText() const; + + /// Return this pattern's components that follow its non-speculative prefix + /// path. + std::vector const &GetComponents() const & { + return _components; + } + + /// \overload + std::vector GetComponents() && { + return std::move(_components); + } + + /// Return the predicate expressions used by this pattern. These are + /// indexed by a Component's predicateIndex member, if it is not -1. + std::vector const & + GetPredicateExprs() const & { + return _predExprs; + } + + /// \overload + std::vector + GetPredicateExprs() && { + return std::move(_predExprs); + } + + /// Return true if this pattern identifies properties exclusively, false + /// otherwise. + bool IsProperty() const { + return _isProperty; + } + + /// Return true if this pattern is not empty, false if it is. + explicit operator bool() const { + return !_prefix.IsEmpty(); + } + +private: + SdfPathPattern(SdfPath prefix, + std::vector &&components, + std::vector &&predExprs, + bool isProperty); + + template + friend void TfHashAppend(HashState &h, SdfPathPattern const &pat) { + h.Append(pat._prefix, pat._components, + pat._predExprs, pat._isProperty); + } + + friend bool + operator==(SdfPathPattern const &l, SdfPathPattern const &r) { + return std::tie(l._prefix, l._components, + l._predExprs, l._isProperty) == + std::tie(r._prefix, r._components, + r._predExprs, r._isProperty); + } + + friend bool + operator!=(SdfPathPattern const &l, SdfPathPattern const &r) { + return !(l == r); + } + + friend void swap(SdfPathPattern &l, SdfPathPattern &r) { + auto lt = std::tie( + l._prefix, l._components, l._predExprs, l._isProperty); + auto rt = std::tie( + r._prefix, r._components, r._predExprs, r._isProperty); + swap(lt, rt); + } + + SdfPath _prefix; + std::vector _components; + std::vector _predExprs; + bool _isProperty; +}; + + +PXR_NAMESPACE_CLOSE_SCOPE + +#endif // PXR_USD_SDF_PATH_PATTERN_H diff --git a/pxr/usd/sdf/pathPatternParser.h b/pxr/usd/sdf/pathPatternParser.h new file mode 100644 index 0000000000..0d930999c3 --- /dev/null +++ b/pxr/usd/sdf/pathPatternParser.h @@ -0,0 +1,207 @@ +// +// Copyright 2024 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// + +#ifndef PXR_USD_SDF_PATH_PATTERN_PARSER_H +#define PXR_USD_SDF_PATH_PATTERN_PARSER_H + +#include "pxr/pxr.h" + +#include "pxr/usd/sdf/predicateExpressionParser.h" +#include "pxr/base/pegtl/pegtl.hpp" + +#include + +PXR_NAMESPACE_OPEN_SCOPE + +namespace SdfPathPatternParser { + +using namespace PXR_PEGTL_NAMESPACE; + +template +using LookaheadList = seq, Sep, Rule>>; + +template using OptSpaced = pad; + +//////////////////////////////////////////////////////////////////////// +// Path patterns with predicates. +struct PathPatStretch : two<'/'> {}; +struct PathPatSep : sor> {}; + +struct BracedPredExpr + : if_must, + OptSpaced, + one<'}'>> {}; + +struct PrimPathWildCard : + seq< + plus>>, + opt,plus>>> + > {}; + +struct PropPathWildCard : + seq< + plus>>, + opt,plus>>> + > {}; + +struct PrimPathPatternElemText : PrimPathWildCard {}; +struct PropPathPatternElemText : PropPathWildCard {}; + +struct PrimPathPatternElem + : if_then_else, + BracedPredExpr> {}; + +struct PropPathPatternElem + : if_then_else, + BracedPredExpr> {}; + +struct PathPatternElems + : seq, + if_must_else, PropPathPatternElem, opt>> {}; + +struct AbsPathPattern : seq> {}; + +struct DotDot : two<'.'> {}; +struct DotDots : list> {}; + +struct ReflexiveRelative : one<'.'> {}; + +struct AbsoluteStart : at> {}; + +struct PathPattern : + sor< + if_must, + seq, success>>, + PathPatternElems, + seq>> + > +{}; + +} // SdfPathPatternParser + + +namespace SdfPathPatternActions { + +using namespace PXR_PEGTL_NAMESPACE; + +using namespace SdfPathPatternParser; + +// Actions ///////////////////////////////////////////////////////////// + +struct PatternBuilder +{ + // The final resulting pattern winds up here. + SdfPathPattern pattern; + + // These are used during parsing. + std::string curElemText; + SdfPredicateExpression curPredExpr; +}; + + +template +struct PathPatternAction : nothing {}; + +template <> +struct PathPatternAction +{ + template + static void apply(Input const &in, PatternBuilder &builder) { + builder.pattern.SetPrefix(SdfPath::AbsoluteRootPath()); + } +}; + +template <> +struct PathPatternAction +{ + template + static void apply(Input const &in, PatternBuilder &builder) { + // '//' appends a component representing arbitrary hierarchy. + TF_VERIFY(builder.pattern.AppendStretchIfPossible()); + } +}; + +// Change action & state to the PredicateExpressionParser so it can parse & +// build a predicate expression for us. +template <> +struct PathPatternAction + : change_action_and_states +{ + template + static void success(Input const &in, + SdfPredicateExprBuilder &predExprBuilder, + PatternBuilder &builder) { + builder.curPredExpr = predExprBuilder.Finish(); + } +}; + +template <> +struct PathPatternAction +{ + template + static void apply(Input const &in, PatternBuilder &builder) { + builder.curElemText = in.string(); + } +}; + +template <> +struct PathPatternAction +{ + template + static void apply(Input const &in, PatternBuilder &builder) { + builder.curElemText = in.string(); + } +}; + +template <> +struct PathPatternAction +{ + template + static void apply(Input const &in, PatternBuilder &builder) { + builder.pattern.AppendChild(builder.curElemText, builder.curPredExpr); + builder.curElemText.clear(); + builder.curPredExpr = SdfPredicateExpression(); + } +}; + +template <> +struct PathPatternAction +{ + template + static void apply(Input const &in, PatternBuilder &builder) { + builder.pattern.AppendProperty(builder.curElemText, + builder.curPredExpr); + builder.curElemText.clear(); + builder.curPredExpr = SdfPredicateExpression(); + } +}; + +template <> +struct PathPatternAction +{ + template + static void apply(Input const &in, PatternBuilder &builder) { + builder.pattern.SetPrefix(SdfPath::ReflexiveRelativePath()); + } +}; + +template <> +struct PathPatternAction +{ + template + static void apply(Input const &in, PatternBuilder &builder) { + builder.pattern.AppendChild(".."); + } +}; + +} // SdfPathPatternActions + +PXR_NAMESPACE_CLOSE_SCOPE + +#endif // PXR_USD_SDF_PATH_PATTERN_PARSER_H + diff --git a/pxr/usd/sdf/pathTable.cpp b/pxr/usd/sdf/pathTable.cpp index 320a4ccbfb..708198a40a 100644 --- a/pxr/usd/sdf/pathTable.cpp +++ b/pxr/usd/sdf/pathTable.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/sdf/pathTable.h b/pxr/usd/sdf/pathTable.h index 008400c96c..86e863bb96 100644 --- a/pxr/usd/sdf/pathTable.h +++ b/pxr/usd/sdf/pathTable.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDF_PATH_TABLE_H #define PXR_USD_SDF_PATH_TABLE_H diff --git a/pxr/usd/sdf/payload.cpp b/pxr/usd/sdf/payload.cpp index a2e0c15841..d16608df01 100644 --- a/pxr/usd/sdf/payload.cpp +++ b/pxr/usd/sdf/payload.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // // Payload.cpp // diff --git a/pxr/usd/sdf/payload.h b/pxr/usd/sdf/payload.h index b30616c4f3..c4bfd1f4c8 100644 --- a/pxr/usd/sdf/payload.h +++ b/pxr/usd/sdf/payload.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDF_PAYLOAD_H #define PXR_USD_SDF_PAYLOAD_H diff --git a/pxr/usd/sdf/pch.h b/pxr/usd/sdf/pch.h index 0728ebe683..8776157f2b 100644 --- a/pxr/usd/sdf/pch.h +++ b/pxr/usd/sdf/pch.h @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // // WARNING: THIS FILE IS GENERATED. DO NOT EDIT. // @@ -48,12 +31,17 @@ #define WIN32_LEAN_AND_MEAN #endif +#include #include #include +#include #endif #include +#include +#include #include #include +#include #include #include #include @@ -66,9 +54,11 @@ #include #include #include +#include #include #include #include +#include #include #include #include @@ -81,6 +71,7 @@ #include #include #include +#include #include #include #include @@ -89,78 +80,22 @@ #include #include #include +#include #include #include #include +#include #include #include #include #include #include #include +#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #ifdef PXR_PYTHON_SUPPORT_ENABLED +#include +#include #include #include #include @@ -198,8 +133,11 @@ #include #include #include +#include #include +#include #include +#include #include #include #include @@ -208,24 +146,6 @@ #undef toupper #endif #endif // PXR_PYTHON_SUPPORT_ENABLED -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include #include #include @@ -238,6 +158,8 @@ #include #include #include +#include +#include #ifdef PXR_PYTHON_SUPPORT_ENABLED #include "pxr/base/tf/pySafePython.h" #endif // PXR_PYTHON_SUPPORT_ENABLED diff --git a/pxr/usd/sdf/pool.cpp b/pxr/usd/sdf/pool.cpp index 0b43794b7f..8fd1432151 100644 --- a/pxr/usd/sdf/pool.cpp +++ b/pxr/usd/sdf/pool.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/sdf/pool.h b/pxr/usd/sdf/pool.h index a803d32d48..8e6f6c8d84 100644 --- a/pxr/usd/sdf/pool.h +++ b/pxr/usd/sdf/pool.h @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDF_POOL_H #define PXR_USD_SDF_POOL_H diff --git a/pxr/usd/sdf/predicateExpression.cpp b/pxr/usd/sdf/predicateExpression.cpp index ab56183c95..a96cbbd13e 100644 --- a/pxr/usd/sdf/predicateExpression.cpp +++ b/pxr/usd/sdf/predicateExpression.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" @@ -255,13 +238,13 @@ operator<<(std::ostream &out, SdfPredicateExpression const &expr) SdfPredicateExpression::SdfPredicateExpression( std::string const &input, std::string const &context) { - using namespace tao::TAO_PEGTL_NAMESPACE; + using namespace PXR_PEGTL_NAMESPACE; - Analyze(); try { SdfPredicateExprBuilder builder; // Uncomment the 'tracer' bit below for debugging. - parse>, PredAction/*, tracer*/>( + parse>, + SdfPredicateExpressionParser::PredAction/*, tracer*/>( string_input<> { input, context.empty() ? "" : context.c_str() }, builder); @@ -272,7 +255,7 @@ SdfPredicateExpression::SdfPredicateExpression( std::string errMsg = err.what(); errMsg += " -- "; bool first = true; - for (position const &p: err.positions) { + for (position const &p: err.positions()) { if (!first) { errMsg += ", "; } diff --git a/pxr/usd/sdf/predicateExpression.h b/pxr/usd/sdf/predicateExpression.h index 622d7a0281..71223652ad 100644 --- a/pxr/usd/sdf/predicateExpression.h +++ b/pxr/usd/sdf/predicateExpression.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDF_PREDICATE_EXPRESSION_H #define PXR_USD_SDF_PREDICATE_EXPRESSION_H diff --git a/pxr/usd/sdf/predicateExpressionParser.h b/pxr/usd/sdf/predicateExpressionParser.h index 4c532436bf..8255983ffa 100644 --- a/pxr/usd/sdf/predicateExpressionParser.h +++ b/pxr/usd/sdf/predicateExpressionParser.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDF_PREDICATE_EXPRESSION_PARSER_H @@ -31,7 +14,7 @@ #include "pxr/base/tf/diagnostic.h" #include "pxr/base/vt/value.h" -#include "pxr/base/tf/pxrPEGTL/pegtl.h" +#include "pxr/base/pegtl/pegtl.hpp" #include @@ -160,9 +143,9 @@ struct SdfPredicateExprBuilder //////////////////////////////////////////////////////////////////////// // Grammar. -namespace { +namespace SdfPredicateExpressionParser { -using namespace tao::TAO_PEGTL_NAMESPACE; +using namespace PXR_PEGTL_NAMESPACE; template using LookaheadList = seq, Sep, Rule>>; @@ -401,15 +384,6 @@ template <> struct PredAction template <> struct PredAction : PredCallAction {}; -template -static void Analyze() { - static const size_t numIssues = analyze(); - if (numIssues) { - TF_FATAL_ERROR("%zu issues found in '%s'", numIssues, - TF_FUNC_NAME().c_str()); - } -} - } PXR_NAMESPACE_CLOSE_SCOPE diff --git a/pxr/usd/sdf/predicateLibrary.cpp b/pxr/usd/sdf/predicateLibrary.cpp index 68c7c23d01..d7117b6998 100644 --- a/pxr/usd/sdf/predicateLibrary.cpp +++ b/pxr/usd/sdf/predicateLibrary.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/sdf/predicateLibrary.h b/pxr/usd/sdf/predicateLibrary.h index 3070732439..4c07ae12f4 100644 --- a/pxr/usd/sdf/predicateLibrary.h +++ b/pxr/usd/sdf/predicateLibrary.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDF_PREDICATE_LIBRARY_H #define PXR_USD_SDF_PREDICATE_LIBRARY_H @@ -33,7 +16,6 @@ #include "pxr/base/vt/value.h" #include "pxr/usd/sdf/predicateExpression.h" -#include "pxr/usd/sdf/invoke.hpp" #include #include @@ -653,10 +635,9 @@ class SdfPredicateLibrary std::integral_constant {}, args, boundArgs, typedArgs); return [typedArgs, fn](DomainType const &obj) { - // invoke fn with obj & typedArgs. (std::apply in '17). return SdfPredicateFunctionResult { - invoke_hpp::apply(fn, std::tuple_cat( - std::make_tuple(obj), typedArgs)) + std::apply(fn, + std::tuple_cat(std::make_tuple(obj), typedArgs)) }; }; } diff --git a/pxr/usd/sdf/predicateProgram.h b/pxr/usd/sdf/predicateProgram.h index 4fb8ee3881..02ec25cbd6 100644 --- a/pxr/usd/sdf/predicateProgram.h +++ b/pxr/usd/sdf/predicateProgram.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDF_PREDICATE_PROGRAM_H #define PXR_USD_SDF_PREDICATE_PROGRAM_H @@ -33,7 +16,6 @@ #include "pxr/usd/sdf/predicateExpression.h" #include "pxr/usd/sdf/predicateLibrary.h" -#include "pxr/usd/sdf/invoke.hpp" #include #include diff --git a/pxr/usd/sdf/primSpec.cpp b/pxr/usd/sdf/primSpec.cpp index 86a383ef4b..a23de69c62 100644 --- a/pxr/usd/sdf/primSpec.cpp +++ b/pxr/usd/sdf/primSpec.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // /// \file PrimSpec.cpp diff --git a/pxr/usd/sdf/primSpec.h b/pxr/usd/sdf/primSpec.h index 7dd4af65c9..b4f243eaa1 100644 --- a/pxr/usd/sdf/primSpec.h +++ b/pxr/usd/sdf/primSpec.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDF_PRIM_SPEC_H #define PXR_USD_SDF_PRIM_SPEC_H diff --git a/pxr/usd/sdf/propertySpec.cpp b/pxr/usd/sdf/propertySpec.cpp index c6ee26f181..4276c6403a 100644 --- a/pxr/usd/sdf/propertySpec.cpp +++ b/pxr/usd/sdf/propertySpec.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/sdf/propertySpec.h b/pxr/usd/sdf/propertySpec.h index 7eba83edc5..cee3948d93 100644 --- a/pxr/usd/sdf/propertySpec.h +++ b/pxr/usd/sdf/propertySpec.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDF_PROPERTY_SPEC_H #define PXR_USD_SDF_PROPERTY_SPEC_H diff --git a/pxr/usd/sdf/proxyPolicies.cpp b/pxr/usd/sdf/proxyPolicies.cpp index 7db7215fac..a5b9455543 100644 --- a/pxr/usd/sdf/proxyPolicies.cpp +++ b/pxr/usd/sdf/proxyPolicies.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // /// \file ProxyPolicies.cpp diff --git a/pxr/usd/sdf/proxyPolicies.h b/pxr/usd/sdf/proxyPolicies.h index 35c6aecd55..e6d465790f 100644 --- a/pxr/usd/sdf/proxyPolicies.h +++ b/pxr/usd/sdf/proxyPolicies.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDF_PROXY_POLICIES_H #define PXR_USD_SDF_PROXY_POLICIES_H diff --git a/pxr/usd/sdf/proxyTypes.cpp b/pxr/usd/sdf/proxyTypes.cpp index cad4eb55fe..5a000cd464 100644 --- a/pxr/usd/sdf/proxyTypes.cpp +++ b/pxr/usd/sdf/proxyTypes.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // // Types.cpp // diff --git a/pxr/usd/sdf/proxyTypes.h b/pxr/usd/sdf/proxyTypes.h index 7974c0ef52..69553a5e95 100644 --- a/pxr/usd/sdf/proxyTypes.h +++ b/pxr/usd/sdf/proxyTypes.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDF_PROXY_TYPES_H #define PXR_USD_SDF_PROXY_TYPES_H diff --git a/pxr/usd/sdf/pseudoRootSpec.cpp b/pxr/usd/sdf/pseudoRootSpec.cpp index dfc79c49b4..faf4a6a4cf 100644 --- a/pxr/usd/sdf/pseudoRootSpec.cpp +++ b/pxr/usd/sdf/pseudoRootSpec.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // /// \file PseudoRootSpec.cpp diff --git a/pxr/usd/sdf/pseudoRootSpec.h b/pxr/usd/sdf/pseudoRootSpec.h index 320ed33ff2..2b9d55c36e 100644 --- a/pxr/usd/sdf/pseudoRootSpec.h +++ b/pxr/usd/sdf/pseudoRootSpec.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDF_PSEUDO_ROOT_SPEC_H #define PXR_USD_SDF_PSEUDO_ROOT_SPEC_H diff --git a/pxr/usd/sdf/pyChildrenProxy.cpp b/pxr/usd/sdf/pyChildrenProxy.cpp index 02207a8f83..47b7785504 100644 --- a/pxr/usd/sdf/pyChildrenProxy.cpp +++ b/pxr/usd/sdf/pyChildrenProxy.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // /// \file PyChildrenProxy.cpp diff --git a/pxr/usd/sdf/pyChildrenProxy.h b/pxr/usd/sdf/pyChildrenProxy.h index 5b13a9825c..0ad8e9be42 100644 --- a/pxr/usd/sdf/pyChildrenProxy.h +++ b/pxr/usd/sdf/pyChildrenProxy.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDF_PY_CHILDREN_PROXY_H #define PXR_USD_SDF_PY_CHILDREN_PROXY_H diff --git a/pxr/usd/sdf/pyChildrenView.cpp b/pxr/usd/sdf/pyChildrenView.cpp index 6d2ee78943..31ed1ff657 100644 --- a/pxr/usd/sdf/pyChildrenView.cpp +++ b/pxr/usd/sdf/pyChildrenView.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // /// \file PyChildrenView.cpp #include "pxr/usd/sdf/pyChildrenView.h" diff --git a/pxr/usd/sdf/pyChildrenView.h b/pxr/usd/sdf/pyChildrenView.h index c52ca7cb6a..b817bee01f 100644 --- a/pxr/usd/sdf/pyChildrenView.h +++ b/pxr/usd/sdf/pyChildrenView.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDF_PY_CHILDREN_VIEW_H #define PXR_USD_SDF_PY_CHILDREN_VIEW_H diff --git a/pxr/usd/sdf/pyListEditorProxy.cpp b/pxr/usd/sdf/pyListEditorProxy.cpp index eab9c848ba..8adceb5f2a 100644 --- a/pxr/usd/sdf/pyListEditorProxy.cpp +++ b/pxr/usd/sdf/pyListEditorProxy.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // /// \file PyListEditorProxy.cpp diff --git a/pxr/usd/sdf/pyListEditorProxy.h b/pxr/usd/sdf/pyListEditorProxy.h index 738eacc7b8..13d39645ec 100644 --- a/pxr/usd/sdf/pyListEditorProxy.h +++ b/pxr/usd/sdf/pyListEditorProxy.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDF_PY_LIST_EDITOR_PROXY_H #define PXR_USD_SDF_PY_LIST_EDITOR_PROXY_H diff --git a/pxr/usd/sdf/pyListOp.cpp b/pxr/usd/sdf/pyListOp.cpp index df1c0d3caa..a0a83fda0d 100644 --- a/pxr/usd/sdf/pyListOp.cpp +++ b/pxr/usd/sdf/pyListOp.cpp @@ -1,24 +1,7 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/sdf/pyListOp.h" diff --git a/pxr/usd/sdf/pyListOp.h b/pxr/usd/sdf/pyListOp.h index aab9017f5d..66170b7db0 100644 --- a/pxr/usd/sdf/pyListOp.h +++ b/pxr/usd/sdf/pyListOp.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDF_PY_LIST_OP_H #define PXR_USD_SDF_PY_LIST_OP_H diff --git a/pxr/usd/sdf/pyListProxy.cpp b/pxr/usd/sdf/pyListProxy.cpp index 9bcb42a2c4..aa34c7bfd8 100644 --- a/pxr/usd/sdf/pyListProxy.cpp +++ b/pxr/usd/sdf/pyListProxy.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // /// \file PyListProxy.cpp diff --git a/pxr/usd/sdf/pyListProxy.h b/pxr/usd/sdf/pyListProxy.h index afffe7ddb7..d8d3620192 100644 --- a/pxr/usd/sdf/pyListProxy.h +++ b/pxr/usd/sdf/pyListProxy.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDF_PY_LIST_PROXY_H #define PXR_USD_SDF_PY_LIST_PROXY_H @@ -81,6 +64,7 @@ class SdfPyWrapListProxy { .def("ApplyList", &Type::ApplyList) .def("ApplyEditsToList", &This::_ApplyEditsToList) .add_property("expired", &This::_IsExpired) + .add_static_property("invalidIndex", &This::_GetInvalidIndex) .def(self == self) .def(self != self) .def(self < self) @@ -234,13 +218,24 @@ class SdfPyWrapListProxy { } } + static int _GetInvalidIndex() + { + // Note that SdfListProxy::Find returns an unsigned value, however the + // wrapped class returns -1 in the event that a value could not be found + // in the list of operations. + return -1; + } + static int _FindIndex(const Type& x, const value_type& value) { if (x._Validate()) { - return static_cast(x.Find(value)); + const size_t index = x.Find(value); + return index == Type::invalidIndex + ? _GetInvalidIndex() + : static_cast(index); } else { - return -1; + return _GetInvalidIndex(); } } diff --git a/pxr/usd/sdf/pyMapEditProxy.cpp b/pxr/usd/sdf/pyMapEditProxy.cpp index 7585cd3d6c..7eaf69cdfc 100644 --- a/pxr/usd/sdf/pyMapEditProxy.cpp +++ b/pxr/usd/sdf/pyMapEditProxy.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // /// \file PyMapEditProxy.cpp diff --git a/pxr/usd/sdf/pyMapEditProxy.h b/pxr/usd/sdf/pyMapEditProxy.h index 62fe3c0520..566ede3a87 100644 --- a/pxr/usd/sdf/pyMapEditProxy.h +++ b/pxr/usd/sdf/pyMapEditProxy.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDF_PY_MAP_EDIT_PROXY_H #define PXR_USD_SDF_PY_MAP_EDIT_PROXY_H diff --git a/pxr/usd/sdf/pySpec.cpp b/pxr/usd/sdf/pySpec.cpp index f66e88f59b..98ed665bb9 100644 --- a/pxr/usd/sdf/pySpec.cpp +++ b/pxr/usd/sdf/pySpec.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // /// \file PySpec.cpp diff --git a/pxr/usd/sdf/pySpec.h b/pxr/usd/sdf/pySpec.h index bd35de8fc9..306d67233f 100644 --- a/pxr/usd/sdf/pySpec.h +++ b/pxr/usd/sdf/pySpec.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. #ifndef PXR_USD_SDF_PY_SPEC_H #define PXR_USD_SDF_PY_SPEC_H diff --git a/pxr/usd/sdf/pyUtils.cpp b/pxr/usd/sdf/pyUtils.cpp index 654f9c01e0..4a869a5bd4 100644 --- a/pxr/usd/sdf/pyUtils.cpp +++ b/pxr/usd/sdf/pyUtils.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/sdf/pyUtils.h b/pxr/usd/sdf/pyUtils.h index 4106cd6835..7f439e5887 100644 --- a/pxr/usd/sdf/pyUtils.h +++ b/pxr/usd/sdf/pyUtils.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDF_PY_UTILS_H #define PXR_USD_SDF_PY_UTILS_H diff --git a/pxr/usd/sdf/reference.cpp b/pxr/usd/sdf/reference.cpp index 4d1f3f4e8a..82040f1e32 100644 --- a/pxr/usd/sdf/reference.cpp +++ b/pxr/usd/sdf/reference.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // // Reference.cpp // diff --git a/pxr/usd/sdf/reference.h b/pxr/usd/sdf/reference.h index 7824ea7e1b..2e0810148c 100644 --- a/pxr/usd/sdf/reference.h +++ b/pxr/usd/sdf/reference.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDF_REFERENCE_H #define PXR_USD_SDF_REFERENCE_H diff --git a/pxr/usd/sdf/relationshipSpec.cpp b/pxr/usd/sdf/relationshipSpec.cpp index 888487ef1e..66546418fa 100644 --- a/pxr/usd/sdf/relationshipSpec.cpp +++ b/pxr/usd/sdf/relationshipSpec.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // /// \file RelationshipSpec.cpp diff --git a/pxr/usd/sdf/relationshipSpec.h b/pxr/usd/sdf/relationshipSpec.h index 62e675b784..36f5f8a804 100644 --- a/pxr/usd/sdf/relationshipSpec.h +++ b/pxr/usd/sdf/relationshipSpec.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDF_RELATIONSHIP_SPEC_H #define PXR_USD_SDF_RELATIONSHIP_SPEC_H diff --git a/pxr/usd/sdf/schema.cpp b/pxr/usd/sdf/schema.cpp index e5e98f2a73..ac37301847 100644 --- a/pxr/usd/sdf/schema.cpp +++ b/pxr/usd/sdf/schema.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" @@ -394,7 +377,8 @@ SDF_VALIDATE_WRAPPER(InheritPath, SdfPath); SDF_VALIDATE_WRAPPER(Payload, SdfPayload); SDF_VALIDATE_WRAPPER(Reference, SdfReference); SDF_VALIDATE_WRAPPER(RelationshipTargetPath, SdfPath); -SDF_VALIDATE_WRAPPER(RelocatesPath, SdfPath); +SDF_VALIDATE_WRAPPER(RelocatesSourcePath, SdfPath); +SDF_VALIDATE_WRAPPER(RelocatesTargetPath, SdfPath); SDF_VALIDATE_WRAPPER(Relocate, SdfRelocate); SDF_VALIDATE_WRAPPER(SpecializesPath, SdfPath); SDF_VALIDATE_WRAPPER(SubLayer, std::string); @@ -788,8 +772,8 @@ SdfSchemaBase::_RegisterStandardFields() _DoRegisterField(SdfFieldKeys->LayerRelocates, SdfRelocates()) .ListValueValidator(&_ValidateRelocate); _DoRegisterField(SdfFieldKeys->Relocates, SdfRelocatesMap()) - .MapKeyValidator(&_ValidateRelocatesPath) - .MapValueValidator(&_ValidateRelocatesPath); + .MapKeyValidator(&_ValidateRelocatesSourcePath) + .MapValueValidator(&_ValidateRelocatesTargetPath); _DoRegisterField(SdfFieldKeys->Specifier, SdfSpecifierOver); _DoRegisterField(SdfFieldKeys->StartFrame, 0.0); _DoRegisterField(SdfFieldKeys->StartTimeCode, 0.0); @@ -1343,7 +1327,7 @@ SdfSchemaBase::IsValidVariantSelection(const std::string& sel) } SdfAllowed -SdfSchemaBase::IsValidRelocatesPath(const SdfPath& path) +SdfSchemaBase::IsValidRelocatesSourcePath(const SdfPath& path) { if (_PathContainsProhibitedVariantSelection(path)) { return SdfAllowed("Relocate paths cannot contain " @@ -1357,13 +1341,25 @@ SdfSchemaBase::IsValidRelocatesPath(const SdfPath& path) return true; } +SdfAllowed +SdfSchemaBase::IsValidRelocatesTargetPath(const SdfPath& path) +{ + // Relocates target paths are allowed to be empty but source paths are not. + if (path.IsEmpty()) { + return true; + } + return IsValidRelocatesSourcePath(path); +} + SdfAllowed SdfSchemaBase::IsValidRelocate(const SdfRelocate &relocate) { - if (SdfAllowed isValid = IsValidRelocatesPath(relocate.first); !isValid) { + if (SdfAllowed isValid = IsValidRelocatesSourcePath(relocate.first); + !isValid) { return isValid; } - if (SdfAllowed isValid = IsValidRelocatesPath(relocate.second); !isValid) { + if (SdfAllowed isValid = IsValidRelocatesTargetPath(relocate.second); + !isValid) { return isValid; } diff --git a/pxr/usd/sdf/schema.h b/pxr/usd/sdf/schema.h index 3f4ce64a1b..63571b5d70 100644 --- a/pxr/usd/sdf/schema.h +++ b/pxr/usd/sdf/schema.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDF_SCHEMA_H #define PXR_USD_SDF_SCHEMA_H @@ -307,7 +290,9 @@ class SdfSchemaBase : public TfWeakBase { SDF_API static SdfAllowed IsValidRelationshipTargetPath(const SdfPath& path); SDF_API - static SdfAllowed IsValidRelocatesPath(const SdfPath& path); + static SdfAllowed IsValidRelocatesSourcePath(const SdfPath& path); + SDF_API + static SdfAllowed IsValidRelocatesTargetPath(const SdfPath& path); SDF_API static SdfAllowed IsValidRelocate(const SdfRelocate& relocate); SDF_API diff --git a/pxr/usd/sdf/schemaTypeRegistration.h b/pxr/usd/sdf/schemaTypeRegistration.h index 3c662fb9c0..74c6ab29bf 100644 --- a/pxr/usd/sdf/schemaTypeRegistration.h +++ b/pxr/usd/sdf/schemaTypeRegistration.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDF_SCHEMA_TYPE_REGISTRATION_H #define PXR_USD_SDF_SCHEMA_TYPE_REGISTRATION_H diff --git a/pxr/usd/sdf/sdfGenAsciiParsers.py b/pxr/usd/sdf/sdfGenAsciiParsers.py index 653b66b5dd..d41dff04b8 100644 --- a/pxr/usd/sdf/sdfGenAsciiParsers.py +++ b/pxr/usd/sdf/sdfGenAsciiParsers.py @@ -2,25 +2,8 @@ # # Copyright 2016 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # # A script for generating the ascii parser files for Sdf. # This takes the flex and bison sources in Sdf and generates C++ @@ -145,25 +128,8 @@ def _runBisonAndFlexCommands(configuration): "//" , "// Copyright 2016 Pixar" , "//" - , "// Licensed under the Apache License, Version 2.0 (the \"Apache License\")" - , "// with the following modification; you may not use this file except in" - , "// compliance with the Apache License and the following modification to it:" - , "// Section 6. Trademarks. is deleted and replaced with:" - , "//" - , "// 6. Trademarks. This License does not grant permission to use the trade" - , "// names, trademarks, service marks, or product names of the Licensor" - , "// and its affiliates, except as required to comply with Section 4(c) of" - , "// the License and to reproduce the content of the NOTICE file." - , "//" - , "// You may obtain a copy of the Apache License at" - , "//" - , "// http://www.apache.org/licenses/LICENSE-2.0" - , "//" - , "// Unless required by applicable law or agreed to in writing, software" - , "// distributed under the Apache License with the above modification is" - , "// distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY" - , "// KIND, either express or implied. See the Apache License for the specific" - , "// language governing permissions and limitations under the Apache License." + , "// Licensed under the terms set forth in the LICENSE.txt file available at" + , "// https://openusd.org/license." , "//\n"]) for generatedFile in generatedFiles: diff --git a/pxr/usd/sdf/site.cpp b/pxr/usd/sdf/site.cpp index a9fc13d737..9ed17ee071 100644 --- a/pxr/usd/sdf/site.cpp +++ b/pxr/usd/sdf/site.cpp @@ -1,24 +1,7 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/sdf/site.h" diff --git a/pxr/usd/sdf/site.h b/pxr/usd/sdf/site.h index c2d1b40464..382fc0224f 100644 --- a/pxr/usd/sdf/site.h +++ b/pxr/usd/sdf/site.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDF_SITE_H #define PXR_USD_SDF_SITE_H diff --git a/pxr/usd/sdf/siteUtils.cpp b/pxr/usd/sdf/siteUtils.cpp index cd7cebb831..c7b3394cf9 100644 --- a/pxr/usd/sdf/siteUtils.cpp +++ b/pxr/usd/sdf/siteUtils.cpp @@ -1,24 +1,7 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/sdf/siteUtils.h" diff --git a/pxr/usd/sdf/siteUtils.h b/pxr/usd/sdf/siteUtils.h index b5258a5f56..390d43934a 100644 --- a/pxr/usd/sdf/siteUtils.h +++ b/pxr/usd/sdf/siteUtils.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDF_SITE_UTILS_H #define PXR_USD_SDF_SITE_UTILS_H diff --git a/pxr/usd/sdf/spec.cpp b/pxr/usd/sdf/spec.cpp index 564db2bc18..79197374e9 100644 --- a/pxr/usd/sdf/spec.cpp +++ b/pxr/usd/sdf/spec.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/sdf/spec.h b/pxr/usd/sdf/spec.h index cacc871fc2..1488cb79ea 100644 --- a/pxr/usd/sdf/spec.h +++ b/pxr/usd/sdf/spec.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDF_SPEC_H #define PXR_USD_SDF_SPEC_H diff --git a/pxr/usd/sdf/specType.cpp b/pxr/usd/sdf/specType.cpp index 37b3057633..f8f7a439e7 100644 --- a/pxr/usd/sdf/specType.cpp +++ b/pxr/usd/sdf/specType.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // /// \file SpecType.cpp diff --git a/pxr/usd/sdf/specType.h b/pxr/usd/sdf/specType.h index 61f652ea3b..77962294ac 100644 --- a/pxr/usd/sdf/specType.h +++ b/pxr/usd/sdf/specType.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDF_SPEC_TYPE_H #define PXR_USD_SDF_SPEC_TYPE_H diff --git a/pxr/usd/sdf/subLayerListEditor.cpp b/pxr/usd/sdf/subLayerListEditor.cpp index 85a0bc8167..f3d3d217ab 100644 --- a/pxr/usd/sdf/subLayerListEditor.cpp +++ b/pxr/usd/sdf/subLayerListEditor.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // /// \file SubLayerListEditor.cpp diff --git a/pxr/usd/sdf/subLayerListEditor.h b/pxr/usd/sdf/subLayerListEditor.h index 4bba4acaf6..32b250664c 100644 --- a/pxr/usd/sdf/subLayerListEditor.h +++ b/pxr/usd/sdf/subLayerListEditor.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDF_SUB_LAYER_LIST_EDITOR_H #define PXR_USD_SDF_SUB_LAYER_LIST_EDITOR_H diff --git a/pxr/usd/sdf/testenv/TestSdfFileFormatCapabilities.cpp b/pxr/usd/sdf/testenv/TestSdfFileFormatCapabilities.cpp index e25f7541bf..643c0e918b 100644 --- a/pxr/usd/sdf/testenv/TestSdfFileFormatCapabilities.cpp +++ b/pxr/usd/sdf/testenv/TestSdfFileFormatCapabilities.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/base/tf/staticTokens.h" diff --git a/pxr/usd/sdf/testenv/TestSdfNoAssetFileFormat.cpp b/pxr/usd/sdf/testenv/TestSdfNoAssetFileFormat.cpp index a8737f2b97..62ead4b071 100644 --- a/pxr/usd/sdf/testenv/TestSdfNoAssetFileFormat.cpp +++ b/pxr/usd/sdf/testenv/TestSdfNoAssetFileFormat.cpp @@ -1,25 +1,8 @@ // // Copyright 2021 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/base/tf/staticTokens.h" diff --git a/pxr/usd/sdf/testenv/TestSdfResolver.cpp b/pxr/usd/sdf/testenv/TestSdfResolver.cpp index 264ce49646..fe5ac8a522 100644 --- a/pxr/usd/sdf/testenv/TestSdfResolver.cpp +++ b/pxr/usd/sdf/testenv/TestSdfResolver.cpp @@ -1,25 +1,8 @@ // // Copyright 2021 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/sdf/testenv/TestSdfStreamingFileFormat.cpp b/pxr/usd/sdf/testenv/TestSdfStreamingFileFormat.cpp index 56ed9bd4a7..9acc37ec97 100644 --- a/pxr/usd/sdf/testenv/TestSdfStreamingFileFormat.cpp +++ b/pxr/usd/sdf/testenv/TestSdfStreamingFileFormat.cpp @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/sdf/testenv/TestSdfTargetFileFormat.cpp b/pxr/usd/sdf/testenv/TestSdfTargetFileFormat.cpp index bcc6a340dd..eb4239d848 100644 --- a/pxr/usd/sdf/testenv/TestSdfTargetFileFormat.cpp +++ b/pxr/usd/sdf/testenv/TestSdfTargetFileFormat.cpp @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/base/tf/staticTokens.h" diff --git a/pxr/usd/sdf/testenv/testSdfAssetPath.py b/pxr/usd/sdf/testenv/testSdfAssetPath.py index 1d9b4f9726..c0221aef8e 100644 --- a/pxr/usd/sdf/testenv/testSdfAssetPath.py +++ b/pxr/usd/sdf/testenv/testSdfAssetPath.py @@ -2,25 +2,8 @@ # # Copyright 2023 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from __future__ import print_function diff --git a/pxr/usd/sdf/testenv/testSdfAttribute.py b/pxr/usd/sdf/testenv/testSdfAttribute.py index d09017ed60..8704f09e25 100644 --- a/pxr/usd/sdf/testenv/testSdfAttribute.py +++ b/pxr/usd/sdf/testenv/testSdfAttribute.py @@ -2,25 +2,8 @@ # # Copyright 2020 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # pylint: disable=range-builtin-not-iterating diff --git a/pxr/usd/sdf/testenv/testSdfAttributeBlocking.cpp b/pxr/usd/sdf/testenv/testSdfAttributeBlocking.cpp index 6c7675343d..8e44964776 100644 --- a/pxr/usd/sdf/testenv/testSdfAttributeBlocking.cpp +++ b/pxr/usd/sdf/testenv/testSdfAttributeBlocking.cpp @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include diff --git a/pxr/usd/sdf/testenv/testSdfAttributeBlocking.py b/pxr/usd/sdf/testenv/testSdfAttributeBlocking.py index a38f6ed736..623ec1b203 100644 --- a/pxr/usd/sdf/testenv/testSdfAttributeBlocking.py +++ b/pxr/usd/sdf/testenv/testSdfAttributeBlocking.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from pxr import Sdf import unittest diff --git a/pxr/usd/sdf/testenv/testSdfBatchNamespaceEdit.py b/pxr/usd/sdf/testenv/testSdfBatchNamespaceEdit.py index 6a9c05827c..acdd6ba3dd 100644 --- a/pxr/usd/sdf/testenv/testSdfBatchNamespaceEdit.py +++ b/pxr/usd/sdf/testenv/testSdfBatchNamespaceEdit.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from __future__ import print_function diff --git a/pxr/usd/sdf/testenv/testSdfColorConfig.py b/pxr/usd/sdf/testenv/testSdfColorConfig.py index 21b2dac7fb..727249a7fc 100644 --- a/pxr/usd/sdf/testenv/testSdfColorConfig.py +++ b/pxr/usd/sdf/testenv/testSdfColorConfig.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from pxr import Sdf import unittest diff --git a/pxr/usd/sdf/testenv/testSdfCopyUtils.py b/pxr/usd/sdf/testenv/testSdfCopyUtils.py index 6a2b452fc7..aad2266746 100644 --- a/pxr/usd/sdf/testenv/testSdfCopyUtils.py +++ b/pxr/usd/sdf/testenv/testSdfCopyUtils.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from pxr import Sdf import textwrap, unittest diff --git a/pxr/usd/sdf/testenv/testSdfCustomLayerData.py b/pxr/usd/sdf/testenv/testSdfCustomLayerData.py index 80bd67db5f..98cf0938d0 100644 --- a/pxr/usd/sdf/testenv/testSdfCustomLayerData.py +++ b/pxr/usd/sdf/testenv/testSdfCustomLayerData.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from pxr import Sdf import unittest diff --git a/pxr/usd/sdf/testenv/testSdfDetachedLayer.py b/pxr/usd/sdf/testenv/testSdfDetachedLayer.py index a80428b625..e8f079eeed 100644 --- a/pxr/usd/sdf/testenv/testSdfDetachedLayer.py +++ b/pxr/usd/sdf/testenv/testSdfDetachedLayer.py @@ -2,25 +2,8 @@ # # Copyright 2022 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. import os, unittest diff --git a/pxr/usd/sdf/testenv/testSdfFileFormat.py b/pxr/usd/sdf/testenv/testSdfFileFormat.py index d33488f58e..1b8badd6a1 100644 --- a/pxr/usd/sdf/testenv/testSdfFileFormat.py +++ b/pxr/usd/sdf/testenv/testSdfFileFormat.py @@ -2,25 +2,8 @@ # # Copyright 2018 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from __future__ import print_function diff --git a/pxr/usd/sdf/testenv/testSdfFileFormatCapabilities.py b/pxr/usd/sdf/testenv/testSdfFileFormatCapabilities.py index 3f912e1c8a..144da3f920 100644 --- a/pxr/usd/sdf/testenv/testSdfFileFormatCapabilities.py +++ b/pxr/usd/sdf/testenv/testSdfFileFormatCapabilities.py @@ -2,25 +2,8 @@ # # Copyright 2023 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from __future__ import print_function import os, tempfile, unittest diff --git a/pxr/usd/sdf/testenv/testSdfHardToReach.cpp b/pxr/usd/sdf/testenv/testSdfHardToReach.cpp index f9a07fd008..7184497337 100644 --- a/pxr/usd/sdf/testenv/testSdfHardToReach.cpp +++ b/pxr/usd/sdf/testenv/testSdfHardToReach.cpp @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/sdf/attributeSpec.h" @@ -115,6 +98,36 @@ _TestSdfLayerTimeSampleValueType() TF_AXIOM(vtValue.UncheckedGet() == 4.0); } +static void +_TestSdfLayerTransferContentsEmptyLayer() +{ + // Tests that setting data on non empty layers properly cleans up all + // specs in that layer without the use of SdfLayer::_IsInertSubtree + const char* layerStr = + R"(#sdf 1.4.32 + def "Root"{ + def "Node1" ( + prepend variantSets = "testVariants" + variants = { string testVariants = "option1" } + ) + { + variantSet "testVariants" = { + "option1" { + def "VariantChild" {} + } + } + def "Node1Child" {} + } + })"; + + SdfLayerRefPtr srcLayer = SdfLayer::CreateAnonymous(); + srcLayer->ImportFromString(layerStr); + TF_AXIOM(!srcLayer->IsEmpty()); + + srcLayer->TransferContent(SdfLayer::CreateAnonymous()); + TF_AXIOM(srcLayer->IsEmpty()); +} + static void _TestSdfLayerTransferContents() { @@ -467,13 +480,23 @@ _TestSdfSchemaPathValidation() TF_AXIOM(!schema.IsValidReference(SdfReference("a.sdf", SdfPath("/A{x=y}B")))); - TF_AXIOM(schema.IsValidRelocatesPath(SdfPath("A"))); - TF_AXIOM(schema.IsValidRelocatesPath(SdfPath("/A"))); - TF_AXIOM(schema.IsValidRelocatesPath(SdfPath("/A/B"))); - TF_AXIOM(!schema.IsValidRelocatesPath(SdfPath())); - TF_AXIOM(!schema.IsValidRelocatesPath(SdfPath("/A.a"))); - TF_AXIOM(!schema.IsValidRelocatesPath(SdfPath("/A{x=y}"))); - TF_AXIOM(!schema.IsValidRelocatesPath(SdfPath("/A{x=y}B"))); + TF_AXIOM(schema.IsValidRelocatesSourcePath(SdfPath("A"))); + TF_AXIOM(schema.IsValidRelocatesSourcePath(SdfPath("/A"))); + TF_AXIOM(schema.IsValidRelocatesSourcePath(SdfPath("/A/B"))); + TF_AXIOM(!schema.IsValidRelocatesSourcePath(SdfPath())); + TF_AXIOM(!schema.IsValidRelocatesSourcePath(SdfPath("/A.a"))); + TF_AXIOM(!schema.IsValidRelocatesSourcePath(SdfPath("/A{x=y}"))); + TF_AXIOM(!schema.IsValidRelocatesSourcePath(SdfPath("/A{x=y}B"))); + + // IsValidRelocatesTargetPath is the same as IsValidRelocatesSourcePath + // except that the empty path is allowed for target paths. + TF_AXIOM(schema.IsValidRelocatesTargetPath(SdfPath("A"))); + TF_AXIOM(schema.IsValidRelocatesTargetPath(SdfPath("/A"))); + TF_AXIOM(schema.IsValidRelocatesTargetPath(SdfPath("/A/B"))); + TF_AXIOM(schema.IsValidRelocatesTargetPath(SdfPath())); + TF_AXIOM(!schema.IsValidRelocatesTargetPath(SdfPath("/A.a"))); + TF_AXIOM(!schema.IsValidRelocatesTargetPath(SdfPath("/A{x=y}"))); + TF_AXIOM(!schema.IsValidRelocatesTargetPath(SdfPath("/A{x=y}B"))); } static void @@ -525,6 +548,7 @@ main(int argc, char **argv) _TestSdfLayerDictKeyOps(); _TestSdfLayerTimeSampleValueType(); _TestSdfLayerTransferContents(); + _TestSdfLayerTransferContentsEmptyLayer(); _TestSdfRelationshipTargetSpecEdits(); _TestSdfPathFindLongestPrefix(); _TestSdfFpsAndTcps(); diff --git a/pxr/usd/sdf/testenv/testSdfLayer.py b/pxr/usd/sdf/testenv/testSdfLayer.py index 965ad144ef..af75b00a5e 100644 --- a/pxr/usd/sdf/testenv/testSdfLayer.py +++ b/pxr/usd/sdf/testenv/testSdfLayer.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. import os, platform, itertools, sys, unittest @@ -930,6 +913,37 @@ def test_OpenCloseThreadSafety(self): completed = sum(1 if f.result() else 0 for f in concurrent.futures.as_completed(futures)) self.assertEqual(completed, OPENS) + + def test_DefaultPrim(self): + layer = Sdf.Layer.CreateAnonymous() + + # Set defaultPrim + layer.defaultPrim = '/foo' + self.assertEqual(layer.GetDefaultPrimAsPath(), '/foo') + + # Set the defaultPrim by name, should return path + layer.defaultPrim = 'bar' + Sdf.CreatePrimInLayer(layer, '/bar') + self.assertEqual(layer.GetDefaultPrimAsPath(), '/bar') + + # Set sub-root prims as default, should return path + layer.defaultPrim = 'foo/bar' + Sdf.CreatePrimInLayer(layer, '/foo/bar') + self.assertEqual(layer.GetDefaultPrimAsPath(), '/foo/bar') + + # Set invalid prim path as default, should return empty path + layer.defaultPrim = 'foo.bar' + self.assertEqual(layer.GetDefaultPrimAsPath(), '') + # Set invalid path as default, should return empty path + layer.defaultPrim = '//' + self.assertEqual(layer.GetDefaultPrimAsPath(), '') + layer.defaultPrim = '' + self.assertEqual(layer.GetDefaultPrimAsPath(), '') + + # Try layer-level authoring API. + self.assertTrue(layer.HasDefaultPrim()) + layer.ClearDefaultPrim() + self.assertFalse(layer.HasDefaultPrim()) if __name__ == "__main__": unittest.main() diff --git a/pxr/usd/sdf/testenv/testSdfLayerHints.cpp b/pxr/usd/sdf/testenv/testSdfLayerHints.cpp index 694cfcd868..4fc5ebb5e0 100644 --- a/pxr/usd/sdf/testenv/testSdfLayerHints.cpp +++ b/pxr/usd/sdf/testenv/testSdfLayerHints.cpp @@ -1,25 +1,8 @@ // // Copyright 2020 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/sdf/testenv/testSdfLayerMuting.py b/pxr/usd/sdf/testenv/testSdfLayerMuting.py index 2c83f7ad16..bcd82132fd 100644 --- a/pxr/usd/sdf/testenv/testSdfLayerMuting.py +++ b/pxr/usd/sdf/testenv/testSdfLayerMuting.py @@ -2,25 +2,8 @@ # # Copyright 2018 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from pxr import Sdf import unittest diff --git a/pxr/usd/sdf/testenv/testSdfListOp.py b/pxr/usd/sdf/testenv/testSdfListOp.py index 2a44e5ca86..9cec8858ff 100644 --- a/pxr/usd/sdf/testenv/testSdfListOp.py +++ b/pxr/usd/sdf/testenv/testSdfListOp.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from pxr import Sdf import unittest, itertools diff --git a/pxr/usd/sdf/testenv/testSdfMetaDataPlugInfo.cpp b/pxr/usd/sdf/testenv/testSdfMetaDataPlugInfo.cpp index 52f7b83398..d371d1b677 100644 --- a/pxr/usd/sdf/testenv/testSdfMetaDataPlugInfo.cpp +++ b/pxr/usd/sdf/testenv/testSdfMetaDataPlugInfo.cpp @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/sdf/testenv/testSdfParsing.py b/pxr/usd/sdf/testenv/testSdfParsing.py index 42e7deb4c4..cdf573ea5f 100644 --- a/pxr/usd/sdf/testenv/testSdfParsing.py +++ b/pxr/usd/sdf/testenv/testSdfParsing.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # This tests a set of sample sdf files that are either expected to load # successfully, or to emit warnings. Files with _bad_ in the name are diff --git a/pxr/usd/sdf/testenv/testSdfParsing.testenv/139_relocates_metadata.sdf b/pxr/usd/sdf/testenv/testSdfParsing.testenv/139_relocates_metadata.sdf index 6dbd61f7c0..6a21c2b5e0 100644 --- a/pxr/usd/sdf/testenv/testSdfParsing.testenv/139_relocates_metadata.sdf +++ b/pxr/usd/sdf/testenv/testSdfParsing.testenv/139_relocates_metadata.sdf @@ -6,7 +6,8 @@ relocates = { : , : , - : + : , + : <> } ) @@ -16,7 +17,8 @@ def MfScope "TestPrim" ( relocates = { : , : , - : + : , + : <> } ) { diff --git a/pxr/usd/sdf/testenv/testSdfParsing.testenv/baseline/139_relocates_metadata.sdf b/pxr/usd/sdf/testenv/testSdfParsing.testenv/baseline/139_relocates_metadata.sdf index d42bec4a55..a69b0c3846 100644 --- a/pxr/usd/sdf/testenv/testSdfParsing.testenv/baseline/139_relocates_metadata.sdf +++ b/pxr/usd/sdf/testenv/testSdfParsing.testenv/baseline/139_relocates_metadata.sdf @@ -5,7 +5,8 @@ relocates = { : , : , - : + : , + : <> } ) @@ -13,7 +14,8 @@ def MfScope "TestPrim" ( relocates = { <../absolute>: , <../source>: <../target>, - : + : , + : <> } ) { diff --git a/pxr/usd/sdf/testenv/testSdfPath.py b/pxr/usd/sdf/testenv/testSdfPath.py index 9d1589e89a..ebcf6cdc52 100644 --- a/pxr/usd/sdf/testenv/testSdfPath.py +++ b/pxr/usd/sdf/testenv/testSdfPath.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from __future__ import print_function diff --git a/pxr/usd/sdf/testenv/testSdfPath2.py b/pxr/usd/sdf/testenv/testSdfPath2.py index 3964c6f286..bbbb16048b 100644 --- a/pxr/usd/sdf/testenv/testSdfPath2.py +++ b/pxr/usd/sdf/testenv/testSdfPath2.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. import sys, os, traceback, unittest from pxr import Sdf, Tf diff --git a/pxr/usd/sdf/testenv/testSdfPath2Construct.py b/pxr/usd/sdf/testenv/testSdfPath2Construct.py index 16077b7220..55913ed082 100644 --- a/pxr/usd/sdf/testenv/testSdfPath2Construct.py +++ b/pxr/usd/sdf/testenv/testSdfPath2Construct.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. import sys, os, traceback, unittest from pxr import Sdf diff --git a/pxr/usd/sdf/testenv/testSdfPathExpression.cpp b/pxr/usd/sdf/testenv/testSdfPathExpression.cpp index 35c44c1c09..0bd2714163 100644 --- a/pxr/usd/sdf/testenv/testSdfPathExpression.cpp +++ b/pxr/usd/sdf/testenv/testSdfPathExpression.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/base/tf/errorMark.h" @@ -27,6 +10,7 @@ #include "pxr/usd/sdf/path.h" #include "pxr/usd/sdf/pathExpression.h" #include "pxr/usd/sdf/pathExpressionEval.h" +#include "pxr/usd/sdf/pathPattern.h" #include "pxr/usd/sdf/predicateLibrary.h" PXR_NAMESPACE_USING_DIRECTIVE @@ -68,6 +52,16 @@ struct MatchEval { static void TestBasics() { + { + // Allow leading & trailing whitespace. + TF_AXIOM(SdfPathExpression(" /foo//bar").GetText() == "/foo//bar"); + TF_AXIOM(SdfPathExpression(" /foo//bar ").GetText() == "/foo//bar"); + TF_AXIOM(SdfPathExpression("/foo//bar ").GetText() == "/foo//bar"); + TF_AXIOM(SdfPathExpression(" /foo /bar").GetText() == "/foo /bar"); + TF_AXIOM(SdfPathExpression(" /foo /bar ").GetText() == "/foo /bar"); + TF_AXIOM(SdfPathExpression("/foo /bar ").GetText() == "/foo /bar"); + } + { auto eval = MatchEval { SdfPathExpression("/foo//bar") }; @@ -77,8 +71,19 @@ TestBasics() TF_AXIOM(!eval.Match(SdfPath("/foo/x/y/z/bar/baz"))); TF_AXIOM(!eval.Match(SdfPath("/foo/x/y/z/bar.baz"))); TF_AXIOM(!eval.Match(SdfPath("/foo/x/y/z/bar.baz:buz"))); + TF_AXIOM(!eval.Match(SdfPath("/foo.bar"))); + TF_AXIOM(!eval.Match(SdfPath("/foo/x/y/z.bar"))); } + { + auto eval = MatchEval { SdfPathExpression("/foo/bar/*") }; + + TF_AXIOM(!eval.Match(SdfPath("/foo/bar"))); + TF_AXIOM(eval.Match(SdfPath("/foo/bar/x"))); + TF_AXIOM(eval.Match(SdfPath("/foo/bar/y"))); + TF_AXIOM(!eval.Match(SdfPath("/foo/bar/x/y"))); + } + { auto eval = MatchEval { SdfPathExpression("//foo/bar/baz/qux/quux") }; @@ -447,6 +452,65 @@ TestSearch() } +static void +TestPathPattern() +{ + SdfPathPattern pat; + + TF_AXIOM(!pat); + TF_AXIOM(!pat.HasTrailingStretch()); + TF_AXIOM(pat.GetPrefix().IsEmpty()); + TF_AXIOM(pat.CanAppendChild({})); // Can append stretch. + TF_AXIOM(pat.AppendChild({})); + TF_AXIOM(pat == SdfPathPattern::EveryDescendant()); + TF_AXIOM(pat.HasTrailingStretch()); + TF_AXIOM(pat.GetPrefix() == SdfPath::ReflexiveRelativePath()); + TF_AXIOM(!pat.HasLeadingStretch()); + + // Set prefix to '/', should become Everything(). + pat.SetPrefix(SdfPath::AbsoluteRootPath()); + TF_AXIOM(pat == SdfPathPattern::Everything()); + TF_AXIOM(pat.HasLeadingStretch()); + TF_AXIOM(pat.HasTrailingStretch()); + + // Remove trailing stretch, should become just '/' + pat.RemoveTrailingStretch(); + TF_AXIOM(!pat.HasLeadingStretch()); + TF_AXIOM(!pat.HasTrailingStretch()); + TF_AXIOM(pat.GetPrefix() == SdfPath::AbsoluteRootPath()); + TF_AXIOM(pat.GetComponents().empty()); + + // Add some components. + pat.AppendChild("foo").AppendChild("bar").AppendChild("baz"); + // This should have modified the prefix path, rather than appending matching + // components. + TF_AXIOM(pat.GetPrefix() == SdfPath("/foo/bar/baz")); + + pat.AppendStretchIfPossible().AppendProperty("prop"); + + // Appending a property to a pattern with trailing stretch has to append a + // prim wildcard '*'. + TF_AXIOM(pat.IsProperty()); + TF_AXIOM(pat.GetComponents().size() == 3); + TF_AXIOM(pat.GetComponents()[0].text.empty()); + TF_AXIOM(pat.GetComponents()[1].text == "*"); + TF_AXIOM(pat.GetComponents()[2].text == "prop"); + + TF_AXIOM(pat.GetText() == "/foo/bar/baz//*.prop"); + + // Can't append children or properties to property patterns. + TF_AXIOM(!pat.CanAppendChild("foo")); + TF_AXIOM(!pat.CanAppendProperty("foo")); + + pat.RemoveTrailingComponent(); + TF_AXIOM(pat.GetText() == "/foo/bar/baz//*"); + pat.RemoveTrailingComponent(); + TF_AXIOM(pat.GetText() == "/foo/bar/baz//"); + pat.RemoveTrailingComponent(); + TF_AXIOM(pat.GetText() == "/foo/bar/baz"); + pat.RemoveTrailingComponent(); // No more trailing components, only prefix. + TF_AXIOM(pat.GetText() == "/foo/bar/baz"); +} static void TestErrors() @@ -482,6 +546,7 @@ main(int argc, char **argv) { TestBasics(); TestSearch(); + TestPathPattern(); TestErrors(); printf(">>> Test SUCCEEDED\n"); diff --git a/pxr/usd/sdf/testenv/testSdfPathExpression.py b/pxr/usd/sdf/testenv/testSdfPathExpression.py index fd70271516..2995e73936 100644 --- a/pxr/usd/sdf/testenv/testSdfPathExpression.py +++ b/pxr/usd/sdf/testenv/testSdfPathExpression.py @@ -2,25 +2,8 @@ # # Copyright 2024 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from pxr import Sdf, Tf import sys, unittest @@ -42,6 +25,34 @@ def test_Basics(self): self.assertEqual(pe, Sdf.PathExpression('')) self.assertFalse(pe) + # Leading & trailing whitespace. + self.assertEqual( + Sdf.PathExpression(" /foo//bar").GetText(), "/foo//bar") + self.assertEqual( + Sdf.PathExpression(" /foo//bar ").GetText(), "/foo//bar") + self.assertEqual( + Sdf.PathExpression("/foo//bar ").GetText(), "/foo//bar") + self.assertEqual( + Sdf.PathExpression(" /foo /bar").GetText(), "/foo /bar") + self.assertEqual( + Sdf.PathExpression(" /foo /bar ").GetText(), "/foo /bar") + self.assertEqual( + Sdf.PathExpression("/foo /bar ").GetText(), "/foo /bar") + + # Complement of complement should cancel. + self.assertEqual( + Sdf.PathExpression('~(~a)'), Sdf.PathExpression('a')) + self.assertEqual( + Sdf.PathExpression('~(~(~a))'), Sdf.PathExpression('~a')) + self.assertEqual( + Sdf.PathExpression('~(~(~(~a)))'), Sdf.PathExpression('a')) + self.assertEqual( + Sdf.PathExpression('// - a'), Sdf.PathExpression('~a')) + self.assertEqual( + Sdf.PathExpression('~(// - a)'), Sdf.PathExpression('a')) + self.assertEqual( + Sdf.PathExpression('~(// - ~a)'), Sdf.PathExpression('~a')) + def test_Matching(self): evl = MatchEval('/foo/bar/*') @@ -307,5 +318,56 @@ def test_SceneDescription(self): # Should have been made absolute: self.assertEqual(attr.default, Sdf.PathExpression("/prim/child")) + def test_PathPattern(self): + self.assertIs(Sdf.PathPattern, Sdf.PathExpression.PathPattern) + + pat = Sdf.PathPattern() + self.assertFalse(pat) + self.assertFalse(pat.HasTrailingStretch()) + self.assertTrue(pat.GetPrefix().isEmpty) + self.assertTrue(pat.CanAppendChild('')) + self.assertTrue(pat.AppendChild('')) + self.assertEqual(pat, Sdf.PathPattern.EveryDescendant()) + self.assertTrue(pat.HasTrailingStretch()) + self.assertEqual(pat.GetPrefix(), Sdf.Path.reflexiveRelativePath) + self.assertFalse(pat.HasLeadingStretch()) + + # Set prefix to '/', should become Everything(). + pat.SetPrefix(Sdf.Path.absoluteRootPath) + self.assertEqual(pat, Sdf.PathPattern.Everything()) + self.assertTrue(pat.HasLeadingStretch()) + self.assertTrue(pat.HasTrailingStretch()) + + # Remove trailing stretch, should become just '/' + pat.RemoveTrailingStretch() + self.assertFalse(pat.HasLeadingStretch()) + self.assertFalse(pat.HasTrailingStretch()) + self.assertEqual(pat.GetPrefix(), Sdf.Path.absoluteRootPath) + + # Add some components. + pat.AppendChild("foo").AppendChild("bar").AppendChild("baz") + # This should have modified the prefix path, rather than appending + # matching components. + self.assertEqual(pat.GetPrefix(), Sdf.Path("/foo/bar/baz")) + + # Appending a property to a pattern with trailing stretch has to append + # a prim wildcard '*'. + pat.AppendStretchIfPossible().AppendProperty("prop") + self.assertTrue(pat.IsProperty()) + self.assertEqual(pat.GetText(), "/foo/bar/baz//*.prop") + + # Can't append children or properties to property patterns. + self.assertFalse(pat.CanAppendChild("foo")) + self.assertFalse(pat.CanAppendProperty("foo")) + + pat.RemoveTrailingComponent() + self.assertEqual(pat.GetText(), "/foo/bar/baz//*") + pat.RemoveTrailingComponent() + self.assertEqual(pat.GetText(), "/foo/bar/baz//") + pat.RemoveTrailingComponent() + self.assertEqual(pat.GetText(), "/foo/bar/baz") + pat.RemoveTrailingComponent() # No more components, only prefix. + self.assertEqual(pat.GetText(), "/foo/bar/baz") + if __name__ == '__main__': unittest.main() diff --git a/pxr/usd/sdf/testenv/testSdfPathParser.cpp b/pxr/usd/sdf/testenv/testSdfPathParser.cpp index 30abbf7e8f..3b9a9f3f8d 100644 --- a/pxr/usd/sdf/testenv/testSdfPathParser.cpp +++ b/pxr/usd/sdf/testenv/testSdfPathParser.cpp @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include #include diff --git a/pxr/usd/sdf/testenv/testSdfPathTable.cpp b/pxr/usd/sdf/testenv/testSdfPathTable.cpp index 32c380ad90..8b06cb8b06 100644 --- a/pxr/usd/sdf/testenv/testSdfPathTable.cpp +++ b/pxr/usd/sdf/testenv/testSdfPathTable.cpp @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/sdf/pathTable.h" diff --git a/pxr/usd/sdf/testenv/testSdfPathThreading.cpp b/pxr/usd/sdf/testenv/testSdfPathThreading.cpp index 143ff40edc..9f1d9209fe 100644 --- a/pxr/usd/sdf/testenv/testSdfPathThreading.cpp +++ b/pxr/usd/sdf/testenv/testSdfPathThreading.cpp @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/sdf/path.h" diff --git a/pxr/usd/sdf/testenv/testSdfPayload.py b/pxr/usd/sdf/testenv/testSdfPayload.py index a1a61a17dd..2fc0ecbabe 100644 --- a/pxr/usd/sdf/testenv/testSdfPayload.py +++ b/pxr/usd/sdf/testenv/testSdfPayload.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # pylint: disable=zip-builtin-not-iterating diff --git a/pxr/usd/sdf/testenv/testSdfPredicateExpression.cpp b/pxr/usd/sdf/testenv/testSdfPredicateExpression.cpp index 5dbe9b7c99..46205c9149 100644 --- a/pxr/usd/sdf/testenv/testSdfPredicateExpression.cpp +++ b/pxr/usd/sdf/testenv/testSdfPredicateExpression.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/base/arch/regex.h" diff --git a/pxr/usd/sdf/testenv/testSdfPrim.py b/pxr/usd/sdf/testenv/testSdfPrim.py index 4082a07252..d071be5eae 100644 --- a/pxr/usd/sdf/testenv/testSdfPrim.py +++ b/pxr/usd/sdf/testenv/testSdfPrim.py @@ -2,25 +2,8 @@ # # Copyright 2019 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from __future__ import print_function diff --git a/pxr/usd/sdf/testenv/testSdfReference.py b/pxr/usd/sdf/testenv/testSdfReference.py index 1526f9d631..65ae870bc7 100644 --- a/pxr/usd/sdf/testenv/testSdfReference.py +++ b/pxr/usd/sdf/testenv/testSdfReference.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from __future__ import print_function diff --git a/pxr/usd/sdf/testenv/testSdfRelocates.py b/pxr/usd/sdf/testenv/testSdfRelocates.py index 02642d771f..9386680a88 100644 --- a/pxr/usd/sdf/testenv/testSdfRelocates.py +++ b/pxr/usd/sdf/testenv/testSdfRelocates.py @@ -2,25 +2,8 @@ # # Copyright 2024 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from pxr import Sdf import unittest @@ -137,12 +120,14 @@ def test_LayerRelocates(self): layer.relocates = [ ("/Root/source2", "/Root/target2"), ("/Root/source1", "/Root/target1"), - ("/Root/source3", "/Root/target3")] + ("/Root/source3", "/Root/target3"), + ("/Root/sourceToDelete", Sdf.Path())] self.assertTrue(layer.HasRelocates()) self.assertEqual(layer.relocates, [("/Root/source2", "/Root/target2"), ("/Root/source1", "/Root/target1"), - ("/Root/source3", "/Root/target3")]) + ("/Root/source3", "/Root/target3"), + ("/Root/sourceToDelete", Sdf.Path())]) # Write layer; relocates are written as layer metadata when the layer # is written. @@ -151,7 +136,8 @@ def test_LayerRelocates(self): relocates = { : , : , - : + : , + : <> } ) @@ -169,7 +155,8 @@ def Scope "Root" self.assertFalse(("/Root/source2", "/Root/target2") in layer.relocates) self.assertEqual(layer.relocates, [(Sdf.Path('/Root/source1'), Sdf.Path('/Root/target1')), - (Sdf.Path('/Root/source3'), Sdf.Path('/Root/target3'))]) + (Sdf.Path('/Root/source3'), Sdf.Path('/Root/target3')), + (Sdf.Path('/Root/sourceToDelete'), Sdf.Path())]) # Add a single new relocate newRelocates = layer.relocates @@ -180,6 +167,7 @@ def Scope "Root" self.assertEqual(layer.relocates, [(Sdf.Path('/Root/source1'), Sdf.Path('/Root/target1')), (Sdf.Path('/Root/source3'), Sdf.Path('/Root/target3')), + (Sdf.Path('/Root/sourceToDelete'), Sdf.Path()), (Sdf.Path('/Root/source4'), Sdf.Path('/Root/target4'))]) # Overwrite an existing relocate @@ -192,6 +180,7 @@ def Scope "Root" self.assertEqual(layer.relocates, [(Sdf.Path('/Root/source1'), Sdf.Path('/Root/targetFoo')), (Sdf.Path('/Root/source3'), Sdf.Path('/Root/target3')), + (Sdf.Path('/Root/sourceToDelete'), Sdf.Path()), (Sdf.Path('/Root/source4'), Sdf.Path('/Root/target4'))]) # Clear all relocates diff --git a/pxr/usd/sdf/testenv/testSdfSpecHash.py b/pxr/usd/sdf/testenv/testSdfSpecHash.py index 56a4a2e332..e6a09c2824 100644 --- a/pxr/usd/sdf/testenv/testSdfSpecHash.py +++ b/pxr/usd/sdf/testenv/testSdfSpecHash.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. import sys, unittest from pxr import Sdf diff --git a/pxr/usd/sdf/testenv/testSdfTimeCode.py b/pxr/usd/sdf/testenv/testSdfTimeCode.py index 128034e69f..43991a0f8f 100644 --- a/pxr/usd/sdf/testenv/testSdfTimeCode.py +++ b/pxr/usd/sdf/testenv/testSdfTimeCode.py @@ -2,25 +2,8 @@ # # Copyright 2019 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from __future__ import division from pxr import Sdf, Tf diff --git a/pxr/usd/sdf/testenv/testSdfTimeSamples.py b/pxr/usd/sdf/testenv/testSdfTimeSamples.py index 3903a647bc..409b714283 100644 --- a/pxr/usd/sdf/testenv/testSdfTimeSamples.py +++ b/pxr/usd/sdf/testenv/testSdfTimeSamples.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. import unittest from pxr import Sdf diff --git a/pxr/usd/sdf/testenv/testSdfTypes.py b/pxr/usd/sdf/testenv/testSdfTypes.py index 6ef801861b..69949df359 100644 --- a/pxr/usd/sdf/testenv/testSdfTypes.py +++ b/pxr/usd/sdf/testenv/testSdfTypes.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from pxr import Sdf, Vt, Gf, Tf import unittest diff --git a/pxr/usd/sdf/testenv/testSdfVariableExpression.py b/pxr/usd/sdf/testenv/testSdfVariableExpression.py index 722da1476b..d4e66233b4 100644 --- a/pxr/usd/sdf/testenv/testSdfVariableExpression.py +++ b/pxr/usd/sdf/testenv/testSdfVariableExpression.py @@ -2,25 +2,8 @@ # # Copyright 2023 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from pxr import Sdf, Vt import unittest diff --git a/pxr/usd/sdf/testenv/testSdfVariants.py b/pxr/usd/sdf/testenv/testSdfVariants.py index a15973fb72..b5efae2649 100644 --- a/pxr/usd/sdf/testenv/testSdfVariants.py +++ b/pxr/usd/sdf/testenv/testSdfVariants.py @@ -2,25 +2,8 @@ # # Copyright 2023 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. import unittest from pxr import Sdf, Tf diff --git a/pxr/usd/sdf/textFileFormat.cpp b/pxr/usd/sdf/textFileFormat.cpp index e503001c4e..5fa14ed7f9 100644 --- a/pxr/usd/sdf/textFileFormat.cpp +++ b/pxr/usd/sdf/textFileFormat.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // /// /// \file Sdf/textFileFormat.cpp diff --git a/pxr/usd/sdf/textFileFormat.h b/pxr/usd/sdf/textFileFormat.h index bf99d9e658..ad5d29f5bd 100644 --- a/pxr/usd/sdf/textFileFormat.h +++ b/pxr/usd/sdf/textFileFormat.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDF_TEXT_FILE_FORMAT_H #define PXR_USD_SDF_TEXT_FILE_FORMAT_H diff --git a/pxr/usd/sdf/textFileFormat.lex.cpp b/pxr/usd/sdf/textFileFormat.lex.cpp index 7e7234d21c..1fe2842525 100644 --- a/pxr/usd/sdf/textFileFormat.lex.cpp +++ b/pxr/usd/sdf/textFileFormat.lex.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #line 2 "pxr/usd/sdf/textFileFormat.lex.cpp" @@ -4802,25 +4785,8 @@ static yyconst flex_int32_t yy_ec[256] = // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" @@ -4867,7 +4833,7 @@ PXR_NAMESPACE_USING_DIRECTIVE */ /* States */ -#line 4848 "pxr/usd/sdf/textFileFormat.lex.cpp" +#line 4831 "pxr/usd/sdf/textFileFormat.lex.cpp" #define INITIAL 0 #define SLASHTERIX_COMMENT 1 @@ -5132,13 +5098,13 @@ YY_DECL } { -#line 98 "pxr/usd/sdf/textFileFormat.ll" +#line 81 "pxr/usd/sdf/textFileFormat.ll" /* skip over whitespace and comments */ /* handle the first line # comment specially, since it contains the magic token */ -#line 5119 "pxr/usd/sdf/textFileFormat.lex.cpp" +#line 5102 "pxr/usd/sdf/textFileFormat.lex.cpp" while ( 1 ) /* loops until end-of-file is reached */ { @@ -5185,12 +5151,12 @@ YY_DECL case 1: YY_RULE_SETUP -#line 103 "pxr/usd/sdf/textFileFormat.ll" +#line 86 "pxr/usd/sdf/textFileFormat.ll" {} YY_BREAK case 2: YY_RULE_SETUP -#line 104 "pxr/usd/sdf/textFileFormat.ll" +#line 87 "pxr/usd/sdf/textFileFormat.ll" { if (yyextra->sdfLineNo == 1) { (*yylval_param) = std::string(yytext, yyleng); @@ -5200,23 +5166,23 @@ YY_RULE_SETUP YY_BREAK case 3: YY_RULE_SETUP -#line 110 "pxr/usd/sdf/textFileFormat.ll" +#line 93 "pxr/usd/sdf/textFileFormat.ll" {} YY_BREAK case 4: YY_RULE_SETUP -#line 111 "pxr/usd/sdf/textFileFormat.ll" +#line 94 "pxr/usd/sdf/textFileFormat.ll" BEGIN SLASHTERIX_COMMENT ; YY_BREAK case 5: /* rule 5 can match eol */ YY_RULE_SETUP -#line 112 "pxr/usd/sdf/textFileFormat.ll" +#line 95 "pxr/usd/sdf/textFileFormat.ll" ; YY_BREAK case 6: YY_RULE_SETUP -#line 113 "pxr/usd/sdf/textFileFormat.ll" +#line 96 "pxr/usd/sdf/textFileFormat.ll" BEGIN INITIAL ; YY_BREAK /* newline is returned as TOK_NL @@ -5226,7 +5192,7 @@ BEGIN INITIAL ; case 7: /* rule 7 can match eol */ YY_RULE_SETUP -#line 119 "pxr/usd/sdf/textFileFormat.ll" +#line 102 "pxr/usd/sdf/textFileFormat.ll" { yyextra->sdfLineNo++; return TOK_NL; @@ -5236,213 +5202,213 @@ YY_RULE_SETUP can make use of it. */ case 8: YY_RULE_SETUP -#line 126 "pxr/usd/sdf/textFileFormat.ll" +#line 109 "pxr/usd/sdf/textFileFormat.ll" { (*yylval_param) = std::string(yytext, yyleng); return TOK_ADD; } YY_BREAK case 9: YY_RULE_SETUP -#line 127 "pxr/usd/sdf/textFileFormat.ll" +#line 110 "pxr/usd/sdf/textFileFormat.ll" { (*yylval_param) = std::string(yytext, yyleng); return TOK_APPEND; } YY_BREAK case 10: YY_RULE_SETUP -#line 128 "pxr/usd/sdf/textFileFormat.ll" +#line 111 "pxr/usd/sdf/textFileFormat.ll" { (*yylval_param) = std::string(yytext, yyleng); return TOK_CLASS; } YY_BREAK case 11: YY_RULE_SETUP -#line 129 "pxr/usd/sdf/textFileFormat.ll" +#line 112 "pxr/usd/sdf/textFileFormat.ll" { (*yylval_param) = std::string(yytext, yyleng); return TOK_CONFIG; } YY_BREAK case 12: YY_RULE_SETUP -#line 130 "pxr/usd/sdf/textFileFormat.ll" +#line 113 "pxr/usd/sdf/textFileFormat.ll" { (*yylval_param) = std::string(yytext, yyleng); return TOK_CONNECT; } YY_BREAK case 13: YY_RULE_SETUP -#line 131 "pxr/usd/sdf/textFileFormat.ll" +#line 114 "pxr/usd/sdf/textFileFormat.ll" { (*yylval_param) = std::string(yytext, yyleng); return TOK_CUSTOM; } YY_BREAK case 14: YY_RULE_SETUP -#line 132 "pxr/usd/sdf/textFileFormat.ll" +#line 115 "pxr/usd/sdf/textFileFormat.ll" { (*yylval_param) = std::string(yytext, yyleng); return TOK_CUSTOMDATA; } YY_BREAK case 15: YY_RULE_SETUP -#line 133 "pxr/usd/sdf/textFileFormat.ll" +#line 116 "pxr/usd/sdf/textFileFormat.ll" { (*yylval_param) = std::string(yytext, yyleng); return TOK_DEFAULT; } YY_BREAK case 16: YY_RULE_SETUP -#line 134 "pxr/usd/sdf/textFileFormat.ll" +#line 117 "pxr/usd/sdf/textFileFormat.ll" { (*yylval_param) = std::string(yytext, yyleng); return TOK_DEF; } YY_BREAK case 17: YY_RULE_SETUP -#line 135 "pxr/usd/sdf/textFileFormat.ll" +#line 118 "pxr/usd/sdf/textFileFormat.ll" { (*yylval_param) = std::string(yytext, yyleng); return TOK_DELETE; } YY_BREAK case 18: YY_RULE_SETUP -#line 136 "pxr/usd/sdf/textFileFormat.ll" +#line 119 "pxr/usd/sdf/textFileFormat.ll" { (*yylval_param) = std::string(yytext, yyleng); return TOK_DICTIONARY; } YY_BREAK case 19: YY_RULE_SETUP -#line 137 "pxr/usd/sdf/textFileFormat.ll" +#line 120 "pxr/usd/sdf/textFileFormat.ll" { (*yylval_param) = std::string(yytext, yyleng); return TOK_DISPLAYUNIT; } YY_BREAK case 20: YY_RULE_SETUP -#line 138 "pxr/usd/sdf/textFileFormat.ll" +#line 121 "pxr/usd/sdf/textFileFormat.ll" { (*yylval_param) = std::string(yytext, yyleng); return TOK_DOC; } YY_BREAK case 21: YY_RULE_SETUP -#line 139 "pxr/usd/sdf/textFileFormat.ll" +#line 122 "pxr/usd/sdf/textFileFormat.ll" { (*yylval_param) = std::string(yytext, yyleng); return TOK_INHERITS; } YY_BREAK case 22: YY_RULE_SETUP -#line 140 "pxr/usd/sdf/textFileFormat.ll" +#line 123 "pxr/usd/sdf/textFileFormat.ll" { (*yylval_param) = std::string(yytext, yyleng); return TOK_KIND; } YY_BREAK case 23: YY_RULE_SETUP -#line 141 "pxr/usd/sdf/textFileFormat.ll" +#line 124 "pxr/usd/sdf/textFileFormat.ll" { (*yylval_param) = std::string(yytext, yyleng); return TOK_NAMECHILDREN; } YY_BREAK case 24: YY_RULE_SETUP -#line 142 "pxr/usd/sdf/textFileFormat.ll" +#line 125 "pxr/usd/sdf/textFileFormat.ll" { (*yylval_param) = std::string(yytext, yyleng); return TOK_NONE; } YY_BREAK case 25: YY_RULE_SETUP -#line 143 "pxr/usd/sdf/textFileFormat.ll" +#line 126 "pxr/usd/sdf/textFileFormat.ll" { (*yylval_param) = std::string(yytext, yyleng); return TOK_OFFSET; } YY_BREAK case 26: YY_RULE_SETUP -#line 144 "pxr/usd/sdf/textFileFormat.ll" +#line 127 "pxr/usd/sdf/textFileFormat.ll" { (*yylval_param) = std::string(yytext, yyleng); return TOK_OVER; } YY_BREAK case 27: YY_RULE_SETUP -#line 145 "pxr/usd/sdf/textFileFormat.ll" +#line 128 "pxr/usd/sdf/textFileFormat.ll" { (*yylval_param) = std::string(yytext, yyleng); return TOK_PAYLOAD; } YY_BREAK case 28: YY_RULE_SETUP -#line 146 "pxr/usd/sdf/textFileFormat.ll" +#line 129 "pxr/usd/sdf/textFileFormat.ll" { (*yylval_param) = std::string(yytext, yyleng); return TOK_PERMISSION; } YY_BREAK case 29: YY_RULE_SETUP -#line 147 "pxr/usd/sdf/textFileFormat.ll" +#line 130 "pxr/usd/sdf/textFileFormat.ll" { (*yylval_param) = std::string(yytext, yyleng); return TOK_PREFIX_SUBSTITUTIONS; } YY_BREAK case 30: YY_RULE_SETUP -#line 148 "pxr/usd/sdf/textFileFormat.ll" +#line 131 "pxr/usd/sdf/textFileFormat.ll" { (*yylval_param) = std::string(yytext, yyleng); return TOK_PREPEND; } YY_BREAK case 31: YY_RULE_SETUP -#line 149 "pxr/usd/sdf/textFileFormat.ll" +#line 132 "pxr/usd/sdf/textFileFormat.ll" { (*yylval_param) = std::string(yytext, yyleng); return TOK_PROPERTIES; } YY_BREAK case 32: YY_RULE_SETUP -#line 150 "pxr/usd/sdf/textFileFormat.ll" +#line 133 "pxr/usd/sdf/textFileFormat.ll" { (*yylval_param) = std::string(yytext, yyleng); return TOK_REFERENCES; } YY_BREAK case 33: YY_RULE_SETUP -#line 151 "pxr/usd/sdf/textFileFormat.ll" +#line 134 "pxr/usd/sdf/textFileFormat.ll" { (*yylval_param) = std::string(yytext, yyleng); return TOK_RELOCATES; } YY_BREAK case 34: YY_RULE_SETUP -#line 152 "pxr/usd/sdf/textFileFormat.ll" +#line 135 "pxr/usd/sdf/textFileFormat.ll" { (*yylval_param) = std::string(yytext, yyleng); return TOK_REL; } YY_BREAK case 35: YY_RULE_SETUP -#line 153 "pxr/usd/sdf/textFileFormat.ll" +#line 136 "pxr/usd/sdf/textFileFormat.ll" { (*yylval_param) = std::string(yytext, yyleng); return TOK_REORDER; } YY_BREAK case 36: YY_RULE_SETUP -#line 154 "pxr/usd/sdf/textFileFormat.ll" +#line 137 "pxr/usd/sdf/textFileFormat.ll" { (*yylval_param) = std::string(yytext, yyleng); return TOK_ROOTPRIMS; } YY_BREAK case 37: YY_RULE_SETUP -#line 155 "pxr/usd/sdf/textFileFormat.ll" +#line 138 "pxr/usd/sdf/textFileFormat.ll" { (*yylval_param) = std::string(yytext, yyleng); return TOK_SCALE; } YY_BREAK case 38: YY_RULE_SETUP -#line 156 "pxr/usd/sdf/textFileFormat.ll" +#line 139 "pxr/usd/sdf/textFileFormat.ll" { (*yylval_param) = std::string(yytext, yyleng); return TOK_SUBLAYERS; } YY_BREAK case 39: YY_RULE_SETUP -#line 157 "pxr/usd/sdf/textFileFormat.ll" +#line 140 "pxr/usd/sdf/textFileFormat.ll" { (*yylval_param) = std::string(yytext, yyleng); return TOK_SUFFIX_SUBSTITUTIONS; } YY_BREAK case 40: YY_RULE_SETUP -#line 158 "pxr/usd/sdf/textFileFormat.ll" +#line 141 "pxr/usd/sdf/textFileFormat.ll" { (*yylval_param) = std::string(yytext, yyleng); return TOK_SPECIALIZES; } YY_BREAK case 41: YY_RULE_SETUP -#line 159 "pxr/usd/sdf/textFileFormat.ll" +#line 142 "pxr/usd/sdf/textFileFormat.ll" { (*yylval_param) = std::string(yytext, yyleng); return TOK_SYMMETRYARGUMENTS; } YY_BREAK case 42: YY_RULE_SETUP -#line 160 "pxr/usd/sdf/textFileFormat.ll" +#line 143 "pxr/usd/sdf/textFileFormat.ll" { (*yylval_param) = std::string(yytext, yyleng); return TOK_SYMMETRYFUNCTION; } YY_BREAK case 43: YY_RULE_SETUP -#line 161 "pxr/usd/sdf/textFileFormat.ll" +#line 144 "pxr/usd/sdf/textFileFormat.ll" { (*yylval_param) = std::string(yytext, yyleng); return TOK_TIME_SAMPLES; } YY_BREAK case 44: YY_RULE_SETUP -#line 162 "pxr/usd/sdf/textFileFormat.ll" +#line 145 "pxr/usd/sdf/textFileFormat.ll" { (*yylval_param) = std::string(yytext, yyleng); return TOK_UNIFORM; } YY_BREAK case 45: YY_RULE_SETUP -#line 163 "pxr/usd/sdf/textFileFormat.ll" +#line 146 "pxr/usd/sdf/textFileFormat.ll" { (*yylval_param) = std::string(yytext, yyleng); return TOK_VARIANTSET; } YY_BREAK case 46: YY_RULE_SETUP -#line 164 "pxr/usd/sdf/textFileFormat.ll" +#line 147 "pxr/usd/sdf/textFileFormat.ll" { (*yylval_param) = std::string(yytext, yyleng); return TOK_VARIANTSETS; } YY_BREAK case 47: YY_RULE_SETUP -#line 165 "pxr/usd/sdf/textFileFormat.ll" +#line 148 "pxr/usd/sdf/textFileFormat.ll" { (*yylval_param) = std::string(yytext, yyleng); return TOK_VARIANTS; } YY_BREAK case 48: YY_RULE_SETUP -#line 166 "pxr/usd/sdf/textFileFormat.ll" +#line 149 "pxr/usd/sdf/textFileFormat.ll" { (*yylval_param) = std::string(yytext, yyleng); return TOK_VARYING; } YY_BREAK /* unquoted C++ namespaced identifier -- see bug 10775 */ case 49: YY_RULE_SETUP -#line 169 "pxr/usd/sdf/textFileFormat.ll" +#line 152 "pxr/usd/sdf/textFileFormat.ll" { (*yylval_param) = std::string(yytext, yyleng); return TOK_CXX_NAMESPACED_IDENTIFIER; @@ -5466,7 +5432,7 @@ YY_RULE_SETUP */ case 50: YY_RULE_SETUP -#line 190 "pxr/usd/sdf/textFileFormat.ll" +#line 173 "pxr/usd/sdf/textFileFormat.ll" { std::string matched = std::string(yytext, yyleng); @@ -5487,7 +5453,7 @@ YY_RULE_SETUP */ case 51: YY_RULE_SETUP -#line 208 "pxr/usd/sdf/textFileFormat.ll" +#line 191 "pxr/usd/sdf/textFileFormat.ll" { std::string matched = std::string(yytext, yyleng); @@ -5504,7 +5470,7 @@ YY_RULE_SETUP /* scene paths */ case 52: YY_RULE_SETUP -#line 222 "pxr/usd/sdf/textFileFormat.ll" +#line 205 "pxr/usd/sdf/textFileFormat.ll" { (*yylval_param) = Sdf_EvalQuotedString(yytext, yyleng, 1); return TOK_PATHREF; @@ -5513,7 +5479,7 @@ YY_RULE_SETUP /* Single '@'-delimited asset references */ case 53: YY_RULE_SETUP -#line 228 "pxr/usd/sdf/textFileFormat.ll" +#line 211 "pxr/usd/sdf/textFileFormat.ll" { TfErrorMark m; (*yylval_param) = @@ -5524,7 +5490,7 @@ YY_RULE_SETUP /* Triple '@'-delimited asset references. */ case 54: YY_RULE_SETUP -#line 236 "pxr/usd/sdf/textFileFormat.ll" +#line 219 "pxr/usd/sdf/textFileFormat.ll" { TfErrorMark m; (*yylval_param) = @@ -5537,10 +5503,10 @@ YY_RULE_SETUP them from the beginning of triply-quoted strings. Ex: "Foo \"foo\"" */ case 55: -#line 248 "pxr/usd/sdf/textFileFormat.ll" +#line 231 "pxr/usd/sdf/textFileFormat.ll" case 56: YY_RULE_SETUP -#line 248 "pxr/usd/sdf/textFileFormat.ll" +#line 231 "pxr/usd/sdf/textFileFormat.ll" { /* " //<- unfreak out coloring code */ (*yylval_param) = Sdf_EvalQuotedString(yytext, yyleng, 1); return TOK_STRING; @@ -5555,7 +5521,7 @@ YY_LINENO_REWIND_TO(yy_bp + 2); yyg->yy_c_buf_p = yy_cp = yy_bp + 2; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 255 "pxr/usd/sdf/textFileFormat.ll" +#line 238 "pxr/usd/sdf/textFileFormat.ll" { /* ' // <- keep syntax coloring from freaking out */ (*yylval_param) = std::string(); return TOK_STRING; @@ -5568,7 +5534,7 @@ YY_LINENO_REWIND_TO(yy_bp + 2); yyg->yy_c_buf_p = yy_cp = yy_bp + 2; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 259 "pxr/usd/sdf/textFileFormat.ll" +#line 242 "pxr/usd/sdf/textFileFormat.ll" { (*yylval_param) = std::string(); return TOK_STRING; @@ -5578,11 +5544,11 @@ YY_RULE_SETUP Ex: """A\n\"B\"\nC""" */ case 59: /* rule 59 can match eol */ -#line 267 "pxr/usd/sdf/textFileFormat.ll" +#line 250 "pxr/usd/sdf/textFileFormat.ll" case 60: /* rule 60 can match eol */ YY_RULE_SETUP -#line 267 "pxr/usd/sdf/textFileFormat.ll" +#line 250 "pxr/usd/sdf/textFileFormat.ll" { /* " //<- unfreak out coloring code */ unsigned int numlines = 0; @@ -5596,7 +5562,7 @@ YY_RULE_SETUP * don't know at this point what the final stored type will be. */ case 61: YY_RULE_SETUP -#line 278 "pxr/usd/sdf/textFileFormat.ll" +#line 261 "pxr/usd/sdf/textFileFormat.ll" { (*yylval_param) = double(-0.0); return TOK_NUMBER; @@ -5605,7 +5571,7 @@ YY_RULE_SETUP /* Positive integers: store as uint64_t if in range, otherwise double. */ case 62: YY_RULE_SETUP -#line 284 "pxr/usd/sdf/textFileFormat.ll" +#line 267 "pxr/usd/sdf/textFileFormat.ll" { bool outOfRange = false; (*yylval_param) = TfStringToUInt64(yytext, &outOfRange); @@ -5624,7 +5590,7 @@ YY_RULE_SETUP /* Negative integers: store as long. */ case 63: YY_RULE_SETUP -#line 300 "pxr/usd/sdf/textFileFormat.ll" +#line 283 "pxr/usd/sdf/textFileFormat.ll" { bool outOfRange = false; (*yylval_param) = TfStringToInt64(yytext, &outOfRange); @@ -5642,10 +5608,10 @@ YY_RULE_SETUP YY_BREAK /* Numbers with decimal places or exponents: store as double. */ case 64: -#line 317 "pxr/usd/sdf/textFileFormat.ll" +#line 300 "pxr/usd/sdf/textFileFormat.ll" case 65: YY_RULE_SETUP -#line 317 "pxr/usd/sdf/textFileFormat.ll" +#line 300 "pxr/usd/sdf/textFileFormat.ll" { (*yylval_param) = TfStringToDouble(yytext); return TOK_NUMBER; @@ -5657,7 +5623,7 @@ YY_RULE_SETUP * identifiers. */ case 66: YY_RULE_SETUP -#line 326 "pxr/usd/sdf/textFileFormat.ll" +#line 309 "pxr/usd/sdf/textFileFormat.ll" { (*yylval_param) = -std::numeric_limits::infinity(); return TOK_NUMBER; @@ -5668,7 +5634,7 @@ YY_RULE_SETUP */ case 67: YY_RULE_SETUP -#line 334 "pxr/usd/sdf/textFileFormat.ll" +#line 317 "pxr/usd/sdf/textFileFormat.ll" { return yytext[0]; } @@ -5679,17 +5645,17 @@ YY_RULE_SETUP */ case 68: YY_RULE_SETUP -#line 342 "pxr/usd/sdf/textFileFormat.ll" +#line 325 "pxr/usd/sdf/textFileFormat.ll" { return TOK_SYNTAX_ERROR; } YY_BREAK case 69: YY_RULE_SETUP -#line 346 "pxr/usd/sdf/textFileFormat.ll" +#line 329 "pxr/usd/sdf/textFileFormat.ll" ECHO; YY_BREAK -#line 5670 "pxr/usd/sdf/textFileFormat.lex.cpp" +#line 5653 "pxr/usd/sdf/textFileFormat.lex.cpp" case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(SLASHTERIX_COMMENT): yyterminate(); @@ -6807,7 +6773,7 @@ void textFileFormatYyfree (void * ptr , yyscan_t yyscanner) #define YYTABLES_NAME "yytables" -#line 346 "pxr/usd/sdf/textFileFormat.ll" +#line 329 "pxr/usd/sdf/textFileFormat.ll" diff --git a/pxr/usd/sdf/textFileFormat.ll b/pxr/usd/sdf/textFileFormat.ll index fa032f101b..c84d583718 100644 --- a/pxr/usd/sdf/textFileFormat.ll +++ b/pxr/usd/sdf/textFileFormat.ll @@ -2,25 +2,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/sdf/textFileFormat.tab.cpp b/pxr/usd/sdf/textFileFormat.tab.cpp index 29879c74ec..31aa154d76 100644 --- a/pxr/usd/sdf/textFileFormat.tab.cpp +++ b/pxr/usd/sdf/textFileFormat.tab.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // /* A Bison parser, made by GNU Bison 2.4.1. */ @@ -99,7 +82,7 @@ /* Copy the first part of user declarations. */ /* Line 189 of yacc.c */ -#line 25 "pxr/usd/sdf/textFileFormat.yy" +#line 8 "pxr/usd/sdf/textFileFormat.yy" #include "pxr/pxr.h" @@ -131,9 +114,6 @@ #include "pxr/base/gf/matrix4d.h" #include "pxr/base/tf/mallocTag.h" -#include -#include - #include #include #include @@ -146,7 +126,6 @@ PXR_NAMESPACE_USING_DIRECTIVE using Sdf_ParserHelpers::Value; -using boost::get; //-------------------------------------------------------------------- // Helper macros/functions for handling errors @@ -671,32 +650,40 @@ _RelocatesAdd(const Value& arg1, const Value& arg2, Sdf_TextParserContext *context) { const std::string& srcStr = arg1.Get(); - const std::string& targetStr = arg2.Get(); - SdfPath srcPath(srcStr); - SdfPath targetPath(targetStr); - if (!SdfSchema::IsValidRelocatesPath(srcPath)) { + if (!SdfSchema::IsValidRelocatesSourcePath(srcPath)) { Err(context, "'%s' is not a valid relocates path", srcStr.c_str()); return; } - if (!SdfSchema::IsValidRelocatesPath(targetPath)) { - Err(context, "'%s' is not a valid relocates path", - targetStr.c_str()); - return; - } - // The relocates map is expected to only hold absolute paths. The - // SdRelocatesMapProxy ensures that all paths are made absolute when - // editing, but since we're bypassing that proxy and setting the map - // directly into the underlying SdfData, we need to explicitly absolutize - // paths here. + // The relocates map is expected to only hold absolute paths. srcPath = srcPath.MakeAbsolutePath(context->path); - targetPath = targetPath.MakeAbsolutePath(context->path); - context->relocatesParsing.emplace_back( - std::move(srcPath), std::move(targetPath)); + const std::string& targetStr = arg2.Get(); + if (targetStr.empty()) { + context->relocatesParsing.emplace_back( + std::move(srcPath), SdfPath()); + } else { + SdfPath targetPath(targetStr); + + // Target paths can be empty but the string must be explicitly empty + // which we would've caught in the if statement. An empty path here + // indicates a malformed path which is never valid. + if (targetPath.IsEmpty() || + !SdfSchema::IsValidRelocatesTargetPath(targetPath)) { + Err(context, "'%s' is not a valid relocates path", + targetStr.c_str()); + return; + } + + // The relocates map is expected to only hold absolute paths. + targetPath = targetPath.MakeAbsolutePath(context->path); + + context->relocatesParsing.emplace_back( + std::move(srcPath), std::move(targetPath)); + } context->layerHints.mightHaveRelocates = true; } @@ -1325,7 +1312,7 @@ _GenericMetadataEnd(SdfSpecType specType, Sdf_TextParserContext *context) /* Line 189 of yacc.c */ -#line 1306 "pxr/usd/sdf/textFileFormat.tab.cpp" +#line 1310 "pxr/usd/sdf/textFileFormat.tab.cpp" /* Enabling traces. */ #ifndef YYDEBUG @@ -1422,7 +1409,7 @@ typedef int YYSTYPE; /* Line 264 of yacc.c */ -#line 1403 "pxr/usd/sdf/textFileFormat.tab.cpp" +#line 1407 "pxr/usd/sdf/textFileFormat.tab.cpp" #ifdef short # undef short @@ -1899,54 +1886,54 @@ static const yytype_int16 yyrhs[] = /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 1323, 1323, 1326, 1327, 1328, 1329, 1330, 1331, 1332, - 1333, 1334, 1335, 1336, 1337, 1338, 1339, 1340, 1341, 1342, - 1343, 1344, 1345, 1346, 1347, 1348, 1349, 1350, 1351, 1352, - 1353, 1354, 1355, 1356, 1357, 1358, 1359, 1360, 1361, 1362, - 1363, 1364, 1365, 1366, 1367, 1368, 1376, 1377, 1388, 1388, - 1400, 1406, 1418, 1419, 1423, 1424, 1428, 1432, 1437, 1437, - 1446, 1446, 1452, 1452, 1458, 1458, 1464, 1464, 1470, 1470, - 1478, 1485, 1493, 1497, 1498, 1512, 1513, 1517, 1525, 1532, - 1534, 1538, 1539, 1543, 1547, 1554, 1555, 1563, 1563, 1567, - 1567, 1571, 1571, 1575, 1575, 1579, 1579, 1583, 1583, 1587, - 1597, 1598, 1605, 1605, 1665, 1666, 1670, 1671, 1675, 1676, - 1680, 1681, 1682, 1686, 1691, 1691, 1700, 1700, 1706, 1706, - 1712, 1712, 1718, 1718, 1724, 1724, 1732, 1739, 1746, 1753, - 1753, 1760, 1760, 1767, 1767, 1774, 1774, 1781, 1781, 1788, - 1788, 1796, 1796, 1801, 1801, 1806, 1806, 1811, 1811, 1816, - 1816, 1821, 1821, 1827, 1827, 1832, 1832, 1837, 1837, 1842, - 1842, 1847, 1847, 1852, 1852, 1858, 1858, 1865, 1865, 1872, - 1872, 1879, 1879, 1886, 1886, 1893, 1893, 1902, 1913, 1917, - 1921, 1925, 1929, 1933, 1937, 1943, 1948, 1955, 1963, 1972, - 1973, 1974, 1975, 1979, 1980, 1984, 1996, 1996, 2019, 2021, - 2022, 2026, 2027, 2031, 2035, 2036, 2037, 2038, 2042, 2043, - 2047, 2060, 2060, 2084, 2086, 2087, 2091, 2092, 2096, 2097, - 2101, 2102, 2103, 2104, 2108, 2109, 2113, 2119, 2120, 2121, - 2122, 2126, 2127, 2131, 2137, 2140, 2142, 2146, 2147, 2151, - 2157, 2158, 2162, 2163, 2167, 2175, 2176, 2180, 2181, 2185, - 2186, 2187, 2188, 2189, 2193, 2193, 2227, 2228, 2232, 2232, - 2275, 2284, 2297, 2298, 2306, 2309, 2318, 2324, 2327, 2333, - 2337, 2343, 2350, 2343, 2361, 2369, 2361, 2380, 2380, 2388, - 2388, 2396, 2396, 2404, 2404, 2412, 2412, 2420, 2420, 2431, - 2431, 2443, 2444, 2445, 2446, 2454, 2455, 2456, 2457, 2461, - 2462, 2466, 2476, 2476, 2481, 2483, 2487, 2488, 2492, 2492, - 2499, 2511, 2513, 2514, 2518, 2519, 2523, 2524, 2525, 2529, - 2534, 2534, 2543, 2543, 2549, 2549, 2555, 2555, 2561, 2561, - 2567, 2567, 2575, 2582, 2589, 2597, 2602, 2609, 2611, 2615, - 2618, 2628, 2628, 2636, 2638, 2642, 2643, 2647, 2650, 2658, - 2659, 2663, 2664, 2668, 2674, 2684, 2684, 2692, 2694, 2698, - 2699, 2703, 2716, 2722, 2732, 2736, 2737, 2750, 2753, 2756, - 2759, 2770, 2776, 2779, 2782, 2787, 2800, 2800, 2809, 2813, - 2814, 2818, 2819, 2820, 2828, 2828, 2835, 2839, 2840, 2844, - 2845, 2853, 2857, 2861, 2865, 2872, 2872, 2884, 2899, 2899, - 2909, 2909, 2917, 2917, 2925, 2925, 2933, 2933, 2942, 2942, - 2950, 2957, 2958, 2961, 2963, 2964, 2968, 2969, 2973, 2974, - 2975, 2979, 2984, 2984, 2993, 2993, 2999, 2999, 3005, 3005, - 3011, 3011, 3017, 3017, 3025, 3032, 3040, 3045, 3052, 3054, - 3058, 3059, 3062, 3065, 3069, 3070, 3074, 3084, 3087, 3091, - 3097, 3108, 3109, 3115, 3116, 3117, 3122, 3123, 3128, 3129, - 3132, 3134, 3138, 3139, 3143, 3144, 3148, 3151, 3153, 3157, - 3158 + 0, 1310, 1310, 1313, 1314, 1315, 1316, 1317, 1318, 1319, + 1320, 1321, 1322, 1323, 1324, 1325, 1326, 1327, 1328, 1329, + 1330, 1331, 1332, 1333, 1334, 1335, 1336, 1337, 1338, 1339, + 1340, 1341, 1342, 1343, 1344, 1345, 1346, 1347, 1348, 1349, + 1350, 1351, 1352, 1353, 1354, 1355, 1363, 1364, 1375, 1375, + 1387, 1393, 1405, 1406, 1410, 1411, 1415, 1419, 1424, 1424, + 1433, 1433, 1439, 1439, 1445, 1445, 1451, 1451, 1457, 1457, + 1465, 1472, 1480, 1484, 1485, 1499, 1500, 1504, 1512, 1519, + 1521, 1525, 1526, 1530, 1534, 1541, 1542, 1550, 1550, 1554, + 1554, 1558, 1558, 1562, 1562, 1566, 1566, 1570, 1570, 1574, + 1584, 1585, 1592, 1592, 1652, 1653, 1657, 1658, 1662, 1663, + 1667, 1668, 1669, 1673, 1678, 1678, 1687, 1687, 1693, 1693, + 1699, 1699, 1705, 1705, 1711, 1711, 1719, 1726, 1733, 1740, + 1740, 1747, 1747, 1754, 1754, 1761, 1761, 1768, 1768, 1775, + 1775, 1783, 1783, 1788, 1788, 1793, 1793, 1798, 1798, 1803, + 1803, 1808, 1808, 1814, 1814, 1819, 1819, 1824, 1824, 1829, + 1829, 1834, 1834, 1839, 1839, 1845, 1845, 1852, 1852, 1859, + 1859, 1866, 1866, 1873, 1873, 1880, 1880, 1889, 1900, 1904, + 1908, 1912, 1916, 1920, 1924, 1930, 1935, 1942, 1950, 1959, + 1960, 1961, 1962, 1966, 1967, 1971, 1983, 1983, 2006, 2008, + 2009, 2013, 2014, 2018, 2022, 2023, 2024, 2025, 2029, 2030, + 2034, 2047, 2047, 2071, 2073, 2074, 2078, 2079, 2083, 2084, + 2088, 2089, 2090, 2091, 2095, 2096, 2100, 2106, 2107, 2108, + 2109, 2113, 2114, 2118, 2124, 2127, 2129, 2133, 2134, 2138, + 2144, 2145, 2149, 2150, 2154, 2162, 2163, 2167, 2168, 2172, + 2173, 2174, 2175, 2176, 2180, 2180, 2214, 2215, 2219, 2219, + 2262, 2271, 2284, 2285, 2293, 2296, 2305, 2311, 2314, 2320, + 2324, 2330, 2337, 2330, 2348, 2356, 2348, 2367, 2367, 2375, + 2375, 2383, 2383, 2391, 2391, 2399, 2399, 2407, 2407, 2418, + 2418, 2430, 2431, 2432, 2433, 2441, 2442, 2443, 2444, 2448, + 2449, 2453, 2463, 2463, 2468, 2470, 2474, 2475, 2479, 2479, + 2486, 2498, 2500, 2501, 2505, 2506, 2510, 2511, 2512, 2516, + 2521, 2521, 2530, 2530, 2536, 2536, 2542, 2542, 2548, 2548, + 2554, 2554, 2562, 2569, 2576, 2584, 2589, 2596, 2598, 2602, + 2605, 2615, 2615, 2623, 2625, 2629, 2630, 2634, 2637, 2645, + 2646, 2650, 2651, 2655, 2661, 2671, 2671, 2679, 2681, 2685, + 2686, 2690, 2703, 2709, 2719, 2723, 2724, 2737, 2740, 2743, + 2746, 2757, 2763, 2766, 2769, 2774, 2787, 2787, 2796, 2800, + 2801, 2805, 2806, 2807, 2815, 2815, 2822, 2826, 2827, 2831, + 2832, 2840, 2844, 2848, 2852, 2859, 2859, 2871, 2886, 2886, + 2896, 2896, 2904, 2904, 2912, 2912, 2920, 2920, 2929, 2929, + 2937, 2944, 2945, 2948, 2950, 2951, 2955, 2956, 2960, 2961, + 2962, 2966, 2971, 2971, 2980, 2980, 2986, 2986, 2992, 2992, + 2998, 2998, 3004, 3004, 3012, 3019, 3027, 3032, 3039, 3041, + 3045, 3046, 3049, 3052, 3056, 3057, 3061, 3071, 3074, 3078, + 3084, 3095, 3096, 3102, 3103, 3104, 3109, 3110, 3115, 3116, + 3119, 3121, 3125, 3126, 3130, 3131, 3135, 3138, 3140, 3144, + 3145 }; #endif @@ -3507,7 +3494,7 @@ YYSTYPE yylval; case 47: /* Line 1455 of yacc.c */ -#line 1377 "pxr/usd/sdf/textFileFormat.yy" +#line 1364 "pxr/usd/sdf/textFileFormat.yy" { // Store the names of the root prims. @@ -3521,7 +3508,7 @@ YYSTYPE yylval; case 48: /* Line 1455 of yacc.c */ -#line 1388 "pxr/usd/sdf/textFileFormat.yy" +#line 1375 "pxr/usd/sdf/textFileFormat.yy" { _MatchMagicIdentifier((yyvsp[(1) - (1)]), context); context->nameChildrenStack.push_back(std::vector()); @@ -3536,7 +3523,7 @@ YYSTYPE yylval; case 50: /* Line 1455 of yacc.c */ -#line 1400 "pxr/usd/sdf/textFileFormat.yy" +#line 1387 "pxr/usd/sdf/textFileFormat.yy" { // If we're only reading metadata and we got here, // we're done. @@ -3548,7 +3535,7 @@ YYSTYPE yylval; case 51: /* Line 1455 of yacc.c */ -#line 1406 "pxr/usd/sdf/textFileFormat.yy" +#line 1393 "pxr/usd/sdf/textFileFormat.yy" { // Abort if error after layer metadata. ABORT_IF_ERROR(context->seenError); @@ -3563,7 +3550,7 @@ YYSTYPE yylval; case 57: /* Line 1455 of yacc.c */ -#line 1432 "pxr/usd/sdf/textFileFormat.yy" +#line 1419 "pxr/usd/sdf/textFileFormat.yy" { _SetField( context->path, SdfFieldKeys->Comment, @@ -3574,7 +3561,7 @@ YYSTYPE yylval; case 58: /* Line 1455 of yacc.c */ -#line 1437 "pxr/usd/sdf/textFileFormat.yy" +#line 1424 "pxr/usd/sdf/textFileFormat.yy" { _GenericMetadataStart((yyvsp[(1) - (1)]), SdfSpecTypePseudoRoot, context); ;} @@ -3583,7 +3570,7 @@ YYSTYPE yylval; case 59: /* Line 1455 of yacc.c */ -#line 1439 "pxr/usd/sdf/textFileFormat.yy" +#line 1426 "pxr/usd/sdf/textFileFormat.yy" { _GenericMetadataEnd(SdfSpecTypePseudoRoot, context); ;} @@ -3592,7 +3579,7 @@ YYSTYPE yylval; case 60: /* Line 1455 of yacc.c */ -#line 1446 "pxr/usd/sdf/textFileFormat.yy" +#line 1433 "pxr/usd/sdf/textFileFormat.yy" { _GenericMetadataStart((yyvsp[(2) - (2)]), SdfSpecTypePseudoRoot, context); context->listOpType = SdfListOpTypeDeleted; @@ -3602,7 +3589,7 @@ YYSTYPE yylval; case 61: /* Line 1455 of yacc.c */ -#line 1449 "pxr/usd/sdf/textFileFormat.yy" +#line 1436 "pxr/usd/sdf/textFileFormat.yy" { _GenericMetadataEnd(SdfSpecTypePseudoRoot, context); ;} @@ -3611,7 +3598,7 @@ YYSTYPE yylval; case 62: /* Line 1455 of yacc.c */ -#line 1452 "pxr/usd/sdf/textFileFormat.yy" +#line 1439 "pxr/usd/sdf/textFileFormat.yy" { _GenericMetadataStart((yyvsp[(2) - (2)]), SdfSpecTypePseudoRoot, context); context->listOpType = SdfListOpTypeAdded; @@ -3621,7 +3608,7 @@ YYSTYPE yylval; case 63: /* Line 1455 of yacc.c */ -#line 1455 "pxr/usd/sdf/textFileFormat.yy" +#line 1442 "pxr/usd/sdf/textFileFormat.yy" { _GenericMetadataEnd(SdfSpecTypePseudoRoot, context); ;} @@ -3630,7 +3617,7 @@ YYSTYPE yylval; case 64: /* Line 1455 of yacc.c */ -#line 1458 "pxr/usd/sdf/textFileFormat.yy" +#line 1445 "pxr/usd/sdf/textFileFormat.yy" { _GenericMetadataStart((yyvsp[(2) - (2)]), SdfSpecTypePseudoRoot, context); context->listOpType = SdfListOpTypePrepended; @@ -3640,7 +3627,7 @@ YYSTYPE yylval; case 65: /* Line 1455 of yacc.c */ -#line 1461 "pxr/usd/sdf/textFileFormat.yy" +#line 1448 "pxr/usd/sdf/textFileFormat.yy" { _GenericMetadataEnd(SdfSpecTypePseudoRoot, context); ;} @@ -3649,7 +3636,7 @@ YYSTYPE yylval; case 66: /* Line 1455 of yacc.c */ -#line 1464 "pxr/usd/sdf/textFileFormat.yy" +#line 1451 "pxr/usd/sdf/textFileFormat.yy" { _GenericMetadataStart((yyvsp[(2) - (2)]), SdfSpecTypePseudoRoot, context); context->listOpType = SdfListOpTypeAppended; @@ -3659,7 +3646,7 @@ YYSTYPE yylval; case 67: /* Line 1455 of yacc.c */ -#line 1467 "pxr/usd/sdf/textFileFormat.yy" +#line 1454 "pxr/usd/sdf/textFileFormat.yy" { _GenericMetadataEnd(SdfSpecTypePseudoRoot, context); ;} @@ -3668,7 +3655,7 @@ YYSTYPE yylval; case 68: /* Line 1455 of yacc.c */ -#line 1470 "pxr/usd/sdf/textFileFormat.yy" +#line 1457 "pxr/usd/sdf/textFileFormat.yy" { _GenericMetadataStart((yyvsp[(2) - (2)]), SdfSpecTypePseudoRoot, context); context->listOpType = SdfListOpTypeOrdered; @@ -3678,7 +3665,7 @@ YYSTYPE yylval; case 69: /* Line 1455 of yacc.c */ -#line 1473 "pxr/usd/sdf/textFileFormat.yy" +#line 1460 "pxr/usd/sdf/textFileFormat.yy" { _GenericMetadataEnd(SdfSpecTypePseudoRoot, context); ;} @@ -3687,7 +3674,7 @@ YYSTYPE yylval; case 70: /* Line 1455 of yacc.c */ -#line 1478 "pxr/usd/sdf/textFileFormat.yy" +#line 1465 "pxr/usd/sdf/textFileFormat.yy" { _SetField( context->path, SdfFieldKeys->Documentation, @@ -3698,7 +3685,7 @@ YYSTYPE yylval; case 71: /* Line 1455 of yacc.c */ -#line 1485 "pxr/usd/sdf/textFileFormat.yy" +#line 1472 "pxr/usd/sdf/textFileFormat.yy" { _SetField( context->path, SdfFieldKeys->LayerRelocates, @@ -3710,7 +3697,7 @@ YYSTYPE yylval; case 74: /* Line 1455 of yacc.c */ -#line 1498 "pxr/usd/sdf/textFileFormat.yy" +#line 1485 "pxr/usd/sdf/textFileFormat.yy" { _SetField( SdfPath::AbsoluteRootPath(), SdfFieldKeys->SubLayers, @@ -3727,7 +3714,7 @@ YYSTYPE yylval; case 77: /* Line 1455 of yacc.c */ -#line 1517 "pxr/usd/sdf/textFileFormat.yy" +#line 1504 "pxr/usd/sdf/textFileFormat.yy" { context->subLayerPaths.push_back(context->layerRefPath); context->subLayerOffsets.push_back(context->layerRefOffset); @@ -3738,7 +3725,7 @@ YYSTYPE yylval; case 78: /* Line 1455 of yacc.c */ -#line 1525 "pxr/usd/sdf/textFileFormat.yy" +#line 1512 "pxr/usd/sdf/textFileFormat.yy" { context->layerRefPath = (yyvsp[(1) - (1)]).Get(); context->layerRefOffset = SdfLayerOffset(); @@ -3749,7 +3736,7 @@ YYSTYPE yylval; case 83: /* Line 1455 of yacc.c */ -#line 1543 "pxr/usd/sdf/textFileFormat.yy" +#line 1530 "pxr/usd/sdf/textFileFormat.yy" { context->layerRefOffset.SetOffset( (yyvsp[(3) - (3)]).Get() ); ABORT_IF_ERROR(context->seenError); @@ -3759,7 +3746,7 @@ YYSTYPE yylval; case 84: /* Line 1455 of yacc.c */ -#line 1547 "pxr/usd/sdf/textFileFormat.yy" +#line 1534 "pxr/usd/sdf/textFileFormat.yy" { context->layerRefOffset.SetScale( (yyvsp[(3) - (3)]).Get() ); ABORT_IF_ERROR(context->seenError); @@ -3769,7 +3756,7 @@ YYSTYPE yylval; case 87: /* Line 1455 of yacc.c */ -#line 1563 "pxr/usd/sdf/textFileFormat.yy" +#line 1550 "pxr/usd/sdf/textFileFormat.yy" { context->specifier = SdfSpecifierDef; context->typeName = TfToken(); @@ -3779,7 +3766,7 @@ YYSTYPE yylval; case 89: /* Line 1455 of yacc.c */ -#line 1567 "pxr/usd/sdf/textFileFormat.yy" +#line 1554 "pxr/usd/sdf/textFileFormat.yy" { context->specifier = SdfSpecifierDef; context->typeName = TfToken((yyvsp[(2) - (2)]).Get()); @@ -3789,7 +3776,7 @@ YYSTYPE yylval; case 91: /* Line 1455 of yacc.c */ -#line 1571 "pxr/usd/sdf/textFileFormat.yy" +#line 1558 "pxr/usd/sdf/textFileFormat.yy" { context->specifier = SdfSpecifierClass; context->typeName = TfToken(); @@ -3799,7 +3786,7 @@ YYSTYPE yylval; case 93: /* Line 1455 of yacc.c */ -#line 1575 "pxr/usd/sdf/textFileFormat.yy" +#line 1562 "pxr/usd/sdf/textFileFormat.yy" { context->specifier = SdfSpecifierClass; context->typeName = TfToken((yyvsp[(2) - (2)]).Get()); @@ -3809,7 +3796,7 @@ YYSTYPE yylval; case 95: /* Line 1455 of yacc.c */ -#line 1579 "pxr/usd/sdf/textFileFormat.yy" +#line 1566 "pxr/usd/sdf/textFileFormat.yy" { context->specifier = SdfSpecifierOver; context->typeName = TfToken(); @@ -3819,7 +3806,7 @@ YYSTYPE yylval; case 97: /* Line 1455 of yacc.c */ -#line 1583 "pxr/usd/sdf/textFileFormat.yy" +#line 1570 "pxr/usd/sdf/textFileFormat.yy" { context->specifier = SdfSpecifierOver; context->typeName = TfToken((yyvsp[(2) - (2)]).Get()); @@ -3829,7 +3816,7 @@ YYSTYPE yylval; case 99: /* Line 1455 of yacc.c */ -#line 1587 "pxr/usd/sdf/textFileFormat.yy" +#line 1574 "pxr/usd/sdf/textFileFormat.yy" { _SetField( context->path, SdfFieldKeys->PrimOrder, @@ -3841,14 +3828,14 @@ YYSTYPE yylval; case 100: /* Line 1455 of yacc.c */ -#line 1597 "pxr/usd/sdf/textFileFormat.yy" +#line 1584 "pxr/usd/sdf/textFileFormat.yy" { (yyval) = (yyvsp[(1) - (1)]); ;} break; case 101: /* Line 1455 of yacc.c */ -#line 1598 "pxr/usd/sdf/textFileFormat.yy" +#line 1585 "pxr/usd/sdf/textFileFormat.yy" { (yyval) = std::string( (yyvsp[(1) - (3)]).Get() + '.' + (yyvsp[(3) - (3)]).Get() ); @@ -3858,7 +3845,7 @@ YYSTYPE yylval; case 102: /* Line 1455 of yacc.c */ -#line 1605 "pxr/usd/sdf/textFileFormat.yy" +#line 1592 "pxr/usd/sdf/textFileFormat.yy" { TfToken name((yyvsp[(1) - (1)]).Get()); if (!SdfPath::IsValidIdentifier(name)) { @@ -3894,7 +3881,7 @@ YYSTYPE yylval; case 103: /* Line 1455 of yacc.c */ -#line 1638 "pxr/usd/sdf/textFileFormat.yy" +#line 1625 "pxr/usd/sdf/textFileFormat.yy" { // Store the names of our children if (!context->nameChildrenStack.back().empty()) { @@ -3922,7 +3909,7 @@ YYSTYPE yylval; case 113: /* Line 1455 of yacc.c */ -#line 1686 "pxr/usd/sdf/textFileFormat.yy" +#line 1673 "pxr/usd/sdf/textFileFormat.yy" { _SetField( context->path, SdfFieldKeys->Comment, @@ -3933,7 +3920,7 @@ YYSTYPE yylval; case 114: /* Line 1455 of yacc.c */ -#line 1691 "pxr/usd/sdf/textFileFormat.yy" +#line 1678 "pxr/usd/sdf/textFileFormat.yy" { _GenericMetadataStart((yyvsp[(1) - (1)]), SdfSpecTypePrim, context); ;} @@ -3942,7 +3929,7 @@ YYSTYPE yylval; case 115: /* Line 1455 of yacc.c */ -#line 1693 "pxr/usd/sdf/textFileFormat.yy" +#line 1680 "pxr/usd/sdf/textFileFormat.yy" { _GenericMetadataEnd(SdfSpecTypePrim, context); ;} @@ -3951,7 +3938,7 @@ YYSTYPE yylval; case 116: /* Line 1455 of yacc.c */ -#line 1700 "pxr/usd/sdf/textFileFormat.yy" +#line 1687 "pxr/usd/sdf/textFileFormat.yy" { _GenericMetadataStart((yyvsp[(2) - (2)]), SdfSpecTypePrim, context); context->listOpType = SdfListOpTypeDeleted; @@ -3961,7 +3948,7 @@ YYSTYPE yylval; case 117: /* Line 1455 of yacc.c */ -#line 1703 "pxr/usd/sdf/textFileFormat.yy" +#line 1690 "pxr/usd/sdf/textFileFormat.yy" { _GenericMetadataEnd(SdfSpecTypePrim, context); ;} @@ -3970,7 +3957,7 @@ YYSTYPE yylval; case 118: /* Line 1455 of yacc.c */ -#line 1706 "pxr/usd/sdf/textFileFormat.yy" +#line 1693 "pxr/usd/sdf/textFileFormat.yy" { _GenericMetadataStart((yyvsp[(2) - (2)]), SdfSpecTypePrim, context); context->listOpType = SdfListOpTypeAdded; @@ -3980,7 +3967,7 @@ YYSTYPE yylval; case 119: /* Line 1455 of yacc.c */ -#line 1709 "pxr/usd/sdf/textFileFormat.yy" +#line 1696 "pxr/usd/sdf/textFileFormat.yy" { _GenericMetadataEnd(SdfSpecTypePrim, context); ;} @@ -3989,7 +3976,7 @@ YYSTYPE yylval; case 120: /* Line 1455 of yacc.c */ -#line 1712 "pxr/usd/sdf/textFileFormat.yy" +#line 1699 "pxr/usd/sdf/textFileFormat.yy" { _GenericMetadataStart((yyvsp[(2) - (2)]), SdfSpecTypePrim, context); context->listOpType = SdfListOpTypePrepended; @@ -3999,7 +3986,7 @@ YYSTYPE yylval; case 121: /* Line 1455 of yacc.c */ -#line 1715 "pxr/usd/sdf/textFileFormat.yy" +#line 1702 "pxr/usd/sdf/textFileFormat.yy" { _GenericMetadataEnd(SdfSpecTypePrim, context); ;} @@ -4008,7 +3995,7 @@ YYSTYPE yylval; case 122: /* Line 1455 of yacc.c */ -#line 1718 "pxr/usd/sdf/textFileFormat.yy" +#line 1705 "pxr/usd/sdf/textFileFormat.yy" { _GenericMetadataStart((yyvsp[(2) - (2)]), SdfSpecTypePrim, context); context->listOpType = SdfListOpTypeAppended; @@ -4018,7 +4005,7 @@ YYSTYPE yylval; case 123: /* Line 1455 of yacc.c */ -#line 1721 "pxr/usd/sdf/textFileFormat.yy" +#line 1708 "pxr/usd/sdf/textFileFormat.yy" { _GenericMetadataEnd(SdfSpecTypePrim, context); ;} @@ -4027,7 +4014,7 @@ YYSTYPE yylval; case 124: /* Line 1455 of yacc.c */ -#line 1724 "pxr/usd/sdf/textFileFormat.yy" +#line 1711 "pxr/usd/sdf/textFileFormat.yy" { _GenericMetadataStart((yyvsp[(2) - (2)]), SdfSpecTypePrim, context); context->listOpType = SdfListOpTypeOrdered; @@ -4037,7 +4024,7 @@ YYSTYPE yylval; case 125: /* Line 1455 of yacc.c */ -#line 1727 "pxr/usd/sdf/textFileFormat.yy" +#line 1714 "pxr/usd/sdf/textFileFormat.yy" { _GenericMetadataEnd(SdfSpecTypePrim, context); ;} @@ -4046,7 +4033,7 @@ YYSTYPE yylval; case 126: /* Line 1455 of yacc.c */ -#line 1732 "pxr/usd/sdf/textFileFormat.yy" +#line 1719 "pxr/usd/sdf/textFileFormat.yy" { _SetField( context->path, SdfFieldKeys->Documentation, @@ -4057,7 +4044,7 @@ YYSTYPE yylval; case 127: /* Line 1455 of yacc.c */ -#line 1739 "pxr/usd/sdf/textFileFormat.yy" +#line 1726 "pxr/usd/sdf/textFileFormat.yy" { _SetField( context->path, SdfFieldKeys->Kind, @@ -4068,7 +4055,7 @@ YYSTYPE yylval; case 128: /* Line 1455 of yacc.c */ -#line 1746 "pxr/usd/sdf/textFileFormat.yy" +#line 1733 "pxr/usd/sdf/textFileFormat.yy" { _SetField( context->path, SdfFieldKeys->Permission, @@ -4080,7 +4067,7 @@ YYSTYPE yylval; case 129: /* Line 1455 of yacc.c */ -#line 1753 "pxr/usd/sdf/textFileFormat.yy" +#line 1740 "pxr/usd/sdf/textFileFormat.yy" { context->layerRefPath = std::string(); context->savedPath = SdfPath(); @@ -4091,7 +4078,7 @@ YYSTYPE yylval; case 130: /* Line 1455 of yacc.c */ -#line 1757 "pxr/usd/sdf/textFileFormat.yy" +#line 1744 "pxr/usd/sdf/textFileFormat.yy" { _PrimSetPayloadListItems(SdfListOpTypeExplicit, context); ;} @@ -4100,7 +4087,7 @@ YYSTYPE yylval; case 131: /* Line 1455 of yacc.c */ -#line 1760 "pxr/usd/sdf/textFileFormat.yy" +#line 1747 "pxr/usd/sdf/textFileFormat.yy" { context->layerRefPath = std::string(); context->savedPath = SdfPath(); @@ -4111,7 +4098,7 @@ YYSTYPE yylval; case 132: /* Line 1455 of yacc.c */ -#line 1764 "pxr/usd/sdf/textFileFormat.yy" +#line 1751 "pxr/usd/sdf/textFileFormat.yy" { _PrimSetPayloadListItems(SdfListOpTypeDeleted, context); ;} @@ -4120,7 +4107,7 @@ YYSTYPE yylval; case 133: /* Line 1455 of yacc.c */ -#line 1767 "pxr/usd/sdf/textFileFormat.yy" +#line 1754 "pxr/usd/sdf/textFileFormat.yy" { context->layerRefPath = std::string(); context->savedPath = SdfPath(); @@ -4131,7 +4118,7 @@ YYSTYPE yylval; case 134: /* Line 1455 of yacc.c */ -#line 1771 "pxr/usd/sdf/textFileFormat.yy" +#line 1758 "pxr/usd/sdf/textFileFormat.yy" { _PrimSetPayloadListItems(SdfListOpTypeAdded, context); ;} @@ -4140,7 +4127,7 @@ YYSTYPE yylval; case 135: /* Line 1455 of yacc.c */ -#line 1774 "pxr/usd/sdf/textFileFormat.yy" +#line 1761 "pxr/usd/sdf/textFileFormat.yy" { context->layerRefPath = std::string(); context->savedPath = SdfPath(); @@ -4151,7 +4138,7 @@ YYSTYPE yylval; case 136: /* Line 1455 of yacc.c */ -#line 1778 "pxr/usd/sdf/textFileFormat.yy" +#line 1765 "pxr/usd/sdf/textFileFormat.yy" { _PrimSetPayloadListItems(SdfListOpTypePrepended, context); ;} @@ -4160,7 +4147,7 @@ YYSTYPE yylval; case 137: /* Line 1455 of yacc.c */ -#line 1781 "pxr/usd/sdf/textFileFormat.yy" +#line 1768 "pxr/usd/sdf/textFileFormat.yy" { context->layerRefPath = std::string(); context->savedPath = SdfPath(); @@ -4171,7 +4158,7 @@ YYSTYPE yylval; case 138: /* Line 1455 of yacc.c */ -#line 1785 "pxr/usd/sdf/textFileFormat.yy" +#line 1772 "pxr/usd/sdf/textFileFormat.yy" { _PrimSetPayloadListItems(SdfListOpTypeAppended, context); ;} @@ -4180,7 +4167,7 @@ YYSTYPE yylval; case 139: /* Line 1455 of yacc.c */ -#line 1788 "pxr/usd/sdf/textFileFormat.yy" +#line 1775 "pxr/usd/sdf/textFileFormat.yy" { context->layerRefPath = std::string(); context->savedPath = SdfPath(); @@ -4191,7 +4178,7 @@ YYSTYPE yylval; case 140: /* Line 1455 of yacc.c */ -#line 1792 "pxr/usd/sdf/textFileFormat.yy" +#line 1779 "pxr/usd/sdf/textFileFormat.yy" { _PrimSetPayloadListItems(SdfListOpTypeOrdered, context); ;} @@ -4200,7 +4187,7 @@ YYSTYPE yylval; case 141: /* Line 1455 of yacc.c */ -#line 1796 "pxr/usd/sdf/textFileFormat.yy" +#line 1783 "pxr/usd/sdf/textFileFormat.yy" { context->inheritParsingTargetPaths.clear(); ;} @@ -4209,7 +4196,7 @@ YYSTYPE yylval; case 142: /* Line 1455 of yacc.c */ -#line 1798 "pxr/usd/sdf/textFileFormat.yy" +#line 1785 "pxr/usd/sdf/textFileFormat.yy" { _PrimSetInheritListItems(SdfListOpTypeExplicit, context); ;} @@ -4218,7 +4205,7 @@ YYSTYPE yylval; case 143: /* Line 1455 of yacc.c */ -#line 1801 "pxr/usd/sdf/textFileFormat.yy" +#line 1788 "pxr/usd/sdf/textFileFormat.yy" { context->inheritParsingTargetPaths.clear(); ;} @@ -4227,7 +4214,7 @@ YYSTYPE yylval; case 144: /* Line 1455 of yacc.c */ -#line 1803 "pxr/usd/sdf/textFileFormat.yy" +#line 1790 "pxr/usd/sdf/textFileFormat.yy" { _PrimSetInheritListItems(SdfListOpTypeDeleted, context); ;} @@ -4236,7 +4223,7 @@ YYSTYPE yylval; case 145: /* Line 1455 of yacc.c */ -#line 1806 "pxr/usd/sdf/textFileFormat.yy" +#line 1793 "pxr/usd/sdf/textFileFormat.yy" { context->inheritParsingTargetPaths.clear(); ;} @@ -4245,7 +4232,7 @@ YYSTYPE yylval; case 146: /* Line 1455 of yacc.c */ -#line 1808 "pxr/usd/sdf/textFileFormat.yy" +#line 1795 "pxr/usd/sdf/textFileFormat.yy" { _PrimSetInheritListItems(SdfListOpTypeAdded, context); ;} @@ -4254,7 +4241,7 @@ YYSTYPE yylval; case 147: /* Line 1455 of yacc.c */ -#line 1811 "pxr/usd/sdf/textFileFormat.yy" +#line 1798 "pxr/usd/sdf/textFileFormat.yy" { context->inheritParsingTargetPaths.clear(); ;} @@ -4263,7 +4250,7 @@ YYSTYPE yylval; case 148: /* Line 1455 of yacc.c */ -#line 1813 "pxr/usd/sdf/textFileFormat.yy" +#line 1800 "pxr/usd/sdf/textFileFormat.yy" { _PrimSetInheritListItems(SdfListOpTypePrepended, context); ;} @@ -4272,7 +4259,7 @@ YYSTYPE yylval; case 149: /* Line 1455 of yacc.c */ -#line 1816 "pxr/usd/sdf/textFileFormat.yy" +#line 1803 "pxr/usd/sdf/textFileFormat.yy" { context->inheritParsingTargetPaths.clear(); ;} @@ -4281,7 +4268,7 @@ YYSTYPE yylval; case 150: /* Line 1455 of yacc.c */ -#line 1818 "pxr/usd/sdf/textFileFormat.yy" +#line 1805 "pxr/usd/sdf/textFileFormat.yy" { _PrimSetInheritListItems(SdfListOpTypeAppended, context); ;} @@ -4290,7 +4277,7 @@ YYSTYPE yylval; case 151: /* Line 1455 of yacc.c */ -#line 1821 "pxr/usd/sdf/textFileFormat.yy" +#line 1808 "pxr/usd/sdf/textFileFormat.yy" { context->inheritParsingTargetPaths.clear(); ;} @@ -4299,7 +4286,7 @@ YYSTYPE yylval; case 152: /* Line 1455 of yacc.c */ -#line 1823 "pxr/usd/sdf/textFileFormat.yy" +#line 1810 "pxr/usd/sdf/textFileFormat.yy" { _PrimSetInheritListItems(SdfListOpTypeOrdered, context); ;} @@ -4308,7 +4295,7 @@ YYSTYPE yylval; case 153: /* Line 1455 of yacc.c */ -#line 1827 "pxr/usd/sdf/textFileFormat.yy" +#line 1814 "pxr/usd/sdf/textFileFormat.yy" { context->specializesParsingTargetPaths.clear(); ;} @@ -4317,7 +4304,7 @@ YYSTYPE yylval; case 154: /* Line 1455 of yacc.c */ -#line 1829 "pxr/usd/sdf/textFileFormat.yy" +#line 1816 "pxr/usd/sdf/textFileFormat.yy" { _PrimSetSpecializesListItems(SdfListOpTypeExplicit, context); ;} @@ -4326,7 +4313,7 @@ YYSTYPE yylval; case 155: /* Line 1455 of yacc.c */ -#line 1832 "pxr/usd/sdf/textFileFormat.yy" +#line 1819 "pxr/usd/sdf/textFileFormat.yy" { context->specializesParsingTargetPaths.clear(); ;} @@ -4335,7 +4322,7 @@ YYSTYPE yylval; case 156: /* Line 1455 of yacc.c */ -#line 1834 "pxr/usd/sdf/textFileFormat.yy" +#line 1821 "pxr/usd/sdf/textFileFormat.yy" { _PrimSetSpecializesListItems(SdfListOpTypeDeleted, context); ;} @@ -4344,7 +4331,7 @@ YYSTYPE yylval; case 157: /* Line 1455 of yacc.c */ -#line 1837 "pxr/usd/sdf/textFileFormat.yy" +#line 1824 "pxr/usd/sdf/textFileFormat.yy" { context->specializesParsingTargetPaths.clear(); ;} @@ -4353,7 +4340,7 @@ YYSTYPE yylval; case 158: /* Line 1455 of yacc.c */ -#line 1839 "pxr/usd/sdf/textFileFormat.yy" +#line 1826 "pxr/usd/sdf/textFileFormat.yy" { _PrimSetSpecializesListItems(SdfListOpTypeAdded, context); ;} @@ -4362,7 +4349,7 @@ YYSTYPE yylval; case 159: /* Line 1455 of yacc.c */ -#line 1842 "pxr/usd/sdf/textFileFormat.yy" +#line 1829 "pxr/usd/sdf/textFileFormat.yy" { context->specializesParsingTargetPaths.clear(); ;} @@ -4371,7 +4358,7 @@ YYSTYPE yylval; case 160: /* Line 1455 of yacc.c */ -#line 1844 "pxr/usd/sdf/textFileFormat.yy" +#line 1831 "pxr/usd/sdf/textFileFormat.yy" { _PrimSetSpecializesListItems(SdfListOpTypePrepended, context); ;} @@ -4380,7 +4367,7 @@ YYSTYPE yylval; case 161: /* Line 1455 of yacc.c */ -#line 1847 "pxr/usd/sdf/textFileFormat.yy" +#line 1834 "pxr/usd/sdf/textFileFormat.yy" { context->specializesParsingTargetPaths.clear(); ;} @@ -4389,7 +4376,7 @@ YYSTYPE yylval; case 162: /* Line 1455 of yacc.c */ -#line 1849 "pxr/usd/sdf/textFileFormat.yy" +#line 1836 "pxr/usd/sdf/textFileFormat.yy" { _PrimSetSpecializesListItems(SdfListOpTypeAppended, context); ;} @@ -4398,7 +4385,7 @@ YYSTYPE yylval; case 163: /* Line 1455 of yacc.c */ -#line 1852 "pxr/usd/sdf/textFileFormat.yy" +#line 1839 "pxr/usd/sdf/textFileFormat.yy" { context->specializesParsingTargetPaths.clear(); ;} @@ -4407,7 +4394,7 @@ YYSTYPE yylval; case 164: /* Line 1455 of yacc.c */ -#line 1854 "pxr/usd/sdf/textFileFormat.yy" +#line 1841 "pxr/usd/sdf/textFileFormat.yy" { _PrimSetSpecializesListItems(SdfListOpTypeOrdered, context); ;} @@ -4416,7 +4403,7 @@ YYSTYPE yylval; case 165: /* Line 1455 of yacc.c */ -#line 1858 "pxr/usd/sdf/textFileFormat.yy" +#line 1845 "pxr/usd/sdf/textFileFormat.yy" { context->layerRefPath = std::string(); context->savedPath = SdfPath(); @@ -4427,7 +4414,7 @@ YYSTYPE yylval; case 166: /* Line 1455 of yacc.c */ -#line 1862 "pxr/usd/sdf/textFileFormat.yy" +#line 1849 "pxr/usd/sdf/textFileFormat.yy" { _PrimSetReferenceListItems(SdfListOpTypeExplicit, context); ;} @@ -4436,7 +4423,7 @@ YYSTYPE yylval; case 167: /* Line 1455 of yacc.c */ -#line 1865 "pxr/usd/sdf/textFileFormat.yy" +#line 1852 "pxr/usd/sdf/textFileFormat.yy" { context->layerRefPath = std::string(); context->savedPath = SdfPath(); @@ -4447,7 +4434,7 @@ YYSTYPE yylval; case 168: /* Line 1455 of yacc.c */ -#line 1869 "pxr/usd/sdf/textFileFormat.yy" +#line 1856 "pxr/usd/sdf/textFileFormat.yy" { _PrimSetReferenceListItems(SdfListOpTypeDeleted, context); ;} @@ -4456,7 +4443,7 @@ YYSTYPE yylval; case 169: /* Line 1455 of yacc.c */ -#line 1872 "pxr/usd/sdf/textFileFormat.yy" +#line 1859 "pxr/usd/sdf/textFileFormat.yy" { context->layerRefPath = std::string(); context->savedPath = SdfPath(); @@ -4467,7 +4454,7 @@ YYSTYPE yylval; case 170: /* Line 1455 of yacc.c */ -#line 1876 "pxr/usd/sdf/textFileFormat.yy" +#line 1863 "pxr/usd/sdf/textFileFormat.yy" { _PrimSetReferenceListItems(SdfListOpTypeAdded, context); ;} @@ -4476,7 +4463,7 @@ YYSTYPE yylval; case 171: /* Line 1455 of yacc.c */ -#line 1879 "pxr/usd/sdf/textFileFormat.yy" +#line 1866 "pxr/usd/sdf/textFileFormat.yy" { context->layerRefPath = std::string(); context->savedPath = SdfPath(); @@ -4487,7 +4474,7 @@ YYSTYPE yylval; case 172: /* Line 1455 of yacc.c */ -#line 1883 "pxr/usd/sdf/textFileFormat.yy" +#line 1870 "pxr/usd/sdf/textFileFormat.yy" { _PrimSetReferenceListItems(SdfListOpTypePrepended, context); ;} @@ -4496,7 +4483,7 @@ YYSTYPE yylval; case 173: /* Line 1455 of yacc.c */ -#line 1886 "pxr/usd/sdf/textFileFormat.yy" +#line 1873 "pxr/usd/sdf/textFileFormat.yy" { context->layerRefPath = std::string(); context->savedPath = SdfPath(); @@ -4507,7 +4494,7 @@ YYSTYPE yylval; case 174: /* Line 1455 of yacc.c */ -#line 1890 "pxr/usd/sdf/textFileFormat.yy" +#line 1877 "pxr/usd/sdf/textFileFormat.yy" { _PrimSetReferenceListItems(SdfListOpTypeAppended, context); ;} @@ -4516,7 +4503,7 @@ YYSTYPE yylval; case 175: /* Line 1455 of yacc.c */ -#line 1893 "pxr/usd/sdf/textFileFormat.yy" +#line 1880 "pxr/usd/sdf/textFileFormat.yy" { context->layerRefPath = std::string(); context->savedPath = SdfPath(); @@ -4527,7 +4514,7 @@ YYSTYPE yylval; case 176: /* Line 1455 of yacc.c */ -#line 1897 "pxr/usd/sdf/textFileFormat.yy" +#line 1884 "pxr/usd/sdf/textFileFormat.yy" { _PrimSetReferenceListItems(SdfListOpTypeOrdered, context); ;} @@ -4536,7 +4523,7 @@ YYSTYPE yylval; case 177: /* Line 1455 of yacc.c */ -#line 1902 "pxr/usd/sdf/textFileFormat.yy" +#line 1889 "pxr/usd/sdf/textFileFormat.yy" { SdfRelocatesMap relocatesParsingMap( std::make_move_iterator(context->relocatesParsing.begin()), @@ -4551,7 +4538,7 @@ YYSTYPE yylval; case 178: /* Line 1455 of yacc.c */ -#line 1913 "pxr/usd/sdf/textFileFormat.yy" +#line 1900 "pxr/usd/sdf/textFileFormat.yy" { _PrimSetVariantSelection(context); ;} @@ -4560,7 +4547,7 @@ YYSTYPE yylval; case 179: /* Line 1455 of yacc.c */ -#line 1917 "pxr/usd/sdf/textFileFormat.yy" +#line 1904 "pxr/usd/sdf/textFileFormat.yy" { _PrimSetVariantSetNamesListItems(SdfListOpTypeExplicit, context); context->nameVector.clear(); @@ -4570,7 +4557,7 @@ YYSTYPE yylval; case 180: /* Line 1455 of yacc.c */ -#line 1921 "pxr/usd/sdf/textFileFormat.yy" +#line 1908 "pxr/usd/sdf/textFileFormat.yy" { _PrimSetVariantSetNamesListItems(SdfListOpTypeDeleted, context); context->nameVector.clear(); @@ -4580,7 +4567,7 @@ YYSTYPE yylval; case 181: /* Line 1455 of yacc.c */ -#line 1925 "pxr/usd/sdf/textFileFormat.yy" +#line 1912 "pxr/usd/sdf/textFileFormat.yy" { _PrimSetVariantSetNamesListItems(SdfListOpTypeAdded, context); context->nameVector.clear(); @@ -4590,7 +4577,7 @@ YYSTYPE yylval; case 182: /* Line 1455 of yacc.c */ -#line 1929 "pxr/usd/sdf/textFileFormat.yy" +#line 1916 "pxr/usd/sdf/textFileFormat.yy" { _PrimSetVariantSetNamesListItems(SdfListOpTypePrepended, context); context->nameVector.clear(); @@ -4600,7 +4587,7 @@ YYSTYPE yylval; case 183: /* Line 1455 of yacc.c */ -#line 1933 "pxr/usd/sdf/textFileFormat.yy" +#line 1920 "pxr/usd/sdf/textFileFormat.yy" { _PrimSetVariantSetNamesListItems(SdfListOpTypeAppended, context); context->nameVector.clear(); @@ -4610,7 +4597,7 @@ YYSTYPE yylval; case 184: /* Line 1455 of yacc.c */ -#line 1937 "pxr/usd/sdf/textFileFormat.yy" +#line 1924 "pxr/usd/sdf/textFileFormat.yy" { _PrimSetVariantSetNamesListItems(SdfListOpTypeOrdered, context); context->nameVector.clear(); @@ -4620,7 +4607,7 @@ YYSTYPE yylval; case 185: /* Line 1455 of yacc.c */ -#line 1943 "pxr/usd/sdf/textFileFormat.yy" +#line 1930 "pxr/usd/sdf/textFileFormat.yy" { _SetField( context->path, SdfFieldKeys->SymmetryFunction, @@ -4631,7 +4618,7 @@ YYSTYPE yylval; case 186: /* Line 1455 of yacc.c */ -#line 1948 "pxr/usd/sdf/textFileFormat.yy" +#line 1935 "pxr/usd/sdf/textFileFormat.yy" { _SetField( context->path, SdfFieldKeys->SymmetryFunction, @@ -4642,7 +4629,7 @@ YYSTYPE yylval; case 187: /* Line 1455 of yacc.c */ -#line 1955 "pxr/usd/sdf/textFileFormat.yy" +#line 1942 "pxr/usd/sdf/textFileFormat.yy" { _SetField( context->path, SdfFieldKeys->PrefixSubstitutions, @@ -4654,7 +4641,7 @@ YYSTYPE yylval; case 188: /* Line 1455 of yacc.c */ -#line 1963 "pxr/usd/sdf/textFileFormat.yy" +#line 1950 "pxr/usd/sdf/textFileFormat.yy" { _SetField( context->path, SdfFieldKeys->SuffixSubstitutions, @@ -4666,7 +4653,7 @@ YYSTYPE yylval; case 195: /* Line 1455 of yacc.c */ -#line 1984 "pxr/usd/sdf/textFileFormat.yy" +#line 1971 "pxr/usd/sdf/textFileFormat.yy" { if (context->layerRefPath.empty()) { Err(context, "Payload asset path must not be empty. If this " @@ -4684,7 +4671,7 @@ YYSTYPE yylval; case 196: /* Line 1455 of yacc.c */ -#line 1996 "pxr/usd/sdf/textFileFormat.yy" +#line 1983 "pxr/usd/sdf/textFileFormat.yy" { // Internal payloads do not begin with an asset path so there's // no layer_ref rule, but we need to make sure we reset state the @@ -4698,7 +4685,7 @@ YYSTYPE yylval; case 197: /* Line 1455 of yacc.c */ -#line 2004 "pxr/usd/sdf/textFileFormat.yy" +#line 1991 "pxr/usd/sdf/textFileFormat.yy" { if (!(yyvsp[(1) - (3)]).Get().empty()) { _PathSetPrim((yyvsp[(1) - (3)]), context); @@ -4717,7 +4704,7 @@ YYSTYPE yylval; case 210: /* Line 1455 of yacc.c */ -#line 2047 "pxr/usd/sdf/textFileFormat.yy" +#line 2034 "pxr/usd/sdf/textFileFormat.yy" { if (context->layerRefPath.empty()) { Err(context, "Reference asset path must not be empty. If this " @@ -4736,7 +4723,7 @@ YYSTYPE yylval; case 211: /* Line 1455 of yacc.c */ -#line 2060 "pxr/usd/sdf/textFileFormat.yy" +#line 2047 "pxr/usd/sdf/textFileFormat.yy" { // Internal references do not begin with an asset path so there's // no layer_ref rule, but we need to make sure we reset state the @@ -4750,7 +4737,7 @@ YYSTYPE yylval; case 212: /* Line 1455 of yacc.c */ -#line 2068 "pxr/usd/sdf/textFileFormat.yy" +#line 2055 "pxr/usd/sdf/textFileFormat.yy" { if (!(yyvsp[(1) - (3)]).Get().empty()) { _PathSetPrim((yyvsp[(1) - (3)]), context); @@ -4770,7 +4757,7 @@ YYSTYPE yylval; case 226: /* Line 1455 of yacc.c */ -#line 2113 "pxr/usd/sdf/textFileFormat.yy" +#line 2100 "pxr/usd/sdf/textFileFormat.yy" { _InheritAppendPath(context); ;} @@ -4779,7 +4766,7 @@ YYSTYPE yylval; case 233: /* Line 1455 of yacc.c */ -#line 2131 "pxr/usd/sdf/textFileFormat.yy" +#line 2118 "pxr/usd/sdf/textFileFormat.yy" { _SpecializesAppendPath(context); ;} @@ -4788,7 +4775,7 @@ YYSTYPE yylval; case 239: /* Line 1455 of yacc.c */ -#line 2151 "pxr/usd/sdf/textFileFormat.yy" +#line 2138 "pxr/usd/sdf/textFileFormat.yy" { _RelocatesAdd((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), context); ;} @@ -4797,7 +4784,7 @@ YYSTYPE yylval; case 244: /* Line 1455 of yacc.c */ -#line 2167 "pxr/usd/sdf/textFileFormat.yy" +#line 2154 "pxr/usd/sdf/textFileFormat.yy" { context->nameVector.push_back(TfToken((yyvsp[(1) - (1)]).Get())); ;} @@ -4806,28 +4793,28 @@ YYSTYPE yylval; case 249: /* Line 1455 of yacc.c */ -#line 2185 "pxr/usd/sdf/textFileFormat.yy" +#line 2172 "pxr/usd/sdf/textFileFormat.yy" {;} break; case 250: /* Line 1455 of yacc.c */ -#line 2186 "pxr/usd/sdf/textFileFormat.yy" +#line 2173 "pxr/usd/sdf/textFileFormat.yy" {;} break; case 251: /* Line 1455 of yacc.c */ -#line 2187 "pxr/usd/sdf/textFileFormat.yy" +#line 2174 "pxr/usd/sdf/textFileFormat.yy" {;} break; case 254: /* Line 1455 of yacc.c */ -#line 2193 "pxr/usd/sdf/textFileFormat.yy" +#line 2180 "pxr/usd/sdf/textFileFormat.yy" { const std::string name = (yyvsp[(2) - (2)]).Get(); ERROR_IF_NOT_ALLOWED(context, SdfSchema::IsValidVariantIdentifier(name)); @@ -4842,7 +4829,7 @@ YYSTYPE yylval; case 255: /* Line 1455 of yacc.c */ -#line 2201 "pxr/usd/sdf/textFileFormat.yy" +#line 2188 "pxr/usd/sdf/textFileFormat.yy" { SdfPath variantSetPath = context->path; @@ -4871,7 +4858,7 @@ YYSTYPE yylval; case 258: /* Line 1455 of yacc.c */ -#line 2232 "pxr/usd/sdf/textFileFormat.yy" +#line 2219 "pxr/usd/sdf/textFileFormat.yy" { const std::string variantName = (yyvsp[(1) - (1)]).Get(); ERROR_IF_NOT_ALLOWED( @@ -4898,7 +4885,7 @@ YYSTYPE yylval; case 259: /* Line 1455 of yacc.c */ -#line 2252 "pxr/usd/sdf/textFileFormat.yy" +#line 2239 "pxr/usd/sdf/textFileFormat.yy" { // Store the names of the prims and properties defined in this variant. if (!context->nameChildrenStack.back().empty()) { @@ -4924,7 +4911,7 @@ YYSTYPE yylval; case 260: /* Line 1455 of yacc.c */ -#line 2275 "pxr/usd/sdf/textFileFormat.yy" +#line 2262 "pxr/usd/sdf/textFileFormat.yy" { _SetField( context->path, SdfFieldKeys->PrimOrder, @@ -4936,7 +4923,7 @@ YYSTYPE yylval; case 261: /* Line 1455 of yacc.c */ -#line 2284 "pxr/usd/sdf/textFileFormat.yy" +#line 2271 "pxr/usd/sdf/textFileFormat.yy" { _SetField( context->path, SdfFieldKeys->PropertyOrder, @@ -4948,7 +4935,7 @@ YYSTYPE yylval; case 264: /* Line 1455 of yacc.c */ -#line 2306 "pxr/usd/sdf/textFileFormat.yy" +#line 2293 "pxr/usd/sdf/textFileFormat.yy" { context->variability = VtValue(SdfVariabilityUniform); ;} @@ -4957,7 +4944,7 @@ YYSTYPE yylval; case 265: /* Line 1455 of yacc.c */ -#line 2309 "pxr/usd/sdf/textFileFormat.yy" +#line 2296 "pxr/usd/sdf/textFileFormat.yy" { // Convert legacy "config" variability to SdfVariabilityUniform. // This value was never officially used in USD but we handle @@ -4969,7 +4956,7 @@ YYSTYPE yylval; case 266: /* Line 1455 of yacc.c */ -#line 2318 "pxr/usd/sdf/textFileFormat.yy" +#line 2305 "pxr/usd/sdf/textFileFormat.yy" { context->assoc = VtValue(); ;} @@ -4978,7 +4965,7 @@ YYSTYPE yylval; case 267: /* Line 1455 of yacc.c */ -#line 2324 "pxr/usd/sdf/textFileFormat.yy" +#line 2311 "pxr/usd/sdf/textFileFormat.yy" { _SetupValue((yyvsp[(1) - (1)]).Get(), context); ;} @@ -4987,7 +4974,7 @@ YYSTYPE yylval; case 268: /* Line 1455 of yacc.c */ -#line 2327 "pxr/usd/sdf/textFileFormat.yy" +#line 2314 "pxr/usd/sdf/textFileFormat.yy" { _SetupValue(std::string((yyvsp[(1) - (3)]).Get() + "[]"), context); ;} @@ -4996,7 +4983,7 @@ YYSTYPE yylval; case 269: /* Line 1455 of yacc.c */ -#line 2333 "pxr/usd/sdf/textFileFormat.yy" +#line 2320 "pxr/usd/sdf/textFileFormat.yy" { context->variability = VtValue(); context->custom = false; @@ -5006,7 +4993,7 @@ YYSTYPE yylval; case 270: /* Line 1455 of yacc.c */ -#line 2337 "pxr/usd/sdf/textFileFormat.yy" +#line 2324 "pxr/usd/sdf/textFileFormat.yy" { context->custom = false; ;} @@ -5015,7 +5002,7 @@ YYSTYPE yylval; case 271: /* Line 1455 of yacc.c */ -#line 2343 "pxr/usd/sdf/textFileFormat.yy" +#line 2330 "pxr/usd/sdf/textFileFormat.yy" { _PrimInitAttribute((yyvsp[(2) - (2)]), context); @@ -5028,7 +5015,7 @@ YYSTYPE yylval; case 272: /* Line 1455 of yacc.c */ -#line 2350 "pxr/usd/sdf/textFileFormat.yy" +#line 2337 "pxr/usd/sdf/textFileFormat.yy" { if (!context->values.valueTypeIsValid) { context->values.StopRecordingString(); @@ -5039,7 +5026,7 @@ YYSTYPE yylval; case 273: /* Line 1455 of yacc.c */ -#line 2355 "pxr/usd/sdf/textFileFormat.yy" +#line 2342 "pxr/usd/sdf/textFileFormat.yy" { context->path = context->path.GetParentPath(); ;} @@ -5048,7 +5035,7 @@ YYSTYPE yylval; case 274: /* Line 1455 of yacc.c */ -#line 2361 "pxr/usd/sdf/textFileFormat.yy" +#line 2348 "pxr/usd/sdf/textFileFormat.yy" { context->custom = true; _PrimInitAttribute((yyvsp[(3) - (3)]), context); @@ -5062,7 +5049,7 @@ YYSTYPE yylval; case 275: /* Line 1455 of yacc.c */ -#line 2369 "pxr/usd/sdf/textFileFormat.yy" +#line 2356 "pxr/usd/sdf/textFileFormat.yy" { if (!context->values.valueTypeIsValid) { context->values.StopRecordingString(); @@ -5073,7 +5060,7 @@ YYSTYPE yylval; case 276: /* Line 1455 of yacc.c */ -#line 2374 "pxr/usd/sdf/textFileFormat.yy" +#line 2361 "pxr/usd/sdf/textFileFormat.yy" { context->path = context->path.GetParentPath(); ;} @@ -5082,7 +5069,7 @@ YYSTYPE yylval; case 277: /* Line 1455 of yacc.c */ -#line 2380 "pxr/usd/sdf/textFileFormat.yy" +#line 2367 "pxr/usd/sdf/textFileFormat.yy" { _PrimInitAttribute((yyvsp[(2) - (5)]), context); context->connParsingTargetPaths.clear(); @@ -5093,7 +5080,7 @@ YYSTYPE yylval; case 278: /* Line 1455 of yacc.c */ -#line 2384 "pxr/usd/sdf/textFileFormat.yy" +#line 2371 "pxr/usd/sdf/textFileFormat.yy" { _AttributeSetConnectionTargetsList(SdfListOpTypeExplicit, context); context->path = context->path.GetParentPath(); @@ -5103,7 +5090,7 @@ YYSTYPE yylval; case 279: /* Line 1455 of yacc.c */ -#line 2388 "pxr/usd/sdf/textFileFormat.yy" +#line 2375 "pxr/usd/sdf/textFileFormat.yy" { _PrimInitAttribute((yyvsp[(3) - (6)]), context); context->connParsingTargetPaths.clear(); @@ -5114,7 +5101,7 @@ YYSTYPE yylval; case 280: /* Line 1455 of yacc.c */ -#line 2392 "pxr/usd/sdf/textFileFormat.yy" +#line 2379 "pxr/usd/sdf/textFileFormat.yy" { _AttributeSetConnectionTargetsList(SdfListOpTypeAdded, context); context->path = context->path.GetParentPath(); @@ -5124,7 +5111,7 @@ YYSTYPE yylval; case 281: /* Line 1455 of yacc.c */ -#line 2396 "pxr/usd/sdf/textFileFormat.yy" +#line 2383 "pxr/usd/sdf/textFileFormat.yy" { _PrimInitAttribute((yyvsp[(3) - (6)]), context); context->connParsingTargetPaths.clear(); @@ -5135,7 +5122,7 @@ YYSTYPE yylval; case 282: /* Line 1455 of yacc.c */ -#line 2400 "pxr/usd/sdf/textFileFormat.yy" +#line 2387 "pxr/usd/sdf/textFileFormat.yy" { _AttributeSetConnectionTargetsList(SdfListOpTypePrepended, context); context->path = context->path.GetParentPath(); @@ -5145,7 +5132,7 @@ YYSTYPE yylval; case 283: /* Line 1455 of yacc.c */ -#line 2404 "pxr/usd/sdf/textFileFormat.yy" +#line 2391 "pxr/usd/sdf/textFileFormat.yy" { _PrimInitAttribute((yyvsp[(3) - (6)]), context); context->connParsingTargetPaths.clear(); @@ -5156,7 +5143,7 @@ YYSTYPE yylval; case 284: /* Line 1455 of yacc.c */ -#line 2408 "pxr/usd/sdf/textFileFormat.yy" +#line 2395 "pxr/usd/sdf/textFileFormat.yy" { _AttributeSetConnectionTargetsList(SdfListOpTypeAppended, context); context->path = context->path.GetParentPath(); @@ -5166,7 +5153,7 @@ YYSTYPE yylval; case 285: /* Line 1455 of yacc.c */ -#line 2412 "pxr/usd/sdf/textFileFormat.yy" +#line 2399 "pxr/usd/sdf/textFileFormat.yy" { _PrimInitAttribute((yyvsp[(3) - (6)]), context); context->connParsingTargetPaths.clear(); @@ -5177,7 +5164,7 @@ YYSTYPE yylval; case 286: /* Line 1455 of yacc.c */ -#line 2416 "pxr/usd/sdf/textFileFormat.yy" +#line 2403 "pxr/usd/sdf/textFileFormat.yy" { _AttributeSetConnectionTargetsList(SdfListOpTypeDeleted, context); context->path = context->path.GetParentPath(); @@ -5187,7 +5174,7 @@ YYSTYPE yylval; case 287: /* Line 1455 of yacc.c */ -#line 2420 "pxr/usd/sdf/textFileFormat.yy" +#line 2407 "pxr/usd/sdf/textFileFormat.yy" { _PrimInitAttribute((yyvsp[(3) - (6)]), context); context->connParsingTargetPaths.clear(); @@ -5198,7 +5185,7 @@ YYSTYPE yylval; case 288: /* Line 1455 of yacc.c */ -#line 2424 "pxr/usd/sdf/textFileFormat.yy" +#line 2411 "pxr/usd/sdf/textFileFormat.yy" { _AttributeSetConnectionTargetsList(SdfListOpTypeOrdered, context); context->path = context->path.GetParentPath(); @@ -5208,7 +5195,7 @@ YYSTYPE yylval; case 289: /* Line 1455 of yacc.c */ -#line 2431 "pxr/usd/sdf/textFileFormat.yy" +#line 2418 "pxr/usd/sdf/textFileFormat.yy" { _PrimInitAttribute((yyvsp[(2) - (5)]), context); ;} @@ -5217,7 +5204,7 @@ YYSTYPE yylval; case 290: /* Line 1455 of yacc.c */ -#line 2434 "pxr/usd/sdf/textFileFormat.yy" +#line 2421 "pxr/usd/sdf/textFileFormat.yy" { _SetField( context->path, SdfFieldKeys->TimeSamples, @@ -5229,7 +5216,7 @@ YYSTYPE yylval; case 301: /* Line 1455 of yacc.c */ -#line 2466 "pxr/usd/sdf/textFileFormat.yy" +#line 2453 "pxr/usd/sdf/textFileFormat.yy" { _AttributeAppendConnectionPath(context); ;} @@ -5238,7 +5225,7 @@ YYSTYPE yylval; case 302: /* Line 1455 of yacc.c */ -#line 2476 "pxr/usd/sdf/textFileFormat.yy" +#line 2463 "pxr/usd/sdf/textFileFormat.yy" { context->timeSamples = SdfTimeSampleMap(); ;} @@ -5247,7 +5234,7 @@ YYSTYPE yylval; case 308: /* Line 1455 of yacc.c */ -#line 2492 "pxr/usd/sdf/textFileFormat.yy" +#line 2479 "pxr/usd/sdf/textFileFormat.yy" { context->timeSampleTime = (yyvsp[(1) - (2)]).Get(); ;} @@ -5256,7 +5243,7 @@ YYSTYPE yylval; case 309: /* Line 1455 of yacc.c */ -#line 2495 "pxr/usd/sdf/textFileFormat.yy" +#line 2482 "pxr/usd/sdf/textFileFormat.yy" { context->timeSamples[ context->timeSampleTime ] = context->currentValue; ;} @@ -5265,7 +5252,7 @@ YYSTYPE yylval; case 310: /* Line 1455 of yacc.c */ -#line 2499 "pxr/usd/sdf/textFileFormat.yy" +#line 2486 "pxr/usd/sdf/textFileFormat.yy" { context->timeSampleTime = (yyvsp[(1) - (3)]).Get(); context->timeSamples[ context->timeSampleTime ] @@ -5276,7 +5263,7 @@ YYSTYPE yylval; case 319: /* Line 1455 of yacc.c */ -#line 2529 "pxr/usd/sdf/textFileFormat.yy" +#line 2516 "pxr/usd/sdf/textFileFormat.yy" { _SetField( context->path, SdfFieldKeys->Comment, @@ -5287,7 +5274,7 @@ YYSTYPE yylval; case 320: /* Line 1455 of yacc.c */ -#line 2534 "pxr/usd/sdf/textFileFormat.yy" +#line 2521 "pxr/usd/sdf/textFileFormat.yy" { _GenericMetadataStart((yyvsp[(1) - (1)]), SdfSpecTypeAttribute, context); ;} @@ -5296,7 +5283,7 @@ YYSTYPE yylval; case 321: /* Line 1455 of yacc.c */ -#line 2536 "pxr/usd/sdf/textFileFormat.yy" +#line 2523 "pxr/usd/sdf/textFileFormat.yy" { _GenericMetadataEnd(SdfSpecTypeAttribute, context); ;} @@ -5305,7 +5292,7 @@ YYSTYPE yylval; case 322: /* Line 1455 of yacc.c */ -#line 2543 "pxr/usd/sdf/textFileFormat.yy" +#line 2530 "pxr/usd/sdf/textFileFormat.yy" { _GenericMetadataStart((yyvsp[(2) - (2)]), SdfSpecTypeAttribute, context); context->listOpType = SdfListOpTypeDeleted; @@ -5315,7 +5302,7 @@ YYSTYPE yylval; case 323: /* Line 1455 of yacc.c */ -#line 2546 "pxr/usd/sdf/textFileFormat.yy" +#line 2533 "pxr/usd/sdf/textFileFormat.yy" { _GenericMetadataEnd(SdfSpecTypeAttribute, context); ;} @@ -5324,7 +5311,7 @@ YYSTYPE yylval; case 324: /* Line 1455 of yacc.c */ -#line 2549 "pxr/usd/sdf/textFileFormat.yy" +#line 2536 "pxr/usd/sdf/textFileFormat.yy" { _GenericMetadataStart((yyvsp[(2) - (2)]), SdfSpecTypeAttribute, context); context->listOpType = SdfListOpTypeAdded; @@ -5334,7 +5321,7 @@ YYSTYPE yylval; case 325: /* Line 1455 of yacc.c */ -#line 2552 "pxr/usd/sdf/textFileFormat.yy" +#line 2539 "pxr/usd/sdf/textFileFormat.yy" { _GenericMetadataEnd(SdfSpecTypeAttribute, context); ;} @@ -5343,7 +5330,7 @@ YYSTYPE yylval; case 326: /* Line 1455 of yacc.c */ -#line 2555 "pxr/usd/sdf/textFileFormat.yy" +#line 2542 "pxr/usd/sdf/textFileFormat.yy" { _GenericMetadataStart((yyvsp[(2) - (2)]), SdfSpecTypeAttribute, context); context->listOpType = SdfListOpTypePrepended; @@ -5353,7 +5340,7 @@ YYSTYPE yylval; case 327: /* Line 1455 of yacc.c */ -#line 2558 "pxr/usd/sdf/textFileFormat.yy" +#line 2545 "pxr/usd/sdf/textFileFormat.yy" { _GenericMetadataEnd(SdfSpecTypeAttribute, context); ;} @@ -5362,7 +5349,7 @@ YYSTYPE yylval; case 328: /* Line 1455 of yacc.c */ -#line 2561 "pxr/usd/sdf/textFileFormat.yy" +#line 2548 "pxr/usd/sdf/textFileFormat.yy" { _GenericMetadataStart((yyvsp[(2) - (2)]), SdfSpecTypeAttribute, context); context->listOpType = SdfListOpTypeAppended; @@ -5372,7 +5359,7 @@ YYSTYPE yylval; case 329: /* Line 1455 of yacc.c */ -#line 2564 "pxr/usd/sdf/textFileFormat.yy" +#line 2551 "pxr/usd/sdf/textFileFormat.yy" { _GenericMetadataEnd(SdfSpecTypeAttribute, context); ;} @@ -5381,7 +5368,7 @@ YYSTYPE yylval; case 330: /* Line 1455 of yacc.c */ -#line 2567 "pxr/usd/sdf/textFileFormat.yy" +#line 2554 "pxr/usd/sdf/textFileFormat.yy" { _GenericMetadataStart((yyvsp[(2) - (2)]), SdfSpecTypeAttribute, context); context->listOpType = SdfListOpTypeOrdered; @@ -5391,7 +5378,7 @@ YYSTYPE yylval; case 331: /* Line 1455 of yacc.c */ -#line 2570 "pxr/usd/sdf/textFileFormat.yy" +#line 2557 "pxr/usd/sdf/textFileFormat.yy" { _GenericMetadataEnd(SdfSpecTypeAttribute, context); ;} @@ -5400,7 +5387,7 @@ YYSTYPE yylval; case 332: /* Line 1455 of yacc.c */ -#line 2575 "pxr/usd/sdf/textFileFormat.yy" +#line 2562 "pxr/usd/sdf/textFileFormat.yy" { _SetField( context->path, SdfFieldKeys->Documentation, @@ -5411,7 +5398,7 @@ YYSTYPE yylval; case 333: /* Line 1455 of yacc.c */ -#line 2582 "pxr/usd/sdf/textFileFormat.yy" +#line 2569 "pxr/usd/sdf/textFileFormat.yy" { _SetField( context->path, SdfFieldKeys->Permission, @@ -5423,7 +5410,7 @@ YYSTYPE yylval; case 334: /* Line 1455 of yacc.c */ -#line 2589 "pxr/usd/sdf/textFileFormat.yy" +#line 2576 "pxr/usd/sdf/textFileFormat.yy" { _SetField( context->path, SdfFieldKeys->DisplayUnit, @@ -5435,7 +5422,7 @@ YYSTYPE yylval; case 335: /* Line 1455 of yacc.c */ -#line 2597 "pxr/usd/sdf/textFileFormat.yy" +#line 2584 "pxr/usd/sdf/textFileFormat.yy" { _SetField( context->path, SdfFieldKeys->SymmetryFunction, @@ -5446,7 +5433,7 @@ YYSTYPE yylval; case 336: /* Line 1455 of yacc.c */ -#line 2602 "pxr/usd/sdf/textFileFormat.yy" +#line 2589 "pxr/usd/sdf/textFileFormat.yy" { _SetField( context->path, SdfFieldKeys->SymmetryFunction, @@ -5457,7 +5444,7 @@ YYSTYPE yylval; case 339: /* Line 1455 of yacc.c */ -#line 2615 "pxr/usd/sdf/textFileFormat.yy" +#line 2602 "pxr/usd/sdf/textFileFormat.yy" { _SetDefault(context->path, context->currentValue, context); ;} @@ -5466,7 +5453,7 @@ YYSTYPE yylval; case 340: /* Line 1455 of yacc.c */ -#line 2618 "pxr/usd/sdf/textFileFormat.yy" +#line 2605 "pxr/usd/sdf/textFileFormat.yy" { _SetDefault(context->path, VtValue(SdfValueBlock()), context); ;} @@ -5475,7 +5462,7 @@ YYSTYPE yylval; case 341: /* Line 1455 of yacc.c */ -#line 2628 "pxr/usd/sdf/textFileFormat.yy" +#line 2615 "pxr/usd/sdf/textFileFormat.yy" { _DictionaryBegin(context); ;} @@ -5484,7 +5471,7 @@ YYSTYPE yylval; case 342: /* Line 1455 of yacc.c */ -#line 2631 "pxr/usd/sdf/textFileFormat.yy" +#line 2618 "pxr/usd/sdf/textFileFormat.yy" { _DictionaryEnd(context); ;} @@ -5493,7 +5480,7 @@ YYSTYPE yylval; case 347: /* Line 1455 of yacc.c */ -#line 2647 "pxr/usd/sdf/textFileFormat.yy" +#line 2634 "pxr/usd/sdf/textFileFormat.yy" { _DictionaryInsertValue((yyvsp[(2) - (4)]), context); ;} @@ -5502,7 +5489,7 @@ YYSTYPE yylval; case 348: /* Line 1455 of yacc.c */ -#line 2650 "pxr/usd/sdf/textFileFormat.yy" +#line 2637 "pxr/usd/sdf/textFileFormat.yy" { _DictionaryInsertDictionary((yyvsp[(2) - (4)]), context); ;} @@ -5511,7 +5498,7 @@ YYSTYPE yylval; case 353: /* Line 1455 of yacc.c */ -#line 2668 "pxr/usd/sdf/textFileFormat.yy" +#line 2655 "pxr/usd/sdf/textFileFormat.yy" { _DictionaryInitScalarFactory((yyvsp[(1) - (1)]), context); ;} @@ -5520,7 +5507,7 @@ YYSTYPE yylval; case 354: /* Line 1455 of yacc.c */ -#line 2674 "pxr/usd/sdf/textFileFormat.yy" +#line 2661 "pxr/usd/sdf/textFileFormat.yy" { _DictionaryInitShapedFactory((yyvsp[(1) - (3)]), context); ;} @@ -5529,7 +5516,7 @@ YYSTYPE yylval; case 355: /* Line 1455 of yacc.c */ -#line 2684 "pxr/usd/sdf/textFileFormat.yy" +#line 2671 "pxr/usd/sdf/textFileFormat.yy" { _DictionaryBegin(context); ;} @@ -5538,7 +5525,7 @@ YYSTYPE yylval; case 356: /* Line 1455 of yacc.c */ -#line 2687 "pxr/usd/sdf/textFileFormat.yy" +#line 2674 "pxr/usd/sdf/textFileFormat.yy" { _DictionaryEnd(context); ;} @@ -5547,7 +5534,7 @@ YYSTYPE yylval; case 361: /* Line 1455 of yacc.c */ -#line 2703 "pxr/usd/sdf/textFileFormat.yy" +#line 2690 "pxr/usd/sdf/textFileFormat.yy" { _DictionaryInitScalarFactory(Value(std::string("string")), context); _ValueAppendAtomic((yyvsp[(3) - (3)]), context); @@ -5559,7 +5546,7 @@ YYSTYPE yylval; case 362: /* Line 1455 of yacc.c */ -#line 2716 "pxr/usd/sdf/textFileFormat.yy" +#line 2703 "pxr/usd/sdf/textFileFormat.yy" { context->currentValue = VtValue(); if (context->values.IsRecordingString()) { @@ -5571,7 +5558,7 @@ YYSTYPE yylval; case 363: /* Line 1455 of yacc.c */ -#line 2722 "pxr/usd/sdf/textFileFormat.yy" +#line 2709 "pxr/usd/sdf/textFileFormat.yy" { _ValueSetList(context); ;} @@ -5580,7 +5567,7 @@ YYSTYPE yylval; case 364: /* Line 1455 of yacc.c */ -#line 2732 "pxr/usd/sdf/textFileFormat.yy" +#line 2719 "pxr/usd/sdf/textFileFormat.yy" { context->currentValue.Swap(context->currentDictionaries[0]); context->currentDictionaries[0].clear(); @@ -5590,7 +5577,7 @@ YYSTYPE yylval; case 366: /* Line 1455 of yacc.c */ -#line 2737 "pxr/usd/sdf/textFileFormat.yy" +#line 2724 "pxr/usd/sdf/textFileFormat.yy" { // This is only here to allow 'None' metadata values for // an explicit list operation on an SdfListOp-valued field. @@ -5606,7 +5593,7 @@ YYSTYPE yylval; case 367: /* Line 1455 of yacc.c */ -#line 2750 "pxr/usd/sdf/textFileFormat.yy" +#line 2737 "pxr/usd/sdf/textFileFormat.yy" { _ValueSetAtomic(context); ;} @@ -5615,7 +5602,7 @@ YYSTYPE yylval; case 368: /* Line 1455 of yacc.c */ -#line 2753 "pxr/usd/sdf/textFileFormat.yy" +#line 2740 "pxr/usd/sdf/textFileFormat.yy" { _ValueSetTuple(context); ;} @@ -5624,7 +5611,7 @@ YYSTYPE yylval; case 369: /* Line 1455 of yacc.c */ -#line 2756 "pxr/usd/sdf/textFileFormat.yy" +#line 2743 "pxr/usd/sdf/textFileFormat.yy" { _ValueSetList(context); ;} @@ -5633,7 +5620,7 @@ YYSTYPE yylval; case 370: /* Line 1455 of yacc.c */ -#line 2759 "pxr/usd/sdf/textFileFormat.yy" +#line 2746 "pxr/usd/sdf/textFileFormat.yy" { // Set the recorded string on the ParserValueContext. Normally // 'values' is able to keep track of the parsed string, but in this @@ -5650,7 +5637,7 @@ YYSTYPE yylval; case 371: /* Line 1455 of yacc.c */ -#line 2770 "pxr/usd/sdf/textFileFormat.yy" +#line 2757 "pxr/usd/sdf/textFileFormat.yy" { _ValueSetCurrentToSdfPath((yyvsp[(1) - (1)]), context); ;} @@ -5659,7 +5646,7 @@ YYSTYPE yylval; case 372: /* Line 1455 of yacc.c */ -#line 2776 "pxr/usd/sdf/textFileFormat.yy" +#line 2763 "pxr/usd/sdf/textFileFormat.yy" { _ValueAppendAtomic((yyvsp[(1) - (1)]), context); ;} @@ -5668,7 +5655,7 @@ YYSTYPE yylval; case 373: /* Line 1455 of yacc.c */ -#line 2779 "pxr/usd/sdf/textFileFormat.yy" +#line 2766 "pxr/usd/sdf/textFileFormat.yy" { _ValueAppendAtomic((yyvsp[(1) - (1)]), context); ;} @@ -5677,7 +5664,7 @@ YYSTYPE yylval; case 374: /* Line 1455 of yacc.c */ -#line 2782 "pxr/usd/sdf/textFileFormat.yy" +#line 2769 "pxr/usd/sdf/textFileFormat.yy" { // The ParserValueContext needs identifiers to be stored as TfToken // instead of std::string to be able to distinguish between them. @@ -5688,7 +5675,7 @@ YYSTYPE yylval; case 375: /* Line 1455 of yacc.c */ -#line 2787 "pxr/usd/sdf/textFileFormat.yy" +#line 2774 "pxr/usd/sdf/textFileFormat.yy" { // The ParserValueContext needs asset paths to be stored as // SdfAssetPath instead of std::string to be able to distinguish @@ -5700,7 +5687,7 @@ YYSTYPE yylval; case 376: /* Line 1455 of yacc.c */ -#line 2800 "pxr/usd/sdf/textFileFormat.yy" +#line 2787 "pxr/usd/sdf/textFileFormat.yy" { context->values.BeginList(); ;} @@ -5709,7 +5696,7 @@ YYSTYPE yylval; case 377: /* Line 1455 of yacc.c */ -#line 2803 "pxr/usd/sdf/textFileFormat.yy" +#line 2790 "pxr/usd/sdf/textFileFormat.yy" { context->values.EndList(); ;} @@ -5718,7 +5705,7 @@ YYSTYPE yylval; case 384: /* Line 1455 of yacc.c */ -#line 2828 "pxr/usd/sdf/textFileFormat.yy" +#line 2815 "pxr/usd/sdf/textFileFormat.yy" { context->values.BeginTuple(); ;} @@ -5727,7 +5714,7 @@ YYSTYPE yylval; case 385: /* Line 1455 of yacc.c */ -#line 2830 "pxr/usd/sdf/textFileFormat.yy" +#line 2817 "pxr/usd/sdf/textFileFormat.yy" { context->values.EndTuple(); ;} @@ -5736,7 +5723,7 @@ YYSTYPE yylval; case 391: /* Line 1455 of yacc.c */ -#line 2853 "pxr/usd/sdf/textFileFormat.yy" +#line 2840 "pxr/usd/sdf/textFileFormat.yy" { context->custom = false; context->variability = VtValue(SdfVariabilityUniform); @@ -5746,7 +5733,7 @@ YYSTYPE yylval; case 392: /* Line 1455 of yacc.c */ -#line 2857 "pxr/usd/sdf/textFileFormat.yy" +#line 2844 "pxr/usd/sdf/textFileFormat.yy" { context->custom = true; context->variability = VtValue(SdfVariabilityUniform); @@ -5756,7 +5743,7 @@ YYSTYPE yylval; case 393: /* Line 1455 of yacc.c */ -#line 2861 "pxr/usd/sdf/textFileFormat.yy" +#line 2848 "pxr/usd/sdf/textFileFormat.yy" { context->custom = true; context->variability = VtValue(SdfVariabilityVarying); @@ -5766,7 +5753,7 @@ YYSTYPE yylval; case 394: /* Line 1455 of yacc.c */ -#line 2865 "pxr/usd/sdf/textFileFormat.yy" +#line 2852 "pxr/usd/sdf/textFileFormat.yy" { context->custom = false; context->variability = VtValue(SdfVariabilityVarying); @@ -5776,7 +5763,7 @@ YYSTYPE yylval; case 395: /* Line 1455 of yacc.c */ -#line 2872 "pxr/usd/sdf/textFileFormat.yy" +#line 2859 "pxr/usd/sdf/textFileFormat.yy" { _PrimInitRelationship((yyvsp[(2) - (5)]), context); ;} @@ -5785,7 +5772,7 @@ YYSTYPE yylval; case 396: /* Line 1455 of yacc.c */ -#line 2875 "pxr/usd/sdf/textFileFormat.yy" +#line 2862 "pxr/usd/sdf/textFileFormat.yy" { _SetField( context->path, SdfFieldKeys->TimeSamples, @@ -5797,7 +5784,7 @@ YYSTYPE yylval; case 397: /* Line 1455 of yacc.c */ -#line 2884 "pxr/usd/sdf/textFileFormat.yy" +#line 2871 "pxr/usd/sdf/textFileFormat.yy" { _PrimInitRelationship((yyvsp[(2) - (6)]), context); @@ -5815,7 +5802,7 @@ YYSTYPE yylval; case 398: /* Line 1455 of yacc.c */ -#line 2899 "pxr/usd/sdf/textFileFormat.yy" +#line 2886 "pxr/usd/sdf/textFileFormat.yy" { _PrimInitRelationship((yyvsp[(2) - (2)]), context); context->relParsingAllowTargetData = true; @@ -5825,7 +5812,7 @@ YYSTYPE yylval; case 399: /* Line 1455 of yacc.c */ -#line 2904 "pxr/usd/sdf/textFileFormat.yy" +#line 2891 "pxr/usd/sdf/textFileFormat.yy" { _RelationshipSetTargetsList(SdfListOpTypeExplicit, context); _PrimEndRelationship(context); @@ -5835,7 +5822,7 @@ YYSTYPE yylval; case 400: /* Line 1455 of yacc.c */ -#line 2909 "pxr/usd/sdf/textFileFormat.yy" +#line 2896 "pxr/usd/sdf/textFileFormat.yy" { _PrimInitRelationship((yyvsp[(3) - (3)]), context); ;} @@ -5844,7 +5831,7 @@ YYSTYPE yylval; case 401: /* Line 1455 of yacc.c */ -#line 2912 "pxr/usd/sdf/textFileFormat.yy" +#line 2899 "pxr/usd/sdf/textFileFormat.yy" { _RelationshipSetTargetsList(SdfListOpTypeDeleted, context); _PrimEndRelationship(context); @@ -5854,7 +5841,7 @@ YYSTYPE yylval; case 402: /* Line 1455 of yacc.c */ -#line 2917 "pxr/usd/sdf/textFileFormat.yy" +#line 2904 "pxr/usd/sdf/textFileFormat.yy" { _PrimInitRelationship((yyvsp[(3) - (3)]), context); context->relParsingAllowTargetData = true; @@ -5864,7 +5851,7 @@ YYSTYPE yylval; case 403: /* Line 1455 of yacc.c */ -#line 2921 "pxr/usd/sdf/textFileFormat.yy" +#line 2908 "pxr/usd/sdf/textFileFormat.yy" { _RelationshipSetTargetsList(SdfListOpTypeAdded, context); _PrimEndRelationship(context); @@ -5874,7 +5861,7 @@ YYSTYPE yylval; case 404: /* Line 1455 of yacc.c */ -#line 2925 "pxr/usd/sdf/textFileFormat.yy" +#line 2912 "pxr/usd/sdf/textFileFormat.yy" { _PrimInitRelationship((yyvsp[(3) - (3)]), context); context->relParsingAllowTargetData = true; @@ -5884,7 +5871,7 @@ YYSTYPE yylval; case 405: /* Line 1455 of yacc.c */ -#line 2929 "pxr/usd/sdf/textFileFormat.yy" +#line 2916 "pxr/usd/sdf/textFileFormat.yy" { _RelationshipSetTargetsList(SdfListOpTypePrepended, context); _PrimEndRelationship(context); @@ -5894,7 +5881,7 @@ YYSTYPE yylval; case 406: /* Line 1455 of yacc.c */ -#line 2933 "pxr/usd/sdf/textFileFormat.yy" +#line 2920 "pxr/usd/sdf/textFileFormat.yy" { _PrimInitRelationship((yyvsp[(3) - (3)]), context); context->relParsingAllowTargetData = true; @@ -5904,7 +5891,7 @@ YYSTYPE yylval; case 407: /* Line 1455 of yacc.c */ -#line 2937 "pxr/usd/sdf/textFileFormat.yy" +#line 2924 "pxr/usd/sdf/textFileFormat.yy" { _RelationshipSetTargetsList(SdfListOpTypeAppended, context); _PrimEndRelationship(context); @@ -5914,7 +5901,7 @@ YYSTYPE yylval; case 408: /* Line 1455 of yacc.c */ -#line 2942 "pxr/usd/sdf/textFileFormat.yy" +#line 2929 "pxr/usd/sdf/textFileFormat.yy" { _PrimInitRelationship((yyvsp[(3) - (3)]), context); ;} @@ -5923,7 +5910,7 @@ YYSTYPE yylval; case 409: /* Line 1455 of yacc.c */ -#line 2945 "pxr/usd/sdf/textFileFormat.yy" +#line 2932 "pxr/usd/sdf/textFileFormat.yy" { _RelationshipSetTargetsList(SdfListOpTypeOrdered, context); _PrimEndRelationship(context); @@ -5933,7 +5920,7 @@ YYSTYPE yylval; case 410: /* Line 1455 of yacc.c */ -#line 2950 "pxr/usd/sdf/textFileFormat.yy" +#line 2937 "pxr/usd/sdf/textFileFormat.yy" { _PrimInitRelationship((yyvsp[(2) - (5)]), context); context->relParsingAllowTargetData = true; @@ -5946,7 +5933,7 @@ YYSTYPE yylval; case 421: /* Line 1455 of yacc.c */ -#line 2979 "pxr/usd/sdf/textFileFormat.yy" +#line 2966 "pxr/usd/sdf/textFileFormat.yy" { _SetField( context->path, SdfFieldKeys->Comment, @@ -5957,7 +5944,7 @@ YYSTYPE yylval; case 422: /* Line 1455 of yacc.c */ -#line 2984 "pxr/usd/sdf/textFileFormat.yy" +#line 2971 "pxr/usd/sdf/textFileFormat.yy" { _GenericMetadataStart((yyvsp[(1) - (1)]), SdfSpecTypeRelationship, context); ;} @@ -5966,7 +5953,7 @@ YYSTYPE yylval; case 423: /* Line 1455 of yacc.c */ -#line 2986 "pxr/usd/sdf/textFileFormat.yy" +#line 2973 "pxr/usd/sdf/textFileFormat.yy" { _GenericMetadataEnd(SdfSpecTypeRelationship, context); ;} @@ -5975,7 +5962,7 @@ YYSTYPE yylval; case 424: /* Line 1455 of yacc.c */ -#line 2993 "pxr/usd/sdf/textFileFormat.yy" +#line 2980 "pxr/usd/sdf/textFileFormat.yy" { _GenericMetadataStart((yyvsp[(2) - (2)]), SdfSpecTypeRelationship, context); context->listOpType = SdfListOpTypeDeleted; @@ -5985,7 +5972,7 @@ YYSTYPE yylval; case 425: /* Line 1455 of yacc.c */ -#line 2996 "pxr/usd/sdf/textFileFormat.yy" +#line 2983 "pxr/usd/sdf/textFileFormat.yy" { _GenericMetadataEnd(SdfSpecTypeRelationship, context); ;} @@ -5994,7 +5981,7 @@ YYSTYPE yylval; case 426: /* Line 1455 of yacc.c */ -#line 2999 "pxr/usd/sdf/textFileFormat.yy" +#line 2986 "pxr/usd/sdf/textFileFormat.yy" { _GenericMetadataStart((yyvsp[(2) - (2)]), SdfSpecTypeRelationship, context); context->listOpType = SdfListOpTypeAdded; @@ -6004,7 +5991,7 @@ YYSTYPE yylval; case 427: /* Line 1455 of yacc.c */ -#line 3002 "pxr/usd/sdf/textFileFormat.yy" +#line 2989 "pxr/usd/sdf/textFileFormat.yy" { _GenericMetadataEnd(SdfSpecTypeRelationship, context); ;} @@ -6013,7 +6000,7 @@ YYSTYPE yylval; case 428: /* Line 1455 of yacc.c */ -#line 3005 "pxr/usd/sdf/textFileFormat.yy" +#line 2992 "pxr/usd/sdf/textFileFormat.yy" { _GenericMetadataStart((yyvsp[(2) - (2)]), SdfSpecTypeRelationship, context); context->listOpType = SdfListOpTypePrepended; @@ -6023,7 +6010,7 @@ YYSTYPE yylval; case 429: /* Line 1455 of yacc.c */ -#line 3008 "pxr/usd/sdf/textFileFormat.yy" +#line 2995 "pxr/usd/sdf/textFileFormat.yy" { _GenericMetadataEnd(SdfSpecTypeRelationship, context); ;} @@ -6032,7 +6019,7 @@ YYSTYPE yylval; case 430: /* Line 1455 of yacc.c */ -#line 3011 "pxr/usd/sdf/textFileFormat.yy" +#line 2998 "pxr/usd/sdf/textFileFormat.yy" { _GenericMetadataStart((yyvsp[(2) - (2)]), SdfSpecTypeRelationship, context); context->listOpType = SdfListOpTypeAppended; @@ -6042,7 +6029,7 @@ YYSTYPE yylval; case 431: /* Line 1455 of yacc.c */ -#line 3014 "pxr/usd/sdf/textFileFormat.yy" +#line 3001 "pxr/usd/sdf/textFileFormat.yy" { _GenericMetadataEnd(SdfSpecTypeRelationship, context); ;} @@ -6051,7 +6038,7 @@ YYSTYPE yylval; case 432: /* Line 1455 of yacc.c */ -#line 3017 "pxr/usd/sdf/textFileFormat.yy" +#line 3004 "pxr/usd/sdf/textFileFormat.yy" { _GenericMetadataStart((yyvsp[(2) - (2)]), SdfSpecTypeRelationship, context); context->listOpType = SdfListOpTypeOrdered; @@ -6061,7 +6048,7 @@ YYSTYPE yylval; case 433: /* Line 1455 of yacc.c */ -#line 3020 "pxr/usd/sdf/textFileFormat.yy" +#line 3007 "pxr/usd/sdf/textFileFormat.yy" { _GenericMetadataEnd(SdfSpecTypeRelationship, context); ;} @@ -6070,7 +6057,7 @@ YYSTYPE yylval; case 434: /* Line 1455 of yacc.c */ -#line 3025 "pxr/usd/sdf/textFileFormat.yy" +#line 3012 "pxr/usd/sdf/textFileFormat.yy" { _SetField( context->path, SdfFieldKeys->Documentation, @@ -6081,7 +6068,7 @@ YYSTYPE yylval; case 435: /* Line 1455 of yacc.c */ -#line 3032 "pxr/usd/sdf/textFileFormat.yy" +#line 3019 "pxr/usd/sdf/textFileFormat.yy" { _SetField( context->path, SdfFieldKeys->Permission, @@ -6093,7 +6080,7 @@ YYSTYPE yylval; case 436: /* Line 1455 of yacc.c */ -#line 3040 "pxr/usd/sdf/textFileFormat.yy" +#line 3027 "pxr/usd/sdf/textFileFormat.yy" { _SetField( context->path, SdfFieldKeys->SymmetryFunction, @@ -6104,7 +6091,7 @@ YYSTYPE yylval; case 437: /* Line 1455 of yacc.c */ -#line 3045 "pxr/usd/sdf/textFileFormat.yy" +#line 3032 "pxr/usd/sdf/textFileFormat.yy" { _SetField( context->path, SdfFieldKeys->SymmetryFunction, @@ -6115,7 +6102,7 @@ YYSTYPE yylval; case 441: /* Line 1455 of yacc.c */ -#line 3059 "pxr/usd/sdf/textFileFormat.yy" +#line 3046 "pxr/usd/sdf/textFileFormat.yy" { context->relParsingTargetPaths = SdfPathVector(); ;} @@ -6124,7 +6111,7 @@ YYSTYPE yylval; case 442: /* Line 1455 of yacc.c */ -#line 3062 "pxr/usd/sdf/textFileFormat.yy" +#line 3049 "pxr/usd/sdf/textFileFormat.yy" { context->relParsingTargetPaths = SdfPathVector(); ;} @@ -6133,7 +6120,7 @@ YYSTYPE yylval; case 446: /* Line 1455 of yacc.c */ -#line 3074 "pxr/usd/sdf/textFileFormat.yy" +#line 3061 "pxr/usd/sdf/textFileFormat.yy" { _RelationshipAppendTargetPath((yyvsp[(1) - (1)]), context); ;} @@ -6142,7 +6129,7 @@ YYSTYPE yylval; case 447: /* Line 1455 of yacc.c */ -#line 3084 "pxr/usd/sdf/textFileFormat.yy" +#line 3071 "pxr/usd/sdf/textFileFormat.yy" { context->savedPath = SdfPath(); ;} @@ -6151,7 +6138,7 @@ YYSTYPE yylval; case 449: /* Line 1455 of yacc.c */ -#line 3091 "pxr/usd/sdf/textFileFormat.yy" +#line 3078 "pxr/usd/sdf/textFileFormat.yy" { _PathSetPrim((yyvsp[(1) - (1)]), context); ;} @@ -6160,7 +6147,7 @@ YYSTYPE yylval; case 450: /* Line 1455 of yacc.c */ -#line 3097 "pxr/usd/sdf/textFileFormat.yy" +#line 3084 "pxr/usd/sdf/textFileFormat.yy" { _PathSetPrimOrPropertyScenePath((yyvsp[(1) - (1)]), context); ;} @@ -6169,14 +6156,14 @@ YYSTYPE yylval; case 459: /* Line 1455 of yacc.c */ -#line 3129 "pxr/usd/sdf/textFileFormat.yy" +#line 3116 "pxr/usd/sdf/textFileFormat.yy" { (yyval) = (yyvsp[(1) - (1)]); ;} break; /* Line 1455 of yacc.c */ -#line 6157 "pxr/usd/sdf/textFileFormat.tab.cpp" +#line 6161 "pxr/usd/sdf/textFileFormat.tab.cpp" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); @@ -6388,7 +6375,7 @@ YYSTYPE yylval; /* Line 1675 of yacc.c */ -#line 3161 "pxr/usd/sdf/textFileFormat.yy" +#line 3148 "pxr/usd/sdf/textFileFormat.yy" //-------------------------------------------------------------------- @@ -6560,8 +6547,8 @@ Sdf_ParseLayer( TRACE_SCOPE("textFileFormatYyParse"); status = textFileFormatYyparse(&context); *hints = context.layerHints; - } catch (boost::bad_get const &) { - TF_CODING_ERROR("Bad boost:get() in layer parser."); + } catch (std::bad_variant_access const &) { + TF_CODING_ERROR("Bad variant access in layer parser."); Err(&context, "Internal layer parser error."); } } @@ -6610,8 +6597,8 @@ Sdf_ParseLayerFromString( TRACE_SCOPE("textFileFormatYyParse"); status = textFileFormatYyparse(&context); *hints = context.layerHints; - } catch (boost::bad_get const &) { - TF_CODING_ERROR("Bad boost:get() in layer parser."); + } catch (std::bad_variant_access const &) { + TF_CODING_ERROR("Bad variant access in layer parser."); Err(&context, "Internal layer parser error."); } diff --git a/pxr/usd/sdf/textFileFormat.tab.h b/pxr/usd/sdf/textFileFormat.tab.h index 483afff046..76b5f29426 100644 --- a/pxr/usd/sdf/textFileFormat.tab.h +++ b/pxr/usd/sdf/textFileFormat.tab.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // /* A Bison parser, made by GNU Bison 2.4.1. */ diff --git a/pxr/usd/sdf/textFileFormat.yy b/pxr/usd/sdf/textFileFormat.yy index 0897851536..135e12cec0 100644 --- a/pxr/usd/sdf/textFileFormat.yy +++ b/pxr/usd/sdf/textFileFormat.yy @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // %{ @@ -53,9 +36,6 @@ #include "pxr/base/gf/matrix4d.h" #include "pxr/base/tf/mallocTag.h" -#include -#include - #include #include #include @@ -68,7 +48,6 @@ PXR_NAMESPACE_USING_DIRECTIVE using Sdf_ParserHelpers::Value; -using boost::get; //-------------------------------------------------------------------- // Helper macros/functions for handling errors @@ -593,32 +572,40 @@ _RelocatesAdd(const Value& arg1, const Value& arg2, Sdf_TextParserContext *context) { const std::string& srcStr = arg1.Get(); - const std::string& targetStr = arg2.Get(); - SdfPath srcPath(srcStr); - SdfPath targetPath(targetStr); - if (!SdfSchema::IsValidRelocatesPath(srcPath)) { + if (!SdfSchema::IsValidRelocatesSourcePath(srcPath)) { Err(context, "'%s' is not a valid relocates path", srcStr.c_str()); return; } - if (!SdfSchema::IsValidRelocatesPath(targetPath)) { - Err(context, "'%s' is not a valid relocates path", - targetStr.c_str()); - return; - } - // The relocates map is expected to only hold absolute paths. The - // SdRelocatesMapProxy ensures that all paths are made absolute when - // editing, but since we're bypassing that proxy and setting the map - // directly into the underlying SdfData, we need to explicitly absolutize - // paths here. + // The relocates map is expected to only hold absolute paths. srcPath = srcPath.MakeAbsolutePath(context->path); - targetPath = targetPath.MakeAbsolutePath(context->path); - context->relocatesParsing.emplace_back( - std::move(srcPath), std::move(targetPath)); + const std::string& targetStr = arg2.Get(); + if (targetStr.empty()) { + context->relocatesParsing.emplace_back( + std::move(srcPath), SdfPath()); + } else { + SdfPath targetPath(targetStr); + + // Target paths can be empty but the string must be explicitly empty + // which we would've caught in the if statement. An empty path here + // indicates a malformed path which is never valid. + if (targetPath.IsEmpty() || + !SdfSchema::IsValidRelocatesTargetPath(targetPath)) { + Err(context, "'%s' is not a valid relocates path", + targetStr.c_str()); + return; + } + + // The relocates map is expected to only hold absolute paths. + targetPath = targetPath.MakeAbsolutePath(context->path); + + context->relocatesParsing.emplace_back( + std::move(srcPath), std::move(targetPath)); + } context->layerHints.mightHaveRelocates = true; } @@ -3329,8 +3316,8 @@ Sdf_ParseLayer( TRACE_SCOPE("textFileFormatYyParse"); status = textFileFormatYyparse(&context); *hints = context.layerHints; - } catch (boost::bad_get const &) { - TF_CODING_ERROR("Bad boost:get() in layer parser."); + } catch (std::bad_variant_access const &) { + TF_CODING_ERROR("Bad variant access in layer parser."); Err(&context, "Internal layer parser error."); } } @@ -3379,8 +3366,8 @@ Sdf_ParseLayerFromString( TRACE_SCOPE("textFileFormatYyParse"); status = textFileFormatYyparse(&context); *hints = context.layerHints; - } catch (boost::bad_get const &) { - TF_CODING_ERROR("Bad boost:get() in layer parser."); + } catch (std::bad_variant_access const &) { + TF_CODING_ERROR("Bad variant access in layer parser."); Err(&context, "Internal layer parser error."); } diff --git a/pxr/usd/sdf/textParserContext.cpp b/pxr/usd/sdf/textParserContext.cpp index 910af207e8..008ed724ba 100644 --- a/pxr/usd/sdf/textParserContext.cpp +++ b/pxr/usd/sdf/textParserContext.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/sdf/textParserContext.h b/pxr/usd/sdf/textParserContext.h index 7ecedd4db9..bffd14fa65 100644 --- a/pxr/usd/sdf/textParserContext.h +++ b/pxr/usd/sdf/textParserContext.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDF_TEXT_PARSER_CONTEXT_H #define PXR_USD_SDF_TEXT_PARSER_CONTEXT_H @@ -83,7 +66,7 @@ class Sdf_TextParserContext { // have data like relational attributes. bool relParsingAllowTargetData; // relationship target paths that will be saved in a list op - // (use a boost::optional to track whether we have seen an opinion at all.) + // (use a std::optional to track whether we have seen an opinion at all.) std::optional relParsingTargetPaths; // relationship target paths that will be appended to the relationship's // list of target children. diff --git a/pxr/usd/sdf/textParserHelpers.cpp b/pxr/usd/sdf/textParserHelpers.cpp index a29aa5256c..493a6e3898 100644 --- a/pxr/usd/sdf/textParserHelpers.cpp +++ b/pxr/usd/sdf/textParserHelpers.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/sdf/textParserHelpers.h" @@ -353,32 +336,41 @@ _RelocatesAdd(const Sdf_ParserHelpers::Value& arg1, const Sdf_ParserHelpers::Val Sdf_TextParserContext *context) { const std::string& srcStr = arg1.Get(); - const std::string& targetStr = arg2.Get(); - SdfPath srcPath(srcStr); - SdfPath targetPath(targetStr); - if (!SdfSchema::IsValidRelocatesPath(srcPath)) { + if (!SdfSchema::IsValidRelocatesSourcePath(srcPath)) { SDF_TEXTFILEFORMATPARSER_ERR(context, "'%s' is not a valid relocates path", srcStr.c_str()); return; } - if (!SdfSchema::IsValidRelocatesPath(targetPath)) { - SDF_TEXTFILEFORMATPARSER_ERR(context, "'%s' is not a valid relocates path", - targetStr.c_str()); - return; - } - // The relocates map is expected to only hold absolute paths. The - // SdRelocatesMapProxy ensures that all paths are made absolute when - // editing, but since we're bypassing that proxy and setting the map - // directly into the underlying SdfData, we need to explicitly absolutize - // paths here. + // The relocates map is expected to only hold absolute paths. srcPath = srcPath.MakeAbsolutePath(context->path); - targetPath = targetPath.MakeAbsolutePath(context->path); - context->relocatesParsing.emplace_back( - std::move(srcPath), std::move(targetPath)); + const std::string& targetStr = arg2.Get(); + + if (targetStr.empty()) { + context->relocatesParsing.emplace_back( + std::move(srcPath), SdfPath()); + } else { + SdfPath targetPath(targetStr); + + // Target paths can be empty but the string must be explicitly empty + // which we would've caught in the if statement. An empty path here + // indicates a malformed path which is never valid. + if (targetPath.IsEmpty() || + !SdfSchema::IsValidRelocatesTargetPath(targetPath)) { + SDF_TEXTFILEFORMATPARSER_ERR(context, "'%s' is not a valid " + "relocates path", targetStr.c_str()); + return; + } + + // The relocates map is expected to only hold absolute paths. + targetPath = targetPath.MakeAbsolutePath(context->path); + + context->relocatesParsing.emplace_back( + std::move(srcPath), std::move(targetPath)); + } context->layerHints.mightHaveRelocates = true; } diff --git a/pxr/usd/sdf/textParserHelpers.h b/pxr/usd/sdf/textParserHelpers.h index 8331c5f047..5ff9bacc7f 100644 --- a/pxr/usd/sdf/textParserHelpers.h +++ b/pxr/usd/sdf/textParserHelpers.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDF_TEXT_PARSER_HELPERS_H diff --git a/pxr/usd/sdf/timeCode.cpp b/pxr/usd/sdf/timeCode.cpp index 2f14d7a2c5..53d618d4b9 100644 --- a/pxr/usd/sdf/timeCode.cpp +++ b/pxr/usd/sdf/timeCode.cpp @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/sdf/timeCode.h" diff --git a/pxr/usd/sdf/timeCode.h b/pxr/usd/sdf/timeCode.h index f4a605f3fc..33c41ab3a6 100644 --- a/pxr/usd/sdf/timeCode.h +++ b/pxr/usd/sdf/timeCode.h @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDF_TIME_CODE_H #define PXR_USD_SDF_TIME_CODE_H diff --git a/pxr/usd/sdf/tokens.cpp b/pxr/usd/sdf/tokens.cpp index dea19b065c..16c64aa16c 100644 --- a/pxr/usd/sdf/tokens.cpp +++ b/pxr/usd/sdf/tokens.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/sdf/tokens.h b/pxr/usd/sdf/tokens.h index 60fc1b5ca3..3709ecf6f6 100644 --- a/pxr/usd/sdf/tokens.h +++ b/pxr/usd/sdf/tokens.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDF_TOKENS_H #define PXR_USD_SDF_TOKENS_H diff --git a/pxr/usd/sdf/types.cpp b/pxr/usd/sdf/types.cpp index 24c50f1052..712245fd5a 100644 --- a/pxr/usd/sdf/types.cpp +++ b/pxr/usd/sdf/types.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // // Types.cpp diff --git a/pxr/usd/sdf/types.h b/pxr/usd/sdf/types.h index a908a798cb..0218c23abd 100644 --- a/pxr/usd/sdf/types.h +++ b/pxr/usd/sdf/types.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDF_TYPES_H #define PXR_USD_SDF_TYPES_H diff --git a/pxr/usd/sdf/valueTypeName.cpp b/pxr/usd/sdf/valueTypeName.cpp index 28dfefc4b1..5b804ef36b 100644 --- a/pxr/usd/sdf/valueTypeName.cpp +++ b/pxr/usd/sdf/valueTypeName.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/sdf/valueTypeName.h b/pxr/usd/sdf/valueTypeName.h index fbb173aebd..20dcbf02f5 100644 --- a/pxr/usd/sdf/valueTypeName.h +++ b/pxr/usd/sdf/valueTypeName.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDF_VALUE_TYPE_NAME_H #define PXR_USD_SDF_VALUE_TYPE_NAME_H diff --git a/pxr/usd/sdf/valueTypePrivate.h b/pxr/usd/sdf/valueTypePrivate.h index bffb343341..466facb4aa 100644 --- a/pxr/usd/sdf/valueTypePrivate.h +++ b/pxr/usd/sdf/valueTypePrivate.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDF_VALUE_TYPE_PRIVATE_H #define PXR_USD_SDF_VALUE_TYPE_PRIVATE_H diff --git a/pxr/usd/sdf/valueTypeRegistry.cpp b/pxr/usd/sdf/valueTypeRegistry.cpp index cdb58cb20e..6ca2d80f0f 100644 --- a/pxr/usd/sdf/valueTypeRegistry.cpp +++ b/pxr/usd/sdf/valueTypeRegistry.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/sdf/valueTypeRegistry.h b/pxr/usd/sdf/valueTypeRegistry.h index da9da4d420..54a3037f40 100644 --- a/pxr/usd/sdf/valueTypeRegistry.h +++ b/pxr/usd/sdf/valueTypeRegistry.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDF_VALUE_TYPE_REGISTRY_H #define PXR_USD_SDF_VALUE_TYPE_REGISTRY_H diff --git a/pxr/usd/sdf/variableExpression.cpp b/pxr/usd/sdf/variableExpression.cpp index d0cd77f9e7..8ff5afbb12 100644 --- a/pxr/usd/sdf/variableExpression.cpp +++ b/pxr/usd/sdf/variableExpression.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/sdf/variableExpression.h" diff --git a/pxr/usd/sdf/variableExpression.h b/pxr/usd/sdf/variableExpression.h index 356438edfd..533c3f5812 100644 --- a/pxr/usd/sdf/variableExpression.h +++ b/pxr/usd/sdf/variableExpression.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDF_VARIABLE_EXPRESSION #define PXR_USD_SDF_VARIABLE_EXPRESSION diff --git a/pxr/usd/sdf/variableExpressionImpl.cpp b/pxr/usd/sdf/variableExpressionImpl.cpp index 82deafbb10..d7e9e40b7a 100644 --- a/pxr/usd/sdf/variableExpressionImpl.cpp +++ b/pxr/usd/sdf/variableExpressionImpl.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/sdf/variableExpressionImpl.h" diff --git a/pxr/usd/sdf/variableExpressionImpl.h b/pxr/usd/sdf/variableExpressionImpl.h index bae112b5a8..0c4a258e7f 100644 --- a/pxr/usd/sdf/variableExpressionImpl.h +++ b/pxr/usd/sdf/variableExpressionImpl.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDF_VARIABLE_EXPRESSION_IMPL_H #define PXR_USD_SDF_VARIABLE_EXPRESSION_IMPL_H diff --git a/pxr/usd/sdf/variableExpressionParser.cpp b/pxr/usd/sdf/variableExpressionParser.cpp index 1be031b382..11fa8f96a8 100644 --- a/pxr/usd/sdf/variableExpressionParser.cpp +++ b/pxr/usd/sdf/variableExpressionParser.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/sdf/variableExpressionParser.h" @@ -27,12 +10,13 @@ #include "pxr/usd/sdf/debugCodes.h" #include "pxr/usd/sdf/variableExpressionImpl.h" -#include "pxr/base/tf/pxrPEGTL/pegtl.h" +#include "pxr/base/pegtl/pegtl.hpp" +#include "pxr/base/pegtl/pegtl/contrib/trace.hpp" #include "pxr/base/tf/stringUtils.h" #include -using namespace tao::TAO_PEGTL_NAMESPACE; +using namespace PXR_PEGTL_NAMESPACE; PXR_NAMESPACE_OPEN_SCOPE @@ -305,6 +289,7 @@ class ParserContext // Parser utilities ----------------------------------------------- template +[[noreturn]] void _ThrowParseError(const Input& in, const std::string& msg) { // XXX: @@ -316,8 +301,7 @@ void _ThrowParseError(const Input& in, const std::string& msg) // pegtl 3.x adds API to parse_error to decompose the error message, // so we could use that later. - // throw parse_error(errorMsg, in); - throw parse_error(msg, std::vector{ in.position() }); + throw parse_error(msg, in); } // Parser grammar ----------------------------------------------- @@ -444,15 +428,15 @@ struct Integer // for users working in those languages while writing expressions. struct BooleanTrue : sor< - TAO_PEGTL_KEYWORD("True"), - TAO_PEGTL_KEYWORD("true") + PXR_PEGTL_KEYWORD("True"), + PXR_PEGTL_KEYWORD("true") > {}; struct BooleanFalse : sor< - TAO_PEGTL_KEYWORD("False"), - TAO_PEGTL_KEYWORD("false") + PXR_PEGTL_KEYWORD("False"), + PXR_PEGTL_KEYWORD("false") > {}; @@ -467,8 +451,8 @@ struct Boolean struct None : sor< - TAO_PEGTL_KEYWORD("None"), - TAO_PEGTL_KEYWORD("none") + PXR_PEGTL_KEYWORD("None"), + PXR_PEGTL_KEYWORD("none") > {}; @@ -761,7 +745,7 @@ struct Errors static const std::string errorMsg; template - static void raise(const Input& in, States&&...) + [[noreturn]] static void raise(const Input& in, States&&...) { _ThrowParseError(in, errorMsg); } @@ -797,7 +781,7 @@ MATCH_ERROR(SingleQuotedString::End, R"(Missing ending "'")"); Sdf_VariableExpressionParserResult Sdf_ParseVariableExpression(const std::string& expr) { - namespace pegtl = tao::TAO_PEGTL_NAMESPACE; + namespace pegtl = PXR_PEGTL_NAMESPACE; ParserContext context; @@ -806,8 +790,7 @@ Sdf_ParseVariableExpression(const std::string& expr) try { const bool parseSuccess = TfDebug::IsEnabled(SDF_VARIABLE_EXPRESSION_PARSING) ? - pegtl::parse::control>(in, context) : + pegtl::standard_trace(in, context) : pegtl::parse(in, context); if (!parseSuccess) { @@ -820,10 +803,10 @@ Sdf_ParseVariableExpression(const std::string& expr) // XXX: "at character" is probably incorrect if the expression // contains Unicode strings? - { TfStringPrintf("%s at character %zu", - e.what(), - e.positions.empty() ? - expr.size() : e.positions.front().byte_in_line) } + { TfStringPrintf("%s at character %zu", + std::string(e.message()).c_str(), + e.positions().empty() + ? expr.size() : e.positions().front().column-1) } }; } diff --git a/pxr/usd/sdf/variableExpressionParser.h b/pxr/usd/sdf/variableExpressionParser.h index 2d102a4567..77b387fca6 100644 --- a/pxr/usd/sdf/variableExpressionParser.h +++ b/pxr/usd/sdf/variableExpressionParser.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDF_VARIABLE_EXPRESSION_PARSER_H #define PXR_USD_SDF_VARIABLE_EXPRESSION_PARSER_H diff --git a/pxr/usd/sdf/variantSetSpec.cpp b/pxr/usd/sdf/variantSetSpec.cpp index 5d17c2a7cf..a8ea3a485e 100644 --- a/pxr/usd/sdf/variantSetSpec.cpp +++ b/pxr/usd/sdf/variantSetSpec.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // /// \file VariantSetSpec.cpp diff --git a/pxr/usd/sdf/variantSetSpec.h b/pxr/usd/sdf/variantSetSpec.h index 06be842d2f..32f017bc18 100644 --- a/pxr/usd/sdf/variantSetSpec.h +++ b/pxr/usd/sdf/variantSetSpec.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDF_VARIANT_SET_SPEC_H #define PXR_USD_SDF_VARIANT_SET_SPEC_H diff --git a/pxr/usd/sdf/variantSpec.cpp b/pxr/usd/sdf/variantSpec.cpp index 32b7843888..55fe538c43 100644 --- a/pxr/usd/sdf/variantSpec.cpp +++ b/pxr/usd/sdf/variantSpec.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // /// \file VariantSpec.cpp diff --git a/pxr/usd/sdf/variantSpec.h b/pxr/usd/sdf/variantSpec.h index c3eb620fb7..87e5be412d 100644 --- a/pxr/usd/sdf/variantSpec.h +++ b/pxr/usd/sdf/variantSpec.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDF_VARIANT_SPEC_H #define PXR_USD_SDF_VARIANT_SPEC_H diff --git a/pxr/usd/sdf/vectorListEditor.cpp b/pxr/usd/sdf/vectorListEditor.cpp index 7ef77f3148..ab8222131f 100644 --- a/pxr/usd/sdf/vectorListEditor.cpp +++ b/pxr/usd/sdf/vectorListEditor.cpp @@ -1,24 +1,7 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/sdf/vectorListEditor.h" diff --git a/pxr/usd/sdf/vectorListEditor.h b/pxr/usd/sdf/vectorListEditor.h index 012b08193e..2403175b00 100644 --- a/pxr/usd/sdf/vectorListEditor.h +++ b/pxr/usd/sdf/vectorListEditor.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDF_VECTOR_LIST_EDITOR_H #define PXR_USD_SDF_VECTOR_LIST_EDITOR_H diff --git a/pxr/usd/sdf/wrapArrayAssetPath.cpp b/pxr/usd/sdf/wrapArrayAssetPath.cpp index 65af3d2537..a73602f820 100644 --- a/pxr/usd/sdf/wrapArrayAssetPath.cpp +++ b/pxr/usd/sdf/wrapArrayAssetPath.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/sdf/assetPath.h" diff --git a/pxr/usd/sdf/wrapArrayPath.cpp b/pxr/usd/sdf/wrapArrayPath.cpp index 289aa92572..91b19804fe 100644 --- a/pxr/usd/sdf/wrapArrayPath.cpp +++ b/pxr/usd/sdf/wrapArrayPath.cpp @@ -1,25 +1,8 @@ // // Copyright 2020 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/sdf/path.h" diff --git a/pxr/usd/sdf/wrapArrayTimeCode.cpp b/pxr/usd/sdf/wrapArrayTimeCode.cpp index 7785d1f47f..85a38cf75d 100644 --- a/pxr/usd/sdf/wrapArrayTimeCode.cpp +++ b/pxr/usd/sdf/wrapArrayTimeCode.cpp @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/sdf/timeCode.h" diff --git a/pxr/usd/sdf/wrapAssetPath.cpp b/pxr/usd/sdf/wrapAssetPath.cpp index 02c7df7ce2..e0223f11a4 100644 --- a/pxr/usd/sdf/wrapAssetPath.cpp +++ b/pxr/usd/sdf/wrapAssetPath.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/sdf/assetPath.h" diff --git a/pxr/usd/sdf/wrapAttributeSpec.cpp b/pxr/usd/sdf/wrapAttributeSpec.cpp index a03a518321..1da39df9d5 100644 --- a/pxr/usd/sdf/wrapAttributeSpec.cpp +++ b/pxr/usd/sdf/wrapAttributeSpec.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // /// \file wrapAttributeSpec.cpp diff --git a/pxr/usd/sdf/wrapChangeBlock.cpp b/pxr/usd/sdf/wrapChangeBlock.cpp index 1d86a7aab5..1a23a6c3af 100644 --- a/pxr/usd/sdf/wrapChangeBlock.cpp +++ b/pxr/usd/sdf/wrapChangeBlock.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/sdf/changeBlock.h" diff --git a/pxr/usd/sdf/wrapCleanupEnabler.cpp b/pxr/usd/sdf/wrapCleanupEnabler.cpp index d95b80c67c..b576b8e453 100644 --- a/pxr/usd/sdf/wrapCleanupEnabler.cpp +++ b/pxr/usd/sdf/wrapCleanupEnabler.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/sdf/wrapCopyUtils.cpp b/pxr/usd/sdf/wrapCopyUtils.cpp index 98f85f8c96..428508f5f7 100644 --- a/pxr/usd/sdf/wrapCopyUtils.cpp +++ b/pxr/usd/sdf/wrapCopyUtils.cpp @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include #include diff --git a/pxr/usd/sdf/wrapFileFormat.cpp b/pxr/usd/sdf/wrapFileFormat.cpp index 0aaf060c67..6e368335c3 100644 --- a/pxr/usd/sdf/wrapFileFormat.cpp +++ b/pxr/usd/sdf/wrapFileFormat.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // /// /// \file Sdf/wrapFileFormat.cpp diff --git a/pxr/usd/sdf/wrapLayer.cpp b/pxr/usd/sdf/wrapLayer.cpp index fa8f95942c..bf071794ff 100644 --- a/pxr/usd/sdf/wrapLayer.cpp +++ b/pxr/usd/sdf/wrapLayer.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // /// \file wrapLayer.cpp @@ -732,6 +715,8 @@ void wrapLayer() &This::GetDefaultPrim, &This::SetDefaultPrim, "The layer's default reference target token.") + .def("GetDefaultPrimAsPath", + &This::GetDefaultPrimAsPath) .def("HasDefaultPrim", &This::HasDefaultPrim) .def("ClearDefaultPrim", diff --git a/pxr/usd/sdf/wrapLayerOffset.cpp b/pxr/usd/sdf/wrapLayerOffset.cpp index aaba976f6d..a5990e2e63 100644 --- a/pxr/usd/sdf/wrapLayerOffset.cpp +++ b/pxr/usd/sdf/wrapLayerOffset.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/sdf/wrapLayerTree.cpp b/pxr/usd/sdf/wrapLayerTree.cpp index 09a5ea127f..b05dc4227b 100644 --- a/pxr/usd/sdf/wrapLayerTree.cpp +++ b/pxr/usd/sdf/wrapLayerTree.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/sdf/wrapNamespaceEdit.cpp b/pxr/usd/sdf/wrapNamespaceEdit.cpp index 2eab495914..d2bf0eecc8 100644 --- a/pxr/usd/sdf/wrapNamespaceEdit.cpp +++ b/pxr/usd/sdf/wrapNamespaceEdit.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // /// \file wrapNamespaceEdit.cpp diff --git a/pxr/usd/sdf/wrapNotice.cpp b/pxr/usd/sdf/wrapNotice.cpp index 40a48e8123..e915bea072 100644 --- a/pxr/usd/sdf/wrapNotice.cpp +++ b/pxr/usd/sdf/wrapNotice.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // /// /// \file Sdf/wrapNotice.cpp diff --git a/pxr/usd/sdf/wrapOpaqueValue.cpp b/pxr/usd/sdf/wrapOpaqueValue.cpp index 01948baefa..5e0be91ed9 100644 --- a/pxr/usd/sdf/wrapOpaqueValue.cpp +++ b/pxr/usd/sdf/wrapOpaqueValue.cpp @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/sdf/opaqueValue.h" diff --git a/pxr/usd/sdf/wrapPath.cpp b/pxr/usd/sdf/wrapPath.cpp index 1b0f873300..e715cd0959 100644 --- a/pxr/usd/sdf/wrapPath.cpp +++ b/pxr/usd/sdf/wrapPath.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/sdf/wrapPathExpression.cpp b/pxr/usd/sdf/wrapPathExpression.cpp index 1fbead4a0b..aad0155034 100644 --- a/pxr/usd/sdf/wrapPathExpression.cpp +++ b/pxr/usd/sdf/wrapPathExpression.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" @@ -29,6 +12,7 @@ #include "pxr/base/vt/valueFromPython.h" #include "pxr/base/tf/pyEnum.h" #include "pxr/base/tf/pyFunction.h" +#include "pxr/base/tf/pyUtils.h" #include "pxr/usd/sdf/pathExpression.h" #include "pxr/usd/sdf/pathExpressionEval.h" @@ -42,9 +26,6 @@ #include using namespace boost::python; -using std::pair; -using std::string; -using std::vector; PXR_NAMESPACE_USING_DIRECTIVE @@ -63,17 +44,6 @@ _Repr(SdfPathExpression const &self) { } } -static std::string -_PatternRepr(SdfPathExpression::PathPattern const &self) { - if (!self) { - return TF_PY_REPR_PREFIX + "PathExpression.PathPattern()"; - } - else { - return std::string(TF_PY_REPR_PREFIX + "PathExpression.PathPattern(") - + TfPyRepr(self.GetText()) + ")"; - } -} - namespace { struct _PathIdentity { @@ -164,6 +134,10 @@ void wrapPathExpression() }, (arg("op"), arg("left"), arg("right"))) .staticmethod("MakeOp") + .def("MakeAtom", + +[](SdfPath const &path) { + return PathExpr::MakeAtom(path); + }, arg("path")) .def("MakeAtom", +[](PathExpr::ExpressionReference const &ref) { return PathExpr::MakeAtom(ref); @@ -229,34 +203,8 @@ void wrapPathExpression() TfPyWrapEnum(); - class_("PathPattern") - .def("AppendChild", - +[](PathPattern &self, std::string text, - SdfPredicateExpression const &predExpr) { - self.AppendChild(text, predExpr); - }, (arg("text"), arg("predExpr")=SdfPredicateExpression())) - .def("AppendProperty", - +[](PathPattern &self, std::string text, - SdfPredicateExpression const &predExpr) { - self.AppendProperty(text, predExpr); - }, (arg("text"), arg("predExpr")=SdfPredicateExpression())) - .def("GetPrefix", - +[](PathPattern const &self) { - return self.GetPrefix(); - }, return_value_policy()) - .def("SetPrefix", - +[](PathPattern &self, SdfPath const &prefix) { - self.SetPrefix(prefix); - }, (arg("prefix"))) - .def("GetText", &PathPattern::GetText) - .def("__bool__", &PathPattern::operator bool) - .def("__repr__", &_PatternRepr) - .def("__hash__", +[](PathPattern const &p) { return TfHash{}(p); }) - .def(self == self) - .def(self != self) - ; - VtValueFromPython(); - + s.attr("PathPattern") = TfPyGetClassObject(); + class_("ExpressionReference") .def_readwrite("path", &ExpressionReference::path) .def_readwrite("name", &ExpressionReference::name) diff --git a/pxr/usd/sdf/wrapPathPattern.cpp b/pxr/usd/sdf/wrapPathPattern.cpp new file mode 100644 index 0000000000..ef814e60a3 --- /dev/null +++ b/pxr/usd/sdf/wrapPathPattern.cpp @@ -0,0 +1,126 @@ +// +// Copyright 2023 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// + +#include "pxr/pxr.h" + +#include "pxr/base/tf/pySignatureExt.h" // wrap lvalue-ref-qualified mem fns. + +#include "pxr/base/vt/valueFromPython.h" +#include "pxr/base/tf/pyAnnotatedBoolResult.h" +#include "pxr/base/tf/pyEnum.h" +#include "pxr/base/tf/pyFunction.h" + +#include "pxr/usd/sdf/pathPattern.h" + +#include +#include +#include +#include + +#include +#include + +using namespace boost::python; + +PXR_NAMESPACE_USING_DIRECTIVE + +static std::string +_Repr(SdfPathPattern const &self) { + if (!self) { + return TF_PY_REPR_PREFIX + "PathPattern()"; + } + else { + return std::string(TF_PY_REPR_PREFIX + "PathPattern(") + + TfPyRepr(self.GetText()) + ")"; + } +} + +struct Sdf_PathPatternCanAppendResult + : public TfPyAnnotatedBoolResult +{ + Sdf_PathPatternCanAppendResult(bool val, std::string const &msg) : + TfPyAnnotatedBoolResult(val, msg) {} +}; + +static +Sdf_PathPatternCanAppendResult +_CanAppendChild(SdfPathPattern const &self, std::string const &text) +{ + std::string errMsg; + bool valid = self.CanAppendChild(text, &errMsg); + return Sdf_PathPatternCanAppendResult(valid, errMsg); +} + +static +Sdf_PathPatternCanAppendResult +_CanAppendProperty(SdfPathPattern const &self, std::string const &text) +{ + std::string errMsg; + bool valid = self.CanAppendProperty(text, &errMsg); + return Sdf_PathPatternCanAppendResult(valid, errMsg); +} + +void wrapPathPattern() +{ + class_("PathPattern") + .def(init(arg("prefix"))) + .def("Everything", SdfPathPattern::Everything, + return_value_policy()) + .staticmethod("Everything") + .def("EveryDescendant", SdfPathPattern::EveryDescendant, + return_value_policy()) + .staticmethod("EveryDescendant") + .def("Nothing", SdfPathPattern::Nothing, + return_value_policy()) + .staticmethod("Nothing") + .def("CanAppendChild", _CanAppendChild, arg("text")) + .def("AppendChild", + +[](SdfPathPattern &self, std::string text, + SdfPredicateExpression const &predExpr) { + self.AppendChild(text, predExpr); + }, (arg("text"), arg("predExpr")=SdfPredicateExpression()), + return_self<>()) + .def("CanAppendProperty", _CanAppendProperty, arg("text")) + .def("AppendProperty", + +[](SdfPathPattern &self, std::string text, + SdfPredicateExpression const &predExpr) { + self.AppendProperty(text, predExpr); + }, (arg("text"), arg("predExpr")=SdfPredicateExpression()), + return_self<>()) + .def("GetPrefix", + +[](SdfPathPattern const &self) { + return self.GetPrefix(); + }, return_value_policy()) + .def("SetPrefix", + +[](SdfPathPattern &self, SdfPath const &prefix) { + self.SetPrefix(prefix); + }, (arg("prefix")), return_self<>()) + .def("HasLeadingStretch", &SdfPathPattern::HasLeadingStretch) + .def("HasTrailingStretch", &SdfPathPattern::HasTrailingStretch) + .def("AppendStretchIfPossible", + &SdfPathPattern::AppendStretchIfPossible, + return_self<>()) + .def("RemoveTrailingStretch", + &SdfPathPattern::RemoveTrailingStretch, + return_self<>()) + .def("RemoveTrailingComponent", + &SdfPathPattern::RemoveTrailingComponent, + return_self<>()) + .def("GetText", &SdfPathPattern::GetText) + .def("IsProperty", &SdfPathPattern::IsProperty) + .def("__bool__", &SdfPathPattern::operator bool) + .def("__repr__", &_Repr) + .def("__hash__", +[](SdfPathPattern const &p) { return TfHash{}(p); }) + .def(self == self) + .def(self != self) + ; + VtValueFromPython(); + + Sdf_PathPatternCanAppendResult:: + Wrap("_PathPatternCanAppendResult", + "reason"); +} diff --git a/pxr/usd/sdf/wrapPayload.cpp b/pxr/usd/sdf/wrapPayload.cpp index f886141c99..8254a49a87 100644 --- a/pxr/usd/sdf/wrapPayload.cpp +++ b/pxr/usd/sdf/wrapPayload.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/sdf/wrapPredicateExpression.cpp b/pxr/usd/sdf/wrapPredicateExpression.cpp index c3e95e8515..07779dae9d 100644 --- a/pxr/usd/sdf/wrapPredicateExpression.cpp +++ b/pxr/usd/sdf/wrapPredicateExpression.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/sdf/wrapPredicateFunctionResult.cpp b/pxr/usd/sdf/wrapPredicateFunctionResult.cpp index b54cea9625..ec14304928 100644 --- a/pxr/usd/sdf/wrapPredicateFunctionResult.cpp +++ b/pxr/usd/sdf/wrapPredicateFunctionResult.cpp @@ -1,25 +1,8 @@ // // Copyright 2024 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/sdf/wrapPrimSpec.cpp b/pxr/usd/sdf/wrapPrimSpec.cpp index ffae821481..8abae505d3 100644 --- a/pxr/usd/sdf/wrapPrimSpec.cpp +++ b/pxr/usd/sdf/wrapPrimSpec.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // /// \file wrapPrimSpec.cpp diff --git a/pxr/usd/sdf/wrapPropertySpec.cpp b/pxr/usd/sdf/wrapPropertySpec.cpp index ec367e3122..50d247cac3 100644 --- a/pxr/usd/sdf/wrapPropertySpec.cpp +++ b/pxr/usd/sdf/wrapPropertySpec.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // /// \file wrapPropertySpec.cpp diff --git a/pxr/usd/sdf/wrapPseudoRootSpec.cpp b/pxr/usd/sdf/wrapPseudoRootSpec.cpp index 8e40ac41ee..24d819bb00 100644 --- a/pxr/usd/sdf/wrapPseudoRootSpec.cpp +++ b/pxr/usd/sdf/wrapPseudoRootSpec.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // /// \file wrapPseudoRootSpec.cpp diff --git a/pxr/usd/sdf/wrapReference.cpp b/pxr/usd/sdf/wrapReference.cpp index d6fd551c99..ec80de7dc7 100644 --- a/pxr/usd/sdf/wrapReference.cpp +++ b/pxr/usd/sdf/wrapReference.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/sdf/wrapRelationshipSpec.cpp b/pxr/usd/sdf/wrapRelationshipSpec.cpp index b00cf14299..9416761b71 100644 --- a/pxr/usd/sdf/wrapRelationshipSpec.cpp +++ b/pxr/usd/sdf/wrapRelationshipSpec.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // /// \file wrapRelationshipSpec.cpp diff --git a/pxr/usd/sdf/wrapSpec.cpp b/pxr/usd/sdf/wrapSpec.cpp index 79a4892403..ccdb18b015 100644 --- a/pxr/usd/sdf/wrapSpec.cpp +++ b/pxr/usd/sdf/wrapSpec.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // /// \file wrapSpec.cpp diff --git a/pxr/usd/sdf/wrapTimeCode.cpp b/pxr/usd/sdf/wrapTimeCode.cpp index 66e3eff172..012d08272a 100644 --- a/pxr/usd/sdf/wrapTimeCode.cpp +++ b/pxr/usd/sdf/wrapTimeCode.cpp @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/sdf/timeCode.h" diff --git a/pxr/usd/sdf/wrapTypes.cpp b/pxr/usd/sdf/wrapTypes.cpp index 5832fb8c49..f0f3629e77 100644 --- a/pxr/usd/sdf/wrapTypes.cpp +++ b/pxr/usd/sdf/wrapTypes.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/sdf/wrapValueTypeName.cpp b/pxr/usd/sdf/wrapValueTypeName.cpp index 8f0e6f686d..3d25141357 100644 --- a/pxr/usd/sdf/wrapValueTypeName.cpp +++ b/pxr/usd/sdf/wrapValueTypeName.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/sdf/wrapVariableExpression.cpp b/pxr/usd/sdf/wrapVariableExpression.cpp index 529dd9df0b..a9eade2d73 100644 --- a/pxr/usd/sdf/wrapVariableExpression.cpp +++ b/pxr/usd/sdf/wrapVariableExpression.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/sdf/wrapVariantSetSpec.cpp b/pxr/usd/sdf/wrapVariantSetSpec.cpp index 3fa5ff9ab6..082f4e82b0 100644 --- a/pxr/usd/sdf/wrapVariantSetSpec.cpp +++ b/pxr/usd/sdf/wrapVariantSetSpec.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // /// \file wrapVariantSetSpec.cpp diff --git a/pxr/usd/sdf/wrapVariantSpec.cpp b/pxr/usd/sdf/wrapVariantSpec.cpp index 96a24152fc..ae44ba2000 100644 --- a/pxr/usd/sdf/wrapVariantSpec.cpp +++ b/pxr/usd/sdf/wrapVariantSpec.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // /// \file wrapVariantSpec.cpp diff --git a/pxr/usd/sdr/__init__.py b/pxr/usd/sdr/__init__.py index 0f6e80982a..2e3bdef0da 100644 --- a/pxr/usd/sdr/__init__.py +++ b/pxr/usd/sdr/__init__.py @@ -1,25 +1,8 @@ # # Copyright 2018 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # """Python bindings for libSdr""" diff --git a/pxr/usd/sdr/api.h b/pxr/usd/sdr/api.h index f044073da7..9631812c54 100644 --- a/pxr/usd/sdr/api.h +++ b/pxr/usd/sdr/api.h @@ -1,25 +1,8 @@ // // Copyright 2018 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDR_API_H #define PXR_USD_SDR_API_H diff --git a/pxr/usd/sdr/debugCodes.cpp b/pxr/usd/sdr/debugCodes.cpp index be727b1760..1bffb58d27 100644 --- a/pxr/usd/sdr/debugCodes.cpp +++ b/pxr/usd/sdr/debugCodes.cpp @@ -1,25 +1,8 @@ // // Copyright 2021 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/sdr/debugCodes.h" diff --git a/pxr/usd/sdr/debugCodes.h b/pxr/usd/sdr/debugCodes.h index 42a4bf9369..2f761839bc 100644 --- a/pxr/usd/sdr/debugCodes.h +++ b/pxr/usd/sdr/debugCodes.h @@ -1,25 +1,8 @@ // // Copyright 2021 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDR_DEBUG_CODES_H #define PXR_USD_SDR_DEBUG_CODES_H diff --git a/pxr/usd/sdr/declare.h b/pxr/usd/sdr/declare.h index ed844a3d1f..4bdbb8ad32 100644 --- a/pxr/usd/sdr/declare.h +++ b/pxr/usd/sdr/declare.h @@ -1,25 +1,8 @@ // // Copyright 2018 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDR_DECLARE_H #define PXR_USD_SDR_DECLARE_H diff --git a/pxr/usd/sdr/module.cpp b/pxr/usd/sdr/module.cpp index ae56d10711..f33d05ca87 100644 --- a/pxr/usd/sdr/module.cpp +++ b/pxr/usd/sdr/module.cpp @@ -1,25 +1,8 @@ // // Copyright 2018 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/sdr/moduleDeps.cpp b/pxr/usd/sdr/moduleDeps.cpp index 6c1484508f..af36c7d5dd 100644 --- a/pxr/usd/sdr/moduleDeps.cpp +++ b/pxr/usd/sdr/moduleDeps.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/pxr/usd/sdr/pch.h b/pxr/usd/sdr/pch.h index b4edc214fc..0932de9f31 100644 --- a/pxr/usd/sdr/pch.h +++ b/pxr/usd/sdr/pch.h @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // // WARNING: THIS FILE IS GENERATED. DO NOT EDIT. // @@ -31,6 +14,7 @@ #include #endif #if defined(ARCH_OS_LINUX) +#include #include #endif #if defined(ARCH_OS_WINDOWS) @@ -38,12 +22,11 @@ #define WIN32_LEAN_AND_MEAN #endif +#include #include -#include -#include -#include #endif #include +#include #include #include #include @@ -67,6 +50,8 @@ #include #include #include +#include +#include #include #include #include @@ -74,6 +59,8 @@ #include #include #include +#include +#include #include #include #include @@ -81,49 +68,6 @@ #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #ifdef PXR_PYTHON_SUPPORT_ENABLED #include #include @@ -156,23 +100,8 @@ #undef toupper #endif #endif // PXR_PYTHON_SUPPORT_ENABLED -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include +#include #include #ifdef PXR_PYTHON_SUPPORT_ENABLED #include "pxr/base/tf/pySafePython.h" diff --git a/pxr/usd/sdr/registry.cpp b/pxr/usd/sdr/registry.cpp index ff4e8685ed..5c2d118e6b 100644 --- a/pxr/usd/sdr/registry.cpp +++ b/pxr/usd/sdr/registry.cpp @@ -1,25 +1,8 @@ // // Copyright 2018 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/base/tf/instantiateSingleton.h" #include "pxr/usd/sdr/registry.h" diff --git a/pxr/usd/sdr/registry.h b/pxr/usd/sdr/registry.h index 81ab719ab9..faafb62a6d 100644 --- a/pxr/usd/sdr/registry.h +++ b/pxr/usd/sdr/registry.h @@ -1,25 +1,8 @@ // // Copyright 2018 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDR_REGISTRY_H diff --git a/pxr/usd/sdr/shaderMetadataHelpers.cpp b/pxr/usd/sdr/shaderMetadataHelpers.cpp index 5e3b8dc74e..f76c425dcb 100644 --- a/pxr/usd/sdr/shaderMetadataHelpers.cpp +++ b/pxr/usd/sdr/shaderMetadataHelpers.cpp @@ -1,25 +1,8 @@ // // Copyright 2018 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/base/tf/staticTokens.h" diff --git a/pxr/usd/sdr/shaderMetadataHelpers.h b/pxr/usd/sdr/shaderMetadataHelpers.h index 0ed3274a94..6ee6e71d1c 100644 --- a/pxr/usd/sdr/shaderMetadataHelpers.h +++ b/pxr/usd/sdr/shaderMetadataHelpers.h @@ -1,25 +1,8 @@ // // Copyright 2018 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDR_SHADER_METADATA_HELPERS_H diff --git a/pxr/usd/sdr/shaderNode.cpp b/pxr/usd/sdr/shaderNode.cpp index 00a7429956..6fcc9aeeb2 100644 --- a/pxr/usd/sdr/shaderNode.cpp +++ b/pxr/usd/sdr/shaderNode.cpp @@ -1,35 +1,19 @@ // // Copyright 2018 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/base/tf/refPtr.h" #include "pxr/usd/ndr/debugCodes.h" +#include "pxr/usd/sdf/valueTypeName.h" #include "pxr/usd/sdr/shaderMetadataHelpers.h" #include "pxr/usd/sdr/shaderNode.h" #include "pxr/usd/sdr/shaderProperty.h" #include -#include PXR_NAMESPACE_OPEN_SCOPE @@ -250,6 +234,47 @@ SdrShaderNode::GetAllVstructNames() const return NdrTokenVec(vstructs.begin(), vstructs.end()); } +/* static */ +SdrShaderNode::ComplianceResults +SdrShaderNode::CheckPropertyCompliance( + const std::vector &shaderNodes) +{ + std::unordered_map + propertyMap; + SdrShaderNode::ComplianceResults result; + for (SdrShaderNodeConstPtr shaderNode : shaderNodes) { + for (const TfToken &propName : shaderNode->GetInputNames()) { + if (SdrShaderPropertyConstPtr sdrProp = + shaderNode->GetShaderInput(propName)) { + auto propIt = propertyMap.find(propName); + if (propIt == propertyMap.end()) { + // insert property + propertyMap.emplace(propName, sdrProp); + } else { + // property already found, lets check for compliance + if (propIt->second->GetTypeAsSdfType() != + sdrProp->GetTypeAsSdfType() || + propIt->second->GetDefaultValue() != + sdrProp->GetDefaultValue() || + propIt->second->GetDefaultValueAsSdfType() != + sdrProp->GetDefaultValueAsSdfType()) { + auto resultIt = result.find(propName); + if (resultIt == result.end()) { + result.emplace(propName, + std::vector{ + shaderNode->GetIdentifier()}); + } else { + resultIt->second.push_back( + shaderNode->GetIdentifier()); + } + } + } + } + } + } + return result; +} + void SdrShaderNode::_InitializePrimvars() { diff --git a/pxr/usd/sdr/shaderNode.h b/pxr/usd/sdr/shaderNode.h index e5be467b99..4ef0f8ff5b 100644 --- a/pxr/usd/sdr/shaderNode.h +++ b/pxr/usd/sdr/shaderNode.h @@ -1,25 +1,8 @@ // // Copyright 2018 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDR_SHADER_NODE_H @@ -33,6 +16,8 @@ #include "pxr/usd/ndr/node.h" #include "pxr/usd/sdr/declare.h" +#include + PXR_NAMESPACE_OPEN_SCOPE // Note: Metadata keys that are generated by parsers should start with @@ -218,6 +203,26 @@ class SdrShaderNode : public NdrNode /// @} + // Stores the result of the compliance check of property names to + // sdrShaderNodeIdentifiers + using ComplianceResults = std::unordered_map, + TfToken::HashFunctor>; + + /// This method checks if same named properties of \p shaderNodes are + /// compatible with each other. + /// + /// Checks if the same name properties have matching types and default + /// values. In order to determine if same name properties from different + /// shader nodes are compliant, we assume that the first shaderNode in the + /// list providing this property is authoritative, and other nodes differing + /// wrt this property are non-compliant. A map of property names and their + /// respective shaderNodes are stored in the map. An empty map returned + /// represents no compliance issues. + SDR_API + static + ComplianceResults CheckPropertyCompliance( + const std::vector &shaderNodes); /// \cond /// Hide from the API. diff --git a/pxr/usd/sdr/shaderParserTestUtils.py b/pxr/usd/sdr/shaderParserTestUtils.py index cdb0c454e9..dc57761cad 100644 --- a/pxr/usd/sdr/shaderParserTestUtils.py +++ b/pxr/usd/sdr/shaderParserTestUtils.py @@ -2,25 +2,8 @@ # # Copyright 2018 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. """ Common utilities that shader-based parser plugins can use in their tests. diff --git a/pxr/usd/sdr/shaderProperty.cpp b/pxr/usd/sdr/shaderProperty.cpp index 57d72599e6..9aaa5ed8c3 100644 --- a/pxr/usd/sdr/shaderProperty.cpp +++ b/pxr/usd/sdr/shaderProperty.cpp @@ -1,24 +1,8 @@ // // Copyright 2018 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/sdr/shaderProperty.h b/pxr/usd/sdr/shaderProperty.h index 1ff04c63c8..017bb4417a 100644 --- a/pxr/usd/sdr/shaderProperty.h +++ b/pxr/usd/sdr/shaderProperty.h @@ -1,25 +1,8 @@ // // Copyright 2018 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_SDR_SHADER_PROPERTY_H diff --git a/pxr/usd/sdr/testenv/TestSdrRegistry_argsParserPlugin.cpp b/pxr/usd/sdr/testenv/TestSdrRegistry_argsParserPlugin.cpp index a9fed207c7..7e7edc875f 100644 --- a/pxr/usd/sdr/testenv/TestSdrRegistry_argsParserPlugin.cpp +++ b/pxr/usd/sdr/testenv/TestSdrRegistry_argsParserPlugin.cpp @@ -1,25 +1,8 @@ // // Copyright 2018 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/ndr/parserPlugin.h" diff --git a/pxr/usd/sdr/testenv/TestSdrRegistry_discoveryPlugin.cpp b/pxr/usd/sdr/testenv/TestSdrRegistry_discoveryPlugin.cpp index e632d2e20d..af40777ecd 100644 --- a/pxr/usd/sdr/testenv/TestSdrRegistry_discoveryPlugin.cpp +++ b/pxr/usd/sdr/testenv/TestSdrRegistry_discoveryPlugin.cpp @@ -1,25 +1,8 @@ // // Copyright 2018 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/ndr/discoveryPlugin.h" diff --git a/pxr/usd/sdr/testenv/TestSdrRegistry_oslParserPlugin.cpp b/pxr/usd/sdr/testenv/TestSdrRegistry_oslParserPlugin.cpp index 0d50459579..30ff649908 100644 --- a/pxr/usd/sdr/testenv/TestSdrRegistry_oslParserPlugin.cpp +++ b/pxr/usd/sdr/testenv/TestSdrRegistry_oslParserPlugin.cpp @@ -1,25 +1,8 @@ // // Copyright 2018 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/base/gf/vec2f.h" diff --git a/pxr/usd/sdr/testenv/testSdrRegistry.py b/pxr/usd/sdr/testenv/testSdrRegistry.py index 304c0d2456..c09d127e2b 100644 --- a/pxr/usd/sdr/testenv/testSdrRegistry.py +++ b/pxr/usd/sdr/testenv/testSdrRegistry.py @@ -2,25 +2,8 @@ # # Copyright 2018 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from __future__ import print_function from pxr import Plug diff --git a/pxr/usd/sdr/wrapRegistry.cpp b/pxr/usd/sdr/wrapRegistry.cpp index 73dca9487e..bb5b3ffe2a 100644 --- a/pxr/usd/sdr/wrapRegistry.cpp +++ b/pxr/usd/sdr/wrapRegistry.cpp @@ -1,25 +1,8 @@ // // Copyright 2018 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/sdr/wrapShaderNode.cpp b/pxr/usd/sdr/wrapShaderNode.cpp index bab89c1a3e..1d4c032e6f 100644 --- a/pxr/usd/sdr/wrapShaderNode.cpp +++ b/pxr/usd/sdr/wrapShaderNode.cpp @@ -1,25 +1,8 @@ // // Copyright 2018 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/sdr/wrapShaderProperty.cpp b/pxr/usd/sdr/wrapShaderProperty.cpp index e47c0d4216..a32cc16462 100644 --- a/pxr/usd/sdr/wrapShaderProperty.cpp +++ b/pxr/usd/sdr/wrapShaderProperty.cpp @@ -1,25 +1,8 @@ // // Copyright 2018 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/usd/CMakeLists.txt b/pxr/usd/usd/CMakeLists.txt index 912bcc4f57..fd86e90856 100644 --- a/pxr/usd/usd/CMakeLists.txt +++ b/pxr/usd/usd/CMakeLists.txt @@ -67,6 +67,10 @@ pxr_library(usd timeCode tokens typed + validator + validatorTokens + validationError + validationRegistry usdFileFormat usdaFileFormat usdcFileFormat @@ -103,6 +107,9 @@ pxr_library(usd wrapUtils.h testenv/TestUsdResolverChangedResolver.h + CPPFILES + coreValidators.cpp + PYTHON_CPPFILES moduleDeps.cpp @@ -250,6 +257,7 @@ pxr_test_scripts( testenv/testUsdResolveTargetPy.py testenv/testUsdSchemaBasePy.py testenv/testUsdSchemaRegistry.py + testenv/testUsdSchemaRegistryThreadedInit.py testenv/testUsdSchemaVersioning.py testenv/testUsdSpecializes.py testenv/testUsdStage.py @@ -459,6 +467,22 @@ pxr_build_test(testUsdUsdzResolver testenv/testUsdUsdzResolver.cpp ) +pxr_build_test(testUsdValidator + LIBRARIES + tf + usd + CPPFILES + testenv/testUsdValidator.cpp +) + +pxr_build_test(testUsdValidationRegistry + LIBRARIES + tf + usd + CPPFILES + testenv/testUsdValidationRegistry.cpp +) + pxr_build_test(testUsdZipFile_CPP LIBRARIES ar @@ -724,6 +748,11 @@ pxr_install_test_dir( DEST testUsdUsdzResolver ) +pxr_install_test_dir( + SRC testenv/testUsdValidationRegistry + DEST testUsdValidationRegistry +) + pxr_install_test_dir( SRC testenv/testUsdZipFile.testenv DEST testUsdZipFile @@ -969,6 +998,16 @@ pxr_register_test(testUsdMetadataCpp EXPECTED_RETURN_CODE 0 ) +pxr_register_test(testUsdValidator + COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdValidator" + EXPECTED_RETURN_CODE 0 +) + +pxr_register_test(testUsdValidationRegistry + COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdValidationRegistry" + EXPECTED_RETURN_CODE 0 +) + # This test relies on a plugin built specifically for this test. # The build system currently doesn't support this for static library # builds, so we only enable this test on shared library builds. @@ -1203,6 +1242,12 @@ pxr_register_test(testUsdSchemaRegistryCpp EXPECTED_RETURN_CODE 0 ) +pxr_register_test(testUsdSchemaRegistryThreadedInit + PYTHON + COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdSchemaRegistryThreadedInit" + EXPECTED_RETURN_CODE 0 +) + pxr_register_test(testUsdSchemaVersioning PYTHON COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdSchemaVersioning" diff --git a/pxr/usd/usd/__init__.py b/pxr/usd/usd/__init__.py index 21792ee990..d830462be1 100644 --- a/pxr/usd/usd/__init__.py +++ b/pxr/usd/usd/__init__.py @@ -1,25 +1,8 @@ # # Copyright 2016 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # from pxr import Tf Tf.PreparePythonModule() diff --git a/pxr/usd/usd/api.h b/pxr/usd/usd/api.h index 831f45354d..c0ec49bc77 100644 --- a/pxr/usd/usd/api.h +++ b/pxr/usd/usd/api.h @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USD_API_H #define USD_API_H diff --git a/pxr/usd/usd/apiSchemaBase.cpp b/pxr/usd/usd/apiSchemaBase.cpp index dba0323159..285c819e12 100644 --- a/pxr/usd/usd/apiSchemaBase.cpp +++ b/pxr/usd/usd/apiSchemaBase.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usd/apiSchemaBase.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usd/apiSchemaBase.h b/pxr/usd/usd/apiSchemaBase.h index c364a07b6e..408c987806 100644 --- a/pxr/usd/usd/apiSchemaBase.h +++ b/pxr/usd/usd/apiSchemaBase.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USD_GENERATED_APISCHEMABASE_H #define USD_GENERATED_APISCHEMABASE_H @@ -88,8 +71,7 @@ class SdfAssetPath; /// explicit bool conversion operator. Examples of applied API schemas include /// UsdCollectionAPI, UsdGeomModelAPI and UsdGeomMotionAPI /// -/// \anchor UsdAPISchemaBase_SingleVsMultipleApply -/// \name Single vs. Multiple Apply API Schemas +/// \subsection usd_apischemabase_single_vs_multiple_apply Single vs. Multiple Apply API Schemas /// /// Applied API schemas can further be classified into single-apply and /// multiple-apply API schemas. As the name suggests, a single-apply API schema diff --git a/pxr/usd/usd/attribute.cpp b/pxr/usd/usd/attribute.cpp index 269630db16..948babd531 100644 --- a/pxr/usd/usd/attribute.cpp +++ b/pxr/usd/usd/attribute.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usd/attribute.h" diff --git a/pxr/usd/usd/attribute.h b/pxr/usd/usd/attribute.h index 198346a0e7..d416708cbc 100644 --- a/pxr/usd/usd/attribute.h +++ b/pxr/usd/usd/attribute.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_ATTRIBUTE_H #define PXR_USD_USD_ATTRIBUTE_H diff --git a/pxr/usd/usd/attributeQuery.cpp b/pxr/usd/usd/attributeQuery.cpp index 0112d6d3ad..dc63926f24 100644 --- a/pxr/usd/usd/attributeQuery.cpp +++ b/pxr/usd/usd/attributeQuery.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usd/attributeQuery.h" diff --git a/pxr/usd/usd/attributeQuery.h b/pxr/usd/usd/attributeQuery.h index 28cbe4b970..f784a996f6 100644 --- a/pxr/usd/usd/attributeQuery.h +++ b/pxr/usd/usd/attributeQuery.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_ATTRIBUTE_QUERY_H #define PXR_USD_USD_ATTRIBUTE_QUERY_H diff --git a/pxr/usd/usd/clip.cpp b/pxr/usd/usd/clip.cpp index 8a06996674..dba584d784 100644 --- a/pxr/usd/usd/clip.cpp +++ b/pxr/usd/usd/clip.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usd/common.h" diff --git a/pxr/usd/usd/clip.h b/pxr/usd/usd/clip.h index e76dc80d0e..3cbfbe4005 100644 --- a/pxr/usd/usd/clip.h +++ b/pxr/usd/usd/clip.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_CLIP_H #define PXR_USD_USD_CLIP_H diff --git a/pxr/usd/usd/clipCache.cpp b/pxr/usd/usd/clipCache.cpp index c582e1d8be..611c944870 100644 --- a/pxr/usd/usd/clipCache.cpp +++ b/pxr/usd/usd/clipCache.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usd/clipCache.h" @@ -218,10 +201,9 @@ Usd_ClipCache::PopulateClipsForPrim( const bool primHasClips = !allClips.empty(); if (primHasClips) { TRACE_SCOPE("Usd_ClipCache::PopulateClipsForPrim (primHasClips)"); - tbb::mutex::scoped_lock lock; - if (_concurrentPopulationContext) { - lock.acquire(_concurrentPopulationContext->_mutex); - } + std::unique_lock lock = (_concurrentPopulationContext) ? + std::unique_lock(_concurrentPopulationContext->_mutex) : + std::unique_lock(); // Find nearest ancestor with clips specified. const std::vector* ancestralClips = nullptr; @@ -260,10 +242,10 @@ Usd_ClipCache::PopulateClipsForPrim( SdfLayerHandleSet Usd_ClipCache::GetUsedLayers() const { - tbb::mutex::scoped_lock lock; - if (_concurrentPopulationContext) { - lock.acquire(_concurrentPopulationContext->_mutex); - } + std::unique_lock lock = (_concurrentPopulationContext) ? + std::unique_lock(_concurrentPopulationContext->_mutex) : + std::unique_lock(); + SdfLayerHandleSet layers; for (_ClipTable::iterator::value_type const &clipsListIter : _table){ for (Usd_ClipSetRefPtr const &clipSet : clipsListIter.second){ @@ -342,10 +324,9 @@ const std::vector& Usd_ClipCache::GetClipsForPrim(const SdfPath& path) const { TRACE_FUNCTION(); - tbb::mutex::scoped_lock lock; - if (_concurrentPopulationContext) { - lock.acquire(_concurrentPopulationContext->_mutex); - } + std::unique_lock lock = (_concurrentPopulationContext) ? + std::unique_lock(_concurrentPopulationContext->_mutex) : + std::unique_lock(); return _GetClipsForPrim_NoLock(path); } diff --git a/pxr/usd/usd/clipCache.h b/pxr/usd/usd/clipCache.h index 2bff0833aa..6492120eb4 100644 --- a/pxr/usd/usd/clipCache.h +++ b/pxr/usd/usd/clipCache.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_CLIP_CACHE_H #define PXR_USD_USD_CLIP_CACHE_H @@ -30,7 +13,7 @@ #include "pxr/usd/usd/clipSet.h" #include "pxr/usd/sdf/pathTable.h" -#include +#include #include PXR_NAMESPACE_OPEN_SCOPE @@ -61,7 +44,7 @@ class Usd_ClipCache explicit ConcurrentPopulationContext(Usd_ClipCache &cache); ~ConcurrentPopulationContext(); Usd_ClipCache &_cache; - tbb::mutex _mutex; + std::mutex _mutex; }; /// Populate the cache with clips for \p prim. Returns true if clips diff --git a/pxr/usd/usd/clipSet.cpp b/pxr/usd/usd/clipSet.cpp index a9ed48d6e5..1c03f3b4c0 100644 --- a/pxr/usd/usd/clipSet.cpp +++ b/pxr/usd/usd/clipSet.cpp @@ -1,25 +1,8 @@ // // Copyright 2020 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usd/clipSet.h" diff --git a/pxr/usd/usd/clipSet.h b/pxr/usd/usd/clipSet.h index 84e46f774c..1a162658ea 100644 --- a/pxr/usd/usd/clipSet.h +++ b/pxr/usd/usd/clipSet.h @@ -1,25 +1,8 @@ // // Copyright 2020 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_CLIP_SET_H #define PXR_USD_USD_CLIP_SET_H diff --git a/pxr/usd/usd/clipSetDefinition.cpp b/pxr/usd/usd/clipSetDefinition.cpp index c8041eec44..572e6c01e4 100644 --- a/pxr/usd/usd/clipSetDefinition.cpp +++ b/pxr/usd/usd/clipSetDefinition.cpp @@ -1,25 +1,8 @@ // // Copyright 2020 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usd/clipSetDefinition.h" diff --git a/pxr/usd/usd/clipSetDefinition.h b/pxr/usd/usd/clipSetDefinition.h index 274d2e837b..dc166fa3bd 100644 --- a/pxr/usd/usd/clipSetDefinition.h +++ b/pxr/usd/usd/clipSetDefinition.h @@ -1,25 +1,8 @@ // // Copyright 2020 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_CLIP_SET_DEFINITION_H #define PXR_USD_USD_CLIP_SET_DEFINITION_H diff --git a/pxr/usd/usd/clipsAPI.cpp b/pxr/usd/usd/clipsAPI.cpp index 98a5021ef4..a87a9e55af 100644 --- a/pxr/usd/usd/clipsAPI.cpp +++ b/pxr/usd/usd/clipsAPI.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usd/clipsAPI.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usd/clipsAPI.h b/pxr/usd/usd/clipsAPI.h index 7efecc4227..257739226e 100644 --- a/pxr/usd/usd/clipsAPI.h +++ b/pxr/usd/usd/clipsAPI.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USD_GENERATED_CLIPSAPI_H #define USD_GENERATED_CLIPSAPI_H diff --git a/pxr/usd/usd/codegenTemplates/api.h b/pxr/usd/usd/codegenTemplates/api.h index eb2adac23f..f466848f42 100644 --- a/pxr/usd/usd/codegenTemplates/api.h +++ b/pxr/usd/usd/codegenTemplates/api.h @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef {{ Upper(libraryName) }}_API_H #define {{ Upper(libraryName) }}_API_H diff --git a/pxr/usd/usd/codegenTemplates/schemaClass.cpp b/pxr/usd/usd/codegenTemplates/schemaClass.cpp index 487484a55b..885c8a05ec 100644 --- a/pxr/usd/usd/codegenTemplates/schemaClass.cpp +++ b/pxr/usd/usd/codegenTemplates/schemaClass.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "{{ libraryPath }}/{{ cls.GetHeaderFile() }}" #include "pxr/usd/usd/schemaRegistry.h" @@ -28,10 +11,6 @@ #include "pxr/usd/sdf/types.h" #include "pxr/usd/sdf/assetPath.h" -{% if cls.isMultipleApply and cls.propertyNamespacePrefix %} -#include "pxr/base/tf/staticTokens.h" - -{% endif %} {% if useExportAPI %} {{ namespaceOpen }} @@ -52,13 +31,6 @@ TF_REGISTRY_FUNCTION(TfType) {% endif %} } -{% if cls.isMultipleApply and cls.propertyNamespacePrefix %} -TF_DEFINE_PRIVATE_TOKENS( - _schemaTokens, - ({{ cls.propertyNamespacePrefix }}) -); - -{% endif %} /* virtual */ {{ cls.cppClassName }}::~{{ cls.cppClassName }}() { @@ -73,10 +45,10 @@ TF_DEFINE_PRIVATE_TOKENS( TF_CODING_ERROR("Invalid stage"); return {{ cls.cppClassName }}(); } -{% if cls.isMultipleApply and cls.propertyNamespacePrefix %} +{% if cls.isMultipleApply and cls.propertyNamespace %} TfToken name; if (!Is{{ cls.usdPrimTypeName }}Path(path, &name)) { - TF_CODING_ERROR("Invalid {{ cls.propertyNamespacePrefix }} path <%s>.", path.GetText()); + TF_CODING_ERROR("Invalid {{ cls.propertyNamespace.prefix }} path <%s>.", path.GetText()); return {{ cls.cppClassName }}(); } return {{ cls.cppClassName }}(stage->GetPrimAtPath(path.GetPrimPath()), name); @@ -123,7 +95,7 @@ std::vector<{{ cls.cppClassName }}> stage->DefinePrim(path, usdPrimTypeName)); } {% endif %} -{% if cls.isMultipleApply and cls.propertyNamespacePrefix %} +{% if cls.isMultipleApply and cls.propertyNamespace %} /* static */ bool @@ -167,9 +139,9 @@ bool } if (tokens.size() >= 2 - && tokens[0] == _schemaTokens->{{ cls.propertyNamespacePrefix }}) { + && tokens[0] == {{ tokensPrefix }}Tokens->{{ cls.propertyNamespace.token }}) { *name = TfToken(propertyName.substr( - _schemaTokens->{{ cls.propertyNamespacePrefix }}.GetString().size() + 1)); + {{ tokensPrefix }}Tokens->{{ cls.propertyNamespace.token }}.GetString().size() + 1)); return true; } @@ -244,7 +216,7 @@ const TfType & { return _GetStaticTfType(); } -{% if cls.isMultipleApply and cls.propertyNamespacePrefix %} +{% if cls.isMultipleApply and cls.propertyNamespace %} /// Returns the property name prefixed with the correct namespace prefix, which /// is composed of the the API's propertyNamespacePrefix metadata and the @@ -265,7 +237,7 @@ _GetNamespacedPropertyName(const TfToken instanceName, const TfToken propName) UsdAttribute {{ cls.cppClassName }}::Get{{ Proper(attr.apiName) }}Attr() const { -{% if cls.isMultipleApply and cls.propertyNamespacePrefix %} +{% if cls.isMultipleApply and cls.propertyNamespace %} return GetPrim().GetAttribute( _GetNamespacedPropertyName( GetName(), @@ -279,7 +251,7 @@ UsdAttribute UsdAttribute {{ cls.cppClassName }}::Create{{ Proper(attr.apiName) }}Attr(VtValue const &defaultValue, bool writeSparsely) const { -{% if cls.isMultipleApply and cls.propertyNamespacePrefix %} +{% if cls.isMultipleApply and cls.propertyNamespace %} return UsdSchemaBase::_CreateAttr( _GetNamespacedPropertyName( GetName(), @@ -304,7 +276,7 @@ UsdAttribute UsdRelationship {{ cls.cppClassName }}::Get{{ Proper(rel.apiName) }}Rel() const { -{% if cls.isMultipleApply and cls.propertyNamespacePrefix %} +{% if cls.isMultipleApply and cls.propertyNamespace %} return GetPrim().GetRelationship( _GetNamespacedPropertyName( GetName(), @@ -318,7 +290,7 @@ UsdRelationship UsdRelationship {{ cls.cppClassName }}::Create{{ Proper(rel.apiName) }}Rel() const { -{% if cls.isMultipleApply and cls.propertyNamespacePrefix %} +{% if cls.isMultipleApply and cls.propertyNamespace %} return GetPrim().CreateRelationship( _GetNamespacedPropertyName( GetName(), diff --git a/pxr/usd/usd/codegenTemplates/schemaClass.h b/pxr/usd/usd/codegenTemplates/schemaClass.h index 2e1134d8da..528d792452 100644 --- a/pxr/usd/usd/codegenTemplates/schemaClass.h +++ b/pxr/usd/usd/codegenTemplates/schemaClass.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef {{ Upper(libraryName) }}_GENERATED_{{ Upper(cls.className) }}_H #define {{ Upper(libraryName) }}_GENERATED_{{ Upper(cls.className) }}_H @@ -88,7 +71,7 @@ class {{ cls.cppClassName }} : public {{ cls.parentCppClassName }} /// {{ cls.cppClassName }}::Get( /// prim.GetStage(), /// prim.GetPath().AppendProperty( - /// "{{ cls.propertyNamespacePrefix }}:name")); + /// "{{ cls.propertyNamespace.prefix }}:name")); /// /// for a \em valid \p prim, but will not immediately throw an error for /// an invalid \p prim @@ -161,9 +144,9 @@ class {{ cls.cppClassName }} : public {{ cls.parentCppClassName }} /// Return a {{ cls.cppClassName }} holding the prim adhering to this /// schema at \p path on \p stage. If no prim exists at \p path on /// \p stage, or if the prim at that path does not adhere to this schema, -{% if cls.isMultipleApply and cls.propertyNamespacePrefix %} +{% if cls.isMultipleApply and cls.propertyNamespace %} /// return an invalid schema object. \p path must be of the format - /// .{{ cls.propertyNamespacePrefix }}:name . + /// .{{ cls.propertyNamespace.prefix }}:name . /// /// This is shorthand for the following: /// @@ -234,7 +217,7 @@ class {{ cls.cppClassName }} : public {{ cls.parentCppClassName }} static {{ cls.cppClassName }} Define(const UsdStagePtr &stage, const SdfPath &path); {% endif %} -{% if cls.isMultipleApply and cls.propertyNamespacePrefix %} +{% if cls.isMultipleApply and cls.propertyNamespace %} /// Checks if the given name \p baseName is the base name of a property /// of {{ cls.usdPrimTypeName }}. {% if useExportAPI -%} diff --git a/pxr/usd/usd/codegenTemplates/tokens.cpp b/pxr/usd/usd/codegenTemplates/tokens.cpp index 89f63a58c9..682034115f 100644 --- a/pxr/usd/usd/codegenTemplates/tokens.cpp +++ b/pxr/usd/usd/codegenTemplates/tokens.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "{{ libraryPath }}/tokens.h" diff --git a/pxr/usd/usd/codegenTemplates/tokens.h b/pxr/usd/usd/codegenTemplates/tokens.h index 732d0bdae3..e0896efda7 100644 --- a/pxr/usd/usd/codegenTemplates/tokens.h +++ b/pxr/usd/usd/codegenTemplates/tokens.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef {{ Upper(tokensPrefix) }}_TOKENS_H #define {{ Upper(tokensPrefix) }}_TOKENS_H diff --git a/pxr/usd/usd/codegenTemplates/wrapSchemaClass.cpp b/pxr/usd/usd/codegenTemplates/wrapSchemaClass.cpp index 642180f815..9c566163a1 100644 --- a/pxr/usd/usd/codegenTemplates/wrapSchemaClass.cpp +++ b/pxr/usd/usd/codegenTemplates/wrapSchemaClass.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "{{ libraryPath }}/{{ cls.GetHeaderFile() }}" #include "pxr/usd/usd/schemaBase.h" @@ -66,7 +49,7 @@ _Create{{ Proper(attr.apiName) }}Attr({{ cls.cppClassName }} &self, } {% endif %} {% endfor %} -{% if cls.isMultipleApply and cls.propertyNamespacePrefix %} +{% if cls.isMultipleApply and cls.propertyNamespace %} static bool _WrapIs{{ cls.usdPrimTypeName }}Path(const SdfPath &path) { TfToken collectionName; @@ -254,7 +237,7 @@ void wrap{{ cls.cppClassName }}() &This::Create{{ Proper(rel.apiName) }}Rel) {% endif %} {% endfor %} -{% if cls.isMultipleApply and cls.propertyNamespacePrefix %} +{% if cls.isMultipleApply and cls.propertyNamespace %} .def("Is{{ cls.usdPrimTypeName }}Path", _WrapIs{{ cls.usdPrimTypeName }}Path) .staticmethod("Is{{ cls.usdPrimTypeName }}Path") {% endif %} diff --git a/pxr/usd/usd/codegenTemplates/wrapTokens.cpp b/pxr/usd/usd/codegenTemplates/wrapTokens.cpp index 7d54d47032..035d22dcad 100644 --- a/pxr/usd/usd/codegenTemplates/wrapTokens.cpp +++ b/pxr/usd/usd/codegenTemplates/wrapTokens.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // // GENERATED FILE. DO NOT EDIT. #include diff --git a/pxr/usd/usd/collectionAPI.cpp b/pxr/usd/usd/collectionAPI.cpp index 61706b4193..63bee84507 100644 --- a/pxr/usd/usd/collectionAPI.cpp +++ b/pxr/usd/usd/collectionAPI.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usd/collectionAPI.h" #include "pxr/usd/usd/schemaRegistry.h" @@ -28,8 +11,6 @@ #include "pxr/usd/sdf/types.h" #include "pxr/usd/sdf/assetPath.h" -#include "pxr/base/tf/staticTokens.h" - PXR_NAMESPACE_OPEN_SCOPE // Register the schema with the TfType system. @@ -40,11 +21,6 @@ TF_REGISTRY_FUNCTION(TfType) } -TF_DEFINE_PRIVATE_TOKENS( - _schemaTokens, - (collection) -); - /* virtual */ UsdCollectionAPI::~UsdCollectionAPI() { @@ -131,9 +107,9 @@ UsdCollectionAPI::IsCollectionAPIPath( } if (tokens.size() >= 2 - && tokens[0] == _schemaTokens->collection) { + && tokens[0] == UsdTokens->collection) { *name = TfToken(propertyName.substr( - _schemaTokens->collection.GetString().size() + 1)); + UsdTokens->collection.GetString().size() + 1)); return true; } diff --git a/pxr/usd/usd/collectionAPI.h b/pxr/usd/usd/collectionAPI.h index 0393847a83..b040c604d6 100644 --- a/pxr/usd/usd/collectionAPI.h +++ b/pxr/usd/usd/collectionAPI.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USD_GENERATED_COLLECTIONAPI_H #define USD_GENERATED_COLLECTIONAPI_H @@ -58,95 +41,137 @@ class SdfAssetPath; /// \class UsdCollectionAPI /// -/// This is a general purpose API schema, used to describe a -/// collection of heterogeneous objects within the scene. "Objects" here may be -/// prims or properties belonging to prims or other collections. It's an add-on -/// schema that can be applied many times to a prim with different collection -/// names. +/// A general purpose API schema used to describe a collection of prims +/// and properties within a scene. This API schema can be applied to a prim +/// multiple times with different instance names to define several collections +/// on a single prim. +/// +/// A collection's membership is specified one of two ways. The first way uses +/// the built-in relationships `includes` and `excludes`, and the attribute +/// `includeRoot` to determine membership. The second way is termed a +/// pattern-based collection, and uses the built-in attribute +/// `membershipExpression` to determine membership. Here we will refer to +/// collections using `includes`, `excludes` and `includeRoot` as being in +/// *relationship-mode* and those using the `membershipExpression` as being in +/// *expression-mode*. /// -/// A collection allows an enumeration of a set of paths to include and a -/// set of paths to exclude. Whether the descendants of an included -/// path are members of a collection are decided by its expansion rule -/// (see below). If the collection excludes paths that are not descendents -/// of included paths, the collection implicitly includes the root path -/// </>. If such a collection also includes paths that are not -/// descendants of the excluded paths, it is considered invalid, since -/// the intention is ambiguous. +/// A collection is determined to be in *relationship-mode* when either or both +/// of its `includes` and `excludes` relationships have valid targets, or the +/// `includeRoot` attribute is set `true`. In this case, the pattern-based +/// `membershipExpression` attribute is ignored. Otherwise, the collection is +/// in *expression-mode* and the `membershipExpression` attribute applies. /// -/// All the properties authored by the schema are namespaced under -/// "collection:". The given name of the collection provides additional -/// namespacing for the various per-collection properties, which include the -/// following: +/// In *relationship-mode* the `includes` and `excludes` relationships specify +/// the collection members as a set of paths to include and a set of paths to +/// exclude. Whether or not the descendants of an included path belong to a +/// collection is decided by its expansion rule (see below). If the collection +/// excludes paths that are not descendent to included paths, the collection +/// implicitly includes the root path ``. If such a collection also +/// includes paths that are not descendent to the excluded paths, it is +/// considered invalid since the intent is ambiguous. +/// +/// In *expression-mode*, the pattern-based `membershipExpression` attribute is +/// used with the `expansionRule` attribute to determine collection membership. +/// See the detailed descriptions of the built-in properties below for more +/// details. +/// +/// \section usd_collectionapi_properties Collection API Properties +/// +/// The built-in properties for this schema are in the `collection:instanceName` +/// namespace, where `instanceName` is the user-provided applied API schema +/// instance name. /// -///
  • uniform token collection:collectionName:expansionRule - -/// specified how the paths that are included in the collection must be expanded -/// to determine its members. Possible values include: ///
      -///
    • explicitOnly - only paths in the includes rel targets and not -/// in the excludes rel targets belong to the collection. +///
    • `uniform token collection:instanceName:expansionRule` - in +/// *relationship-mode*, specifies how to expand the `includes` and `excludes` +/// relationship targets to determine the collection's members. In +/// *expression-mode*, specifies how matching scene objects against the +/// `membershipExpression` proceeds. Possible values include: +///
        +///
      • `expandPrims` - in *relationship-mode*, all the prims descendent +/// to the `includes` relationship targets (and not descendent to `excludes` +/// relationship targets) belong to the collection. Any `includes`-targeted +/// property paths also belong to the collection. This is the default +/// behavior. In *expression-mode*, the functions +/// UsdComputeIncludedObjectsFromCollection() and +/// UsdComputeIncludedPathsFromCollection() only test prims against the +/// `membershipExpression` to determine membership. ///
      • -///
      • expandPrims - all the prims at or below the includes rel- -/// targets (and not under the excludes rel-targets) belong to the -/// collection. Any property paths included in the collection would, of -/// course, also be honored. This is the default behavior as it satisfies -/// most use cases. +///
      • `expandPrimsAndProperties` - like `expandPrims`, but in +/// *relationship-mode*, all properties on all included prims also belong to +/// the collection. In *expression-mode*, the functions +/// UsdComputeIncludedObjectsFromCollection() and +/// UsdComputeIncludedPathsFromCollection() test both prims and +/// properties against the `membershipExpression` to determine membership. ///
      • -///
      • expandPrimsAndProperties - like expandPrims, but also -/// includes all properties on all matched prims. We're still not quite -/// sure what the use cases are for this, but you can use it to capture a -/// whole lot of UsdObjects very concisely. +///
      • `explicitOnly` - in *relationship-mode*, only paths in the +/// `includes` relationship targets and not those in the `excludes` +/// relationship targets belong to the collection. Does not apply to +/// *expression-mode*. If set in *expression-mode*, the functions +/// UsdComputeIncludedObjectsFromCollection() and +/// UsdComputeIncludedPathsFromCollection() return no results. ///
      • ///
      ///
    • -///
    • bool collection:collectionName:includeRoot - boolean -/// attribute indicating whether the pseudo-root path </> should -/// be counted as one of the included target paths. The fallback is false. -/// This separate attribute is required because relationships cannot -/// directly target the root. When expansionRule is explicitOnly, this -/// attribute is ignored. -///
    • rel collection:collectionName:includes - specifies a list -/// of targets that are included in the collection. This can target prims or -/// properties directly. A collection can insert the rules of another -/// collection by making its includes relationship target the -/// collection:{collectionName} property on the owning prim of the -/// collection to be included (see UsdCollectionAPI::GetCollectionAttr). -/// It is important to note that including another collection does not -/// guarantee the contents of that collection will be in the final collection; -/// instead, the rules are merged. This means, for example, an exclude -/// entry may exclude a portion of the included collection. -/// When a collection includes one or more collections, the order in which -/// targets are added to the includes relationship may become significant, if -/// there are conflicting opinions about the same path. Targets that are added -/// later are considered to be stronger than earlier targets for the same path. -///
    • -///
    • rel collection:collectionName:excludes - specifies a list -/// of targets that are excluded below the included paths in this -/// collection. This can target prims or properties directly, but cannot -/// target another collection. This is to keep the membership determining -/// logic simple, efficient and easier to reason about. Finally, it is invalid -/// for a collection to exclude paths that are not included in it. The presence -/// of such "orphaned" excluded paths will not affect the set of paths included -/// in the collection, but may affect the performance of querying membership of -/// a path in the collection (see UsdCollectionAPI::MembershipQuery::IsPathIncluded) -/// or of enumerating the objects belonging to the collection (see -/// UsdCollectionAPI::GetIncludedObjects). -///
    • -///
    • uniform opaque collection:collectionName - opaque +/// +///
    • `bool collection:instanceName:includeRoot` - boolean attribute +/// indicating whether the pseudo-root path `` should be counted as one +/// of the included target paths in *relationship-mode*. This separate attribute +/// is required because relationships cannot directly target the root. When +/// `expansionRule` is `explicitOnly`, this attribute is ignored. The fallback +/// value is false. When set to `true`, this collection is in +/// *relationship-mode*. This attribute is ignored in *expression-mode*.
    • +/// +///
    • `rel collection:instanceName:includes` - in *relationship-mode*, +/// specifies a list of targets that are included in the collection. This can +/// target prims or properties directly. A collection can insert the rules of +/// another collection by making its `includes` relationship target the +/// `collection:otherInstanceName` property from the collection to be included +/// (see UsdCollectionAPI::GetCollectionAttr). Note that including another +/// collection does not guarantee the contents of that collection will be in the +/// final collection; instead, the rules are merged. This means, for example, +/// an exclude entry may exclude a portion of the included collection. When a +/// collection includes one or more collections, the order in which targets are +/// added to the includes relationship may become significant, if there are +/// conflicting opinions about the same path. Targets that are added later are +/// considered to be stronger than earlier targets for the same path. This +/// relationship is ignored in *expression-mode*.
    • +/// +///
    • `rel collection:instanceName:excludes` - in *relationship-mode*, +/// specifies a list of targets that are excluded below the included +/// paths in this collection. This can target prims or properties directly, but +/// cannot target another collection. This is to keep the membership +/// determining logic simple, efficient and easier to reason about. Finally, it +/// is invalid for a collection to exclude paths that are not included in +/// it. The presence of such "orphaned" excluded paths will not affect the set +/// of paths included in the collection, but may affect the performance of +/// querying membership of a path in the collection (see +/// UsdCollectionMembershipQuery::IsPathIncluded) or of enumerating the +/// objects belonging to the collection (see +/// UsdCollectionAPI::ComputeIncludedObjects). This relationship is ignored in +/// *expression-mode*.
    • +/// +///
    • `uniform opaque collection:instanceName` - opaque /// attribute (meaning it can never have a value) that represents the collection -/// for the purpose of allowing another collection to include it. When this -/// property is targeted by another collection's includes relationship, -/// the rules of this collection will be inserted into the rules of the collection -/// that includes it. -///
    +/// for the purpose of allowing another collection to include it in +/// *relationship-mode*. When this property is targeted by another collection's +/// `includes` relationship, the rules of this collection will be inserted +/// into the rules of the collection that includes it.
  • /// -/// Implicit inclusion +///
  • `uniform pathExpression collection:instanceName:membershipExpression` - +/// in *expression-mode*, defines the SdfPathExpression used to test +/// objects for collection membership.
  • +/// +///
+/// +/// \subsection usd_collectionapi_implicit_inclusion Implicit Inclusion /// /// In some scenarios it is useful to express a collection that includes -/// everything except certain paths. To support this, a collection -/// that has an exclude that is not a descendent of any include -/// will include the root path </>. +/// everything except certain paths. To support this, a *relationship-mode* +/// collection that has an exclude that is not descendent to any include will +/// include the root path ``. /// -/// Creating collections in C++ +/// \section usd_collectionapi_creating_cpp Creating Collections in C++ /// /// \snippet examples_usd.cpp ApplyCollections /// @@ -348,7 +373,7 @@ class UsdCollectionAPI : public UsdAPISchemaBase // INCLUDEROOT // --------------------------------------------------------------------- // /// Boolean attribute indicating whether the pseudo-root - /// path </> should be counted as one of the included target + /// path `` should be counted as one of the included target /// paths. The fallback is false. This separate attribute is /// required because relationships cannot directly target the root. /// @@ -573,8 +598,6 @@ class UsdCollectionAPI : public UsdAPISchemaBase const UsdStageWeakPtr &stage, const Usd_PrimFlagsPredicate &pred=UsdPrimDefaultPredicate); - /// @} - /// \anchor UsdCollectionAPI_AuthoringAPI /// \name Collection Authoring API /// diff --git a/pxr/usd/usd/collectionMembershipQuery.cpp b/pxr/usd/usd/collectionMembershipQuery.cpp index e1a2421028..e826b6857b 100644 --- a/pxr/usd/usd/collectionMembershipQuery.cpp +++ b/pxr/usd/usd/collectionMembershipQuery.cpp @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usd/collectionMembershipQuery.h" #include "pxr/usd/usd/collectionPredicateLibrary.h" @@ -129,6 +112,17 @@ _ComputeIncludedImpl( } else if (UsdPrim prim = stage->GetPrimAtPath(path)) { UsdPrimRange range(prim, pred); + // If this prim is the stage's pseudo-root, increment the + // range's begin iterator to skip it. This happens when the + // collection has 'includeRoot' set to include '/'. This fixup + // is necessary since the below test of query.IsPathIncluded() + // will return false for '/' since only prims and properties can + // be included, but that will thwart the remainder of the + // iteration descendant to '/'. + if (prim == stage->GetPseudoRoot()) { + range.increment_begin(); + } + auto iter = range.begin(); for (; iter != range.end() ; ++iter) { const UsdPrim &descendantPrim = *iter; @@ -406,8 +400,12 @@ Usd_CollectionMembershipQueryBase::_IsPathIncludedByRuleMap( *expansionRule = UsdTokens->exclude; } return false; - } else if ((i->second == UsdTokens->expandPrimsAndProperties) || - (i->second == UsdTokens->explicitOnly && p == path)){ + } + // If there is a property path directly in the map, then it is + // considered included even if the rule is expandPrims. + else if (p.IsPropertyPath() || + (i->second == UsdTokens->expandPrimsAndProperties) || + (i->second == UsdTokens->explicitOnly && p == path)) { if (expansionRule) { *expansionRule = i->second; } @@ -503,4 +501,203 @@ Usd_CollectionMembershipQueryBase::_Hash::operator()( return TfHash::Combine(entries, q._topExpansionRule); } + +SdfPathExpression +UsdComputePathExpressionFromCollectionMembershipQueryRuleMap( + Usd_CollectionMembershipQueryBase::PathExpansionRuleMap const &ruleMap) +{ + // Shorthand to increase readability. + using Expr = SdfPathExpression; + + // If there are no rules, we don't match anything. + if (ruleMap.empty()) { + return Expr::Nothing(); + } + + // Use an enum instead of tokens to avoid TfToken refcounting locally. + enum Rule { ExpandPrims, ExpandPrimsAndProps, Exclude, ExplicitOnly }; + auto tokenToRule = [](TfToken const &token) { + if (token == UsdTokens->expandPrims) { return ExpandPrims; } + if (token == UsdTokens-> + expandPrimsAndProperties) { return ExpandPrimsAndProps; } + if (token == UsdTokens->exclude) { return Exclude; } + return ExplicitOnly; + }; + + // Build a lexicographically ordered list of entries to process. This + // ensures that we will see ancestor paths prior to descendant paths. + // + // During this process we also collect any explictOnly prim paths, and all + // property paths separately. These can all be treated as ExplicitOnly + // entries, either included or excluded. We combine these with the final + // expression at the end, in such a way that they are evaluated first, since + // they are the fastest to evaluate. + using Entry = std::pair; + std::vector entries; + entries.reserve(ruleMap.size()); + + // These subexpressions track explicitly included or excluded single-path + // rules. They are both just union chains, like '/foo /bar /baz' etc. + Expr explicitIncludes, explicitExcludes; + auto addUnion = [](Expr &expr, SdfPath const &path) { + expr = Expr::MakeOp(Expr::ImpliedUnion, + std::move(expr), Expr::MakeAtom(path)); + }; + + for (auto const &[path, ruleToken]: ruleMap) { + Rule rule = tokenToRule(ruleToken); + // Collect explicit-only rules separately. + if (rule == ExplicitOnly) { + addUnion(explicitIncludes, path); + } + // Property paths can always be treated as explicit since they don't + // have descendant prims/properties. + else if (!path.IsAbsoluteRootOrPrimPath()) { + addUnion( + rule == Exclude ? explicitExcludes : explicitIncludes, path); + } + // Other rules for prim-like paths are handled by the shift/reduce + // builder. + else { + TF_AXIOM(path.IsAbsoluteRootOrPrimPath()); + entries.emplace_back(path, rule); + } + } + std::sort(entries.begin(), entries.end()); + + // Build the expression shift-reduce style, merging the most descendant + // expressions into ancestral expressions. + + // Each stack entry contains the path for this rule as 'self', its + // accumulated subexpression thus far (incorporating descendant rules), and + // finally the rule for this path. + struct StackEntry { + StackEntry(SdfPath const &self_, Rule rule_) + : StackEntry(SdfPath(self_), rule_) {} + StackEntry(SdfPath &&self_, Rule rule_) + : self(std::move(self_)), rule(rule_) { + // Note that this cannot be a property path. Those are handled in + // explicitIncludes/Excludes. + TF_AXIOM(self.IsAbsoluteRootOrPrimPath()); + + // If this is an exclude of the absolute root path, our expression + // is just Nothing. + if (self.IsAbsoluteRootPath() && rule == Exclude) { + return; + } + // Otherwise build the initial expression for this path's rule, + // starting with the path itself. + Expr::PathPattern pattern(self); + pattern.AppendChild({}); // tack on '//' + expr = Expr::MakeAtom(std::move(pattern)); + // If the rule is ExpandPrims (not properties) subtract properties. + if (rule == ExpandPrims) { + static Expr const &allPropsExpr = *(new Expr("//*.*")); + expr = Expr::MakeOp(Expr::Difference, + std::move(expr), Expr{allPropsExpr}); + } + // Finally, to get correct precedence, we insert a weaker reference + // '%_' on the left hand side joined with the operator for our rule. + // So for an include it's like '%_ /self//' and for an exclude it's + // like '%_ - /self//'. The parent will compose this expression + // over its own as the weaker reference to insert in the correct + // spot. But if this rule is for the absolute root, we do not + // include a weaker reference since it's the final rule. + if (!self.IsAbsoluteRootPath()) { + expr = Expr::MakeOp( + rule == Exclude ? Expr::Difference : Expr::Union, + Expr::WeakerRef(), std::move(expr)); + } + } + SdfPath self; + Expr expr; + Rule rule; + }; + std::vector stack; + + // Helper function to reduce the stack top (back()) into the next + // (ancestral) stack entry by merging its accumulated expression into the + // ancestor, reducing the stack size by one. If the stack is not empty, + // return the empty expression. If the stack has only one element, return + // the final expression and leave the stack empty. + auto reduce = [](std::vector &stack) { + Expr topExpr = std::move(stack.back().expr); + stack.pop_back(); + // If the stack is empty, return the final expression. + if (stack.empty()) { + return topExpr; + } + // Otherwise combine into the next entry by composing the oldTop's + // expression over the newTop's -- replacing the oldTop's weaker + // reference '%_' with the newTop's expression. + StackEntry &newTop = stack.back(); + newTop.expr = topExpr.ComposeOver(newTop.expr); + // Return empty since the expression is not yet complete. + topExpr = {}; + return topExpr; + }; + + // For uniformity we want the stack top to always be '/'. If the first + // entry in 'entries' is not '/', it means that '/' is implicitly excluded, + // so in that case we push an exclude of '/' manually. Otherwise the loop + // over entries below will push the '/' on its first iteration. If entries + // is empty here, it means that all paths were explicit and there are no + // other rules. + if (!entries.empty() && !entries.front().first.IsAbsoluteRootPath()) { + stack.emplace_back(SdfPath::AbsoluteRootPath(), Exclude); + } + + // Process each entry in lexicographical order, which ensures we process + // ancestors prior to descendants. + for (Entry &curEntry: entries) { + // Reduce the stack until we find an ancestor of 'curEntry'. Note that + // this loop will never reduce stack to empty() -- it is only possibly + // empty the first time through. + while (!stack.empty() && !curEntry.first.HasPrefix(stack.back().self)) { + reduce(stack); + } + // Push/shift this new descendant, unless it is redundant. The rule map + // computation sometimes produces redundant entries, like + // excludes=[/foo, /foo/bar]. So skip this entry if it is subsumed by + // the stack top. This is true when top=exclude and cur=exclude, or + // when top=expandPrims and cur=expandPrims, or when + // top=expandPrimsAndProps and cur!=exclude. + if (!stack.empty()) { + Rule topRule = stack.back().rule, curRule = curEntry.second; + if ((topRule == Exclude && curRule == Exclude) || + (topRule == ExpandPrims && curRule == ExpandPrims) || + (topRule == ExpandPrimsAndProps && curRule != Exclude)) { + // This entry is redundant with the stack top, so skip it. Any + // descendant entries of this curEntry will still be processed. + continue; + } + } + // Push new descendant. + stack.emplace_back(std::move(curEntry.first), curEntry.second); + } + + // Reduce the remainder of the stack to complete building the expression. + Expr result; + while (!stack.empty()) { + result = reduce(stack); + } + + // Put it all together. The overall final form of the expression is: + // + // (incl_1 + ... + incl_N) + (~(excl_1 + ... + excl_N) & result) + // ~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~ + // ^ explicitIncludes ^ ^ explicitExcludes ^ + // + // Where 'result' is the previously shift/reduce-computed expression dealing + // with hierarchical include/exclude rules, and 'incl/excl_1..N' are the + // explicit includes & excludes. + + return Expr::MakeOp(Expr::ImpliedUnion, + std::move(explicitIncludes), + Expr::MakeOp(Expr::Intersection, + Expr::MakeComplement( + std::move(explicitExcludes)), + std::move(result))); +} + PXR_NAMESPACE_CLOSE_SCOPE diff --git a/pxr/usd/usd/collectionMembershipQuery.h b/pxr/usd/usd/collectionMembershipQuery.h index 64b375d1cf..c36943e58d 100644 --- a/pxr/usd/usd/collectionMembershipQuery.h +++ b/pxr/usd/usd/collectionMembershipQuery.h @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_COLLECTION_MEMBERSHIP_QUERY_H #define PXR_USD_USD_COLLECTION_MEMBERSHIP_QUERY_H @@ -113,10 +96,10 @@ class Usd_CollectionMembershipQueryBase /// Returns a set of paths for all collections that were included in the /// collection from which this Usd_CollectionMembershipQueryBase object was - /// computed. This set is recursive, so collections that were included - /// by other collections will be part of this set. The collection from - /// which this Usd_CollectionMembershipQueryBase object was computed is *not* - /// part of this set. + /// computed. This set is recursive, so collections that were included by + /// other collections will be part of this set. The collection from which + /// this Usd_CollectionMembershipQueryBase object was computed is *not* part + /// of this set. const SdfPathSet& GetIncludedCollections() const { return _includedCollections; } @@ -168,6 +151,13 @@ class Usd_CollectionMembershipQueryBase bool _hasExcludes=false; }; +/// Compute an SdfPathExpression that matches the same paths as \p ruleMap. The +/// resulting SdfPathExpression is always complete (see +/// SdfPathExpression::IsComplete()) and never contains predicates. +USD_API +SdfPathExpression +UsdComputePathExpressionFromCollectionMembershipQueryRuleMap( + Usd_CollectionMembershipQueryBase::PathExpansionRuleMap const &ruleMap); // -------------------------------------------------------------------------- // // UsdCollectionMembershipQuery // @@ -310,10 +300,10 @@ class Usd_CollectionMembershipQuery : public Usd_CollectionMembershipQueryBase // compare equal to each other. This is because the evaluator objects // run code, and there's no good way to determine equivalence. return _topExpansionRule == rhs._topExpansionRule && - _hasExcludes == rhs._hasExcludes && - _pathExpansionRuleMap == rhs._pathExpansionRuleMap && - _includedCollections == rhs._includedCollections && - _exprEval.IsEmpty() == rhs._exprEval.IsEmpty(); + _hasExcludes == rhs._hasExcludes && + _pathExpansionRuleMap == rhs._pathExpansionRuleMap && + _includedCollections == rhs._includedCollections && + _exprEval.IsEmpty() == rhs._exprEval.IsEmpty(); ; } diff --git a/pxr/usd/usd/collectionPredicateLibrary.cpp b/pxr/usd/usd/collectionPredicateLibrary.cpp index 7bd018e868..ef1c9da4fb 100644 --- a/pxr/usd/usd/collectionPredicateLibrary.cpp +++ b/pxr/usd/usd/collectionPredicateLibrary.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usd/collectionPredicateLibrary.h" #include "pxr/usd/usd/variantSets.h" diff --git a/pxr/usd/usd/collectionPredicateLibrary.h b/pxr/usd/usd/collectionPredicateLibrary.h index ce4191df02..b114d2b057 100644 --- a/pxr/usd/usd/collectionPredicateLibrary.h +++ b/pxr/usd/usd/collectionPredicateLibrary.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_COLLECTION_PREDICATE_LIBRARY_H #define PXR_USD_USD_COLLECTION_PREDICATE_LIBRARY_H diff --git a/pxr/usd/usd/common.cpp b/pxr/usd/usd/common.cpp index 9d86e5931e..d6470cea07 100644 --- a/pxr/usd/usd/common.cpp +++ b/pxr/usd/usd/common.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/usd/common.h b/pxr/usd/usd/common.h index 3b2d8110ca..b4c6dc79a4 100644 --- a/pxr/usd/usd/common.h +++ b/pxr/usd/usd/common.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_COMMON_H #define PXR_USD_USD_COMMON_H diff --git a/pxr/usd/usd/coreValidators.cpp b/pxr/usd/usd/coreValidators.cpp new file mode 100644 index 0000000000..b9f9ceec2e --- /dev/null +++ b/pxr/usd/usd/coreValidators.cpp @@ -0,0 +1,37 @@ +// +// Copyright 2024 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// + +#include "pxr/usd/usd/validationError.h" +#include "pxr/usd/usd/validationRegistry.h" +#include "pxr/usd/usd/validatorTokens.h" +#include "pxr/usd/usd/validator.h" + +PXR_NAMESPACE_OPEN_SCOPE + +TF_REGISTRY_FUNCTION(UsdValidationRegistry) +{ + const UsdValidateStageTaskFn stageTaskFn = + [](const UsdStagePtr &usdStage) { + UsdValidationErrorVector errors; + const PcpErrorVector pcpErrors = usdStage->GetCompositionErrors(); + errors.reserve(pcpErrors.size()); + for (const PcpErrorBasePtr &pcpError : pcpErrors) { + UsdValidationErrorSites errorSites = { + UsdValidationErrorSite(usdStage, pcpError->rootSite.path)}; + errors.emplace_back(UsdValidationErrorType::Error, + std::move(errorSites), + pcpError->ToString()); + } + return errors; + }; + + UsdValidationRegistry ®istry = UsdValidationRegistry::GetInstance(); + registry.RegisterPluginValidator( + UsdValidatorNameTokens->compositionErrorTest, stageTaskFn); +} + +PXR_NAMESPACE_CLOSE_SCOPE diff --git a/pxr/usd/usd/crateData.cpp b/pxr/usd/usd/crateData.cpp index 00fb643b87..b05b547d22 100644 --- a/pxr/usd/usd/crateData.cpp +++ b/pxr/usd/usd/crateData.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usd/crateData.h" @@ -801,7 +784,7 @@ class Usd_CrateDataImpl liveFieldSets[FieldSetIndex(fsBegin-fieldSets.begin())]; dispatcher.Run( - [this, fsBegin, fsEnd, &fields, &fieldValuePairs]() mutable { + [this, fsBegin, fsEnd, &fields, &fieldValuePairs]() { try{ // XXX Won't need first two tags when bug #132031 is // addressed @@ -809,8 +792,8 @@ class Usd_CrateDataImpl "Usd", "Usd_CrateDataImpl::Open", "field data"); auto &pairs = fieldValuePairs.GetMutable(); pairs.resize(fsEnd-fsBegin); - for (size_t i = 0; fsBegin != fsEnd; ++fsBegin, ++i) { - auto const &field = fields[fsBegin->value]; + for (size_t i = 0; i < size_t(std::distance(fsBegin,fsEnd)); ++i) { + auto const &field = fields[fsBegin[i].value]; pairs[i].first = _crateFile->GetToken(field.tokenIndex); pairs[i].second = _UnpackForField(field.valueRep); diff --git a/pxr/usd/usd/crateData.h b/pxr/usd/usd/crateData.h index c86c2cdd93..1c86bf4158 100644 --- a/pxr/usd/usd/crateData.h +++ b/pxr/usd/usd/crateData.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_CRATE_DATA_H #define PXR_USD_USD_CRATE_DATA_H diff --git a/pxr/usd/usd/crateDataTypes.h b/pxr/usd/usd/crateDataTypes.h index ab22cf26cb..343db777a2 100644 --- a/pxr/usd/usd/crateDataTypes.h +++ b/pxr/usd/usd/crateDataTypes.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // // Note that changing any of the enum value numbers will break backward // compatibility. Adding additional types will not. diff --git a/pxr/usd/usd/crateFile.cpp b/pxr/usd/usd/crateFile.cpp index 5dfd9d4512..a66f654a5f 100644 --- a/pxr/usd/usd/crateFile.cpp +++ b/pxr/usd/usd/crateFile.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" @@ -3647,13 +3630,14 @@ CrateFile::_ReadPathsImpl(Reader reader, auto siblingOffset = reader.template Read(); dispatcher.Run( [this, reader, - siblingOffset, &dispatcher, parentPath]() mutable { + siblingOffset, &dispatcher, parentPath]() { // XXX Remove these tags when bug #132031 is addressed TfAutoMallocTag tag( "Usd", "Usd_CrateDataImpl::Open", "Usd_CrateFile::CrateFile::Open", "_ReadPaths"); - reader.Seek(siblingOffset); - _ReadPathsImpl
(reader, dispatcher, parentPath); + auto readerCopy = reader; + readerCopy.Seek(siblingOffset); + _ReadPathsImpl
(readerCopy, dispatcher, parentPath); }); } // Have a child (may have also had a sibling). Reset parent path. @@ -3783,7 +3767,7 @@ CrateFile::_BuildDecompressedPathsImpl( #endif dispatcher.Run( [this, &pathIndexes, &elementTokenIndexes, &jumps, - siblingIndex, &dispatcher, parentPath]() mutable { + siblingIndex, &dispatcher, parentPath]() { // XXX Remove these tags when bug #132031 is addressed TfAutoMallocTag tag( "Usd", "Usd_CrateDataImpl::Open", diff --git a/pxr/usd/usd/crateFile.h b/pxr/usd/usd/crateFile.h index 84dca91cd6..81cad78029 100644 --- a/pxr/usd/usd/crateFile.h +++ b/pxr/usd/usd/crateFile.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_CRATE_FILE_H #define PXR_USD_USD_CRATE_FILE_H @@ -348,12 +331,15 @@ class CrateFile bool operator!=(ZeroCopySource const &other) const { return !(*this == other); } - friend size_t tbb_hasher(ZeroCopySource const &z) { - return TfHash::Combine( - reinterpret_cast(z._addr), - z._numBytes - ); - } + + struct Hash { + inline size_t operator()(const ZeroCopySource& z) const { + return TfHash::Combine( + reinterpret_cast(z._addr), + z._numBytes + ); + } + }; // Return true if the refcount is nonzero. bool IsInUse() const { return _refCount; } @@ -421,7 +407,8 @@ class CrateFile ArchConstFileMapping _mapping; char const *_start; int64_t _length; - tbb::concurrent_unordered_set _outstandingRanges; + tbb::concurrent_unordered_set _outstandingRanges; }; public: diff --git a/pxr/usd/usd/crateInfo.cpp b/pxr/usd/usd/crateInfo.cpp index e5cfee75a2..e3b22c2311 100644 --- a/pxr/usd/usd/crateInfo.cpp +++ b/pxr/usd/usd/crateInfo.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usd/crateInfo.h" diff --git a/pxr/usd/usd/crateInfo.h b/pxr/usd/usd/crateInfo.h index d58e7aa6f9..3be43d24a7 100644 --- a/pxr/usd/usd/crateInfo.h +++ b/pxr/usd/usd/crateInfo.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_CRATE_INFO_H #define PXR_USD_USD_CRATE_INFO_H diff --git a/pxr/usd/usd/crateValueInliners.h b/pxr/usd/usd/crateValueInliners.h index a5a96ae934..8b8fb7df44 100644 --- a/pxr/usd/usd/crateValueInliners.h +++ b/pxr/usd/usd/crateValueInliners.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_CRATE_VALUE_INLINERS_H #define PXR_USD_USD_CRATE_VALUE_INLINERS_H diff --git a/pxr/usd/usd/debugCodes.cpp b/pxr/usd/usd/debugCodes.cpp index 3421c98703..30e6119a0c 100644 --- a/pxr/usd/usd/debugCodes.cpp +++ b/pxr/usd/usd/debugCodes.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usd/debugCodes.h" @@ -40,10 +23,6 @@ TF_REGISTRY_FUNCTION(TfDebug) "USD clip details"); TF_DEBUG_ENVIRONMENT_SYMBOL(USD_COMPOSITION, "USD composition details"); - TF_DEBUG_ENVIRONMENT_SYMBOL(USD_DATA_BD, - "USD BD file format traces"); - TF_DEBUG_ENVIRONMENT_SYMBOL(USD_DATA_BD_TRY, - "USD BD call traces. Prints names, errors and results."); TF_DEBUG_ENVIRONMENT_SYMBOL(USD_INSTANCING, "USD instancing diagnostics"); TF_DEBUG_ENVIRONMENT_SYMBOL(USD_PATH_RESOLUTION, diff --git a/pxr/usd/usd/debugCodes.h b/pxr/usd/usd/debugCodes.h index 9eb970cfcb..4c7aa43b36 100644 --- a/pxr/usd/usd/debugCodes.h +++ b/pxr/usd/usd/debugCodes.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_DEBUG_CODES_H #define PXR_USD_USD_DEBUG_CODES_H @@ -35,8 +18,6 @@ TF_DEBUG_CODES( USD_CHANGES, USD_CLIPS, USD_COMPOSITION, - USD_DATA_BD, - USD_DATA_BD_TRY, USD_INSTANCING, USD_PATH_RESOLUTION, USD_PAYLOADS, diff --git a/pxr/usd/usd/editContext.cpp b/pxr/usd/usd/editContext.cpp index c1d7e7a7a4..fa19c15fc9 100644 --- a/pxr/usd/usd/editContext.cpp +++ b/pxr/usd/usd/editContext.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usd/editContext.h" diff --git a/pxr/usd/usd/editContext.h b/pxr/usd/usd/editContext.h index 47803d3385..de09d1b4f7 100644 --- a/pxr/usd/usd/editContext.h +++ b/pxr/usd/usd/editContext.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_EDIT_CONTEXT_H #define PXR_USD_USD_EDIT_CONTEXT_H diff --git a/pxr/usd/usd/editTarget.cpp b/pxr/usd/usd/editTarget.cpp index dbae28f8c4..a1f677b8ab 100644 --- a/pxr/usd/usd/editTarget.cpp +++ b/pxr/usd/usd/editTarget.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usd/editTarget.h" diff --git a/pxr/usd/usd/editTarget.h b/pxr/usd/usd/editTarget.h index f6a8ccbf50..1e4f8eb45f 100644 --- a/pxr/usd/usd/editTarget.h +++ b/pxr/usd/usd/editTarget.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_EDIT_TARGET_H #define PXR_USD_USD_EDIT_TARGET_H diff --git a/pxr/usd/usd/errors.cpp b/pxr/usd/usd/errors.cpp index cdb462d5e8..6036c8cc5b 100644 --- a/pxr/usd/usd/errors.cpp +++ b/pxr/usd/usd/errors.cpp @@ -1,25 +1,8 @@ // // Copyright 2021 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/usd/errors.h b/pxr/usd/usd/errors.h index 33fe0d83b1..9ab756ef7e 100644 --- a/pxr/usd/usd/errors.h +++ b/pxr/usd/usd/errors.h @@ -1,25 +1,8 @@ // // Copyright 2021 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_ERRORS_H #define PXR_USD_USD_ERRORS_H diff --git a/pxr/usd/usd/examples_usd.cpp b/pxr/usd/usd/examples_usd.cpp index 86c755ea4b..aceae0fb82 100644 --- a/pxr/usd/usd/examples_usd.cpp +++ b/pxr/usd/usd/examples_usd.cpp @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usd/collectionAPI.h" diff --git a/pxr/usd/usd/flattenUtils.cpp b/pxr/usd/usd/flattenUtils.cpp index 7c2ea098dc..c0025bc174 100644 --- a/pxr/usd/usd/flattenUtils.cpp +++ b/pxr/usd/usd/flattenUtils.cpp @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usd/flattenUtils.h" diff --git a/pxr/usd/usd/flattenUtils.h b/pxr/usd/usd/flattenUtils.h index 75bf434181..64fbc99af2 100644 --- a/pxr/usd/usd/flattenUtils.h +++ b/pxr/usd/usd/flattenUtils.h @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_FLATTEN_UTILS_H #define PXR_USD_USD_FLATTEN_UTILS_H diff --git a/pxr/usd/usd/generatedSchema.usda b/pxr/usd/usd/generatedSchema.usda index 3ed639f02b..f3e0510255 100644 --- a/pxr/usd/usd/generatedSchema.usda +++ b/pxr/usd/usd/generatedSchema.usda @@ -52,8 +52,7 @@ class "APISchemaBase" ( explicit bool conversion operator. Examples of applied API schemas include UsdCollectionAPI, UsdGeomModelAPI and UsdGeomMotionAPI - \\anchor UsdAPISchemaBase_SingleVsMultipleApply - \\name Single vs. Multiple Apply API Schemas + \\subsection usd_apischemabase_single_vs_multiple_apply Single vs. Multiple Apply API Schemas Applied API schemas can further be classified into single-apply and multiple-apply API schemas. As the name suggests, a single-apply API schema @@ -103,95 +102,137 @@ class "ModelAPI" ( } class "CollectionAPI" ( - doc = """ This is a general purpose API schema, used to describe a - collection of heterogeneous objects within the scene. \"Objects\" here may be - prims or properties belonging to prims or other collections. It's an add-on - schema that can be applied many times to a prim with different collection - names. + doc = """A general purpose API schema used to describe a collection of prims + and properties within a scene. This API schema can be applied to a prim + multiple times with different instance names to define several collections + on a single prim. - A collection allows an enumeration of a set of paths to include and a - set of paths to exclude. Whether the descendants of an included - path are members of a collection are decided by its expansion rule - (see below). If the collection excludes paths that are not descendents - of included paths, the collection implicitly includes the root path - </>. If such a collection also includes paths that are not - descendants of the excluded paths, it is considered invalid, since - the intention is ambiguous. + A collection's membership is specified one of two ways. The first way uses + the built-in relationships `includes` and `excludes`, and the attribute + `includeRoot` to determine membership. The second way is termed a + pattern-based collection, and uses the built-in attribute + `membershipExpression` to determine membership. Here we will refer to + collections using `includes`, `excludes` and `includeRoot` as being in + *relationship-mode* and those using the `membershipExpression` as being in + *expression-mode*. - All the properties authored by the schema are namespaced under - \"collection:\". The given name of the collection provides additional - namespacing for the various per-collection properties, which include the - following: + A collection is determined to be in *relationship-mode* when either or both + of its `includes` and `excludes` relationships have valid targets, or the + `includeRoot` attribute is set `true`. In this case, the pattern-based + `membershipExpression` attribute is ignored. Otherwise, the collection is + in *expression-mode* and the `membershipExpression` attribute applies. -
  • uniform token collection:collectionName:expansionRule - - specified how the paths that are included in the collection must be expanded - to determine its members. Possible values include: + In *relationship-mode* the `includes` and `excludes` relationships specify + the collection members as a set of paths to include and a set of paths to + exclude. Whether or not the descendants of an included path belong to a + collection is decided by its expansion rule (see below). If the collection + excludes paths that are not descendent to included paths, the collection + implicitly includes the root path ``. If such a collection also + includes paths that are not descendent to the excluded paths, it is + considered invalid since the intent is ambiguous. + + In *expression-mode*, the pattern-based `membershipExpression` attribute is + used with the `expansionRule` attribute to determine collection membership. + See the detailed descriptions of the built-in properties below for more + details. + + Collection API Properties + + The built-in properties for this schema are in the `collection:instanceName` + namespace, where `instanceName` is the user-provided applied API schema + instance name. + +
      +
    • `uniform token collection:instanceName:expansionRule` - in + *relationship-mode*, specifies how to expand the `includes` and `excludes` + relationship targets to determine the collection's members. In + *expression-mode*, specifies how matching scene objects against the + `membershipExpression` proceeds. Possible values include:
        -
      • explicitOnly - only paths in the includes rel targets and not - in the excludes rel targets belong to the collection. +
      • `expandPrims` - in *relationship-mode*, all the prims descendent + to the `includes` relationship targets (and not descendent to `excludes` + relationship targets) belong to the collection. Any `includes`-targeted + property paths also belong to the collection. This is the default + behavior. In *expression-mode*, the functions + UsdComputeIncludedObjectsFromCollection() and + UsdComputeIncludedPathsFromCollection() only test prims against the + `membershipExpression` to determine membership.
      • -
      • expandPrims - all the prims at or below the includes rel- - targets (and not under the excludes rel-targets) belong to the - collection. Any property paths included in the collection would, of - course, also be honored. This is the default behavior as it satisfies - most use cases. +
      • `expandPrimsAndProperties` - like `expandPrims`, but in + *relationship-mode*, all properties on all included prims also belong to + the collection. In *expression-mode*, the functions + UsdComputeIncludedObjectsFromCollection() and + UsdComputeIncludedPathsFromCollection() test both prims and + properties against the `membershipExpression` to determine membership.
      • -
      • expandPrimsAndProperties - like expandPrims, but also - includes all properties on all matched prims. We're still not quite - sure what the use cases are for this, but you can use it to capture a - whole lot of UsdObjects very concisely. +
      • `explicitOnly` - in *relationship-mode*, only paths in the + `includes` relationship targets and not those in the `excludes` + relationship targets belong to the collection. Does not apply to + *expression-mode*. If set in *expression-mode*, the functions + UsdComputeIncludedObjectsFromCollection() and + UsdComputeIncludedPathsFromCollection() return no results.
      -
    • -
    • bool collection:collectionName:includeRoot - boolean - attribute indicating whether the pseudo-root path </> should - be counted as one of the included target paths. The fallback is false. - This separate attribute is required because relationships cannot - directly target the root. When expansionRule is explicitOnly, this - attribute is ignored. -
    • rel collection:collectionName:includes - specifies a list - of targets that are included in the collection. This can target prims or - properties directly. A collection can insert the rules of another - collection by making its includes relationship target the - collection:{collectionName} property on the owning prim of the - collection to be included (see UsdCollectionAPI::GetCollectionAttr). - It is important to note that including another collection does not - guarantee the contents of that collection will be in the final collection; - instead, the rules are merged. This means, for example, an exclude - entry may exclude a portion of the included collection. - When a collection includes one or more collections, the order in which - targets are added to the includes relationship may become significant, if - there are conflicting opinions about the same path. Targets that are added - later are considered to be stronger than earlier targets for the same path. -
    • -
    • rel collection:collectionName:excludes - specifies a list - of targets that are excluded below the included paths in this - collection. This can target prims or properties directly, but cannot - target another collection. This is to keep the membership determining - logic simple, efficient and easier to reason about. Finally, it is invalid - for a collection to exclude paths that are not included in it. The presence - of such \"orphaned\" excluded paths will not affect the set of paths included - in the collection, but may affect the performance of querying membership of - a path in the collection (see UsdCollectionAPI::MembershipQuery::IsPathIncluded) - or of enumerating the objects belonging to the collection (see - UsdCollectionAPI::GetIncludedObjects). -
    • -
    • uniform opaque collection:collectionName - opaque +
    • + +
    • `bool collection:instanceName:includeRoot` - boolean attribute + indicating whether the pseudo-root path `` should be counted as one + of the included target paths in *relationship-mode*. This separate attribute + is required because relationships cannot directly target the root. When + `expansionRule` is `explicitOnly`, this attribute is ignored. The fallback + value is false. When set to `true`, this collection is in + *relationship-mode*. This attribute is ignored in *expression-mode*.
    • + +
    • `rel collection:instanceName:includes` - in *relationship-mode*, + specifies a list of targets that are included in the collection. This can + target prims or properties directly. A collection can insert the rules of + another collection by making its `includes` relationship target the + `collection:otherInstanceName` property from the collection to be included + (see UsdCollectionAPI::GetCollectionAttr). Note that including another + collection does not guarantee the contents of that collection will be in the + final collection; instead, the rules are merged. This means, for example, + an exclude entry may exclude a portion of the included collection. When a + collection includes one or more collections, the order in which targets are + added to the includes relationship may become significant, if there are + conflicting opinions about the same path. Targets that are added later are + considered to be stronger than earlier targets for the same path. This + relationship is ignored in *expression-mode*.
    • + +
    • `rel collection:instanceName:excludes` - in *relationship-mode*, + specifies a list of targets that are excluded below the included + paths in this collection. This can target prims or properties directly, but + cannot target another collection. This is to keep the membership + determining logic simple, efficient and easier to reason about. Finally, it + is invalid for a collection to exclude paths that are not included in + it. The presence of such \"orphaned\" excluded paths will not affect the set + of paths included in the collection, but may affect the performance of + querying membership of a path in the collection (see + UsdCollectionMembershipQuery::IsPathIncluded) or of enumerating the + objects belonging to the collection (see + UsdCollectionAPI::ComputeIncludedObjects). This relationship is ignored in + *expression-mode*.
    • + +
    • `uniform opaque collection:instanceName` - opaque attribute (meaning it can never have a value) that represents the collection - for the purpose of allowing another collection to include it. When this - property is targeted by another collection's includes relationship, - the rules of this collection will be inserted into the rules of the collection - that includes it. -
    + for the purpose of allowing another collection to include it in + *relationship-mode*. When this property is targeted by another collection's + `includes` relationship, the rules of this collection will be inserted + into the rules of the collection that includes it.
  • + +
  • `uniform pathExpression collection:instanceName:membershipExpression` - + in *expression-mode*, defines the SdfPathExpression used to test + objects for collection membership.
  • + +
- Implicit inclusion + \\subsection usd_collectionapi_implicit_inclusion Implicit Inclusion In some scenarios it is useful to express a collection that includes - everything except certain paths. To support this, a collection - that has an exclude that is not a descendent of any include - will include the root path </>. + everything except certain paths. To support this, a *relationship-mode* + collection that has an exclude that is not descendent to any include will + include the root path ``. - Creating collections in C++ + Creating Collections in C++ \\snippet examples_usd.cpp ApplyCollections """ @@ -226,7 +267,7 @@ class "CollectionAPI" ( ) uniform bool collection:__INSTANCE_NAME__:includeRoot ( doc = """Boolean attribute indicating whether the pseudo-root - path </> should be counted as one of the included target + path `` should be counted as one of the included target paths. The fallback is false. This separate attribute is required because relationships cannot directly target the root.""" ) diff --git a/pxr/usd/usd/inherits.cpp b/pxr/usd/usd/inherits.cpp index 62f56fa863..e4496d24e8 100644 --- a/pxr/usd/usd/inherits.cpp +++ b/pxr/usd/usd/inherits.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usd/common.h" diff --git a/pxr/usd/usd/inherits.h b/pxr/usd/usd/inherits.h index e5b617e190..8f88090368 100644 --- a/pxr/usd/usd/inherits.h +++ b/pxr/usd/usd/inherits.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_INHERITS_H #define PXR_USD_USD_INHERITS_H diff --git a/pxr/usd/usd/instanceCache.cpp b/pxr/usd/usd/instanceCache.cpp index cf4dbbd6ac..1d9b603440 100644 --- a/pxr/usd/usd/instanceCache.cpp +++ b/pxr/usd/usd/instanceCache.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usd/instanceCache.h" diff --git a/pxr/usd/usd/instanceCache.h b/pxr/usd/usd/instanceCache.h index 4b7c948de2..3f32e74c0c 100644 --- a/pxr/usd/usd/instanceCache.h +++ b/pxr/usd/usd/instanceCache.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_INSTANCE_CACHE_H #define PXR_USD_USD_INSTANCE_CACHE_H diff --git a/pxr/usd/usd/instanceKey.cpp b/pxr/usd/usd/instanceKey.cpp index 51a045a8b8..1ffdc3e8ae 100644 --- a/pxr/usd/usd/instanceKey.cpp +++ b/pxr/usd/usd/instanceKey.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usd/instanceKey.h" diff --git a/pxr/usd/usd/instanceKey.h b/pxr/usd/usd/instanceKey.h index 8887717c30..a79802702b 100644 --- a/pxr/usd/usd/instanceKey.h +++ b/pxr/usd/usd/instanceKey.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_INSTANCE_KEY_H #define PXR_USD_USD_INSTANCE_KEY_H diff --git a/pxr/usd/usd/integerCoding.cpp b/pxr/usd/usd/integerCoding.cpp index 28716aac76..95d8304d0d 100644 --- a/pxr/usd/usd/integerCoding.cpp +++ b/pxr/usd/usd/integerCoding.cpp @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/base/tf/diagnostic.h" diff --git a/pxr/usd/usd/integerCoding.h b/pxr/usd/usd/integerCoding.h index 9da1554862..2e04af3150 100644 --- a/pxr/usd/usd/integerCoding.h +++ b/pxr/usd/usd/integerCoding.h @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_INTEGER_CODING_H #define PXR_USD_USD_INTEGER_CODING_H diff --git a/pxr/usd/usd/interpolation.cpp b/pxr/usd/usd/interpolation.cpp index 6272b5cfc6..96dbea51bf 100644 --- a/pxr/usd/usd/interpolation.cpp +++ b/pxr/usd/usd/interpolation.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usd/interpolation.h" diff --git a/pxr/usd/usd/interpolation.h b/pxr/usd/usd/interpolation.h index 8f4c507c75..412dc8923d 100644 --- a/pxr/usd/usd/interpolation.h +++ b/pxr/usd/usd/interpolation.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_INTERPOLATION_H #define PXR_USD_USD_INTERPOLATION_H diff --git a/pxr/usd/usd/interpolators.cpp b/pxr/usd/usd/interpolators.cpp index 5e8e0f5ee2..774f5c84e5 100644 --- a/pxr/usd/usd/interpolators.cpp +++ b/pxr/usd/usd/interpolators.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usd/interpolators.h" diff --git a/pxr/usd/usd/interpolators.h b/pxr/usd/usd/interpolators.h index 41e7c80c63..6cdb15f350 100644 --- a/pxr/usd/usd/interpolators.h +++ b/pxr/usd/usd/interpolators.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_INTERPOLATORS_H #define PXR_USD_USD_INTERPOLATORS_H diff --git a/pxr/usd/usd/listEditImpl.h b/pxr/usd/usd/listEditImpl.h index 4f3e1ec455..eead67cafc 100644 --- a/pxr/usd/usd/listEditImpl.h +++ b/pxr/usd/usd/listEditImpl.h @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_LIST_EDIT_IMPL_H #define PXR_USD_USD_LIST_EDIT_IMPL_H diff --git a/pxr/usd/usd/modelAPI.cpp b/pxr/usd/usd/modelAPI.cpp index ad6470342e..da03dd125b 100644 --- a/pxr/usd/usd/modelAPI.cpp +++ b/pxr/usd/usd/modelAPI.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usd/modelAPI.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usd/modelAPI.h b/pxr/usd/usd/modelAPI.h index a71e643dae..3b87d5aa8e 100644 --- a/pxr/usd/usd/modelAPI.h +++ b/pxr/usd/usd/modelAPI.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USD_GENERATED_MODELAPI_H #define USD_GENERATED_MODELAPI_H diff --git a/pxr/usd/usd/module.cpp b/pxr/usd/usd/module.cpp index b7586cec11..b984549688 100644 --- a/pxr/usd/usd/module.cpp +++ b/pxr/usd/usd/module.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/base/tf/pyModule.h" diff --git a/pxr/usd/usd/moduleDeps.cpp b/pxr/usd/usd/moduleDeps.cpp index 7b33cd54ba..1a3632da7a 100644 --- a/pxr/usd/usd/moduleDeps.cpp +++ b/pxr/usd/usd/moduleDeps.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/pxr/usd/usd/namespaceEditor.cpp b/pxr/usd/usd/namespaceEditor.cpp index 5438021a2b..ff2187a4df 100644 --- a/pxr/usd/usd/namespaceEditor.cpp +++ b/pxr/usd/usd/namespaceEditor.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usd/namespaceEditor.h" @@ -295,6 +278,22 @@ UsdNamespaceEditor::UsdNamespaceEditor(const UsdStageRefPtr &stage) { } +UsdNamespaceEditor::UsdNamespaceEditor( + const UsdStageRefPtr &stage, + EditOptions &&editOptions) + : _stage(stage) + , _editOptions(std::move(editOptions)) +{ +} + +UsdNamespaceEditor::UsdNamespaceEditor( + const UsdStageRefPtr &stage, + const EditOptions &editOptions) + : _stage(stage) + , _editOptions(editOptions) +{ +} + bool UsdNamespaceEditor::DeletePrimAtPath( const SdfPath &path) @@ -561,31 +560,35 @@ class UsdNamespaceEditor::_EditProcessor { // Creates a processed edit from an edit description. static UsdNamespaceEditor::_ProcessedEdit ProcessEdit( const UsdStageRefPtr &stage, - const UsdNamespaceEditor::_EditDescription &editDesc); + const UsdNamespaceEditor::_EditDescription &editDesc, + const UsdNamespaceEditor::EditOptions &editOptions); private: - static void _ProcessPrimEditRequiresRelocates( - const _EditDescription &editDesc, - const PcpPrimIndex &primIndex, - const PcpNodeRef &nodeForEditTarget, + _EditProcessor( + const UsdStageRefPtr &stage, + const UsdNamespaceEditor::_EditDescription &editDesc, + const UsdNamespaceEditor::EditOptions &editOptions, _ProcessedEdit *processedEdit); - static void _ProcessPropEditRequiresRelocates( - const _EditDescription &editDesc, - const PcpPrimIndex &primIndex, - const PcpNodeRef &nodeForEditTarget, - _ProcessedEdit *processedEdit); + bool _ProcessNewPath(); - static void _GatherLayersToEdit( - const _EditDescription &editDesc, - const UsdEditTarget &editTarget, - const PcpPrimIndex &primIndex, - _ProcessedEdit *processedEdit); + void _ProcessPrimEditRequiresRelocates( + const PcpPrimIndex &primIndex); - static void _GatherTargetListOpEdits( - const UsdStageRefPtr &stage, - const _EditDescription &editDesc, - _ProcessedEdit *processedEdit); + void _ProcessPropEditRequiresRelocates( + const PcpPrimIndex &primIndex); + + void _GatherLayersToEdit(); + + void _GatherTargetListOpEdits(); + + const UsdStageRefPtr & _stage; + const UsdNamespaceEditor::_EditDescription & _editDesc; + const UsdEditTarget &_editTarget; + const UsdNamespaceEditor::EditOptions & _editOptions; + _ProcessedEdit *_processedEdit; + + PcpNodeRef _nodeForEditTarget; }; void @@ -598,7 +601,7 @@ UsdNamespaceEditor::_ProcessEditsIfNeeded() const return; } _processedEdit = UsdNamespaceEditor::_EditProcessor::ProcessEdit( - _stage, _editDescription); + _stage, _editDescription, _editOptions); } static @@ -744,153 +747,242 @@ _IsValidNewParentPath( UsdNamespaceEditor::_ProcessedEdit UsdNamespaceEditor::_EditProcessor::ProcessEdit( const UsdStageRefPtr &stage, - const _EditDescription &editDesc) + const _EditDescription &editDesc, + const EditOptions &editOptions) { _ProcessedEdit processedEdit; + _EditProcessor(stage, editDesc, editOptions, &processedEdit); + return processedEdit; +} +UsdNamespaceEditor::_EditProcessor::_EditProcessor( + const UsdStageRefPtr &stage, + const UsdNamespaceEditor::_EditDescription &editDesc, + const UsdNamespaceEditor::EditOptions &editOptions, + _ProcessedEdit *processedEdit) + : _stage(stage) + , _editDesc(editDesc) + , _editTarget(stage->GetEditTarget()) + , _editOptions(editOptions) + , _processedEdit(processedEdit) +{ if (editDesc.editType == _EditType::Invalid) { - processedEdit.errors.push_back("There are no valid edits to perform"); - return processedEdit; + _processedEdit->errors.push_back("There are no valid edits to perform"); + return; } // Add the edit to the processed SdfBatchNamespaceEdit. We use the index of // "Same" specifically so renames don't move the object (it has no effect // for any edits other than rename) - processedEdit.edits.Add( + _processedEdit->edits.Add( editDesc.oldPath, editDesc.newPath, SdfNamespaceEdit::Same); // Validate whether the stage has the prim or property at the original path // that can be namespace edited. - const UsdPrim prim = stage->GetPrimAtPath(editDesc.oldPath.GetPrimPath()); + const UsdPrim prim = stage->GetPrimAtPath(_editDesc.oldPath.GetPrimPath()); std::string error; if (editDesc.IsPropertyEdit()) { - if (!_IsValidPropertyToEdit(prim, editDesc.oldPath.GetNameToken(), &error)) { - processedEdit.errors.push_back(std::move(error)); - return processedEdit; + if (!_IsValidPropertyToEdit(prim, _editDesc.oldPath.GetNameToken(), &error)) { + _processedEdit->errors.push_back(std::move(error)); + return; } } else if (!_IsValidPrimToEdit(prim, &error)) { - processedEdit.errors.push_back(std::move(error)); - return processedEdit; + _processedEdit->errors.push_back(std::move(error)); + return; + } + + const PcpPrimIndex &primIndex = prim.GetPrimIndex(); + // XXX: To start, we're only going to perform namespace edit operations + // using the root layer stack. This will be updated to support edit targets + // as a later task. + _nodeForEditTarget = primIndex.GetRootNode(); + + if (!_ProcessNewPath()) { + return; + } + + if (_editDesc.IsPropertyEdit()) { + // Determine if editing the path would require relocates. + _ProcessPropEditRequiresRelocates(primIndex); + } else { + // Determine if editing the path would require relocates. + _ProcessPrimEditRequiresRelocates(primIndex); + } + + // Gather all layers with contributing specs to the old path that will need + // to be edited when the edits are applied. + _GatherLayersToEdit(); + + // Gather all the edits that need to be made to target path listOps in + // property specs in order to "fix up" properties that have connections or + // relationship targets targeting the namespace edited object. + _GatherTargetListOpEdits(); +} + +bool +UsdNamespaceEditor::_EditProcessor::_ProcessNewPath() +{ + // Empty path is a delete so the new path is automatically valid. + if (_editDesc.newPath.IsEmpty()) { + return true; } // For move edits we'll have a new path; verify that the stage doesn't // already have an object at that path. - if (!editDesc.newPath.IsEmpty() && - stage->GetObjectAtPath(editDesc.newPath)) { - processedEdit.errors.push_back("An object already exists at the new path"); - return processedEdit; + if (_stage->GetObjectAtPath(_editDesc.newPath)) { + _processedEdit->errors.push_back( + "An object already exists at the new path"); + return false; } // For reparenting we have additional behaviors and validation to perform. - if (editDesc.editType == _EditType::Reparent) { + if (_editDesc.editType == _EditType::Reparent) { // For each layer we edit, we may need to create new overs for the new // parent path and delete inert ancestor overs after moving a prim or // property from its original parent, so add this info to the processed // edit. - processedEdit.createParentSpecIfNeededPath = - editDesc.newPath.GetParentPath(); - processedEdit.removeInertAncestorOvers = true; + _processedEdit->createParentSpecIfNeededPath = + _editDesc.newPath.GetParentPath(); + _processedEdit->removeInertAncestorOvers = true; // Validate that the stage does have a prim at the new parent path to // reparent to. std::string whyNot; - if (!_IsValidNewParentPath(stage, editDesc.oldPath, - processedEdit.createParentSpecIfNeededPath, &whyNot)) { - processedEdit.errors.push_back(std::move(whyNot)); - return processedEdit; + if (!_IsValidNewParentPath(_stage, _editDesc.oldPath, + _processedEdit->createParentSpecIfNeededPath, &whyNot)) { + _processedEdit->errors.push_back(std::move(whyNot)); + return false; } } - // Gather all layers with contributing specs to the old path that will need - // to be edited when the edits are applied. This will also determine if the - // edit requires relocates. - _GatherLayersToEdit( - editDesc, - stage->GetEditTarget(), - prim.GetPrimIndex(), - &processedEdit); - - // At the point in which this function is called, the prim must exist on the - // stage. So if we didn't find any specs to edit, then we must've found - // specs across a composition arc that requires relocates. Verifying this - // as a sanity check. - if (processedEdit.layersToEdit.empty()) { - TF_VERIFY(processedEdit.requiresRelocates); - return processedEdit; + // For property edits we're done at this point. + if (_editDesc.IsPropertyEdit()) { + return true; } - // Gather all the edits that need to be made to target path listOps in - // property specs in order to "fix up" properties that have connections or - // relationship targets targeting the namespace edited object. - _GatherTargetListOpEdits(stage, editDesc, &processedEdit); + // For prim moves, we need to check whether the new path is prohibited + // because of relocates. + // The parent prim will be able to tell us if the child name that we're + // moving and/or renaming this to is prohibited. + UsdPrim newParentPrim = _stage->GetPrimAtPath( + _editDesc.newPath.GetParentPath()); + if (!newParentPrim) { + TF_CODING_ERROR("Parent prim at path %s does not exist", + _editDesc.newPath.GetParentPath().GetText()); + return false; + } - return processedEdit; + // XXX: We compute the prohibited children from the parent prim + // index. Given that the prohibited children are always composed + // with the actual child names, we could cache this when the + // stage is populated and exposed the prohibited children in API on + // UsdPrim. But for now we'll compose them as needed when processing + // namespace edits. + const PcpPrimIndex &newParentPrimIndex = newParentPrim.GetPrimIndex(); + TfTokenVector childNames; + PcpTokenSet prohibitedChildren; + newParentPrimIndex.ComputePrimChildNames( + &childNames, &prohibitedChildren); + + // If the parent does not prohibit a child with our name, we're good, + // otherwise we can't move the prim to the new path. + if (prohibitedChildren.count(_editDesc.newPath.GetNameToken()) == 0) { + return true; + } + + // But there is one exception! If this layer stack has a relocation from the + // new path to the old path, then we are allowed to move the prim back to + // its original location by removing the relocation. + const SdfRelocatesMap &localRelocates = + _nodeForEditTarget.GetLayerStack()->GetIncrementalRelocatesSourceToTarget(); + const auto foundIt = localRelocates.find(_editDesc.newPath); + if (foundIt != localRelocates.end() && foundIt->second == _editDesc.oldPath) { + return true; + } + + _processedEdit->errors.push_back("The new path is a prohibited child of " + "its parent path because of existing relocates."); + return false; } -/*static*/ void UsdNamespaceEditor::_EditProcessor::_ProcessPrimEditRequiresRelocates( - const _EditDescription &editDesc, - const PcpPrimIndex &primIndex, - const PcpNodeRef &nodeForEditTarget, - _ProcessedEdit *processedEdit) + const PcpPrimIndex &primIndex) { - // Check to see if there are any contributing specs that would require - // relocates. These are specs that would continue to be mapped to the - // same path across the edit target's node even after all specs are edited - // in its layer stack. - const auto range = nodeForEditTarget.GetChildrenRange(); - for (const auto &child : range) { - // If a child node is a direct arc, we can skip it and its entire - // subtree as all the specs at or below this node are mapped to the - // prim path (whatever it may be) through this child node. - if (!child.IsDueToAncestor()) { - continue; + const bool requiresRelocatesAuthoring = [&](){ + // First check: if the path that is being moved or deleted is already + // the target of a relocation in the local layer stack, then the + // local layer relocates will need to be updated to perform the edit + // operation. + const SdfRelocatesMap &targetToSourceRelocates = + _nodeForEditTarget.GetLayerStack() + ->GetIncrementalRelocatesTargetToSource(); + if (targetToSourceRelocates.count(_editDesc.oldPath)) { + return true; } - // Since the child node is an ancestral arc, the mapping of specs across - // the child node is not affected by the path of this prim itself and - // will continue to map to the original path after the edit. So if there - // are any specs in the child's subtree, then this edit will require - // relocates - PcpNodeRange subtreeRange = primIndex.GetNodeSubtreeRange(child); - for (const PcpNodeRef &subtreeNode : subtreeRange) { - // A node has contributing specs if it has specs and is not inert. - if (subtreeNode.HasSpecs() && !subtreeNode.IsInert()) { - processedEdit->requiresRelocates = true; - - // Relocates support is not implemented yet so it's currently an - // error if the edit requires it.. - if (editDesc.editType == _EditType::Delete) { - // "Relocates" means deactivating the prim in the deletion - // case. - processedEdit->errors.push_back("The prim to delete must " - "be deactivated rather than deleted since it composes " - "opinions introduced by ancestral composition arcs; " - "deletion via deactivation is not yet supported"); - } else { - processedEdit->errors.push_back("The prim to move requires " - "authoring relocates since it composes opinions " - "introduced by ancestral composition arcs; authoring " - "relocates is not yet supported"); + // Check to see if there are any contributing specs that would require + // relocates. These are specs that would continue to be mapped to the + // same path across the edit target's node even after all specs are + // edited in its layer stack. + const auto range = _nodeForEditTarget.GetChildrenRange(); + for (const auto &child : range) { + // If a child node is a direct arc, we can skip it and its entire + // subtree as all the specs at or below this node are mapped to the + // prim path (whatever it may be) through this child node. + if (!child.IsDueToAncestor()) { + continue; + } + + // Since the child node is an ancestral arc, the mapping of specs + // across the child node is not affected by the path of this prim + // itself and will continue to map to the original path after the + // edit. So if there are any specs in the child's subtree, then this + // edit will require relocates + PcpNodeRange subtreeRange = primIndex.GetNodeSubtreeRange(child); + for (const PcpNodeRef &subtreeNode : subtreeRange) { + // A node has contributing specs if it has specs and is not + // inert. + if (subtreeNode.HasSpecs() && !subtreeNode.IsInert()) { + return true; } - - // Once we've determined the edits require relocates, we're done. - return; } } + + return false; + }(); + + if (!requiresRelocatesAuthoring) { + return; } + + // If relocates authoring is not allowed, log an error and return; we + // won't be able to apply this edit. + if (!_editOptions.allowRelocatesAuthoring) { + _processedEdit->errors.push_back("The prim to edit requires " + "authoring relocates since it composes opinions " + "introduced by ancestral composition arcs; relocates " + "authoring must be enabled to perform this edit"); + return; + } + + // Otherwise, use the relocates builder to get all the relocates metadata + // that needs to be authored in each layer to move old path to new path. + PcpLayerRelocatesEditBuilder builder( + _nodeForEditTarget.GetLayerStack(), _editTarget.GetLayer()); + std::string error; + if (!builder.Relocate(_editDesc.oldPath, _editDesc.newPath, &error)) { + TF_CODING_ERROR("Cannot get relocates edits because: %s", + error.c_str()); + } + _processedEdit->relocatesEdits = builder.GetEdits(); } -/*static*/ void UsdNamespaceEditor::_EditProcessor::_ProcessPropEditRequiresRelocates( - const _EditDescription &editDesc, - const PcpPrimIndex &primIndex, - const PcpNodeRef &nodeForEditTarget, - _ProcessedEdit *processedEdit) + const PcpPrimIndex &primIndex) { - const TfToken &propName = editDesc.oldPath.GetNameToken(); + const TfToken &propName = _editDesc.oldPath.GetNameToken(); // Check to see if there are any contributing specs that would require // relocates. These are specs that would continue to be mapped to the @@ -901,7 +993,8 @@ UsdNamespaceEditor::_EditProcessor::_ProcessPropEditRequiresRelocates( // properties since properties don't define composition arcs. So we look // for property specs in every node under the edit target node as those // can't be namespace edited without relocates. - PcpNodeRange subtreeRange = primIndex.GetNodeSubtreeRange(nodeForEditTarget); + PcpNodeRange subtreeRange = + primIndex.GetNodeSubtreeRange(_nodeForEditTarget); // Skip the node itself; we want to check its descendants. ++subtreeRange.first; @@ -936,58 +1029,35 @@ UsdNamespaceEditor::_EditProcessor::_ProcessPropEditRequiresRelocates( // If we found a property spec, the edit requires relocates. if (hasPropertySpecs) { - processedEdit->requiresRelocates = true; - - // Relocates support is not implemented yet so it's currently an + // There is no plan to support relocates for properties so it's an // error if the edit requires it. - if (editDesc.editType == _EditType::Delete) { - // "Relocates" means deactivating the property in the deletion - // case. - processedEdit->errors.push_back("The property to delete must " - "be deactivated rather than deleted since it composes " - "opinions introduced by ancestral composition arcs; " - "deletion via deactivation is not yet supported"); - } else { - processedEdit->errors.push_back("The property to move requires " - "authoring relocates since it composes opinions " - "introduced by ancestral composition arcs; authoring " - "relocates is not supported for properties"); - } - - // Once we've determined the edits require relocates, we're done. + _processedEdit->errors.push_back("The property to edit requires " + "authoring relocates since it composes opinions " + "introduced by ancestral composition arcs; authoring " + "relocates is not supported for properties"); return; } } } -/*static*/ void -UsdNamespaceEditor::_EditProcessor::_GatherLayersToEdit( - const _EditDescription &editDesc, - const UsdEditTarget &editTarget, - const PcpPrimIndex &primIndex, - _ProcessedEdit *processedEdit) +UsdNamespaceEditor::_EditProcessor::_GatherLayersToEdit() { - // XXX: To start, we're only going to perform namespace edit operations - // using the root layer stack. This will be updated to support edit targets - // as a later task. - const PcpNodeRef nodeForEditTarget = primIndex.GetRootNode(); - // Get all the layers in the layer stack where the edits will be performed. const SdfLayerRefPtrVector &layers = - nodeForEditTarget.GetLayerStack()->GetLayers(); + _nodeForEditTarget.GetLayerStack()->GetLayers(); // Until we support edit targets, verify that the stage's current edit // target maps to the prim's local opinions in the root layer stack. - if (!editTarget.GetMapFunction().IsIdentityPathMapping()) { - processedEdit->errors.push_back("Edit targets that map paths across " + if (!_editTarget.GetMapFunction().IsIdentityPathMapping()) { + _processedEdit->errors.push_back("Edit targets that map paths across " "composition arcs are not currently supported for namespace " "editing"); return; } - if (std::find(layers.begin(), layers.end(), editTarget.GetLayer()) + if (std::find(layers.begin(), layers.end(), _editTarget.GetLayer()) == layers.end()) { - processedEdit->errors.push_back("Edit targets with layers outside of " + _processedEdit->errors.push_back("Edit targets with layers outside of " "the root layer stack are not currently supported for namespace " "editing"); return; @@ -996,54 +1066,42 @@ UsdNamespaceEditor::_EditProcessor::_GatherLayersToEdit( // Collect every prim spec that exists for this prim path in the layer // stack's layers. for (const SdfLayerRefPtr &layer : layers) { - if (layer->HasSpec(editDesc.oldPath)) { - processedEdit->layersToEdit.push_back(layer); + if (layer->HasSpec(_editDesc.oldPath)) { + _processedEdit->layersToEdit.push_back(layer); } } - // Determine if editing the path would require relocates. - if (editDesc.IsPropertyEdit()) { - _ProcessPropEditRequiresRelocates( - editDesc, primIndex, nodeForEditTarget, processedEdit); - } else { - _ProcessPrimEditRequiresRelocates( - editDesc, primIndex, nodeForEditTarget, processedEdit); - } - // Validate whether the necessary spec edits can actually be performed on // each layer that needs to be edited. - for (const auto &layer : processedEdit->layersToEdit) { + for (const auto &layer : _processedEdit->layersToEdit) { // The layer itself needs to be editable if (!layer->PermissionToEdit()) { - processedEdit->errors.push_back(TfStringPrintf("The spec @%s@<%s> " + _processedEdit->errors.push_back(TfStringPrintf("The spec @%s@<%s> " "cannot be edited because the layer is not editable", layer->GetIdentifier().c_str(), - editDesc.oldPath.GetText())); + _editDesc.oldPath.GetText())); } // If we're moving an object to a new path, the layer cannot have a // spec already at the new path. - if (!editDesc.newPath.IsEmpty() && layer->HasSpec(editDesc.newPath)) { - processedEdit->errors.push_back(TfStringPrintf("The spec @%s@<%s> " + if (!_editDesc.newPath.IsEmpty() && layer->HasSpec(_editDesc.newPath)) { + _processedEdit->errors.push_back(TfStringPrintf("The spec @%s@<%s> " "cannot be moved to <%s> because a spec already exists at " "the new path", layer->GetIdentifier().c_str(), - editDesc.oldPath.GetText(), - editDesc.newPath.GetText())); + _editDesc.oldPath.GetText(), + _editDesc.newPath.GetText())); } } } void -UsdNamespaceEditor::_EditProcessor::_GatherTargetListOpEdits( - const UsdStageRefPtr &stage, - const _EditDescription &editDesc, - _ProcessedEdit *processedEdit) +UsdNamespaceEditor::_EditProcessor::_GatherTargetListOpEdits() { // Gather all the dependencies from stage namespace path to properties with // relationship targets or attributes connections that depend on that // namespace path. _TargetingPropertyDependencies deps = - _TargetingPropertyDependencyCollector::GetDependencies(stage); + _TargetingPropertyDependencyCollector::GetDependencies(_stage); // With all the target path dependencies we need to determine which // targeting properties are affected by this particular edit. If the edit @@ -1053,7 +1111,7 @@ UsdNamespaceEditor::_EditProcessor::_GatherTargetListOpEdits( SdfPathSet propPathsWithAffectedTargets; const auto range = deps.targetedPathToTargetingPropertiesPathTable.FindSubtreeRange( - editDesc.oldPath); + _editDesc.oldPath); for (auto it = range.first; it != range.second; ++it) { const SdfPathVector &propPaths = it->second; propPathsWithAffectedTargets.insert(propPaths.begin(), propPaths.end()); @@ -1097,29 +1155,36 @@ UsdNamespaceEditor::_EditProcessor::_GatherTargetListOpEdits( } // If the path doesn't start with the old path, it is not // affected and returned unmodified. - if (!path.HasPrefix(editDesc.oldPath)) { + if (!path.HasPrefix(_editDesc.oldPath)) { return std::optional(path); } // Otherwise we found an affected path. If we've deleted // the old path, delete this target item. - if (editDesc.newPath.IsEmpty()) { + if (_editDesc.newPath.IsEmpty()) { return std::optional(); } // Otherwise update the path of this target item for the // new path. return std::optional( - path.ReplacePrefix(editDesc.oldPath, editDesc.newPath)); + path.ReplacePrefix(_editDesc.oldPath, _editDesc.newPath)); })) { // If the target list op was modified, add the edit we need // to perform for this spec in the processed edit. - processedEdit->targetPathListOpEdits.push_back( + _processedEdit->targetPathListOpEdits.push_back( {specInfo.layer->GetPropertyAtPath(specInfo.path), specInfo.fieldName, std::move(targetListOp)}); } } + // If we added relocates for this edit already, then the target paths + // authored across composition arcs will also be mapped by the + // relocation. + if (!_processedEdit->relocatesEdits.empty()) { + continue; + } + // For target paths that are contributed by specs that originate across // arcs below the root node, we can't edit these specs directly. // Instead we'd need relocates to map these paths. In this case we find @@ -1149,7 +1214,7 @@ UsdNamespaceEditor::_EditProcessor::_GatherTargetListOpEdits( // affected by the namespace edit; we don't care about these // either. if (translatedPath.IsEmpty() || - !translatedPath.HasPrefix(editDesc.oldPath)) { + !translatedPath.HasPrefix(_editDesc.oldPath)) { return std::optional(); } return std::optional(translatedPath); @@ -1160,16 +1225,19 @@ UsdNamespaceEditor::_EditProcessor::_GatherTargetListOpEdits( // list op error in the processed edit. if (!targetsRequireRelocates.empty()) { const bool isAttribute = - stage->GetObjectAtPath(propertyPath).Is(); - processedEdit->targetPathListOpErrors.push_back(TfStringPrintf( - "The %s at '%s' has the following %s paths [%s] which require " - "authoring relocates to be retargeted because they are " - "introduced by opinions from composition arcs; authoring " - "relocates is not yet supported", + _stage->GetObjectAtPath(propertyPath).Is(); + _processedEdit->targetPathListOpErrors.push_back(TfStringPrintf( + "Fixing the %s paths %s for the %s at '%s' would require " + "'%s'to be relocated but we do not introduce relocates for %s.", + isAttribute ? "connection" : "relationship", + TfStringify(targetsRequireRelocates).c_str(), isAttribute ? "attribute" : "relationship", propertyPath.GetText(), - isAttribute ? "connection" : "relationship target", - TfStringify(targetsRequireRelocates).c_str())); + _editDesc.oldPath.GetText(), + _editDesc.IsPropertyEdit() ? + "properties ever" : + "prims that do not have opinions across composition arcs" + )); } } } @@ -1254,6 +1322,11 @@ UsdNamespaceEditor::_ProcessedEdit::Apply() } } + // Set any necessary relocates. + for (const auto &[layer, relocatesValue] : relocatesEdits) { + layer->SetRelocates(relocatesValue); + } + // Perform any target path listOp fixups necessary now that the namespace // edits have been successfully performed. for (const TargetPathListOpEdit &edit : targetPathListOpEdits) { @@ -1268,8 +1341,8 @@ UsdNamespaceEditor::_ProcessedEdit::Apply() // Errors in fixing up targets do not prevent us from applying namespace // edits, but we report them as warnings. if (!targetPathListOpErrors.empty()) { - TF_WARN("The follow target path or connections could not be " - "updated for the namespace edit: %s", + TF_WARN("Failed to update the following targets and/or connections for " + "the namespace edit: %s", _GetErrorString(targetPathListOpErrors).c_str()); } diff --git a/pxr/usd/usd/namespaceEditor.h b/pxr/usd/usd/namespaceEditor.h index aa79e28ad8..25a7e56beb 100644 --- a/pxr/usd/usd/namespaceEditor.h +++ b/pxr/usd/usd/namespaceEditor.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_NAMESPACE_EDITOR_H #define PXR_USD_USD_NAMESPACE_EDITOR_H @@ -30,6 +13,7 @@ #include "pxr/usd/usd/api.h" #include "pxr/usd/usd/common.h" #include "pxr/usd/usd/stage.h" +#include "pxr/usd/pcp/layerRelocatesEditBuilder.h" #include "pxr/usd/sdf/namespaceEdit.h" @@ -43,9 +27,31 @@ PXR_NAMESPACE_OPEN_SCOPE class UsdNamespaceEditor { public: + /// Structure for holding the options for how the namespace editor will + /// behave when trying to perform edits. + struct EditOptions { + + /// Whether the namespace editor will allow the authoring of relocates + /// in order to perform edits that would otherwise not be possible + /// because of opinions across composition arcs. By default this is set + /// to true. If set to false the namespace editor will consider edits + /// that require relocates as errors and will not apply the edit. + bool allowRelocatesAuthoring = true; + }; + USD_API explicit UsdNamespaceEditor(const UsdStageRefPtr &stage); + USD_API + UsdNamespaceEditor( + const UsdStageRefPtr &stage, + EditOptions &&editOptions); + + USD_API + UsdNamespaceEditor( + const UsdStageRefPtr &stage, + const EditOptions &editOptions); + /// Adds an edit operation to delete the composed prim at the given \p path /// from this namespace editor's stage. /// @@ -245,6 +251,10 @@ class UsdNamespaceEditor // namespace edit applied. SdfLayerHandleVector layersToEdit; + // The list of relocates edits that need to be made to layers in order + // to relocate a prim. + PcpLayerRelocatesEditBuilder::LayerRelocatesEdits relocatesEdits; + // Layer edits that need to be performed to update connection and // relationship targets of other properties in order to keep them // targeting the same object after applying this processed edit. @@ -278,9 +288,6 @@ class UsdNamespaceEditor // removed from its parent spec in a layer. bool removeInertAncestorOvers = false; - // Whether the edit would require relocates (or deactivation for delete) - bool requiresRelocates = false; - // Applies this processed edit, performing the individual edits // necessary to each layer that needs to be updated. bool Apply(); @@ -314,6 +321,7 @@ class UsdNamespaceEditor class _EditProcessor; UsdStageRefPtr _stage; + EditOptions _editOptions; _EditDescription _editDescription; mutable std::optional<_ProcessedEdit> _processedEdit; }; diff --git a/pxr/usd/usd/notice.cpp b/pxr/usd/usd/notice.cpp index 52319e7424..b2f0deb822 100644 --- a/pxr/usd/usd/notice.cpp +++ b/pxr/usd/usd/notice.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usd/notice.h" @@ -56,13 +39,13 @@ UsdNotice::StageNotice::StageNotice(const UsdStageWeakPtr& stage) : { } -UsdNotice::StageNotice::~StageNotice() {} +UsdNotice::StageNotice::~StageNotice() = default; -UsdNotice::StageContentsChanged::~StageContentsChanged() {} +UsdNotice::StageContentsChanged::~StageContentsChanged() = default; -UsdNotice::StageEditTargetChanged::~StageEditTargetChanged() {} +UsdNotice::StageEditTargetChanged::~StageEditTargetChanged() = default; -UsdNotice::LayerMutingChanged::~LayerMutingChanged() {} +UsdNotice::LayerMutingChanged::~LayerMutingChanged() = default; TfTokenVector UsdNotice::ObjectsChanged::PathRange::const_iterator::GetChangedFields() const diff --git a/pxr/usd/usd/notice.h b/pxr/usd/usd/notice.h index b375e76602..395beb39e5 100644 --- a/pxr/usd/usd/notice.h +++ b/pxr/usd/usd/notice.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_NOTICE_H #define PXR_USD_USD_NOTICE_H @@ -49,7 +32,7 @@ class UsdNotice { USD_API StageNotice(const UsdStageWeakPtr &stage); USD_API - virtual ~StageNotice(); + ~StageNotice() override; /// Return the stage associated with this notice. const UsdStageWeakPtr &GetStage() const { return _stage; } @@ -74,7 +57,7 @@ class UsdNotice { public: explicit StageContentsChanged(const UsdStageWeakPtr& stage) : StageNotice(stage) {} - USD_API virtual ~StageContentsChanged(); + USD_API ~StageContentsChanged() override; }; /// \class ObjectsChanged @@ -145,7 +128,7 @@ class UsdNotice { const _PathsToChangesMap *resyncChanges); public: - USD_API virtual ~ObjectsChanged(); + USD_API ~ObjectsChanged() override; /// Return true if \p obj was possibly affected by the layer changes /// that generated this notice. This is the case if either the object @@ -394,7 +377,7 @@ class UsdNotice { public: explicit StageEditTargetChanged(const UsdStageWeakPtr &stage) : StageNotice(stage) {} - USD_API virtual ~StageEditTargetChanged(); + USD_API ~StageEditTargetChanged() override; }; /// \class LayerMutingChanged @@ -420,7 +403,7 @@ class UsdNotice { _mutedLayers(mutedLayers), _unMutedLayers(unmutedLayers) {} - USD_API virtual ~LayerMutingChanged(); + USD_API ~LayerMutingChanged() override; /// Returns the identifier of the layers that were muted. /// diff --git a/pxr/usd/usd/object.cpp b/pxr/usd/usd/object.cpp index 185a1f6730..dd632a3b47 100644 --- a/pxr/usd/usd/object.cpp +++ b/pxr/usd/usd/object.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usd/object.h" diff --git a/pxr/usd/usd/object.h b/pxr/usd/usd/object.h index 96f2fee0de..7b754e39c2 100644 --- a/pxr/usd/usd/object.h +++ b/pxr/usd/usd/object.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_OBJECT_H #define PXR_USD_USD_OBJECT_H diff --git a/pxr/usd/usd/payloads.cpp b/pxr/usd/usd/payloads.cpp index e4ad1de245..6a614c1d34 100644 --- a/pxr/usd/usd/payloads.cpp +++ b/pxr/usd/usd/payloads.cpp @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usd/common.h" diff --git a/pxr/usd/usd/payloads.h b/pxr/usd/usd/payloads.h index 642e523b15..132a99ab82 100644 --- a/pxr/usd/usd/payloads.h +++ b/pxr/usd/usd/payloads.h @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_PAYLOADS_H #define PXR_USD_USD_PAYLOADS_H diff --git a/pxr/usd/usd/pch.h b/pxr/usd/usd/pch.h index d360999d4b..3a260bb324 100644 --- a/pxr/usd/usd/pch.h +++ b/pxr/usd/usd/pch.h @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // // WARNING: THIS FILE IS GENERATED. DO NOT EDIT. // @@ -48,15 +31,17 @@ #define WIN32_LEAN_AND_MEAN #endif +#include #include #include -#include -#include -#include +#include #endif #include +#include +#include #include #include +#include #include #include #include @@ -67,6 +52,7 @@ #include #include #include +#include #include #include #include @@ -82,8 +68,11 @@ #include #include #include +#include +#include #include #include +#include #include #include #include @@ -99,71 +88,11 @@ #include #include #include +#include #include -#include -#include -#include -#include -#include +#ifdef PXR_PYTHON_SUPPORT_ENABLED #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#ifdef PXR_PYTHON_SUPPORT_ENABLED #include #include #include @@ -194,6 +123,7 @@ #include #include #include +#include #include #include #include @@ -204,30 +134,6 @@ #undef toupper #endif #endif // PXR_PYTHON_SUPPORT_ENABLED -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include #include #include @@ -242,6 +148,7 @@ #include #include #include +#include #ifdef PXR_PYTHON_SUPPORT_ENABLED #include "pxr/base/tf/pySafePython.h" #endif // PXR_PYTHON_SUPPORT_ENABLED diff --git a/pxr/usd/usd/plugInfo.json b/pxr/usd/usd/plugInfo.json index 4705fbe0cf..016a8898c3 100644 --- a/pxr/usd/usd/plugInfo.json +++ b/pxr/usd/usd/plugInfo.json @@ -144,6 +144,14 @@ "usdz" ] } + }, + "Validators": { + "CompositionErrorTest": { + "doc": "Validator aims at providing all composition errors, which were generated while composing the stage." + }, + "keywords": [ + "UsdCoreValidators" + ] } }, "LibraryPath": "@PLUG_INFO_LIBRARY_PATH@", diff --git a/pxr/usd/usd/prim.cpp b/pxr/usd/usd/prim.cpp index 5ac2940075..688775f675 100644 --- a/pxr/usd/usd/prim.cpp +++ b/pxr/usd/usd/prim.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usd/prim.h" diff --git a/pxr/usd/usd/prim.h b/pxr/usd/usd/prim.h index d44770e59c..69ebb130df 100644 --- a/pxr/usd/usd/prim.h +++ b/pxr/usd/usd/prim.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_PRIM_H #define PXR_USD_USD_PRIM_H diff --git a/pxr/usd/usd/primCompositionQuery.cpp b/pxr/usd/usd/primCompositionQuery.cpp index 9a3391c4b8..793345f7d7 100644 --- a/pxr/usd/usd/primCompositionQuery.cpp +++ b/pxr/usd/usd/primCompositionQuery.cpp @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usd/primCompositionQuery.h" @@ -82,7 +65,7 @@ template using _PcpComposeFunc = void (*)(PcpLayerStackRefPtr const &, SdfPath const &, std::vector *, - PcpSourceArcInfoVector *); + PcpArcInfoVector *); // Helper for getting the corresponding list entry and arc source info from // the composed list op of an arc introducing node for all list op types. @@ -91,12 +74,12 @@ static bool _GetIntroducingComposeInfo(const UsdPrimCompositionQueryArc &arc, _PcpComposeFunc composeFunc, - PcpSourceArcInfo *arcInfo, + PcpArcInfo *arcInfo, ResultType *entry) { // Run the Pcp compose func to get the parallel vectors of composed list // entries and arc source info. - PcpSourceArcInfoVector info; + PcpArcInfoVector info; std::vector result; composeFunc(arc.GetIntroducingNode().GetLayerStack(), arc.GetIntroducingPrimPath(), @@ -177,7 +160,7 @@ UsdPrimCompositionQueryArc::GetIntroducingLayer() const // The arc source info returned by the various Pcp compose functions for // list op fields will hold the layer whose prim spec adds this arc to the // list. Just need to call the correct function for each arc type. - PcpSourceArcInfo info; + PcpArcInfo info; bool foundInfo = false; switch (_node.GetArcType()) { case PcpArcTypeReference: @@ -204,7 +187,7 @@ UsdPrimCompositionQueryArc::GetIntroducingLayer() const break; } if (foundInfo) { - return info.layer; + return info.sourceLayer; } // Empty layer for root arc and unsupported arc types. return SdfLayerHandle(); @@ -229,9 +212,9 @@ UsdPrimCompositionQueryArc::GetIntroducingPrimPath() const static SdfPrimSpecHandle _GetIntroducingPrimSpec(const UsdPrimCompositionQueryArc &arc, - const PcpSourceArcInfo &info) + const PcpArcInfo &info) { - return info.layer->GetPrimAtPath(arc.GetIntroducingPrimPath()); + return info.sourceLayer->GetPrimAtPath(arc.GetIntroducingPrimPath()); } bool @@ -245,7 +228,7 @@ UsdPrimCompositionQueryArc::GetIntroducingListEditor( } // Compose the references on the introducing node. - PcpSourceArcInfo info; + PcpArcInfo info; if (!_GetIntroducingComposeInfo( *this, &PcpComposeSiteReferences, &info, ref)) { return false; @@ -270,7 +253,7 @@ UsdPrimCompositionQueryArc::GetIntroducingListEditor( } // Compose the payloads on the introducing node. - PcpSourceArcInfo info; + PcpArcInfo info; if (!_GetIntroducingComposeInfo( *this, &PcpComposeSitePayloads, &info, payload)) { return false; @@ -296,7 +279,7 @@ UsdPrimCompositionQueryArc::GetIntroducingListEditor( return false; } - PcpSourceArcInfo info; + PcpArcInfo info; if (GetArcType() == PcpArcTypeInherit) { // Compose the inherit paths on the introducing node. if (!_GetIntroducingComposeInfo( @@ -329,7 +312,7 @@ UsdPrimCompositionQueryArc::GetIntroducingListEditor( } // Compose the variant set names on the introducing node. - PcpSourceArcInfo info; + PcpArcInfo info; if (!_GetIntroducingComposeInfo( *this, &PcpComposeSiteVariantSets, &info, name)) { return false; diff --git a/pxr/usd/usd/primCompositionQuery.h b/pxr/usd/usd/primCompositionQuery.h index 240e388ddb..11764418d5 100644 --- a/pxr/usd/usd/primCompositionQuery.h +++ b/pxr/usd/usd/primCompositionQuery.h @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_PRIM_COMPOSITION_QUERY_H #define PXR_USD_USD_PRIM_COMPOSITION_QUERY_H diff --git a/pxr/usd/usd/primData.cpp b/pxr/usd/usd/primData.cpp index e1ce385b9f..ee2250176b 100644 --- a/pxr/usd/usd/primData.cpp +++ b/pxr/usd/usd/primData.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usd/prim.h" diff --git a/pxr/usd/usd/primData.h b/pxr/usd/usd/primData.h index 0a42d009ca..04c9591d6a 100644 --- a/pxr/usd/usd/primData.h +++ b/pxr/usd/usd/primData.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_PRIM_DATA_H #define PXR_USD_USD_PRIM_DATA_H diff --git a/pxr/usd/usd/primDataHandle.cpp b/pxr/usd/usd/primDataHandle.cpp index 3361ed435a..f11a3ca2ad 100644 --- a/pxr/usd/usd/primDataHandle.cpp +++ b/pxr/usd/usd/primDataHandle.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usd/primDataHandle.h" diff --git a/pxr/usd/usd/primDataHandle.h b/pxr/usd/usd/primDataHandle.h index 9ae7120fe7..366eaac680 100644 --- a/pxr/usd/usd/primDataHandle.h +++ b/pxr/usd/usd/primDataHandle.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_PRIM_DATA_HANDLE_H #define PXR_USD_USD_PRIM_DATA_HANDLE_H diff --git a/pxr/usd/usd/primDefinition.cpp b/pxr/usd/usd/primDefinition.cpp index 5b360af17a..6432d3895c 100644 --- a/pxr/usd/usd/primDefinition.cpp +++ b/pxr/usd/usd/primDefinition.cpp @@ -1,25 +1,8 @@ // // Copyright 2020 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usd/primDefinition.h" @@ -809,7 +792,16 @@ UsdPrimDefinition::Property::GetVariability() const { std::string UsdPrimDefinition::Property::GetDocumentation() const { std::string docString; - _layerAndPath->HasField(SdfFieldKeys->Documentation, &docString); + static const TfToken schemaUserDocBriefToken("userDocBrief"); + + // Try to get "userDocBrief" doc from property metadata + if (! _layerAndPath->HasFieldDictKey( + SdfFieldKeys->CustomData, + schemaUserDocBriefToken, + &docString)) { + // For now, fall back to using the "documentation" metadata if present + _layerAndPath->HasField(SdfFieldKeys->Documentation, &docString); + } return docString; } diff --git a/pxr/usd/usd/primDefinition.h b/pxr/usd/usd/primDefinition.h index 7afb08851a..39e99bbab9 100644 --- a/pxr/usd/usd/primDefinition.h +++ b/pxr/usd/usd/primDefinition.h @@ -1,25 +1,8 @@ // // Copyright 2020 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_PRIM_DEFINITION_H #define PXR_USD_USD_PRIM_DEFINITION_H diff --git a/pxr/usd/usd/primFlags.cpp b/pxr/usd/usd/primFlags.cpp index c7ebc04320..1bbc662e59 100644 --- a/pxr/usd/usd/primFlags.cpp +++ b/pxr/usd/usd/primFlags.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usd/primFlags.h" diff --git a/pxr/usd/usd/primFlags.h b/pxr/usd/usd/primFlags.h index f1fd3d30be..efb1b2cd01 100644 --- a/pxr/usd/usd/primFlags.h +++ b/pxr/usd/usd/primFlags.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_PRIM_FLAGS_H #define PXR_USD_USD_PRIM_FLAGS_H diff --git a/pxr/usd/usd/primRange.cpp b/pxr/usd/usd/primRange.cpp index 8a5b9b315e..fbb78ca298 100644 --- a/pxr/usd/usd/primRange.cpp +++ b/pxr/usd/usd/primRange.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usd/primRange.h" diff --git a/pxr/usd/usd/primRange.h b/pxr/usd/usd/primRange.h index 3aae0c862c..95dba1aa9f 100644 --- a/pxr/usd/usd/primRange.h +++ b/pxr/usd/usd/primRange.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_PRIM_RANGE_H #define PXR_USD_USD_PRIM_RANGE_H diff --git a/pxr/usd/usd/primTypeInfo.cpp b/pxr/usd/usd/primTypeInfo.cpp index 78631090f0..2bdc27f13d 100644 --- a/pxr/usd/usd/primTypeInfo.cpp +++ b/pxr/usd/usd/primTypeInfo.cpp @@ -1,25 +1,8 @@ // // Copyright 2020 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usd/primTypeInfo.h" diff --git a/pxr/usd/usd/primTypeInfo.h b/pxr/usd/usd/primTypeInfo.h index 1d69ab748e..061632f81b 100644 --- a/pxr/usd/usd/primTypeInfo.h +++ b/pxr/usd/usd/primTypeInfo.h @@ -1,25 +1,8 @@ // // Copyright 2020 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_PRIM_TYPE_INFO_H #define PXR_USD_USD_PRIM_TYPE_INFO_H diff --git a/pxr/usd/usd/primTypeInfoCache.cpp b/pxr/usd/usd/primTypeInfoCache.cpp index 49760e3a5d..449dd7f869 100644 --- a/pxr/usd/usd/primTypeInfoCache.cpp +++ b/pxr/usd/usd/primTypeInfoCache.cpp @@ -1,25 +1,8 @@ // // Copyright 2020 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usd/primTypeInfoCache.h" diff --git a/pxr/usd/usd/primTypeInfoCache.h b/pxr/usd/usd/primTypeInfoCache.h index 6bd0e488fc..b6ab2cc10d 100644 --- a/pxr/usd/usd/primTypeInfoCache.h +++ b/pxr/usd/usd/primTypeInfoCache.h @@ -1,25 +1,8 @@ // // Copyright 2020 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_PRIM_TYPE_INFO_CACHE_H #define PXR_USD_USD_PRIM_TYPE_INFO_CACHE_H diff --git a/pxr/usd/usd/property.cpp b/pxr/usd/usd/property.cpp index bcddf4616d..53faae508c 100644 --- a/pxr/usd/usd/property.cpp +++ b/pxr/usd/usd/property.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usd/property.h" diff --git a/pxr/usd/usd/property.h b/pxr/usd/usd/property.h index 06d9d4e677..2633b500b9 100644 --- a/pxr/usd/usd/property.h +++ b/pxr/usd/usd/property.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_PROPERTY_H #define PXR_USD_USD_PROPERTY_H diff --git a/pxr/usd/usd/pyConversions.cpp b/pxr/usd/usd/pyConversions.cpp index a7d78883ed..570e438f52 100644 --- a/pxr/usd/usd/pyConversions.cpp +++ b/pxr/usd/usd/pyConversions.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usd/pyConversions.h" diff --git a/pxr/usd/usd/pyConversions.h b/pxr/usd/usd/pyConversions.h index 2831418ad3..05280a891b 100644 --- a/pxr/usd/usd/pyConversions.h +++ b/pxr/usd/usd/pyConversions.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_PY_CONVERSIONS_H #define PXR_USD_USD_PY_CONVERSIONS_H diff --git a/pxr/usd/usd/pyEditContext.cpp b/pxr/usd/usd/pyEditContext.cpp index 87b2f11e5c..4baf3547f0 100644 --- a/pxr/usd/usd/pyEditContext.cpp +++ b/pxr/usd/usd/pyEditContext.cpp @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usd/pyEditContext.h" diff --git a/pxr/usd/usd/pyEditContext.h b/pxr/usd/usd/pyEditContext.h index 7cbd29bebe..9ba3eed2b5 100644 --- a/pxr/usd/usd/pyEditContext.h +++ b/pxr/usd/usd/pyEditContext.h @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_PY_EDIT_CONTEXT_H #define PXR_USD_USD_PY_EDIT_CONTEXT_H diff --git a/pxr/usd/usd/references.cpp b/pxr/usd/usd/references.cpp index ce2f94041b..6a9dd96d94 100644 --- a/pxr/usd/usd/references.cpp +++ b/pxr/usd/usd/references.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usd/common.h" diff --git a/pxr/usd/usd/references.h b/pxr/usd/usd/references.h index f07ac82438..5006659ed5 100644 --- a/pxr/usd/usd/references.h +++ b/pxr/usd/usd/references.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_REFERENCES_H #define PXR_USD_USD_REFERENCES_H diff --git a/pxr/usd/usd/relationship.cpp b/pxr/usd/usd/relationship.cpp index b79f19077f..a9bc5e8d8c 100644 --- a/pxr/usd/usd/relationship.cpp +++ b/pxr/usd/usd/relationship.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usd/common.h" diff --git a/pxr/usd/usd/relationship.h b/pxr/usd/usd/relationship.h index a1256c2caa..8e75b0fcd1 100644 --- a/pxr/usd/usd/relationship.h +++ b/pxr/usd/usd/relationship.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_RELATIONSHIP_H #define PXR_USD_USD_RELATIONSHIP_H diff --git a/pxr/usd/usd/resolveInfo.cpp b/pxr/usd/usd/resolveInfo.cpp index 7c63b9fb9f..a62f39ec95 100644 --- a/pxr/usd/usd/resolveInfo.cpp +++ b/pxr/usd/usd/resolveInfo.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usd/resolveInfo.h" diff --git a/pxr/usd/usd/resolveInfo.h b/pxr/usd/usd/resolveInfo.h index ac77da04b7..13a331d1f8 100644 --- a/pxr/usd/usd/resolveInfo.h +++ b/pxr/usd/usd/resolveInfo.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_RESOLVE_INFO_H #define PXR_USD_USD_RESOLVE_INFO_H diff --git a/pxr/usd/usd/resolveTarget.cpp b/pxr/usd/usd/resolveTarget.cpp index d2e662f2f0..cdd117b713 100644 --- a/pxr/usd/usd/resolveTarget.cpp +++ b/pxr/usd/usd/resolveTarget.cpp @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usd/resolveTarget.h" diff --git a/pxr/usd/usd/resolveTarget.h b/pxr/usd/usd/resolveTarget.h index 2208edbb70..b5fa0fab01 100644 --- a/pxr/usd/usd/resolveTarget.h +++ b/pxr/usd/usd/resolveTarget.h @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_RESOLVE_TARGET_H #define PXR_USD_USD_RESOLVE_TARGET_H diff --git a/pxr/usd/usd/resolver.cpp b/pxr/usd/usd/resolver.cpp index ba7b3b0860..7826a01630 100644 --- a/pxr/usd/usd/resolver.cpp +++ b/pxr/usd/usd/resolver.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usd/resolver.h" diff --git a/pxr/usd/usd/resolver.h b/pxr/usd/usd/resolver.h index 15203c0a8d..6946935912 100644 --- a/pxr/usd/usd/resolver.h +++ b/pxr/usd/usd/resolver.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_RESOLVER_H #define PXR_USD_USD_RESOLVER_H diff --git a/pxr/usd/usd/schema.usda b/pxr/usd/usd/schema.usda index f9947dddd6..e1029b6c7a 100644 --- a/pxr/usd/usd/schema.usda +++ b/pxr/usd/usd/schema.usda @@ -82,8 +82,7 @@ class "APISchemaBase" explicit bool conversion operator. Examples of applied API schemas include UsdCollectionAPI, UsdGeomModelAPI and UsdGeomMotionAPI - \\anchor UsdAPISchemaBase_SingleVsMultipleApply - \\name Single vs. Multiple Apply API Schemas + \\subsection usd_apischemabase_single_vs_multiple_apply Single vs. Multiple Apply API Schemas Applied API schemas can further be classified into single-apply and multiple-apply API schemas. As the name suggests, a single-apply API schema @@ -143,95 +142,137 @@ class "ModelAPI" class "CollectionAPI" ( inherits = - doc = """ This is a general purpose API schema, used to describe a - collection of heterogeneous objects within the scene. "Objects" here may be - prims or properties belonging to prims or other collections. It's an add-on - schema that can be applied many times to a prim with different collection - names. - - A collection allows an enumeration of a set of paths to include and a - set of paths to exclude. Whether the descendants of an included - path are members of a collection are decided by its expansion rule - (see below). If the collection excludes paths that are not descendents - of included paths, the collection implicitly includes the root path - </>. If such a collection also includes paths that are not - descendants of the excluded paths, it is considered invalid, since - the intention is ambiguous. - - All the properties authored by the schema are namespaced under - "collection:". The given name of the collection provides additional - namespacing for the various per-collection properties, which include the - following: - -
  • uniform token collection:collectionName:expansionRule - - specified how the paths that are included in the collection must be expanded - to determine its members. Possible values include: + doc = """A general purpose API schema used to describe a collection of prims + and properties within a scene. This API schema can be applied to a prim + multiple times with different instance names to define several collections + on a single prim. + + A collection's membership is specified one of two ways. The first way uses + the built-in relationships `includes` and `excludes`, and the attribute + `includeRoot` to determine membership. The second way is termed a + pattern-based collection, and uses the built-in attribute + `membershipExpression` to determine membership. Here we will refer to + collections using `includes`, `excludes` and `includeRoot` as being in + *relationship-mode* and those using the `membershipExpression` as being in + *expression-mode*. + + A collection is determined to be in *relationship-mode* when either or both + of its `includes` and `excludes` relationships have valid targets, or the + `includeRoot` attribute is set `true`. In this case, the pattern-based + `membershipExpression` attribute is ignored. Otherwise, the collection is + in *expression-mode* and the `membershipExpression` attribute applies. + + In *relationship-mode* the `includes` and `excludes` relationships specify + the collection members as a set of paths to include and a set of paths to + exclude. Whether or not the descendants of an included path belong to a + collection is decided by its expansion rule (see below). If the collection + excludes paths that are not descendent to included paths, the collection + implicitly includes the root path ``. If such a collection also + includes paths that are not descendent to the excluded paths, it is + considered invalid since the intent is ambiguous. + + In *expression-mode*, the pattern-based `membershipExpression` attribute is + used with the `expansionRule` attribute to determine collection membership. + See the detailed descriptions of the built-in properties below for more + details. + + \\section usd_collectionapi_properties Collection API Properties + + The built-in properties for this schema are in the `collection:instanceName` + namespace, where `instanceName` is the user-provided applied API schema + instance name. + +
      +
    • `uniform token collection:instanceName:expansionRule` - in + *relationship-mode*, specifies how to expand the `includes` and `excludes` + relationship targets to determine the collection's members. In + *expression-mode*, specifies how matching scene objects against the + `membershipExpression` proceeds. Possible values include:
        -
      • explicitOnly - only paths in the includes rel targets and not - in the excludes rel targets belong to the collection. +
      • `expandPrims` - in *relationship-mode*, all the prims descendent + to the `includes` relationship targets (and not descendent to `excludes` + relationship targets) belong to the collection. Any `includes`-targeted + property paths also belong to the collection. This is the default + behavior. In *expression-mode*, the functions + UsdComputeIncludedObjectsFromCollection() and + UsdComputeIncludedPathsFromCollection() only test prims against the + `membershipExpression` to determine membership.
      • -
      • expandPrims - all the prims at or below the includes rel- - targets (and not under the excludes rel-targets) belong to the - collection. Any property paths included in the collection would, of - course, also be honored. This is the default behavior as it satisfies - most use cases. +
      • `expandPrimsAndProperties` - like `expandPrims`, but in + *relationship-mode*, all properties on all included prims also belong to + the collection. In *expression-mode*, the functions + UsdComputeIncludedObjectsFromCollection() and + UsdComputeIncludedPathsFromCollection() test both prims and + properties against the `membershipExpression` to determine membership.
      • -
      • expandPrimsAndProperties - like expandPrims, but also - includes all properties on all matched prims. We're still not quite - sure what the use cases are for this, but you can use it to capture a - whole lot of UsdObjects very concisely. +
      • `explicitOnly` - in *relationship-mode*, only paths in the + `includes` relationship targets and not those in the `excludes` + relationship targets belong to the collection. Does not apply to + *expression-mode*. If set in *expression-mode*, the functions + UsdComputeIncludedObjectsFromCollection() and + UsdComputeIncludedPathsFromCollection() return no results.
      -
    • -
    • bool collection:collectionName:includeRoot - boolean - attribute indicating whether the pseudo-root path </> should - be counted as one of the included target paths. The fallback is false. - This separate attribute is required because relationships cannot - directly target the root. When expansionRule is explicitOnly, this - attribute is ignored. -
    • rel collection:collectionName:includes - specifies a list - of targets that are included in the collection. This can target prims or - properties directly. A collection can insert the rules of another - collection by making its includes relationship target the - collection:{collectionName} property on the owning prim of the - collection to be included (see UsdCollectionAPI::GetCollectionAttr). - It is important to note that including another collection does not - guarantee the contents of that collection will be in the final collection; - instead, the rules are merged. This means, for example, an exclude - entry may exclude a portion of the included collection. - When a collection includes one or more collections, the order in which - targets are added to the includes relationship may become significant, if - there are conflicting opinions about the same path. Targets that are added - later are considered to be stronger than earlier targets for the same path. -
    • -
    • rel collection:collectionName:excludes - specifies a list - of targets that are excluded below the included paths in this - collection. This can target prims or properties directly, but cannot - target another collection. This is to keep the membership determining - logic simple, efficient and easier to reason about. Finally, it is invalid - for a collection to exclude paths that are not included in it. The presence - of such "orphaned" excluded paths will not affect the set of paths included - in the collection, but may affect the performance of querying membership of - a path in the collection (see UsdCollectionAPI::MembershipQuery::IsPathIncluded) - or of enumerating the objects belonging to the collection (see - UsdCollectionAPI::GetIncludedObjects). -
    • -
    • uniform opaque collection:collectionName - opaque +
    • + +
    • `bool collection:instanceName:includeRoot` - boolean attribute + indicating whether the pseudo-root path `` should be counted as one + of the included target paths in *relationship-mode*. This separate attribute + is required because relationships cannot directly target the root. When + `expansionRule` is `explicitOnly`, this attribute is ignored. The fallback + value is false. When set to `true`, this collection is in + *relationship-mode*. This attribute is ignored in *expression-mode*.
    • + +
    • `rel collection:instanceName:includes` - in *relationship-mode*, + specifies a list of targets that are included in the collection. This can + target prims or properties directly. A collection can insert the rules of + another collection by making its `includes` relationship target the + `collection:otherInstanceName` property from the collection to be included + (see UsdCollectionAPI::GetCollectionAttr). Note that including another + collection does not guarantee the contents of that collection will be in the + final collection; instead, the rules are merged. This means, for example, + an exclude entry may exclude a portion of the included collection. When a + collection includes one or more collections, the order in which targets are + added to the includes relationship may become significant, if there are + conflicting opinions about the same path. Targets that are added later are + considered to be stronger than earlier targets for the same path. This + relationship is ignored in *expression-mode*.
    • + +
    • `rel collection:instanceName:excludes` - in *relationship-mode*, + specifies a list of targets that are excluded below the included + paths in this collection. This can target prims or properties directly, but + cannot target another collection. This is to keep the membership + determining logic simple, efficient and easier to reason about. Finally, it + is invalid for a collection to exclude paths that are not included in + it. The presence of such "orphaned" excluded paths will not affect the set + of paths included in the collection, but may affect the performance of + querying membership of a path in the collection (see + UsdCollectionMembershipQuery::IsPathIncluded) or of enumerating the + objects belonging to the collection (see + UsdCollectionAPI::ComputeIncludedObjects). This relationship is ignored in + *expression-mode*.
    • + +
    • `uniform opaque collection:instanceName` - opaque attribute (meaning it can never have a value) that represents the collection - for the purpose of allowing another collection to include it. When this - property is targeted by another collection's includes relationship, - the rules of this collection will be inserted into the rules of the collection - that includes it. -
    + for the purpose of allowing another collection to include it in + *relationship-mode*. When this property is targeted by another collection's + `includes` relationship, the rules of this collection will be inserted + into the rules of the collection that includes it.
  • + +
  • `uniform pathExpression collection:instanceName:membershipExpression` - + in *expression-mode*, defines the SdfPathExpression used to test + objects for collection membership.
  • + +
- Implicit inclusion + \\subsection usd_collectionapi_implicit_inclusion Implicit Inclusion In some scenarios it is useful to express a collection that includes - everything except certain paths. To support this, a collection - that has an exclude that is not a descendent of any include - will include the root path </>. + everything except certain paths. To support this, a *relationship-mode* + collection that has an exclude that is not descendent to any include will + include the root path ``. - Creating collections in C++ + \\section usd_collectionapi_creating_cpp Creating Collections in C++ \\snippet examples_usd.cpp ApplyCollections """ @@ -265,7 +306,7 @@ class "CollectionAPI" ) uniform bool includeRoot ( doc = """Boolean attribute indicating whether the pseudo-root - path </> should be counted as one of the included target + path `` should be counted as one of the included target paths. The fallback is false. This separate attribute is required because relationships cannot directly target the root.""" ) diff --git a/pxr/usd/usd/schemaBase.cpp b/pxr/usd/usd/schemaBase.cpp index a74e4299fb..de0554b59b 100644 --- a/pxr/usd/usd/schemaBase.cpp +++ b/pxr/usd/usd/schemaBase.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usd/schemaBase.h b/pxr/usd/usd/schemaBase.h index e454d58ebe..5d1ae2e5fe 100644 --- a/pxr/usd/usd/schemaBase.h +++ b/pxr/usd/usd/schemaBase.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_SCHEMA_BASE_H #define PXR_USD_USD_SCHEMA_BASE_H diff --git a/pxr/usd/usd/schemaRegistry.cpp b/pxr/usd/usd/schemaRegistry.cpp index e712824595..f57a4019a6 100644 --- a/pxr/usd/usd/schemaRegistry.cpp +++ b/pxr/usd/usd/schemaRegistry.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usd/schemaRegistry.h b/pxr/usd/usd/schemaRegistry.h index d6418900ac..6566dfcdf1 100644 --- a/pxr/usd/usd/schemaRegistry.h +++ b/pxr/usd/usd/schemaRegistry.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_SCHEMA_REGISTRY_H #define PXR_USD_USD_SCHEMA_REGISTRY_H diff --git a/pxr/usd/usd/shared.cpp b/pxr/usd/usd/shared.cpp index b7e832e43f..aa14f1d407 100644 --- a/pxr/usd/usd/shared.cpp +++ b/pxr/usd/usd/shared.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usd/shared.h" diff --git a/pxr/usd/usd/shared.h b/pxr/usd/usd/shared.h index 3369c0555f..4c8c8ec4d0 100644 --- a/pxr/usd/usd/shared.h +++ b/pxr/usd/usd/shared.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_SHARED_H #define PXR_USD_USD_SHARED_H diff --git a/pxr/usd/usd/specializes.cpp b/pxr/usd/usd/specializes.cpp index 997cabe23a..4641aef8e6 100644 --- a/pxr/usd/usd/specializes.cpp +++ b/pxr/usd/usd/specializes.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usd/common.h" diff --git a/pxr/usd/usd/specializes.h b/pxr/usd/usd/specializes.h index 4807ebca38..f021500c8e 100644 --- a/pxr/usd/usd/specializes.h +++ b/pxr/usd/usd/specializes.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_SPECIALIZES_H #define PXR_USD_USD_SPECIALIZES_H diff --git a/pxr/usd/usd/stage.cpp b/pxr/usd/usd/stage.cpp index a6cfe51fc8..2f99cc693c 100644 --- a/pxr/usd/usd/stage.cpp +++ b/pxr/usd/usd/stage.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usd/stage.h" @@ -343,20 +326,29 @@ _MapPathExpressionToPrim( auto mapPattern = [&stack, &map, &unmappedPatterns](PathPattern const &pattern) { - SdfPath mapped = map(pattern.GetPrefix()); - // If the prefix path is outside the domain, push the Nothing() - // subexpression. - if (mapped.IsEmpty()) { - if (unmappedPatterns) { - unmappedPatterns->push_back(pattern); - } - stack.push_back(SdfPathExpression::Nothing()); + // If the pattern starts with '//' we persist it unchanged, as we deem + // the intent to be "search everything" regardless of context. This is + // as opposed to any kind of non-speculative prefix, which refers to a + // specific prim or property in the originating context. + if (pattern.HasLeadingStretch()) { + stack.push_back(SdfPathExpression::MakeAtom(pattern)); } - // Otherwise push the mapped pattern. else { - PathPattern mappedPattern(pattern); - mappedPattern.SetPrefix(mapped); - stack.push_back(PathExpr::MakeAtom(mappedPattern)); + SdfPath mapped = map(pattern.GetPrefix()); + // If the prefix path is outside the domain, push the Nothing() + // subexpression. + if (mapped.IsEmpty()) { + if (unmappedPatterns) { + unmappedPatterns->push_back(pattern); + } + stack.push_back(SdfPathExpression::Nothing()); + } + // Otherwise push the mapped pattern. + else { + PathPattern mappedPattern(pattern); + mappedPattern.SetPrefix(mapped); + stack.push_back(PathExpr::MakeAtom(mappedPattern)); + } } }; @@ -2118,16 +2110,20 @@ UsdStage::GetPseudoRoot() const UsdPrim UsdStage::GetDefaultPrim() const { - TfToken name = GetRootLayer()->GetDefaultPrim(); - return SdfPath::IsValidIdentifier(name) - ? GetPrimAtPath(SdfPath::AbsoluteRootPath().AppendChild(name)) - : UsdPrim(); + SdfPath path = GetRootLayer()->GetDefaultPrimAsPath(); + return path.IsEmpty() + ? UsdPrim() + : GetPrimAtPath(path); } void UsdStage::SetDefaultPrim(const UsdPrim &prim) { - GetRootLayer()->SetDefaultPrim(prim.GetName()); + if (prim){ + prim.GetParent() == GetPseudoRoot() + ? GetRootLayer()->SetDefaultPrim(prim.GetName()) + : GetRootLayer()->SetDefaultPrim(prim.GetPath().GetAsToken()); + } } void @@ -3880,6 +3876,27 @@ UsdStage::GetPathResolverContext() const return _GetPcpCache()->GetLayerStackIdentifier().pathResolverContext; } +PcpErrorVector +UsdStage::GetCompositionErrors() const +{ + PcpErrorVector errors; + + auto _ExtractErrorsFromPrimIndices = [&errors]( + const PcpPrimIndex &primIndex) { + const PcpErrorVector &localErrors = primIndex.GetLocalErrors(); + errors.insert(errors.end(), localErrors.begin(), localErrors.end()); + }; + _GetPcpCache()->ForEachPrimIndex(_ExtractErrorsFromPrimIndices); + + auto _ExtractErrorsFromPcpLayerStack = [&errors]( + const PcpLayerStackPtr layerStackPtr) { + const PcpErrorVector &localErrors = layerStackPtr->GetLocalErrors(); + errors.insert(errors.end(), localErrors.begin(), localErrors.end()); + }; + _GetPcpCache()->ForEachLayerStack(_ExtractErrorsFromPcpLayerStack); + return errors; +} + SdfLayerHandleVector UsdStage::GetLayerStack(bool includeSessionLayers) const { @@ -9501,7 +9518,7 @@ double UsdStage::GetEndTimeCode() const { // Look for 'endTimeCode' first. If it is not available, then look for - // the deprecated field 'startFrame'. + // the deprecated field 'endFrame'. const SdfLayerConstHandle sessionLayer = GetSessionLayer(); if (sessionLayer) { if (sessionLayer->HasEndTimeCode()) diff --git a/pxr/usd/usd/stage.h b/pxr/usd/usd/stage.h index a1d0a991fe..5b0a9f94da 100644 --- a/pxr/usd/usd/stage.h +++ b/pxr/usd/usd/stage.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_STAGE_H #define PXR_USD_USD_STAGE_H @@ -727,22 +710,27 @@ class UsdStage : public TfRefBase, public TfWeakBase { USD_API UsdPrim GetPseudoRoot() const; - /// Return the root UsdPrim on this stage whose name is the root layer's + /// Return the UsdPrim on this stage whose path is the root layer's /// defaultPrim metadata's value. Return an invalid prim if there is no /// such prim or if the root layer's defaultPrim metadata is unset or is not - /// a valid prim name. Note that this function only examines this stage's - /// rootLayer. It does not consider sublayers of the rootLayer. See also - /// SdfLayer::GetDefaultPrim(). + /// a valid prim path. Note that this function will return the prim on the + /// stage whose path is the root layer's GetDefaultPrimAsPath() if that path + /// is not empty and a prim at that path exists on the stage. + /// See also SdfLayer::GetDefaultPrimAsPath(). USD_API UsdPrim GetDefaultPrim() const; - /// Set the default prim layer metadata in this stage's root layer. This is - /// shorthand for: + /// Set the default prim layer metadata in this stage's root layer. This + /// is shorthand for: /// \code /// stage->GetRootLayer()->SetDefaultPrim(prim.GetName()); /// \endcode - /// Note that this function always authors to the stage's root layer. To - /// author to a different layer, use the SdfLayer::SetDefaultPrim() API. + /// If prim is a root prim, otherwise + /// \code + /// stage->GetRootLayer()->SetDefaultPrim(prim.GetPath().GetAsToken()); + /// \endcode + /// Note that this function always authors to the stage's root layer. + /// To author to a different layer, use the SdfLayer::SetDefaultPrim() API. USD_API void SetDefaultPrim(const UsdPrim &prim); @@ -1014,7 +1002,11 @@ class UsdStage : public TfRefBase, public TfWeakBase { std::string ResolveIdentifierToEditTarget(std::string const &identifier) const; - /// Return this stage's local layers in strong-to-weak order. If + /// Return a PcpErrorVector containing all composition errors encountered + /// when composing the prims and layer stacks on this stage. + USD_API + PcpErrorVector GetCompositionErrors() const; + /// \a includeSessionLayers is true, return the linearized strong-to-weak /// sublayers rooted at the stage's session layer followed by the linearized /// strong-to-weak sublayers rooted at this stage's root layer. If diff --git a/pxr/usd/usd/stageCache.cpp b/pxr/usd/usd/stageCache.cpp index edaafbd7f9..b38c265bac 100644 --- a/pxr/usd/usd/stageCache.cpp +++ b/pxr/usd/usd/stageCache.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usd/stageCache.h" diff --git a/pxr/usd/usd/stageCache.h b/pxr/usd/usd/stageCache.h index 09c91a8ffd..28b29a76f4 100644 --- a/pxr/usd/usd/stageCache.h +++ b/pxr/usd/usd/stageCache.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_STAGE_CACHE_H #define PXR_USD_USD_STAGE_CACHE_H diff --git a/pxr/usd/usd/stageCacheContext.cpp b/pxr/usd/usd/stageCacheContext.cpp index 80599ab6df..b88cab402e 100644 --- a/pxr/usd/usd/stageCacheContext.cpp +++ b/pxr/usd/usd/stageCacheContext.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usd/stageCacheContext.h" diff --git a/pxr/usd/usd/stageCacheContext.h b/pxr/usd/usd/stageCacheContext.h index efa17fe093..7bbf266a85 100644 --- a/pxr/usd/usd/stageCacheContext.h +++ b/pxr/usd/usd/stageCacheContext.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_STAGE_CACHE_CONTEXT_H #define PXR_USD_USD_STAGE_CACHE_CONTEXT_H diff --git a/pxr/usd/usd/stageLoadRules.cpp b/pxr/usd/usd/stageLoadRules.cpp index 7ee24a709e..44f052f069 100644 --- a/pxr/usd/usd/stageLoadRules.cpp +++ b/pxr/usd/usd/stageLoadRules.cpp @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usd/stageLoadRules.h" diff --git a/pxr/usd/usd/stageLoadRules.h b/pxr/usd/usd/stageLoadRules.h index 2a641ec264..502338f8d4 100644 --- a/pxr/usd/usd/stageLoadRules.h +++ b/pxr/usd/usd/stageLoadRules.h @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_STAGE_LOAD_RULES_H diff --git a/pxr/usd/usd/stagePopulationMask.cpp b/pxr/usd/usd/stagePopulationMask.cpp index 0d67c0b5ba..2e720f3c53 100644 --- a/pxr/usd/usd/stagePopulationMask.cpp +++ b/pxr/usd/usd/stagePopulationMask.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usd/stagePopulationMask.h" diff --git a/pxr/usd/usd/stagePopulationMask.h b/pxr/usd/usd/stagePopulationMask.h index 02f50111d6..56e45bb7a9 100644 --- a/pxr/usd/usd/stagePopulationMask.h +++ b/pxr/usd/usd/stagePopulationMask.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_STAGE_POPULATION_MASK_H #define PXR_USD_USD_STAGE_POPULATION_MASK_H diff --git a/pxr/usd/usd/testenv/TestUsdProceduralExternalAssetsFileFormatPlugin.cpp b/pxr/usd/usd/testenv/TestUsdProceduralExternalAssetsFileFormatPlugin.cpp index af3b411351..4f1be0272c 100644 --- a/pxr/usd/usd/testenv/TestUsdProceduralExternalAssetsFileFormatPlugin.cpp +++ b/pxr/usd/usd/testenv/TestUsdProceduralExternalAssetsFileFormatPlugin.cpp @@ -1,25 +1,8 @@ // // Copyright 2020 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/usd/testenv/TestUsdResolverChangedResolver.cpp b/pxr/usd/usd/testenv/TestUsdResolverChangedResolver.cpp index defe4827a3..588c80e7f3 100644 --- a/pxr/usd/usd/testenv/TestUsdResolverChangedResolver.cpp +++ b/pxr/usd/usd/testenv/TestUsdResolverChangedResolver.cpp @@ -1,25 +1,8 @@ // // Copyright 2021 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/usd/testenv/TestUsdResolverChangedResolver.h b/pxr/usd/usd/testenv/TestUsdResolverChangedResolver.h index 370e78a47b..6658fb8469 100644 --- a/pxr/usd/usd/testenv/TestUsdResolverChangedResolver.h +++ b/pxr/usd/usd/testenv/TestUsdResolverChangedResolver.h @@ -1,25 +1,8 @@ // // Copyright 2021 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_TEST_USD_RESOLVER_CHANGED_RESOLVER_H #define PXR_USD_USD_TEST_USD_RESOLVER_CHANGED_RESOLVER_H diff --git a/pxr/usd/usd/testenv/testUsdAppliedAPISchemas.py b/pxr/usd/usd/testenv/testUsdAppliedAPISchemas.py index b65e3bcecd..4a9ba6f9bd 100644 --- a/pxr/usd/usd/testenv/testUsdAppliedAPISchemas.py +++ b/pxr/usd/usd/testenv/testUsdAppliedAPISchemas.py @@ -2,25 +2,8 @@ # # Copyright 2020 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. import os, unittest from pxr import Plug, Sdf, Usd, Vt, Tf, Gf diff --git a/pxr/usd/usd/testenv/testUsdAttributeBlocking.cpp b/pxr/usd/usd/testenv/testUsdAttributeBlocking.cpp index e8de695cf9..6018e41871 100644 --- a/pxr/usd/usd/testenv/testUsdAttributeBlocking.cpp +++ b/pxr/usd/usd/testenv/testUsdAttributeBlocking.cpp @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/usd/testenv/testUsdAttributeBlocking.py b/pxr/usd/usd/testenv/testUsdAttributeBlocking.py index 10f7c6381b..a4c5a58601 100644 --- a/pxr/usd/usd/testenv/testUsdAttributeBlocking.py +++ b/pxr/usd/usd/testenv/testUsdAttributeBlocking.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from pxr import Sdf, Usd diff --git a/pxr/usd/usd/testenv/testUsdAttributeConnections.py b/pxr/usd/usd/testenv/testUsdAttributeConnections.py index 17af6dc6e8..9f379a8396 100644 --- a/pxr/usd/usd/testenv/testUsdAttributeConnections.py +++ b/pxr/usd/usd/testenv/testUsdAttributeConnections.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. import sys, unittest from pxr import Sdf, Tf, Usd diff --git a/pxr/usd/usd/testenv/testUsdAttributeInterpolationCpp.cpp b/pxr/usd/usd/testenv/testUsdAttributeInterpolationCpp.cpp index 73fe0b05f1..0f86f1d7d2 100644 --- a/pxr/usd/usd/testenv/testUsdAttributeInterpolationCpp.cpp +++ b/pxr/usd/usd/testenv/testUsdAttributeInterpolationCpp.cpp @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/usd/testenv/testUsdAttributeQuery.py b/pxr/usd/usd/testenv/testUsdAttributeQuery.py index 366aae65a1..0c2a958360 100644 --- a/pxr/usd/usd/testenv/testUsdAttributeQuery.py +++ b/pxr/usd/usd/testenv/testUsdAttributeQuery.py @@ -2,25 +2,8 @@ # # Copyright 2021 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. import contextlib import unittest diff --git a/pxr/usd/usd/testenv/testUsdBug119633.py b/pxr/usd/usd/testenv/testUsdBug119633.py index f75967b0b1..299f1fbec2 100644 --- a/pxr/usd/usd/testenv/testUsdBug119633.py +++ b/pxr/usd/usd/testenv/testUsdBug119633.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from __future__ import print_function diff --git a/pxr/usd/usd/testenv/testUsdBug141491.py b/pxr/usd/usd/testenv/testUsdBug141491.py index 1f825c808a..bc208751f5 100644 --- a/pxr/usd/usd/testenv/testUsdBug141491.py +++ b/pxr/usd/usd/testenv/testUsdBug141491.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from __future__ import print_function diff --git a/pxr/usd/usd/testenv/testUsdBugs.py b/pxr/usd/usd/testenv/testUsdBugs.py index 7d68c5cb32..630438261a 100644 --- a/pxr/usd/usd/testenv/testUsdBugs.py +++ b/pxr/usd/usd/testenv/testUsdBugs.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from __future__ import division diff --git a/pxr/usd/usd/testenv/testUsdChangeProcessing.py b/pxr/usd/usd/testenv/testUsdChangeProcessing.py index 8a9fd34e60..0d04c8cf85 100644 --- a/pxr/usd/usd/testenv/testUsdChangeProcessing.py +++ b/pxr/usd/usd/testenv/testUsdChangeProcessing.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from __future__ import print_function diff --git a/pxr/usd/usd/testenv/testUsdClasses.py b/pxr/usd/usd/testenv/testUsdClasses.py index 3df422cf75..7eea527b9c 100644 --- a/pxr/usd/usd/testenv/testUsdClasses.py +++ b/pxr/usd/usd/testenv/testUsdClasses.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from pxr import Sdf, Usd, Tf import unittest diff --git a/pxr/usd/usd/testenv/testUsdCollectionAPI.py b/pxr/usd/usd/testenv/testUsdCollectionAPI.py index a623dff4cb..8e321bacd2 100644 --- a/pxr/usd/usd/testenv/testUsdCollectionAPI.py +++ b/pxr/usd/usd/testenv/testUsdCollectionAPI.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # pylint: disable=dict-keys-not-iterating @@ -57,6 +40,45 @@ def tearDown(self): stage.Reload() pass + def checkQuery(self, mquery, stage, verbose=False): + # Cross-check the mquery between ComputeIncludedPathsFromCollection(), + # IsPathIncluded(), and the expression produced by + # ComputePathExpressionFromCollectionMembershipQueryRuleMap(). + + # Compute includes from the membership query. + includes = set(Usd.ComputeIncludedPathsFromCollection( + query=mquery, stage=stage)) + + # Fetch all paths from the stage, then cross-check. + allPaths = set() + for prim in stage.Traverse(): + allPaths.add(prim.GetPath()) + allPaths.update([prop.GetPath() for prop in prim.GetProperties()]) + + # Check all paths with query.IsPathIncluded() API. + for path in allPaths: + if path in includes: + self.assertTrue(mquery.IsPathIncluded(path), + msg='query should include {}'.format(path)) + else: + self.assertFalse(mquery.IsPathIncluded(path), + msg='query should exclude {}'.format(path)) + + # Get path expression. + pathExpr = \ + Usd.ComputePathExpressionFromCollectionMembershipQueryRuleMap( + mquery.GetAsPathExpansionRuleMap()) + + # Check all paths against expression Match() API. + matchEval = Sdf._MakeBasicMatchEval(pathExpr.GetText()) + for path in allPaths: + if path in includes: + self.assertTrue(matchEval.Match(path), + msg='expr should match {}'.format(path)) + else: + self.assertFalse(matchEval.Match(path), + msg='expr should not match {}'.format(path)) + def test_AuthorCollections(self): # ---------------------------------------------------------- # Test an explicitOnly collection. @@ -104,6 +126,7 @@ def test_AuthorCollections(self): explicitColl.GetIncludesRel().AddTarget(cone.GetPath()) explicitCollMquery = explicitColl.ComputeMembershipQuery() + self.checkQuery(explicitCollMquery, stage) explicitCollIncObjects = Usd.CollectionAPI.ComputeIncludedObjects( explicitCollMquery, stage) @@ -125,6 +148,7 @@ def test_AuthorCollections(self): # We have to recompute the membership map if we add or remove # includes/excludes targets. explicitCollMquery = explicitColl.ComputeMembershipQuery() + self.checkQuery(explicitCollMquery, stage) # Ensure that the cone is excluded. self.assertFalse(explicitCollMquery.IsPathIncluded(cone.GetPath())) @@ -137,6 +161,7 @@ def test_AuthorCollections(self): "testExpandPrimsColl") expandPrimsColl.CreateIncludesRel().AddTarget(geom.GetPath()) expandPrimsCollMquery = expandPrimsColl.ComputeMembershipQuery() + self.checkQuery(expandPrimsCollMquery, stage) expandPrimCollIncObjects = Usd.CollectionAPI.ComputeIncludedObjects( expandPrimsCollMquery, stage) @@ -155,6 +180,7 @@ def test_AuthorCollections(self): Sdf.Path("/Collection/Materials/Plastic")) expandPrimsCollMquery = expandPrimsColl.ComputeMembershipQuery() + self.checkQuery(expandPrimsCollMquery, stage) expandPrimCollIncObjects = Usd.CollectionAPI.ComputeIncludedObjects( expandPrimsCollMquery, stage, Usd.TraverseInstanceProxies()) self.assertEqual(len(expandPrimCollIncObjects), 4) @@ -171,6 +197,7 @@ def test_AuthorCollections(self): expandPrimsAndPropertiesColl.CreateIncludesRel().AddTarget( shapes.GetPath()) expandPnPCollMquery = expandPrimsAndPropertiesColl.ComputeMembershipQuery() + self.checkQuery(expandPnPCollMquery, stage) expandPnPCollObjects = Usd.CollectionAPI.ComputeIncludedObjects( expandPnPCollMquery, stage) @@ -192,6 +219,7 @@ def test_AuthorCollections(self): explicitColl.GetCollectionPath()) combinedMquery = combinedColl.ComputeMembershipQuery() + self.checkQuery(combinedMquery, stage) combinedCollIncObjects = Usd.CollectionAPI.ComputeIncludedObjects( combinedMquery, stage) @@ -205,9 +233,10 @@ def test_AuthorCollections(self): # exludes "Shapes", but is weaker than the "expandPrimsAndProperties" # collection. combinedColl.CreateIncludesRel().AddTarget( - expandPrimsColl.GetCollectionPath(), position=Usd.ListPositionBackOfAppendList) + expandPrimsColl.GetCollectionPath(), + position=Usd.ListPositionBackOfAppendList) combinedMquery = combinedColl.ComputeMembershipQuery() - + self.checkQuery(combinedMquery, stage) combinedCollIncObjects = Usd.CollectionAPI.ComputeIncludedObjects( combinedMquery, stage) @@ -229,6 +258,7 @@ def test_testIncludeAndExcludePath(self): self.assertTrue(geomCollection.ExcludePath(sphere.GetPath())) query = geomCollection.ComputeMembershipQuery() + self.checkQuery(query, stage) self.assertTrue(query.IsPathIncluded(cylinder.GetPath())) self.assertTrue(query.IsPathIncluded(cube.GetPath())) self.assertFalse(query.IsPathIncluded(sphere.GetPath())) @@ -245,6 +275,7 @@ def test_testIncludeAndExcludePath(self): # Every time we call IncludePath() or ExcludePath(), we must recompute # the MembershipQuery object. query = geomCollection.ComputeMembershipQuery() + self.checkQuery(query, stage) self.assertFalse(query.IsPathIncluded(sphere.GetPath())) self.assertFalse(query.IsPathIncluded(hemiSphere1.GetPath())) self.assertTrue(query.IsPathIncluded(hemiSphere2.GetPath())) @@ -253,6 +284,7 @@ def test_testIncludeAndExcludePath(self): self.assertTrue(geomCollection.IncludePath(sphere.GetPath())) query = geomCollection.ComputeMembershipQuery() + self.checkQuery(query, stage) self.assertTrue(query.IsPathIncluded(sphere.GetPath())) self.assertTrue(query.IsPathIncluded(hemiSphere1.GetPath())) self.assertTrue(query.IsPathIncluded(hemiSphere2.GetPath())) @@ -268,6 +300,7 @@ def test_testIncludeAndExcludePath(self): includeRootTest.IncludePath('/') includeRootTest.ExcludePath(geom.GetPath()) query = includeRootTest.ComputeMembershipQuery() + self.checkQuery(query, stage) self.assertTrue(query.IsPathIncluded(testPrim.GetPath())) self.assertFalse(query.IsPathIncluded(geom.GetPath())) self.assertFalse(query.IsPathIncluded(box.GetPath())) @@ -276,6 +309,7 @@ def test_testIncludeAndExcludePath(self): # a path under the excluded Geom scope. includeRootTest.IncludePath(box.GetPath()) query = includeRootTest.ComputeMembershipQuery() + self.checkQuery(query, stage) self.assertTrue(query.IsPathIncluded(testPrim.GetPath())) self.assertFalse(query.IsPathIncluded(geom.GetPath())) self.assertTrue(query.IsPathIncluded(box.GetPath())) @@ -312,6 +346,7 @@ def test_testReadCollection(self): leafGeom.GetIncludesRel().GetPath())) leafGeomMquery = leafGeom.ComputeMembershipQuery() + self.checkQuery(leafGeomMquery, stage) self.assertEqual(leafGeomMquery.GetIncludedCollections(), []) self.assertEqual( len(Usd.CollectionAPI.ComputeIncludedObjects(leafGeomMquery, @@ -330,6 +365,7 @@ def test_testReadCollection(self): allGeom = Usd.CollectionAPI(testPrim, "allGeom") (valid, reason) = allGeom.Validate() allGeomMquery = allGeom.ComputeMembershipQuery() + self.checkQuery(allGeomMquery, stage) self.assertEqual(allGeomMquery.GetIncludedCollections(), []) self.assertEqual(len(Usd.CollectionAPI.ComputeIncludedObjects( allGeomMquery,stage)), 9) @@ -342,6 +378,7 @@ def test_testReadCollection(self): allGeomProperties = Usd.CollectionAPI(testPrim, "allGeomProperties") (valid, reason) = allGeomProperties.Validate() allGeomPropertiesMquery = allGeomProperties.ComputeMembershipQuery() + self.checkQuery(allGeomPropertiesMquery, stage) self.assertEqual(allGeomPropertiesMquery.GetIncludedCollections(), []) self.assertEqual(len(Usd.CollectionAPI.ComputeIncludedObjects( allGeomPropertiesMquery, stage)), 33) @@ -350,6 +387,7 @@ def test_testReadCollection(self): (valid, reason) = hasRels.Validate() self.assertTrue(valid) hasRelsMquery = hasRels.ComputeMembershipQuery() + self.checkQuery(hasRelsMquery, stage) self.assertEqual(hasRelsMquery.GetIncludedCollections(), []) incObjects = Usd.CollectionAPI.ComputeIncludedObjects(hasRelsMquery, stage) for obj in incObjects: @@ -359,6 +397,7 @@ def test_testReadCollection(self): (valid, reason) = hasInstanceProxy.Validate() self.assertTrue(valid) hasInstanceProxyMquery = hasInstanceProxy.ComputeMembershipQuery() + self.checkQuery(hasInstanceProxyMquery, stage) self.assertEqual(hasInstanceProxyMquery.GetIncludedCollections(), []) incObjects = Usd.CollectionAPI.ComputeIncludedObjects( hasInstanceProxyMquery, stage) @@ -371,6 +410,7 @@ def test_testReadCollection(self): (valid, reason) = coneProperties.Validate() self.assertTrue(valid) conePropertiesMquery = coneProperties.ComputeMembershipQuery() + self.checkQuery(conePropertiesMquery, stage) self.assertEqual(conePropertiesMquery.GetIncludedCollections(), []) incObjects = Usd.CollectionAPI.ComputeIncludedObjects( conePropertiesMquery, stage) @@ -382,6 +422,7 @@ def test_testReadCollection(self): (valid, reason) = includesCollection.Validate() self.assertTrue(valid) includesCollectionMquery = includesCollection.ComputeMembershipQuery() + self.checkQuery(includesCollectionMquery, stage) self.assertEqual( set(includesCollectionMquery.GetIncludedCollections()), set([Sdf.Path("/CollectionTest/Geom/Shapes.collection:allShapes")])) @@ -396,6 +437,7 @@ def test_testReadCollection(self): self.assertTrue(valid) includesNestedCollectionMquery = \ includesNestedCollection.ComputeMembershipQuery() + self.checkQuery(includesNestedCollectionMquery, stage) self.assertEqual( set(includesNestedCollectionMquery.GetIncludedCollections()), set([Sdf.Path("/CollectionTest/Geom/Shapes.collection:allShapes"), @@ -405,6 +447,7 @@ def test_testReadCollection(self): (valid, reason) = excludeInstanceGeom.Validate() self.assertTrue(valid) excludeInstanceGeomMquery = excludeInstanceGeom.ComputeMembershipQuery() + self.checkQuery(excludeInstanceGeomMquery, stage) self.assertEqual(excludeInstanceGeomMquery.GetIncludedCollections(), []) incObjects = Usd.CollectionAPI.ComputeIncludedObjects( excludeInstanceGeomMquery, stage) @@ -458,6 +501,7 @@ def test_CircularDependency(self): self.assertFalse(valid) self.assertTrue('circular' in reason) mqueryA = collectionA.ComputeMembershipQuery() + self.checkQuery(mqueryA, stage) self.assertEqual(len(ComputeIncObjs(mqueryA, stage)), 0) self.assertEqual(mqueryA.GetIncludedCollections(), [collectionB.GetCollectionPath(), @@ -467,6 +511,7 @@ def test_CircularDependency(self): self.assertFalse(valid) self.assertTrue('circular' in reason) mqueryB = collectionB.ComputeMembershipQuery() + self.checkQuery(mqueryB, stage) self.assertEqual(len(ComputeIncObjs(mqueryB, stage)), 0) self.assertEqual(mqueryB.GetIncludedCollections(), [collectionA.GetCollectionPath(), @@ -476,6 +521,7 @@ def test_CircularDependency(self): self.assertFalse(valid) self.assertTrue('circular' in reason) mqueryC = collectionC.ComputeMembershipQuery() + self.checkQuery(mqueryC, stage) self.assertEqual(len(ComputeIncObjs(mqueryC, stage)), 0) self.assertEqual(mqueryC.GetIncludedCollections(), [collectionA.GetCollectionPath(), @@ -486,6 +532,7 @@ def test_CircularDependency(self): collectionA.CreateIncludesRel().AddTarget( collectionD.GetCollectionPath()) mqueryA = collectionA.ComputeMembershipQuery() + self.checkQuery(mqueryA, stage) self.assertEqual(len(ComputeIncObjs(mqueryA, stage)), 9) self.assertEqual(mqueryA.GetIncludedCollections(), [collectionB.GetCollectionPath(), @@ -493,6 +540,7 @@ def test_CircularDependency(self): collectionD.GetCollectionPath()]) mqueryB = collectionB.ComputeMembershipQuery() + self.checkQuery(mqueryB, stage) self.assertEqual(len(ComputeIncObjs(mqueryB, stage)), 9) self.assertEqual(mqueryB.GetIncludedCollections(), [collectionA.GetCollectionPath(), @@ -500,6 +548,7 @@ def test_CircularDependency(self): collectionD.GetCollectionPath()]) mqueryC = collectionC.ComputeMembershipQuery() + self.checkQuery(mqueryC, stage) self.assertEqual(len(ComputeIncObjs(mqueryC, stage)), 9) self.assertEqual(mqueryC.GetIncludedCollections(), [collectionA.GetCollectionPath(), @@ -518,6 +567,7 @@ def test_CircularDependency(self): self.assertFalse(valid) self.assertTrue('circular' in reason) mqueryA = collectionA.ComputeMembershipQuery() + self.checkQuery(mqueryA, stage) self.assertEqual(len(ComputeIncObjs(mqueryA, stage)), 0) self.assertEqual(mqueryA.GetIncludedCollections(), [collectionB.GetCollectionPath(), @@ -527,6 +577,7 @@ def test_CircularDependency(self): self.assertFalse(valid) self.assertTrue('circular' in reason) mqueryB = collectionB.ComputeMembershipQuery() + self.checkQuery(mqueryB, stage) self.assertEqual(len(ComputeIncObjs(mqueryB, stage)), 0) self.assertEqual(mqueryB.GetIncludedCollections(), [collectionC.GetCollectionPath()]) @@ -535,6 +586,7 @@ def test_CircularDependency(self): self.assertFalse(valid) self.assertTrue('circular' in reason) mqueryC = collectionC.ComputeMembershipQuery() + self.checkQuery(mqueryC, stage) self.assertEqual(len(ComputeIncObjs(mqueryC, stage)), 0) self.assertEqual(mqueryC.GetIncludedCollections(), [collectionB.GetCollectionPath()]) @@ -548,6 +600,7 @@ def test_CircularDependency(self): self.assertFalse(valid) self.assertTrue('circular' in reason) mqueryA = collectionA.ComputeMembershipQuery() + self.checkQuery(mqueryA, stage) self.assertEqual(len(ComputeIncObjs(mqueryA, stage)), 0) self.assertEqual(mqueryA.GetIncludedCollections(), [collectionB.GetCollectionPath()]) @@ -556,6 +609,7 @@ def test_CircularDependency(self): self.assertFalse(valid) self.assertTrue('circular' in reason) mqueryB = collectionB.ComputeMembershipQuery() + self.checkQuery(mqueryB, stage) self.assertEqual(len(ComputeIncObjs(mqueryB, stage)), 0) self.assertEqual(mqueryB.GetIncludedCollections(), []) @@ -569,6 +623,7 @@ def test_CircularDependency(self): self.assertFalse(valid) self.assertTrue('circular' in reason) mqueryA = collectionA.ComputeMembershipQuery() + self.checkQuery(mqueryA, stage) self.assertEqual(len(ComputeIncObjs(mqueryA, stage)), 0) self.assertEqual(mqueryA.GetIncludedCollections(), []) @@ -599,11 +654,13 @@ def test_CollectionEquivalence(self): collections = Usd.CollectionAPI.GetAll(testPrim) self.assertTrue(len(collections) > 1) - # Each of their membership queries should be equal to itself, - # and unequal to the others. Same for their hashes -- although - # note that the hashes are not, in general, guaranteed to be - # distinct due to the pigeonhole principle. + # Each of their membership queries should be equal to itself, and + # unequal to the others. Same for their hashes -- although note that + # the hashes are not, in general, guaranteed to be distinct due to the + # pigeonhole principle. Queries that do not use the rule map (i.e. they + # use a membershipExpression) do not compare or hash equal. mqueries = [c.ComputeMembershipQuery() for c in collections] + mqueries = [q for q in mqueries if q.UsesPathExpansionRuleMap()] for i in range(len(mqueries)): for j in range(i, len(mqueries)): if i == j: @@ -690,6 +747,55 @@ def test_ExplicitOnlyAndIncludeRoot(self): self.assertEqual( Usd.ComputeIncludedPathsFromCollection(query, stage), []) + def test_MembershipExpressions(self): + withMembershipExpr = Usd.CollectionAPI.Get( + testPrim, 'withMembershipExpr') + + query = withMembershipExpr.ComputeMembershipQuery() + self.assertFalse(query.UsesPathExpansionRuleMap()) + + self.assertEqual( + Usd.ComputeIncludedPathsFromCollection(query, stage), + [Sdf.Path('/CollectionTest/Geom/Box'), + Sdf.Path('/CollectionTest/Geom/Shapes/Cone'), + Sdf.Path('/CollectionTest/Geom/Shapes/Cube'), + Sdf.Path('/CollectionTest/Geom/Shapes/Cylinder'), + Sdf.Path('/CollectionTest/Geom/Shapes/Sphere/Hemisphere1'), + Sdf.Path('/CollectionTest/Geom/Shapes/Sphere/Hemisphere2')]) + + # Test ResolveCompleteMembershipExpression. + self.assertEqual( + withMembershipExpr.ResolveCompleteMembershipExpression(), + Sdf.PathExpression("/CollectionTest/Geom//C* //{model} //Box " + "/CollectionTest/Geom/Shapes//H*")) + + expressionRef = Usd.CollectionAPI.Get( + testPrim, 'expressionRef') + query = expressionRef.ComputeMembershipQuery() + self.assertFalse(query.UsesPathExpansionRuleMap()) + self.assertEqual( + Usd.ComputeIncludedPathsFromCollection(query, stage), + [Sdf.Path('/CollectionTest/Geom/Shapes/Sphere/Hemisphere1'), + Sdf.Path('/CollectionTest/Geom/Shapes/Sphere/Hemisphere2')]) + + # Test that `//` leading exprs translate across references. + srcStage = Usd.Stage.CreateInMemory() + dstStage = Usd.Stage.CreateInMemory() + + src = srcStage.DefinePrim('/src') + dst = dstStage.DefinePrim('/dst') + + dstCapi = Usd.CollectionAPI.Apply(dst, 'testRef') + dstCapi.GetMembershipExpressionAttr().Set(Sdf.PathExpression('//')) + + src.GetReferences().AddReference( + dstStage.GetRootLayer().identifier, '/dst') + + srcCapi = Usd.CollectionAPI.Get(src, 'testRef') + self.assertTrue(srcCapi) + self.assertEqual(srcCapi.GetMembershipExpressionAttr().Get(), + Sdf.PathExpression('//')) + def test_HashMembershipQuery(self): self.assertEqual( hash(Usd.UsdCollectionMembershipQuery()), diff --git a/pxr/usd/usd/testenv/testUsdCollectionAPI/Test.usda b/pxr/usd/usd/testenv/testUsdCollectionAPI/Test.usda index 2883220dec..56c02a714e 100644 --- a/pxr/usd/usd/testenv/testUsdCollectionAPI/Test.usda +++ b/pxr/usd/usd/testenv/testUsdCollectionAPI/Test.usda @@ -7,7 +7,7 @@ def "CollectionTest" ( kind = "prop" - prepend apiSchemas = ["CollectionAPI:leafGeom", "CollectionAPI:allGeom", "CollectionAPI:allGeomProperties", "CollectionAPI:hasRelationships", "CollectionAPI:hasInstanceProxy", "CollectionAPI:coneProperties", "CollectionAPI:includesCollection", "CollectionAPI:includesNestedCollection", "CollectionAPI:excludeInstanceGeom", "CollectionAPI:invalidExpansionRule", "CollectionAPI:invalidExcludesExplicitOnly", "CollectionAPI:invalidExcludesExpandPrims", "CollectionAPI:invalidTopLevelRules"] + prepend apiSchemas = ["CollectionAPI:leafGeom", "CollectionAPI:allGeom", "CollectionAPI:allGeomProperties", "CollectionAPI:hasRelationships", "CollectionAPI:hasInstanceProxy", "CollectionAPI:coneProperties", "CollectionAPI:includesCollection", "CollectionAPI:includesNestedCollection", "CollectionAPI:excludeInstanceGeom", "CollectionAPI:invalidExpansionRule", "CollectionAPI:invalidExcludesExplicitOnly", "CollectionAPI:invalidExcludesExpandPrims", "CollectionAPI:invalidTopLevelRules", "CollectionAPI:withMembershipExpr", "CollectionAPI:expressionRef"] ) { # simple explicit collection @@ -105,6 +105,10 @@ def "CollectionTest" ( uniform token collection:explicitOnlyAndIncludeRoot:expansionRule = "explicitOnly" uniform bool collection:explicitOnlyAndIncludeRoot:includeRoot = true + pathExpression collection:withMembershipExpr:membershipExpression = "/CollectionTest/Geom//C* //{model} //Box %:expressionRef" + + pathExpression collection:expressionRef:membershipExpression = "/CollectionTest/Geom/Shapes//H*" + def "Geom" ( prepend apiSchemas = ["CollectionAPI:allGeom"] ) diff --git a/pxr/usd/usd/testenv/testUsdCratePayloadConversionFromVersion07.py b/pxr/usd/usd/testenv/testUsdCratePayloadConversionFromVersion07.py index 02ac9dcc5f..5f68277986 100644 --- a/pxr/usd/usd/testenv/testUsdCratePayloadConversionFromVersion07.py +++ b/pxr/usd/usd/testenv/testUsdCratePayloadConversionFromVersion07.py @@ -2,25 +2,8 @@ # # Copyright 2019 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. import unittest, shutil from pxr import Sdf, Usd diff --git a/pxr/usd/usd/testenv/testUsdCrateRelocates.py b/pxr/usd/usd/testenv/testUsdCrateRelocates.py index 3c1acd960f..52d05722ff 100644 --- a/pxr/usd/usd/testenv/testUsdCrateRelocates.py +++ b/pxr/usd/usd/testenv/testUsdCrateRelocates.py @@ -2,25 +2,8 @@ # # Copyright 2024 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. import unittest, shutil from pxr import Sdf, Usd diff --git a/pxr/usd/usd/testenv/testUsdCreateAttributeCpp.cpp b/pxr/usd/usd/testenv/testUsdCreateAttributeCpp.cpp index 020b171ba7..e487a1dd02 100644 --- a/pxr/usd/usd/testenv/testUsdCreateAttributeCpp.cpp +++ b/pxr/usd/usd/testenv/testUsdCreateAttributeCpp.cpp @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/usd/testenv/testUsdCreateProperties.py b/pxr/usd/usd/testenv/testUsdCreateProperties.py index 203853d535..48124a7acc 100644 --- a/pxr/usd/usd/testenv/testUsdCreateProperties.py +++ b/pxr/usd/usd/testenv/testUsdCreateProperties.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # pylint: disable=map-builtin-not-iterating diff --git a/pxr/usd/usd/testenv/testUsdDataFormats.py b/pxr/usd/usd/testenv/testUsdDataFormats.py index 2389ea2bf1..7795f1102a 100644 --- a/pxr/usd/usd/testenv/testUsdDataFormats.py +++ b/pxr/usd/usd/testenv/testUsdDataFormats.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from __future__ import print_function diff --git a/pxr/usd/usd/testenv/testUsdEditTarget.py b/pxr/usd/usd/testenv/testUsdEditTarget.py index 28ce0609ee..bbe3e609a8 100644 --- a/pxr/usd/usd/testenv/testUsdEditTarget.py +++ b/pxr/usd/usd/testenv/testUsdEditTarget.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. import os, sys, unittest from pxr import Gf, Tf, Sdf, Pcp, Usd diff --git a/pxr/usd/usd/testenv/testUsdErrors.py b/pxr/usd/usd/testenv/testUsdErrors.py index cded3ba162..1794ac007e 100644 --- a/pxr/usd/usd/testenv/testUsdErrors.py +++ b/pxr/usd/usd/testenv/testUsdErrors.py @@ -2,25 +2,8 @@ # # Copyright 2021 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from __future__ import print_function import sys, os, unittest diff --git a/pxr/usd/usd/testenv/testUsdExternalAssetDependencies.py b/pxr/usd/usd/testenv/testUsdExternalAssetDependencies.py index fb6806ddd4..bebaaa84da 100644 --- a/pxr/usd/usd/testenv/testUsdExternalAssetDependencies.py +++ b/pxr/usd/usd/testenv/testUsdExternalAssetDependencies.py @@ -2,25 +2,8 @@ # # Copyright 2020 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from __future__ import print_function diff --git a/pxr/usd/usd/testenv/testUsdFallbackPrimTypes.py b/pxr/usd/usd/testenv/testUsdFallbackPrimTypes.py index 56e8e69ea7..c40e99a22b 100644 --- a/pxr/usd/usd/testenv/testUsdFallbackPrimTypes.py +++ b/pxr/usd/usd/testenv/testUsdFallbackPrimTypes.py @@ -2,25 +2,8 @@ # # Copyright 2020 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. import os, unittest from pxr import Plug, Sdf, Usd, Vt, Tf diff --git a/pxr/usd/usd/testenv/testUsdFileFormats.py b/pxr/usd/usd/testenv/testUsdFileFormats.py index 5a5559bdc3..9b82883d8b 100644 --- a/pxr/usd/usd/testenv/testUsdFileFormats.py +++ b/pxr/usd/usd/testenv/testUsdFileFormats.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. import shutil, os, unittest from pxr import Sdf, Usd, Tf diff --git a/pxr/usd/usd/testenv/testUsdFlatten.py b/pxr/usd/usd/testenv/testUsdFlatten.py index 9b86b93ebd..ad440e9b2f 100644 --- a/pxr/usd/usd/testenv/testUsdFlatten.py +++ b/pxr/usd/usd/testenv/testUsdFlatten.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # pylint: disable=range-builtin-not-iterating diff --git a/pxr/usd/usd/testenv/testUsdFlatten2.py b/pxr/usd/usd/testenv/testUsdFlatten2.py index d60f966a3d..dd83ff9c94 100644 --- a/pxr/usd/usd/testenv/testUsdFlatten2.py +++ b/pxr/usd/usd/testenv/testUsdFlatten2.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from __future__ import print_function diff --git a/pxr/usd/usd/testenv/testUsdFlattenLayerStack.py b/pxr/usd/usd/testenv/testUsdFlattenLayerStack.py index fd95bdcf02..ced51a010d 100644 --- a/pxr/usd/usd/testenv/testUsdFlattenLayerStack.py +++ b/pxr/usd/usd/testenv/testUsdFlattenLayerStack.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from __future__ import print_function diff --git a/pxr/usd/usd/testenv/testUsdFlattenProperties.py b/pxr/usd/usd/testenv/testUsdFlattenProperties.py index 29f584b3c6..947822625a 100644 --- a/pxr/usd/usd/testenv/testUsdFlattenProperties.py +++ b/pxr/usd/usd/testenv/testUsdFlattenProperties.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. import os, unittest from pxr import Usd, Sdf, Tf, Plug diff --git a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/api.h b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/api.h index 816f5a9fa2..3e803a9c9c 100644 --- a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/api.h +++ b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/api.h @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDCONTRIVED_API_H #define USDCONTRIVED_API_H diff --git a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/base.cpp b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/base.cpp index eaa8f68a0a..dfe05f5429 100644 --- a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/base.cpp +++ b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/base.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdContrived/base.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/base.h b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/base.h index ccb1a07086..7e9b6bbd75 100644 --- a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/base.h +++ b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/base.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDCONTRIVED_GENERATED_BASE_H #define USDCONTRIVED_GENERATED_BASE_H diff --git a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/derived.cpp b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/derived.cpp index cffb49f3f3..6e24be010a 100644 --- a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/derived.cpp +++ b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/derived.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdContrived/derived.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/derived.h b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/derived.h index 7c19e75b71..87032e05d7 100644 --- a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/derived.h +++ b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/derived.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDCONTRIVED_GENERATED_DERIVED_H #define USDCONTRIVED_GENERATED_DERIVED_H diff --git a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/derivedNonAppliedAPI.cpp b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/derivedNonAppliedAPI.cpp index 4463b5e60a..c7cc8e6c5f 100644 --- a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/derivedNonAppliedAPI.cpp +++ b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/derivedNonAppliedAPI.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdContrived/derivedNonAppliedAPI.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/derivedNonAppliedAPI.h b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/derivedNonAppliedAPI.h index 14a3ea3e5d..deeaaac0a8 100644 --- a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/derivedNonAppliedAPI.h +++ b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/derivedNonAppliedAPI.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDCONTRIVED_GENERATED_DERIVEDNONAPPLIEDAPI_H #define USDCONTRIVED_GENERATED_DERIVEDNONAPPLIEDAPI_H diff --git a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/emptyMultipleApplyAPI.cpp b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/emptyMultipleApplyAPI.cpp index 01b8182ff6..dcfad1cd55 100644 --- a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/emptyMultipleApplyAPI.cpp +++ b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/emptyMultipleApplyAPI.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdContrived/emptyMultipleApplyAPI.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/emptyMultipleApplyAPI.h b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/emptyMultipleApplyAPI.h index f40a92dc97..e027889f54 100644 --- a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/emptyMultipleApplyAPI.h +++ b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/emptyMultipleApplyAPI.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDCONTRIVED_GENERATED_EMPTYMULTIPLEAPPLYAPI_H #define USDCONTRIVED_GENERATED_EMPTYMULTIPLEAPPLYAPI_H @@ -65,7 +48,7 @@ class UsdContrivedEmptyMultipleApplyAPI : public UsdAPISchemaBase /// UsdContrivedEmptyMultipleApplyAPI::Get( /// prim.GetStage(), /// prim.GetPath().AppendProperty( - /// "None:name")); + /// ":name")); /// /// for a \em valid \p prim, but will not immediately throw an error for /// an invalid \p prim diff --git a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/multipleApplyAPI.cpp b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/multipleApplyAPI.cpp index 71a2560534..6a524be824 100644 --- a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/multipleApplyAPI.cpp +++ b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/multipleApplyAPI.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdContrived/multipleApplyAPI.h" #include "pxr/usd/usd/schemaRegistry.h" @@ -28,8 +11,6 @@ #include "pxr/usd/sdf/types.h" #include "pxr/usd/sdf/assetPath.h" -#include "pxr/base/tf/staticTokens.h" - PXR_NAMESPACE_OPEN_SCOPE // Register the schema with the TfType system. @@ -40,11 +21,6 @@ TF_REGISTRY_FUNCTION(TfType) } -TF_DEFINE_PRIVATE_TOKENS( - _schemaTokens, - (test) -); - /* virtual */ UsdContrivedMultipleApplyAPI::~UsdContrivedMultipleApplyAPI() { @@ -125,9 +101,9 @@ UsdContrivedMultipleApplyAPI::IsMultipleApplyAPIPath( } if (tokens.size() >= 2 - && tokens[0] == _schemaTokens->test) { + && tokens[0] == UsdContrivedTokens->test) { *name = TfToken(propertyName.substr( - _schemaTokens->test.GetString().size() + 1)); + UsdContrivedTokens->test.GetString().size() + 1)); return true; } diff --git a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/multipleApplyAPI.h b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/multipleApplyAPI.h index 3f5d10182a..5de1fa9c60 100644 --- a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/multipleApplyAPI.h +++ b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/multipleApplyAPI.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDCONTRIVED_GENERATED_MULTIPLEAPPLYAPI_H #define USDCONTRIVED_GENERATED_MULTIPLEAPPLYAPI_H diff --git a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/multipleApplyAPI_1.cpp b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/multipleApplyAPI_1.cpp index 50f7a2e244..cec6f6e56a 100644 --- a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/multipleApplyAPI_1.cpp +++ b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/multipleApplyAPI_1.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdContrived/multipleApplyAPI_1.h" #include "pxr/usd/usd/schemaRegistry.h" @@ -28,8 +11,6 @@ #include "pxr/usd/sdf/types.h" #include "pxr/usd/sdf/assetPath.h" -#include "pxr/base/tf/staticTokens.h" - PXR_NAMESPACE_OPEN_SCOPE // Register the schema with the TfType system. @@ -40,11 +21,6 @@ TF_REGISTRY_FUNCTION(TfType) } -TF_DEFINE_PRIVATE_TOKENS( - _schemaTokens, - (testNewVersion) -); - /* virtual */ UsdContrivedMultipleApplyAPI_1::~UsdContrivedMultipleApplyAPI_1() { @@ -123,9 +99,9 @@ UsdContrivedMultipleApplyAPI_1::IsMultipleApplyAPI_1Path( } if (tokens.size() >= 2 - && tokens[0] == _schemaTokens->testNewVersion) { + && tokens[0] == UsdContrivedTokens->testNewVersion) { *name = TfToken(propertyName.substr( - _schemaTokens->testNewVersion.GetString().size() + 1)); + UsdContrivedTokens->testNewVersion.GetString().size() + 1)); return true; } diff --git a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/multipleApplyAPI_1.h b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/multipleApplyAPI_1.h index 3125aecce7..f7564713f8 100644 --- a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/multipleApplyAPI_1.h +++ b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/multipleApplyAPI_1.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDCONTRIVED_GENERATED_MULTIPLEAPPLYAPI_1_H #define USDCONTRIVED_GENERATED_MULTIPLEAPPLYAPI_1_H diff --git a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/nonAppliedAPI.cpp b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/nonAppliedAPI.cpp index a0c0f1eb51..a19a23596b 100644 --- a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/nonAppliedAPI.cpp +++ b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/nonAppliedAPI.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdContrived/nonAppliedAPI.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/nonAppliedAPI.h b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/nonAppliedAPI.h index 18ce3e7bb5..95c1a8d786 100644 --- a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/nonAppliedAPI.h +++ b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/nonAppliedAPI.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDCONTRIVED_GENERATED_NONAPPLIEDAPI_H #define USDCONTRIVED_GENERATED_NONAPPLIEDAPI_H diff --git a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/publicMultipleApplyAPI.cpp b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/publicMultipleApplyAPI.cpp index 3bec69482b..2cecdb73a4 100644 --- a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/publicMultipleApplyAPI.cpp +++ b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/publicMultipleApplyAPI.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdContrived/publicMultipleApplyAPI.h" #include "pxr/usd/usd/schemaRegistry.h" @@ -28,8 +11,6 @@ #include "pxr/usd/sdf/types.h" #include "pxr/usd/sdf/assetPath.h" -#include "pxr/base/tf/staticTokens.h" - PXR_NAMESPACE_OPEN_SCOPE // Register the schema with the TfType system. @@ -40,11 +21,6 @@ TF_REGISTRY_FUNCTION(TfType) } -TF_DEFINE_PRIVATE_TOKENS( - _schemaTokens, - (testo) -); - /* virtual */ UsdContrivedPublicMultipleApplyAPI::~UsdContrivedPublicMultipleApplyAPI() { @@ -125,9 +101,9 @@ UsdContrivedPublicMultipleApplyAPI::IsPublicMultipleApplyAPIPath( } if (tokens.size() >= 2 - && tokens[0] == _schemaTokens->testo) { + && tokens[0] == UsdContrivedTokens->testo) { *name = TfToken(propertyName.substr( - _schemaTokens->testo.GetString().size() + 1)); + UsdContrivedTokens->testo.GetString().size() + 1)); return true; } diff --git a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/publicMultipleApplyAPI.h b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/publicMultipleApplyAPI.h index 0535090dfc..5a9be34e63 100644 --- a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/publicMultipleApplyAPI.h +++ b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/publicMultipleApplyAPI.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDCONTRIVED_GENERATED_PUBLICMULTIPLEAPPLYAPI_H #define USDCONTRIVED_GENERATED_PUBLICMULTIPLEAPPLYAPI_H diff --git a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/singleApplyAPI.cpp b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/singleApplyAPI.cpp index e6d0b59d53..aec11134a5 100644 --- a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/singleApplyAPI.cpp +++ b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/singleApplyAPI.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdContrived/singleApplyAPI.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/singleApplyAPI.h b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/singleApplyAPI.h index 184fb27360..b65eb53c3c 100644 --- a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/singleApplyAPI.h +++ b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/singleApplyAPI.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDCONTRIVED_GENERATED_SINGLEAPPLYAPI_H #define USDCONTRIVED_GENERATED_SINGLEAPPLYAPI_H diff --git a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/singleApplyAPI_1.cpp b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/singleApplyAPI_1.cpp index 1eb3a01591..0c898ae8e8 100644 --- a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/singleApplyAPI_1.cpp +++ b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/singleApplyAPI_1.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdContrived/singleApplyAPI_1.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/singleApplyAPI_1.h b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/singleApplyAPI_1.h index 3be7b0cd60..4105a9972c 100644 --- a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/singleApplyAPI_1.h +++ b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/singleApplyAPI_1.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDCONTRIVED_GENERATED_SINGLEAPPLYAPI_1_H #define USDCONTRIVED_GENERATED_SINGLEAPPLYAPI_1_H diff --git a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/testHairman.cpp b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/testHairman.cpp index 70122fc5aa..5aa07a82dd 100644 --- a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/testHairman.cpp +++ b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/testHairman.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdContrived/testHairman.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/testHairman.h b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/testHairman.h index ac3779bff4..ffc4414a71 100644 --- a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/testHairman.h +++ b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/testHairman.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDCONTRIVED_GENERATED_TESTHAIRMAN_H #define USDCONTRIVED_GENERATED_TESTHAIRMAN_H diff --git a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/testHairman_1.cpp b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/testHairman_1.cpp index 4ed3d35ddb..ba485aa98c 100644 --- a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/testHairman_1.cpp +++ b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/testHairman_1.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdContrived/testHairman_1.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/testHairman_1.h b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/testHairman_1.h index cc37f852dc..cc517f7c49 100644 --- a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/testHairman_1.h +++ b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/testHairman_1.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDCONTRIVED_GENERATED_TESTHAIRMAN_1_H #define USDCONTRIVED_GENERATED_TESTHAIRMAN_1_H diff --git a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/testNoVersion0_2.cpp b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/testNoVersion0_2.cpp index 92dd43e8bf..506fbc1a8b 100644 --- a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/testNoVersion0_2.cpp +++ b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/testNoVersion0_2.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdContrived/testNoVersion0_2.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/testNoVersion0_2.h b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/testNoVersion0_2.h index 750f690197..8ba1141a45 100644 --- a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/testNoVersion0_2.h +++ b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/testNoVersion0_2.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDCONTRIVED_GENERATED_TESTNOVERSION0_2_H #define USDCONTRIVED_GENERATED_TESTNOVERSION0_2_H diff --git a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/tokens.cpp b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/tokens.cpp index 6ad91e530f..15c2541c23 100644 --- a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/tokens.cpp +++ b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/tokens.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdContrived/tokens.h" diff --git a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/tokens.h b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/tokens.h index de1d0c6974..be293e0378 100644 --- a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/tokens.h +++ b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/tokens.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDCONTRIVED_TOKENS_H #define USDCONTRIVED_TOKENS_H diff --git a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/wrapBase.cpp b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/wrapBase.cpp index 7b87a94a51..2850d93782 100644 --- a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/wrapBase.cpp +++ b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/wrapBase.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdContrived/base.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/wrapDerived.cpp b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/wrapDerived.cpp index 8b677f311d..ffeae95c67 100644 --- a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/wrapDerived.cpp +++ b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/wrapDerived.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdContrived/derived.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/wrapDerivedNonAppliedAPI.cpp b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/wrapDerivedNonAppliedAPI.cpp index e65bd8b046..c4d1a5574a 100644 --- a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/wrapDerivedNonAppliedAPI.cpp +++ b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/wrapDerivedNonAppliedAPI.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdContrived/derivedNonAppliedAPI.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/wrapEmptyMultipleApplyAPI.cpp b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/wrapEmptyMultipleApplyAPI.cpp index f5bf9b6ce1..f79904bf18 100644 --- a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/wrapEmptyMultipleApplyAPI.cpp +++ b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/wrapEmptyMultipleApplyAPI.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdContrived/emptyMultipleApplyAPI.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/wrapMultipleApplyAPI.cpp b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/wrapMultipleApplyAPI.cpp index 8c38ac2104..6351223adf 100644 --- a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/wrapMultipleApplyAPI.cpp +++ b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/wrapMultipleApplyAPI.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdContrived/multipleApplyAPI.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/wrapMultipleApplyAPI_1.cpp b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/wrapMultipleApplyAPI_1.cpp index 9745005480..91285961c9 100644 --- a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/wrapMultipleApplyAPI_1.cpp +++ b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/wrapMultipleApplyAPI_1.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdContrived/multipleApplyAPI_1.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/wrapNonAppliedAPI.cpp b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/wrapNonAppliedAPI.cpp index 0bf5e9b913..12396ae0cc 100644 --- a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/wrapNonAppliedAPI.cpp +++ b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/wrapNonAppliedAPI.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdContrived/nonAppliedAPI.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/wrapPublicMultipleApplyAPI.cpp b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/wrapPublicMultipleApplyAPI.cpp index e619187dd6..82a8e7680f 100644 --- a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/wrapPublicMultipleApplyAPI.cpp +++ b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/wrapPublicMultipleApplyAPI.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdContrived/publicMultipleApplyAPI.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/wrapSingleApplyAPI.cpp b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/wrapSingleApplyAPI.cpp index 7710701187..aed479a91f 100644 --- a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/wrapSingleApplyAPI.cpp +++ b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/wrapSingleApplyAPI.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdContrived/singleApplyAPI.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/wrapSingleApplyAPI_1.cpp b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/wrapSingleApplyAPI_1.cpp index 04b40a0273..b090be89f4 100644 --- a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/wrapSingleApplyAPI_1.cpp +++ b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/wrapSingleApplyAPI_1.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdContrived/singleApplyAPI_1.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/wrapTestHairman.cpp b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/wrapTestHairman.cpp index 29212093d7..066dca36bd 100644 --- a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/wrapTestHairman.cpp +++ b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/wrapTestHairman.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdContrived/testHairman.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/wrapTestHairman_1.cpp b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/wrapTestHairman_1.cpp index 8b7afac01c..2b464c1f0b 100644 --- a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/wrapTestHairman_1.cpp +++ b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/wrapTestHairman_1.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdContrived/testHairman_1.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/wrapTestNoVersion0_2.cpp b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/wrapTestNoVersion0_2.cpp index 48ca01d98f..2f828518a8 100644 --- a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/wrapTestNoVersion0_2.cpp +++ b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/wrapTestNoVersion0_2.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdContrived/testNoVersion0_2.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/wrapTokens.cpp b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/wrapTokens.cpp index 504b0b1ee8..60abefd25e 100644 --- a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/wrapTokens.cpp +++ b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/wrapTokens.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // // GENERATED FILE. DO NOT EDIT. #include diff --git a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/headerTerminatorString/api.h b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/headerTerminatorString/api.h index 816f5a9fa2..3e803a9c9c 100644 --- a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/headerTerminatorString/api.h +++ b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/headerTerminatorString/api.h @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDCONTRIVED_API_H #define USDCONTRIVED_API_H diff --git a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/headerTerminatorString/base.cpp b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/headerTerminatorString/base.cpp index 55c98e1f45..c64e7969e5 100644 --- a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/headerTerminatorString/base.cpp +++ b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/headerTerminatorString/base.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdContrived/base.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/headerTerminatorString/base.h b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/headerTerminatorString/base.h index 3e61debfb3..6246b5b0f8 100644 --- a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/headerTerminatorString/base.h +++ b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/headerTerminatorString/base.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDCONTRIVED_GENERATED_BASE_H #define USDCONTRIVED_GENERATED_BASE_H diff --git a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/headerTerminatorString/singleApplyAPI.cpp b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/headerTerminatorString/singleApplyAPI.cpp index ada18ef34c..126e885d15 100644 --- a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/headerTerminatorString/singleApplyAPI.cpp +++ b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/headerTerminatorString/singleApplyAPI.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdContrived/singleApplyAPI.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/headerTerminatorString/singleApplyAPI.h b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/headerTerminatorString/singleApplyAPI.h index c5f53e2036..0914c973b1 100644 --- a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/headerTerminatorString/singleApplyAPI.h +++ b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/headerTerminatorString/singleApplyAPI.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDCONTRIVED_GENERATED_SINGLEAPPLYAPI_H #define USDCONTRIVED_GENERATED_SINGLEAPPLYAPI_H diff --git a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/headerTerminatorString/tokens.cpp b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/headerTerminatorString/tokens.cpp index aab8dd9c5f..eb64580601 100644 --- a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/headerTerminatorString/tokens.cpp +++ b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/headerTerminatorString/tokens.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdContrived/tokens.h" diff --git a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/headerTerminatorString/tokens.h b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/headerTerminatorString/tokens.h index d9918bf8ae..33f6d5aaa4 100644 --- a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/headerTerminatorString/tokens.h +++ b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/headerTerminatorString/tokens.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDCONTRIVED_TOKENS_H #define USDCONTRIVED_TOKENS_H diff --git a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/headerTerminatorString/wrapBase.cpp b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/headerTerminatorString/wrapBase.cpp index a1a7c8cec0..3a33606334 100644 --- a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/headerTerminatorString/wrapBase.cpp +++ b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/headerTerminatorString/wrapBase.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdContrived/base.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/headerTerminatorString/wrapSingleApplyAPI.cpp b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/headerTerminatorString/wrapSingleApplyAPI.cpp index 7ddb8a4744..d2179cbf67 100644 --- a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/headerTerminatorString/wrapSingleApplyAPI.cpp +++ b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/headerTerminatorString/wrapSingleApplyAPI.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdContrived/singleApplyAPI.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/headerTerminatorString/wrapTokens.cpp b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/headerTerminatorString/wrapTokens.cpp index cb31301ef8..4cfd9d6a22 100644 --- a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/headerTerminatorString/wrapTokens.cpp +++ b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/headerTerminatorString/wrapTokens.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // // GENERATED FILE. DO NOT EDIT. #include diff --git a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/namespace/api.h b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/namespace/api.h index 816f5a9fa2..3e803a9c9c 100644 --- a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/namespace/api.h +++ b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/namespace/api.h @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDCONTRIVED_API_H #define USDCONTRIVED_API_H diff --git a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/namespace/base.cpp b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/namespace/base.cpp index c6172cb44b..0b8f659fcf 100644 --- a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/namespace/base.cpp +++ b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/namespace/base.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdContrived/base.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/namespace/base.h b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/namespace/base.h index 2491850c26..ddd2b9aaae 100644 --- a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/namespace/base.h +++ b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/namespace/base.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDCONTRIVED_GENERATED_BASE_H #define USDCONTRIVED_GENERATED_BASE_H diff --git a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/namespace/singleApplyAPI.cpp b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/namespace/singleApplyAPI.cpp index fcc2c62b60..8fa3d43ffe 100644 --- a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/namespace/singleApplyAPI.cpp +++ b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/namespace/singleApplyAPI.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdContrived/singleApplyAPI.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/namespace/singleApplyAPI.h b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/namespace/singleApplyAPI.h index e9ef506ff2..5921cabffb 100644 --- a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/namespace/singleApplyAPI.h +++ b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/namespace/singleApplyAPI.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDCONTRIVED_GENERATED_SINGLEAPPLYAPI_H #define USDCONTRIVED_GENERATED_SINGLEAPPLYAPI_H diff --git a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/namespace/tokens.cpp b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/namespace/tokens.cpp index 05cf44903d..741938fc6f 100644 --- a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/namespace/tokens.cpp +++ b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/namespace/tokens.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdContrived/tokens.h" diff --git a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/namespace/tokens.h b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/namespace/tokens.h index 9ba1b236f8..99b00e012e 100644 --- a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/namespace/tokens.h +++ b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/namespace/tokens.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDCONTRIVED_TOKENS_H #define USDCONTRIVED_TOKENS_H diff --git a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/namespace/wrapBase.cpp b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/namespace/wrapBase.cpp index 0c24dddf78..ac4ce26588 100644 --- a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/namespace/wrapBase.cpp +++ b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/namespace/wrapBase.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdContrived/base.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/namespace/wrapSingleApplyAPI.cpp b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/namespace/wrapSingleApplyAPI.cpp index 45a000772a..9c5fb1b191 100644 --- a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/namespace/wrapSingleApplyAPI.cpp +++ b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/namespace/wrapSingleApplyAPI.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdContrived/singleApplyAPI.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/namespace/wrapTokens.cpp b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/namespace/wrapTokens.cpp index 9adde2d2b8..12893f0c25 100644 --- a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/namespace/wrapTokens.cpp +++ b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/namespace/wrapTokens.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // // GENERATED FILE. DO NOT EDIT. #include diff --git a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/nestedNamespace/api.h b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/nestedNamespace/api.h index 816f5a9fa2..3e803a9c9c 100644 --- a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/nestedNamespace/api.h +++ b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/nestedNamespace/api.h @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDCONTRIVED_API_H #define USDCONTRIVED_API_H diff --git a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/nestedNamespace/base.cpp b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/nestedNamespace/base.cpp index 13e6265d5c..3f81022a2d 100644 --- a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/nestedNamespace/base.cpp +++ b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/nestedNamespace/base.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdContrived/base.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/nestedNamespace/base.h b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/nestedNamespace/base.h index fc37891698..91bb2c5275 100644 --- a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/nestedNamespace/base.h +++ b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/nestedNamespace/base.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDCONTRIVED_GENERATED_BASE_H #define USDCONTRIVED_GENERATED_BASE_H diff --git a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/nestedNamespace/singleApplyAPI.cpp b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/nestedNamespace/singleApplyAPI.cpp index a987a6c406..766535ef74 100644 --- a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/nestedNamespace/singleApplyAPI.cpp +++ b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/nestedNamespace/singleApplyAPI.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdContrived/singleApplyAPI.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/nestedNamespace/singleApplyAPI.h b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/nestedNamespace/singleApplyAPI.h index b9e44731eb..cad8f5347f 100644 --- a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/nestedNamespace/singleApplyAPI.h +++ b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/nestedNamespace/singleApplyAPI.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDCONTRIVED_GENERATED_SINGLEAPPLYAPI_H #define USDCONTRIVED_GENERATED_SINGLEAPPLYAPI_H diff --git a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/nestedNamespace/tokens.cpp b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/nestedNamespace/tokens.cpp index f1852161da..26fadc4d24 100644 --- a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/nestedNamespace/tokens.cpp +++ b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/nestedNamespace/tokens.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdContrived/tokens.h" diff --git a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/nestedNamespace/tokens.h b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/nestedNamespace/tokens.h index 9e8be3e39e..2d73f237cb 100644 --- a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/nestedNamespace/tokens.h +++ b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/nestedNamespace/tokens.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDCONTRIVED_TOKENS_H #define USDCONTRIVED_TOKENS_H diff --git a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/nestedNamespace/wrapBase.cpp b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/nestedNamespace/wrapBase.cpp index 1d9150ef56..1c58ec4d19 100644 --- a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/nestedNamespace/wrapBase.cpp +++ b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/nestedNamespace/wrapBase.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdContrived/base.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/nestedNamespace/wrapSingleApplyAPI.cpp b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/nestedNamespace/wrapSingleApplyAPI.cpp index 3109fce3cb..2326a1f354 100644 --- a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/nestedNamespace/wrapSingleApplyAPI.cpp +++ b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/nestedNamespace/wrapSingleApplyAPI.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdContrived/singleApplyAPI.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/nestedNamespace/wrapTokens.cpp b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/nestedNamespace/wrapTokens.cpp index c62c88e663..917102007c 100644 --- a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/nestedNamespace/wrapTokens.cpp +++ b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/nestedNamespace/wrapTokens.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // // GENERATED FILE. DO NOT EDIT. #include diff --git a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/useLiteralIdentifier/api.h b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/useLiteralIdentifier/api.h index 816f5a9fa2..3e803a9c9c 100644 --- a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/useLiteralIdentifier/api.h +++ b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/useLiteralIdentifier/api.h @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDCONTRIVED_API_H #define USDCONTRIVED_API_H diff --git a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/useLiteralIdentifier/base.cpp b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/useLiteralIdentifier/base.cpp index 55c98e1f45..c64e7969e5 100644 --- a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/useLiteralIdentifier/base.cpp +++ b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/useLiteralIdentifier/base.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdContrived/base.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/useLiteralIdentifier/base.h b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/useLiteralIdentifier/base.h index 5271a2306d..94dadfee45 100644 --- a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/useLiteralIdentifier/base.h +++ b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/useLiteralIdentifier/base.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDCONTRIVED_GENERATED_BASE_H #define USDCONTRIVED_GENERATED_BASE_H diff --git a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/useLiteralIdentifier/tokens.cpp b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/useLiteralIdentifier/tokens.cpp index e8fa2b2c97..28623332dc 100644 --- a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/useLiteralIdentifier/tokens.cpp +++ b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/useLiteralIdentifier/tokens.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdContrived/tokens.h" diff --git a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/useLiteralIdentifier/tokens.h b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/useLiteralIdentifier/tokens.h index 2bcc11c7e2..b4c3e4b90c 100644 --- a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/useLiteralIdentifier/tokens.h +++ b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/useLiteralIdentifier/tokens.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDCONTRIVED_TOKENS_H #define USDCONTRIVED_TOKENS_H diff --git a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/useLiteralIdentifier/wrapBase.cpp b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/useLiteralIdentifier/wrapBase.cpp index a1a7c8cec0..3a33606334 100644 --- a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/useLiteralIdentifier/wrapBase.cpp +++ b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/useLiteralIdentifier/wrapBase.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdContrived/base.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/useLiteralIdentifier/wrapTokens.cpp b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/useLiteralIdentifier/wrapTokens.cpp index 306e0d0b81..e7b2c75414 100644 --- a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/useLiteralIdentifier/wrapTokens.cpp +++ b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/useLiteralIdentifier/wrapTokens.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // // GENERATED FILE. DO NOT EDIT. #include diff --git a/pxr/usd/usd/testenv/testUsdHardToReach.cpp b/pxr/usd/usd/testenv/testUsdHardToReach.cpp index 53c43775f0..5bc042aa7d 100644 --- a/pxr/usd/usd/testenv/testUsdHardToReach.cpp +++ b/pxr/usd/usd/testenv/testUsdHardToReach.cpp @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/usd/testenv/testUsdInherits.py b/pxr/usd/usd/testenv/testUsdInherits.py index af229ab3a7..79b89928e1 100644 --- a/pxr/usd/usd/testenv/testUsdInherits.py +++ b/pxr/usd/usd/testenv/testUsdInherits.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. import unittest from pxr import Usd, Pcp, Sdf, Tf diff --git a/pxr/usd/usd/testenv/testUsdInstanceProxy.py b/pxr/usd/usd/testenv/testUsdInstanceProxy.py index 6657d4b943..94721899a7 100644 --- a/pxr/usd/usd/testenv/testUsdInstanceProxy.py +++ b/pxr/usd/usd/testenv/testUsdInstanceProxy.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from pxr import Sdf, Tf, Usd import unittest @@ -404,6 +387,51 @@ def _ValidateAttributeValue(attrPath, expectedValue): _ValidateAttributeValue( attrPath = '/World/sets/Set_2/Prop_2/geom.x', expectedValue = 1.0) + _ValidateAttributeValue( + attrPath = '/World/sets/Set_1/Prop_1/geom.pathExpr', + expectedValue = Sdf.PathExpression( + '//foo /World/sets/Set_1/Prop_1/anim//*bar')) + _ValidateAttributeValue( + attrPath = '/World/sets/Set_1/Prop_2/geom.pathExpr', + expectedValue = Sdf.PathExpression( + '//foo /World/sets/Set_1/Prop_2/anim//*bar')) + _ValidateAttributeValue( + attrPath = '/World/sets/Set_2/Prop_1/geom.pathExpr', + expectedValue = Sdf.PathExpression( + '//foo /World/sets/Set_2/Prop_1/anim//*bar')) + _ValidateAttributeValue( + attrPath = '/World/sets/Set_2/Prop_2/geom.pathExpr', + expectedValue = Sdf.PathExpression( + '//foo /World/sets/Set_2/Prop_2/anim//*bar')) + + # Check that the pathExpr attribute values in prototypes also map. + def _ValidatePathExprAttrInPrototype(attrPath, expectedPattern): + import re + attrPath = Sdf.Path(attrPath) + proxyPrim = s.GetPrimAtPath(attrPath.GetPrimPath()) + self._ValidateInstanceProxy(attrPath.GetPrimPath(), proxyPrim) + + protoPrim = proxyPrim.GetPrimInPrototype() + attr = protoPrim.GetAttribute(attrPath.name) + self.assertTrue(attr) + self.assertTrue(re.match(expectedPattern, attr.Get().GetText()), + msg=attr.Get().GetText() + ' did not match ' + + expectedPattern) + + pattern = r'//foo /__Prototype_\d+/anim//\*bar' + _ValidatePathExprAttrInPrototype( + attrPath = '/World/sets/Set_1/Prop_1/geom.pathExpr', + expectedPattern = pattern) + _ValidatePathExprAttrInPrototype( + attrPath = '/World/sets/Set_1/Prop_2/geom.pathExpr', + expectedPattern = pattern) + _ValidatePathExprAttrInPrototype( + attrPath = '/World/sets/Set_2/Prop_1/geom.pathExpr', + expectedPattern = pattern) + _ValidatePathExprAttrInPrototype( + attrPath = '/World/sets/Set_2/Prop_2/geom.pathExpr', + expectedPattern = pattern) + def test_GetRelationshipTargets(self): s = Usd.Stage.Open('rels/root.usda') diff --git a/pxr/usd/usd/testenv/testUsdInstanceProxy/nested/prop.usda b/pxr/usd/usd/testenv/testUsdInstanceProxy/nested/prop.usda index 856e41f731..c19c6be90e 100644 --- a/pxr/usd/usd/testenv/testUsdInstanceProxy/nested/prop.usda +++ b/pxr/usd/usd/testenv/testUsdInstanceProxy/nested/prop.usda @@ -6,6 +6,7 @@ def Scope "Prop" { double x = 1.0 rel y + pathExpression pathExpr = "//foo ../anim//*bar" } def Scope "anim" diff --git a/pxr/usd/usd/testenv/testUsdInstancing.py b/pxr/usd/usd/testenv/testUsdInstancing.py index aee2344fd3..8c5c129c37 100644 --- a/pxr/usd/usd/testenv/testUsdInstancing.py +++ b/pxr/usd/usd/testenv/testUsdInstancing.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # NOTE: # Because Usd does not guarantee a stable assignment of diff --git a/pxr/usd/usd/testenv/testUsdInstancingCpp.cpp b/pxr/usd/usd/testenv/testUsdInstancingCpp.cpp index 1f270ce0b7..dff30d6750 100644 --- a/pxr/usd/usd/testenv/testUsdInstancingCpp.cpp +++ b/pxr/usd/usd/testenv/testUsdInstancingCpp.cpp @@ -1,25 +1,8 @@ // // Copyright 2020 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/pcp/primIndex.h" diff --git a/pxr/usd/usd/testenv/testUsdIntegerCoding.cpp b/pxr/usd/usd/testenv/testUsdIntegerCoding.cpp index 8577fad530..deba9f2e1e 100644 --- a/pxr/usd/usd/testenv/testUsdIntegerCoding.cpp +++ b/pxr/usd/usd/testenv/testUsdIntegerCoding.cpp @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/usd/testenv/testUsdLoadUnloadDeepNestedInstancing.py b/pxr/usd/usd/testenv/testUsdLoadUnloadDeepNestedInstancing.py index 8ffb746714..d2980c9e9b 100644 --- a/pxr/usd/usd/testenv/testUsdLoadUnloadDeepNestedInstancing.py +++ b/pxr/usd/usd/testenv/testUsdLoadUnloadDeepNestedInstancing.py @@ -2,25 +2,8 @@ # # Copyright 2020 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # Test to ensure loading and unloading of large nested instance paths, do not diff --git a/pxr/usd/usd/testenv/testUsdMetadata.cpp b/pxr/usd/usd/testenv/testUsdMetadata.cpp index 7099398280..43f41e226e 100644 --- a/pxr/usd/usd/testenv/testUsdMetadata.cpp +++ b/pxr/usd/usd/testenv/testUsdMetadata.cpp @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/usd/testenv/testUsdMetadata.py b/pxr/usd/usd/testenv/testUsdMetadata.py index 10a9f8011b..aa2f836f95 100644 --- a/pxr/usd/usd/testenv/testUsdMetadata.py +++ b/pxr/usd/usd/testenv/testUsdMetadata.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from __future__ import print_function diff --git a/pxr/usd/usd/testenv/testUsdModel.py b/pxr/usd/usd/testenv/testUsdModel.py index f07f16caa0..69765ec416 100644 --- a/pxr/usd/usd/testenv/testUsdModel.py +++ b/pxr/usd/usd/testenv/testUsdModel.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. import unittest from pxr import Usd, Sdf, Kind diff --git a/pxr/usd/usd/testenv/testUsdNamespaceEditor.py b/pxr/usd/usd/testenv/testUsdNamespaceEditor.py index 027fe8b119..98629ade6a 100644 --- a/pxr/usd/usd/testenv/testUsdNamespaceEditor.py +++ b/pxr/usd/usd/testenv/testUsdNamespaceEditor.py @@ -2,25 +2,8 @@ # # Copyright 2023 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. import sys, os, unittest from pxr import Sdf, Usd, Tf, Plug @@ -917,7 +900,7 @@ def _VerifyCannotApplyMovePrimAtPath(path, newPath, expectedMessage): # identifier regardless of platform def getFormattedCwd(): drive, tail = os.path.splitdrive(os.getcwd()) - return drive.lower() + tail.replace('\\', '/') + return drive + tail.replace('\\', '/') # Cannot delete or rename /C (there are no valid reparent targets for # /C on this stage currently regardless of layer permission) @@ -1143,19 +1126,16 @@ def _VerifyCanMovePrimAtPath(primPath, newPrimPath): nonInstancePrim = _VerifyCanDeletePrimAtPath("/NonInstancePrim") # But we can't delete any of the children of the instance prims as they - # are proxies from the prototype. We also can't delete a child of the - # non-instance prim but for a different reason as it is defined across a - # reference and we don't yet support deactivation as delete. + # are proxies from the prototype. _VerifyCannotApplyDeletePrim(instance1.GetChild("B"), "The prim to edit is a prototype proxy descendant of an instance " "prim") _VerifyCannotApplyDeletePrim(instance2.GetChild("B"), "The prim to edit is a prototype proxy descendant of an instance " "prim") - _VerifyCannotApplyDeletePrim(nonInstancePrim.GetChild("B"), - "The prim to delete must be deactivated rather than deleted since " - "it composes opinions introduced by ancestral composition arcs; " - "deletion via deactivation is not yet supported") + # We can delete a child of the non-instance prim but only if relocates + # authoring is allowed as it is defined across a reference. + _VerifyCanDeletePrimAtPath("/NonInstancePrim/B") # Like with delete, we can rename any of the instance and non-instance # prims (as long as the new name is valid). @@ -1165,19 +1145,18 @@ def _VerifyCanMovePrimAtPath(primPath, newPrimPath): "/NonInstancePrim", "/NewNonInstancePrim") # And just like with delete, we can't rename any of the children of the - # instance prims because they are proxies into the prototype. The - # non-instanced prim can't be renamed because relocates aren't supported - # yet. + # instance prims because they are proxies into the prototype. _VerifyCannotApplyRenamePrim(instance1.GetChild("B"), "NewB", "The prim to edit is a prototype proxy descendant of an instance " "prim") _VerifyCannotApplyRenamePrim(instance2.GetChild("B"), "NewB", "The prim to edit is a prototype proxy descendant of an instance " "prim") - _VerifyCannotApplyRenamePrim(nonInstancePrim.GetChild("B"), "NewB", - "The prim to move requires authoring relocates since it composes " - "opinions introduced by ancestral composition arcs; authoring " - "relocates is not yet supported") + # But we can rename a child of the non-instance prim but only if + # relocates authoring is allowed as it is defined across a reference. + _VerifyCanMovePrimAtPath( + "/NonInstancePrim/B", "/NonInstancePrim/NewB") + # We can reparent an instance prim under a non-instance prim instance1 = _VerifyCanMovePrimAtPath( @@ -1225,16 +1204,15 @@ def _VerifyCanMovePrimAtPath(primPath, newPrimPath): _VerifyCannotApplyReparentPrim(nonInstancePrim, prototypePrim.GetChild("B"), "The new parent prim belongs to a prototype prim") - def test_EditPrimsWithCompositionArcs(self): - """Tests namespace edit operations on prims with specs that contribute - opinions across composition arcs. - """ + def _RunEditPrimsWithCompositionArcs(self, allowRelocatesAuthoring): # This stage has few variety of composition arcs on the root prims. stage = Usd.Stage.Open("composition_arcs/root.usda") self.assertTrue(stage) - editor = Usd.NamespaceEditor(stage) + editOptions = Usd.NamespaceEditor.EditOptions() + editOptions.allowRelocatesAuthoring = allowRelocatesAuthoring + editor = Usd.NamespaceEditor(stage, editOptions) # Helper functions for testing prims that we expect to be able to # successfully edit. @@ -1342,15 +1320,12 @@ def _VerifyCannotApplyMovePrimAtPath(primPath, newPrimPath, expectedMessage): # Helper to verify that the prim cannot be deleted nor moved. def _VerifyCannotEditPrimAtPath(primPath): - _VerifyCannotApplyDeletePrimAtPath(primPath, - "The prim to delete must be deactivated rather than deleted " - "since it composes opinions introduced by ancestral " - "composition arcs; deletion via deactivation is not yet " - "supported") - _VerifyCannotApplyMovePrimAtPath(primPath, "/Foo", - "The prim to move requires authoring relocates since it " - "composes opinions introduced by ancestral composition arcs; " - "authoring relocates is not yet supported") + expectedMessage = "The prim to edit requires authoring relocates " \ + "since it composes opinions introduced by ancestral " \ + "composition arcs; relocates authoring must be enabled to " \ + "perform this edit" + _VerifyCannotApplyDeletePrimAtPath(primPath, expectedMessage) + _VerifyCannotApplyMovePrimAtPath(primPath, "/Foo", expectedMessage) # A prim with a direct reference to another prim can be edited. _VerifyCanEditPrimAtPath("/PrimWithReference") @@ -1358,9 +1333,14 @@ def _VerifyCannotEditPrimAtPath(primPath): # But children of the prim which were defined across the reference # (i.e. brought in by an ancestral reference) cannot be edited without # relocates. - _VerifyCannotEditPrimAtPath("/PrimWithReference/ClassChild") - _VerifyCannotEditPrimAtPath("/PrimWithReference/B") - _VerifyCannotEditPrimAtPath("/PrimWithReference/B/A") + if allowRelocatesAuthoring: + _VerifyCanEditPrimAtPath("/PrimWithReference/ClassChild") + _VerifyCanEditPrimAtPath("/PrimWithReference/B") + _VerifyCanEditPrimAtPath("/PrimWithReference/B/A") + else: + _VerifyCannotEditPrimAtPath("/PrimWithReference/ClassChild") + _VerifyCannotEditPrimAtPath("/PrimWithReference/B") + _VerifyCannotEditPrimAtPath("/PrimWithReference/B/A") # But a child prim that was added entirely in the root layer stack, even # though its parent is defined across the reference, can still be edited @@ -1370,7 +1350,10 @@ def _VerifyCannotEditPrimAtPath(primPath): # A prim with a subroot prim reference behaves the same way as a prim # with a root prim reference. _VerifyCanEditPrimAtPath("/PrimWithSubrootReference") - _VerifyCannotEditPrimAtPath("/PrimWithSubrootReference/A") + if allowRelocatesAuthoring: + _VerifyCanEditPrimAtPath("/PrimWithSubrootReference/A") + else: + _VerifyCannotEditPrimAtPath("/PrimWithSubrootReference/A") _VerifyCanEditPrimAtPath("/PrimWithSubrootReference/A/A_Root_Child") # A prim with a variant selection can be edited given the variant is @@ -1379,14 +1362,223 @@ def _VerifyCannotEditPrimAtPath(primPath): # But children of the prim which were defined across the reference # within the selected variant cannot be edited without relocates. - _VerifyCannotEditPrimAtPath("/PrimWithVariant/ClassChild") - _VerifyCannotEditPrimAtPath("/PrimWithVariant/B") - _VerifyCannotEditPrimAtPath("/PrimWithVariant/B/A") + if allowRelocatesAuthoring: + _VerifyCanEditPrimAtPath("/PrimWithVariant/ClassChild") + _VerifyCanEditPrimAtPath("/PrimWithVariant/B") + _VerifyCanEditPrimAtPath("/PrimWithVariant/B/A") + else: + _VerifyCannotEditPrimAtPath("/PrimWithVariant/ClassChild") + _VerifyCannotEditPrimAtPath("/PrimWithVariant/B") + _VerifyCannotEditPrimAtPath("/PrimWithVariant/B/A") # But also a child defined fully in the root layer stack but inside # the variant self still cannot be edited without relocates or edit # target support as it has specs across an ancestral variant arc. - _VerifyCannotEditPrimAtPath("/PrimWithVariant/V1_Root_Child") + if allowRelocatesAuthoring: + _VerifyCanEditPrimAtPath("/PrimWithVariant/V1_Root_Child") + else: + _VerifyCannotEditPrimAtPath("/PrimWithVariant/V1_Root_Child") + + def test_EditPrimsWithCompositionArcs(self): + """Tests namespace edit operations on prims with specs that contribute + opinions across composition arcs. + """ + + self._RunEditPrimsWithCompositionArcs(allowRelocatesAuthoring=True) + self._RunEditPrimsWithCompositionArcs(allowRelocatesAuthoring=False) + + def test_RelocatesAndProhibitedChildren(self): + """Tests how relocates and prohibited children affect allowed namespace + edits.""" + + # Layer with a prim with two children + ref2Layer = Sdf.Layer.CreateAnonymous("ref2.usda") + ref2Layer.ImportFromString('''#usda 1.0 + + def "Ref2Prim" + { + def MadeUpTypeName_2 "ChildInRef2" + { + float a = 2.5 + } + + def MadeUpTypeName_1 "Child" { + int foo = 3 + } + } + ''') + + # Layer with a prim that references the above layer and relocates + # one the prim's children (with over opinions.) + ref1Layer = Sdf.Layer.CreateAnonymous("ref1.usda") + ref1Layer.ImportFromString('''#usda 1.0 + ( + relocates = { + : + } + ) + + def "Ref1Prim" ( + references = @''' + ref2Layer.identifier + '''@ + ) { + over "RelocatedFromRef2" { + string b = "hello" + } + } + ''') + + # Root layer with a prim that references the above layer + rootLayer = Sdf.Layer.CreateAnonymous("root.usda") + rootLayer .ImportFromString('''#usda 1.0 + + def "PrimWithReference" ( + references = @''' + ref1Layer.identifier + '''@ + ) { + over "Child" { + int bar = 5 + } + + def "RootChild" { + } + } + ''') + + # Create our test stage and namespace editor which allows relocates (by + # default). + stage = Usd.Stage.Open(rootLayer) + editor = Usd.NamespaceEditor(stage) + + # Helper for verifying the contents on the composed + # /PrimWithReference/Child as we move it around. Tested on the initial + # prim + def _VerifyChildContents(prim): + self.assertEqual(prim.GetTypeName(), "MadeUpTypeName_1") + self.assertEqual(prim.GetPropertyNames(), + ["bar", "foo"]) + self.assertEqual(prim.GetAttribute("foo").Get(), 3) + self.assertEqual(prim.GetAttribute("bar").Get(), 5) + _VerifyChildContents(stage.GetPrimAtPath('/PrimWithReference/Child')) + + # Helper for verifying the contents on the composed + # /PrimWithReference/RelocatedFromRef2 as we move it around. Tested on + # the initial prim + def _VerifyRelocatedFromRef2Contents(prim): + self.assertEqual(prim.GetTypeName(), "MadeUpTypeName_2") + self.assertEqual(prim.GetPropertyNames(), + ["a", "b"]) + self.assertEqual(prim.GetAttribute("a").Get(), 2.5) + self.assertEqual(prim.GetAttribute("b").Get(), "hello") + _VerifyRelocatedFromRef2Contents( + stage.GetPrimAtPath('/PrimWithReference/RelocatedFromRef2')) + + # Performs and verifies the move of the prim at primPath to newPrimPath. + # Runs to the given verifyContentsFunc to confirm the composed prim was + # indeed moved in its entirety + def _VerifyCanMovePrimAtPath(primPath, newPrimPath, verifyContentsFunc): + # Verify the initial prim exists has the expected contents. + prim = stage.GetPrimAtPath(primPath) + self.assertTrue(prim) + verifyContentsFunc(prim) + + # Verify the new path does not exist. + self.assertFalse(stage.GetPrimAtPath(newPrimPath)) + + # Apply the move edit. + self.assertTrue(editor.MovePrimAtPath(primPath, newPrimPath)) + self.assertTrue(editor.CanApplyEdits()) + self.assertTrue(editor.ApplyEdits()) + + # Verify that no prim exists at the original path. + self.assertFalse(stage.GetPrimAtPath(primPath)) + + # Verify the prim does exist at the new path and has the expected + # contents + newPrim = stage.GetPrimAtPath(newPrimPath) + self.assertTrue(newPrim) + verifyContentsFunc(newPrim) + + # Verifies that the prim at primPath cannot be moved to newPrimPath + # because the new path is a prohibited child of its parent + def _VerifyCannotApplyMovePrimAtPath(primPath, newPrimPath): + # Verify the prim actually exists first + prim = stage.GetPrimAtPath(primPath) + self.assertTrue(prim) + + # Verify that we cannot move the prim for the expected reason + self.assertTrue(editor.MovePrimAtPath(primPath, newPrimPath)) + self._VerifyFalseResult(editor.CanApplyEdits(), + 'The new path is a prohibited child of its parent path because ' + 'of existing relocates.') + with self.assertRaises(Tf.ErrorException): + editor.ApplyEdits() + + # We can move a child prim from across a reference with local relocates. + self.assertEqual(rootLayer.relocates, []) + _VerifyCanMovePrimAtPath( + '/PrimWithReference/Child', '/MovedChild', _VerifyChildContents) + self.assertEqual(rootLayer.relocates, [ + (Sdf.Path('/PrimWithReference/Child'), Sdf.Path('/MovedChild')) + ]) + + # We cannot move a different prim to the now empty pre-relocation path + # even though there is no prim there. This is because relocation + # tombstones do not allow a prim to exist at this path. + _VerifyCannotApplyMovePrimAtPath( + '/PrimWithReference/RootChild', '/PrimWithReference/Child') + + # We can move the moved prim again to another loacation. This updates + # the relocation. + _VerifyCanMovePrimAtPath( + '/MovedChild', '/RenamedMovedChild', _VerifyChildContents) + self.assertEqual(rootLayer.relocates, [ + (Sdf.Path('/PrimWithReference/Child'), Sdf.Path('/RenamedMovedChild')) + ]) + + # And we can move the locally relocated prim back to its original path. + # This is the only prim that be moved to this tombstone location and is + # accomplished by removing the local relocate. + _VerifyCanMovePrimAtPath( + '/RenamedMovedChild', '/PrimWithReference/Child', + _VerifyChildContents) + self.assertEqual(rootLayer.relocates, []) + + # Now try a prim that has been relocated within the reference itself. + # This prim can still be moved in the local layer stack using local + # relocates. + _VerifyCanMovePrimAtPath( + '/PrimWithReference/RelocatedFromRef2', '/MovedRelocatedFromRef2', + _VerifyRelocatedFromRef2Contents) + self.assertEqual(rootLayer.relocates, [ + (Sdf.Path('/PrimWithReference/RelocatedFromRef2'), + Sdf.Path('/MovedRelocatedFromRef2')) + ]) + + # We cannnot move a different prim to the now empty pre-relocation path. + _VerifyCannotApplyMovePrimAtPath( + '/PrimWithReference/RootChild', + '/PrimWithReference/RelocatedFromRef2') + + # We also cannot move a prim into a location that would be the path of + # RelocatedFromRef2 if it were not relocated in the reference layer + # itself (namely ChildInRef2). This is because pre-relocation + # tombstones are propagated through composition arcs. + _VerifyCannotApplyMovePrimAtPath( + '/PrimWithReference/RootChild', '/PrimWithReference/ChildInRef2') + + # We can move the locally relocated prim back to its original + # path within the local layer stack, RelocatedFromRef2, because we + # can undo that relocation locally. + _VerifyCanMovePrimAtPath( + '/MovedRelocatedFromRef2', '/PrimWithReference/RelocatedFromRef2', + _VerifyRelocatedFromRef2Contents) + self.assertEqual(rootLayer.relocates, []) + + # But we cannot move this prim back to it's pre-relocation path from + # within the reference as we can't undo the reference's relocates in the + # local layer stack. + _VerifyCannotApplyMovePrimAtPath( + '/PrimWithReference/RelocatedFromRef2', + '/PrimWithReference/ChildInRef2') if __name__ == '__main__': unittest.main() diff --git a/pxr/usd/usd/testenv/testUsdNamespaceEditorProperties.py b/pxr/usd/usd/testenv/testUsdNamespaceEditorProperties.py index 609d21d904..bac351f157 100644 --- a/pxr/usd/usd/testenv/testUsdNamespaceEditorProperties.py +++ b/pxr/usd/usd/testenv/testUsdNamespaceEditorProperties.py @@ -2,25 +2,8 @@ # # Copyright 2023 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. import sys, os, unittest from pxr import Sdf, Usd, Tf, Plug @@ -829,7 +812,7 @@ def _VerifyCannotApplyMovePropertyAtPath(path, newPath, expectedMessage): # identifier regardless of platform def getFormattedCwd(): drive, tail = os.path.splitdrive(os.getcwd()) - return drive.lower() + tail.replace('\\', '/') + return drive + tail.replace('\\', '/') uneditableLayerMessage = ( "The spec @{cwd}/basic/sub_1.usda@<{propPath}> cannot be " @@ -1198,19 +1181,14 @@ def _VerifyCanMovePropertyAtPath(propPath, newPropPath): # necessitating relocates as opposed to any requirements related to # instancing. def _VerifyCannotEditPropertyWithoutRelocates(prop): - _VerifyCannotApplyDeleteProperty(prop, - "The property to delete must be deactivated rather than " - "deleted since it composes opinions introduced by ancestral " - "composition arcs; deletion via deactivation is not yet " - "supported") - _VerifyCannotApplyRenameProperty(prop, "New_Attr", - "The property to move requires authoring relocates since it " - "composes opinions introduced by ancestral composition arcs; " - "authoring relocates is not supported for properties") + expectedMessage = "The property to edit requires authoring " \ + "relocates since it composes opinions introduced by " \ + "ancestral composition arcs; authoring relocates is not " \ + "supported for properties" + _VerifyCannotApplyDeleteProperty(prop, expectedMessage) + _VerifyCannotApplyRenameProperty(prop, "New_Attr", expectedMessage) _VerifyCannotApplyReparentProperty(prop, basicRootPrim, - "The property to move requires authoring relocates since it " - "composes opinions introduced by ancestral composition arcs; " - "authoring relocates is not supported for properties") + expectedMessage) # Open the stage and get the prims to test. stage, instance1, instance2, nonInstancePrim, prototypePrim = \ @@ -1467,19 +1445,15 @@ def _VerifyCannotEditPropertyAtPath(propPath): reparentedPropPath = \ Sdf.Path("/BasicRootPrim").AppendProperty(propPath.name) - _VerifyCannotApplyDeletePropertyAtPath(propPath, - "The property to delete must be deactivated rather than " - "deleted since it composes opinions introduced by ancestral " - "composition arcs; deletion via deactivation is not yet " - "supported") - _VerifyCannotApplyMovePropertyAtPath(propPath, renamedPropPath, - "The property to move requires authoring relocates since it " - "composes opinions introduced by ancestral composition arcs; " - "authoring relocates is not supported for properties") - _VerifyCannotApplyMovePropertyAtPath(propPath, reparentedPropPath, - "The property to move requires authoring relocates since it " - "composes opinions introduced by ancestral composition arcs; " - "authoring relocates is not supported for properties") + expectedMessage = "The property to edit requires authoring " \ + "relocates since it composes opinions introduced by " \ + "ancestral composition arcs; authoring relocates is not " \ + "supported for properties" + _VerifyCannotApplyDeletePropertyAtPath(propPath, expectedMessage) + _VerifyCannotApplyMovePropertyAtPath(propPath, renamedPropPath, + expectedMessage) + _VerifyCannotApplyMovePropertyAtPath(propPath, reparentedPropPath, + expectedMessage) # /PrimWithReference has a direct reference to @ref.usda@ diff --git a/pxr/usd/usd/testenv/testUsdNamespaceEditorTargetPathFixup.py b/pxr/usd/usd/testenv/testUsdNamespaceEditorTargetPathFixup.py index 9acc5174e9..f408ff1ee5 100644 --- a/pxr/usd/usd/testenv/testUsdNamespaceEditorTargetPathFixup.py +++ b/pxr/usd/usd/testenv/testUsdNamespaceEditorTargetPathFixup.py @@ -2,25 +2,8 @@ # # Copyright 2023 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. import sys, os, unittest from pxr import Sdf, Usd, Tf, Plug @@ -2338,5 +2321,244 @@ def test_ReparentPropertyWithTargets(self): } }) + def test_TargetsFromCompositionArcs(self): + + # Setup: Layer to be referenced with prims that have relationship and + # attributes with targets and connections. /Model/A has targets to + # /Model/B (which exists). /Model/B has targets to /Model/A (which + # exists) and /Model/C (which does NOT exists but will speculatively + # map to a prim in the root layer that will exist.) + refLayer = Sdf.Layer.CreateAnonymous("ref.usda") + refLayer.ImportFromString('''#usda 1.0 + def "Model" + { + def "A" + { + rel a_rel = [] + int a_attr + int a_attr.connect = [] + } + + def "B" + { + rel b_rel = [, ] + int b_attr + int b_attr.connect = [, ] + } + } + ''') + + # Root layer which references the above. Defines /Root/C which has + # targets to A and B (brought in by the reference) and is also the + # prim that is speculatively targeted by /Model/B. Also provides an + # over to A that adds targets to /Root/C. + rootLayer = Sdf.Layer.CreateAnonymous("root.usda") + rootLayer.ImportFromString('''#usda 1.0 + def "Root" ( + references = @''' + refLayer.identifier + '''@ + ) + { + def "C" + { + rel c_rel = [, ] + int c_attr + int c_attr.connect = [, ] + } + + over "A" + { + append rel a_rel = [] + append int a_attr.connect = [] + } + } + ''') + + # Create a stage and editor. + stage = Usd.Stage.Open(rootLayer) + editor = Usd.NamespaceEditor(stage) + + # Verify initial prims + self.assertEqual(stage.GetPrimAtPath("/Root").GetChildrenNames(), + ["A", "B", "C"]) + # Verify no relocates + self.assertEqual(rootLayer.relocates, []) + + # /Root/A properties target B and C + self.assertEqual( + stage.GetRelationshipAtPath("/Root/A.a_rel").GetTargets(), + ["/Root/B", "/Root/C"]) + self.assertEqual( + stage.GetAttributeAtPath("/Root/A.a_attr").GetConnections(), + ["/Root/B.b_attr", "/Root/C.c_attr"]) + + # /Root/B properties target A and C + self.assertEqual( + stage.GetRelationshipAtPath("/Root/B.b_rel").GetTargets(), + ["/Root/A", "/Root/C"]) + self.assertEqual( + stage.GetAttributeAtPath("/Root/B.b_attr").GetConnections(), + ["/Root/A.a_attr", "/Root/C.c_attr"]) + + # /Root/C properties target A and B + self.assertEqual( + stage.GetRelationshipAtPath("/Root/C.c_rel").GetTargets(), + ["/Root/A", "/Root/B"]) + self.assertEqual( + stage.GetAttributeAtPath("/Root/C.c_attr").GetConnections(), + ["/Root/A.a_attr", "/Root/B.b_attr"]) + + # Rename /Root/A to Moved_A + self.assertTrue(editor.MovePrimAtPath("/Root/A", "/Root/Moved_A")) + self.assertTrue(editor.ApplyEdits()) + + # Verify the prim was renamed. + self.assertEqual(stage.GetPrimAtPath("/Root").GetChildrenNames(), + ["Moved_A", "B", "C"]) + # Verify A was relocated. + self.assertEqual(rootLayer.relocates, [("/Root/A", "/Root/Moved_A")]) + + # Moved_A has the same targets as before the rename. + self.assertEqual( + stage.GetRelationshipAtPath("/Root/Moved_A.a_rel").GetTargets(), + ["/Root/B", "/Root/C"]) + self.assertEqual( + stage.GetAttributeAtPath("/Root/Moved_A.a_attr").GetConnections(), + ["/Root/B.b_attr", "/Root/C.c_attr"]) + + # /Root/B properties have been updated to target Moved_A + self.assertEqual( + stage.GetRelationshipAtPath("/Root/B.b_rel").GetTargets(), + ["/Root/Moved_A", "/Root/C"]) + self.assertEqual( + stage.GetAttributeAtPath("/Root/B.b_attr").GetConnections(), + ["/Root/Moved_A.a_attr", "/Root/C.c_attr"]) + + # /Root/C properties have been updated to target Moved_A + self.assertEqual( + stage.GetRelationshipAtPath("/Root/C.c_rel").GetTargets(), + ["/Root/Moved_A", "/Root/B"]) + self.assertEqual( + stage.GetAttributeAtPath("/Root/C.c_attr").GetConnections(), + ["/Root/Moved_A.a_attr", "/Root/B.b_attr"]) + + # Rename /Root/B to Moved_B + self.assertTrue(editor.MovePrimAtPath("/Root/B", "/Root/Moved_B")) + self.assertTrue(editor.ApplyEdits()) + + # Verify that B is now also renamed. + self.assertEqual(stage.GetPrimAtPath("/Root").GetChildrenNames(), + ["Moved_A", "Moved_B", "C"]) + # Verify B is now also relocated. + self.assertEqual(rootLayer.relocates, [ + ("/Root/A", "/Root/Moved_A"), + ("/Root/B", "/Root/Moved_B")]) + + # /Root/Moved_A properties have been updated to target Moved_B + self.assertEqual( + stage.GetRelationshipAtPath("/Root/Moved_A.a_rel").GetTargets(), + ["/Root/Moved_B", "/Root/C"]) + self.assertEqual( + stage.GetAttributeAtPath("/Root/Moved_A.a_attr").GetConnections(), + ["/Root/Moved_B.b_attr", "/Root/C.c_attr"]) + + # Moved_B has the same targets as before the rename. + self.assertEqual( + stage.GetRelationshipAtPath("/Root/Moved_B.b_rel").GetTargets(), + ["/Root/Moved_A", "/Root/C"]) + self.assertEqual( + stage.GetAttributeAtPath("/Root/Moved_B.b_attr").GetConnections(), + ["/Root/Moved_A.a_attr", "/Root/C.c_attr"]) + + # /Root/Moved_C properties have been updated to target Moved_B + self.assertEqual( + stage.GetRelationshipAtPath("/Root/C.c_rel").GetTargets(), + ["/Root/Moved_A", "/Root/Moved_B"]) + self.assertEqual( + stage.GetAttributeAtPath("/Root/C.c_attr").GetConnections(), + ["/Root/Moved_A.a_attr", "/Root/Moved_B.b_attr"]) + + # Rename /Root/C to Moved_C + self.assertTrue(editor.MovePrimAtPath("/Root/C", "/Root/Moved_C")) + self.assertTrue(editor.ApplyEdits()) + + # Verify that C is now also renamed. + self.assertEqual(stage.GetPrimAtPath("/Root").GetChildrenNames(), + ["Moved_A", "Moved_B", "Moved_C"]) + # Verify that the relocates haven't changed as moving /Root/C does not + # require relocates. + self.assertEqual(rootLayer.relocates, [ + ("/Root/A", "/Root/Moved_A"), + ("/Root/B", "/Root/Moved_B")]) + + # /Root/Moved_A properties have been updated to target Moved_C because + # the opinions that target C are in the root layer and can be edited. + self.assertEqual( + stage.GetRelationshipAtPath("/Root/Moved_A.a_rel").GetTargets(), + ["/Root/Moved_B", "/Root/Moved_C"]) + self.assertEqual( + stage.GetAttributeAtPath("/Root/Moved_A.a_attr").GetConnections(), + ["/Root/Moved_B.b_attr", "/Root/Moved_C.c_attr"]) + + # /Root/Moved_B properties have NOT been updated to target Moved_C + # because these opinions are in the reference and /Root/C cannot be + # relocated as it has no opinions across the reference itself. + self.assertEqual( + stage.GetRelationshipAtPath("/Root/Moved_B.b_rel").GetTargets(), + ["/Root/Moved_A", "/Root/C"]) + self.assertEqual( + stage.GetAttributeAtPath("/Root/Moved_B.b_attr").GetConnections(), + ["/Root/Moved_A.a_attr", "/Root/C.c_attr"]) + + # Moved_C has the same targets as before the rename. + self.assertEqual( + stage.GetRelationshipAtPath("/Root/Moved_C.c_rel").GetTargets(), + ["/Root/Moved_A", "/Root/Moved_B"]) + self.assertEqual( + stage.GetAttributeAtPath("/Root/Moved_C.c_attr").GetConnections(), + ["/Root/Moved_A.a_attr", "/Root/Moved_B.b_attr"]) + + # Delete /Root/Moved_A + self.assertTrue(editor.DeletePrimAtPath("/Root/Moved_A")) + self.assertTrue(editor.ApplyEdits()) + + # Verify Moved_A is no longer a prim + self.assertEqual(stage.GetPrimAtPath("/Root").GetChildrenNames(), + ["Moved_B", "Moved_C"]) + # Verify the relocates have been updates so /Root/A now maps to empty + self.assertEqual(rootLayer.relocates, [ + ("/Root/A", Sdf.Path()), + ("/Root/B", "/Root/Moved_B")]) + + # /Root/Moved_B properties have been updated but instead of + # /Root/Moved_A being removed from its targets, it has returned to + # using the unrelocated path of /Root/A. This is because Pcp doesn't + # removed composed targets that have been relocated. + # + # XXX: This really should remove the deleted targets to /Root/A but we + # don't currently add the mapping to empty in the map function for + # /Root/A. This is because the PcpTargetIndex computation uses the + # map function to map the target path and it will produce a composition + # error if the path is not mappable. An unmappable target path that is + # due to a "relocate to delete" should not be an error, but any other + # case where it's not mappable is an error. Unfortunately, we don't have + # an easy way of distinguishing between these two cases in the target + # index so for now we have to let deleted prims map to avoid false + # errors in the presence of a relocate to delete. + self.assertEqual( + stage.GetRelationshipAtPath("/Root/Moved_B.b_rel").GetTargets(), + ["/Root/A", "/Root/C"]) + self.assertEqual( + stage.GetAttributeAtPath("/Root/Moved_B.b_attr").GetConnections(), + ["/Root/A.a_attr", "/Root/C.c_attr"]) + + # /Root/Moved_C, on the other hand, does have targets to Moved_A removed + # because the opinions are local to the root layer. + self.assertEqual( + stage.GetRelationshipAtPath("/Root/Moved_C.c_rel").GetTargets(), + ["/Root/Moved_B"]) + self.assertEqual( + stage.GetAttributeAtPath("/Root/Moved_C.c_attr").GetConnections(), + ["/Root/Moved_B.b_attr"]) + if __name__ == '__main__': unittest.main() diff --git a/pxr/usd/usd/testenv/testUsdNotices.py b/pxr/usd/usd/testenv/testUsdNotices.py index b59d603497..2e85ad0316 100644 --- a/pxr/usd/usd/testenv/testUsdNotices.py +++ b/pxr/usd/usd/testenv/testUsdNotices.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. import contextlib, os, platform, sys, unittest from pxr import Ar,Sdf,Usd,Tf diff --git a/pxr/usd/usd/testenv/testUsdOpaqueAttributes.py b/pxr/usd/usd/testenv/testUsdOpaqueAttributes.py index 9f2002628c..3c7bfe8095 100644 --- a/pxr/usd/usd/testenv/testUsdOpaqueAttributes.py +++ b/pxr/usd/usd/testenv/testUsdOpaqueAttributes.py @@ -2,25 +2,8 @@ # # Copyright 2022 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from __future__ import print_function diff --git a/pxr/usd/usd/testenv/testUsdPathExpressionAttrs.py b/pxr/usd/usd/testenv/testUsdPathExpressionAttrs.py index 8a4974ab19..afa7461b50 100644 --- a/pxr/usd/usd/testenv/testUsdPathExpressionAttrs.py +++ b/pxr/usd/usd/testenv/testUsdPathExpressionAttrs.py @@ -2,25 +2,8 @@ # # Copyright 2023 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from pxr import Usd, Vt, Sdf, Tf import unittest @@ -89,5 +72,26 @@ def test_BasicPathTranslation(self): Sdf.PathExpression( '/srcPrim/srcChild /srcPrim/refChild')) + def test_BasicPathTranslation2(self): + # Test that `//` leading exprs translate across references *and* across + # the prototype-to-instance path mapping, which uses a different + # mechanism from PcpMapFunction. + stage = Usd.Stage.CreateInMemory() + stage2 = Usd.Stage.CreateInMemory() + + src = stage.DefinePrim('/src') + dst = stage2.DefinePrim('/dst') + + dstCapi = Usd.CollectionAPI.Apply(dst, 'testRef') + dstCapi.GetMembershipExpressionAttr().Set(Sdf.PathExpression('//')) + + src.GetReferences().AddReference( + stage2.GetRootLayer().identifier, '/dst') + + srcCapi = Usd.CollectionAPI.Get(src, 'testRef') + self.assertEqual(srcCapi.GetMembershipExpressionAttr().Get(), + Sdf.PathExpression('//')) + + if __name__ == '__main__': unittest.main() diff --git a/pxr/usd/usd/testenv/testUsdPayloads.py b/pxr/usd/usd/testenv/testUsdPayloads.py index 1121bf2d71..67c9539ff3 100644 --- a/pxr/usd/usd/testenv/testUsdPayloads.py +++ b/pxr/usd/usd/testenv/testUsdPayloads.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from __future__ import print_function diff --git a/pxr/usd/usd/testenv/testUsdPrimCompositionQuery.py b/pxr/usd/usd/testenv/testUsdPrimCompositionQuery.py index f4d0e4065c..4469b43c38 100644 --- a/pxr/usd/usd/testenv/testUsdPrimCompositionQuery.py +++ b/pxr/usd/usd/testenv/testUsdPrimCompositionQuery.py @@ -2,25 +2,8 @@ # # Copyright 2019 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from __future__ import print_function import os, sys, unittest diff --git a/pxr/usd/usd/testenv/testUsdPrimFlagsPredicate.py b/pxr/usd/usd/testenv/testUsdPrimFlagsPredicate.py index 7abb8bd71a..9ef2066ccb 100644 --- a/pxr/usd/usd/testenv/testUsdPrimFlagsPredicate.py +++ b/pxr/usd/usd/testenv/testUsdPrimFlagsPredicate.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. import unittest from pxr import Usd, Tf diff --git a/pxr/usd/usd/testenv/testUsdPrimGetDescendants.cpp b/pxr/usd/usd/testenv/testUsdPrimGetDescendants.cpp index 0c44cdda9f..bb7e0adc6d 100644 --- a/pxr/usd/usd/testenv/testUsdPrimGetDescendants.cpp +++ b/pxr/usd/usd/testenv/testUsdPrimGetDescendants.cpp @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/usd/testenv/testUsdPrimRange.py b/pxr/usd/usd/testenv/testUsdPrimRange.py index 6635dd0514..24bba2010d 100644 --- a/pxr/usd/usd/testenv/testUsdPrimRange.py +++ b/pxr/usd/usd/testenv/testUsdPrimRange.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # pylint: disable=map-builtin-not-iterating diff --git a/pxr/usd/usd/testenv/testUsdPrims.py b/pxr/usd/usd/testenv/testUsdPrims.py index 4fb1415395..8916ac821e 100644 --- a/pxr/usd/usd/testenv/testUsdPrims.py +++ b/pxr/usd/usd/testenv/testUsdPrims.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from __future__ import print_function @@ -810,12 +793,14 @@ def test_DefaultPrim(self): barPrim = s.OverridePrim('/bar') assert s.GetDefaultPrim() == barPrim - # Try error cases. + # Set sub-root prims as default, should pick it up s.GetRootLayer().defaultPrim = 'foo/bar' assert not s.GetDefaultPrim() - s.OverridePrim('/foo/bar') - assert not s.GetDefaultPrim() - s.defaultPrim = '' + fooBarPrim = s.OverridePrim('/foo/bar') + assert s.GetDefaultPrim() == fooBarPrim + + # Try error cases + s.GetRootLayer().defaultPrim = '' assert not s.GetDefaultPrim() # Try stage-level authoring API. diff --git a/pxr/usd/usd/testenv/testUsdReadOutOfBounds.py b/pxr/usd/usd/testenv/testUsdReadOutOfBounds.py index 924c1a6847..c5b7df40fb 100644 --- a/pxr/usd/usd/testenv/testUsdReadOutOfBounds.py +++ b/pxr/usd/usd/testenv/testUsdReadOutOfBounds.py @@ -2,25 +2,8 @@ # # Copyright 2023 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. import os, unittest from pxr import Usd, Tf diff --git a/pxr/usd/usd/testenv/testUsdReferences.py b/pxr/usd/usd/testenv/testUsdReferences.py index 975c3eddab..1173b24cc6 100644 --- a/pxr/usd/usd/testenv/testUsdReferences.py +++ b/pxr/usd/usd/testenv/testUsdReferences.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. import sys, unittest from pxr import Sdf,Pcp,Usd,Tf diff --git a/pxr/usd/usd/testenv/testUsdRelationships.py b/pxr/usd/usd/testenv/testUsdRelationships.py index 2fa5765489..c57eff6f49 100644 --- a/pxr/usd/usd/testenv/testUsdRelationships.py +++ b/pxr/usd/usd/testenv/testUsdRelationships.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. import sys, unittest from pxr import Sdf, Tf, Usd diff --git a/pxr/usd/usd/testenv/testUsdResolveTarget.cpp b/pxr/usd/usd/testenv/testUsdResolveTarget.cpp index ab0654b852..aeae8cccfa 100644 --- a/pxr/usd/usd/testenv/testUsdResolveTarget.cpp +++ b/pxr/usd/usd/testenv/testUsdResolveTarget.cpp @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/usd/testenv/testUsdResolveTargetPy.py b/pxr/usd/usd/testenv/testUsdResolveTargetPy.py index 11eaa13e25..0a595967c7 100644 --- a/pxr/usd/usd/testenv/testUsdResolveTargetPy.py +++ b/pxr/usd/usd/testenv/testUsdResolveTargetPy.py @@ -2,25 +2,8 @@ # # Copyright 2022 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. import unittest from pxr import Sdf, Usd diff --git a/pxr/usd/usd/testenv/testUsdResolverChanged.cpp b/pxr/usd/usd/testenv/testUsdResolverChanged.cpp index 8af871d701..f7ae66bd49 100644 --- a/pxr/usd/usd/testenv/testUsdResolverChanged.cpp +++ b/pxr/usd/usd/testenv/testUsdResolverChanged.cpp @@ -1,25 +1,8 @@ // // Copyright 2021 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/usd/testenv/testUsdSchemaBase.cpp b/pxr/usd/usd/testenv/testUsdSchemaBase.cpp index 3186890366..d26c52c911 100644 --- a/pxr/usd/usd/testenv/testUsdSchemaBase.cpp +++ b/pxr/usd/usd/testenv/testUsdSchemaBase.cpp @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/usd/testenv/testUsdSchemaBasePy.py b/pxr/usd/usd/testenv/testUsdSchemaBasePy.py index 15aa3f60f2..560b2a6272 100644 --- a/pxr/usd/usd/testenv/testUsdSchemaBasePy.py +++ b/pxr/usd/usd/testenv/testUsdSchemaBasePy.py @@ -2,25 +2,8 @@ # # Copyright 2019 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from pxr import Gf, Tf, Sdf, Usd, Vt import unittest, math diff --git a/pxr/usd/usd/testenv/testUsdSchemaRegistry.py b/pxr/usd/usd/testenv/testUsdSchemaRegistry.py index e3b48f7a46..34974aecda 100644 --- a/pxr/usd/usd/testenv/testUsdSchemaRegistry.py +++ b/pxr/usd/usd/testenv/testUsdSchemaRegistry.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. import os, unittest from pxr import Plug, Usd, Sdf, Vt, Tf @@ -59,7 +42,7 @@ def test_PrimMetadata(self): "testDictionaryMetadata", "value"), 2) self.assertEqual(primDef.GetDocumentation(), - "Testing documentation metadata") + "Testing brief user doc for schema class") def test_AttributeMetadata(self): primDef = Usd.SchemaRegistry().FindConcretePrimDefinition( @@ -114,9 +97,9 @@ def test_AttributeMetadata(self): self.assertEqual(attrDef.GetMetadata("documentation"), "Testing documentation metadata") self.assertEqual(attrDef.GetDocumentation(), - "Testing documentation metadata") + "Testing brief user doc for schema attr") self.assertEqual(primDef.GetPropertyDocumentation("testAttr"), - "Testing documentation metadata") + "Testing brief user doc for schema attr") # Dictionary metadata can be gotten by whole value as well as queried # for individual keys in the metadata value. @@ -193,9 +176,9 @@ def test_RelationshipMetadata(self): self.assertEqual(relDef.GetMetadata("documentation"), "Testing documentation metadata") self.assertEqual(relDef.GetDocumentation(), - "Testing documentation metadata") - self.assertEqual(primDef.GetPropertyDocumentation("testAttr"), - "Testing documentation metadata") + "Testing brief user doc for schema rel") + self.assertEqual(primDef.GetPropertyDocumentation("testRel"), + "Testing brief user doc for schema rel") # Dictionary metadata can be gotten by whole value as well as queried # for individual keys in the metadata value. @@ -597,7 +580,9 @@ def _VerifyExpectedPrimData(layer, path, expectedPrimFields, "hidden" : True, "testCustomMetadata" : "garply", "testDictionaryMetadata" : {"name" : "bar", "value" : 3}, - "variability" : Sdf.VariabilityVarying + "variability" : Sdf.VariabilityVarying, + "customData" : + {"userDocBrief" : "Testing brief user doc for schema attr"} }, "testRel" : { "custom" : False, @@ -607,7 +592,9 @@ def _VerifyExpectedPrimData(layer, path, expectedPrimFields, "hidden" : True, "testCustomMetadata" : "garply", "testDictionaryMetadata" : {"name" : "baz", "value" : 5}, - "variability" : Sdf.VariabilityUniform + "variability" : Sdf.VariabilityUniform, + "customData" : + {"userDocBrief" : "Testing brief user doc for schema rel"} } } diff --git a/pxr/usd/usd/testenv/testUsdSchemaRegistry/resources/generatedSchema.usda b/pxr/usd/usd/testenv/testUsdSchemaRegistry/resources/generatedSchema.usda index ef51f19f7a..48c57fc35f 100644 --- a/pxr/usd/usd/testenv/testUsdSchemaRegistry/resources/generatedSchema.usda +++ b/pxr/usd/usd/testenv/testUsdSchemaRegistry/resources/generatedSchema.usda @@ -10,6 +10,9 @@ class "AbstractTest" ( { string testAttr = "foo" ( allowedTokens = ["bar", "baz"] + customData = { + string userDocBrief = "Testing brief user doc for schema attr" + } displayGroup = "Display Group" displayName = "Display Name" doc = "Testing documentation metadata" @@ -23,6 +26,9 @@ class "AbstractTest" ( } class MetadataTest "MetadataTest" ( + customData = { + string userDocBrief = "Testing brief user doc for schema class" + } doc = "Testing documentation metadata" hidden = true testCustomMetadata = "garply" @@ -34,6 +40,9 @@ class MetadataTest "MetadataTest" ( { string testAttr = "foo" ( allowedTokens = ["bar", "baz"] + customData = { + string userDocBrief = "Testing brief user doc for schema attr" + } displayGroup = "Display Group" displayName = "Display Name" doc = "Testing documentation metadata" @@ -45,6 +54,9 @@ class MetadataTest "MetadataTest" ( } ) rel testRel ( + customData = { + string userDocBrief = "Testing brief user doc for schema rel" + } displayGroup = "Display Group" displayName = "Display Name" doc = "Testing documentation metadata" diff --git a/pxr/usd/usd/testenv/testUsdSchemaRegistry/resources/schema.usda b/pxr/usd/usd/testenv/testUsdSchemaRegistry/resources/schema.usda index e777270c63..8626921ed6 100644 --- a/pxr/usd/usd/testenv/testUsdSchemaRegistry/resources/schema.usda +++ b/pxr/usd/usd/testenv/testUsdSchemaRegistry/resources/schema.usda @@ -34,6 +34,9 @@ class "AbstractTest" ( string name = "bar" int value = 3 } + customData = { + string userDocBrief = """Testing brief user doc for schema attr""" + } ) } @@ -46,6 +49,9 @@ class MetadataTest "MetadataTest" ( string name = "foo" int value = 2 } + customData = { + string userDocBrief = """Testing brief user doc for schema class""" + } ) { rel testRel ( @@ -57,6 +63,9 @@ class MetadataTest "MetadataTest" ( testDictionaryMetadata = { string name = "baz" int value = 5 - } + } + customData = { + string userDocBrief = """Testing brief user doc for schema rel""" + } ) } diff --git a/pxr/usd/usd/testenv/testUsdSchemaRegistryCpp.cpp b/pxr/usd/usd/testenv/testUsdSchemaRegistryCpp.cpp index d83f789736..d6b4867b5a 100644 --- a/pxr/usd/usd/testenv/testUsdSchemaRegistryCpp.cpp +++ b/pxr/usd/usd/testenv/testUsdSchemaRegistryCpp.cpp @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/usd/testenv/testUsdSchemaRegistryThreadedInit.py b/pxr/usd/usd/testenv/testUsdSchemaRegistryThreadedInit.py new file mode 100644 index 0000000000..e02f31104e --- /dev/null +++ b/pxr/usd/usd/testenv/testUsdSchemaRegistryThreadedInit.py @@ -0,0 +1,24 @@ +#!/pxrpythonsubst +# +# Copyright 2024 Pixar +# +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. + +import unittest, threading + +from pxr import Usd + +class TestUsdSchemaRegistryThreadedInit(unittest.TestCase): + def test_ThreadedInit(self): + threads = [] + for i in range(2): + thread = threading.Thread(target=lambda: Usd.SchemaRegistry()) + thread.start() + threads.append(thread) + + for thread in threads: + thread.join() + +if __name__ == "__main__": + unittest.main() diff --git a/pxr/usd/usd/testenv/testUsdSchemaVersioning.py b/pxr/usd/usd/testenv/testUsdSchemaVersioning.py index d05e34359f..c9d2b7dbf1 100644 --- a/pxr/usd/usd/testenv/testUsdSchemaVersioning.py +++ b/pxr/usd/usd/testenv/testUsdSchemaVersioning.py @@ -2,25 +2,8 @@ # # Copyright 2022 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. import os, unittest from pxr import Plug, Usd, Tf diff --git a/pxr/usd/usd/testenv/testUsdSpecializes.py b/pxr/usd/usd/testenv/testUsdSpecializes.py index 256860a8fe..b5d58e803a 100644 --- a/pxr/usd/usd/testenv/testUsdSpecializes.py +++ b/pxr/usd/usd/testenv/testUsdSpecializes.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. import unittest from pxr import Usd, Pcp, Sdf, Tf diff --git a/pxr/usd/usd/testenv/testUsdStage.py b/pxr/usd/usd/testenv/testUsdStage.py index d4e1f11761..3fa99ae6db 100644 --- a/pxr/usd/usd/testenv/testUsdStage.py +++ b/pxr/usd/usd/testenv/testUsdStage.py @@ -3,25 +3,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. import sys, unittest from pxr import Sdf,Usd,Tf @@ -446,6 +429,70 @@ def test_BadGetPrimAtPath(self): # Should get an invalid prim if passed an empty path assert(not s.GetPrimAtPath(Sdf.Path.emptyPath)) + def test_StageCompositionErrors(self): + layer = Sdf.Layer.CreateAnonymous('.usda') + layer.ImportFromString(''' + #usda 1.0 + ( + subLayers = [ + @missingLayer.usda@ + ] + ) + + def "World" + { + def "Inst1" ( + instanceable = true + prepend references = + ) + { + } + def "Inst2" ( + instanceable = true + prepend references = + ) + { + } + } + + def "Main" ( + ) + { + def "First" ( + add references = + ) + { + } + + def "Second" ( + add references = + ) + { + } + }'''.strip()) + s = Usd.Stage.Open(layer.identifier) + errors = s.GetCompositionErrors() + # Make sure composition errors are always in a specific order, to test + # the error types below + errors = sorted(errors, key=lambda error: error.rootSite.path) + self.assertEqual(len(errors), 5) + + # Find out whats the source path for the instances, for which errors + # will be reported. + srcPrimPath = s.GetPrototypes()[0]._GetSourcePrimIndex().rootNode.path + + from pxr import Pcp + expectedErrors = [ (Pcp.ErrorType_InvalidSublayerPath, "/"), + (Pcp.ErrorType_ArcCycle, "/Main/First"), + (Pcp.ErrorType_ArcCycle, "/Main/Second"), + (Pcp.ErrorType_ArcCycle, + srcPrimPath.AppendChild("First").pathString), + (Pcp.ErrorType_ArcCycle, + srcPrimPath.AppendChild("Second").pathString) ] + for i in range(5): + self.assertEqual(expectedErrors[i][0], errors[i].errorType) + self.assertEqual(expectedErrors[i][1], errors[i].rootSite.path) + def test_GetAtPath(self): for fmt in allFormats: s = Usd.Stage.CreateInMemory('GetAtPath.'+fmt) diff --git a/pxr/usd/usd/testenv/testUsdStageCache.py b/pxr/usd/usd/testenv/testUsdStageCache.py index 57e5436b30..9d7263b515 100644 --- a/pxr/usd/usd/testenv/testUsdStageCache.py +++ b/pxr/usd/usd/testenv/testUsdStageCache.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. import sys, unittest from pxr import Sdf,Usd,Tf,Ar diff --git a/pxr/usd/usd/testenv/testUsdStageDefaultResolver.py b/pxr/usd/usd/testenv/testUsdStageDefaultResolver.py index 4aacaff62a..006c89f9de 100644 --- a/pxr/usd/usd/testenv/testUsdStageDefaultResolver.py +++ b/pxr/usd/usd/testenv/testUsdStageDefaultResolver.py @@ -2,25 +2,8 @@ # # Copyright 2024 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. import unittest diff --git a/pxr/usd/usd/testenv/testUsdStageLoadUnload.py b/pxr/usd/usd/testenv/testUsdStageLoadUnload.py index cfab32d7b8..a9478fef61 100644 --- a/pxr/usd/usd/testenv/testUsdStageLoadUnload.py +++ b/pxr/usd/usd/testenv/testUsdStageLoadUnload.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from __future__ import print_function diff --git a/pxr/usd/usd/testenv/testUsdStageNoPython.cpp b/pxr/usd/usd/testenv/testUsdStageNoPython.cpp index 9ac807fabc..de381cf3ae 100644 --- a/pxr/usd/usd/testenv/testUsdStageNoPython.cpp +++ b/pxr/usd/usd/testenv/testUsdStageNoPython.cpp @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // diff --git a/pxr/usd/usd/testenv/testUsdStageNotification.cpp b/pxr/usd/usd/testenv/testUsdStageNotification.cpp index 1e23eceb77..4f450ceffe 100644 --- a/pxr/usd/usd/testenv/testUsdStageNotification.cpp +++ b/pxr/usd/usd/testenv/testUsdStageNotification.cpp @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/usd/testenv/testUsdStagePopulationMasks.py b/pxr/usd/usd/testenv/testUsdStagePopulationMasks.py index ffc68cbd08..ae908b5bf9 100644 --- a/pxr/usd/usd/testenv/testUsdStagePopulationMasks.py +++ b/pxr/usd/usd/testenv/testUsdStagePopulationMasks.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. import unittest from pxr import Usd, Sdf, Tf diff --git a/pxr/usd/usd/testenv/testUsdStageThreading.cpp b/pxr/usd/usd/testenv/testUsdStageThreading.cpp index b4dabedafa..362c742812 100644 --- a/pxr/usd/usd/testenv/testUsdStageThreading.cpp +++ b/pxr/usd/usd/testenv/testUsdStageThreading.cpp @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifdef PXR_PYTHON_SUPPORT_ENABLED diff --git a/pxr/usd/usd/testenv/testUsdTemplatedIO.cpp b/pxr/usd/usd/testenv/testUsdTemplatedIO.cpp index 36627b15ce..1c276573b2 100644 --- a/pxr/usd/usd/testenv/testUsdTemplatedIO.cpp +++ b/pxr/usd/usd/testenv/testUsdTemplatedIO.cpp @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/usd/testenv/testUsdThreadedAuthoring.cpp b/pxr/usd/usd/testenv/testUsdThreadedAuthoring.cpp index be233a0d3e..6f1a1fbad2 100644 --- a/pxr/usd/usd/testenv/testUsdThreadedAuthoring.cpp +++ b/pxr/usd/usd/testenv/testUsdThreadedAuthoring.cpp @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/usd/testenv/testUsdTimeCodeRepr.py b/pxr/usd/usd/testenv/testUsdTimeCodeRepr.py index a0387e87e4..9b7945dd98 100644 --- a/pxr/usd/usd/testenv/testUsdTimeCodeRepr.py +++ b/pxr/usd/usd/testenv/testUsdTimeCodeRepr.py @@ -2,25 +2,8 @@ # # Copyright 2019 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from pxr import Usd,Sdf diff --git a/pxr/usd/usd/testenv/testUsdTimeCodeStream.cpp b/pxr/usd/usd/testenv/testUsdTimeCodeStream.cpp index 8710037f02..1c2597070c 100644 --- a/pxr/usd/usd/testenv/testUsdTimeCodeStream.cpp +++ b/pxr/usd/usd/testenv/testUsdTimeCodeStream.cpp @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/usd/testenv/testUsdTimeOffsets.py b/pxr/usd/usd/testenv/testUsdTimeOffsets.py index 34cd4e2eb6..711f6a14be 100644 --- a/pxr/usd/usd/testenv/testUsdTimeOffsets.py +++ b/pxr/usd/usd/testenv/testUsdTimeOffsets.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from __future__ import print_function from __future__ import division diff --git a/pxr/usd/usd/testenv/testUsdTimeSamples.py b/pxr/usd/usd/testenv/testUsdTimeSamples.py index 59c994a073..4ad1b75fa9 100644 --- a/pxr/usd/usd/testenv/testUsdTimeSamples.py +++ b/pxr/usd/usd/testenv/testUsdTimeSamples.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from __future__ import print_function diff --git a/pxr/usd/usd/testenv/testUsdTimeValueAuthoring.cpp b/pxr/usd/usd/testenv/testUsdTimeValueAuthoring.cpp index 4bcc2c69d4..49bf01a5ae 100644 --- a/pxr/usd/usd/testenv/testUsdTimeValueAuthoring.cpp +++ b/pxr/usd/usd/testenv/testUsdTimeValueAuthoring.cpp @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/usd/testenv/testUsdTimeValueAuthoring.py b/pxr/usd/usd/testenv/testUsdTimeValueAuthoring.py index 9a1ff434af..87aca46bc9 100644 --- a/pxr/usd/usd/testenv/testUsdTimeValueAuthoring.py +++ b/pxr/usd/usd/testenv/testUsdTimeValueAuthoring.py @@ -2,25 +2,8 @@ # # Copyright 2019 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. import sys, os, unittest from pxr import Sdf, Usd, Tf, Plug diff --git a/pxr/usd/usd/testenv/testUsdUsdzFileFormat.py b/pxr/usd/usd/testenv/testUsdUsdzFileFormat.py index 5d7cdc2d4b..1f6b44700d 100644 --- a/pxr/usd/usd/testenv/testUsdUsdzFileFormat.py +++ b/pxr/usd/usd/testenv/testUsdUsdzFileFormat.py @@ -2,25 +2,8 @@ # # Copyright 2018 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. import unittest diff --git a/pxr/usd/usd/testenv/testUsdUsdzResolver.cpp b/pxr/usd/usd/testenv/testUsdUsdzResolver.cpp index aa9db7649a..de7a09e1e8 100644 --- a/pxr/usd/usd/testenv/testUsdUsdzResolver.cpp +++ b/pxr/usd/usd/testenv/testUsdUsdzResolver.cpp @@ -1,25 +1,8 @@ // // Copyright 2018 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/usd/testenv/testUsdValidationRegistry.cpp b/pxr/usd/usd/testenv/testUsdValidationRegistry.cpp new file mode 100644 index 0000000000..fd7db260c2 --- /dev/null +++ b/pxr/usd/usd/testenv/testUsdValidationRegistry.cpp @@ -0,0 +1,325 @@ +// +// Copyright 2024 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// + +#include "pxr/pxr.h" +#include "pxr/usd/usd/validationRegistry.h" +#include "pxr/usd/usd/validationError.h" +#include "pxr/usd/usd/validatorTokens.h" +#include "pxr/usd/usd/validator.h" +#include "pxr/base/arch/systemInfo.h" +#include "pxr/base/plug/registry.h" +#include "pxr/base/tf/errorMark.h" +#include "pxr/base/tf/registryManager.h" +#include "pxr/base/tf/token.h" + +PXR_NAMESPACE_USING_DIRECTIVE + +TF_REGISTRY_FUNCTION(UsdValidationRegistry) +{ + UsdValidationRegistry& registry = UsdValidationRegistry::GetInstance(); + + { + const TfToken validatorName("testValidationPlugin:TestValidator1"); + const UsdValidateStageTaskFn stageTaskFn = []( + const UsdStagePtr & usdStage) + { + return UsdValidationErrorVector{ + UsdValidationError(UsdValidationErrorType::Error, + {UsdValidationErrorSite(usdStage, + SdfPath("/"))}, + "This is an error on the stage")}; + }; + + // Register the validator + TfErrorMark m; + registry.RegisterPluginValidator(validatorName, stageTaskFn); + TF_AXIOM(m.IsClean()); + } + { + const TfToken validatorName("testValidationPlugin:TestValidator2"); + const UsdValidatePrimTaskFn primTaskFn = [](const UsdPrim & /*prim*/) + { + return UsdValidationErrorVector{}; + }; + + // Register the validator + TfErrorMark m; + registry.RegisterPluginValidator(validatorName, primTaskFn); + TF_AXIOM(m.IsClean()); + } + { + const TfToken validatorName("testValidationPlugin:TestValidator3"); + const UsdValidatePrimTaskFn primTaskFn = [](const UsdPrim & /*prim*/) + { + return UsdValidationErrorVector{}; + }; + + // Register the validator + TfErrorMark m; + registry.RegisterPluginValidator(validatorName, primTaskFn); + TF_AXIOM(m.IsClean()); + } + { + const TfToken suiteName("testValidationPlugin:TestValidatorSuite"); + const std::vector containedValidators = + registry.GetOrLoadValidatorsByName( + {TfToken("testValidationPlugin:TestValidator1"), + TfToken("testValidationPlugin:TestValidator2")}); + TfErrorMark m; + registry.RegisterPluginValidatorSuite(suiteName, containedValidators); + TF_AXIOM(m.IsClean()); + } + { + const TfToken validatorName("testValidationPlugin:FailedValidator"); + const UsdValidateStageTaskFn stageTaskFn = []( + const UsdStagePtr & /*stage*/) + { + return UsdValidationErrorVector{}; + }; + + // Register the validator + TfErrorMark m; + registry.RegisterPluginValidator(validatorName, stageTaskFn); + TF_AXIOM(!m.IsClean()); + } + { + const TfToken suiteName("testValidationPlugin:FailedValidatorSuite"); + const std::vector containedValidators = + registry.GetOrLoadValidatorsByName( + {TfToken("testValidationPlugin:TestValidator2"), + TfToken("testValidationPlugin:TestValidator1")}); + TfErrorMark m; + registry.RegisterPluginValidatorSuite(suiteName, containedValidators); + TF_AXIOM(!m.IsClean()); + } + { + const TfToken suiteName("testValidationPlugin:FailedValidatorSuite2"); + const std::vector containedValidators = + registry.GetOrLoadValidatorsByName( + {TfToken("testValidationPlugin:TestValidator2")}); + TfErrorMark m; + registry.RegisterPluginValidatorSuite(suiteName, containedValidators); + TF_AXIOM(!m.IsClean()); + } +} + +void TestUsdValidationRegistry() +{ + UsdValidationRegistry ®istry = UsdValidationRegistry::GetInstance(); + + { + UsdValidatorMetadata metadata; + + TF_AXIOM(registry.GetValidatorMetadata( + TfToken("testValidationPlugin:TestValidator1"), &metadata)); + const TfTokenVector expectedKeywords = { + TfToken("IncludedInAll"), + TfToken("SomeKeyword1") }; + TF_AXIOM(metadata.keywords == expectedKeywords); + const std::string expectedDoc = "TestValidator1 for keywords metadata " + "parsing"; + TF_AXIOM(metadata.doc == expectedDoc); + TF_AXIOM(!metadata.isSuite); + + // Actually go and call validate on this and inspect the Error. + const UsdValidator* const validator = + registry.GetOrLoadValidatorByName(metadata.name); + TF_AXIOM(validator); + UsdStageRefPtr usdStage = UsdStage::CreateInMemory(); + const UsdValidationErrorVector errors = validator->Validate(usdStage); + TF_AXIOM(errors.size() == 1); + TF_AXIOM(!errors[0].HasNoError()); + TF_AXIOM(errors[0].GetType() == UsdValidationErrorType::Error); + TF_AXIOM(errors[0].GetValidator() == validator); + const UsdValidationErrorSites &errorSites = errors[0].GetSites(); + TF_AXIOM(errorSites.size() == 1); + TF_AXIOM(!errorSites[0].IsValidSpecInLayer()); + TF_AXIOM(errorSites[0].IsPrim()); + TF_AXIOM(!errorSites[0].IsProperty()); + + // TestValidator1 has a StageTaskFn, try giving it a layer or a prim, it + // must return a no error. + TF_AXIOM(validator->Validate(usdStage->GetPseudoRoot()).empty()); + TF_AXIOM(validator->Validate(usdStage->GetRootLayer()).empty()); + } + { + UsdValidatorMetadataVector metadata = + registry.GetValidatorMetadataForSchemaType( + TfToken("SomePrimType")); + TF_AXIOM(metadata.size() == 4); + TfTokenVector expectedValue({ + TfToken("testValidationPlugin:FailedValidator"), + TfToken("testValidationPlugin:FailedValidatorSuite"), + TfToken("testValidationPlugin:TestValidator2"), + TfToken("testValidationPlugin:TestValidator3") + }); + TF_AXIOM(TfTokenVector({metadata[0].name, metadata[1].name, + metadata[2].name, metadata[3].name}) == expectedValue); + } + { + UsdValidatorMetadataVector metadata = + registry.GetValidatorMetadataForKeyword( + TfToken("SomeKeyword1")); + TF_AXIOM(metadata.size() == 2); + TfTokenVector expectedValue({ + TfToken("testValidationPlugin:TestValidator1"), + TfToken("testValidationPlugin:TestValidator3") + }); + TF_AXIOM(TfTokenVector({metadata[0].name, metadata[1].name}) == + expectedValue); + TF_AXIOM(!metadata[0].isSuite); + TF_AXIOM(!metadata[1].isSuite); + } + { + const UsdValidatorSuite* suiteValidator = + registry.GetOrLoadValidatorSuiteByName( + TfToken("testValidationPlugin:TestValidatorSuite")); + const UsdValidatorMetadata &metadata = suiteValidator->GetMetadata(); + TF_AXIOM(metadata.name == TfToken( + "testValidationPlugin:TestValidatorSuite")); + TF_AXIOM(metadata.isSuite); + TF_AXIOM(metadata.doc == "Suite of TestValidator1 and TestValidator2"); + TF_AXIOM(metadata.keywords.size() == 2); + TF_AXIOM(metadata.keywords == TfTokenVector({ + TfToken("IncludedInAll"), TfToken("SuiteValidator")})); + const std::vector containedValidators = + suiteValidator->GetContainedValidators(); + { + const UsdValidatorMetadata &vm = + containedValidators[0]->GetMetadata(); + TF_AXIOM(vm.name == TfToken("testValidationPlugin:TestValidator1")); + TF_AXIOM(vm.keywords.size() == 2); + TF_AXIOM(vm.keywords == TfTokenVector({ + TfToken("IncludedInAll"), TfToken("SomeKeyword1")})); + TF_AXIOM(vm.schemaTypes.empty()); + } + { + const UsdValidatorMetadata &vm = + containedValidators[1]->GetMetadata(); + TF_AXIOM(vm.name == TfToken("testValidationPlugin:TestValidator2")); + TF_AXIOM(vm.keywords.size() == 1); + TF_AXIOM(vm.keywords[0] == TfToken("IncludedInAll")); + TF_AXIOM(vm.schemaTypes.size() == 2); + TF_AXIOM(vm.schemaTypes == TfTokenVector({ + TfToken("SomePrimType"), TfToken("SomeAPISchema")})); + } + } + { + // Try to retrieve a failed validator (stageTask for validator which + // provides schemaTypes + const UsdValidator* validator = registry.GetOrLoadValidatorByName( + TfToken("testValidationPlugin:FailedValidator")); + TF_AXIOM(!validator); + } + { + // Try to retrieve a failed validator suite (stageTask for a contained + // validator but suite provides schemaTypes + const UsdValidatorSuite* suite = registry.GetOrLoadValidatorSuiteByName( + TfToken("testValidationPlugin:FailedValidatorSuite")); + TF_AXIOM(!suite); + } + { + // The following test keeps track of all the available validators within + // UsdCoreValidators keyword, hence as new validators are added under + // this keyword this unit test will have to be updated. + const UsdValidatorMetadataVector coreValidatorMetadata = + registry.GetValidatorMetadataForKeyword( + UsdValidatorKeywordTokens->UsdCoreValidators); + TF_AXIOM(coreValidatorMetadata.size() == 1); + const std::vector expectedValidatorNames = + {UsdValidatorNameTokens->compositionErrorTest}; + + for (size_t index = 0; index < coreValidatorMetadata.size(); ++index) { + TF_AXIOM(coreValidatorMetadata[index].name == + expectedValidatorNames[index]); + } + } + { + // test to make sure CompositionErrorTest validator provided in the core + // usd plugin works correctly by reporting all the composition errors, + // error sites and appropriate messages pertaining to these errors. + const UsdValidator* const compositionErrorValidator = + registry.GetOrLoadValidatorByName( + UsdValidatorNameTokens->compositionErrorTest); + TF_AXIOM(compositionErrorValidator); + + static const std::string layerContents = + R"usda(#usda 1.0 + ( + subLayers = [ + @missingLayer.usda@ + ] + ) + def "World" + { + def "Inst1" ( + instanceable = true + prepend references = + ) + { + } + def "Inst2" ( + instanceable = true + prepend references = + ) + { + } + } + def "Main" + { + def "First" ( + add references = + ) + { + } + def "Second" ( + add references = + ) + { + } + } + )usda"; + SdfLayerRefPtr layer = SdfLayer::CreateAnonymous(".usda"); + layer->ImportFromString(layerContents); + UsdStageRefPtr usdStage = UsdStage::Open(layer); + + // Get expected list of composition errors from the stage. + const PcpErrorVector expectedPcpErrors = + usdStage->GetCompositionErrors(); + TF_AXIOM(expectedPcpErrors.size() == 5); + + // Get wrapped validation errors from our compositionErrorValidator + UsdValidationErrorVector errors = + compositionErrorValidator->Validate(usdStage); + TF_AXIOM(errors.size() == 5); + + // Lets make sure pcpErrors and validationErrors match + for (size_t index = 0; index < errors.size(); ++index) { + TF_AXIOM(errors[index].GetValidator() == compositionErrorValidator); + TF_AXIOM(errors[index].GetMessage() == + expectedPcpErrors[index]->ToString()); + TF_AXIOM(errors[index].GetSites().size() == 1); + TF_AXIOM(errors[index].GetSites().size() == 1); + TF_AXIOM(errors[index].GetSites()[0].IsValid()); + TF_AXIOM(errors[index].GetSites()[0].IsPrim()); + TF_AXIOM(errors[index].GetSites()[0].GetPrim().GetPath() == + expectedPcpErrors[index]->rootSite.path); + } + } +} + +int +main() +{ + // Register the test plugin + const std::string testDir = ArchGetCwd(); + TF_AXIOM(!PlugRegistry::GetInstance().RegisterPlugins(testDir).empty()); + + TestUsdValidationRegistry(); + + printf("OK\n"); +} diff --git a/pxr/usd/usd/testenv/testUsdValidationRegistry/plugInfo.json b/pxr/usd/usd/testenv/testUsdValidationRegistry/plugInfo.json new file mode 100644 index 0000000000..e5b343bc12 --- /dev/null +++ b/pxr/usd/usd/testenv/testUsdValidationRegistry/plugInfo.json @@ -0,0 +1,45 @@ +{ + "Plugins": [ + { + "Type": "resource", + "Name": "testValidationPlugin", + "Info": { + "Validators": { + "keywords": ["IncludedInAll"], + "FailedValidator": { + "doc": "Won't get registered, as schemaType provided, but primTask not provided", + "schemaTypes": ["SomePrimType"] + }, + "FailedValidatorSuite": { + "doc": "Won't get registered, as contained validators will not comply", + "schemaTypes": ["SomePrimType", "SomeAPISchema"] + }, + "FailedValidatorSuite2": { + "doc": "Won't get registered, as contained validators will not comply", + "schemaTypes": ["SomeOtherPrimType"] + }, + "TestValidator1": { + "doc": "TestValidator1 for keywords metadata parsing", + "keywords": ["SomeKeyword1"], + "isSuite": false + }, + "TestValidator2": { + "doc": "TestValidator2 for schemaType metadata parsing", + "schemaTypes": ["SomePrimType", "SomeAPISchema"], + "someBogusMetadta": "Doesn't get parsed" + }, + "TestValidator3": { + "doc": "TestValidator3 for schemaType metadata parsing", + "schemaTypes": ["SomePrimType"], + "keywords": ["SomeKeyword1"] + }, + "TestValidatorSuite": { + "doc": "Suite of TestValidator1 and TestValidator2", + "keywords": ["SuiteValidator"], + "isSuite": true + } + } + } + } + ] +} diff --git a/pxr/usd/usd/testenv/testUsdValidator.cpp b/pxr/usd/usd/testenv/testUsdValidator.cpp new file mode 100644 index 0000000000..030dc81bc2 --- /dev/null +++ b/pxr/usd/usd/testenv/testUsdValidator.cpp @@ -0,0 +1,140 @@ +// +// Copyright 2024 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// + +#include "pxr/pxr.h" +#include "pxr/usd/sdf/layer.h" +#include "pxr/usd/usd/validator.h" +#include "pxr/usd/usd/validationError.h" + +#include + +PXR_NAMESPACE_USING_DIRECTIVE + +static +void TestSimpleValidator() +{ + // Note that these are just to test the validator -> taskFn -> Error + // pipeline, validators should ideally be registered with the + // UsdValidationRegistry. + // + // Simple LayerValidator + UsdValidateLayerTaskFn validateLayerTaskFn = + [](const SdfLayerHandle& layer) { + return UsdValidationErrorVector{UsdValidationError()}; + }; + UsdValidatorMetadata metadata; + metadata.name = TfToken("TestSimpleLayerValidator"); + metadata.doc = "This is a test."; + metadata.isSuite = false; + UsdValidator layerValidator = UsdValidator(metadata, validateLayerTaskFn); + SdfLayerRefPtr testLayer = SdfLayer::CreateAnonymous(); + { + UsdValidationErrorVector errors = layerValidator.Validate(testLayer); + TF_AXIOM(errors.size() == 1); + TF_AXIOM(errors[0].HasNoError()); + TF_AXIOM(errors[0].GetSites().empty()); + TF_AXIOM(errors[0].GetValidator() == &layerValidator); + } + // Use the LayerValidator to validate a prim!! + // Note that this validator has no UsdValidatePrimTaskFn! + UsdStageRefPtr usdStage2 = UsdStage::CreateInMemory(); + const UsdPrim prim = usdStage2->GetPseudoRoot(); + { + TF_AXIOM(layerValidator.Validate(prim).empty()); + } + + // Simple StageValidator + UsdValidateStageTaskFn validateStageTaskFn = + [](const UsdStageRefPtr &usdStage) { + return UsdValidationErrorVector{ + UsdValidationError(UsdValidationErrorType::Error, + {UsdValidationErrorSite(usdStage, + SdfPath("/"))}, + "This is an error on the stage")}; + }; + metadata.name = TfToken("TestSimpleStageValidator"); + UsdValidator stageValidator = UsdValidator(metadata, validateStageTaskFn); + UsdStageRefPtr usdStage = UsdStage::CreateInMemory(); + { + UsdValidationErrorVector errors = stageValidator.Validate(usdStage); + TF_AXIOM(errors.size() == 1); + TF_AXIOM(!errors[0].HasNoError()); + TF_AXIOM(errors[0].GetType() == UsdValidationErrorType::Error); + TF_AXIOM(errors[0].GetValidator() == &stageValidator); + const UsdValidationErrorSites &errorSites = errors[0].GetSites(); + TF_AXIOM(errorSites.size() == 1); + TF_AXIOM(!errorSites[0].IsValidSpecInLayer()); + TF_AXIOM(errorSites[0].IsPrim()); + TF_AXIOM(!errorSites[0].IsProperty()); + } + // Use the StageValidator to validate a layer + // Note that this validator has no UsdValidateLayerTaskFn + { + TF_AXIOM(stageValidator.Validate(testLayer).empty()); + } + // Create a stage using the layer and validate the stage now! + UsdStageRefPtr usdStageFromLayer = UsdStage::Open(testLayer); + { + UsdValidationErrorVector errors = + stageValidator.Validate(usdStageFromLayer); + TF_AXIOM(errors.size() == 1); + TF_AXIOM(!errors[0].HasNoError()); + TF_AXIOM(errors[0].GetType() == UsdValidationErrorType::Error); + TF_AXIOM(errors[0].GetValidator() == &stageValidator); + const UsdValidationErrorSites &errorSites = errors[0].GetSites(); + TF_AXIOM(errorSites.size() == 1); + TF_AXIOM(!errorSites[0].IsValidSpecInLayer()); + TF_AXIOM(errorSites[0].IsPrim()); + TF_AXIOM(!errorSites[0].IsProperty()); + } + + // Simple SchemaTypeValidator + UsdValidatePrimTaskFn validatePrimTaskFn = [](const UsdPrim &usdPrim) { + return UsdValidationErrorVector{ + UsdValidationError(UsdValidationErrorType::Error, + {UsdValidationErrorSite(usdPrim.GetStage(), + usdPrim.GetPath())}, + "This is an error on the stage")}; + }; + metadata.name = TfToken("TestSimplePrimValidator"); + metadata.schemaTypes = {TfToken("MadeUpPrimType")}; + UsdValidator schemaTypeValidator = UsdValidator(metadata, + validatePrimTaskFn); + { + UsdValidationErrorVector errors = schemaTypeValidator.Validate(prim); + TF_AXIOM(errors.size() == 1); + TF_AXIOM(!errors[0].HasNoError()); + TF_AXIOM(errors[0].GetType() == UsdValidationErrorType::Error); + TF_AXIOM(errors[0].GetValidator() == &schemaTypeValidator); + const UsdValidationErrorSites &errorSites = errors[0].GetSites(); + TF_AXIOM(errorSites.size() == 1); + TF_AXIOM(!errorSites[0].IsValidSpecInLayer()); + TF_AXIOM(errorSites[0].IsPrim()); + TF_AXIOM(!errorSites[0].IsProperty()); + } + + // Simple ValidatorSuite + metadata.name = TfToken("TestValidatorSuite"); + metadata.doc = "This is a test."; + metadata.schemaTypes = {}; + metadata.isSuite = true; + UsdValidatorSuite validatorSuite = UsdValidatorSuite(metadata, + { + &layerValidator, + &stageValidator, + &schemaTypeValidator + }); + TF_AXIOM(validatorSuite.GetContainedValidators().size() == 3); +} + +int +main() +{ + TestSimpleValidator(); + + std::cout << "OK\n"; +} diff --git a/pxr/usd/usd/testenv/testUsdValueClips.py b/pxr/usd/usd/testenv/testUsdValueClips.py index 9ed7d1e772..982a110116 100644 --- a/pxr/usd/usd/testenv/testUsdValueClips.py +++ b/pxr/usd/usd/testenv/testUsdValueClips.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. import contextlib import os diff --git a/pxr/usd/usd/testenv/testUsdVariantEditing.py b/pxr/usd/usd/testenv/testUsdVariantEditing.py index be4831d052..09f4a066d1 100644 --- a/pxr/usd/usd/testenv/testUsdVariantEditing.py +++ b/pxr/usd/usd/testenv/testUsdVariantEditing.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from __future__ import print_function diff --git a/pxr/usd/usd/testenv/testUsdVariantFallbacks.py b/pxr/usd/usd/testenv/testUsdVariantFallbacks.py index 6d392a3234..099f2aa60e 100644 --- a/pxr/usd/usd/testenv/testUsdVariantFallbacks.py +++ b/pxr/usd/usd/testenv/testUsdVariantFallbacks.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. import os, sys, unittest from pxr import Gf, Sdf, Usd, Plug diff --git a/pxr/usd/usd/testenv/testUsdVariants.py b/pxr/usd/usd/testenv/testUsdVariants.py index 90901d8c8b..0759931064 100644 --- a/pxr/usd/usd/testenv/testUsdVariants.py +++ b/pxr/usd/usd/testenv/testUsdVariants.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. import sys, os, unittest from pxr import Sdf, Usd, Tf diff --git a/pxr/usd/usd/testenv/testUsdZipFile.cpp b/pxr/usd/usd/testenv/testUsdZipFile.cpp index 4bd265fa2d..9ed6db4702 100644 --- a/pxr/usd/usd/testenv/testUsdZipFile.cpp +++ b/pxr/usd/usd/testenv/testUsdZipFile.cpp @@ -1,25 +1,8 @@ // // Copyright 2021 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" @@ -62,8 +45,8 @@ TestIterators() UsdZipFile::Iterator i = zipFile.begin(), e = zipFile.end(); TF_AXIOM(std::distance(i, e) == 4); - TF_AXIOM(*i == "a.txt"); // Test operator* - TF_AXIOM(strcmp(i->c_str(), "a.txt") == 0); // Test operator-> + TF_AXIOM(*i == "a.test"); // Test operator* + TF_AXIOM(strcmp(i->c_str(), "a.test") == 0); // Test operator-> TF_AXIOM(i == std::next(zipFile.begin(), 0)); TF_AXIOM(i != std::next(zipFile.begin(), 1)); TF_AXIOM(i != std::next(zipFile.begin(), 2)); diff --git a/pxr/usd/usd/testenv/testUsdZipFile.py b/pxr/usd/usd/testenv/testUsdZipFile.py index f674f0bdd7..227d775c93 100644 --- a/pxr/usd/usd/testenv/testUsdZipFile.py +++ b/pxr/usd/usd/testenv/testUsdZipFile.py @@ -2,25 +2,8 @@ # # Copyright 2018 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. import os import unittest @@ -51,7 +34,7 @@ def test_Reader(self): zf = Usd.ZipFile.Open("test_reader.usdz") self.assertTrue(zf) self.assertEqual( - zf.GetFileNames(), ["a.txt", "b.png", "sub/c.png", "sub/d.txt"]) + zf.GetFileNames(), ["a.test", "b.png", "sub/c.png", "sub/d.txt"]) self.assertIsNone(zf.GetFile("nonexistent.txt")) self.assertIsNone(zf.GetFileInfo("nonexistent.txt")) @@ -62,15 +45,15 @@ def test_Reader(self): # translations applied. fixLineEndings = True - fileInfo = zf.GetFileInfo("a.txt") + fileInfo = zf.GetFileInfo("a.test") self.assertEqual(fileInfo.dataOffset, 64) - self.assertEqual(fileInfo.size, 82) - self.assertEqual(fileInfo.uncompressedSize, 82) - self.assertEqual(fileInfo.crc, 3011207731) + self.assertEqual(fileInfo.size, 83) + self.assertEqual(fileInfo.uncompressedSize, 83) + self.assertEqual(fileInfo.crc, 2187659876) self.assertEqual(fileInfo.compressionMethod, 0) self.assertFalse(fileInfo.encrypted) self._ValidateSourceAndZippedFile( - "src/a.txt", zf, "a.txt", fixLineEndings) + "src/a.test", zf, "a.test", fixLineEndings) fileInfo = zf.GetFileInfo("b.png") self.assertEqual(fileInfo.dataOffset, 192) @@ -112,8 +95,8 @@ def test_Writer(self): # writer or the writer is destroyed. self.assertFalse(os.path.isfile("test_writer.usdz")) - addedFile = zfw.AddFile("src/a.txt") - self.assertEqual(addedFile, "src/a.txt") + addedFile = zfw.AddFile("src/a.test") + self.assertEqual(addedFile, "src/a.test") addedFile = zfw.AddFile("src/b.png", "b.png") self.assertEqual(addedFile, "b.png") @@ -122,7 +105,7 @@ def test_Writer(self): # Verify that the zip file can be read by Usd.ZipFile. zf = Usd.ZipFile.Open("test_writer.usdz") - self.assertEqual(zf.GetFileNames(), ["src/a.txt", "b.png"]) + self.assertEqual(zf.GetFileNames(), ["src/a.test", "b.png"]) # Since we're writing files into a .usdz and then extracting # and comparing them to the original file, we don't need to @@ -132,11 +115,11 @@ def test_Writer(self): def _GetFileSize(file): return os.stat(file).st_size - fileInfo = zf.GetFileInfo("src/a.txt") + fileInfo = zf.GetFileInfo("src/a.test") self.assertEqual(fileInfo.dataOffset, 64) - self.assertEqual(fileInfo.size, _GetFileSize("src/a.txt")) - self.assertEqual(fileInfo.uncompressedSize, _GetFileSize("src/a.txt")) - self.assertEqual(fileInfo.crc, 3011207731) + self.assertEqual(fileInfo.size, _GetFileSize("src/a.test")) + self.assertEqual(fileInfo.uncompressedSize, _GetFileSize("src/a.test")) + self.assertEqual(fileInfo.crc, 2187659876) self.assertEqual(fileInfo.compressionMethod, 0) self.assertFalse(fileInfo.encrypted) @@ -149,7 +132,7 @@ def _GetFileSize(file): self.assertFalse(fileInfo.encrypted) self._ValidateSourceAndZippedFile( - "src/a.txt", zf, "src/a.txt", dontFixLineEndings) + "src/a.test", zf, "src/a.test", dontFixLineEndings) self._ValidateSourceAndZippedFile("src/b.png", zf, "b.png") # Verify that the data offset for all files in the archive are @@ -160,11 +143,11 @@ def _GetFileSize(file): # Verify that zip file can be read by third-party zip libraries # (in this case, Python's zip module) zf = zipfile.ZipFile("test_writer.usdz") - self.assertEqual(zf.namelist(), ["src/a.txt", "b.png"]) + self.assertEqual(zf.namelist(), ["src/a.test", "b.png"]) self.assertIsNone(zf.testzip()) self._ValidateSourceAndZippedFile( - "src/a.txt", zf, "src/a.txt", dontFixLineEndings) + "src/a.test", zf, "src/a.test", dontFixLineEndings) self._ValidateSourceAndZippedFile("src/b.png", zf, "b.png") def test_WriterAlignment(self): diff --git a/pxr/usd/usd/testenv/testUsdZipFile.testenv/src/a.test b/pxr/usd/usd/testenv/testUsdZipFile.testenv/src/a.test new file mode 100644 index 0000000000..cfa7f89f4e --- /dev/null +++ b/pxr/usd/usd/testenv/testUsdZipFile.testenv/src/a.test @@ -0,0 +1,4 @@ +This is a file named a.test. It is used for a test. + +It has multiple lines in it. + diff --git a/pxr/usd/usd/testenv/testUsdZipFile.testenv/src/a.txt b/pxr/usd/usd/testenv/testUsdZipFile.testenv/src/a.txt deleted file mode 100644 index 8ecf459291..0000000000 --- a/pxr/usd/usd/testenv/testUsdZipFile.testenv/src/a.txt +++ /dev/null @@ -1,4 +0,0 @@ -This is a file named a.txt. It is used for a test. - -It has multiple lines in it. - diff --git a/pxr/usd/usd/testenv/testUsdZipFile.testenv/test_reader.usdz b/pxr/usd/usd/testenv/testUsdZipFile.testenv/test_reader.usdz index 1f41706206..04b3721d93 100644 Binary files a/pxr/usd/usd/testenv/testUsdZipFile.testenv/test_reader.usdz and b/pxr/usd/usd/testenv/testUsdZipFile.testenv/test_reader.usdz differ diff --git a/pxr/usd/usd/timeCode.cpp b/pxr/usd/usd/timeCode.cpp index 91ae723ebb..ed070215bb 100644 --- a/pxr/usd/usd/timeCode.cpp +++ b/pxr/usd/usd/timeCode.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usd/timeCode.h" diff --git a/pxr/usd/usd/timeCode.h b/pxr/usd/usd/timeCode.h index c96c161aa3..6efcc39398 100644 --- a/pxr/usd/usd/timeCode.h +++ b/pxr/usd/usd/timeCode.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_TIME_CODE_H #define PXR_USD_USD_TIME_CODE_H diff --git a/pxr/usd/usd/tokens.cpp b/pxr/usd/usd/tokens.cpp index f0c2fec1cf..4b69074aac 100644 --- a/pxr/usd/usd/tokens.cpp +++ b/pxr/usd/usd/tokens.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usd/tokens.h" diff --git a/pxr/usd/usd/tokens.h b/pxr/usd/usd/tokens.h index 6c2a2dc0b3..67f9282fbf 100644 --- a/pxr/usd/usd/tokens.h +++ b/pxr/usd/usd/tokens.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USD_TOKENS_H #define USD_TOKENS_H diff --git a/pxr/usd/usd/typed.cpp b/pxr/usd/usd/typed.cpp index a58cb115fb..231f27e9b6 100644 --- a/pxr/usd/usd/typed.cpp +++ b/pxr/usd/usd/typed.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usd/typed.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usd/typed.h b/pxr/usd/usd/typed.h index 938c75e698..a6ca1540d9 100644 --- a/pxr/usd/usd/typed.h +++ b/pxr/usd/usd/typed.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USD_GENERATED_TYPED_H #define USD_GENERATED_TYPED_H diff --git a/pxr/usd/usd/usdFileFormat.cpp b/pxr/usd/usd/usdFileFormat.cpp index 1b54aabf8e..b3863b449e 100644 --- a/pxr/usd/usd/usdFileFormat.cpp +++ b/pxr/usd/usd/usdFileFormat.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usd/usdFileFormat.h" diff --git a/pxr/usd/usd/usdFileFormat.h b/pxr/usd/usd/usdFileFormat.h index 64b119522b..0eb141fac3 100644 --- a/pxr/usd/usd/usdFileFormat.h +++ b/pxr/usd/usd/usdFileFormat.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_USD_FILE_FORMAT_H #define PXR_USD_USD_USD_FILE_FORMAT_H diff --git a/pxr/usd/usd/usdGenSchema.py b/pxr/usd/usd/usdGenSchema.py index b79d8440f0..9502b1c7b1 100644 --- a/pxr/usd/usd/usdGenSchema.py +++ b/pxr/usd/usd/usdGenSchema.py @@ -2,25 +2,8 @@ # # Copyright 2016 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # """ This script generates C++ classes and supporting Python code for USD Schemata. @@ -41,6 +24,7 @@ """ from __future__ import print_function +import dataclasses import sys, os, re, inspect import keyword from argparse import ArgumentParser @@ -124,6 +108,10 @@ def SetQuiet(self, quiet): INSTANCE_NAME_PLACEHOLDER = \ Usd.SchemaRegistry.MakeMultipleApplyNameTemplate("", "") +# Custom metadata tokens for user doc +USERDOC_BRIEF = "userDocBrief" +USERDOC_FULL = "userDoc" + #------------------------------------------------------------------------------# # Parsed Objects # #------------------------------------------------------------------------------# @@ -293,14 +281,14 @@ def _CamelCase(aString): Token = namedtuple('Token', ['id', 'value', 'desc']) def _GetNameAndGeneratedSchemaPropNameForPropInfo(sdfPropName, classInfo): - if classInfo.propertyNamespacePrefix: + if classInfo.propertyNamespace: # A property namespace prefix will only exist for multiple apply API # schemas and is used to create the instanceable namespace prefix # prepended to all its properties. We prepend this instanceable # prefix to the raw name here. generatedSchemaPropName = \ Usd.SchemaRegistry.MakeMultipleApplyNameTemplate( - classInfo.propertyNamespacePrefix, sdfPropName) + classInfo.propertyNamespace.prefix, sdfPropName) # Since the property info's name is used to create the identifier # used for tokens and such, we make it from the instanced property # name with the instance name placeholder replaced with @@ -480,6 +468,17 @@ def _InheritsOwnFamily(p): p.GetPath().name) return family in allInheritedFamilies +@dataclasses.dataclass +class MultiApplyPropertyNamespace: + prefix : str + token : str + + @classmethod + def Create(cls, prefix, useLiteralIdentifier): + return cls(prefix, _MakeValidToken(prefix, useLiteralIdentifier)) \ + if prefix else None + + class ClassInfo(object): def __init__(self, usdPrim, sdfPrim, useLiteralIdentifier=False): # First validate proper class naming... @@ -601,8 +600,10 @@ def __init__(self, usdPrim, sdfPrim, useLiteralIdentifier=False): not self.isAPISchemaBase and not self.isTypedBase self.apiSchemaType = self.customData.get(API_SCHEMA_TYPE, SINGLE_APPLY if self.isApi else None) - self.propertyNamespacePrefix = \ - self.customData.get(PROPERTY_NAMESPACE_PREFIX) + self.propertyNamespace = MultiApplyPropertyNamespace.Create( + self.customData.get(PROPERTY_NAMESPACE_PREFIX), + useLiteralIdentifier + ) self.apiAutoApply = self.customData.get(API_AUTO_APPLY) self.apiCanOnlyApply = self.customData.get(API_CAN_ONLY_APPLY) self.apiAllowedInstanceNames = self.customData.get( @@ -616,7 +617,7 @@ def __init__(self, usdPrim, sdfPrim, useLiteralIdentifier=False): sdfPrim.path) if self.apiSchemaType != MULTIPLE_APPLY: - if self.propertyNamespacePrefix: + if self.propertyNamespace: raise _GetSchemaDefException( "%s should only be used as a customData field on " "multiple-apply API schemas." % PROPERTY_NAMESPACE_PREFIX, @@ -795,7 +796,7 @@ def _MakeMultipleApplySchemaNameTemplate(apiSchemaName): # use the USD prim because we need to know all override properties for the # flattened schema class, so this will include any overrides provided purely # through inheritance. -def _GetAPISchemaOverridePropertyNames(usdPrim, propertyNamespacePrefix): +def _GetAPISchemaOverridePropertyNames(usdPrim, propertyNamespace): apiSchemaOverridePropertyNames = [] for usdProp in usdPrim.GetProperties(): @@ -845,9 +846,9 @@ def _GetAPISchemaOverridePropertyNames(usdPrim, propertyNamespacePrefix): # schemas. If so, the property names need to be converted into their # template names to match the properties that will be in the # generatedSchema. - if propertyNamespacePrefix: + if propertyNamespace: propName = Usd.SchemaRegistry.MakeMultipleApplyNameTemplate( - propertyNamespacePrefix, propName) + propertyNamespace.prefix, propName) # Add the property name to the list. apiSchemaOverridePropertyNames.append(propName) @@ -880,13 +881,13 @@ def ParseUsd(usdFilePath): # make sure that if we have a multiple-apply schema with a property # namespace prefix that the prim actually has some properties if classInfo.apiSchemaType == MULTIPLE_APPLY: - if classInfo.propertyNamespacePrefix and \ + if classInfo.propertyNamespace and \ len(sdfPrim.properties) == 0: raise _GetSchemaDefException( "Multiple-apply schemas that have the " "propertyNamespacePrefix metadata fields must have at " "least one property", sdfPrim.path) - if not classInfo.propertyNamespacePrefix and \ + if not classInfo.propertyNamespace and \ not len(sdfPrim.properties) == 0: raise _GetSchemaDefException( "Multiple-apply schemas that do not" @@ -967,7 +968,7 @@ def ParseUsd(usdFilePath): # schemas. classInfo.apiSchemaOverridePropertyNames = \ _GetAPISchemaOverridePropertyNames( - usdPrim, classInfo.propertyNamespacePrefix) + usdPrim, classInfo.propertyNamespace) for classInfo in classes: # If this is an applied API schema that does not inherit from @@ -1265,9 +1266,9 @@ def GatherTokens(classes, libName, libTokens, # Add property namespace prefix token for multiple-apply API # schema to token set - if cls.propertyNamespacePrefix: - _AddToken(tokenDict, cls.tokens, cls.propertyNamespacePrefix, - cls.propertyNamespacePrefix, + if cls.propertyNamespace: + _AddToken(tokenDict, cls.tokens, cls.propertyNamespace.token, + cls.propertyNamespace.prefix, "Property namespace prefix for the %s schema." \ % cls.cppClassName, True) @@ -1607,6 +1608,55 @@ def _RenamePropertiesWithInstanceablePrefix(usdPrim): for name in originalPropNames: usdPrim.RemoveProperty(name) +def _GetUserDocForSchemaObj(obj, userDocSchemaObj): + """ + Find brief user doc for a schema object, in either the specifically authored + user doc info in userDocSchemaObj, or the schema obj itself. + Returns brief user doc string, or None if no reasonable brief user doc found + """ + # Start by looking at userDocSchemaObj for USERDOC_BRIEF customData + if userDocSchemaObj is not None and USERDOC_BRIEF in userDocSchemaObj.GetCustomData(): + return userDocSchemaObj.GetCustomData().get(USERDOC_BRIEF) + else: + # See if USERDOC_BRIEF exists on schema object's custom data + return obj.customData.get(USERDOC_BRIEF) + +def _UpdateUserDocForRegistry(filePath, flatLayer): + """ + Find the best source for "brief" user doc for the schema and apply it + This is only done for the schema registry, and not for codegen + """ + briefDict = {} + # Load /userDoc/schemaUserDoc.usda if it exists + userDocSchemaFile = os.path.join(os.path.dirname(os.path.abspath(filePath)), + "userDoc", "schemaUserDoc.usda") + userDocStage = None + if (os.path.isfile(userDocSchemaFile) and os.access(userDocSchemaFile, os.R_OK)): + userDocStage = Usd.Stage.Open(userDocSchemaFile) + # Walk through flattened schema stage and look for same-path classes in + # userDocStage if available, to get the appropriate brief user doc + for cls in flatLayer.rootPrims: + # Ignore GLOBAL + if cls.name == "GLOBAL": + continue + if userDocStage is not None: + userDocCls = userDocStage.GetPrimAtPath(cls.path) + else: + userDocCls = None + briefUserDoc = _GetUserDocForSchemaObj(cls, userDocCls) + if briefUserDoc is not None: + briefDict[cls.path] = briefUserDoc + # Look for property user doc + for clsProp in cls.properties: + if userDocCls is not None: + userDocClsProp = userDocCls.GetPropertyAtPath(clsProp.path) + else: + userDocClsProp = None + briefUserDoc = _GetUserDocForSchemaObj(clsProp, userDocClsProp) + if briefUserDoc is not None: + briefDict[clsProp.path] = briefUserDoc + return briefDict + def GenerateRegistry(codeGenPath, filePath, classes, validate, env): # Get the flattened layer to work with. @@ -1617,6 +1667,11 @@ def GenerateRegistry(codeGenPath, filePath, classes, validate, env): # lower-level schema modules. We hop back up to the UsdStage API to do # so because it is more convenient for these kinds of operations. flatStage = Usd.Stage.Open(flatLayer) + + # Gather schema class and property brief user doc if found. + # Do this here, before we strip out customData. + briefDict = _UpdateUserDocForRegistry(filePath, flatLayer) + pathsToDelete = [] primsToKeep = {cls.usdPrimTypeName : cls for cls in classes} if not flatStage.RemovePrim('/GLOBAL'): @@ -1690,6 +1745,19 @@ def GenerateRegistry(codeGenPath, filePath, classes, validate, env): p.SetCustomDataByKey('apiSchemaOverridePropertyNames', Vt.TokenArray(apiSchemaOverridePropertyNames)) + # Set user doc brief strings in class and property customData if + # authored, using the path-based dictionary we set in the call to + # _UpdateUserDocForRegistry above. Note that we need to do this after + # clearing other custom data. + workPathStr = p.GetPath() + if workPathStr in briefDict: + p.SetCustomDataByKey(USERDOC_BRIEF, briefDict[workPathStr]) + for myproperty in p.GetAuthoredProperties(): + workPathStr = myproperty.GetPath() + if workPathStr in briefDict: + myproperty.SetCustomDataByKey(USERDOC_BRIEF, + briefDict[workPathStr]) + for p in pathsToDelete: flatStage.RemovePrim(p) @@ -1849,7 +1917,7 @@ def InitializeResolver(): libTokens, \ skipCodeGen, \ classes = ParseUsd(schemaPath) - + if args.validate: Print('Validation on, any diffs found will cause failure.') diff --git a/pxr/usd/usd/usdaFileFormat.cpp b/pxr/usd/usd/usdaFileFormat.cpp index 1dca2ad157..4518c81f7c 100644 --- a/pxr/usd/usd/usdaFileFormat.cpp +++ b/pxr/usd/usd/usdaFileFormat.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usd/usdaFileFormat.h" diff --git a/pxr/usd/usd/usdaFileFormat.h b/pxr/usd/usd/usdaFileFormat.h index ea7e135ada..83f2f118e6 100644 --- a/pxr/usd/usd/usdaFileFormat.h +++ b/pxr/usd/usd/usdaFileFormat.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_USDA_FILE_FORMAT_H #define PXR_USD_USD_USDA_FILE_FORMAT_H diff --git a/pxr/usd/usd/usdcFileFormat.cpp b/pxr/usd/usd/usdcFileFormat.cpp index 6b7980e351..bb7f31b7fd 100644 --- a/pxr/usd/usd/usdcFileFormat.cpp +++ b/pxr/usd/usd/usdcFileFormat.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usd/usdcFileFormat.h" diff --git a/pxr/usd/usd/usdcFileFormat.h b/pxr/usd/usd/usdcFileFormat.h index a7f046875c..137c5d550b 100644 --- a/pxr/usd/usd/usdcFileFormat.h +++ b/pxr/usd/usd/usdcFileFormat.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_USDC_FILE_FORMAT_H #define PXR_USD_USD_USDC_FILE_FORMAT_H diff --git a/pxr/usd/usd/usdzFileFormat.cpp b/pxr/usd/usd/usdzFileFormat.cpp index f323775c86..fd923befcb 100644 --- a/pxr/usd/usd/usdzFileFormat.cpp +++ b/pxr/usd/usd/usdzFileFormat.cpp @@ -1,25 +1,8 @@ // // Copyright 2018 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usd/usdaFileFormat.h" diff --git a/pxr/usd/usd/usdzFileFormat.h b/pxr/usd/usd/usdzFileFormat.h index 5d09c9e768..650e162991 100644 --- a/pxr/usd/usd/usdzFileFormat.h +++ b/pxr/usd/usd/usdzFileFormat.h @@ -1,25 +1,8 @@ // // Copyright 2018 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_USDZ_FILE_FORMAT_H #define PXR_USD_USD_USDZ_FILE_FORMAT_H diff --git a/pxr/usd/usd/usdzResolver.cpp b/pxr/usd/usd/usdzResolver.cpp index ffdf492d3a..27ac9cb287 100644 --- a/pxr/usd/usd/usdzResolver.cpp +++ b/pxr/usd/usd/usdzResolver.cpp @@ -1,25 +1,8 @@ // // Copyright 2018 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/usd/usdzResolver.h b/pxr/usd/usd/usdzResolver.h index 3c991a72dd..b3a3b40652 100644 --- a/pxr/usd/usd/usdzResolver.h +++ b/pxr/usd/usd/usdzResolver.h @@ -1,25 +1,8 @@ // // Copyright 2018 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_USDZ_RESOLVER_H #define PXR_USD_USD_USDZ_RESOLVER_H diff --git a/pxr/usd/usd/validationError.cpp b/pxr/usd/usd/validationError.cpp new file mode 100644 index 0000000000..a3a78f19a7 --- /dev/null +++ b/pxr/usd/usd/validationError.cpp @@ -0,0 +1,69 @@ +// +// Copyright 2024 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// + +#include "pxr/usd/usd/validationError.h" + +PXR_NAMESPACE_OPEN_SCOPE + +UsdValidationErrorSite::UsdValidationErrorSite( + const SdfLayerHandle &layer, const SdfPath &objectPath) : + _layer(layer), _objectPath(objectPath) +{ +} + +UsdValidationErrorSite::UsdValidationErrorSite(const UsdStagePtr &usdStage, + const SdfPath &objectPath, + const SdfLayerHandle &layer) : + _usdStage(usdStage), _layer(layer), _objectPath(objectPath) +{ +} + +UsdValidationError::UsdValidationError() : + _errorType(UsdValidationErrorType::None) +{ + _validator = nullptr; +} + +UsdValidationError::UsdValidationError(const UsdValidationErrorType &type, + const UsdValidationErrorSites &errorSites, + const std::string &errorMsg) : + _errorType(type), _errorSites(errorSites), _errorMsg(errorMsg) +{ + _validator = nullptr; +} + +std::string +UsdValidationError::GetErrorAsString() const +{ + std::string errorTypeAsString; + switch(_errorType) { + case UsdValidationErrorType::None: + return _errorMsg; + break; + case UsdValidationErrorType::Error: + errorTypeAsString = "Error"; + break; + case UsdValidationErrorType::Warn: + errorTypeAsString = "Warn"; + break; + case UsdValidationErrorType::Info: + errorTypeAsString = "Info"; + break; + } + + const std::string separator = ": "; + return errorTypeAsString + separator + _errorMsg; +} + +void +UsdValidationError::_SetValidator(const UsdValidator *validator) +{ + _validator = validator; +} + +PXR_NAMESPACE_CLOSE_SCOPE + diff --git a/pxr/usd/usd/validationError.h b/pxr/usd/usd/validationError.h new file mode 100644 index 0000000000..95005f09aa --- /dev/null +++ b/pxr/usd/usd/validationError.h @@ -0,0 +1,308 @@ +// +// Copyright 2024 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// + +#ifndef PXR_USD_USD_VALIDATION_ERROR_H +#define PXR_USD_USD_VALIDATION_ERROR_H + +#include "pxr/pxr.h" +#include "pxr/usd/sdf/path.h" +#include "pxr/usd/usd/stage.h" +#include "pxr/usd/usd/property.h" + +#include + +PXR_NAMESPACE_OPEN_SCOPE + +class UsdPrim; +class UsdValidator; + +/// \class UsdValidationErrorType +/// +/// UsdValidationErrorType reflects severity of a validation error, which can +/// then be reported appropriately to the users. +/// +/// None: No Error. +/// Error: Associates the UsdValidationErrorType with an actual Error reported +/// by the validation task. +/// Warn: Associates the UsdValidationErrorType with a less severe situation and +/// hence reported as warning by the validation task. +/// Info: Associates the UsdValidationErrorType with information which needs to +/// be reported to the users by the validation task. +enum class UsdValidationErrorType { + None = 0, + Error, + Warn, + Info +}; + +/// \class UsdValidationErrorSite +/// +/// UsdValidationErrorSite is important information available from a +/// ValidationError, which annotates the site where the Error was reported by a +/// validation task. +/// +/// An Error could be reported in a SdfLayer (in layer metadata, for example), +/// or a UsdStage (in stage metadata, for example) or a Prim within a stage, or +/// a property of a prim. +struct UsdValidationErrorSite +{ +public: + UsdValidationErrorSite() = default; + + /// Initialize an UsdValidationErrorSite using a \p layer and an + /// \p objectPath. + /// + /// Object Path here could be a prim or a property spec path. + /// + /// Note that to identify a layer metadata, objectPath can be set as the + /// pseudoRoot. + USD_API + UsdValidationErrorSite(const SdfLayerHandle &layer, + const SdfPath &objectPath); + + /// Initialize an UsdValidationErrorSite using a \p usdStage and an \p + /// objectPath. + /// + /// An option \p layer can also be provided to provide information about a + /// specific layer the erroring \p objectPath is found in the property + /// stack. + /// + /// Object Path here could be a prim path or a property path. + /// Note that to identify stage's root layer metadata, objectPath can be set + /// as the pseudoRoot. + USD_API + UsdValidationErrorSite(const UsdStagePtr &usdStage, + const SdfPath &objectPath, + const SdfLayerHandle &layer=SdfLayerHandle()); + + /// Returns true if UsdValidationErrorSite instance can either point to a + /// prim or property spec in a layer or a prim or property on a stage. + bool IsValid() const + { + return IsValidSpecInLayer() || IsPrim() || IsProperty(); + } + + /// Returns true if the objectPath and layer represent a spec in the layer; + /// false otherwise. + bool IsValidSpecInLayer() const + { + if (!_layer || _objectPath.IsEmpty()) { + return false; + } + return _layer->HasSpec(_objectPath); + } + + /// Returns true if UsdValidationErrorSite represents a prim on a stage, + /// false otherwise. + bool IsPrim() const + { + return GetPrim().IsValid(); + } + + /// Returns true if UsdValidationErrorSite represents a property on a stage, + /// false otherwise. + bool IsProperty() const + { + return GetProperty().IsValid(); + } + + /// Returns the SdfPropertySpecHandle associated with this + /// ValidationErrorSite's layer and objectPath. + /// + /// Returns an invalid SdfPropertySpecHandle if no valid property spec is + /// found, or when UsdValidationErrorSite instance doesn't have a + /// layer. + const SdfPropertySpecHandle GetPropertySpec() const + { + if (!_layer) { + return SdfPropertySpecHandle(); + } + return _layer->GetPropertyAtPath(_objectPath); + } + + /// Returns the SdfPrimSpecHandle associated with this ValidationErrorSite's + /// layer and objectPath. + /// + /// Returns an invalid SdfPrimSpecHandle if no valid prim spec is found, or + /// when UsdValidationErrorSite instance doesn't have a layer. + const SdfPrimSpecHandle GetPrimSpec() const + { + if (!_layer) { + return SdfPrimSpecHandle(); + } + return _layer->GetPrimAtPath(_objectPath); + } + + /// Returns the SdfLayerHandle associated with this UsdValidatorErrorSite + const SdfLayerHandle& GetLayer() const + { + return _layer; + } + + /// Returns the UsdStage associated with this UsdValidationErrorSite; + /// nullptr othewrise. + const UsdStagePtr& GetStage() const + { + return _usdStage; + } + + /// Returns UsdPrim associated with this UsdValidationErrorSite, that is + /// when UsdStage is present and objectPath represents a prim path on this + /// stage; if not, an invalid prim is returned. + UsdPrim GetPrim() const + { + if (_usdStage) { + return _usdStage->GetPrimAtPath(_objectPath); + } + return UsdPrim(); + } + + /// Returns UsdProperty associated with this UsdValidationErrorSite, that is + /// when UsdStage is present and objectPath represents a property path on + /// this stage; if not, an invalid property is returned. + UsdProperty GetProperty() const + { + if (_usdStage) { + return _usdStage->GetPropertyAtPath(_objectPath); + } + return UsdProperty(); + } + + /// Returns true if \p other UsdValidationErrorSite has same valued members + /// as this UsdValidationErrorSite, false otherwise. + bool operator==(const UsdValidationErrorSite& other) const { + return (_layer == other._layer) && + (_usdStage == other._usdStage) && + (_objectPath == other._objectPath); + } + + /// Returns false if \p other UsdValidationErrorSite has same valued members + /// as this UsdValidationErrorSite, true otherwise. + bool operator!=(const UsdValidationErrorSite& other) const { + return !(*this == other); + } + +private: + UsdStagePtr _usdStage; + SdfLayerHandle _layer; + SdfPath _objectPath; + +}; // UsdValidationErrorSite + +using UsdValidationErrorSites = std::vector; + +/// \class UsdValidationError +/// +/// UsdValidationError is an entity returned by a validation task, which is +/// associated with a UsdValidator. +/// +/// A UsdValidationError instance contains important information, like: +/// +/// - UsdValidationErrorType - severity of an error, +/// +/// - UsdValidationErrorSites - on what sites validationError was reported by a +/// validation task, +/// +/// - Message - Message governing more information associated with the error. Such +/// a message is provided by the validator writer, when providing +/// implementation for the validation task function. +/// +/// UsdValidationError instances will be stored in the UsdValidationContext +/// responsible for executing a set of UsdValidators. +/// +class UsdValidationError { +public: + /// A default constructed UsdValidationError signifies no error. + USD_API + UsdValidationError(); + + /// Instantiate a ValidationError by providing its \p errorType, \p + /// errorSites and an \p errorMsg. + USD_API + UsdValidationError(const UsdValidationErrorType &errorType, + const UsdValidationErrorSites &errorSites, + const std::string &errorMsg); + + bool operator==(const UsdValidationError& other) const { + return (_errorType == other._errorType) && + (_errorSites == other._errorSites) && + (_errorMsg == other._errorMsg) && + (_validator == other._validator); + } + + bool operator!=(const UsdValidationError& other) const { + return !(*this == other); + } + + /// Returns the UsdValidationErrorType associated with this + /// UsdValidationError + UsdValidationErrorType GetType() const + { + return _errorType; + } + + /// Returns the UsdValidationErrorSite associated with this + /// UsdValidationError + const UsdValidationErrorSites& GetSites() const + { + return _errorSites; + } + + /// Returns the UsdValidator that reported this error. + /// + /// This will return nullptr if there is no UsdValidator associated with + /// this error. This will never be nullptr for validation errors returned + /// from calls to UsdValidator::Validate. + const UsdValidator* GetValidator() const + { + return _validator; + } + + /// Returns the message associated with this UsdValidationError + const std::string& GetMessage() const + { + return _errorMsg; + } + + /// Returns UsdValidationErrorType and ErrorMessage concatenated as a string + USD_API + std::string GetErrorAsString() const; + + /// Returns true if UsdValidationErrorType is UsdValidationErrorType::None, + /// false otherwise + bool HasNoError() const { + return _errorType == UsdValidationErrorType::None; + } + +private: + // UsdValidatorError holds a pointer to the UsdValidator that generated it, so + // we need to provide friend access to allow the necessary mutation. + friend class UsdValidator; + + // Used by UsdValidator::Validate methods to embed itself to the reported + // errors. + void _SetValidator(const UsdValidator *validator); + + // _validator is set when ValidationError is generated via a + // UsdValidator::Validate() call. + const UsdValidator *_validator; + + // These data members should not be modified other than during + // initialization by the validate task functions. + UsdValidationErrorType _errorType; + UsdValidationErrorSites _errorSites; + std::string _errorMsg; + + // TODO:(Subsequent iterations) + // - VtValue of a random value the error wants to propagate down to the + // fixer + +}; // UsdValidationError + +PXR_NAMESPACE_CLOSE_SCOPE + +#endif // PXR_USD_USD_VALIDATION_ERROR_H diff --git a/pxr/usd/usd/validationRegistry.cpp b/pxr/usd/usd/validationRegistry.cpp new file mode 100644 index 0000000000..d6249346bf --- /dev/null +++ b/pxr/usd/usd/validationRegistry.cpp @@ -0,0 +1,787 @@ +// +// Copyright 2024 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// + +#include "pxr/usd/usd/validationRegistry.h" + +#include "pxr/base/tf/instantiateSingleton.h" +#include "pxr/base/tf/registryManager.h" +#include "pxr/base/plug/plugin.h" +#include "pxr/base/plug/registry.h" +#include "pxr/base/tf/token.h" + +#include +#include +#include +#include + +PXR_NAMESPACE_OPEN_SCOPE + +TF_INSTANTIATE_SINGLETON(UsdValidationRegistry); + +TF_DEFINE_PRIVATE_TOKENS(_tokens, + ((PluginValidatorsKey, "Validators")) + ((Keywords, "keywords")) + ((Doc, "doc")) + ((SchemaTypes, "schemaTypes")) + ((IsSuite, "isSuite")) + ((PluginValidatorNameDelimiter, ":")) +); + + + +UsdValidationRegistry::UsdValidationRegistry() +{ + // Do any plugin processing before subscription starts. + _PopulateMetadataFromPlugInfo(); + TfSingleton::SetInstanceConstructed(*this); + TfRegistryManager::GetInstance().SubscribeTo(); +} + +// Helper to return a TfTokenVector from a json string array +static TfTokenVector +_FillTokenVector(const JsValue &value) +{ + TfTokenVector tokens; + const auto arr = value.GetArrayOf(); + tokens.reserve(arr.size()); + for (const auto &a : arr) { + tokens.emplace_back(a); + } + return tokens; +} + +// Helper to return common keywords associated with all validators in plugInfo +static TfTokenVector +_ParseStringArrayValue(const JsObject &object, const TfToken &token, + const TfToken &validatorName = TfToken()) +{ + const std::string &errorStrTemplate = + "Expected array of strings for " + token.GetString() + " metadata"; + const std::string &errorStr = validatorName.IsEmpty() ? + errorStrTemplate : + errorStrTemplate + " for validator " + validatorName.GetString(); + if (const JsValue * const value = TfMapLookupPtr(object, token)) { + if (!value->IsArrayOf()) { + TF_RUNTIME_ERROR("%s", errorStr.c_str()); + return TfTokenVector{}; + } + return _FillTokenVector(*value); + } + return TfTokenVector{}; +} + +void +UsdValidationRegistry::_PopulateMetadataFromPlugInfo() +{ + const PlugPluginPtrVector &plugins = + PlugRegistry::GetInstance().GetAllPlugins(); + + auto _GetKey = [](const JsObject &dict, const std::string &key, + JsObject *value) { + const JsObject::const_iterator i = dict.find(key); + if (i != dict.end() && i->second.IsObject()) { + *value = i->second.GetJsObject(); + return true; + } + return false; + }; + + for(const PlugPluginPtr &plugin : plugins) { + JsObject validators; + const JsObject &plugMetadata = plugin->GetMetadata(); + + // No Validators in plugInfo, continue + if (!_GetKey(plugMetadata, _tokens->PluginValidatorsKey, &validators)) { + continue; + } + + const TfTokenVector keywords = + _ParseStringArrayValue(validators, + _tokens->Keywords); + + const TfToken pluginName = TfToken(plugin->GetName()); + TfTokenVector validatorNames; + // Parse all validator names and respective plugMetadata + for (const auto &validatorEntry : validators) { + // Skip keywords, move to validator entries + if (validatorEntry.first == _tokens->Keywords) { + continue; + } + const TfToken validatorName(validatorEntry.first); + JsObject validatorDict; + if (!_GetKey(validators, validatorName, &validatorDict)) { + TF_RUNTIME_ERROR("Expected dict for validator '%s'", + validatorName.GetText()); + continue; + } + + const JsValue * const doc = + TfMapLookupPtr(validatorDict, _tokens->Doc); + if (!doc || !doc->IsString() || doc->GetString().empty()) { + TF_RUNTIME_ERROR("Missing or invalid or empty doc string " + "metadata for '%s' validator", + validatorName.GetText()); + continue; + } + + UsdValidatorMetadata metadata; + + metadata.pluginPtr = plugin; + // prefix pluginName to validatorName to make these plugin + // validator's metadata.name unique + metadata.name = TfToken(TfStringJoin( + std::vector{pluginName.GetString(), + validatorName.GetString()}, + _tokens->PluginValidatorNameDelimiter.GetText())); + validatorNames.push_back(metadata.name); + + metadata.doc = doc->GetString(); + + metadata.schemaTypes = + _ParseStringArrayValue(validatorDict, _tokens->SchemaTypes, + metadata.name); + + metadata.keywords = keywords; + const TfTokenVector &localKeywords = + _ParseStringArrayValue(validatorDict, _tokens->Keywords, + metadata.name); + metadata.keywords.reserve( + metadata.keywords.size() + localKeywords.size()); + metadata.keywords.insert(metadata.keywords.end(), + localKeywords.begin(), + localKeywords.end()); + + if (const JsValue * const isSuite = + TfMapLookupPtr(validatorDict, _tokens->IsSuite)) { + if (!isSuite->IsBool()) { + TF_RUNTIME_ERROR("Expected bool for isSuite for validator " + "'%s'", metadata.name.GetText()); + } else { + metadata.isSuite = isSuite->GetBool(); + } + } else { + metadata.isSuite = false; + } + + // we need no protection of shared resource here, because this + // member function is only called from within the constructor, and + // that's guaranteed to run only once by TfSingleton initialization. + _AddValidatorMetadata(metadata); + } + if (!validatorNames.empty()) { + _pluginNameToValidatorNames.emplace(plugin->GetName(), + validatorNames); + } + } +} + +void +UsdValidationRegistry::RegisterPluginValidator( + const TfToken &validatorName, const UsdValidateLayerTaskFn &layerTaskFn) +{ + _RegisterPluginValidator( + validatorName, layerTaskFn); +} + +void +UsdValidationRegistry::RegisterPluginValidator( + const TfToken &validatorName, const UsdValidateStageTaskFn &stageTaskFn) +{ + _RegisterPluginValidator( + validatorName, stageTaskFn); +} + +void +UsdValidationRegistry::RegisterPluginValidator( + const TfToken &validatorName, const UsdValidatePrimTaskFn &primTaskFn) +{ + _RegisterPluginValidator( + validatorName, primTaskFn); +} + +template +void +UsdValidationRegistry::_RegisterPluginValidator(const TfToken &validatorName, + const ValidateTaskFn &taskFn) +{ + static_assert(std::is_same_v || + std::is_same_v || + std::is_same_v, + "template parameter must be UsdValidateLayerTaskFn," + "UsdValidateStageTaskFn, or UsdValidatePrimTaskFn"); + + UsdValidatorMetadata metadata; + if (!GetValidatorMetadata(validatorName, &metadata)) { + // if this validatorName is from a plugin, which it should be since + // this API is only for registering validators which are defined + // in plugInfo, then we should have parsed its metadata already, + // and if it's not found that means it's not coming from a plugInfo, + // so bail out. + TF_CODING_ERROR( + "Validator metadata missing for '%s', validator registered " + "using this API must be defined in the plugInfo.json", + validatorName.GetText()); + return; + } + + _RegisterValidator(metadata, taskFn, /* addMetadata */ false); +} + +void +UsdValidationRegistry::RegisterValidator( + const UsdValidatorMetadata &metadata, + const UsdValidateLayerTaskFn &layerTaskFn) +{ + _RegisterValidator(metadata, layerTaskFn); +} + +void +UsdValidationRegistry::RegisterValidator( + const UsdValidatorMetadata &metadata, + const UsdValidateStageTaskFn &stageTaskFn) +{ + _RegisterValidator(metadata, stageTaskFn); +} + +void +UsdValidationRegistry::RegisterValidator( + const UsdValidatorMetadata &metadata, + const UsdValidatePrimTaskFn &primTaskFn) +{ + _RegisterValidator(metadata, primTaskFn); +} + +template +void +UsdValidationRegistry::_RegisterValidator(const UsdValidatorMetadata &metadata, + const ValidateTaskFn &taskFn, bool addMetadata) +{ + static_assert(std::is_same_v || + std::is_same_v || + std::is_same_v, + "template parameter must be UsdValidateLayerTaskFn," + "UsdValidateStageTaskFn, or UsdValidatePrimTaskFn"); + + static constexpr bool isPrimTaskFn = + std::is_same::value; + if (!_CheckMetadata(metadata, isPrimTaskFn)) { + return; + } + + { + // Lock for writing validators. + std::unique_lock lock(_mutex); + if (_validators.find(metadata.name) != _validators.end()) { + TF_CODING_ERROR( + "Validator '%s' already registered with the " + "UsdValidationRegistry", metadata.name.GetText()); + return; + } + + // Note in case validator metadata needs to be added and there is + // contention only the first validator's (which is being added) + // metadata will be added. + if (addMetadata) { + // Following call to _AddValidatorMetadata is protected by the lock + // above. + if (!_AddValidatorMetadata(metadata)) { + TF_CODING_ERROR( + "Metadata already added for a UsdValidatorSuite with the " + "same name '%s'.", metadata.name.GetText()); + return; + } + } + + std::unique_ptr validator = + std::make_unique(metadata, taskFn); + if (!_validators.emplace(metadata.name, std::move(validator)).second) { + TF_CODING_ERROR( + "Validator with name '%s' already exists, failed to register " + "it again.", metadata.name.GetText()); + } + } +} + +bool +UsdValidationRegistry::HasValidator(const TfToken &validatorName) const +{ + std::shared_lock lock(_mutex); + return _validators.find(validatorName) != _validators.end(); +} + +std::vector +UsdValidationRegistry::GetOrLoadAllValidators() +{ + const TfTokenVector &validatorNames = [&]() { + TfTokenVector result; + std::shared_lock lock(_mutex); + result.reserve(_validatorNameToMetadata.size()); + + // Ensure _validatorNameToMetadata is accessed as a const; This will + // ensure multiple threads can safely read from + // _validatorNameToMetadata without risking data races, as const + // begin / end overloads will be invoked below. + for (const auto &entry : std::as_const(_validatorNameToMetadata)) { + if (!entry.second.isSuite) { + result.push_back(entry.first); + } + } + return result; + }(); + + return GetOrLoadValidatorsByName(validatorNames); +} + +const UsdValidator* +UsdValidationRegistry::GetOrLoadValidatorByName(const TfToken &validatorName) +{ + auto _GetValidator = [&](const TfToken &name) -> const UsdValidator* { + std::shared_lock lock(_mutex); + // Ensure _validators is accessed as a const; This will ensure multiple + // threads can safely read from _validators without risking data races, + // as const find overload will be invoked below. + const auto &validatorItr = std::as_const(_validators).find(name); + if (validatorItr != _validators.cend()) { + return validatorItr->second.get(); + } + return nullptr; + }; + + if (const UsdValidator *const validator = _GetValidator(validatorName)) { + return validator; + } + + UsdValidatorMetadata metadata; + if (!GetValidatorMetadata(validatorName, &metadata)) { + // No validatorMetadata found corresponding to this validatorName + return nullptr; + } + + // If metadata was found but validator was not found / loaded, that implies + // this validator must be plugin provided. + TF_VERIFY(metadata.pluginPtr); + + if (metadata.pluginPtr->Load()) { + // Plugin was loaded, lets look again. + return _GetValidator(validatorName); + } + + return nullptr; +} + +std::vector +UsdValidationRegistry::GetOrLoadValidatorsByName( + const TfTokenVector &validatorNames) +{ + std::vector validators; + validators.reserve(validatorNames.size()); + + for (const TfToken &validatorName : validatorNames) { + const UsdValidator *validator = GetOrLoadValidatorByName(validatorName); + // If validator is nullptr, that means the validatorName was not found + // in the registry and it failed to register, in which case appropriate + // coding error would have been reported. + if (validator) { + validators.push_back(validator); + } + } + return validators; +} + +void +UsdValidationRegistry::RegisterPluginValidatorSuite( + const TfToken &suiteName, + const std::vector &containedValidators) +{ + UsdValidatorMetadata metadata; + if (!GetValidatorMetadata(suiteName, &metadata)) { + // if this suiteName is from a plugin, which it should be since + // this API is only for registering validators which are defined + // in plugInfo, then we should have parsed its metadata already, + // and if it's not found that means it's not coming from a plugInfo, + // so bail out. + TF_CODING_ERROR( + "Validator Suite metadata missing for '%s', validator registered " + "using this API must be defined in the plugInfo.json", + suiteName.GetText()); + return; + } + _RegisterValidatorSuite(metadata, containedValidators, + /* addMetadata */ false); +} + +void +UsdValidationRegistry::RegisterValidatorSuite( + const UsdValidatorMetadata &metadata, + const std::vector &containedValidators) +{ + _RegisterValidatorSuite(metadata, containedValidators); +} + +void +UsdValidationRegistry::_RegisterValidatorSuite( + const UsdValidatorMetadata &metadata, + const std::vector &containedValidators, + bool addMetadata) +{ + if (!_CheckMetadata(metadata, /* checkForPrimTask */ false, + /* expectSuite */ true)) { + return; + } + + // Make sure containedValidators are conforming if suite has schemaTypes. + // That is, validators have PrimTaskFn, otherwise, do not register this + // validator. And contained validators's schemaType is a subset of Suite's + // schemaTypes metadata. + if (!metadata.schemaTypes.empty()) { + for(const UsdValidator *const validator : containedValidators) { + if (!validator) { + // Possible clients try to register a validator which is + // invalid/nullptr + TF_CODING_ERROR( + "Validator Suite '%s' not registered, one of the contained " + "validator is invalid.", + metadata.name.GetText()); + return; + } + if (!validator->_GetValidatePrimTask()) { + TF_CODING_ERROR( + "ValidatorSuite '%s' cannot be registered, as it provides " + "schemaTypes, but at least one of its contained validator " + "'%s' does not provide a UsdValidatePrimTaskFn", + metadata.name.GetText(), + validator->GetMetadata().name.GetText()); + return; + } + // We also need to make sure the contained validator's schemaTypes + // is a subset of validatorSuite's schemaTypes + // NB: The size of the vectors here should be small. + for (const TfToken& schemaType : + validator->GetMetadata().schemaTypes) { + if (std::find(metadata.schemaTypes.begin(), + metadata.schemaTypes.end(), schemaType) == + metadata.schemaTypes.end()) { + TF_CODING_ERROR( + "schemaType '%s' provided by a contained validator " + "'%s' is not in schemaTypes for '%s' validator suite", + schemaType.GetText(), + validator->GetMetadata().name.GetText(), + metadata.name.GetText()); + return; + } + } + } + } + + { + // Lock for writing validatorSuites + std::unique_lock lock(_mutex); + if (_validatorSuites.find(metadata.name) != + _validatorSuites.end()) { + TF_CODING_ERROR( + "ValidatorSuite '%s' already registered with the " + "UsdValidationRegistry", metadata.name.GetText()); + return; + } + + // Note in case validator metadata needs to be added and there is + // contention only the first validator's (which is being added) + // metadata will be added. + if (addMetadata) { + // Following call to _AddValidatorMetadata is protected by the lock + // above. + if (!_AddValidatorMetadata(metadata)) { + TF_CODING_ERROR( + "Metadata already added for a UsdValidator with the same " + "name '%s'.", metadata.name.GetText()); + return; + } + } + + std::unique_ptr validatorSuite = + std::make_unique(metadata, containedValidators); + if (!_validatorSuites.emplace(metadata.name, + std::move(validatorSuite)).second) { + TF_CODING_ERROR( + "Suite with name '%s' already exists, failed to register it " + "again.", metadata.name.GetText()); + } + } +} + +bool +UsdValidationRegistry::HasValidatorSuite(const TfToken &suiteName) const +{ + std::shared_lock lock(_mutex); + return _validatorSuites.find(suiteName) != _validatorSuites.end(); +} + +std::vector +UsdValidationRegistry::GetOrLoadAllValidatorSuites() +{ + + const TfTokenVector suiteNames = [&]() { + TfTokenVector result; + std::shared_lock lock(_mutex); + result.reserve(_validatorNameToMetadata.size()); + // Ensure _validatorNameToMetadata is accessed as a const; This will + // ensure multiple threads can safely read from + // _validatorNameToMetadata without risking data races, as const + // begin / end overloads will be invoked below. + for (const auto &entry : std::as_const(_validatorNameToMetadata)) { + if (entry.second.isSuite) { + result.push_back(entry.first); + } + } + return result; + }(); + + std::vector suites; + suites.reserve(suiteNames.size()); + for (const auto& suiteName : suiteNames) { + const UsdValidatorSuite* suite = + GetOrLoadValidatorSuiteByName(suiteName); + if (suite) { + suites.push_back(suite); + } + } + return suites; +} + +const UsdValidatorSuite* +UsdValidationRegistry::GetOrLoadValidatorSuiteByName( + const TfToken &suiteName) +{ + auto _GetValidatorSuite = [&](const TfToken &name) + -> const UsdValidatorSuite* { + std::shared_lock lock(_mutex); + // Ensure _validatorSuites is accessed as a const; This will ensure + // multiple threads can safely read from _validatorSuites without + // risking data races, as const find overload will be invoked below. + const auto& validatorSuiteItr = std::as_const(_validatorSuites).find(name); + if (validatorSuiteItr != _validatorSuites.cend()) { + return validatorSuiteItr->second.get(); + } + return nullptr; + }; + + if (const UsdValidatorSuite *const suite = _GetValidatorSuite(suiteName)) { + return suite; + } + + UsdValidatorMetadata metadata; + if (!GetValidatorMetadata(suiteName, &metadata)) { + // No validatorMetadata found corresponding to this suiteName + return nullptr; + } + + // If metadata was found but suite was not found / loaded, that implies + // this suite must be plugin provided. + TF_VERIFY(metadata.pluginPtr); + + if (metadata.pluginPtr->Load()) { + return _GetValidatorSuite(suiteName); + // Plugin was loaded, lets look again. + } + + return nullptr; +} + +std::vector +UsdValidationRegistry::GetOrLoadValidatorSuitesByName( + const TfTokenVector &suiteNames) +{ + std::vector suites; + suites.reserve(suiteNames.size()); + + for (const TfToken &suiteName : suiteNames) { + const UsdValidatorSuite *suite = GetOrLoadValidatorSuiteByName(suiteName); + // if suite is nullptr, that means suiteName was not found in the + // registry and it failed to register, in which case appropriate coding + // error would have been reported. + if (suite) { + suites.push_back(suite); + } + } + return suites; +} + +bool +UsdValidationRegistry::GetValidatorMetadata( + const TfToken &name, + UsdValidatorMetadata *metadata) const +{ + std::shared_lock lock(_mutex); + const auto& validatorNameToMetadataItr = + _validatorNameToMetadata.find(name); + if (validatorNameToMetadataItr == _validatorNameToMetadata.end()) { + return false; + } + *metadata = validatorNameToMetadataItr->second; + return true; +} + +UsdValidatorMetadataVector +UsdValidationRegistry::GetAllValidatorMetadata() const +{ + UsdValidatorMetadataVector result; + std::shared_lock lock(_mutex); + result.reserve(_validatorNameToMetadata.size()); + for (const auto &entry : _validatorNameToMetadata) { + result.push_back(entry.second); + } + return result; +} + +UsdValidatorMetadataVector +UsdValidationRegistry::GetValidatorMetadataForPlugin( + const TfToken &pluginName) const +{ + return GetValidatorMetadataForPlugins({pluginName}); +} + +UsdValidatorMetadataVector +UsdValidationRegistry::GetValidatorMetadataForKeyword( + const TfToken &keyword) const +{ + return GetValidatorMetadataForKeywords({keyword}); +} + +UsdValidatorMetadataVector +UsdValidationRegistry::GetValidatorMetadataForSchemaType( + const TfToken &schemaType) const +{ + return GetValidatorMetadataForSchemaTypes({schemaType}); +} + +UsdValidatorMetadataVector +UsdValidationRegistry::GetValidatorMetadataForPlugins( + const TfTokenVector &pluginNames) const +{ + // Since the _pluginNameToValidatorNames is created during registry + // initialization this method is inherently thread safe, as + // _pluginNameToValidatorNames is already populated and never updated. + return _GetValidatorMetadataForToken(_pluginNameToValidatorNames, + pluginNames); +} + +UsdValidatorMetadataVector +UsdValidationRegistry::GetValidatorMetadataForKeywords( + const TfTokenVector &keywords) const +{ + std::shared_lock lock(_mutex); + return _GetValidatorMetadataForToken(_keywordToValidatorNames, keywords); +} + +UsdValidatorMetadataVector +UsdValidationRegistry::GetValidatorMetadataForSchemaTypes( + const TfTokenVector &schemaTypes) const +{ + std::shared_lock lock(_mutex); + return _GetValidatorMetadataForToken(_schemaTypeToValidatorNames, + schemaTypes); +} + +UsdValidatorMetadataVector +UsdValidationRegistry::_GetValidatorMetadataForToken( + const _TokenToValidatorNamesMap &tokenToValidatorNames, + const TfTokenVector &tokens) const +{ + UsdValidatorMetadataVector result; + for (const TfToken &token : tokens) { + const auto &itr = tokenToValidatorNames.find(token); + if (itr == tokenToValidatorNames.end()) { + continue; + } + std::shared_lock lock(_mutex); + for (const TfToken &validatorName : itr->second) { + // If we have a validatorName in tokenToValidatorNames, we + // must have a validatorMetadata for this validatorName, because + // that's how these are added in _AddValidatorMetadata + const auto &nameToMetadataItr = + _validatorNameToMetadata.find(validatorName); + TF_VERIFY(nameToMetadataItr != _validatorNameToMetadata.end()); + result.push_back(nameToMetadataItr->second); + } + } + return result; +} + +bool +UsdValidationRegistry::_AddValidatorMetadata( + const UsdValidatorMetadata &metadata) +{ + const bool didAddValidatorMetadata = [&]() + { + return _validatorNameToMetadata.emplace( + metadata.name, metadata).second; + }(); + + if (didAddValidatorMetadata) { + // Callers are required to hold a lock on `_mutex`, so + // _schemaTypeToValidatorNames and _keywordToValidatorNames are + // protected here. + _UpdateValidatorNamesMappings(_schemaTypeToValidatorNames, + metadata.name, metadata.schemaTypes); + _UpdateValidatorNamesMappings(_keywordToValidatorNames, + metadata.name, metadata.keywords); + } + return didAddValidatorMetadata; +} + +/* static */ +bool +UsdValidationRegistry::_CheckMetadata( + const UsdValidatorMetadata &metadata, + bool checkForPrimTask, + bool expectSuite) +{ + // return false if we are trying to register a validator which is + // associated with schemaTypes, and testing task is not + // UsdValidatePrimTaskFn! + if (!checkForPrimTask && !metadata.schemaTypes.empty()) { + TF_CODING_ERROR( + "Invalid metadata for ('%s') validator. Can not provide " + "schemaTypes metadata when registering a " + "UsdValidateLayerTaskFn or UsdValidateStageTaskFn validator.", + metadata.name.GetText()); + return false; + } + + // Return false if isSuite metadata is set, but we are dealing with a + // UsdValidator, similarly returns false if isSuite metadata is not set, but + // we are dealing with a UsdValidatorSuite. + if (metadata.isSuite != expectSuite) { + TF_CODING_ERROR( + "Invalid metadata for '%s' validator. Incompatible isSuite " + "metadata set. Expected '%d', but '%d' provided.", + metadata.name.GetText(), expectSuite, metadata.isSuite); + return false; + } + return true; +} + +/* static */ +void +UsdValidationRegistry::_UpdateValidatorNamesMappings( + _TokenToValidatorNamesMap &tokenMap, + const TfToken &validatorName, + const TfTokenVector &tokens) +{ + for (const TfToken &token : tokens) { + if (tokenMap.find(token) == tokenMap.end()) { + tokenMap.emplace(token, TfTokenVector{validatorName}); + } else { + // Since this method is only called from the + // _PopulateMetadataFromPlugInfo, its guaranteed that + // validatorNames will be unique in this vector. + tokenMap[token].push_back(validatorName); + } + } +} + +PXR_NAMESPACE_CLOSE_SCOPE diff --git a/pxr/usd/usd/validationRegistry.h b/pxr/usd/usd/validationRegistry.h new file mode 100644 index 0000000000..46739f0a66 --- /dev/null +++ b/pxr/usd/usd/validationRegistry.h @@ -0,0 +1,585 @@ +// +// Copyright 2024 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// +#ifndef PXR_USD_USD_VALIDATION_REGISTRY_H +#define PXR_USD_USD_VALIDATION_REGISTRY_H + +#include "pxr/pxr.h" +#include "pxr/usd/usd/api.h" +#include "pxr/usd/usd/validator.h" +#include "pxr/base/tf/singleton.h" + +#include +#include +#include + +/// \file + +PXR_NAMESPACE_OPEN_SCOPE + +/// \class UsdValidationRegistry +/// +/// UsdValidationRegistry manages and provides access to UsdValidator / +/// UsdValidatorSuite for USD Validation. +/// +/// UsdValidationRegistry is a singleton class, which serves as a central +/// registry to hold / own all validators and validatorSuites by their names. +/// Both Core USD and client-provided validators are registered with the +/// registry. Validators can be registered and retrieved dynamically, supporting +/// complex validation scenarios across different modules or plugins. +/// +/// Clients of USD can register validators either via plugin infrastructure, +/// which results in lazy loading of the validators, or explicitly register +/// validators in their code via appropriate APIs. +/// +/// As discussed in UsdValidator, validators are associated with +/// UsdValidateLayerTaskFn, UsdValidateStageTaskFn or UsdValidatePrimTaskFn, +/// which govern how a layer, stage or a prim needs to be validated. +/// UsdValidator / UsdValidatorSuite also have metadata, which can either be +/// provided in the plugInfo.json when registering the validators via plugin +/// mechanism, or by providing metadata field when registering validators. +/// +/// Example of registering a validator named "StageMetadataValidator" with +/// doc metadata using plufInfo.json: +/// +/// \code +/// { +/// "Plugins": [ +/// { +/// "Info": { +/// "Name": "usd" +/// "LibraryPath": "@PLUG_INFO_LIBRARY_PATH", +/// .... +/// .... +/// .... +/// "Validators": { +/// "keywords" : ["UsdCoreValidators"], +/// ... +/// "StageMetadataValidator": { +/// "doc": "Validates stage metadata." +/// }, +/// ... +/// ... +/// ... +/// } +/// } +/// } ] +/// } +/// \endcode +/// +/// The above example can then be registered in the plugin: +/// +/// ```cpp +/// TF_REGISTRY_FUNCTION(UsdValidationRegistry) +/// { +/// UsdValidationRegistry& registry = UsdValidationRegistry::GetInstance(); +/// const TfToken validatorName("usd:StageMetadataValidator"); +/// const UsdValidateStageTaskFn stageTaskFn = +/// [](const UsdStagePtr &usdStage) { +/// UsdValidationErrorVector errors; +/// if (!usdStage->GetDefaultPrim()) { +/// errors.emplace_back(UsdValidationErrorType::Error, +/// {UsdValidationErrorSite(usdStage, SdfPath("/"))}, +/// "Stage has missing or invalid defaultPrim."); +/// } +/// if (!usdStage->HasAuthoredMetadata( +/// UsdGeomTokens->metersPerUnit)) { +/// errors.emplace_back(UsdValidationErrorType::Error, +/// {UsdValidationErrorSite(usdStage, SdfPath("/"))}, +/// "Stage does not specify its linear scale in " +/// "metersPerUnit."); +/// } +/// if (!usdStage->HasAuthoredMetadata( +/// UsdGeomTokens->upAxis)) { +/// errors.emplace_back(UsdValidationErrorType::Error, +/// {UsdValidationErrorSite(usdStage, SdfPath("/"))}, +/// "Stage does not specify an upAxis."); +/// } +/// return errors; +/// }; +/// registry.RegisterValidator(validatorName, stageTaskFn); +/// } +/// ``` +/// +/// Clients can also register validators by explicitly providing +/// UsdValidatorMetadata, instead of relying on plugInfo.json for the same. +/// Though its recommended to use appropriate APIs when validator metadata is +/// being provided in the plugInfo.json. +/// +/// Example of validator registration by explicitly providing metadata, when its +/// not available in the plugInfo.json: +/// +/// ```cpp +/// { +/// UsdValidationRegistry& registry = UsdValidationRegistry::GetInstance(); +/// const UsdValidatorMetadata &metadata = GetMetadataToBeRegistered(); +/// const UsdValidateLayerTaskFn &layerTask = GetLayerTaskForValidator(); +/// registry.RegisterValidator(metadata, layerTask); +/// } +/// ``` +/// +/// Usage: +/// +/// As shown above, UsdValidator or UsdValidatorSuite can be registered using +/// specific metadata or names, and retrieved by their name. The registry also +/// provides functionality to check the existence of a validator / suite, load +/// validators / suites dynamically if they are not in the registry. +/// +/// Clients can also retrieve metadata for validators associated with a +/// specific plugin, keywords or schemaTypes, this can help clients filter out +/// relevant validators they need to validate their context / scene. +/// +/// Note that this class is designed to be thread-safe: +/// Querying of validator metadata, registering new validator (hence mutating +/// the registry) or retrieving previously registered validator are designed to +/// be thread-safe. +/// +/// \sa UsdValidator +/// \sa UsdValidatorSuite +class UsdValidationRegistry +{ + UsdValidationRegistry(const UsdValidationRegistry&) = delete; + UsdValidationRegistry& operator=(const UsdValidationRegistry&) = delete; +public: + USD_API + static UsdValidationRegistry& GetInstance() { + return TfSingleton::GetInstance(); + } + + /// Register UsdValidator defined in a plugin using \p validatorName and + /// \p layerTaskFn with the UsdValidationRegistry. + /// + /// Here \p validatorName should include the name of the plugin the + /// validator belongs to, delimited by ":". + /// + /// Note calling RegisterPluginValidator with a validatorName which is + /// already registered will result in a coding error. HasValidator can be + /// used to determine if a validator is already registered and associated + /// with validatorName. + /// + /// Also note any other failure to register a validator results in a coding + /// error. + /// + /// \sa HasValidator + USD_API + void RegisterPluginValidator(const TfToken &validatorName, + const UsdValidateLayerTaskFn &layerTaskFn); + + /// Register UsdValidator defined in a plugin using \p validatorName and + /// \p stageTaskFn with the UsdValidationRegistry. + /// + /// Here \p validatorName should include the name of the plugin the + /// validator belongs to, delimited by ":". + /// + /// Note calling RegisterPluginValidator with a validatorName which is + /// already registered will result in a coding error. HasValidator can be + /// used to determine if a validator is already registered and associated + /// with validatorName. + /// + /// Also note any other failure to register a validator results in a coding + /// error. + /// + /// \sa HasValidator + USD_API + void RegisterPluginValidator(const TfToken &validatorName, + const UsdValidateStageTaskFn &stageTaskFn); + + /// Register UsdValidator defined in a plugin using \p validatorName and + /// \p primTaskFn with the UsdValidationRegistry. + /// + /// Here \p validatorName should include the name of the plugin the + /// validator belongs to, delimited by ":". + /// + /// Note calling RegisterPluginValidator with a validatorName which is + /// already registered will result in a coding error. HasValidator can be + /// used to determine if a validator is already registered and associated + /// with validatorName. + /// + /// Also note any other failure to register a validator results in a coding + /// error. + /// + /// \sa HasValidator + USD_API + void RegisterPluginValidator(const TfToken &validatorName, + const UsdValidatePrimTaskFn &primTaskFn); + + /// Register UsdValidator using \p metadata and \p layerTaskFn + /// with the UsdValidationRegistry. + /// + /// Clients can explicitly provide validator metadata, which is then used to + /// register a validator and associate it with name metadata. The metadata + /// here is not specified in a plugInfo. + /// + /// Note calling RegisterValidator with a validator name which is already + /// registered will result in a coding error. HasValidator can be used to + /// determine if a validator is already registered and associated with + /// validatorName. + /// + /// Also note any other failure to register a validator results in a coding + /// error. + /// + /// \sa HasValidator + USD_API + void RegisterValidator(const UsdValidatorMetadata &metadata, + const UsdValidateLayerTaskFn &layerTaskFn); + + /// Register UsdValidator using \p metadata and \p stageTaskFn + /// with the UsdValidationRegistry. + /// + /// Clients can explicitly provide validator metadata, which is then used to + /// register a validator and associate it with name metadata. The metadata + /// here is not specified in a plugInfo. + /// + /// Note calling RegisterValidator with a validator name which is already + /// registered will result in a coding error. HasValidator can be used to + /// determine if a validator is already registered and associated with + /// validatorName. + /// + /// Also note any other failure to register a validator results in a coding + /// error. + /// + /// \sa HasValidator + USD_API + void RegisterValidator(const UsdValidatorMetadata &metadata, + const UsdValidateStageTaskFn &stageTaskFn); + + /// Register UsdValidator using \p metadata and \p primTaskFn + /// with the UsdValidationRegistry. + /// + /// Clients can explicitly provide validator metadata, which is then used to + /// register a validator and associate it with name metadata. The metadata + /// here is not specified in a plugInfo. + /// + /// Note calling RegisterValidator with a validator name which is already + /// registered will result in a coding error. HasValidator can be used to + /// determine if a validator is already registered and associated with + /// validatorName. + /// + /// Also note any other failure to register a validator results in a coding + /// error. + /// + /// \sa HasValidator + USD_API + void RegisterValidator(const UsdValidatorMetadata &metadata, + const UsdValidatePrimTaskFn &primTaskFn); + + /// Register UsdValidatorSuite defined in a plugin using + /// \p validatorSuiteName and \p containedValidators with the + /// UsdValidationRegistry. + /// + /// Here \p validatorSuiteName should include the name of the plugin the + /// validator belongs to, delimited by ":". + /// + /// Note UsdValidatorMetadata::isSuite must be set to true in the plugInfo, + /// else the validatorSuite will not be registered. + /// + /// Note calling RegisterPluginValidatorSuite with a validatorSuiteName + /// which is already registered will result in a coding error. + /// HasValidatorSuite can be used to determine if a validator is already + /// registered and associated with validatorName. + /// + /// Also note any other failure to register a validator results in a coding + /// error. + /// + /// \sa HasValidatorSuite + USD_API + void RegisterPluginValidatorSuite(const TfToken &validatorSuiteName, + const std::vector& + containedValidators); + + /// Register UsdValidatorSuite using \p metadata and + /// \p containedValidators with the UsdValidationRegistry. + /// + /// Clients can explicitly provide validator metadata, which is then used to + /// register a suite and associate it with name metadata. The metadata + /// here is not specified in a plugInfo. + /// + /// Note UsdValidatorMetadata::isSuite must be set to true in the plugInfo, + /// else the validatorSuite will not be registered. + /// + /// Note calling RegisterPluginValidatorSuite with a validatorSuiteName + /// which is already registered will result in a coding error. + /// HasValidatorSuite can be used to determine if a validator is already + /// registered and associated with validatorName. + /// + /// Also note any other failure to register a validator results in a coding + /// error. + /// + /// \sa HasValidatorSuite + USD_API + void RegisterValidatorSuite(const UsdValidatorMetadata &metadata, + const std::vector& + containedValidators); + + /// Return true if a UsdValidator is registered with the name \p + /// validatorName; false otherwise. + bool HasValidator(const TfToken &validatorName) const; + + /// Return true if a UsdValidatorSuite is registered with the name \p + /// validatorSuiteName; false otherwise. + bool HasValidatorSuite(const TfToken &suiteName) const; + + /// Returns a vector of const pointer to UsdValidator corresponding to all + /// validators registered in the UsdValidationRegistry. + /// + /// If a validator is not found in the registry, this method will load + /// appropriate plugins, if the validator is made available via a plugin. + /// + /// Note that this call will load in many plugins which provide a + /// UsdValidator, if not already loaded. Also note that returned validators + /// will only include validators defined in plugins or any explicitly + /// registered validators before this call. + USD_API + std::vector GetOrLoadAllValidators(); + + /// Returns a const pointer to UsdValidator if \p validatorName is found in + /// the registry. + /// + /// If a validator is not found in the registry, this method will load + /// appropriate plugins, if the validator is made available via a plugin. + /// + /// Returns a nullptr if no validator is found. + USD_API + const UsdValidator* GetOrLoadValidatorByName(const TfToken &validatorName); + + /// Returns a vector of const pointer to UsdValidator corresponding to + /// \p validatorNames found in the registry. + /// + /// If a validator is not found in the registry, this method will load + /// appropriate plugins, if the validator is made available via a plugin. + /// + /// Size of returned vector might be less than the size of the input + /// validatorNames, in case of missing validators. + USD_API + std::vector + GetOrLoadValidatorsByName(const TfTokenVector &validatorNames); + + /// Returns a vector of const pointer to UsdValidatorSuite corresponding to + /// all validator suites registered in the UsdValidationRegistry. + /// + /// If a suite is not found in the registry, this method will load + /// appropriate plugins, if the suite is made available via a plugin. + /// + /// Note that this call might load in many plugins which provide a + /// UsdValidatorSuite, if not already loaded. Also note that returned suites + /// will only include suites defined in plugins or any explicitly registered + /// suites before this call. + USD_API + std::vector GetOrLoadAllValidatorSuites(); + + /// Returns a const pointer to UsdValidatorSuite if \p suiteName + /// is found in the registry. + /// + /// If a suite is not found in the registry, this method will load + /// appropriate plugins, if the suite is made available via a plugin. + /// + /// Returns a nullptr if no validator is found. + USD_API + const UsdValidatorSuite* GetOrLoadValidatorSuiteByName( + const TfToken &suiteName); + + /// Returns a vector of const pointer to UsdValidatorSuite corresponding to + /// \p suiteNames found in the registry. + /// + /// If a suite is not found in the registry, this method will load + /// appropriate plugins, if the suite is made available via a plugin. + /// + /// Size of returned vector might be less than the size of the input + /// suiteNames, in case of missing validators. + USD_API + std::vector + GetOrLoadValidatorSuitesByName(const TfTokenVector &suiteNames); + + /// Returns true if metadata is found in the _validatorNameToMetadata for + /// a validator/suite name, false otherwise. + /// + /// \p metadata parameter is used as an out parameter here. + USD_API + bool GetValidatorMetadata(const TfToken &name, + UsdValidatorMetadata *metadata) const; + + /// Return vector of all UsdValidatorMetadata known to the registry + USD_API + UsdValidatorMetadataVector GetAllValidatorMetadata() const; + + /// Returns vector of UsdValidatorMetadata associated with the Validators + /// which belong to the \p pluginName. + /// + /// This API can be used to curate a vector of validator metadata, that + /// clients may want to load and use in their validation context. + /// + /// Note that this method does not result in any plugins to be loaded. + USD_API + UsdValidatorMetadataVector GetValidatorMetadataForPlugin( + const TfToken &pluginName) const; + + /// Returns vector of UsdValidatorMetadata associated with the Validators + /// which has the \p keyword. + /// + /// This API can be used to curate a vector of validator metadata, that + /// clients may want to load and use in their validation context. + /// + /// Note that this method does not result in any plugins to be loaded. + USD_API + UsdValidatorMetadataVector GetValidatorMetadataForKeyword( + const TfToken &keyword) const; + + /// Returns vector of UsdValidatorMetadata associated with the Validators + /// which has the \p schemaType. + /// + /// This API can be used to curate a vector of validator metadata, that + /// clients may want to load and use in their validation context. + /// + /// Note that this method does not result in any plugins to be loaded. + USD_API + UsdValidatorMetadataVector GetValidatorMetadataForSchemaType( + const TfToken &schemaType) const; + + /// Returns vector of UsdValidatorMetadata associated with the Validators + /// which belong to the \p pluginNames. + /// + /// The returned vector is a union of all UsdValidatorMetadata associated + /// with the plugins. + /// + /// This API can be used to curate a vector of validator metadata, that + /// clients may want to load and use in their validation context. + /// + /// Note that this method does not result in any plugins to be loaded. + USD_API + UsdValidatorMetadataVector GetValidatorMetadataForPlugins( + const TfTokenVector &pluginNames) const; + + /// Returns vector of UsdValidatorMetadata associated with the Validators + /// which has at least one of the \p keywords. + /// + /// The returned vector is a union of all UsdValidatorMetadata associated + /// with the keywords. + /// + /// This API can be used to curate a vector of validator metadata, that + /// clients may want to load and use in their validation context. + /// + /// Note that this method does not result in any plugins to be loaded. + USD_API + UsdValidatorMetadataVector GetValidatorMetadataForKeywords( + const TfTokenVector &keywords) const; + + /// Returns vector of UsdValidatorMetadata associated with the Validators + /// which has at least one of the \p schameTypes. + /// + /// The returned vector is a union of all UsdValidatorMetadata associated + /// with the schemaTypes. + /// + /// This API can be used to curate a vector of validator metadata, that + /// clients may want to load and use in their validation context. + /// + /// Note that this method does not result in any plugins to be loaded. + USD_API + UsdValidatorMetadataVector GetValidatorMetadataForSchemaTypes( + const TfTokenVector &schemaTypes) const; + +private: + friend class TfSingleton; + + UsdValidationRegistry(); + + // Initialize _validatorNameToMetadata, _keywordToValidatorNames and + // _schemaTypeToValidatorNames by parsing all plugInfo.json, find all + // Validators. + void _PopulateMetadataFromPlugInfo(); + + // Templated method to register validator, called by appropriate + // RegisterValidator methods, providing UsdValidateLayerTaskFn, + // UsdValidateStageTaskFn or UsdValidatePrimTaskFn. + template + void _RegisterPluginValidator(const TfToken &validatorName, + const ValidateTaskFn &taskFn); + + // Overloaded templated _RegisterValidator, where metadata is explicitly + // provided. + template + void _RegisterValidator(const UsdValidatorMetadata &metadata, + const ValidateTaskFn &taskFn, bool addMetadata = true); + + void _RegisterValidatorSuite(const UsdValidatorMetadata &metadata, + const std::vector& containedValidators, + bool addMetadata = true); + + // makes sure metadata provided is legal + // checkForPrimTask parameter is used to determine if schemaTypes metadata + // is provided and if the task being registered for the validator is + // UsdValidatePrimTaskFn. + // expectSuite parameter is used to determine if the isSuite metadata is + // appropriately set (for UsdValidatorSuite) or not (for UsdValidator). + static + bool _CheckMetadata(const UsdValidatorMetadata &metadata, + bool checkForPrimTask, bool expectSuite = false); + + // Add validator metadata to _validatorNameToMetadata, also updates + // _schemaTypeToValidatorNames and _keywordToValidatorNames, for easy access + // to what validators are linked to specific schemaTypes or keywords. + // _mutex must be acquired before calling this method. + bool _AddValidatorMetadata(const UsdValidatorMetadata &metadata); + + using _ValidatorNameToValidatorMap = + std::unordered_map, + TfToken::HashFunctor>; + using _ValidatorSuiteNameToValidatorSuiteMap = + std::unordered_map, + TfToken::HashFunctor>; + using _ValidatorNameToMetadataMap = + std::unordered_map; + using _TokenToValidatorNamesMap = + std::unordered_map; + + // Helper to query + UsdValidatorMetadataVector _GetValidatorMetadataForToken( + const _TokenToValidatorNamesMap &tokenToValidatorNames, + const TfTokenVector &tokens) const; + + // Helper to populate _keywordToValidatorNames and + // _schemaTypeToValidatorNames + // _mutex must be acquired before calling this method. + static + void _UpdateValidatorNamesMappings(_TokenToValidatorNamesMap &tokenMap, + const TfToken &validatorName, const TfTokenVector &tokens); + + // Main datastructure which holds validatorName to + // std::unique_ptr + _ValidatorNameToValidatorMap _validators; + // Main datastructure which holds suiteName to + // std::unique_ptr + _ValidatorSuiteNameToValidatorSuiteMap _validatorSuites; + + // ValidatorName to ValidatorMetadata map + _ValidatorNameToMetadataMap _validatorNameToMetadata; + + // Following 3 are helper data structures to easy lookup for Validators, + // when queried for keywords, schemaType or pluginName. + + // This map stores the mapping from keyword to validator names. It may get + // updated as validators can be registered dynamically outside of the plugin + // infrastructure. + _TokenToValidatorNamesMap _keywordToValidatorNames; + + // This map stores the mapping from schemaTypes to validator names. It may + // get updated as validators can be registered dynamically outside of the + // plugin infrastructure. + _TokenToValidatorNamesMap _schemaTypeToValidatorNames; + + // This map stores the mapping from plugin names to validator names. + // It is populated during the initialization of UsdValidationRegistry + // and remains constant thereafter. + _TokenToValidatorNamesMap _pluginNameToValidatorNames; + + // Mutex to protect access to all data members. + mutable std::shared_mutex _mutex; +}; + +USD_API_TEMPLATE_CLASS(TfSingleton); + +PXR_NAMESPACE_CLOSE_SCOPE + +#endif // PXR_USD_USD_VALIDATION_REGISTRY_H diff --git a/pxr/usd/usd/validator.cpp b/pxr/usd/usd/validator.cpp new file mode 100644 index 0000000000..e70b48c49d --- /dev/null +++ b/pxr/usd/usd/validator.cpp @@ -0,0 +1,103 @@ +// +// Copyright 2024 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// + +#include "pxr/usd/usd/validator.h" +#include "pxr/usd/usd/validationError.h" + +PXR_NAMESPACE_OPEN_SCOPE + +UsdValidator::UsdValidator(const UsdValidatorMetadata& metadata) : + _metadata(metadata) +{ +} + +UsdValidator::UsdValidator(const UsdValidatorMetadata& metadata, + const UsdValidateLayerTaskFn& validateLayerTaskFn) : + _metadata(metadata), _validateTaskFn(validateLayerTaskFn) +{ +} + +UsdValidator::UsdValidator(const UsdValidatorMetadata& metadata, + const UsdValidateStageTaskFn& validateStageTaskFn) : + _metadata(metadata), _validateTaskFn(validateStageTaskFn) +{ +} + +UsdValidator::UsdValidator(const UsdValidatorMetadata& metadata, + const UsdValidatePrimTaskFn& validatePrimTaskFn) : + _metadata(metadata), _validateTaskFn(validatePrimTaskFn) +{ +} + +const UsdValidateLayerTaskFn* +UsdValidator::_GetValidateLayerTask() const +{ + return std::get_if(&_validateTaskFn); +} + +const UsdValidateStageTaskFn* +UsdValidator::_GetValidateStageTask() const +{ + return std::get_if(&_validateTaskFn); +} + +const UsdValidatePrimTaskFn* +UsdValidator::_GetValidatePrimTask() const +{ + return std::get_if(&_validateTaskFn); +} + +UsdValidationErrorVector +UsdValidator::Validate(const SdfLayerHandle &layer) const +{ + const UsdValidateLayerTaskFn *layerTaskFn = _GetValidateLayerTask(); + if (layerTaskFn) { + UsdValidationErrorVector errors = (*layerTaskFn)(layer); + for (UsdValidationError &error : errors) { + error._SetValidator(this); + } + return errors; + } + return {}; +} + +UsdValidationErrorVector +UsdValidator::Validate(const UsdStagePtr &usdStage) const +{ + const UsdValidateStageTaskFn *stageTaskFn = _GetValidateStageTask(); + if (stageTaskFn) { + UsdValidationErrorVector errors = (*stageTaskFn)(usdStage); + for (UsdValidationError &error : errors) { + error._SetValidator(this); + } + return errors; + } + return {}; +} + +UsdValidationErrorVector +UsdValidator::Validate(const UsdPrim &usdPrim) const +{ + const UsdValidatePrimTaskFn *primTaskFn = _GetValidatePrimTask(); + if (primTaskFn) { + UsdValidationErrorVector errors = (*primTaskFn)(usdPrim); + for (UsdValidationError &error : errors) { + error._SetValidator(this); + } + return errors; + } + return {}; +} + +UsdValidatorSuite::UsdValidatorSuite(const UsdValidatorMetadata& metadata, + const std::vector& validators) : + _metadata(metadata), _containedValidators(validators) +{ +} + +PXR_NAMESPACE_CLOSE_SCOPE + diff --git a/pxr/usd/usd/validator.h b/pxr/usd/usd/validator.h new file mode 100644 index 0000000000..921c6a4e23 --- /dev/null +++ b/pxr/usd/usd/validator.h @@ -0,0 +1,268 @@ +// +// Copyright 2024 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// +#ifndef PXR_USD_USD_VALIDATOR_H +#define PXR_USD_USD_VALIDATOR_H + +/// \file + +#include "pxr/pxr.h" +#include "pxr/base/tf/token.h" +#include "pxr/usd/usd/api.h" +#include "pxr/usd/usd/stage.h" + +#include +#include +#include + +PXR_NAMESPACE_OPEN_SCOPE + +class UsdValidationError; +using UsdValidationErrorVector = std::vector; +class UsdPrim; + +/// \class UsdValidatorMetadata +/// +/// A structure which describes metadata for a UsdValidator. +/// +/// The metadata values are populated from the plugInfo.json associated with a +/// validator's plugin. PlugInfo can provide the following validator metadata: +/// +/// - name: A required field. This metadatum stores the validator name. For +/// validators defined in a plugin, the name must be a fully qualified name +/// which includes the pluginName as well, separated by ":". This ensures, +/// plugin provided validator names are guaranteed to be unique. +/// - pluginPtr: Pointer to the plugin where a plugin based validator is defined. +/// nullptr for a non-plugin based validator. +/// - keywords: Keywords associated with this validator. +/// - doc: Doc string explaining the purpose of the validator. +/// - schemaTypes: If the validator is associated with specific schemaTypes. +/// - isSuite: If the validator represents a suite of validators. +/// +struct UsdValidatorMetadata +{ + /// Name of the validator. + /// + /// For plugin provided validators, this is prefixed with the pluginName, + /// like "pluginName:testName" in order to uniquely identify these plugin + /// provided validators. + /// + /// This is a mandatory field for a ValidatorMetadata. + TfToken name; + + /// Pointer to the plugin to which a plugin based validator belongs. + /// + /// For non-plugin based validator, pluginPtr is nullptr. + PlugPluginPtr pluginPtr; + + /// list of keywords extracted for this test from the plugInfo.json + TfTokenVector keywords; + + /// doc string extracted from plugInfo.json + /// This is a mandatory field for a ValidatorMetadata. + std::string doc; + + /// list of schemaTypes names this test applies to, extracted from + /// plugInfo.json + TfTokenVector schemaTypes; + + /// whether this test represents a test suite or not + bool isSuite; +}; // UsdValidatorMetadata + +using UsdValidatorMetadataVector = std::vector; + +// TODO: +// - TimeCode (Range), leaving right now for brevity. Will introduce in +// subsequent iterations. +// +// + +/// \defgroup UsdValidateTaskFn_group Validating Task Functions +/// +/// UsdValidateLayerTaskFn, UsdValidateStageTaskFn and UsdValidatePrimTaskFn +/// represent the callbacks associated with each validator's validation logic. +/// +/// Clients must provide implementation for these in their respective plugin +/// registration code. +/// @{ + +/// UsdValidateLayerTaskFn: Validation logic operating on a given SdfLayerHandle +using UsdValidateLayerTaskFn = std::function; +/// UsdValidateStageTaskFn: Validation logic operating on a given UsdStage +using UsdValidateStageTaskFn = std::function; +/// UsdValidatePrimTaskFn: Validation logic operating on a given UsdPrim +using UsdValidatePrimTaskFn = std::function; + +/// @} + +/// \class UsdValidator +/// +/// UsdValidator is a class describing a single test. +/// +/// An instance of UsdValidator is created when plugins are loaded and tests are +/// registered and cached in the UsdValidationRegistry. UsdValidator can +/// consist of any one of the 3 testing tasks: LayerTestingTask, +/// StageTestingTask or PrimTestingTask, which correspond to testing the given +/// SdfLayer, an entire UsdStage or a UsdPrim respectively. UsdValidator +/// instances are immutable and non-copyable. +/// +class UsdValidator +{ +public: + /// Instantiate a UsdValidator which has no validation logic implementation. + /// This is primarily used by UsdValidatorSuite. + USD_API + explicit UsdValidator(const UsdValidatorMetadata &metadata); + + UsdValidator(const UsdValidator &other) = delete; + UsdValidator &operator=(const UsdValidator&) = delete; + + UsdValidator(UsdValidator &&other) noexcept = default; + UsdValidator& operator=(UsdValidator&&) noexcept = default; + + /// Instantiate a UsdValidator which has its validation logic implemented by + /// a UsdValidateLayerTaskFn. + USD_API + UsdValidator(const UsdValidatorMetadata &metadata, + const UsdValidateLayerTaskFn &validateLayerTaskFn); + + /// Instantiate a UsdValidator which has its validation logic implemented by + /// a UsdValidateStageTaskFn. + USD_API + UsdValidator(const UsdValidatorMetadata &metadata, + const UsdValidateStageTaskFn &validateStageTaskFn); + + /// Instantiate a UsdValidator which has its validation logic implemented by + /// a UsdValidatePrimTaskFn. + USD_API + UsdValidator(const UsdValidatorMetadata &metadata, + const UsdValidatePrimTaskFn &validatePrimTaskFn); + + /// Return metadata associated with this Validator. + const UsdValidatorMetadata& GetMetadata() const & + { + return _metadata; + } + + /// Return metadata associated with this validator by-value. + UsdValidatorMetadata GetMetadata() && + { + return std::move(_metadata); + } + + /// Run validation on the given \p layer by executing the contained + /// validateTaskFn and returns UsdValidationErrorVector. + /// + /// If this Validator doesn't provide a UsdValidateLayerTaskFn, then an + /// empty vector is returned, which signifies no error. + USD_API + UsdValidationErrorVector Validate(const SdfLayerHandle &layer) const; + + /// Run validation on the given \p usdStage by executing the contained + /// validateTaskFn and returns UsdValidationErrorVector. + /// + /// If this Validator doesn't provide a UsdValidateStageTaskFn, then an + /// empty vector is returned, which signifies no error. + USD_API + UsdValidationErrorVector Validate(const UsdStagePtr &usdStage) const; + + /// Run validation on the given \p usdPrim by executing the contained + /// validateTaskFn and returns UsdValidationErrorVector. + /// + /// If this Validator doesn't provide a UsdValidatePrimTaskFn, then an + /// empty vector is returned, which signifies no error. + USD_API + UsdValidationErrorVector Validate(const UsdPrim& usdPrim) const; + +private: + // To make sure registry can query task types on a validator. + // Registry needs access to _GetValidatorPrimTasks, in order to determine if + // the contained validators in a suite, which provides schemaTypes metadata + // are compliant. + friend class UsdValidationRegistry; + + UsdValidatorMetadata _metadata; + std::variant _validateTaskFn; + + // Return UsdValidateLayerTaskFn if provided by the validator, else a + // nullptr. + const UsdValidateLayerTaskFn* _GetValidateLayerTask() const; + + // Return UsdValidateStageTaskFn if provided by the validator, else a + // nullptr. + const UsdValidateStageTaskFn* _GetValidateStageTask() const; + + // Return UsdValidatePrimTaskFn if provided by the validator, else a + // nullptr. + const UsdValidatePrimTaskFn* _GetValidatePrimTask() const; + +}; // UsdValidator + +/// \class UsdValidatorSuite +/// +/// UsdValidatorSuite acts like a suite for a collection of tests, which +/// clients can use to bundle all tests relevant to test their concepts. +/// +/// If client failed to provide isSuite metadata for a UsdValidatorSuite +/// instance then the validatorSuite will not be registered, and client will +/// appropriately be warned. +class UsdValidatorSuite +{ +public: + /// Instantiate UsdValidatorSuite using \p metadata and a vector of \p + /// validators. + USD_API + UsdValidatorSuite(const UsdValidatorMetadata &metadata, + const std::vector& validators); + + UsdValidatorSuite(UsdValidatorSuite &&other) noexcept = default; + + UsdValidatorSuite& operator=(UsdValidatorSuite&&) noexcept = default; + + /// Returns a vector of const UsdValidator pointers, which make this + /// UsdValidatorSuite. Note that the validators are guaranteed to be valid, + /// since their lifetime is managed by the UsdValidationRegistry, which has + /// a higher scope than individual validators. + const std::vector& GetContainedValidators() const & + { + return _containedValidators; + } + + /// Returns a vector of const UsdValidator pointers, which make this + /// UsdValidatorSuite. Note that the validators are guaranteed to be valid, + /// since their lifetime is managed by the UsdValidationRegistry, which has + /// a higher scope than individual validators. + std::vector GetContainedValidators() && + { + return std::move(_containedValidators); + } + + /// Return metadata associated with this validator. + const UsdValidatorMetadata& GetMetadata() const & + { + return _metadata; + } + + /// Return metadata associated with this validator. + UsdValidatorMetadata GetMetadata() && + { + return std::move(_metadata); + } + +private: + UsdValidatorMetadata _metadata; + std::vector _containedValidators; +}; // UsdValidatorSuite + +PXR_NAMESPACE_CLOSE_SCOPE + +#endif // PXR_USD_USD_VALIDATOR_H diff --git a/pxr/usd/usd/validatorTokens.cpp b/pxr/usd/usd/validatorTokens.cpp new file mode 100644 index 0000000000..1a8bb9b70c --- /dev/null +++ b/pxr/usd/usd/validatorTokens.cpp @@ -0,0 +1,16 @@ +// +// Copyright 2024 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// + +#include "pxr/usd/usd/validatorTokens.h" + +PXR_NAMESPACE_OPEN_SCOPE + +TF_DEFINE_PUBLIC_TOKENS(UsdValidatorNameTokens, USD_VALIDATOR_NAMES_TOKENS); +TF_DEFINE_PUBLIC_TOKENS(UsdValidatorKeywordTokens, + USD_VALIDATOR_KEYWORD_TOKENS); + +PXR_NAMESPACE_CLOSE_SCOPE diff --git a/pxr/usd/usd/validatorTokens.h b/pxr/usd/usd/validatorTokens.h new file mode 100644 index 0000000000..edd43cdca7 --- /dev/null +++ b/pxr/usd/usd/validatorTokens.h @@ -0,0 +1,40 @@ +// +// Copyright 2024 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// + +#ifndef USD_VALIDATOR_TOKENS_H +#define USD_VALIDATOR_TOKENS_H + +/// \file usd/validatorTokens.h + +#include "pxr/pxr.h" +#include "pxr/usd/usd/api.h" +#include "pxr/base/tf/staticTokens.h" + +PXR_NAMESPACE_OPEN_SCOPE + +#define USD_VALIDATOR_NAME_TOKENS \ + ((compositionErrorTest, "usd:CompositionErrorTest")) + +#define USD_VALIDATOR_KEYWORD_TOKENS \ + (UsdCoreValidators) + +/// Tokens representing validator names. Note that for plugin provided +/// validators, the names must be prefixed by usd:, which is the name of +/// the usd plugin. +TF_DECLARE_PUBLIC_TOKENS(UsdValidatorNameTokens, USD_API, + USD_VALIDATOR_NAME_TOKENS); + +/// Tokens representing keywords associated with any validator in the usd +/// plugin. Cliends can use this to inspect validators contained within a +/// specific keywords, or use these to be added as keywords to any new +/// validator. +TF_DECLARE_PUBLIC_TOKENS(UsdValidatorKeywordTokens, USD_API, + USD_VALIDATOR_KEYWORD_TOKENS); + +PXR_NAMESPACE_CLOSE_SCOPE + +#endif diff --git a/pxr/usd/usd/valueUtils.cpp b/pxr/usd/usd/valueUtils.cpp index 6ca0f4d4ad..f34bf01850 100644 --- a/pxr/usd/usd/valueUtils.cpp +++ b/pxr/usd/usd/valueUtils.cpp @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usd/valueUtils.h" diff --git a/pxr/usd/usd/valueUtils.h b/pxr/usd/usd/valueUtils.h index 164f380641..62fcb90c39 100644 --- a/pxr/usd/usd/valueUtils.h +++ b/pxr/usd/usd/valueUtils.h @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_VALUE_UTILS_H #define PXR_USD_USD_VALUE_UTILS_H diff --git a/pxr/usd/usd/variantSets.cpp b/pxr/usd/usd/variantSets.cpp index a66646f6f4..027f0d008c 100644 --- a/pxr/usd/usd/variantSets.cpp +++ b/pxr/usd/usd/variantSets.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usd/variantSets.h" diff --git a/pxr/usd/usd/variantSets.h b/pxr/usd/usd/variantSets.h index 8cfe8aab20..e714433b7e 100644 --- a/pxr/usd/usd/variantSets.h +++ b/pxr/usd/usd/variantSets.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_VARIANT_SETS_H #define PXR_USD_USD_VARIANT_SETS_H diff --git a/pxr/usd/usd/wrapAPISchemaBase.cpp b/pxr/usd/usd/wrapAPISchemaBase.cpp index 5aabb2aa12..05e30a48d3 100644 --- a/pxr/usd/usd/wrapAPISchemaBase.cpp +++ b/pxr/usd/usd/wrapAPISchemaBase.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usd/apiSchemaBase.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usd/wrapAttribute.cpp b/pxr/usd/usd/wrapAttribute.cpp index 591b948630..09253fb342 100644 --- a/pxr/usd/usd/wrapAttribute.cpp +++ b/pxr/usd/usd/wrapAttribute.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usd/attribute.h" diff --git a/pxr/usd/usd/wrapAttributeQuery.cpp b/pxr/usd/usd/wrapAttributeQuery.cpp index a3dac7a0f0..cbb31c3c7d 100644 --- a/pxr/usd/usd/wrapAttributeQuery.cpp +++ b/pxr/usd/usd/wrapAttributeQuery.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usd/attributeQuery.h" diff --git a/pxr/usd/usd/wrapClipsAPI.cpp b/pxr/usd/usd/wrapClipsAPI.cpp index e66d5673cb..47918b334e 100644 --- a/pxr/usd/usd/wrapClipsAPI.cpp +++ b/pxr/usd/usd/wrapClipsAPI.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usd/clipsAPI.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usd/wrapCollectionAPI.cpp b/pxr/usd/usd/wrapCollectionAPI.cpp index 3eacfc7fff..5c328e111b 100644 --- a/pxr/usd/usd/wrapCollectionAPI.cpp +++ b/pxr/usd/usd/wrapCollectionAPI.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usd/collectionAPI.h" #include "pxr/usd/usd/schemaBase.h" @@ -284,6 +267,10 @@ WRAP_CUSTOM { (arg("prim"), arg("collectionName"))) .staticmethod("GetNamedCollectionPath") + .def("ResolveCompleteMembershipExpression", + (SdfPathExpression (This::*)() const) + &This::ResolveCompleteMembershipExpression) + .def("IsSchemaPropertyBaseName", &This::IsSchemaPropertyBaseName, arg("baseName")) .staticmethod("IsSchemaPropertyBaseName") diff --git a/pxr/usd/usd/wrapCollectionMembershipQuery.cpp b/pxr/usd/usd/wrapCollectionMembershipQuery.cpp index 6c0badb9c2..9d7c53f0f2 100644 --- a/pxr/usd/usd/wrapCollectionMembershipQuery.cpp +++ b/pxr/usd/usd/wrapCollectionMembershipQuery.cpp @@ -1,28 +1,12 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usd/collectionMembershipQuery.h" +#include "pxr/base/tf/pyContainerConversions.h" #include "pxr/base/tf/pyResultConversions.h" #include "pxr/usd/usd/object.h" @@ -49,6 +33,50 @@ static bool _WrapIsPathIncluded_2( return query.IsPathIncluded(path, parentExpansionRule); } +struct _PathExpansionRuleMapFromPython +{ + using RuleMap = Usd_CollectionMembershipQueryBase::PathExpansionRuleMap; + + _PathExpansionRuleMapFromPython() { + converter::registry::insert( + &convertible, &construct, type_id()); + } + + static PyObject *convert(PyObject *p, RuleMap *result) { + if (!PyDict_Check(p)) { + return nullptr; + } + Py_ssize_t pos = 0; + PyObject *pyKey = nullptr, *pyVal = nullptr; + while (PyDict_Next(p, &pos, &pyKey, &pyVal)) { + extract keyProxy(pyKey); + extract valProxy(pyVal); + if (!keyProxy.check() || !valProxy.check()) { + return nullptr; + } + object pVal(handle<>(borrowed(pyVal))); + if (result) { + (*result)[keyProxy()] = valProxy(); + } + } + return p; + } + + static void *convertible(PyObject *p) { + return convert(p, nullptr); + } + + static void construct(PyObject *source, + converter::rvalue_from_python_stage1_data *data) { + void *storage = ( + (converter::rvalue_from_python_storage*) + data)->storage.bytes; + new (storage) RuleMap; + data->convertible = storage; + convert(source, (RuleMap *)storage); + } +}; + } // anonymous namespace void @@ -66,6 +94,10 @@ wrapUsdCollectionMembershipQuery() arg("predicate")=UsdPrimDefaultPredicate), return_value_policy()); + def("ComputePathExpressionFromCollectionMembershipQueryRuleMap", + UsdComputePathExpressionFromCollectionMembershipQueryRuleMap, + arg("ruleMap")); + class_("UsdCollectionMembershipQuery") .def("IsPathIncluded", _WrapIsPathIncluded_1, arg("path")) .def("IsPathIncluded", _WrapIsPathIncluded_2, @@ -77,10 +109,18 @@ wrapUsdCollectionMembershipQuery() .def("GetIncludedCollections", &UsdCollectionMembershipQuery::GetIncludedCollections, return_value_policy()) + .def("UsesPathExpansionRuleMap", + &UsdCollectionMembershipQuery::UsesPathExpansionRuleMap) .def("__hash__", &UsdCollectionMembershipQuery::GetHash) .def(self == self) .def(self != self) ; + + // from-python conversion from PathExpansionRuleMap. + TfPyContainerConversions::from_python_tuple_pair< + Usd_CollectionMembershipQueryBase::PathExpansionRuleMap::value_type>(); + + _PathExpansionRuleMapFromPython(); } diff --git a/pxr/usd/usd/wrapCommon.cpp b/pxr/usd/usd/wrapCommon.cpp index b038b32ce1..76720529ff 100644 --- a/pxr/usd/usd/wrapCommon.cpp +++ b/pxr/usd/usd/wrapCommon.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usd/common.h" diff --git a/pxr/usd/usd/wrapCrateInfo.cpp b/pxr/usd/usd/wrapCrateInfo.cpp index c8133f8db1..34431a112e 100644 --- a/pxr/usd/usd/wrapCrateInfo.cpp +++ b/pxr/usd/usd/wrapCrateInfo.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usd/crateInfo.h" diff --git a/pxr/usd/usd/wrapEditContext.cpp b/pxr/usd/usd/wrapEditContext.cpp index cf36f7faf0..fca7237dc9 100644 --- a/pxr/usd/usd/wrapEditContext.cpp +++ b/pxr/usd/usd/wrapEditContext.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usd/editContext.h" diff --git a/pxr/usd/usd/wrapEditTarget.cpp b/pxr/usd/usd/wrapEditTarget.cpp index 5a4f35ae4c..d2d06e9fb0 100644 --- a/pxr/usd/usd/wrapEditTarget.cpp +++ b/pxr/usd/usd/wrapEditTarget.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usd/editTarget.h" diff --git a/pxr/usd/usd/wrapFlattenUtils.cpp b/pxr/usd/usd/wrapFlattenUtils.cpp index 4deb7b6230..16dca01482 100644 --- a/pxr/usd/usd/wrapFlattenUtils.cpp +++ b/pxr/usd/usd/wrapFlattenUtils.cpp @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/base/arch/pragmas.h" diff --git a/pxr/usd/usd/wrapInherits.cpp b/pxr/usd/usd/wrapInherits.cpp index 208b552dc3..cd1f0d7a5f 100644 --- a/pxr/usd/usd/wrapInherits.cpp +++ b/pxr/usd/usd/wrapInherits.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usd/inherits.h" diff --git a/pxr/usd/usd/wrapInterpolation.cpp b/pxr/usd/usd/wrapInterpolation.cpp index b02e18865a..f0943563fd 100644 --- a/pxr/usd/usd/wrapInterpolation.cpp +++ b/pxr/usd/usd/wrapInterpolation.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usd/interpolation.h" diff --git a/pxr/usd/usd/wrapModelAPI.cpp b/pxr/usd/usd/wrapModelAPI.cpp index e18af10a9e..2c5aa9e7d2 100644 --- a/pxr/usd/usd/wrapModelAPI.cpp +++ b/pxr/usd/usd/wrapModelAPI.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usd/modelAPI.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usd/wrapNamespaceEditor.cpp b/pxr/usd/usd/wrapNamespaceEditor.cpp index 6a6aa799ff..1eefc06511 100644 --- a/pxr/usd/usd/wrapNamespaceEditor.cpp +++ b/pxr/usd/usd/wrapNamespaceEditor.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usd/namespaceEditor.h" @@ -72,6 +55,7 @@ void wrapUsdNamespaceEditor() scope s = class_("NamespaceEditor", no_init) .def(init()) + .def(init()) .def("DeletePrimAtPath", &This::DeletePrimAtPath) .def("MovePrimAtPath", &This::MovePrimAtPath) @@ -100,4 +84,11 @@ void wrapUsdNamespaceEditor() .def("ApplyEdits", &This::ApplyEdits) .def("CanApplyEdits", &_CanApplyEdits) ; + + class_("EditOptions") + .def(init<>()) + .add_property("allowRelocatesAuthoring", + &This::EditOptions::allowRelocatesAuthoring, + &This::EditOptions::allowRelocatesAuthoring) + ; } diff --git a/pxr/usd/usd/wrapNotice.cpp b/pxr/usd/usd/wrapNotice.cpp index 70104dbcd9..39b439bebb 100644 --- a/pxr/usd/usd/wrapNotice.cpp +++ b/pxr/usd/usd/wrapNotice.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usd/notice.h" diff --git a/pxr/usd/usd/wrapObject.cpp b/pxr/usd/usd/wrapObject.cpp index 0102619bf9..08864bc352 100644 --- a/pxr/usd/usd/wrapObject.cpp +++ b/pxr/usd/usd/wrapObject.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usd/object.h" diff --git a/pxr/usd/usd/wrapPayloads.cpp b/pxr/usd/usd/wrapPayloads.cpp index 86feab3e6d..49d0d82fc7 100644 --- a/pxr/usd/usd/wrapPayloads.cpp +++ b/pxr/usd/usd/wrapPayloads.cpp @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usd/payloads.h" diff --git a/pxr/usd/usd/wrapPrim.cpp b/pxr/usd/usd/wrapPrim.cpp index 39983a6585..0f510c2ad0 100644 --- a/pxr/usd/usd/wrapPrim.cpp +++ b/pxr/usd/usd/wrapPrim.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usd/prim.h" diff --git a/pxr/usd/usd/wrapPrimCompositionQuery.cpp b/pxr/usd/usd/wrapPrimCompositionQuery.cpp index 2dbc0104c2..318fdec7d4 100644 --- a/pxr/usd/usd/wrapPrimCompositionQuery.cpp +++ b/pxr/usd/usd/wrapPrimCompositionQuery.cpp @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usd/primCompositionQuery.h" diff --git a/pxr/usd/usd/wrapPrimDefinition.cpp b/pxr/usd/usd/wrapPrimDefinition.cpp index 787b56cc9f..9d5d80ab50 100644 --- a/pxr/usd/usd/wrapPrimDefinition.cpp +++ b/pxr/usd/usd/wrapPrimDefinition.cpp @@ -1,25 +1,8 @@ // // Copyright 2020 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usd/primDefinition.h" diff --git a/pxr/usd/usd/wrapPrimFlags.cpp b/pxr/usd/usd/wrapPrimFlags.cpp index 7c0b3e9380..d5ed198c2a 100644 --- a/pxr/usd/usd/wrapPrimFlags.cpp +++ b/pxr/usd/usd/wrapPrimFlags.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/base/tf/hash.h" diff --git a/pxr/usd/usd/wrapPrimRange.cpp b/pxr/usd/usd/wrapPrimRange.cpp index e2e9a59030..e8136382b4 100644 --- a/pxr/usd/usd/wrapPrimRange.cpp +++ b/pxr/usd/usd/wrapPrimRange.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usd/primRange.h" diff --git a/pxr/usd/usd/wrapPrimTypeInfo.cpp b/pxr/usd/usd/wrapPrimTypeInfo.cpp index d5109ce4e1..7fae8e7ae3 100644 --- a/pxr/usd/usd/wrapPrimTypeInfo.cpp +++ b/pxr/usd/usd/wrapPrimTypeInfo.cpp @@ -1,25 +1,8 @@ // // Copyright 2020 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usd/primTypeInfo.h" diff --git a/pxr/usd/usd/wrapProperty.cpp b/pxr/usd/usd/wrapProperty.cpp index 2c3d8b9a87..543acde8f9 100644 --- a/pxr/usd/usd/wrapProperty.cpp +++ b/pxr/usd/usd/wrapProperty.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usd/property.h" diff --git a/pxr/usd/usd/wrapReferences.cpp b/pxr/usd/usd/wrapReferences.cpp index 433a131498..37df7c8619 100644 --- a/pxr/usd/usd/wrapReferences.cpp +++ b/pxr/usd/usd/wrapReferences.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usd/references.h" diff --git a/pxr/usd/usd/wrapRelationship.cpp b/pxr/usd/usd/wrapRelationship.cpp index 4c5e3ae227..78302c069e 100644 --- a/pxr/usd/usd/wrapRelationship.cpp +++ b/pxr/usd/usd/wrapRelationship.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usd/relationship.h" diff --git a/pxr/usd/usd/wrapResolveInfo.cpp b/pxr/usd/usd/wrapResolveInfo.cpp index 415c3dd7bf..bff9e4db4b 100644 --- a/pxr/usd/usd/wrapResolveInfo.cpp +++ b/pxr/usd/usd/wrapResolveInfo.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usd/resolveInfo.h" diff --git a/pxr/usd/usd/wrapResolveTarget.cpp b/pxr/usd/usd/wrapResolveTarget.cpp index 4e94e9d4d7..75aa92b0d8 100644 --- a/pxr/usd/usd/wrapResolveTarget.cpp +++ b/pxr/usd/usd/wrapResolveTarget.cpp @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usd/resolveTarget.h" diff --git a/pxr/usd/usd/wrapSchemaBase.cpp b/pxr/usd/usd/wrapSchemaBase.cpp index 19645ca1d9..713b36a74f 100644 --- a/pxr/usd/usd/wrapSchemaBase.cpp +++ b/pxr/usd/usd/wrapSchemaBase.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usd/wrapSchemaRegistry.cpp b/pxr/usd/usd/wrapSchemaRegistry.cpp index d8a5e01669..2444c0ab82 100644 --- a/pxr/usd/usd/wrapSchemaRegistry.cpp +++ b/pxr/usd/usd/wrapSchemaRegistry.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usd/wrapSpecializes.cpp b/pxr/usd/usd/wrapSpecializes.cpp index fe59e937e2..19450ef10f 100644 --- a/pxr/usd/usd/wrapSpecializes.cpp +++ b/pxr/usd/usd/wrapSpecializes.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usd/specializes.h" diff --git a/pxr/usd/usd/wrapStage.cpp b/pxr/usd/usd/wrapStage.cpp index 8ec54bdfa5..215746d3a8 100644 --- a/pxr/usd/usd/wrapStage.cpp +++ b/pxr/usd/usd/wrapStage.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usd/attribute.h" @@ -483,6 +466,8 @@ void wrapUsdStage() .def("GetPathResolverContext", &UsdStage::GetPathResolverContext) .def("ResolveIdentifierToEditTarget", &UsdStage::ResolveIdentifierToEditTarget, arg("identifier")) + .def("GetCompositionErrors", &UsdStage::GetCompositionErrors, + return_value_policy()) .def("GetLayerStack", &UsdStage::GetLayerStack, arg("includeSessionLayers")=true, return_value_policy()) diff --git a/pxr/usd/usd/wrapStageCache.cpp b/pxr/usd/usd/wrapStageCache.cpp index bae1a158d2..139278716c 100644 --- a/pxr/usd/usd/wrapStageCache.cpp +++ b/pxr/usd/usd/wrapStageCache.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usd/stageCache.h" diff --git a/pxr/usd/usd/wrapStageCacheContext.cpp b/pxr/usd/usd/wrapStageCacheContext.cpp index 47ede49a3c..33f16c5c44 100644 --- a/pxr/usd/usd/wrapStageCacheContext.cpp +++ b/pxr/usd/usd/wrapStageCacheContext.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usd/stageCacheContext.h" diff --git a/pxr/usd/usd/wrapStageLoadRules.cpp b/pxr/usd/usd/wrapStageLoadRules.cpp index a627b2c455..6fe5a2779b 100644 --- a/pxr/usd/usd/wrapStageLoadRules.cpp +++ b/pxr/usd/usd/wrapStageLoadRules.cpp @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include diff --git a/pxr/usd/usd/wrapStagePopulationMask.cpp b/pxr/usd/usd/wrapStagePopulationMask.cpp index b2765ad590..a75e903c68 100644 --- a/pxr/usd/usd/wrapStagePopulationMask.cpp +++ b/pxr/usd/usd/wrapStagePopulationMask.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include diff --git a/pxr/usd/usd/wrapTimeCode.cpp b/pxr/usd/usd/wrapTimeCode.cpp index 9332e05bea..4080655fc2 100644 --- a/pxr/usd/usd/wrapTimeCode.cpp +++ b/pxr/usd/usd/wrapTimeCode.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usd/timeCode.h" diff --git a/pxr/usd/usd/wrapTokens.cpp b/pxr/usd/usd/wrapTokens.cpp index 53e4f12d74..e0c405f861 100644 --- a/pxr/usd/usd/wrapTokens.cpp +++ b/pxr/usd/usd/wrapTokens.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // // GENERATED FILE. DO NOT EDIT. #include diff --git a/pxr/usd/usd/wrapTyped.cpp b/pxr/usd/usd/wrapTyped.cpp index 4e5f64cad5..b78a06cec7 100644 --- a/pxr/usd/usd/wrapTyped.cpp +++ b/pxr/usd/usd/wrapTyped.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usd/typed.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usd/wrapUsdFileFormat.cpp b/pxr/usd/usd/wrapUsdFileFormat.cpp index 1cb485aa71..affa0fe880 100644 --- a/pxr/usd/usd/wrapUsdFileFormat.cpp +++ b/pxr/usd/usd/wrapUsdFileFormat.cpp @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/usd/wrapUtils.cpp b/pxr/usd/usd/wrapUtils.cpp index aad721a747..06175dc4c7 100644 --- a/pxr/usd/usd/wrapUtils.cpp +++ b/pxr/usd/usd/wrapUtils.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usd/wrapUtils.h" diff --git a/pxr/usd/usd/wrapUtils.h b/pxr/usd/usd/wrapUtils.h index e12200c887..b2bed0da53 100644 --- a/pxr/usd/usd/wrapUtils.h +++ b/pxr/usd/usd/wrapUtils.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_WRAP_UTILS_H #define PXR_USD_USD_WRAP_UTILS_H diff --git a/pxr/usd/usd/wrapVariantSets.cpp b/pxr/usd/usd/wrapVariantSets.cpp index 2567e88199..2125b5e40e 100644 --- a/pxr/usd/usd/wrapVariantSets.cpp +++ b/pxr/usd/usd/wrapVariantSets.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usd/variantSets.h" diff --git a/pxr/usd/usd/wrapVersion.cpp b/pxr/usd/usd/wrapVersion.cpp index bdf207efdf..6393e6fd2c 100644 --- a/pxr/usd/usd/wrapVersion.cpp +++ b/pxr/usd/usd/wrapVersion.cpp @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/usd/wrapZipFile.cpp b/pxr/usd/usd/wrapZipFile.cpp index 1ccf930b48..425aea43fa 100644 --- a/pxr/usd/usd/wrapZipFile.cpp +++ b/pxr/usd/usd/wrapZipFile.cpp @@ -1,25 +1,8 @@ // // Copyright 2018 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/usd/zipFile.cpp b/pxr/usd/usd/zipFile.cpp index 2edff69165..6f616cc9a9 100644 --- a/pxr/usd/usd/zipFile.cpp +++ b/pxr/usd/usd/zipFile.cpp @@ -1,25 +1,8 @@ // // Copyright 2018 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usd/zipFile.h" diff --git a/pxr/usd/usd/zipFile.h b/pxr/usd/usd/zipFile.h index 5e56ccd49b..4356be7ecb 100644 --- a/pxr/usd/usd/zipFile.h +++ b/pxr/usd/usd/zipFile.h @@ -1,25 +1,8 @@ // // Copyright 2018 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_ZIP_FILE_H #define PXR_USD_USD_ZIP_FILE_H diff --git a/pxr/usd/usdGeom/__init__.py b/pxr/usd/usdGeom/__init__.py index 21792ee990..d830462be1 100644 --- a/pxr/usd/usdGeom/__init__.py +++ b/pxr/usd/usdGeom/__init__.py @@ -1,25 +1,8 @@ # # Copyright 2016 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # from pxr import Tf Tf.PreparePythonModule() diff --git a/pxr/usd/usdGeom/api.h b/pxr/usd/usdGeom/api.h index 7c13f813ee..c9f29e4e7f 100644 --- a/pxr/usd/usdGeom/api.h +++ b/pxr/usd/usdGeom/api.h @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDGEOM_API_H #define USDGEOM_API_H diff --git a/pxr/usd/usdGeom/basisCurves.cpp b/pxr/usd/usdGeom/basisCurves.cpp index a5f76c2250..01023132f5 100644 --- a/pxr/usd/usdGeom/basisCurves.cpp +++ b/pxr/usd/usdGeom/basisCurves.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdGeom/basisCurves.h" #include "pxr/usd/usd/schemaRegistry.h" @@ -349,4 +332,94 @@ UsdGeomBasisCurves::ComputeVertexDataSize( return _ComputeVertexDataSize(curveVertexCounts); } +VtIntArray +UsdGeomBasisCurves::ComputeSegmentCounts( + const UsdTimeCode& timeCode) const +{ + VtIntArray curveVertexCounts; + if (!GetCurveVertexCountsAttr().Get(&curveVertexCounts, timeCode)) { + TF_WARN("CurveVertexCounts could not be read from prim, " + "cannot compute segment counts."); + return VtIntArray(); + } + + TfToken type; + if (!GetTypeAttr().Get(&type, timeCode)) { + TF_WARN("Curve type could not be read from prim, " + "cannot compute segment counts."); + return VtIntArray(); + } + + TfToken wrap; + if (!GetWrapAttr().Get(&wrap, timeCode)) { + TF_WARN("Curve wrap could not be read from prim, " + "cannot compute segment counts."); + return VtIntArray(); + } + + TfToken basis; + if (!GetBasisAttr().Get(&basis, timeCode)) { + TF_WARN("Curve basis could not be read from prim, " + "cannot compute segment counts."); + return VtIntArray(); + } + + VtIntArray segmentCounts(curveVertexCounts.size()); + bool isValid = false; + + if (type == UsdGeomTokens->linear) { + if (wrap == UsdGeomTokens->periodic) { + // Linear and periodic + segmentCounts = curveVertexCounts; + isValid = true; + } else if (wrap == UsdGeomTokens->nonperiodic || + wrap == UsdGeomTokens->pinned) { + // Linear and nonperiodic/pinned + std::transform(curveVertexCounts.cbegin(), curveVertexCounts.cend(), + segmentCounts.begin(), [](int n) { return n - 1; }); + isValid = true; + } + } else if (type == UsdGeomTokens->cubic) { + if (basis == UsdGeomTokens->bezier) { + constexpr int vstep = 3; + if (wrap == UsdGeomTokens->periodic) { + // Cubic, bezier, periodic + std::transform(curveVertexCounts.cbegin(), curveVertexCounts.cend(), + segmentCounts.begin(), [vstep](int n) { return n / vstep; }); + isValid = true; + } else if (wrap == UsdGeomTokens->nonperiodic || + wrap == UsdGeomTokens->pinned) { + // Cubic, bezier, nonperiodic/pinned + std::transform(curveVertexCounts.cbegin(), curveVertexCounts.cend(), + segmentCounts.begin(), [vstep](int n) { return (n - 4) / vstep + 1; }); + isValid = true; + } + } else if (basis == UsdGeomTokens->bspline || + basis == UsdGeomTokens->catmullRom) { + if (wrap == UsdGeomTokens->periodic) { + // Cubic, bspline/catmullRom, periodic + segmentCounts = curveVertexCounts; + isValid = true; + } else if (wrap == UsdGeomTokens->nonperiodic) { + // Cubic, bspline/catmullRom, nonperiodic + std::transform(curveVertexCounts.cbegin(), curveVertexCounts.cend(), + segmentCounts.begin(), [](int n) { return n - 3; }); + isValid = true; + } else if (wrap == UsdGeomTokens->pinned) { + // Cubic, bspline/catmullRom, pinned + std::transform(curveVertexCounts.cbegin(), curveVertexCounts.cend(), + segmentCounts.begin(), [](int n) { return n - 1; }); + isValid = true; + } + } + } + + if (!isValid) { + TF_WARN("Invalid type, wrap, or basis."); + return VtIntArray(); + } + + return segmentCounts; +} + PXR_NAMESPACE_CLOSE_SCOPE diff --git a/pxr/usd/usdGeom/basisCurves.h b/pxr/usd/usdGeom/basisCurves.h index d9cc4dd6ca..14ffcea0db 100644 --- a/pxr/usd/usdGeom/basisCurves.h +++ b/pxr/usd/usdGeom/basisCurves.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDGEOM_GENERATED_BASISCURVES_H #define USDGEOM_GENERATED_BASISCURVES_H @@ -483,6 +466,11 @@ class UsdGeomBasisCurves : public UsdGeomCurves USDGEOM_API size_t ComputeVertexDataSize(const UsdTimeCode& timeCode) const; + /// Computes the segment counts of the curves based on their vertex counts + /// from the \c curveVertexCounts attribute. + USDGEOM_API + VtIntArray ComputeSegmentCounts(const UsdTimeCode& timeCode) const; + /// \} }; diff --git a/pxr/usd/usdGeom/bboxCache.cpp b/pxr/usd/usdGeom/bboxCache.cpp index 2e52ddaa4b..363e08e07f 100644 --- a/pxr/usd/usdGeom/bboxCache.cpp +++ b/pxr/usd/usdGeom/bboxCache.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usdGeom/bboxCache.h" @@ -46,6 +29,7 @@ #include #include +#include PXR_NAMESPACE_OPEN_SCOPE @@ -99,11 +83,11 @@ class UsdGeomBBoxCache::_BBoxTask { explicit operator bool() const { return _owner; } - void operator()() { + void operator()() const { // Do not save state here; all state should be accumulated externally. - _owner->_ResolvePrim(this, _primContext, _inverseComponentCtm); + _owner->_ResolvePrim(const_cast<_BBoxTask const *>(this), _primContext, _inverseComponentCtm); } - _ThreadXformCache* GetXformCaches() { return _xfCaches; } + _ThreadXformCache* GetXformCaches() const { return _xfCaches; } }; // -------------------------------------------------------------------------- // @@ -124,11 +108,24 @@ class UsdGeomBBoxCache::_PrototypeBBoxResolver struct _PrototypeTask { - _PrototypeTask() : numDependencies(0) { } + _PrototypeTask() + : numDependencies(0) { } + + _PrototypeTask(const _PrototypeTask &other) + : dependentPrototypes(other.dependentPrototypes) + { + numDependencies.store(other.numDependencies.load()); + } + + _PrototypeTask(_PrototypeTask &&other) + : dependentPrototypes(std::move(other.dependentPrototypes)) + { + numDependencies.store(other.numDependencies.load()); + } // Number of dependencies -- prototype prims that must be resolved // before this prototype can be resolved. - tbb::atomic numDependencies; + std::atomic numDependencies; // List of prototype prims that depend on this prototype. std::vector<_PrimContext> dependentPrototypes; @@ -220,7 +217,7 @@ class UsdGeomBBoxCache::_PrototypeBBoxResolver _PrototypeTask& dependentPrototypeData = prototypeTasks->find(dependentPrototype)->second; if (dependentPrototypeData.numDependencies - .fetch_and_decrement() == 1){ + .fetch_sub(1) == 1){ dispatcher->Run( &_PrototypeBBoxResolver::_ExecuteTaskForPrototype, this, dependentPrototype, prototypeTasks, xfCaches, @@ -1169,7 +1166,7 @@ UsdGeomBBoxCache::_GetBBoxFromExtentsHint( } void -UsdGeomBBoxCache::_ResolvePrim(_BBoxTask* task, +UsdGeomBBoxCache::_ResolvePrim(const _BBoxTask* task, const _PrimContext &primContext, const GfMatrix4d &inverseComponentCtm) { @@ -1525,4 +1522,3 @@ UsdGeomBBoxCache::_PrimContext::ToString() const { } PXR_NAMESPACE_CLOSE_SCOPE - diff --git a/pxr/usd/usdGeom/bboxCache.h b/pxr/usd/usdGeom/bboxCache.h index 1fef245c8a..a3d0e7957f 100644 --- a/pxr/usd/usdGeom/bboxCache.h +++ b/pxr/usd/usdGeom/bboxCache.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_GEOM_BBOX_CACHE_H #define PXR_USD_USD_GEOM_BBOX_CACHE_H @@ -470,7 +453,7 @@ class UsdGeomBBoxCache // // \p inverseComponentCtm is used to combine all the child bboxes in // component-relative space. - void _ResolvePrim(_BBoxTask* task, + void _ResolvePrim(const _BBoxTask* task, const _PrimContext& prim, const GfMatrix4d &inverseComponentCtm); diff --git a/pxr/usd/usdGeom/boundable.cpp b/pxr/usd/usdGeom/boundable.cpp index 7f029dd27d..f3ec8b085c 100644 --- a/pxr/usd/usdGeom/boundable.cpp +++ b/pxr/usd/usdGeom/boundable.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdGeom/boundable.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usdGeom/boundable.h b/pxr/usd/usdGeom/boundable.h index 3abbfe329b..74a07085c8 100644 --- a/pxr/usd/usdGeom/boundable.h +++ b/pxr/usd/usdGeom/boundable.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDGEOM_GENERATED_BOUNDABLE_H #define USDGEOM_GENERATED_BOUNDABLE_H diff --git a/pxr/usd/usdGeom/boundableComputeExtent.cpp b/pxr/usd/usdGeom/boundableComputeExtent.cpp index d30db5aac4..b6faddb864 100644 --- a/pxr/usd/usdGeom/boundableComputeExtent.cpp +++ b/pxr/usd/usdGeom/boundableComputeExtent.cpp @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/usdGeom/boundableComputeExtent.h b/pxr/usd/usdGeom/boundableComputeExtent.h index e0f6384b3e..4d80db5d0d 100644 --- a/pxr/usd/usdGeom/boundableComputeExtent.h +++ b/pxr/usd/usdGeom/boundableComputeExtent.h @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_GEOM_BOUNDABLE_COMPUTE_EXTENT_H #define PXR_USD_USD_GEOM_BOUNDABLE_COMPUTE_EXTENT_H diff --git a/pxr/usd/usdGeom/camera.cpp b/pxr/usd/usdGeom/camera.cpp index a5910e7cd0..643fafa25e 100644 --- a/pxr/usd/usdGeom/camera.cpp +++ b/pxr/usd/usdGeom/camera.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdGeom/camera.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usdGeom/camera.h b/pxr/usd/usdGeom/camera.h index 4835663ad7..e718a10b89 100644 --- a/pxr/usd/usdGeom/camera.h +++ b/pxr/usd/usdGeom/camera.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDGEOM_GENERATED_CAMERA_H #define USDGEOM_GENERATED_CAMERA_H diff --git a/pxr/usd/usdGeom/capsule.cpp b/pxr/usd/usdGeom/capsule.cpp index 1b639af573..79c3a39591 100644 --- a/pxr/usd/usdGeom/capsule.cpp +++ b/pxr/usd/usdGeom/capsule.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdGeom/capsule.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usdGeom/capsule.h b/pxr/usd/usdGeom/capsule.h index 12f93034d6..acd2b0a0ea 100644 --- a/pxr/usd/usdGeom/capsule.h +++ b/pxr/usd/usdGeom/capsule.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDGEOM_GENERATED_CAPSULE_H #define USDGEOM_GENERATED_CAPSULE_H diff --git a/pxr/usd/usdGeom/capsule_1.cpp b/pxr/usd/usdGeom/capsule_1.cpp index f649b879ba..2aeecce384 100644 --- a/pxr/usd/usdGeom/capsule_1.cpp +++ b/pxr/usd/usdGeom/capsule_1.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdGeom/capsule_1.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usdGeom/capsule_1.h b/pxr/usd/usdGeom/capsule_1.h index cb9226d145..e8dca3379d 100644 --- a/pxr/usd/usdGeom/capsule_1.h +++ b/pxr/usd/usdGeom/capsule_1.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDGEOM_GENERATED_CAPSULE_1_H #define USDGEOM_GENERATED_CAPSULE_1_H diff --git a/pxr/usd/usdGeom/cone.cpp b/pxr/usd/usdGeom/cone.cpp index 75449c3d25..befa596899 100644 --- a/pxr/usd/usdGeom/cone.cpp +++ b/pxr/usd/usdGeom/cone.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdGeom/cone.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usdGeom/cone.h b/pxr/usd/usdGeom/cone.h index bd7ebeacc2..967fe3fbdb 100644 --- a/pxr/usd/usdGeom/cone.h +++ b/pxr/usd/usdGeom/cone.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDGEOM_GENERATED_CONE_H #define USDGEOM_GENERATED_CONE_H diff --git a/pxr/usd/usdGeom/constraintTarget.cpp b/pxr/usd/usdGeom/constraintTarget.cpp index ad765bb39a..24388815a6 100644 --- a/pxr/usd/usdGeom/constraintTarget.cpp +++ b/pxr/usd/usdGeom/constraintTarget.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usdGeom/constraintTarget.h" diff --git a/pxr/usd/usdGeom/constraintTarget.h b/pxr/usd/usdGeom/constraintTarget.h index e04487f7a5..df0f52cbbc 100644 --- a/pxr/usd/usdGeom/constraintTarget.h +++ b/pxr/usd/usdGeom/constraintTarget.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_GEOM_CONSTRAINT_TARGET_H #define PXR_USD_USD_GEOM_CONSTRAINT_TARGET_H diff --git a/pxr/usd/usdGeom/cube.cpp b/pxr/usd/usdGeom/cube.cpp index bb58e355b4..37ddf72ec8 100644 --- a/pxr/usd/usdGeom/cube.cpp +++ b/pxr/usd/usdGeom/cube.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdGeom/cube.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usdGeom/cube.h b/pxr/usd/usdGeom/cube.h index c29f92b9e9..43abdd7b71 100644 --- a/pxr/usd/usdGeom/cube.h +++ b/pxr/usd/usdGeom/cube.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDGEOM_GENERATED_CUBE_H #define USDGEOM_GENERATED_CUBE_H diff --git a/pxr/usd/usdGeom/curves.cpp b/pxr/usd/usdGeom/curves.cpp index 03c615539b..0774a05b59 100644 --- a/pxr/usd/usdGeom/curves.cpp +++ b/pxr/usd/usdGeom/curves.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdGeom/curves.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usdGeom/curves.h b/pxr/usd/usdGeom/curves.h index 6be1687378..b10b15832b 100644 --- a/pxr/usd/usdGeom/curves.h +++ b/pxr/usd/usdGeom/curves.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDGEOM_GENERATED_CURVES_H #define USDGEOM_GENERATED_CURVES_H diff --git a/pxr/usd/usdGeom/cylinder.cpp b/pxr/usd/usdGeom/cylinder.cpp index c0b7d6b3bf..104d29cf05 100644 --- a/pxr/usd/usdGeom/cylinder.cpp +++ b/pxr/usd/usdGeom/cylinder.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdGeom/cylinder.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usdGeom/cylinder.h b/pxr/usd/usdGeom/cylinder.h index 345925402a..245eae10ee 100644 --- a/pxr/usd/usdGeom/cylinder.h +++ b/pxr/usd/usdGeom/cylinder.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDGEOM_GENERATED_CYLINDER_H #define USDGEOM_GENERATED_CYLINDER_H diff --git a/pxr/usd/usdGeom/cylinder_1.cpp b/pxr/usd/usdGeom/cylinder_1.cpp index 76364f3675..0626a2fc08 100644 --- a/pxr/usd/usdGeom/cylinder_1.cpp +++ b/pxr/usd/usdGeom/cylinder_1.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdGeom/cylinder_1.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usdGeom/cylinder_1.h b/pxr/usd/usdGeom/cylinder_1.h index 41c5ce189b..4cca3a7dab 100644 --- a/pxr/usd/usdGeom/cylinder_1.h +++ b/pxr/usd/usdGeom/cylinder_1.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDGEOM_GENERATED_CYLINDER_1_H #define USDGEOM_GENERATED_CYLINDER_1_H diff --git a/pxr/usd/usdGeom/debugCodes.cpp b/pxr/usd/usdGeom/debugCodes.cpp index cd15c12ca1..baaeb8304d 100644 --- a/pxr/usd/usdGeom/debugCodes.cpp +++ b/pxr/usd/usdGeom/debugCodes.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usdGeom/debugCodes.h" diff --git a/pxr/usd/usdGeom/debugCodes.h b/pxr/usd/usdGeom/debugCodes.h index 9c44f5e343..c5680f394c 100644 --- a/pxr/usd/usdGeom/debugCodes.h +++ b/pxr/usd/usdGeom/debugCodes.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_GEOM_DEBUG_CODES_H #define PXR_USD_USD_GEOM_DEBUG_CODES_H diff --git a/pxr/usd/usdGeom/examples_usdGeom.cpp b/pxr/usd/usdGeom/examples_usdGeom.cpp index eecad94b55..40813cbb00 100644 --- a/pxr/usd/usdGeom/examples_usdGeom.cpp +++ b/pxr/usd/usdGeom/examples_usdGeom.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usdGeom/xformable.h" diff --git a/pxr/usd/usdGeom/gprim.cpp b/pxr/usd/usdGeom/gprim.cpp index 1a5f1ffc8e..2596fdb229 100644 --- a/pxr/usd/usdGeom/gprim.cpp +++ b/pxr/usd/usdGeom/gprim.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdGeom/gprim.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usdGeom/gprim.h b/pxr/usd/usdGeom/gprim.h index 866dc30323..f96eb06dad 100644 --- a/pxr/usd/usdGeom/gprim.h +++ b/pxr/usd/usdGeom/gprim.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDGEOM_GENERATED_GPRIM_H #define USDGEOM_GENERATED_GPRIM_H diff --git a/pxr/usd/usdGeom/hermiteCurves.cpp b/pxr/usd/usdGeom/hermiteCurves.cpp index affc935686..26db525f18 100644 --- a/pxr/usd/usdGeom/hermiteCurves.cpp +++ b/pxr/usd/usdGeom/hermiteCurves.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdGeom/hermiteCurves.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usdGeom/hermiteCurves.h b/pxr/usd/usdGeom/hermiteCurves.h index a09ea502e8..466fbc6afd 100644 --- a/pxr/usd/usdGeom/hermiteCurves.h +++ b/pxr/usd/usdGeom/hermiteCurves.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDGEOM_GENERATED_HERMITECURVES_H #define USDGEOM_GENERATED_HERMITECURVES_H diff --git a/pxr/usd/usdGeom/imageable.cpp b/pxr/usd/usdGeom/imageable.cpp index 05799ee6a9..a6fbd67171 100644 --- a/pxr/usd/usdGeom/imageable.cpp +++ b/pxr/usd/usdGeom/imageable.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdGeom/imageable.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usdGeom/imageable.h b/pxr/usd/usdGeom/imageable.h index a4f191c9b7..4ee9276f79 100644 --- a/pxr/usd/usdGeom/imageable.h +++ b/pxr/usd/usdGeom/imageable.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDGEOM_GENERATED_IMAGEABLE_H #define USDGEOM_GENERATED_IMAGEABLE_H diff --git a/pxr/usd/usdGeom/mesh.cpp b/pxr/usd/usdGeom/mesh.cpp index ea7f2a1d61..501f299429 100644 --- a/pxr/usd/usdGeom/mesh.cpp +++ b/pxr/usd/usdGeom/mesh.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdGeom/mesh.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usdGeom/mesh.h b/pxr/usd/usdGeom/mesh.h index 2e108648e4..55bf3f27c4 100644 --- a/pxr/usd/usdGeom/mesh.h +++ b/pxr/usd/usdGeom/mesh.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDGEOM_GENERATED_MESH_H #define USDGEOM_GENERATED_MESH_H diff --git a/pxr/usd/usdGeom/metrics.cpp b/pxr/usd/usdGeom/metrics.cpp index 866a86ebae..2056a4c61f 100644 --- a/pxr/usd/usdGeom/metrics.cpp +++ b/pxr/usd/usdGeom/metrics.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usdGeom/metrics.h" diff --git a/pxr/usd/usdGeom/metrics.h b/pxr/usd/usdGeom/metrics.h index 6e86d63c16..fecceaced5 100644 --- a/pxr/usd/usdGeom/metrics.h +++ b/pxr/usd/usdGeom/metrics.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_GEOM_METRICS_H #define PXR_USD_USD_GEOM_METRICS_H diff --git a/pxr/usd/usdGeom/modelAPI.cpp b/pxr/usd/usdGeom/modelAPI.cpp index 22646cde2e..7266d41ed3 100644 --- a/pxr/usd/usdGeom/modelAPI.cpp +++ b/pxr/usd/usdGeom/modelAPI.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdGeom/modelAPI.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usdGeom/modelAPI.h b/pxr/usd/usdGeom/modelAPI.h index cc0ae522a1..5321bc8671 100644 --- a/pxr/usd/usdGeom/modelAPI.h +++ b/pxr/usd/usdGeom/modelAPI.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDGEOM_GENERATED_MODELAPI_H #define USDGEOM_GENERATED_MODELAPI_H diff --git a/pxr/usd/usdGeom/module.cpp b/pxr/usd/usdGeom/module.cpp index 97b766fdcd..360fff2909 100644 --- a/pxr/usd/usdGeom/module.cpp +++ b/pxr/usd/usdGeom/module.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/base/tf/pyModule.h" diff --git a/pxr/usd/usdGeom/moduleDeps.cpp b/pxr/usd/usdGeom/moduleDeps.cpp index 331a574462..188cc440ab 100644 --- a/pxr/usd/usdGeom/moduleDeps.cpp +++ b/pxr/usd/usdGeom/moduleDeps.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/pxr/usd/usdGeom/motionAPI.cpp b/pxr/usd/usdGeom/motionAPI.cpp index 2758b1613e..72866226c6 100644 --- a/pxr/usd/usdGeom/motionAPI.cpp +++ b/pxr/usd/usdGeom/motionAPI.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdGeom/motionAPI.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usdGeom/motionAPI.h b/pxr/usd/usdGeom/motionAPI.h index a82ac6c7cf..da4c9bb908 100644 --- a/pxr/usd/usdGeom/motionAPI.h +++ b/pxr/usd/usdGeom/motionAPI.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDGEOM_GENERATED_MOTIONAPI_H #define USDGEOM_GENERATED_MOTIONAPI_H diff --git a/pxr/usd/usdGeom/nurbsCurves.cpp b/pxr/usd/usdGeom/nurbsCurves.cpp index 87a592be1d..dcd006f7b0 100644 --- a/pxr/usd/usdGeom/nurbsCurves.cpp +++ b/pxr/usd/usdGeom/nurbsCurves.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdGeom/nurbsCurves.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usdGeom/nurbsCurves.h b/pxr/usd/usdGeom/nurbsCurves.h index adac636e7e..e64fff7764 100644 --- a/pxr/usd/usdGeom/nurbsCurves.h +++ b/pxr/usd/usdGeom/nurbsCurves.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDGEOM_GENERATED_NURBSCURVES_H #define USDGEOM_GENERATED_NURBSCURVES_H diff --git a/pxr/usd/usdGeom/nurbsPatch.cpp b/pxr/usd/usdGeom/nurbsPatch.cpp index a130e66488..c6e87e854b 100644 --- a/pxr/usd/usdGeom/nurbsPatch.cpp +++ b/pxr/usd/usdGeom/nurbsPatch.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdGeom/nurbsPatch.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usdGeom/nurbsPatch.h b/pxr/usd/usdGeom/nurbsPatch.h index 765a4becbd..de0c84fb55 100644 --- a/pxr/usd/usdGeom/nurbsPatch.h +++ b/pxr/usd/usdGeom/nurbsPatch.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDGEOM_GENERATED_NURBSPATCH_H #define USDGEOM_GENERATED_NURBSPATCH_H diff --git a/pxr/usd/usdGeom/pch.h b/pxr/usd/usdGeom/pch.h index 824c5b0f93..731c1501c5 100644 --- a/pxr/usd/usdGeom/pch.h +++ b/pxr/usd/usdGeom/pch.h @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // // WARNING: THIS FILE IS GENERATED. DO NOT EDIT. // @@ -31,6 +14,7 @@ #include #endif #if defined(ARCH_OS_LINUX) +#include #include #endif #if defined(ARCH_OS_WINDOWS) @@ -38,12 +22,11 @@ #define WIN32_LEAN_AND_MEAN #endif +#include #include -#include -#include -#include #endif #include +#include #include #include #include @@ -70,6 +53,7 @@ #include #include #include +#include #include #include #include @@ -78,60 +62,15 @@ #include #include #include +#include #include #include #include #include #include #include +#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #ifdef PXR_PYTHON_SUPPORT_ENABLED #include #include @@ -151,6 +90,7 @@ #include #include #include +#include #include #include #include @@ -161,29 +101,9 @@ #undef toupper #endif #endif // PXR_PYTHON_SUPPORT_ENABLED -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include #include +#include #include #include #include @@ -196,6 +116,7 @@ #include #include #include +#include #ifdef PXR_PYTHON_SUPPORT_ENABLED #include "pxr/base/tf/pySafePython.h" #endif // PXR_PYTHON_SUPPORT_ENABLED diff --git a/pxr/usd/usdGeom/plane.cpp b/pxr/usd/usdGeom/plane.cpp index bd5cfe898f..10f199ed91 100644 --- a/pxr/usd/usdGeom/plane.cpp +++ b/pxr/usd/usdGeom/plane.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdGeom/plane.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usdGeom/plane.h b/pxr/usd/usdGeom/plane.h index dd3675c9f1..009ec463b7 100644 --- a/pxr/usd/usdGeom/plane.h +++ b/pxr/usd/usdGeom/plane.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDGEOM_GENERATED_PLANE_H #define USDGEOM_GENERATED_PLANE_H diff --git a/pxr/usd/usdGeom/pointBased.cpp b/pxr/usd/usdGeom/pointBased.cpp index 2b95c7d8e4..a45cb07435 100644 --- a/pxr/usd/usdGeom/pointBased.cpp +++ b/pxr/usd/usdGeom/pointBased.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdGeom/pointBased.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usdGeom/pointBased.h b/pxr/usd/usdGeom/pointBased.h index 7dfee8d21f..9f1d1cb9d2 100644 --- a/pxr/usd/usdGeom/pointBased.h +++ b/pxr/usd/usdGeom/pointBased.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDGEOM_GENERATED_POINTBASED_H #define USDGEOM_GENERATED_POINTBASED_H diff --git a/pxr/usd/usdGeom/pointInstancer.cpp b/pxr/usd/usdGeom/pointInstancer.cpp index 36d4f1609a..c3b6ac4e57 100644 --- a/pxr/usd/usdGeom/pointInstancer.cpp +++ b/pxr/usd/usdGeom/pointInstancer.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdGeom/pointInstancer.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usdGeom/pointInstancer.h b/pxr/usd/usdGeom/pointInstancer.h index 04832946ef..2ce27043de 100644 --- a/pxr/usd/usdGeom/pointInstancer.h +++ b/pxr/usd/usdGeom/pointInstancer.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDGEOM_GENERATED_POINTINSTANCER_H #define USDGEOM_GENERATED_POINTINSTANCER_H diff --git a/pxr/usd/usdGeom/points.cpp b/pxr/usd/usdGeom/points.cpp index ee4cb9dd82..1dc14690b9 100644 --- a/pxr/usd/usdGeom/points.cpp +++ b/pxr/usd/usdGeom/points.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdGeom/points.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usdGeom/points.h b/pxr/usd/usdGeom/points.h index 3ea4bee144..8e4bd19765 100644 --- a/pxr/usd/usdGeom/points.h +++ b/pxr/usd/usdGeom/points.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDGEOM_GENERATED_POINTS_H #define USDGEOM_GENERATED_POINTS_H diff --git a/pxr/usd/usdGeom/primvar.cpp b/pxr/usd/usdGeom/primvar.cpp index 83151aa672..1c253f2ebd 100644 --- a/pxr/usd/usdGeom/primvar.cpp +++ b/pxr/usd/usdGeom/primvar.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usdGeom/primvar.h" diff --git a/pxr/usd/usdGeom/primvar.h b/pxr/usd/usdGeom/primvar.h index 87709e8e55..05a3c983b1 100644 --- a/pxr/usd/usdGeom/primvar.h +++ b/pxr/usd/usdGeom/primvar.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_GEOM_PRIMVAR_H #define PXR_USD_USD_GEOM_PRIMVAR_H diff --git a/pxr/usd/usdGeom/primvarsAPI.cpp b/pxr/usd/usdGeom/primvarsAPI.cpp index 8cdd5841c7..129477cb53 100644 --- a/pxr/usd/usdGeom/primvarsAPI.cpp +++ b/pxr/usd/usdGeom/primvarsAPI.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdGeom/primvarsAPI.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usdGeom/primvarsAPI.h b/pxr/usd/usdGeom/primvarsAPI.h index b64802d167..366f88d6e7 100644 --- a/pxr/usd/usdGeom/primvarsAPI.h +++ b/pxr/usd/usdGeom/primvarsAPI.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDGEOM_GENERATED_PRIMVARSAPI_H #define USDGEOM_GENERATED_PRIMVARSAPI_H diff --git a/pxr/usd/usdGeom/samplingUtils.cpp b/pxr/usd/usdGeom/samplingUtils.cpp index 52c1590739..0ac5bb6e53 100644 --- a/pxr/usd/usdGeom/samplingUtils.cpp +++ b/pxr/usd/usdGeom/samplingUtils.cpp @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdGeom/samplingUtils.h" #include "pxr/usd/usdGeom/motionAPI.h" diff --git a/pxr/usd/usdGeom/samplingUtils.h b/pxr/usd/usdGeom/samplingUtils.h index cea6ea9a6d..0681cd5035 100644 --- a/pxr/usd/usdGeom/samplingUtils.h +++ b/pxr/usd/usdGeom/samplingUtils.h @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_GEOM_SAMPLING_UTILS_H #define PXR_USD_USD_GEOM_SAMPLING_UTILS_H diff --git a/pxr/usd/usdGeom/scope.cpp b/pxr/usd/usdGeom/scope.cpp index e0823e6c8b..f81f130463 100644 --- a/pxr/usd/usdGeom/scope.cpp +++ b/pxr/usd/usdGeom/scope.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdGeom/scope.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usdGeom/scope.h b/pxr/usd/usdGeom/scope.h index 0fadea64c8..9ed927c544 100644 --- a/pxr/usd/usdGeom/scope.h +++ b/pxr/usd/usdGeom/scope.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDGEOM_GENERATED_SCOPE_H #define USDGEOM_GENERATED_SCOPE_H diff --git a/pxr/usd/usdGeom/sphere.cpp b/pxr/usd/usdGeom/sphere.cpp index 6be168aa7c..6b77063260 100644 --- a/pxr/usd/usdGeom/sphere.cpp +++ b/pxr/usd/usdGeom/sphere.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdGeom/sphere.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usdGeom/sphere.h b/pxr/usd/usdGeom/sphere.h index 46cb60e536..daf230595d 100644 --- a/pxr/usd/usdGeom/sphere.h +++ b/pxr/usd/usdGeom/sphere.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDGEOM_GENERATED_SPHERE_H #define USDGEOM_GENERATED_SPHERE_H diff --git a/pxr/usd/usdGeom/subset.cpp b/pxr/usd/usdGeom/subset.cpp index 08d6d79911..95c1921df9 100644 --- a/pxr/usd/usdGeom/subset.cpp +++ b/pxr/usd/usdGeom/subset.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdGeom/subset.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usdGeom/subset.h b/pxr/usd/usdGeom/subset.h index 0be9f08e52..76fd8b07c9 100644 --- a/pxr/usd/usdGeom/subset.h +++ b/pxr/usd/usdGeom/subset.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDGEOM_GENERATED_SUBSET_H #define USDGEOM_GENERATED_SUBSET_H diff --git a/pxr/usd/usdGeom/testenv/testUsdGeomBBoxCache.py b/pxr/usd/usdGeom/testenv/testUsdGeomBBoxCache.py index d952dce422..fd68131a6c 100644 --- a/pxr/usd/usdGeom/testenv/testUsdGeomBBoxCache.py +++ b/pxr/usd/usdGeom/testenv/testUsdGeomBBoxCache.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from __future__ import print_function diff --git a/pxr/usd/usdGeom/testenv/testUsdGeomBasisCurves.py b/pxr/usd/usdGeom/testenv/testUsdGeomBasisCurves.py index 412a24918a..f11f675107 100644 --- a/pxr/usd/usdGeom/testenv/testUsdGeomBasisCurves.py +++ b/pxr/usd/usdGeom/testenv/testUsdGeomBasisCurves.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. import sys, unittest from pxr import Usd, UsdGeom @@ -77,5 +60,23 @@ def test_ComputeCurveCount(self): self.assertEqual(invalid.ComputeCurveCount( Usd.TimeCode.EarliestTime()), 0) + def test_ComputeSegmentCount(self): + stage = Usd.Stage.Open('basisCurves.usda') + data = [ + (UsdGeom.BasisCurves.Get(stage, '/LinearNonperiodic'), [1, 2, 1, 4]), + (UsdGeom.BasisCurves.Get(stage, '/LinearPeriodic'), [3, 7]), + (UsdGeom.BasisCurves.Get(stage, '/CubicNonperiodicBezier'), [1, 2, 3, 1, 2]), + (UsdGeom.BasisCurves.Get(stage, '/CubicNonperiodicBspline'), [2, 1, 3, 4]), + (UsdGeom.BasisCurves.Get(stage, '/CubicPeriodicBezier'), [2, 3, 2]), + (UsdGeom.BasisCurves.Get(stage, '/CubicPeriodicBspline'), [6, 9, 6]), + (UsdGeom.BasisCurves.Get(stage, '/CubicPinnedCatmullRom'), [1, 2, 1, 4]), + (UsdGeom.BasisCurves.Get(stage, '/CubicPinnedBezier'), [1, 2, 3, 1, 2]) + ] + + for curve, curveSegmentCounts in data: + self.assertEqual( + curve.ComputeSegmentCounts(Usd.TimeCode.EarliestTime()), + curveSegmentCounts) + if __name__ == '__main__': unittest.main() diff --git a/pxr/usd/usdGeom/testenv/testUsdGeomBasisCurves/basisCurves.usda b/pxr/usd/usdGeom/testenv/testUsdGeomBasisCurves/basisCurves.usda index 210d0976c5..cb4d7e294c 100644 --- a/pxr/usd/usdGeom/testenv/testUsdGeomBasisCurves/basisCurves.usda +++ b/pxr/usd/usdGeom/testenv/testUsdGeomBasisCurves/basisCurves.usda @@ -41,3 +41,65 @@ def BasisCurves "TimeSampledAndDefaultVertexCounts" 1: [4, 4, 4, 4, 4] } } + +def BasisCurves "LinearNonperiodic" +{ + uniform token type = "linear" + uniform token wrap = "nonperiodic" + int[] curveVertexCounts = [2, 3, 2, 5] +} + +def BasisCurves "LinearPeriodic" +{ + uniform token type = "linear" + uniform token wrap = "periodic" + int[] curveVertexCounts = [3, 7] +} + +def BasisCurves "CubicNonperiodicBezier" +{ + uniform token type = "cubic" + uniform token wrap = "nonperiodic" + uniform token basis = "bezier" + int[] curveVertexCounts = [4, 7, 10, 4, 7] +} + +def BasisCurves "CubicNonperiodicBspline" +{ + uniform token type = "cubic" + uniform token wrap = "nonperiodic" + uniform token basis = "bspline" + int[] curveVertexCounts = [5, 4, 6, 7] +} + +def BasisCurves "CubicPeriodicBezier" +{ + uniform token type = "cubic" + uniform token wrap = "periodic" + uniform token basis = "bezier" + int[] curveVertexCounts = [6, 9, 6] +} + +def BasisCurves "CubicPeriodicBspline" +{ + uniform token type = "cubic" + uniform token wrap = "periodic" + uniform token basis = "bspline" + int[] curveVertexCounts = [6, 9, 6] +} + +def BasisCurves "CubicPinnedCatmullRom" +{ + uniform token type = "cubic" + uniform token wrap = "pinned" + uniform token basis = "catmullRom" + int[] curveVertexCounts = [2, 3, 2, 5] +} + +def BasisCurves "CubicPinnedBezier" +{ + uniform token type = "cubic" + uniform token wrap = "pinned" + uniform token basis = "bezier" + int[] curveVertexCounts = [4, 7, 10, 4, 7] +} \ No newline at end of file diff --git a/pxr/usd/usdGeom/testenv/testUsdGeomCamera.py b/pxr/usd/usdGeom/testenv/testUsdGeomCamera.py index 75a864ef26..dcebde5f47 100644 --- a/pxr/usd/usdGeom/testenv/testUsdGeomCamera.py +++ b/pxr/usd/usdGeom/testenv/testUsdGeomCamera.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from pxr import Gf, Usd, UsdGeom, Sdf, Tf import unittest, math diff --git a/pxr/usd/usdGeom/testenv/testUsdGeomComputeAtTime.py b/pxr/usd/usdGeom/testenv/testUsdGeomComputeAtTime.py index baf5731e60..c1d324e22b 100644 --- a/pxr/usd/usdGeom/testenv/testUsdGeomComputeAtTime.py +++ b/pxr/usd/usdGeom/testenv/testUsdGeomComputeAtTime.py @@ -2,25 +2,8 @@ # # Copyright 2018 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. import unittest diff --git a/pxr/usd/usdGeom/testenv/testUsdGeomConstraintTarget.py b/pxr/usd/usdGeom/testenv/testUsdGeomConstraintTarget.py index bb9d18c0c6..3ab8e137f1 100644 --- a/pxr/usd/usdGeom/testenv/testUsdGeomConstraintTarget.py +++ b/pxr/usd/usdGeom/testenv/testUsdGeomConstraintTarget.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. import sys, os, unittest from pxr import Gf, Usd, UsdGeom, Sdf, Tf diff --git a/pxr/usd/usdGeom/testenv/testUsdGeomConsts.py b/pxr/usd/usdGeom/testenv/testUsdGeomConsts.py index 5324f780de..729a2b5eff 100644 --- a/pxr/usd/usdGeom/testenv/testUsdGeomConsts.py +++ b/pxr/usd/usdGeom/testenv/testUsdGeomConsts.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. import sys, os, unittest from pxr import Sdf, Usd, UsdGeom diff --git a/pxr/usd/usdGeom/testenv/testUsdGeomCreateAttribute.cpp b/pxr/usd/usdGeom/testenv/testUsdGeomCreateAttribute.cpp index b595ad838c..6b0b6cfe04 100644 --- a/pxr/usd/usdGeom/testenv/testUsdGeomCreateAttribute.cpp +++ b/pxr/usd/usdGeom/testenv/testUsdGeomCreateAttribute.cpp @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/usdGeom/testenv/testUsdGeomCurves.py b/pxr/usd/usdGeom/testenv/testUsdGeomCurves.py index accd867d4c..1d5652dc42 100644 --- a/pxr/usd/usdGeom/testenv/testUsdGeomCurves.py +++ b/pxr/usd/usdGeom/testenv/testUsdGeomCurves.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. import unittest diff --git a/pxr/usd/usdGeom/testenv/testUsdGeomExtentFromPlugins.py b/pxr/usd/usdGeom/testenv/testUsdGeomExtentFromPlugins.py index 0402c40a9b..864093160d 100644 --- a/pxr/usd/usdGeom/testenv/testUsdGeomExtentFromPlugins.py +++ b/pxr/usd/usdGeom/testenv/testUsdGeomExtentFromPlugins.py @@ -2,25 +2,8 @@ # # Copyright 2020 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from pxr import Gf, Vt, Usd, UsdGeom import unittest diff --git a/pxr/usd/usdGeom/testenv/testUsdGeomExtentTransform.py b/pxr/usd/usdGeom/testenv/testUsdGeomExtentTransform.py index cfc8d91466..9636049e61 100644 --- a/pxr/usd/usdGeom/testenv/testUsdGeomExtentTransform.py +++ b/pxr/usd/usdGeom/testenv/testUsdGeomExtentTransform.py @@ -2,25 +2,8 @@ # # Copyright 2018 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. import unittest diff --git a/pxr/usd/usdGeom/testenv/testUsdGeomHasAPI.cpp b/pxr/usd/usdGeom/testenv/testUsdGeomHasAPI.cpp index 519028b528..495f7a35a5 100644 --- a/pxr/usd/usdGeom/testenv/testUsdGeomHasAPI.cpp +++ b/pxr/usd/usdGeom/testenv/testUsdGeomHasAPI.cpp @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/usdGeom/testenv/testUsdGeomHermiteCurves.py b/pxr/usd/usdGeom/testenv/testUsdGeomHermiteCurves.py index 3a4dc7ad65..8d8d03110e 100644 --- a/pxr/usd/usdGeom/testenv/testUsdGeomHermiteCurves.py +++ b/pxr/usd/usdGeom/testenv/testUsdGeomHermiteCurves.py @@ -2,25 +2,8 @@ # # Copyright 2020 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. import unittest diff --git a/pxr/usd/usdGeom/testenv/testUsdGeomImageable.py b/pxr/usd/usdGeom/testenv/testUsdGeomImageable.py index 59ac05839d..70094d2c7b 100644 --- a/pxr/usd/usdGeom/testenv/testUsdGeomImageable.py +++ b/pxr/usd/usdGeom/testenv/testUsdGeomImageable.py @@ -2,25 +2,8 @@ # # Copyright 2019 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from pxr import Usd, UsdGeom import unittest diff --git a/pxr/usd/usdGeom/testenv/testUsdGeomIsA.cpp b/pxr/usd/usdGeom/testenv/testUsdGeomIsA.cpp index 24cdaa59be..b1a401338b 100644 --- a/pxr/usd/usdGeom/testenv/testUsdGeomIsA.cpp +++ b/pxr/usd/usdGeom/testenv/testUsdGeomIsA.cpp @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/usdGeom/testenv/testUsdGeomMesh.py b/pxr/usd/usdGeom/testenv/testUsdGeomMesh.py index 1f3516d42d..8a5fb7afd5 100644 --- a/pxr/usd/usdGeom/testenv/testUsdGeomMesh.py +++ b/pxr/usd/usdGeom/testenv/testUsdGeomMesh.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from pxr import Usd, UsdGeom, Vt import unittest diff --git a/pxr/usd/usdGeom/testenv/testUsdGeomMetrics.py b/pxr/usd/usdGeom/testenv/testUsdGeomMetrics.py index ccc95d25e0..dc6f175a0a 100644 --- a/pxr/usd/usdGeom/testenv/testUsdGeomMetrics.py +++ b/pxr/usd/usdGeom/testenv/testUsdGeomMetrics.py @@ -2,25 +2,8 @@ # # Copyright 2019 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. import sys, os, unittest from pxr import Tf, Usd, UsdGeom diff --git a/pxr/usd/usdGeom/testenv/testUsdGeomMotionAPI.py b/pxr/usd/usdGeom/testenv/testUsdGeomMotionAPI.py index 085ce56624..0f027e5cba 100644 --- a/pxr/usd/usdGeom/testenv/testUsdGeomMotionAPI.py +++ b/pxr/usd/usdGeom/testenv/testUsdGeomMotionAPI.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. import sys, os, unittest from pxr import Usd, UsdGeom, Sdf, Tf diff --git a/pxr/usd/usdGeom/testenv/testUsdGeomNoPlugLoad.py b/pxr/usd/usdGeom/testenv/testUsdGeomNoPlugLoad.py index a2f84f000c..d9d3197619 100644 --- a/pxr/usd/usdGeom/testenv/testUsdGeomNoPlugLoad.py +++ b/pxr/usd/usdGeom/testenv/testUsdGeomNoPlugLoad.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # This test explicitly does *not* load usdGeom. We're testing that core Usd # functionality will work using only information loaded from usdGeom's diff --git a/pxr/usd/usdGeom/testenv/testUsdGeomPointInstancer.py b/pxr/usd/usdGeom/testenv/testUsdGeomPointInstancer.py index d4fdc317d4..17050d17ff 100644 --- a/pxr/usd/usdGeom/testenv/testUsdGeomPointInstancer.py +++ b/pxr/usd/usdGeom/testenv/testUsdGeomPointInstancer.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # pylint: disable=range-builtin-not-iterating diff --git a/pxr/usd/usdGeom/testenv/testUsdGeomPoints.py b/pxr/usd/usdGeom/testenv/testUsdGeomPoints.py index 350f6f5659..3b29f61616 100644 --- a/pxr/usd/usdGeom/testenv/testUsdGeomPoints.py +++ b/pxr/usd/usdGeom/testenv/testUsdGeomPoints.py @@ -2,25 +2,8 @@ # # Copyright 2020 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. import sys, unittest from pxr import Usd, UsdGeom diff --git a/pxr/usd/usdGeom/testenv/testUsdGeomPrimvar.py b/pxr/usd/usdGeom/testenv/testUsdGeomPrimvar.py index 8109f620f9..6a0996a7f1 100644 --- a/pxr/usd/usdGeom/testenv/testUsdGeomPrimvar.py +++ b/pxr/usd/usdGeom/testenv/testUsdGeomPrimvar.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. import sys, os, unittest from pxr import Gf, Usd, UsdGeom, Sdf, Tf, Vt diff --git a/pxr/usd/usdGeom/testenv/testUsdGeomPurposeVisibility.py b/pxr/usd/usdGeom/testenv/testUsdGeomPurposeVisibility.py index dce4d1c73d..096a253eb9 100644 --- a/pxr/usd/usdGeom/testenv/testUsdGeomPurposeVisibility.py +++ b/pxr/usd/usdGeom/testenv/testUsdGeomPurposeVisibility.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from __future__ import print_function diff --git a/pxr/usd/usdGeom/testenv/testUsdGeomSchemata.py b/pxr/usd/usdGeom/testenv/testUsdGeomSchemata.py index 7ee185402f..c707c54ccc 100644 --- a/pxr/usd/usdGeom/testenv/testUsdGeomSchemata.py +++ b/pxr/usd/usdGeom/testenv/testUsdGeomSchemata.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # pylint: disable=map-builtin-not-iterating diff --git a/pxr/usd/usdGeom/testenv/testUsdGeomSubset.py b/pxr/usd/usdGeom/testenv/testUsdGeomSubset.py index 8c2beab1ec..249eebe9f0 100644 --- a/pxr/usd/usdGeom/testenv/testUsdGeomSubset.py +++ b/pxr/usd/usdGeom/testenv/testUsdGeomSubset.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # pylint: disable=range-builtin-not-iterating @@ -30,7 +13,8 @@ import unittest class testUsdGeomSubset(unittest.TestCase): - def _ValidateFamily(self, geom, elementType, familyName, expectedIsValid): + def _ValidateFamily(self, geom, elementType, familyName, + expectedIsValid, expectedReasons=""): (valid, reason) = UsdGeom.Subset.ValidateFamily( geom, elementType, familyName=familyName) if expectedIsValid: @@ -42,6 +26,8 @@ def _ValidateFamily(self, geom, elementType, familyName, expectedIsValid): (familyName, reason)) self.assertFalse(valid) self.assertTrue(len(reason) > 0) + for expectedReason in expectedReasons: + self.assertTrue(expectedReason in reason) def _TestSubsetValidity(self, geom, varyingGeom, nullGeom, elementType): prefix = elementType + "_" @@ -52,24 +38,50 @@ def _TestSubsetValidity(self, geom, varyingGeom, nullGeom, elementType): for familyName in validFamilies: self._ValidateFamily(geom, elementType, prefix+familyName, True) - invalidFamilies = ['invalidIndices', 'badPartition1', 'badPartition2', - 'badPartition3', 'invalidNonOverlapping', - 'invalidUnrestricted', 'onlyNegativeIndices', - 'emptyIndicesAtAllTimes'] - for familyName in invalidFamilies: - self._ValidateFamily(geom, elementType, prefix+familyName, False) + if elementType == UsdGeom.Tokens.edge: + invalidFamilies = [ + ('invalidIndices', ["does not exist on the parent prim", + "Indices attribute has an odd number of elements", + "Found one or more indices that are less than 0"]), + ('badPartition1', ["does not match the element count", + "does not exist on the parent prim"]), + ('badPartition2', ["does not match the element count"]), + ('badPartition3', ["Found duplicate edge"]), + ('invalidNonOverlapping', ["Found duplicate edge"]), + ('invalidUnrestricted', ["does not exist on the parent prim", + "Found one or more indices that are less than 0"]), + ('onlyNegativeIndices', ["Found one or more indices that are less than 0", + "does not exist on the parent prim"]), + ('emptyIndicesAtAllTimes', ["No indices in family at any time"])] + else: + invalidFamilies = [ + ('invalidIndices', ["Found one or more indices that are greater than the element count", + "Found one or more indices that are less than 0"]), + ('badPartition1', ["does not match the element count", + "Found one or more indices that are greater than the element count"]), + ('badPartition2', ["does not match the element count"]), + ('badPartition3', ["Found duplicate index"]), + ('invalidNonOverlapping', ["Found duplicate index"]), + ('invalidUnrestricted', ["Found one or more indices that are greater than the element count", + "Found one or more indices that are less than 0"]), + ('onlyNegativeIndices', ["Found one or more indices that are less than 0"]), + ('emptyIndicesAtAllTimes', ["No indices in family at any time"])] + + for familyName, reasons in invalidFamilies: + self._ValidateFamily(geom, elementType, prefix+familyName, False, reasons) validFamilies = ['validPartition'] for familyName in validFamilies: self._ValidateFamily(varyingGeom, elementType, prefix+familyName, True) - invalidFamilies = ['invalidNoDefaultTimeElements'] - for familyName in invalidFamilies: - self._ValidateFamily(varyingGeom, elementType, prefix+familyName, False) + invalidFamilies = [('invalidNoDefaultTimeElements', ["has no elements"])] + for familyName, reasons in invalidFamilies: + self._ValidateFamily(varyingGeom, elementType, prefix+familyName, False, reasons) - invalidFamilies = ['emptyIndicesAtAllTimes', 'invalidPartition'] - for familyName in invalidFamilies: - self._ValidateFamily(nullGeom, elementType, prefix+familyName, False) + invalidFamilies = [('emptyIndicesAtAllTimes', ["No indices in family at any time"]), + ('invalidPartition', ["Unable to determine element count at earliest time"])] + for familyName, reasons in invalidFamilies: + self._ValidateFamily(nullGeom, elementType, prefix+familyName, False, reasons) def _TestSubsetRetrieval(self, geom, elementType, familyName): prefix = elementType + "_" @@ -227,10 +239,9 @@ def test_CreateGeomSubset(self): self.assertEqual(UsdGeom.Subset.GetFamilyType(geom, 'testFamily'), UsdGeom.Tokens.partition) - (valid, reason) = UsdGeom.Subset.ValidateFamily(geom, - UsdGeom.Tokens.face, 'testFamily') - self.assertFalse(valid) - + self._ValidateFamily(geom, + UsdGeom.Tokens.face, 'testFamily', False, ["does not match the element count"]) + unassignedIndices = UsdGeom.Subset.GetUnassignedIndices(geom, UsdGeom.Tokens.face, 'testFamily') self.assertEqual(unassignedIndices, Vt.IntArray(range(3, 16))) @@ -264,9 +275,7 @@ def test_CreateGeomSubset(self): familyType=UsdGeom.Tokens.partition) self.assertEqual(len(testSubsets), 2) - (valid, reason) = UsdGeom.Subset.ValidateFamily(geom, - UsdGeom.Tokens.face, familyName='testFamily') - self.assertTrue(valid) + self._ValidateFamily(geom, UsdGeom.Tokens.face, 'testFamily', True) # Check total count. allGeomSubsets = UsdGeom.Subset.GetAllGeomSubsets( @@ -303,9 +312,8 @@ def test_PointInstancer(self): self.assertEqual(UsdGeom.Tokens.partition, UsdGeom.Subset.GetFamilyType(geom, 'materialBind')) - (valid, reason) = UsdGeom.Subset.ValidateFamily(geom, - UsdGeom.Tokens.face, familyName='materialBind') - self.assertTrue(valid) + self._ValidateFamily(geom, + UsdGeom.Tokens.face, 'materialBind', True) if __name__ == "__main__": unittest.main() diff --git a/pxr/usd/usdGeom/testenv/testUsdGeomTetMesh.py b/pxr/usd/usdGeom/testenv/testUsdGeomTetMesh.py index 54a0e2e42f..b9b42e9a0b 100644 --- a/pxr/usd/usdGeom/testenv/testUsdGeomTetMesh.py +++ b/pxr/usd/usdGeom/testenv/testUsdGeomTetMesh.py @@ -2,25 +2,8 @@ # # Copyright 2023 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. import sys, unittest from pxr import Usd, UsdGeom, Vt, Gf diff --git a/pxr/usd/usdGeom/testenv/testUsdGeomTypeRegistry.py b/pxr/usd/usdGeom/testenv/testUsdGeomTypeRegistry.py index 6d040ccd21..5a6f86d5ff 100644 --- a/pxr/usd/usdGeom/testenv/testUsdGeomTypeRegistry.py +++ b/pxr/usd/usdGeom/testenv/testUsdGeomTypeRegistry.py @@ -2,25 +2,8 @@ # # Copyright 2018 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. import sys import unittest diff --git a/pxr/usd/usdGeom/testenv/testUsdGeomXformCache.cpp b/pxr/usd/usdGeom/testenv/testUsdGeomXformCache.cpp index 7df950d1a7..dfeee107bb 100644 --- a/pxr/usd/usdGeom/testenv/testUsdGeomXformCache.cpp +++ b/pxr/usd/usdGeom/testenv/testUsdGeomXformCache.cpp @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/usdGeom/testenv/testUsdGeomXformCommonAPI.py b/pxr/usd/usdGeom/testenv/testUsdGeomXformCommonAPI.py index 59930885df..4f3f559e4c 100644 --- a/pxr/usd/usdGeom/testenv/testUsdGeomXformCommonAPI.py +++ b/pxr/usd/usdGeom/testenv/testUsdGeomXformCommonAPI.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from pxr import Gf, Tf, Usd, UsdGeom, Vt import unittest, math diff --git a/pxr/usd/usdGeom/testenv/testUsdGeomXformable.py b/pxr/usd/usdGeom/testenv/testUsdGeomXformable.py index 6e5abfbaae..883beef043 100644 --- a/pxr/usd/usdGeom/testenv/testUsdGeomXformable.py +++ b/pxr/usd/usdGeom/testenv/testUsdGeomXformable.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from pxr import Gf, Tf, Sdf, Usd, UsdGeom, Vt import unittest, math diff --git a/pxr/usd/usdGeom/tetMesh.cpp b/pxr/usd/usdGeom/tetMesh.cpp index 0abe2d0e27..d2a3ed883f 100644 --- a/pxr/usd/usdGeom/tetMesh.cpp +++ b/pxr/usd/usdGeom/tetMesh.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdGeom/tetMesh.h" #include "pxr/usd/usd/schemaRegistry.h" @@ -227,10 +210,8 @@ struct _Vec3iCmp } }; -} - VtVec3iArray -UsdGeomTetMesh::ComputeSurfaceFaces(const VtVec4iArray &tetVertexIndices) +_ComputeSurfaceFaces(const VtVec4iArray &tetVertexIndices) { // The surface faces are made of triangles that are not shared between @@ -298,6 +279,7 @@ UsdGeomTetMesh::ComputeSurfaceFaces(const VtVec4iArray &tetVertexIndices) return result; } +} bool UsdGeomTetMesh::ComputeSurfaceFaces(const UsdGeomTetMesh& tetMesh, VtVec3iArray* surfaceFaceIndices, @@ -312,7 +294,7 @@ bool UsdGeomTetMesh::ComputeSurfaceFaces(const UsdGeomTetMesh& tetMesh, VtVec4iArray tetVertexIndices; tetVertexIndicesAttr.Get(&tetVertexIndices, timeCode); - *surfaceFaceIndices = ComputeSurfaceFaces(tetVertexIndices); + *surfaceFaceIndices = _ComputeSurfaceFaces(tetVertexIndices); return true; } diff --git a/pxr/usd/usdGeom/tetMesh.h b/pxr/usd/usdGeom/tetMesh.h index e6dc539fe1..fb00ff3c7d 100644 --- a/pxr/usd/usdGeom/tetMesh.h +++ b/pxr/usd/usdGeom/tetMesh.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDGEOM_GENERATED_TETMESH_H #define USDGEOM_GENERATED_TETMESH_H @@ -253,10 +236,6 @@ class UsdGeomTetMesh : public UsdGeomPointBased VtVec3iArray* surfaceFaceIndices, const UsdTimeCode timeCode = UsdTimeCode::Default()); - USDGEOM_API - static VtVec3iArray ComputeSurfaceFaces( - const VtVec4iArray &tetVertexIndices); - /// FindInvertedElements is used to determine if the tetMesh has inverted /// tetrahedral elements at the given time code. Inverted elements are /// determined wrt. the "orientation" attribute of the UsdGeomTetMesh and diff --git a/pxr/usd/usdGeom/tokens.cpp b/pxr/usd/usdGeom/tokens.cpp index 343a05b2b6..7d09e44604 100644 --- a/pxr/usd/usdGeom/tokens.cpp +++ b/pxr/usd/usdGeom/tokens.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdGeom/tokens.h" diff --git a/pxr/usd/usdGeom/tokens.h b/pxr/usd/usdGeom/tokens.h index 6f90a61dce..96e4d648de 100644 --- a/pxr/usd/usdGeom/tokens.h +++ b/pxr/usd/usdGeom/tokens.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDGEOM_TOKENS_H #define USDGEOM_TOKENS_H diff --git a/pxr/usd/usdGeom/visibilityAPI.cpp b/pxr/usd/usdGeom/visibilityAPI.cpp index 83516c4e4d..93c4859a0b 100644 --- a/pxr/usd/usdGeom/visibilityAPI.cpp +++ b/pxr/usd/usdGeom/visibilityAPI.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdGeom/visibilityAPI.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usdGeom/visibilityAPI.h b/pxr/usd/usdGeom/visibilityAPI.h index b8a229286d..4602c10b48 100644 --- a/pxr/usd/usdGeom/visibilityAPI.h +++ b/pxr/usd/usdGeom/visibilityAPI.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDGEOM_GENERATED_VISIBILITYAPI_H #define USDGEOM_GENERATED_VISIBILITYAPI_H diff --git a/pxr/usd/usdGeom/wrapBBoxCache.cpp b/pxr/usd/usdGeom/wrapBBoxCache.cpp index 28f3af4870..2df3d253ff 100644 --- a/pxr/usd/usdGeom/wrapBBoxCache.cpp +++ b/pxr/usd/usdGeom/wrapBBoxCache.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usdGeom/bboxCache.h" diff --git a/pxr/usd/usdGeom/wrapBasisCurves.cpp b/pxr/usd/usdGeom/wrapBasisCurves.cpp index 95a0b9b241..303e3f60e7 100644 --- a/pxr/usd/usdGeom/wrapBasisCurves.cpp +++ b/pxr/usd/usdGeom/wrapBasisCurves.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdGeom/basisCurves.h" #include "pxr/usd/usd/schemaBase.h" @@ -180,6 +163,7 @@ WRAP_CUSTOM { .def("ComputeUniformDataSize", &This::ComputeUniformDataSize) .def("ComputeVaryingDataSize", &This::ComputeVaryingDataSize) .def("ComputeVertexDataSize", &This::ComputeVertexDataSize) + .def("ComputeSegmentCounts", &This::ComputeSegmentCounts) ; } diff --git a/pxr/usd/usdGeom/wrapBoundable.cpp b/pxr/usd/usdGeom/wrapBoundable.cpp index f5144052b9..da8a12c7ba 100644 --- a/pxr/usd/usdGeom/wrapBoundable.cpp +++ b/pxr/usd/usdGeom/wrapBoundable.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdGeom/boundable.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdGeom/wrapCamera.cpp b/pxr/usd/usdGeom/wrapCamera.cpp index 95b66635bf..1c9b7d5982 100644 --- a/pxr/usd/usdGeom/wrapCamera.cpp +++ b/pxr/usd/usdGeom/wrapCamera.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdGeom/camera.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdGeom/wrapCapsule.cpp b/pxr/usd/usdGeom/wrapCapsule.cpp index 826813fe38..7152878eb3 100644 --- a/pxr/usd/usdGeom/wrapCapsule.cpp +++ b/pxr/usd/usdGeom/wrapCapsule.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdGeom/capsule.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdGeom/wrapCapsule_1.cpp b/pxr/usd/usdGeom/wrapCapsule_1.cpp index fb6b9bcc15..1f55bf0468 100644 --- a/pxr/usd/usdGeom/wrapCapsule_1.cpp +++ b/pxr/usd/usdGeom/wrapCapsule_1.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdGeom/capsule_1.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdGeom/wrapCone.cpp b/pxr/usd/usdGeom/wrapCone.cpp index a87259e499..76ef3d4611 100644 --- a/pxr/usd/usdGeom/wrapCone.cpp +++ b/pxr/usd/usdGeom/wrapCone.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdGeom/cone.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdGeom/wrapConstraintTarget.cpp b/pxr/usd/usdGeom/wrapConstraintTarget.cpp index 358f25921a..3d201bcc1f 100644 --- a/pxr/usd/usdGeom/wrapConstraintTarget.cpp +++ b/pxr/usd/usdGeom/wrapConstraintTarget.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usdGeom/constraintTarget.h" diff --git a/pxr/usd/usdGeom/wrapCube.cpp b/pxr/usd/usdGeom/wrapCube.cpp index ab2bd1ca42..1378eb323c 100644 --- a/pxr/usd/usdGeom/wrapCube.cpp +++ b/pxr/usd/usdGeom/wrapCube.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdGeom/cube.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdGeom/wrapCurves.cpp b/pxr/usd/usdGeom/wrapCurves.cpp index 2ae1a884ed..b5f8ffe2bb 100644 --- a/pxr/usd/usdGeom/wrapCurves.cpp +++ b/pxr/usd/usdGeom/wrapCurves.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdGeom/curves.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdGeom/wrapCylinder.cpp b/pxr/usd/usdGeom/wrapCylinder.cpp index 63744d0f07..51b34bb18e 100644 --- a/pxr/usd/usdGeom/wrapCylinder.cpp +++ b/pxr/usd/usdGeom/wrapCylinder.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdGeom/cylinder.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdGeom/wrapCylinder_1.cpp b/pxr/usd/usdGeom/wrapCylinder_1.cpp index 893d275269..7eb648c416 100644 --- a/pxr/usd/usdGeom/wrapCylinder_1.cpp +++ b/pxr/usd/usdGeom/wrapCylinder_1.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdGeom/cylinder_1.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdGeom/wrapGprim.cpp b/pxr/usd/usdGeom/wrapGprim.cpp index 98ff9f3f1c..1025747a01 100644 --- a/pxr/usd/usdGeom/wrapGprim.cpp +++ b/pxr/usd/usdGeom/wrapGprim.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdGeom/gprim.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdGeom/wrapHermiteCurves.cpp b/pxr/usd/usdGeom/wrapHermiteCurves.cpp index 8334dbaed0..524ca6a66b 100644 --- a/pxr/usd/usdGeom/wrapHermiteCurves.cpp +++ b/pxr/usd/usdGeom/wrapHermiteCurves.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdGeom/hermiteCurves.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdGeom/wrapImageable.cpp b/pxr/usd/usdGeom/wrapImageable.cpp index 2d6d42216a..4ffbee51ee 100644 --- a/pxr/usd/usdGeom/wrapImageable.cpp +++ b/pxr/usd/usdGeom/wrapImageable.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdGeom/imageable.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdGeom/wrapMesh.cpp b/pxr/usd/usdGeom/wrapMesh.cpp index f6e8054c62..465575202f 100644 --- a/pxr/usd/usdGeom/wrapMesh.cpp +++ b/pxr/usd/usdGeom/wrapMesh.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdGeom/mesh.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdGeom/wrapMetrics.cpp b/pxr/usd/usdGeom/wrapMetrics.cpp index dd94092df1..81f68fe34f 100644 --- a/pxr/usd/usdGeom/wrapMetrics.cpp +++ b/pxr/usd/usdGeom/wrapMetrics.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usdGeom/metrics.h" diff --git a/pxr/usd/usdGeom/wrapModelAPI.cpp b/pxr/usd/usdGeom/wrapModelAPI.cpp index 0773afb905..06472aac8d 100644 --- a/pxr/usd/usdGeom/wrapModelAPI.cpp +++ b/pxr/usd/usdGeom/wrapModelAPI.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdGeom/modelAPI.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdGeom/wrapMotionAPI.cpp b/pxr/usd/usdGeom/wrapMotionAPI.cpp index ce7c213c3d..99d0c4f34b 100644 --- a/pxr/usd/usdGeom/wrapMotionAPI.cpp +++ b/pxr/usd/usdGeom/wrapMotionAPI.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdGeom/motionAPI.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdGeom/wrapNurbsCurves.cpp b/pxr/usd/usdGeom/wrapNurbsCurves.cpp index fb174b53ce..567ae08e96 100644 --- a/pxr/usd/usdGeom/wrapNurbsCurves.cpp +++ b/pxr/usd/usdGeom/wrapNurbsCurves.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdGeom/nurbsCurves.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdGeom/wrapNurbsPatch.cpp b/pxr/usd/usdGeom/wrapNurbsPatch.cpp index 2a323c9ac3..08bc06f192 100644 --- a/pxr/usd/usdGeom/wrapNurbsPatch.cpp +++ b/pxr/usd/usdGeom/wrapNurbsPatch.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdGeom/nurbsPatch.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdGeom/wrapPlane.cpp b/pxr/usd/usdGeom/wrapPlane.cpp index 80c0974e98..651c94bd67 100644 --- a/pxr/usd/usdGeom/wrapPlane.cpp +++ b/pxr/usd/usdGeom/wrapPlane.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdGeom/plane.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdGeom/wrapPointBased.cpp b/pxr/usd/usdGeom/wrapPointBased.cpp index 8c8c9f83ef..04d3fe9fcf 100644 --- a/pxr/usd/usdGeom/wrapPointBased.cpp +++ b/pxr/usd/usdGeom/wrapPointBased.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdGeom/pointBased.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdGeom/wrapPointInstancer.cpp b/pxr/usd/usdGeom/wrapPointInstancer.cpp index 55b434729a..876d9431b3 100644 --- a/pxr/usd/usdGeom/wrapPointInstancer.cpp +++ b/pxr/usd/usdGeom/wrapPointInstancer.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdGeom/pointInstancer.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdGeom/wrapPoints.cpp b/pxr/usd/usdGeom/wrapPoints.cpp index 522b334a3a..788847208c 100644 --- a/pxr/usd/usdGeom/wrapPoints.cpp +++ b/pxr/usd/usdGeom/wrapPoints.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdGeom/points.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdGeom/wrapPrimvar.cpp b/pxr/usd/usdGeom/wrapPrimvar.cpp index d3f9720d8f..2680a12f0f 100644 --- a/pxr/usd/usdGeom/wrapPrimvar.cpp +++ b/pxr/usd/usdGeom/wrapPrimvar.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usdGeom/primvar.h" diff --git a/pxr/usd/usdGeom/wrapPrimvarsAPI.cpp b/pxr/usd/usdGeom/wrapPrimvarsAPI.cpp index be23fd64f7..9ce1349c02 100644 --- a/pxr/usd/usdGeom/wrapPrimvarsAPI.cpp +++ b/pxr/usd/usdGeom/wrapPrimvarsAPI.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdGeom/primvarsAPI.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdGeom/wrapScope.cpp b/pxr/usd/usdGeom/wrapScope.cpp index 1e27cf79dc..8c4eb464dc 100644 --- a/pxr/usd/usdGeom/wrapScope.cpp +++ b/pxr/usd/usdGeom/wrapScope.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdGeom/scope.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdGeom/wrapSphere.cpp b/pxr/usd/usdGeom/wrapSphere.cpp index efa1209959..81402266fb 100644 --- a/pxr/usd/usdGeom/wrapSphere.cpp +++ b/pxr/usd/usdGeom/wrapSphere.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdGeom/sphere.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdGeom/wrapSubset.cpp b/pxr/usd/usdGeom/wrapSubset.cpp index eee5a60a1d..e1bba6300f 100644 --- a/pxr/usd/usdGeom/wrapSubset.cpp +++ b/pxr/usd/usdGeom/wrapSubset.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdGeom/subset.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdGeom/wrapTetMesh.cpp b/pxr/usd/usdGeom/wrapTetMesh.cpp index 07ddae6cf8..3dbd684726 100644 --- a/pxr/usd/usdGeom/wrapTetMesh.cpp +++ b/pxr/usd/usdGeom/wrapTetMesh.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdGeom/tetMesh.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdGeom/wrapTokens.cpp b/pxr/usd/usdGeom/wrapTokens.cpp index b07f9a429b..e2fec5b804 100644 --- a/pxr/usd/usdGeom/wrapTokens.cpp +++ b/pxr/usd/usdGeom/wrapTokens.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // // GENERATED FILE. DO NOT EDIT. #include diff --git a/pxr/usd/usdGeom/wrapVisibilityAPI.cpp b/pxr/usd/usdGeom/wrapVisibilityAPI.cpp index 4b68644195..a9ae3d9d48 100644 --- a/pxr/usd/usdGeom/wrapVisibilityAPI.cpp +++ b/pxr/usd/usdGeom/wrapVisibilityAPI.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdGeom/visibilityAPI.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdGeom/wrapXform.cpp b/pxr/usd/usdGeom/wrapXform.cpp index fa1699b9f1..d211f94dc5 100644 --- a/pxr/usd/usdGeom/wrapXform.cpp +++ b/pxr/usd/usdGeom/wrapXform.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdGeom/xform.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdGeom/wrapXformCache.cpp b/pxr/usd/usdGeom/wrapXformCache.cpp index 43a494cc87..30cca55f7c 100644 --- a/pxr/usd/usdGeom/wrapXformCache.cpp +++ b/pxr/usd/usdGeom/wrapXformCache.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usdGeom/xformCache.h" diff --git a/pxr/usd/usdGeom/wrapXformCommonAPI.cpp b/pxr/usd/usdGeom/wrapXformCommonAPI.cpp index 7be5e3c9d6..8bc00facf5 100644 --- a/pxr/usd/usdGeom/wrapXformCommonAPI.cpp +++ b/pxr/usd/usdGeom/wrapXformCommonAPI.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdGeom/xformCommonAPI.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdGeom/wrapXformOp.cpp b/pxr/usd/usdGeom/wrapXformOp.cpp index cc260e8f8d..bdfc6b97d2 100644 --- a/pxr/usd/usdGeom/wrapXformOp.cpp +++ b/pxr/usd/usdGeom/wrapXformOp.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usdGeom/xformOp.h" diff --git a/pxr/usd/usdGeom/wrapXformable.cpp b/pxr/usd/usdGeom/wrapXformable.cpp index 374c3022a3..fc82508785 100644 --- a/pxr/usd/usdGeom/wrapXformable.cpp +++ b/pxr/usd/usdGeom/wrapXformable.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdGeom/xformable.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdGeom/xform.cpp b/pxr/usd/usdGeom/xform.cpp index c5afd04a18..a90162ed43 100644 --- a/pxr/usd/usdGeom/xform.cpp +++ b/pxr/usd/usdGeom/xform.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdGeom/xform.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usdGeom/xform.h b/pxr/usd/usdGeom/xform.h index 26f784ff53..c4269de806 100644 --- a/pxr/usd/usdGeom/xform.h +++ b/pxr/usd/usdGeom/xform.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDGEOM_GENERATED_XFORM_H #define USDGEOM_GENERATED_XFORM_H diff --git a/pxr/usd/usdGeom/xformCache.cpp b/pxr/usd/usdGeom/xformCache.cpp index fa907dacf5..84e116263b 100644 --- a/pxr/usd/usdGeom/xformCache.cpp +++ b/pxr/usd/usdGeom/xformCache.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usdGeom/xformCache.h" diff --git a/pxr/usd/usdGeom/xformCache.h b/pxr/usd/usdGeom/xformCache.h index 4520bf018e..a14ff2e1ed 100644 --- a/pxr/usd/usdGeom/xformCache.h +++ b/pxr/usd/usdGeom/xformCache.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_GEOM_XFORM_CACHE_H #define PXR_USD_USD_GEOM_XFORM_CACHE_H diff --git a/pxr/usd/usdGeom/xformCommonAPI.cpp b/pxr/usd/usdGeom/xformCommonAPI.cpp index 006b7571ca..52fccd4eb8 100644 --- a/pxr/usd/usdGeom/xformCommonAPI.cpp +++ b/pxr/usd/usdGeom/xformCommonAPI.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdGeom/xformCommonAPI.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usdGeom/xformCommonAPI.h b/pxr/usd/usdGeom/xformCommonAPI.h index eae2a1ffb1..d00d81b26f 100644 --- a/pxr/usd/usdGeom/xformCommonAPI.h +++ b/pxr/usd/usdGeom/xformCommonAPI.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDGEOM_GENERATED_XFORMCOMMONAPI_H #define USDGEOM_GENERATED_XFORMCOMMONAPI_H diff --git a/pxr/usd/usdGeom/xformOp.cpp b/pxr/usd/usdGeom/xformOp.cpp index 1a459a4583..b7b3958432 100644 --- a/pxr/usd/usdGeom/xformOp.cpp +++ b/pxr/usd/usdGeom/xformOp.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usdGeom/xformOp.h" diff --git a/pxr/usd/usdGeom/xformOp.h b/pxr/usd/usdGeom/xformOp.h index 73de4f4740..6a31f39376 100644 --- a/pxr/usd/usdGeom/xformOp.h +++ b/pxr/usd/usdGeom/xformOp.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_GEOM_XFORM_OP_H #define PXR_USD_USD_GEOM_XFORM_OP_H diff --git a/pxr/usd/usdGeom/xformable.cpp b/pxr/usd/usdGeom/xformable.cpp index 3405d25473..4b04e5bda0 100644 --- a/pxr/usd/usdGeom/xformable.cpp +++ b/pxr/usd/usdGeom/xformable.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdGeom/xformable.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usdGeom/xformable.h b/pxr/usd/usdGeom/xformable.h index 5fc188d1cb..b558aadfd6 100644 --- a/pxr/usd/usdGeom/xformable.h +++ b/pxr/usd/usdGeom/xformable.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDGEOM_GENERATED_XFORMABLE_H #define USDGEOM_GENERATED_XFORMABLE_H diff --git a/pxr/usd/usdHydra/__init__.py b/pxr/usd/usdHydra/__init__.py index 71d85c6b0e..1fadb021f2 100644 --- a/pxr/usd/usdHydra/__init__.py +++ b/pxr/usd/usdHydra/__init__.py @@ -1,25 +1,8 @@ # # Copyright 2016 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # from pxr import Tf Tf.PreparePythonModule() diff --git a/pxr/usd/usdHydra/api.h b/pxr/usd/usdHydra/api.h index de5eb2ce12..d13d5703d0 100644 --- a/pxr/usd/usdHydra/api.h +++ b/pxr/usd/usdHydra/api.h @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDHYDRA_API_H #define USDHYDRA_API_H diff --git a/pxr/usd/usdHydra/discoveryPlugin.cpp b/pxr/usd/usdHydra/discoveryPlugin.cpp index bb412bddcf..a75e801211 100644 --- a/pxr/usd/usdHydra/discoveryPlugin.cpp +++ b/pxr/usd/usdHydra/discoveryPlugin.cpp @@ -1,25 +1,8 @@ // // Copyright 2018 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdHydra/discoveryPlugin.h" diff --git a/pxr/usd/usdHydra/discoveryPlugin.h b/pxr/usd/usdHydra/discoveryPlugin.h index fba93db42b..e4bdd64faa 100644 --- a/pxr/usd/usdHydra/discoveryPlugin.h +++ b/pxr/usd/usdHydra/discoveryPlugin.h @@ -1,25 +1,8 @@ // // Copyright 2018 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_HYDRA_DISCOVERY_PLUGIN_H #define PXR_USD_USD_HYDRA_DISCOVERY_PLUGIN_H diff --git a/pxr/usd/usdHydra/generativeProceduralAPI.cpp b/pxr/usd/usdHydra/generativeProceduralAPI.cpp index 5c68d11141..36026e319a 100644 --- a/pxr/usd/usdHydra/generativeProceduralAPI.cpp +++ b/pxr/usd/usdHydra/generativeProceduralAPI.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdHydra/generativeProceduralAPI.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usdHydra/generativeProceduralAPI.h b/pxr/usd/usdHydra/generativeProceduralAPI.h index 773470fff0..f361e402d8 100644 --- a/pxr/usd/usdHydra/generativeProceduralAPI.h +++ b/pxr/usd/usdHydra/generativeProceduralAPI.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDHYDRA_GENERATED_GENERATIVEPROCEDURALAPI_H #define USDHYDRA_GENERATED_GENERATIVEPROCEDURALAPI_H diff --git a/pxr/usd/usdHydra/module.cpp b/pxr/usd/usdHydra/module.cpp index 44ee939bbf..6172103b41 100644 --- a/pxr/usd/usdHydra/module.cpp +++ b/pxr/usd/usdHydra/module.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/base/tf/pyModule.h" diff --git a/pxr/usd/usdHydra/moduleDeps.cpp b/pxr/usd/usdHydra/moduleDeps.cpp index 8028308654..a605f0e099 100644 --- a/pxr/usd/usdHydra/moduleDeps.cpp +++ b/pxr/usd/usdHydra/moduleDeps.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/pxr/usd/usdHydra/pch.h b/pxr/usd/usdHydra/pch.h index 5ba9df4c20..e62a1c609e 100644 --- a/pxr/usd/usdHydra/pch.h +++ b/pxr/usd/usdHydra/pch.h @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // // WARNING: THIS FILE IS GENERATED. DO NOT EDIT. // @@ -31,6 +14,7 @@ #include #endif #if defined(ARCH_OS_LINUX) +#include #include #endif #if defined(ARCH_OS_WINDOWS) @@ -38,12 +22,11 @@ #define WIN32_LEAN_AND_MEAN #endif +#include #include -#include -#include -#include #endif #include +#include #include #include #include @@ -68,6 +51,8 @@ #include #include #include +#include +#include #include #include #include @@ -76,6 +61,7 @@ #include #include #include +#include #include #include #include @@ -83,87 +69,31 @@ #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #ifdef PXR_PYTHON_SUPPORT_ENABLED +#include #include +#include #include #include #include +#include #include #include #include #include +#include +#include +#include +#include #include #if defined(__APPLE__) // Fix breakage caused by Python's pyport.h. #undef tolower #undef toupper #endif #endif // PXR_PYTHON_SUPPORT_ENABLED -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include #include +#include #include #include #include @@ -171,7 +101,7 @@ #include #include #include -#include +#include #ifdef PXR_PYTHON_SUPPORT_ENABLED #include "pxr/base/tf/pySafePython.h" #endif // PXR_PYTHON_SUPPORT_ENABLED diff --git a/pxr/usd/usdHydra/shaders/empty.glslfx b/pxr/usd/usdHydra/shaders/empty.glslfx index ffe586e9c1..cc20f4fd1a 100644 --- a/pxr/usd/usdHydra/shaders/empty.glslfx +++ b/pxr/usd/usdHydra/shaders/empty.glslfx @@ -3,25 +3,8 @@ // // Copyright 2018 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // -- configuration diff --git a/pxr/usd/usdHydra/tokens.cpp b/pxr/usd/usdHydra/tokens.cpp index 80fa1a10ed..6f256a33e6 100644 --- a/pxr/usd/usdHydra/tokens.cpp +++ b/pxr/usd/usdHydra/tokens.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdHydra/tokens.h" diff --git a/pxr/usd/usdHydra/tokens.h b/pxr/usd/usdHydra/tokens.h index 4b465a7f72..97204f1e01 100644 --- a/pxr/usd/usdHydra/tokens.h +++ b/pxr/usd/usdHydra/tokens.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDHYDRA_TOKENS_H #define USDHYDRA_TOKENS_H diff --git a/pxr/usd/usdHydra/wrapGenerativeProceduralAPI.cpp b/pxr/usd/usdHydra/wrapGenerativeProceduralAPI.cpp index a9a13ff2bf..c31d9c5524 100644 --- a/pxr/usd/usdHydra/wrapGenerativeProceduralAPI.cpp +++ b/pxr/usd/usdHydra/wrapGenerativeProceduralAPI.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdHydra/generativeProceduralAPI.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdHydra/wrapTokens.cpp b/pxr/usd/usdHydra/wrapTokens.cpp index 8d4f629cbb..c8f7fa2e4a 100644 --- a/pxr/usd/usdHydra/wrapTokens.cpp +++ b/pxr/usd/usdHydra/wrapTokens.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // // GENERATED FILE. DO NOT EDIT. #include diff --git a/pxr/usd/usdLux/__init__.py b/pxr/usd/usdLux/__init__.py index 71d85c6b0e..1fadb021f2 100644 --- a/pxr/usd/usdLux/__init__.py +++ b/pxr/usd/usdLux/__init__.py @@ -1,25 +1,8 @@ # # Copyright 2016 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # from pxr import Tf Tf.PreparePythonModule() diff --git a/pxr/usd/usdLux/api.h b/pxr/usd/usdLux/api.h index 0d91698feb..028511e770 100644 --- a/pxr/usd/usdLux/api.h +++ b/pxr/usd/usdLux/api.h @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDLUX_API_H #define USDLUX_API_H diff --git a/pxr/usd/usdLux/blackbody.cpp b/pxr/usd/usdLux/blackbody.cpp index 05cf21ceb7..3b1b0bd04f 100644 --- a/pxr/usd/usdLux/blackbody.cpp +++ b/pxr/usd/usdLux/blackbody.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdLux/blackbody.h" #include "pxr/base/gf/math.h" diff --git a/pxr/usd/usdLux/blackbody.h b/pxr/usd/usdLux/blackbody.h index 2c7aa177c8..34e14f8596 100644 --- a/pxr/usd/usdLux/blackbody.h +++ b/pxr/usd/usdLux/blackbody.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_LUX_BLACKBODY_H #define PXR_USD_USD_LUX_BLACKBODY_H diff --git a/pxr/usd/usdLux/boundableLightBase.cpp b/pxr/usd/usdLux/boundableLightBase.cpp index 9b5b0af0ad..f1ba90cdb9 100644 --- a/pxr/usd/usdLux/boundableLightBase.cpp +++ b/pxr/usd/usdLux/boundableLightBase.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdLux/boundableLightBase.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usdLux/boundableLightBase.h b/pxr/usd/usdLux/boundableLightBase.h index 9177de300e..f48f2d11f5 100644 --- a/pxr/usd/usdLux/boundableLightBase.h +++ b/pxr/usd/usdLux/boundableLightBase.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDLUX_GENERATED_BOUNDABLELIGHTBASE_H #define USDLUX_GENERATED_BOUNDABLELIGHTBASE_H diff --git a/pxr/usd/usdLux/cylinderLight.cpp b/pxr/usd/usdLux/cylinderLight.cpp index ef4fbfd003..9de2f0d388 100644 --- a/pxr/usd/usdLux/cylinderLight.cpp +++ b/pxr/usd/usdLux/cylinderLight.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdLux/cylinderLight.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usdLux/cylinderLight.h b/pxr/usd/usdLux/cylinderLight.h index 5590cefb6e..5c257f4655 100644 --- a/pxr/usd/usdLux/cylinderLight.h +++ b/pxr/usd/usdLux/cylinderLight.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDLUX_GENERATED_CYLINDERLIGHT_H #define USDLUX_GENERATED_CYLINDERLIGHT_H diff --git a/pxr/usd/usdLux/discoveryPlugin.cpp b/pxr/usd/usdLux/discoveryPlugin.cpp index a1a5c5d7ba..2374c0e6a6 100644 --- a/pxr/usd/usdLux/discoveryPlugin.cpp +++ b/pxr/usd/usdLux/discoveryPlugin.cpp @@ -1,25 +1,8 @@ // // Copyright 2020 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdLux/discoveryPlugin.h" diff --git a/pxr/usd/usdLux/discoveryPlugin.h b/pxr/usd/usdLux/discoveryPlugin.h index 114ae13bfc..4b186dd4df 100644 --- a/pxr/usd/usdLux/discoveryPlugin.h +++ b/pxr/usd/usdLux/discoveryPlugin.h @@ -1,25 +1,8 @@ // // Copyright 2020 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USDLUX_DISCOVERY_PLUGIN_H #define PXR_USD_USDLUX_DISCOVERY_PLUGIN_H diff --git a/pxr/usd/usdLux/diskLight.cpp b/pxr/usd/usdLux/diskLight.cpp index 3a5eb0afbe..79ba9b0dec 100644 --- a/pxr/usd/usdLux/diskLight.cpp +++ b/pxr/usd/usdLux/diskLight.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdLux/diskLight.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usdLux/diskLight.h b/pxr/usd/usdLux/diskLight.h index 30569d4eb0..5c9faa0177 100644 --- a/pxr/usd/usdLux/diskLight.h +++ b/pxr/usd/usdLux/diskLight.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDLUX_GENERATED_DISKLIGHT_H #define USDLUX_GENERATED_DISKLIGHT_H diff --git a/pxr/usd/usdLux/distantLight.cpp b/pxr/usd/usdLux/distantLight.cpp index 1a4f544148..65fdb73979 100644 --- a/pxr/usd/usdLux/distantLight.cpp +++ b/pxr/usd/usdLux/distantLight.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdLux/distantLight.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usdLux/distantLight.h b/pxr/usd/usdLux/distantLight.h index 8d04b68af9..d89d005cca 100644 --- a/pxr/usd/usdLux/distantLight.h +++ b/pxr/usd/usdLux/distantLight.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDLUX_GENERATED_DISTANTLIGHT_H #define USDLUX_GENERATED_DISTANTLIGHT_H diff --git a/pxr/usd/usdLux/domeLight.cpp b/pxr/usd/usdLux/domeLight.cpp index 8de0328d22..9b7a23a85a 100644 --- a/pxr/usd/usdLux/domeLight.cpp +++ b/pxr/usd/usdLux/domeLight.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdLux/domeLight.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usdLux/domeLight.h b/pxr/usd/usdLux/domeLight.h index 39215025cb..39bd7e10ca 100644 --- a/pxr/usd/usdLux/domeLight.h +++ b/pxr/usd/usdLux/domeLight.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDLUX_GENERATED_DOMELIGHT_H #define USDLUX_GENERATED_DOMELIGHT_H diff --git a/pxr/usd/usdLux/domeLight_1.cpp b/pxr/usd/usdLux/domeLight_1.cpp index 89cccf36d3..b543a7eb97 100644 --- a/pxr/usd/usdLux/domeLight_1.cpp +++ b/pxr/usd/usdLux/domeLight_1.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdLux/domeLight_1.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usdLux/domeLight_1.h b/pxr/usd/usdLux/domeLight_1.h index 86c649d894..c0dd7af47d 100644 --- a/pxr/usd/usdLux/domeLight_1.h +++ b/pxr/usd/usdLux/domeLight_1.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDLUX_GENERATED_DOMELIGHT_1_H #define USDLUX_GENERATED_DOMELIGHT_1_H diff --git a/pxr/usd/usdLux/geometryLight.cpp b/pxr/usd/usdLux/geometryLight.cpp index 3981eb25fa..75b20ebc1f 100644 --- a/pxr/usd/usdLux/geometryLight.cpp +++ b/pxr/usd/usdLux/geometryLight.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdLux/geometryLight.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usdLux/geometryLight.h b/pxr/usd/usdLux/geometryLight.h index d1cb380118..c0952d4d6b 100644 --- a/pxr/usd/usdLux/geometryLight.h +++ b/pxr/usd/usdLux/geometryLight.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDLUX_GENERATED_GEOMETRYLIGHT_H #define USDLUX_GENERATED_GEOMETRYLIGHT_H diff --git a/pxr/usd/usdLux/lightAPI.cpp b/pxr/usd/usdLux/lightAPI.cpp index 57b5e49cda..3feaf0b117 100644 --- a/pxr/usd/usdLux/lightAPI.cpp +++ b/pxr/usd/usdLux/lightAPI.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdLux/lightAPI.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usdLux/lightAPI.h b/pxr/usd/usdLux/lightAPI.h index 1ea31f3fba..457d12aae5 100644 --- a/pxr/usd/usdLux/lightAPI.h +++ b/pxr/usd/usdLux/lightAPI.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDLUX_GENERATED_LIGHTAPI_H #define USDLUX_GENERATED_LIGHTAPI_H diff --git a/pxr/usd/usdLux/lightDefParser.cpp b/pxr/usd/usdLux/lightDefParser.cpp index e790474882..7d030af228 100644 --- a/pxr/usd/usdLux/lightDefParser.cpp +++ b/pxr/usd/usdLux/lightDefParser.cpp @@ -1,25 +1,8 @@ // // Copyright 2020 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdLux/lightDefParser.h" diff --git a/pxr/usd/usdLux/lightDefParser.h b/pxr/usd/usdLux/lightDefParser.h index 7bfca8d187..28eca2b03d 100644 --- a/pxr/usd/usdLux/lightDefParser.h +++ b/pxr/usd/usdLux/lightDefParser.h @@ -1,25 +1,8 @@ // // Copyright 2020 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_LUX_LIGHT_DEF_PARSER_H #define PXR_USD_USD_LUX_LIGHT_DEF_PARSER_H diff --git a/pxr/usd/usdLux/lightFilter.cpp b/pxr/usd/usdLux/lightFilter.cpp index 7b30de3354..5364c5b84b 100644 --- a/pxr/usd/usdLux/lightFilter.cpp +++ b/pxr/usd/usdLux/lightFilter.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdLux/lightFilter.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usdLux/lightFilter.h b/pxr/usd/usdLux/lightFilter.h index a52317e115..ce5f057f4b 100644 --- a/pxr/usd/usdLux/lightFilter.h +++ b/pxr/usd/usdLux/lightFilter.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDLUX_GENERATED_LIGHTFILTER_H #define USDLUX_GENERATED_LIGHTFILTER_H diff --git a/pxr/usd/usdLux/lightListAPI.cpp b/pxr/usd/usdLux/lightListAPI.cpp index 8523971c68..207bdc272f 100644 --- a/pxr/usd/usdLux/lightListAPI.cpp +++ b/pxr/usd/usdLux/lightListAPI.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdLux/lightListAPI.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usdLux/lightListAPI.h b/pxr/usd/usdLux/lightListAPI.h index 7b55f61022..b07d0e790e 100644 --- a/pxr/usd/usdLux/lightListAPI.h +++ b/pxr/usd/usdLux/lightListAPI.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDLUX_GENERATED_LIGHTLISTAPI_H #define USDLUX_GENERATED_LIGHTLISTAPI_H diff --git a/pxr/usd/usdLux/listAPI.cpp b/pxr/usd/usdLux/listAPI.cpp index 4f98f6f655..2e860768cd 100644 --- a/pxr/usd/usdLux/listAPI.cpp +++ b/pxr/usd/usdLux/listAPI.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdLux/listAPI.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usdLux/listAPI.h b/pxr/usd/usdLux/listAPI.h index 0ac13b84d4..46b67a52cd 100644 --- a/pxr/usd/usdLux/listAPI.h +++ b/pxr/usd/usdLux/listAPI.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDLUX_GENERATED_LISTAPI_H #define USDLUX_GENERATED_LISTAPI_H diff --git a/pxr/usd/usdLux/meshLightAPI.cpp b/pxr/usd/usdLux/meshLightAPI.cpp index b71f57ea27..eb4efb1e38 100644 --- a/pxr/usd/usdLux/meshLightAPI.cpp +++ b/pxr/usd/usdLux/meshLightAPI.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdLux/meshLightAPI.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usdLux/meshLightAPI.h b/pxr/usd/usdLux/meshLightAPI.h index 8bbb5abb51..144683370d 100644 --- a/pxr/usd/usdLux/meshLightAPI.h +++ b/pxr/usd/usdLux/meshLightAPI.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDLUX_GENERATED_MESHLIGHTAPI_H #define USDLUX_GENERATED_MESHLIGHTAPI_H diff --git a/pxr/usd/usdLux/module.cpp b/pxr/usd/usdLux/module.cpp index 615e6d2e36..2479ecaa30 100644 --- a/pxr/usd/usdLux/module.cpp +++ b/pxr/usd/usdLux/module.cpp @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usdLux/blackbody.h" diff --git a/pxr/usd/usdLux/moduleDeps.cpp b/pxr/usd/usdLux/moduleDeps.cpp index 9bee400a2d..ce3bae2190 100644 --- a/pxr/usd/usdLux/moduleDeps.cpp +++ b/pxr/usd/usdLux/moduleDeps.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/pxr/usd/usdLux/nonboundableLightBase.cpp b/pxr/usd/usdLux/nonboundableLightBase.cpp index 94f8aec2b6..9e2c9b1764 100644 --- a/pxr/usd/usdLux/nonboundableLightBase.cpp +++ b/pxr/usd/usdLux/nonboundableLightBase.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdLux/nonboundableLightBase.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usdLux/nonboundableLightBase.h b/pxr/usd/usdLux/nonboundableLightBase.h index 2d9a23dfe6..d0cd9fe840 100644 --- a/pxr/usd/usdLux/nonboundableLightBase.h +++ b/pxr/usd/usdLux/nonboundableLightBase.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDLUX_GENERATED_NONBOUNDABLELIGHTBASE_H #define USDLUX_GENERATED_NONBOUNDABLELIGHTBASE_H diff --git a/pxr/usd/usdLux/pch.h b/pxr/usd/usdLux/pch.h index 8fe34cb954..4b1e8f8001 100644 --- a/pxr/usd/usdLux/pch.h +++ b/pxr/usd/usdLux/pch.h @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // // WARNING: THIS FILE IS GENERATED. DO NOT EDIT. // @@ -31,6 +14,7 @@ #include #endif #if defined(ARCH_OS_LINUX) +#include #include #endif #if defined(ARCH_OS_WINDOWS) @@ -38,12 +22,11 @@ #define WIN32_LEAN_AND_MEAN #endif +#include #include -#include -#include -#include #endif #include +#include #include #include #include @@ -69,6 +52,8 @@ #include #include #include +#include +#include #include #include #include @@ -77,60 +62,15 @@ #include #include #include +#include #include #include #include #include #include #include +#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #ifdef PXR_PYTHON_SUPPORT_ENABLED #include #include @@ -149,6 +89,7 @@ #include #include #include +#include #include #include #include @@ -158,27 +99,9 @@ #undef toupper #endif #endif // PXR_PYTHON_SUPPORT_ENABLED -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include #include +#include #include #include #include @@ -186,7 +109,7 @@ #include #include #include -#include +#include #ifdef PXR_PYTHON_SUPPORT_ENABLED #include "pxr/base/tf/pySafePython.h" #endif // PXR_PYTHON_SUPPORT_ENABLED diff --git a/pxr/usd/usdLux/pluginLight.cpp b/pxr/usd/usdLux/pluginLight.cpp index 218b7a8345..1ab84197c5 100644 --- a/pxr/usd/usdLux/pluginLight.cpp +++ b/pxr/usd/usdLux/pluginLight.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdLux/pluginLight.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usdLux/pluginLight.h b/pxr/usd/usdLux/pluginLight.h index 4c70804dc8..ae738cadd4 100644 --- a/pxr/usd/usdLux/pluginLight.h +++ b/pxr/usd/usdLux/pluginLight.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDLUX_GENERATED_PLUGINLIGHT_H #define USDLUX_GENERATED_PLUGINLIGHT_H diff --git a/pxr/usd/usdLux/pluginLightFilter.cpp b/pxr/usd/usdLux/pluginLightFilter.cpp index 8686cd12fa..3953b0834b 100644 --- a/pxr/usd/usdLux/pluginLightFilter.cpp +++ b/pxr/usd/usdLux/pluginLightFilter.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdLux/pluginLightFilter.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usdLux/pluginLightFilter.h b/pxr/usd/usdLux/pluginLightFilter.h index 8e2a0557f9..5dae8407fc 100644 --- a/pxr/usd/usdLux/pluginLightFilter.h +++ b/pxr/usd/usdLux/pluginLightFilter.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDLUX_GENERATED_PLUGINLIGHTFILTER_H #define USDLUX_GENERATED_PLUGINLIGHTFILTER_H diff --git a/pxr/usd/usdLux/portalLight.cpp b/pxr/usd/usdLux/portalLight.cpp index afc43bd7a7..198d8c3bd3 100644 --- a/pxr/usd/usdLux/portalLight.cpp +++ b/pxr/usd/usdLux/portalLight.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdLux/portalLight.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usdLux/portalLight.h b/pxr/usd/usdLux/portalLight.h index 7a349f9f3e..094def6f3d 100644 --- a/pxr/usd/usdLux/portalLight.h +++ b/pxr/usd/usdLux/portalLight.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDLUX_GENERATED_PORTALLIGHT_H #define USDLUX_GENERATED_PORTALLIGHT_H diff --git a/pxr/usd/usdLux/rectLight.cpp b/pxr/usd/usdLux/rectLight.cpp index 4e369bee4e..e211c6b98d 100644 --- a/pxr/usd/usdLux/rectLight.cpp +++ b/pxr/usd/usdLux/rectLight.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdLux/rectLight.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usdLux/rectLight.h b/pxr/usd/usdLux/rectLight.h index 3c42040a0a..377c2678e9 100644 --- a/pxr/usd/usdLux/rectLight.h +++ b/pxr/usd/usdLux/rectLight.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDLUX_GENERATED_RECTLIGHT_H #define USDLUX_GENERATED_RECTLIGHT_H diff --git a/pxr/usd/usdLux/shadowAPI.cpp b/pxr/usd/usdLux/shadowAPI.cpp index 8875c3b6b8..dbbf9b26ec 100644 --- a/pxr/usd/usdLux/shadowAPI.cpp +++ b/pxr/usd/usdLux/shadowAPI.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdLux/shadowAPI.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usdLux/shadowAPI.h b/pxr/usd/usdLux/shadowAPI.h index efb6b25a98..06e4242b84 100644 --- a/pxr/usd/usdLux/shadowAPI.h +++ b/pxr/usd/usdLux/shadowAPI.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDLUX_GENERATED_SHADOWAPI_H #define USDLUX_GENERATED_SHADOWAPI_H diff --git a/pxr/usd/usdLux/shapingAPI.cpp b/pxr/usd/usdLux/shapingAPI.cpp index e495221855..3ef1d623fd 100644 --- a/pxr/usd/usdLux/shapingAPI.cpp +++ b/pxr/usd/usdLux/shapingAPI.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdLux/shapingAPI.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usdLux/shapingAPI.h b/pxr/usd/usdLux/shapingAPI.h index adda4fb904..5c7304eac1 100644 --- a/pxr/usd/usdLux/shapingAPI.h +++ b/pxr/usd/usdLux/shapingAPI.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDLUX_GENERATED_SHAPINGAPI_H #define USDLUX_GENERATED_SHAPINGAPI_H diff --git a/pxr/usd/usdLux/sphereLight.cpp b/pxr/usd/usdLux/sphereLight.cpp index f7669e1ad1..6af5f6fe0c 100644 --- a/pxr/usd/usdLux/sphereLight.cpp +++ b/pxr/usd/usdLux/sphereLight.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdLux/sphereLight.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usdLux/sphereLight.h b/pxr/usd/usdLux/sphereLight.h index e17d52ea6c..e39ccbbeda 100644 --- a/pxr/usd/usdLux/sphereLight.h +++ b/pxr/usd/usdLux/sphereLight.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDLUX_GENERATED_SPHERELIGHT_H #define USDLUX_GENERATED_SPHERELIGHT_H diff --git a/pxr/usd/usdLux/testenv/testUsdLuxLight.py b/pxr/usd/usdLux/testenv/testUsdLuxLight.py index 67cde135e8..91e33e96c5 100644 --- a/pxr/usd/usdLux/testenv/testUsdLuxLight.py +++ b/pxr/usd/usdLux/testenv/testUsdLuxLight.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from __future__ import print_function diff --git a/pxr/usd/usdLux/testenv/testUsdLuxLightListAPI.py b/pxr/usd/usdLux/testenv/testUsdLuxLightListAPI.py index 0ea48011a2..9d6fcffdc1 100644 --- a/pxr/usd/usdLux/testenv/testUsdLuxLightListAPI.py +++ b/pxr/usd/usdLux/testenv/testUsdLuxLightListAPI.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from pxr import Usd, UsdGeom, UsdLux, Vt, Sdf import unittest diff --git a/pxr/usd/usdLux/testenv/testUsdLuxLinkingAPI.py b/pxr/usd/usdLux/testenv/testUsdLuxLinkingAPI.py index 5ca23cad50..0830785a8c 100644 --- a/pxr/usd/usdLux/testenv/testUsdLuxLinkingAPI.py +++ b/pxr/usd/usdLux/testenv/testUsdLuxLinkingAPI.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from pxr import Usd, UsdGeom, UsdLux, Vt, Sdf import unittest diff --git a/pxr/usd/usdLux/tokens.cpp b/pxr/usd/usdLux/tokens.cpp index dbada86c2c..9ec0a18cac 100644 --- a/pxr/usd/usdLux/tokens.cpp +++ b/pxr/usd/usdLux/tokens.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdLux/tokens.h" diff --git a/pxr/usd/usdLux/tokens.h b/pxr/usd/usdLux/tokens.h index 865a77cea5..fa09f3c256 100644 --- a/pxr/usd/usdLux/tokens.h +++ b/pxr/usd/usdLux/tokens.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDLUX_TOKENS_H #define USDLUX_TOKENS_H diff --git a/pxr/usd/usdLux/volumeLightAPI.cpp b/pxr/usd/usdLux/volumeLightAPI.cpp index 476653ac20..04c9f603fc 100644 --- a/pxr/usd/usdLux/volumeLightAPI.cpp +++ b/pxr/usd/usdLux/volumeLightAPI.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdLux/volumeLightAPI.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usdLux/volumeLightAPI.h b/pxr/usd/usdLux/volumeLightAPI.h index e66070fcdd..3c8812e55d 100644 --- a/pxr/usd/usdLux/volumeLightAPI.h +++ b/pxr/usd/usdLux/volumeLightAPI.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDLUX_GENERATED_VOLUMELIGHTAPI_H #define USDLUX_GENERATED_VOLUMELIGHTAPI_H diff --git a/pxr/usd/usdLux/wrapBoundableLightBase.cpp b/pxr/usd/usdLux/wrapBoundableLightBase.cpp index 1fe522ad65..3be67948cb 100644 --- a/pxr/usd/usdLux/wrapBoundableLightBase.cpp +++ b/pxr/usd/usdLux/wrapBoundableLightBase.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdLux/boundableLightBase.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdLux/wrapCylinderLight.cpp b/pxr/usd/usdLux/wrapCylinderLight.cpp index 8d7c7f0525..f887c4c568 100644 --- a/pxr/usd/usdLux/wrapCylinderLight.cpp +++ b/pxr/usd/usdLux/wrapCylinderLight.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdLux/cylinderLight.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdLux/wrapDiskLight.cpp b/pxr/usd/usdLux/wrapDiskLight.cpp index 76296e6c91..efa4e905de 100644 --- a/pxr/usd/usdLux/wrapDiskLight.cpp +++ b/pxr/usd/usdLux/wrapDiskLight.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdLux/diskLight.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdLux/wrapDistantLight.cpp b/pxr/usd/usdLux/wrapDistantLight.cpp index acd6c62c90..235855e907 100644 --- a/pxr/usd/usdLux/wrapDistantLight.cpp +++ b/pxr/usd/usdLux/wrapDistantLight.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdLux/distantLight.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdLux/wrapDomeLight.cpp b/pxr/usd/usdLux/wrapDomeLight.cpp index 8479d530ba..025316e446 100644 --- a/pxr/usd/usdLux/wrapDomeLight.cpp +++ b/pxr/usd/usdLux/wrapDomeLight.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdLux/domeLight.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdLux/wrapDomeLight_1.cpp b/pxr/usd/usdLux/wrapDomeLight_1.cpp index 59460105e5..bf79258d41 100644 --- a/pxr/usd/usdLux/wrapDomeLight_1.cpp +++ b/pxr/usd/usdLux/wrapDomeLight_1.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdLux/domeLight_1.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdLux/wrapGeometryLight.cpp b/pxr/usd/usdLux/wrapGeometryLight.cpp index 169c3cc9c6..8eea077a22 100644 --- a/pxr/usd/usdLux/wrapGeometryLight.cpp +++ b/pxr/usd/usdLux/wrapGeometryLight.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdLux/geometryLight.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdLux/wrapLightAPI.cpp b/pxr/usd/usdLux/wrapLightAPI.cpp index 4b1ce738ae..910d681226 100644 --- a/pxr/usd/usdLux/wrapLightAPI.cpp +++ b/pxr/usd/usdLux/wrapLightAPI.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdLux/lightAPI.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdLux/wrapLightFilter.cpp b/pxr/usd/usdLux/wrapLightFilter.cpp index b008a7f90a..cd57290b18 100644 --- a/pxr/usd/usdLux/wrapLightFilter.cpp +++ b/pxr/usd/usdLux/wrapLightFilter.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdLux/lightFilter.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdLux/wrapLightListAPI.cpp b/pxr/usd/usdLux/wrapLightListAPI.cpp index cdf9d61ea8..893c98f582 100644 --- a/pxr/usd/usdLux/wrapLightListAPI.cpp +++ b/pxr/usd/usdLux/wrapLightListAPI.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdLux/lightListAPI.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdLux/wrapListAPI.cpp b/pxr/usd/usdLux/wrapListAPI.cpp index ad00789d27..6dbd020531 100644 --- a/pxr/usd/usdLux/wrapListAPI.cpp +++ b/pxr/usd/usdLux/wrapListAPI.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdLux/listAPI.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdLux/wrapMeshLightAPI.cpp b/pxr/usd/usdLux/wrapMeshLightAPI.cpp index dd2cb7f9ff..29106da301 100644 --- a/pxr/usd/usdLux/wrapMeshLightAPI.cpp +++ b/pxr/usd/usdLux/wrapMeshLightAPI.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdLux/meshLightAPI.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdLux/wrapNonboundableLightBase.cpp b/pxr/usd/usdLux/wrapNonboundableLightBase.cpp index 898b0fae86..73282af967 100644 --- a/pxr/usd/usdLux/wrapNonboundableLightBase.cpp +++ b/pxr/usd/usdLux/wrapNonboundableLightBase.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdLux/nonboundableLightBase.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdLux/wrapPluginLight.cpp b/pxr/usd/usdLux/wrapPluginLight.cpp index 5632703964..ee1bdfee01 100644 --- a/pxr/usd/usdLux/wrapPluginLight.cpp +++ b/pxr/usd/usdLux/wrapPluginLight.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdLux/pluginLight.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdLux/wrapPluginLightFilter.cpp b/pxr/usd/usdLux/wrapPluginLightFilter.cpp index ab561ab5e8..e2b4840789 100644 --- a/pxr/usd/usdLux/wrapPluginLightFilter.cpp +++ b/pxr/usd/usdLux/wrapPluginLightFilter.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdLux/pluginLightFilter.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdLux/wrapPortalLight.cpp b/pxr/usd/usdLux/wrapPortalLight.cpp index c3ae9333fb..5ba12b2a4c 100644 --- a/pxr/usd/usdLux/wrapPortalLight.cpp +++ b/pxr/usd/usdLux/wrapPortalLight.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdLux/portalLight.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdLux/wrapRectLight.cpp b/pxr/usd/usdLux/wrapRectLight.cpp index dc1d482d4d..ae510e20e0 100644 --- a/pxr/usd/usdLux/wrapRectLight.cpp +++ b/pxr/usd/usdLux/wrapRectLight.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdLux/rectLight.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdLux/wrapShadowAPI.cpp b/pxr/usd/usdLux/wrapShadowAPI.cpp index 7f25b8eaae..286c27efb5 100644 --- a/pxr/usd/usdLux/wrapShadowAPI.cpp +++ b/pxr/usd/usdLux/wrapShadowAPI.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdLux/shadowAPI.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdLux/wrapShapingAPI.cpp b/pxr/usd/usdLux/wrapShapingAPI.cpp index c8738b0804..13ab2f6434 100644 --- a/pxr/usd/usdLux/wrapShapingAPI.cpp +++ b/pxr/usd/usdLux/wrapShapingAPI.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdLux/shapingAPI.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdLux/wrapSphereLight.cpp b/pxr/usd/usdLux/wrapSphereLight.cpp index cd0b7c2620..3f332c9806 100644 --- a/pxr/usd/usdLux/wrapSphereLight.cpp +++ b/pxr/usd/usdLux/wrapSphereLight.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdLux/sphereLight.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdLux/wrapTokens.cpp b/pxr/usd/usdLux/wrapTokens.cpp index 4428da276f..ddbc3393bc 100644 --- a/pxr/usd/usdLux/wrapTokens.cpp +++ b/pxr/usd/usdLux/wrapTokens.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // // GENERATED FILE. DO NOT EDIT. #include diff --git a/pxr/usd/usdLux/wrapVolumeLightAPI.cpp b/pxr/usd/usdLux/wrapVolumeLightAPI.cpp index 6b9e04b6db..179cc8ea20 100644 --- a/pxr/usd/usdLux/wrapVolumeLightAPI.cpp +++ b/pxr/usd/usdLux/wrapVolumeLightAPI.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdLux/volumeLightAPI.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdMedia/__init__.py b/pxr/usd/usdMedia/__init__.py index 8c0dabcdfb..3ad26ffd3c 100644 --- a/pxr/usd/usdMedia/__init__.py +++ b/pxr/usd/usdMedia/__init__.py @@ -1,25 +1,8 @@ # # Copyright 2019 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # from pxr import Tf Tf.PreparePythonModule() diff --git a/pxr/usd/usdMedia/api.h b/pxr/usd/usdMedia/api.h index b3fc79755b..952e8c7947 100644 --- a/pxr/usd/usdMedia/api.h +++ b/pxr/usd/usdMedia/api.h @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDMEDIA_API_H #define USDMEDIA_API_H diff --git a/pxr/usd/usdMedia/assetPreviewsAPI.cpp b/pxr/usd/usdMedia/assetPreviewsAPI.cpp index 0c715d065d..db28499bc0 100644 --- a/pxr/usd/usdMedia/assetPreviewsAPI.cpp +++ b/pxr/usd/usdMedia/assetPreviewsAPI.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdMedia/assetPreviewsAPI.h" #include "pxr/usd/usd/schemaRegistry.h" @@ -210,13 +193,12 @@ UsdMediaAssetPreviewsAPI::GetAssetDefaultPreviews(const SdfLayerHandle &layer) return UsdMediaAssetPreviewsAPI(); } - TfToken defaultPrimName = layer->GetDefaultPrim(); - if (defaultPrimName.IsEmpty()) { + SdfPath defaultPrimPath = layer->GetDefaultPrimAsPath(); + if (defaultPrimPath.IsEmpty()) { return UsdMediaAssetPreviewsAPI(); } static const TfToken noSuchPrim("__No_Such_Prim__"); - SdfPath defaultPrimPath = SdfPath::AbsoluteRootPath().AppendChild(defaultPrimName); // Technique to limit population to a maximum depth SdfPath maskPath = defaultPrimPath.AppendChild(noSuchPrim); UsdStagePopulationMask mask({ maskPath }); diff --git a/pxr/usd/usdMedia/assetPreviewsAPI.h b/pxr/usd/usdMedia/assetPreviewsAPI.h index f4330ab07b..855f89af24 100644 --- a/pxr/usd/usdMedia/assetPreviewsAPI.h +++ b/pxr/usd/usdMedia/assetPreviewsAPI.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDMEDIA_GENERATED_ASSETPREVIEWSAPI_H #define USDMEDIA_GENERATED_ASSETPREVIEWSAPI_H diff --git a/pxr/usd/usdMedia/module.cpp b/pxr/usd/usdMedia/module.cpp index 32b60317c4..926972e471 100644 --- a/pxr/usd/usdMedia/module.cpp +++ b/pxr/usd/usdMedia/module.cpp @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/base/tf/pyModule.h" diff --git a/pxr/usd/usdMedia/moduleDeps.cpp b/pxr/usd/usdMedia/moduleDeps.cpp index 89505df7a9..7af27823ab 100644 --- a/pxr/usd/usdMedia/moduleDeps.cpp +++ b/pxr/usd/usdMedia/moduleDeps.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/pxr/usd/usdMedia/pch.h b/pxr/usd/usdMedia/pch.h index 7802ec3e2d..cd2273423e 100644 --- a/pxr/usd/usdMedia/pch.h +++ b/pxr/usd/usdMedia/pch.h @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // // WARNING: THIS FILE IS GENERATED. DO NOT EDIT. // @@ -31,6 +14,7 @@ #include #endif #if defined(ARCH_OS_LINUX) +#include #include #endif #if defined(ARCH_OS_WINDOWS) @@ -38,12 +22,11 @@ #define WIN32_LEAN_AND_MEAN #endif +#include #include -#include -#include -#include #endif #include +#include #include #include #include @@ -67,8 +50,9 @@ #include #include #include -#include #include +#include +#include #include #include #include @@ -77,60 +61,15 @@ #include #include #include +#include #include #include #include #include #include #include +#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #ifdef PXR_PYTHON_SUPPORT_ENABLED #include #include @@ -143,6 +82,8 @@ #include #include #include +#include +#include #include #include #include @@ -151,27 +92,9 @@ #undef toupper #endif #endif // PXR_PYTHON_SUPPORT_ENABLED -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include #include +#include #include #include #include @@ -179,7 +102,7 @@ #include #include #include -#include +#include #ifdef PXR_PYTHON_SUPPORT_ENABLED #include "pxr/base/tf/pySafePython.h" #endif // PXR_PYTHON_SUPPORT_ENABLED diff --git a/pxr/usd/usdMedia/spatialAudio.cpp b/pxr/usd/usdMedia/spatialAudio.cpp index 8dc0fa8002..637bfc5ff6 100644 --- a/pxr/usd/usdMedia/spatialAudio.cpp +++ b/pxr/usd/usdMedia/spatialAudio.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdMedia/spatialAudio.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usdMedia/spatialAudio.h b/pxr/usd/usdMedia/spatialAudio.h index 81bf2740cc..e4ffea3ba7 100644 --- a/pxr/usd/usdMedia/spatialAudio.h +++ b/pxr/usd/usdMedia/spatialAudio.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDMEDIA_GENERATED_SPATIALAUDIO_H #define USDMEDIA_GENERATED_SPATIALAUDIO_H diff --git a/pxr/usd/usdMedia/testenv/testUsdMediaAssetPreviewsAPI.py b/pxr/usd/usdMedia/testenv/testUsdMediaAssetPreviewsAPI.py index badb5bbaa3..21ea36bf52 100644 --- a/pxr/usd/usdMedia/testenv/testUsdMediaAssetPreviewsAPI.py +++ b/pxr/usd/usdMedia/testenv/testUsdMediaAssetPreviewsAPI.py @@ -2,25 +2,8 @@ # # Copyright 2022 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from pxr import Sdf, Usd, UsdGeom, UsdMedia import unittest diff --git a/pxr/usd/usdMedia/testenv/testUsdMediaSpatialAudio.py b/pxr/usd/usdMedia/testenv/testUsdMediaSpatialAudio.py index b648b5e48c..e5534fa151 100644 --- a/pxr/usd/usdMedia/testenv/testUsdMediaSpatialAudio.py +++ b/pxr/usd/usdMedia/testenv/testUsdMediaSpatialAudio.py @@ -2,25 +2,8 @@ # # Copyright 2019 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from pxr import Sdf, Usd, UsdMedia import unittest, math diff --git a/pxr/usd/usdMedia/tokens.cpp b/pxr/usd/usdMedia/tokens.cpp index b1ca1804e1..b53b1ae1bd 100644 --- a/pxr/usd/usdMedia/tokens.cpp +++ b/pxr/usd/usdMedia/tokens.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdMedia/tokens.h" diff --git a/pxr/usd/usdMedia/tokens.h b/pxr/usd/usdMedia/tokens.h index 19ac17031c..da1e6f0c30 100644 --- a/pxr/usd/usdMedia/tokens.h +++ b/pxr/usd/usdMedia/tokens.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDMEDIA_TOKENS_H #define USDMEDIA_TOKENS_H diff --git a/pxr/usd/usdMedia/wrapAssetPreviewsAPI.cpp b/pxr/usd/usdMedia/wrapAssetPreviewsAPI.cpp index 76bd7f1166..848d1b65a1 100644 --- a/pxr/usd/usdMedia/wrapAssetPreviewsAPI.cpp +++ b/pxr/usd/usdMedia/wrapAssetPreviewsAPI.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdMedia/assetPreviewsAPI.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdMedia/wrapSpatialAudio.cpp b/pxr/usd/usdMedia/wrapSpatialAudio.cpp index d77440133d..344d445e6b 100644 --- a/pxr/usd/usdMedia/wrapSpatialAudio.cpp +++ b/pxr/usd/usdMedia/wrapSpatialAudio.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdMedia/spatialAudio.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdMedia/wrapTokens.cpp b/pxr/usd/usdMedia/wrapTokens.cpp index 9abe918d4b..2b7cce3dad 100644 --- a/pxr/usd/usdMedia/wrapTokens.cpp +++ b/pxr/usd/usdMedia/wrapTokens.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // // GENERATED FILE. DO NOT EDIT. #include diff --git a/pxr/usd/usdMtlx/__init__.py b/pxr/usd/usdMtlx/__init__.py index 85c7173035..5e0d06a196 100644 --- a/pxr/usd/usdMtlx/__init__.py +++ b/pxr/usd/usdMtlx/__init__.py @@ -1,25 +1,8 @@ # # Copyright 2018 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # from pxr import Tf Tf.PreparePythonModule() diff --git a/pxr/usd/usdMtlx/api.h b/pxr/usd/usdMtlx/api.h index 49d63b982a..5d78afee19 100644 --- a/pxr/usd/usdMtlx/api.h +++ b/pxr/usd/usdMtlx/api.h @@ -1,25 +1,8 @@ // // Copyright 2018 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USDMTLX_API_H #define PXR_USD_USDMTLX_API_H diff --git a/pxr/usd/usdMtlx/backdoor.cpp b/pxr/usd/usdMtlx/backdoor.cpp index 6f11215777..e0223a7a2d 100644 --- a/pxr/usd/usdMtlx/backdoor.cpp +++ b/pxr/usd/usdMtlx/backdoor.cpp @@ -1,25 +1,8 @@ // // Copyright 2018 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/usdMtlx/backdoor.h b/pxr/usd/usdMtlx/backdoor.h index 84a34c4a61..a121364d6b 100644 --- a/pxr/usd/usdMtlx/backdoor.h +++ b/pxr/usd/usdMtlx/backdoor.h @@ -1,25 +1,8 @@ // // Copyright 2018 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USDMTLX_BACKDOOR_H #define PXR_USD_USDMTLX_BACKDOOR_H diff --git a/pxr/usd/usdMtlx/debugCodes.cpp b/pxr/usd/usdMtlx/debugCodes.cpp index fe74fca908..05a00aa44b 100644 --- a/pxr/usd/usdMtlx/debugCodes.cpp +++ b/pxr/usd/usdMtlx/debugCodes.cpp @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usdMtlx/debugCodes.h" diff --git a/pxr/usd/usdMtlx/debugCodes.h b/pxr/usd/usdMtlx/debugCodes.h index acf94cb0e6..7bc5369fb1 100644 --- a/pxr/usd/usdMtlx/debugCodes.h +++ b/pxr/usd/usdMtlx/debugCodes.h @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USDMTLX_DEBUG_CODES_H #define PXR_USD_USDMTLX_DEBUG_CODES_H diff --git a/pxr/usd/usdMtlx/discovery.cpp b/pxr/usd/usdMtlx/discovery.cpp index 439b790e73..8ae7a95943 100644 --- a/pxr/usd/usdMtlx/discovery.cpp +++ b/pxr/usd/usdMtlx/discovery.cpp @@ -1,25 +1,8 @@ // // Copyright 2018 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usdMtlx/utils.h" diff --git a/pxr/usd/usdMtlx/fileFormat.cpp b/pxr/usd/usdMtlx/fileFormat.cpp index f23265cfa1..5c1125a2c1 100644 --- a/pxr/usd/usdMtlx/fileFormat.cpp +++ b/pxr/usd/usdMtlx/fileFormat.cpp @@ -1,25 +1,8 @@ // // Copyright 2018 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usdMtlx/fileFormat.h" diff --git a/pxr/usd/usdMtlx/fileFormat.h b/pxr/usd/usdMtlx/fileFormat.h index 76273de305..7a324b6a79 100644 --- a/pxr/usd/usdMtlx/fileFormat.h +++ b/pxr/usd/usdMtlx/fileFormat.h @@ -1,25 +1,8 @@ // // Copyright 2018 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USDMTLX_FILE_FORMAT_H #define PXR_USD_USDMTLX_FILE_FORMAT_H diff --git a/pxr/usd/usdMtlx/module.cpp b/pxr/usd/usdMtlx/module.cpp index 956e1ea672..e9ba5c0f06 100644 --- a/pxr/usd/usdMtlx/module.cpp +++ b/pxr/usd/usdMtlx/module.cpp @@ -1,25 +1,8 @@ // // Copyright 2018 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/base/tf/pyModule.h" diff --git a/pxr/usd/usdMtlx/moduleDeps.cpp b/pxr/usd/usdMtlx/moduleDeps.cpp index d93fa8116b..c29310dcba 100644 --- a/pxr/usd/usdMtlx/moduleDeps.cpp +++ b/pxr/usd/usdMtlx/moduleDeps.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/pxr/usd/usdMtlx/parser.cpp b/pxr/usd/usdMtlx/parser.cpp index d635b3c15f..d01b76a53f 100644 --- a/pxr/usd/usdMtlx/parser.cpp +++ b/pxr/usd/usdMtlx/parser.cpp @@ -1,25 +1,8 @@ // // Copyright 2018 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usdMtlx/utils.h" @@ -400,9 +383,10 @@ ParseMetadata( { const auto& value = element->getAttribute(attribute); if (!value.empty()) { - // Change the 'texture2d' role for stdlib MaterialX Texture nodes - // to 'texture' for Sdr. - if (key == SdrNodeMetadata->Role && value == "texture2d") { + // Change the 'texture2d' and 'texture3d' roles for stdlib MaterialX + // Texture nodes to 'texture' for Sdr. + if (key == SdrNodeMetadata->Role && + (value == "texture2d" || value == "texture3d")) { builder->metadata[key] = "texture"; } else { diff --git a/pxr/usd/usdMtlx/pch.h b/pxr/usd/usdMtlx/pch.h index 5eba44e7ed..ee438b747c 100644 --- a/pxr/usd/usdMtlx/pch.h +++ b/pxr/usd/usdMtlx/pch.h @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // // WARNING: THIS FILE IS GENERATED. DO NOT EDIT. // @@ -48,13 +31,14 @@ #define WIN32_LEAN_AND_MEAN #endif +#include #include #include -#include -#include -#include +#include #endif #include +#include +#include #include #include #include @@ -80,8 +64,9 @@ #include #include #include -#include #include +#include +#include #include #include #include @@ -91,68 +76,21 @@ #include #include #include +#include #include #include #include #include #include #include +#include #include +#ifdef PXR_MATERIALX_SUPPORT_ENABLED #include +#include +#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#endif // PXR_MATERIALX_SUPPORT_ENABLED #ifdef PXR_PYTHON_SUPPORT_ENABLED #include #include @@ -176,25 +114,9 @@ #undef toupper #endif #endif // PXR_PYTHON_SUPPORT_ENABLED -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include #include +#include #include #include #include @@ -203,7 +125,7 @@ #include #include #include -#include +#include #ifdef PXR_PYTHON_SUPPORT_ENABLED #include "pxr/base/tf/pySafePython.h" #endif // PXR_PYTHON_SUPPORT_ENABLED diff --git a/pxr/usd/usdMtlx/reader.cpp b/pxr/usd/usdMtlx/reader.cpp index 2376223016..473a359ced 100644 --- a/pxr/usd/usdMtlx/reader.cpp +++ b/pxr/usd/usdMtlx/reader.cpp @@ -1,25 +1,8 @@ // // Copyright 2018-2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usdMtlx/debugCodes.h" @@ -1520,7 +1503,8 @@ _Context::AddShaderNode(const mx::ConstNodePtr& mtlxShaderNode) _FindMatchingNodeDef(mtlxShaderNode, mtlxShaderNode->getCategory(), UsdMtlxGetVersion(mtlxShaderNode), - mtlxShaderNode->getTarget()); + mtlxShaderNode->getTarget(), + mtlxShaderNode); } auto shaderId = _GetShaderId(mtlxNodeDef); if (shaderId.IsEmpty()) { diff --git a/pxr/usd/usdMtlx/reader.h b/pxr/usd/usdMtlx/reader.h index f98755e4c1..d742732caf 100644 --- a/pxr/usd/usdMtlx/reader.h +++ b/pxr/usd/usdMtlx/reader.h @@ -1,25 +1,8 @@ // // Copyright 2018 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USDMTLX_READER_H #define PXR_USD_USDMTLX_READER_H diff --git a/pxr/usd/usdMtlx/testenv/testUsdMtlxDiscovery.py b/pxr/usd/usdMtlx/testenv/testUsdMtlxDiscovery.py index 3d3037931c..dce2baf1b2 100644 --- a/pxr/usd/usdMtlx/testenv/testUsdMtlxDiscovery.py +++ b/pxr/usd/usdMtlx/testenv/testUsdMtlxDiscovery.py @@ -2,25 +2,8 @@ # # Copyright 2018 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. import os os.environ['PXR_MTLX_PLUGIN_SEARCH_PATHS'] = os.getcwd() diff --git a/pxr/usd/usdMtlx/testenv/testUsdMtlxFileFormat.py b/pxr/usd/usdMtlx/testenv/testUsdMtlxFileFormat.py index 26cc7a4b67..8a7ac58a24 100644 --- a/pxr/usd/usdMtlx/testenv/testUsdMtlxFileFormat.py +++ b/pxr/usd/usdMtlx/testenv/testUsdMtlxFileFormat.py @@ -2,25 +2,8 @@ # # Copyright 2018 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from __future__ import print_function from pxr import Ar, Tf, Sdf, Usd, UsdMtlx, UsdShade diff --git a/pxr/usd/usdMtlx/testenv/testUsdMtlxParser.py b/pxr/usd/usdMtlx/testenv/testUsdMtlxParser.py index fc6f8d02dd..ddbfb2ce2c 100644 --- a/pxr/usd/usdMtlx/testenv/testUsdMtlxParser.py +++ b/pxr/usd/usdMtlx/testenv/testUsdMtlxParser.py @@ -2,25 +2,8 @@ # # Copyright 2018 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. import os os.environ['PXR_MTLX_STDLIB_SEARCH_PATHS'] = os.getcwd() diff --git a/pxr/usd/usdMtlx/utils.cpp b/pxr/usd/usdMtlx/utils.cpp index 44ddcd2284..9d02f42af8 100644 --- a/pxr/usd/usdMtlx/utils.cpp +++ b/pxr/usd/usdMtlx/utils.cpp @@ -1,25 +1,8 @@ // // Copyright 2018 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usdMtlx/utils.h" diff --git a/pxr/usd/usdMtlx/utils.h b/pxr/usd/usdMtlx/utils.h index 11095ffd46..5d89893ee8 100644 --- a/pxr/usd/usdMtlx/utils.h +++ b/pxr/usd/usdMtlx/utils.h @@ -1,25 +1,8 @@ // // Copyright 2018 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USDMTLX_UTILS_H diff --git a/pxr/usd/usdMtlx/wrapBackdoor.cpp b/pxr/usd/usdMtlx/wrapBackdoor.cpp index 65e0a0411d..29722a48f0 100644 --- a/pxr/usd/usdMtlx/wrapBackdoor.cpp +++ b/pxr/usd/usdMtlx/wrapBackdoor.cpp @@ -1,25 +1,8 @@ // // Copyright 2018 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/usdPhysics/__init__.py b/pxr/usd/usdPhysics/__init__.py index 71de432ec8..4bcde7b5f4 100644 --- a/pxr/usd/usdPhysics/__init__.py +++ b/pxr/usd/usdPhysics/__init__.py @@ -7,25 +7,8 @@ # # Copyright 2016 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # from pxr import Tf Tf.PreparePythonModule() diff --git a/pxr/usd/usdPhysics/api.h b/pxr/usd/usdPhysics/api.h index 737645ea58..4bccaf0bda 100644 --- a/pxr/usd/usdPhysics/api.h +++ b/pxr/usd/usdPhysics/api.h @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDPHYSICS_API_H #define USDPHYSICS_API_H diff --git a/pxr/usd/usdPhysics/articulationRootAPI.cpp b/pxr/usd/usdPhysics/articulationRootAPI.cpp index 98d939cd53..13dba394e7 100644 --- a/pxr/usd/usdPhysics/articulationRootAPI.cpp +++ b/pxr/usd/usdPhysics/articulationRootAPI.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdPhysics/articulationRootAPI.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usdPhysics/articulationRootAPI.h b/pxr/usd/usdPhysics/articulationRootAPI.h index 2ad5daceb4..9e263768d5 100644 --- a/pxr/usd/usdPhysics/articulationRootAPI.h +++ b/pxr/usd/usdPhysics/articulationRootAPI.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDPHYSICS_GENERATED_ARTICULATIONROOTAPI_H #define USDPHYSICS_GENERATED_ARTICULATIONROOTAPI_H diff --git a/pxr/usd/usdPhysics/collisionAPI.cpp b/pxr/usd/usdPhysics/collisionAPI.cpp index 2e3319b07b..ae5c7471e7 100644 --- a/pxr/usd/usdPhysics/collisionAPI.cpp +++ b/pxr/usd/usdPhysics/collisionAPI.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdPhysics/collisionAPI.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usdPhysics/collisionAPI.h b/pxr/usd/usdPhysics/collisionAPI.h index a6e260bb77..51e1316801 100644 --- a/pxr/usd/usdPhysics/collisionAPI.h +++ b/pxr/usd/usdPhysics/collisionAPI.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDPHYSICS_GENERATED_COLLISIONAPI_H #define USDPHYSICS_GENERATED_COLLISIONAPI_H diff --git a/pxr/usd/usdPhysics/collisionGroup.cpp b/pxr/usd/usdPhysics/collisionGroup.cpp index ecf2b9040a..c82b830ae6 100644 --- a/pxr/usd/usdPhysics/collisionGroup.cpp +++ b/pxr/usd/usdPhysics/collisionGroup.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdPhysics/collisionGroup.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usdPhysics/collisionGroup.h b/pxr/usd/usdPhysics/collisionGroup.h index abab12127d..e6d180282d 100644 --- a/pxr/usd/usdPhysics/collisionGroup.h +++ b/pxr/usd/usdPhysics/collisionGroup.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDPHYSICS_GENERATED_COLLISIONGROUP_H #define USDPHYSICS_GENERATED_COLLISIONGROUP_H diff --git a/pxr/usd/usdPhysics/distanceJoint.cpp b/pxr/usd/usdPhysics/distanceJoint.cpp index 2842e3e972..fe90120d9c 100644 --- a/pxr/usd/usdPhysics/distanceJoint.cpp +++ b/pxr/usd/usdPhysics/distanceJoint.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdPhysics/distanceJoint.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usdPhysics/distanceJoint.h b/pxr/usd/usdPhysics/distanceJoint.h index 4a3f53151b..7987a6eec4 100644 --- a/pxr/usd/usdPhysics/distanceJoint.h +++ b/pxr/usd/usdPhysics/distanceJoint.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDPHYSICS_GENERATED_DISTANCEJOINT_H #define USDPHYSICS_GENERATED_DISTANCEJOINT_H diff --git a/pxr/usd/usdPhysics/driveAPI.cpp b/pxr/usd/usdPhysics/driveAPI.cpp index 26f7c78b7b..597f02894d 100644 --- a/pxr/usd/usdPhysics/driveAPI.cpp +++ b/pxr/usd/usdPhysics/driveAPI.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdPhysics/driveAPI.h" #include "pxr/usd/usd/schemaRegistry.h" @@ -28,8 +11,6 @@ #include "pxr/usd/sdf/types.h" #include "pxr/usd/sdf/assetPath.h" -#include "pxr/base/tf/staticTokens.h" - PXR_NAMESPACE_OPEN_SCOPE // Register the schema with the TfType system. @@ -40,11 +21,6 @@ TF_REGISTRY_FUNCTION(TfType) } -TF_DEFINE_PRIVATE_TOKENS( - _schemaTokens, - (drive) -); - /* virtual */ UsdPhysicsDriveAPI::~UsdPhysicsDriveAPI() { @@ -131,9 +107,9 @@ UsdPhysicsDriveAPI::IsPhysicsDriveAPIPath( } if (tokens.size() >= 2 - && tokens[0] == _schemaTokens->drive) { + && tokens[0] == UsdPhysicsTokens->drive) { *name = TfToken(propertyName.substr( - _schemaTokens->drive.GetString().size() + 1)); + UsdPhysicsTokens->drive.GetString().size() + 1)); return true; } diff --git a/pxr/usd/usdPhysics/driveAPI.h b/pxr/usd/usdPhysics/driveAPI.h index 205de77798..694e42670f 100644 --- a/pxr/usd/usdPhysics/driveAPI.h +++ b/pxr/usd/usdPhysics/driveAPI.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDPHYSICS_GENERATED_DRIVEAPI_H #define USDPHYSICS_GENERATED_DRIVEAPI_H diff --git a/pxr/usd/usdPhysics/filteredPairsAPI.cpp b/pxr/usd/usdPhysics/filteredPairsAPI.cpp index a353942e7b..2364e8fefe 100644 --- a/pxr/usd/usdPhysics/filteredPairsAPI.cpp +++ b/pxr/usd/usdPhysics/filteredPairsAPI.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdPhysics/filteredPairsAPI.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usdPhysics/filteredPairsAPI.h b/pxr/usd/usdPhysics/filteredPairsAPI.h index e2ec7d7f13..4d4e26fdaa 100644 --- a/pxr/usd/usdPhysics/filteredPairsAPI.h +++ b/pxr/usd/usdPhysics/filteredPairsAPI.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDPHYSICS_GENERATED_FILTEREDPAIRSAPI_H #define USDPHYSICS_GENERATED_FILTEREDPAIRSAPI_H diff --git a/pxr/usd/usdPhysics/fixedJoint.cpp b/pxr/usd/usdPhysics/fixedJoint.cpp index a9a0632404..bcd4f2a3a8 100644 --- a/pxr/usd/usdPhysics/fixedJoint.cpp +++ b/pxr/usd/usdPhysics/fixedJoint.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdPhysics/fixedJoint.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usdPhysics/fixedJoint.h b/pxr/usd/usdPhysics/fixedJoint.h index a26e4d3d8a..12d0e83f0b 100644 --- a/pxr/usd/usdPhysics/fixedJoint.h +++ b/pxr/usd/usdPhysics/fixedJoint.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDPHYSICS_GENERATED_FIXEDJOINT_H #define USDPHYSICS_GENERATED_FIXEDJOINT_H diff --git a/pxr/usd/usdPhysics/joint.cpp b/pxr/usd/usdPhysics/joint.cpp index e5dafca95b..cdd514d87d 100644 --- a/pxr/usd/usdPhysics/joint.cpp +++ b/pxr/usd/usdPhysics/joint.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdPhysics/joint.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usdPhysics/joint.h b/pxr/usd/usdPhysics/joint.h index 24d4a1271f..1f6a61d723 100644 --- a/pxr/usd/usdPhysics/joint.h +++ b/pxr/usd/usdPhysics/joint.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDPHYSICS_GENERATED_JOINT_H #define USDPHYSICS_GENERATED_JOINT_H diff --git a/pxr/usd/usdPhysics/limitAPI.cpp b/pxr/usd/usdPhysics/limitAPI.cpp index 836487b575..4783c7e167 100644 --- a/pxr/usd/usdPhysics/limitAPI.cpp +++ b/pxr/usd/usdPhysics/limitAPI.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdPhysics/limitAPI.h" #include "pxr/usd/usd/schemaRegistry.h" @@ -28,8 +11,6 @@ #include "pxr/usd/sdf/types.h" #include "pxr/usd/sdf/assetPath.h" -#include "pxr/base/tf/staticTokens.h" - PXR_NAMESPACE_OPEN_SCOPE // Register the schema with the TfType system. @@ -40,11 +21,6 @@ TF_REGISTRY_FUNCTION(TfType) } -TF_DEFINE_PRIVATE_TOKENS( - _schemaTokens, - (limit) -); - /* virtual */ UsdPhysicsLimitAPI::~UsdPhysicsLimitAPI() { @@ -123,9 +99,9 @@ UsdPhysicsLimitAPI::IsPhysicsLimitAPIPath( } if (tokens.size() >= 2 - && tokens[0] == _schemaTokens->limit) { + && tokens[0] == UsdPhysicsTokens->limit) { *name = TfToken(propertyName.substr( - _schemaTokens->limit.GetString().size() + 1)); + UsdPhysicsTokens->limit.GetString().size() + 1)); return true; } diff --git a/pxr/usd/usdPhysics/limitAPI.h b/pxr/usd/usdPhysics/limitAPI.h index 174012ee07..dd4d72bfd7 100644 --- a/pxr/usd/usdPhysics/limitAPI.h +++ b/pxr/usd/usdPhysics/limitAPI.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDPHYSICS_GENERATED_LIMITAPI_H #define USDPHYSICS_GENERATED_LIMITAPI_H diff --git a/pxr/usd/usdPhysics/massAPI.cpp b/pxr/usd/usdPhysics/massAPI.cpp index a0a937e961..e971bcb349 100644 --- a/pxr/usd/usdPhysics/massAPI.cpp +++ b/pxr/usd/usdPhysics/massAPI.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdPhysics/massAPI.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usdPhysics/massAPI.h b/pxr/usd/usdPhysics/massAPI.h index 32b819b5db..2a17e5c077 100644 --- a/pxr/usd/usdPhysics/massAPI.h +++ b/pxr/usd/usdPhysics/massAPI.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDPHYSICS_GENERATED_MASSAPI_H #define USDPHYSICS_GENERATED_MASSAPI_H diff --git a/pxr/usd/usdPhysics/massProperties.h b/pxr/usd/usdPhysics/massProperties.h index ed297f4228..63f8e437ac 100644 --- a/pxr/usd/usdPhysics/massProperties.h +++ b/pxr/usd/usdPhysics/massProperties.h @@ -1,25 +1,8 @@ // // Copyright 2021 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_MASS_PROPERTIES_H #define PXR_USD_USD_MASS_PROPERTIES_H diff --git a/pxr/usd/usdPhysics/materialAPI.cpp b/pxr/usd/usdPhysics/materialAPI.cpp index 1fffc6e227..7564770b0a 100644 --- a/pxr/usd/usdPhysics/materialAPI.cpp +++ b/pxr/usd/usdPhysics/materialAPI.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdPhysics/materialAPI.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usdPhysics/materialAPI.h b/pxr/usd/usdPhysics/materialAPI.h index 4f5abaad00..235549518f 100644 --- a/pxr/usd/usdPhysics/materialAPI.h +++ b/pxr/usd/usdPhysics/materialAPI.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDPHYSICS_GENERATED_MATERIALAPI_H #define USDPHYSICS_GENERATED_MATERIALAPI_H diff --git a/pxr/usd/usdPhysics/meshCollisionAPI.cpp b/pxr/usd/usdPhysics/meshCollisionAPI.cpp index 9168f40338..0113235d67 100644 --- a/pxr/usd/usdPhysics/meshCollisionAPI.cpp +++ b/pxr/usd/usdPhysics/meshCollisionAPI.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdPhysics/meshCollisionAPI.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usdPhysics/meshCollisionAPI.h b/pxr/usd/usdPhysics/meshCollisionAPI.h index 4223d562d5..a022eb92d1 100644 --- a/pxr/usd/usdPhysics/meshCollisionAPI.h +++ b/pxr/usd/usdPhysics/meshCollisionAPI.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDPHYSICS_GENERATED_MESHCOLLISIONAPI_H #define USDPHYSICS_GENERATED_MESHCOLLISIONAPI_H diff --git a/pxr/usd/usdPhysics/metrics.cpp b/pxr/usd/usdPhysics/metrics.cpp index f23a3c099b..13e012bc85 100644 --- a/pxr/usd/usdPhysics/metrics.cpp +++ b/pxr/usd/usdPhysics/metrics.cpp @@ -1,25 +1,8 @@ // // Copyright 2021 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/usdPhysics/metrics.h b/pxr/usd/usdPhysics/metrics.h index 69de3c6834..5284f07a6d 100644 --- a/pxr/usd/usdPhysics/metrics.h +++ b/pxr/usd/usdPhysics/metrics.h @@ -1,25 +1,8 @@ // // Copyright 2021 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_PHYSICS_METRICS_H #define PXR_USD_USD_PHYSICS_METRICS_H diff --git a/pxr/usd/usdPhysics/module.cpp b/pxr/usd/usdPhysics/module.cpp index 42e8bffd65..e3222be248 100644 --- a/pxr/usd/usdPhysics/module.cpp +++ b/pxr/usd/usdPhysics/module.cpp @@ -7,25 +7,8 @@ Copyright (c) 2018, NVIDIA CORPORATION // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "boost/python.hpp" #include "pxr/pxr.h" diff --git a/pxr/usd/usdPhysics/moduleDeps.cpp b/pxr/usd/usdPhysics/moduleDeps.cpp index c6b98846ac..863356ac8e 100644 --- a/pxr/usd/usdPhysics/moduleDeps.cpp +++ b/pxr/usd/usdPhysics/moduleDeps.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/pxr/usd/usdPhysics/pch.h b/pxr/usd/usdPhysics/pch.h index 824c5b0f93..eefb76388e 100644 --- a/pxr/usd/usdPhysics/pch.h +++ b/pxr/usd/usdPhysics/pch.h @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // // WARNING: THIS FILE IS GENERATED. DO NOT EDIT. // @@ -31,6 +14,7 @@ #include #endif #if defined(ARCH_OS_LINUX) +#include #include #endif #if defined(ARCH_OS_WINDOWS) @@ -38,12 +22,11 @@ #define WIN32_LEAN_AND_MEAN #endif +#include #include -#include -#include -#include #endif #include +#include #include #include #include @@ -67,9 +50,9 @@ #include #include #include -#include #include #include +#include #include #include #include @@ -78,81 +61,37 @@ #include #include #include +#include #include #include #include #include #include #include +#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #ifdef PXR_PYTHON_SUPPORT_ENABLED +#include #include +#include #include #include #include #include #include #include +#include #include #include #include -#include #include #include #include #include #include #include -#include -#include -#include +#include +#include #include #include #include @@ -161,41 +100,18 @@ #undef toupper #endif #endif // PXR_PYTHON_SUPPORT_ENABLED -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include #include +#include #include +#include #include #include #include -#include -#include -#include -#include #include #include #include -#include +#include #ifdef PXR_PYTHON_SUPPORT_ENABLED #include "pxr/base/tf/pySafePython.h" #endif // PXR_PYTHON_SUPPORT_ENABLED diff --git a/pxr/usd/usdPhysics/prismaticJoint.cpp b/pxr/usd/usdPhysics/prismaticJoint.cpp index c1cce977ad..2a2cf19efb 100644 --- a/pxr/usd/usdPhysics/prismaticJoint.cpp +++ b/pxr/usd/usdPhysics/prismaticJoint.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdPhysics/prismaticJoint.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usdPhysics/prismaticJoint.h b/pxr/usd/usdPhysics/prismaticJoint.h index 1840763e46..61e2a9fc8c 100644 --- a/pxr/usd/usdPhysics/prismaticJoint.h +++ b/pxr/usd/usdPhysics/prismaticJoint.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDPHYSICS_GENERATED_PRISMATICJOINT_H #define USDPHYSICS_GENERATED_PRISMATICJOINT_H diff --git a/pxr/usd/usdPhysics/revoluteJoint.cpp b/pxr/usd/usdPhysics/revoluteJoint.cpp index 6e52276e60..62ff838dd2 100644 --- a/pxr/usd/usdPhysics/revoluteJoint.cpp +++ b/pxr/usd/usdPhysics/revoluteJoint.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdPhysics/revoluteJoint.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usdPhysics/revoluteJoint.h b/pxr/usd/usdPhysics/revoluteJoint.h index 247a4430b0..9bdb95ac0c 100644 --- a/pxr/usd/usdPhysics/revoluteJoint.h +++ b/pxr/usd/usdPhysics/revoluteJoint.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDPHYSICS_GENERATED_REVOLUTEJOINT_H #define USDPHYSICS_GENERATED_REVOLUTEJOINT_H diff --git a/pxr/usd/usdPhysics/rigidBodyAPI.cpp b/pxr/usd/usdPhysics/rigidBodyAPI.cpp index c715a15a23..e75998d187 100644 --- a/pxr/usd/usdPhysics/rigidBodyAPI.cpp +++ b/pxr/usd/usdPhysics/rigidBodyAPI.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdPhysics/rigidBodyAPI.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usdPhysics/rigidBodyAPI.h b/pxr/usd/usdPhysics/rigidBodyAPI.h index e5cf30a539..48efa6719c 100644 --- a/pxr/usd/usdPhysics/rigidBodyAPI.h +++ b/pxr/usd/usdPhysics/rigidBodyAPI.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDPHYSICS_GENERATED_RIGIDBODYAPI_H #define USDPHYSICS_GENERATED_RIGIDBODYAPI_H diff --git a/pxr/usd/usdPhysics/scene.cpp b/pxr/usd/usdPhysics/scene.cpp index 19dea7ae6f..46a562ee34 100644 --- a/pxr/usd/usdPhysics/scene.cpp +++ b/pxr/usd/usdPhysics/scene.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdPhysics/scene.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usdPhysics/scene.h b/pxr/usd/usdPhysics/scene.h index a5ccfb1261..60c8eb5bf8 100644 --- a/pxr/usd/usdPhysics/scene.h +++ b/pxr/usd/usdPhysics/scene.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDPHYSICS_GENERATED_SCENE_H #define USDPHYSICS_GENERATED_SCENE_H diff --git a/pxr/usd/usdPhysics/sphericalJoint.cpp b/pxr/usd/usdPhysics/sphericalJoint.cpp index 4942f20ff0..560cdccdd0 100644 --- a/pxr/usd/usdPhysics/sphericalJoint.cpp +++ b/pxr/usd/usdPhysics/sphericalJoint.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdPhysics/sphericalJoint.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usdPhysics/sphericalJoint.h b/pxr/usd/usdPhysics/sphericalJoint.h index ece2e02df9..7d4a9f371f 100644 --- a/pxr/usd/usdPhysics/sphericalJoint.h +++ b/pxr/usd/usdPhysics/sphericalJoint.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDPHYSICS_GENERATED_SPHERICALJOINT_H #define USDPHYSICS_GENERATED_SPHERICALJOINT_H diff --git a/pxr/usd/usdPhysics/testenv/testUsdPhysicsCollisionGroupAPI.py b/pxr/usd/usdPhysics/testenv/testUsdPhysicsCollisionGroupAPI.py index 6beb4497f2..2f1fa3aafb 100644 --- a/pxr/usd/usdPhysics/testenv/testUsdPhysicsCollisionGroupAPI.py +++ b/pxr/usd/usdPhysics/testenv/testUsdPhysicsCollisionGroupAPI.py @@ -2,25 +2,8 @@ # # Copyright 2021 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. import sys, os, unittest from pxr import Tf, Usd, Sdf, UsdGeom, UsdShade, Gf, UsdPhysics diff --git a/pxr/usd/usdPhysics/testenv/testUsdPhysicsMetrics.py b/pxr/usd/usdPhysics/testenv/testUsdPhysicsMetrics.py index e781687793..e7d0178b3e 100644 --- a/pxr/usd/usdPhysics/testenv/testUsdPhysicsMetrics.py +++ b/pxr/usd/usdPhysics/testenv/testUsdPhysicsMetrics.py @@ -2,25 +2,8 @@ # # Copyright 2021 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. import sys, os, unittest from pxr import Tf, Usd, UsdPhysics diff --git a/pxr/usd/usdPhysics/testenv/testUsdPhysicsRigidBodyAPI.py b/pxr/usd/usdPhysics/testenv/testUsdPhysicsRigidBodyAPI.py index 781bbbb9c4..f1a4157dce 100644 --- a/pxr/usd/usdPhysics/testenv/testUsdPhysicsRigidBodyAPI.py +++ b/pxr/usd/usdPhysics/testenv/testUsdPhysicsRigidBodyAPI.py @@ -2,25 +2,8 @@ # # Copyright 2021 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from __future__ import print_function diff --git a/pxr/usd/usdPhysics/tokens.cpp b/pxr/usd/usdPhysics/tokens.cpp index c8452ccb7e..28479d5279 100644 --- a/pxr/usd/usdPhysics/tokens.cpp +++ b/pxr/usd/usdPhysics/tokens.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdPhysics/tokens.h" diff --git a/pxr/usd/usdPhysics/tokens.h b/pxr/usd/usdPhysics/tokens.h index 7aab4cabc8..f14e435e1e 100644 --- a/pxr/usd/usdPhysics/tokens.h +++ b/pxr/usd/usdPhysics/tokens.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDPHYSICS_TOKENS_H #define USDPHYSICS_TOKENS_H diff --git a/pxr/usd/usdPhysics/wrapArticulationRootAPI.cpp b/pxr/usd/usdPhysics/wrapArticulationRootAPI.cpp index 2a6af90629..ec948bfffe 100644 --- a/pxr/usd/usdPhysics/wrapArticulationRootAPI.cpp +++ b/pxr/usd/usdPhysics/wrapArticulationRootAPI.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdPhysics/articulationRootAPI.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdPhysics/wrapCollisionAPI.cpp b/pxr/usd/usdPhysics/wrapCollisionAPI.cpp index 14ffd63d24..5b1c37c13e 100644 --- a/pxr/usd/usdPhysics/wrapCollisionAPI.cpp +++ b/pxr/usd/usdPhysics/wrapCollisionAPI.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdPhysics/collisionAPI.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdPhysics/wrapCollisionGroup.cpp b/pxr/usd/usdPhysics/wrapCollisionGroup.cpp index 0e8f273a67..01d98a907a 100644 --- a/pxr/usd/usdPhysics/wrapCollisionGroup.cpp +++ b/pxr/usd/usdPhysics/wrapCollisionGroup.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdPhysics/collisionGroup.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdPhysics/wrapDistanceJoint.cpp b/pxr/usd/usdPhysics/wrapDistanceJoint.cpp index 2706183bb0..07d967a352 100644 --- a/pxr/usd/usdPhysics/wrapDistanceJoint.cpp +++ b/pxr/usd/usdPhysics/wrapDistanceJoint.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdPhysics/distanceJoint.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdPhysics/wrapDriveAPI.cpp b/pxr/usd/usdPhysics/wrapDriveAPI.cpp index b23200972f..95fa8d99a8 100644 --- a/pxr/usd/usdPhysics/wrapDriveAPI.cpp +++ b/pxr/usd/usdPhysics/wrapDriveAPI.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdPhysics/driveAPI.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdPhysics/wrapFilteredPairsAPI.cpp b/pxr/usd/usdPhysics/wrapFilteredPairsAPI.cpp index bafcdc7e0a..5bed19b960 100644 --- a/pxr/usd/usdPhysics/wrapFilteredPairsAPI.cpp +++ b/pxr/usd/usdPhysics/wrapFilteredPairsAPI.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdPhysics/filteredPairsAPI.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdPhysics/wrapFixedJoint.cpp b/pxr/usd/usdPhysics/wrapFixedJoint.cpp index c66aa79a1f..97c9d88c44 100644 --- a/pxr/usd/usdPhysics/wrapFixedJoint.cpp +++ b/pxr/usd/usdPhysics/wrapFixedJoint.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdPhysics/fixedJoint.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdPhysics/wrapJoint.cpp b/pxr/usd/usdPhysics/wrapJoint.cpp index bfd32b05dc..00a80bbe06 100644 --- a/pxr/usd/usdPhysics/wrapJoint.cpp +++ b/pxr/usd/usdPhysics/wrapJoint.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdPhysics/joint.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdPhysics/wrapLimitAPI.cpp b/pxr/usd/usdPhysics/wrapLimitAPI.cpp index ce271fb937..2a68640b45 100644 --- a/pxr/usd/usdPhysics/wrapLimitAPI.cpp +++ b/pxr/usd/usdPhysics/wrapLimitAPI.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdPhysics/limitAPI.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdPhysics/wrapMassAPI.cpp b/pxr/usd/usdPhysics/wrapMassAPI.cpp index dbd89621b5..06f5f1dcbe 100644 --- a/pxr/usd/usdPhysics/wrapMassAPI.cpp +++ b/pxr/usd/usdPhysics/wrapMassAPI.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdPhysics/massAPI.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdPhysics/wrapMaterialAPI.cpp b/pxr/usd/usdPhysics/wrapMaterialAPI.cpp index 8f59d4d0f0..1c03777b36 100644 --- a/pxr/usd/usdPhysics/wrapMaterialAPI.cpp +++ b/pxr/usd/usdPhysics/wrapMaterialAPI.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdPhysics/materialAPI.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdPhysics/wrapMeshCollisionAPI.cpp b/pxr/usd/usdPhysics/wrapMeshCollisionAPI.cpp index 0b03d816b2..fd760aa8a2 100644 --- a/pxr/usd/usdPhysics/wrapMeshCollisionAPI.cpp +++ b/pxr/usd/usdPhysics/wrapMeshCollisionAPI.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdPhysics/meshCollisionAPI.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdPhysics/wrapMetrics.cpp b/pxr/usd/usdPhysics/wrapMetrics.cpp index 6e87722384..bbe11a2296 100644 --- a/pxr/usd/usdPhysics/wrapMetrics.cpp +++ b/pxr/usd/usdPhysics/wrapMetrics.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usdPhysics/metrics.h" diff --git a/pxr/usd/usdPhysics/wrapPrismaticJoint.cpp b/pxr/usd/usdPhysics/wrapPrismaticJoint.cpp index d51de7c8a3..317e4d9590 100644 --- a/pxr/usd/usdPhysics/wrapPrismaticJoint.cpp +++ b/pxr/usd/usdPhysics/wrapPrismaticJoint.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdPhysics/prismaticJoint.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdPhysics/wrapRevoluteJoint.cpp b/pxr/usd/usdPhysics/wrapRevoluteJoint.cpp index a84d96b2b1..7fe298d6b9 100644 --- a/pxr/usd/usdPhysics/wrapRevoluteJoint.cpp +++ b/pxr/usd/usdPhysics/wrapRevoluteJoint.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdPhysics/revoluteJoint.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdPhysics/wrapRigidBodyAPI.cpp b/pxr/usd/usdPhysics/wrapRigidBodyAPI.cpp index 8935d152e9..3dec5f6ebe 100644 --- a/pxr/usd/usdPhysics/wrapRigidBodyAPI.cpp +++ b/pxr/usd/usdPhysics/wrapRigidBodyAPI.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdPhysics/rigidBodyAPI.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdPhysics/wrapScene.cpp b/pxr/usd/usdPhysics/wrapScene.cpp index 5e575ece65..703de38d5b 100644 --- a/pxr/usd/usdPhysics/wrapScene.cpp +++ b/pxr/usd/usdPhysics/wrapScene.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdPhysics/scene.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdPhysics/wrapSphericalJoint.cpp b/pxr/usd/usdPhysics/wrapSphericalJoint.cpp index 41fdc553ed..cade87a0d3 100644 --- a/pxr/usd/usdPhysics/wrapSphericalJoint.cpp +++ b/pxr/usd/usdPhysics/wrapSphericalJoint.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdPhysics/sphericalJoint.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdPhysics/wrapTokens.cpp b/pxr/usd/usdPhysics/wrapTokens.cpp index e5f2e720e5..5b89894e87 100644 --- a/pxr/usd/usdPhysics/wrapTokens.cpp +++ b/pxr/usd/usdPhysics/wrapTokens.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // // GENERATED FILE. DO NOT EDIT. #include diff --git a/pxr/usd/usdProc/__init__.py b/pxr/usd/usdProc/__init__.py index f18c7c0369..6758dd3cc1 100644 --- a/pxr/usd/usdProc/__init__.py +++ b/pxr/usd/usdProc/__init__.py @@ -1,25 +1,8 @@ # # Copyright 2022 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # from pxr import Tf Tf.PreparePythonModule() diff --git a/pxr/usd/usdProc/api.h b/pxr/usd/usdProc/api.h index bd6f224995..c32030a778 100644 --- a/pxr/usd/usdProc/api.h +++ b/pxr/usd/usdProc/api.h @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDPROC_API_H #define USDPROC_API_H diff --git a/pxr/usd/usdProc/generativeProcedural.cpp b/pxr/usd/usdProc/generativeProcedural.cpp index d4b62f14c1..92eb48e568 100644 --- a/pxr/usd/usdProc/generativeProcedural.cpp +++ b/pxr/usd/usdProc/generativeProcedural.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdProc/generativeProcedural.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usdProc/generativeProcedural.h b/pxr/usd/usdProc/generativeProcedural.h index 246ac90bf9..912104ad0d 100644 --- a/pxr/usd/usdProc/generativeProcedural.h +++ b/pxr/usd/usdProc/generativeProcedural.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDPROC_GENERATED_GENERATIVEPROCEDURAL_H #define USDPROC_GENERATED_GENERATIVEPROCEDURAL_H diff --git a/pxr/usd/usdProc/module.cpp b/pxr/usd/usdProc/module.cpp index c4ffc61956..60917ac2cb 100644 --- a/pxr/usd/usdProc/module.cpp +++ b/pxr/usd/usdProc/module.cpp @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/base/tf/pyModule.h" diff --git a/pxr/usd/usdProc/moduleDeps.cpp b/pxr/usd/usdProc/moduleDeps.cpp index 3b15c20d95..4dfd2ef278 100644 --- a/pxr/usd/usdProc/moduleDeps.cpp +++ b/pxr/usd/usdProc/moduleDeps.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/pxr/usd/usdProc/pch.h b/pxr/usd/usdProc/pch.h index f40455a1ca..f8e8af37dd 100644 --- a/pxr/usd/usdProc/pch.h +++ b/pxr/usd/usdProc/pch.h @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // // WARNING: THIS FILE IS GENERATED. DO NOT EDIT. // @@ -31,6 +14,7 @@ #include #endif #if defined(ARCH_OS_LINUX) +#include #include #endif #if defined(ARCH_OS_WINDOWS) @@ -38,9 +22,11 @@ #define WIN32_LEAN_AND_MEAN #endif - +#include +#include #endif #include +#include #include #include #include @@ -56,7 +42,6 @@ #include #include #include -#include #include #include #include @@ -65,9 +50,9 @@ #include #include #include -#include #include #include +#include #include #include #include @@ -76,58 +61,15 @@ #include #include #include +#include #include #include #include #include #include #include +#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #ifdef PXR_PYTHON_SUPPORT_ENABLED #include #include @@ -148,25 +90,9 @@ #undef toupper #endif #endif // PXR_PYTHON_SUPPORT_ENABLED -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include #include +#include #include #include #include @@ -174,6 +100,7 @@ #include #include #include +#include #ifdef PXR_PYTHON_SUPPORT_ENABLED #include "pxr/base/tf/pySafePython.h" #endif // PXR_PYTHON_SUPPORT_ENABLED diff --git a/pxr/usd/usdProc/tokens.cpp b/pxr/usd/usdProc/tokens.cpp index 171ee6211b..15995b159b 100644 --- a/pxr/usd/usdProc/tokens.cpp +++ b/pxr/usd/usdProc/tokens.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdProc/tokens.h" diff --git a/pxr/usd/usdProc/tokens.h b/pxr/usd/usdProc/tokens.h index 97e15d61bf..f06ce409e3 100644 --- a/pxr/usd/usdProc/tokens.h +++ b/pxr/usd/usdProc/tokens.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDPROC_TOKENS_H #define USDPROC_TOKENS_H diff --git a/pxr/usd/usdProc/wrapGenerativeProcedural.cpp b/pxr/usd/usdProc/wrapGenerativeProcedural.cpp index be5f2de1fd..3d32eda776 100644 --- a/pxr/usd/usdProc/wrapGenerativeProcedural.cpp +++ b/pxr/usd/usdProc/wrapGenerativeProcedural.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdProc/generativeProcedural.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdProc/wrapTokens.cpp b/pxr/usd/usdProc/wrapTokens.cpp index 68816f7955..8e51b7a072 100644 --- a/pxr/usd/usdProc/wrapTokens.cpp +++ b/pxr/usd/usdProc/wrapTokens.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // // GENERATED FILE. DO NOT EDIT. #include diff --git a/pxr/usd/usdRender/__init__.py b/pxr/usd/usdRender/__init__.py index 21792ee990..d830462be1 100644 --- a/pxr/usd/usdRender/__init__.py +++ b/pxr/usd/usdRender/__init__.py @@ -1,25 +1,8 @@ # # Copyright 2016 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # from pxr import Tf Tf.PreparePythonModule() diff --git a/pxr/usd/usdRender/api.h b/pxr/usd/usdRender/api.h index 90b962dd08..479fdae09b 100644 --- a/pxr/usd/usdRender/api.h +++ b/pxr/usd/usdRender/api.h @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDRENDER_API_H #define USDRENDER_API_H diff --git a/pxr/usd/usdRender/denoisePass.cpp b/pxr/usd/usdRender/denoisePass.cpp index 62de6fa579..652af858e9 100644 --- a/pxr/usd/usdRender/denoisePass.cpp +++ b/pxr/usd/usdRender/denoisePass.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdRender/denoisePass.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usdRender/denoisePass.h b/pxr/usd/usdRender/denoisePass.h index 3c140d90c1..26cde762c5 100644 --- a/pxr/usd/usdRender/denoisePass.h +++ b/pxr/usd/usdRender/denoisePass.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDRENDER_GENERATED_DENOISEPASS_H #define USDRENDER_GENERATED_DENOISEPASS_H diff --git a/pxr/usd/usdRender/generatedSchema.usda b/pxr/usd/usdRender/generatedSchema.usda index fbf3a671bc..781b67b7e9 100644 --- a/pxr/usd/usdRender/generatedSchema.usda +++ b/pxr/usd/usdRender/generatedSchema.usda @@ -375,11 +375,18 @@ class RenderProduct "RenderProduct" ( filesystem or other storage, in the desired location.""" ) uniform token productType = "raster" ( - doc = '''The type of output to produce. - The default, "raster", indicates a 2D image. - - \\note In the future, UsdRender may define additional product - types.''' + allowedTokens = ["raster", "deepRaster"] + doc = """The type of output to produce; allowed values are ones most + renderers should be able to support. + Renderers that support custom output types are encouraged to supply an + applied API schema that will add an `token myRenderContext:productType` + attribute (e.g. `token ri:productType`), which will override this + attribute's value for that renderer. + + - \"raster\": This is the default type and indicates a 2D raster image of + pixels. + - \"deepRaster\": Indicates a deep image that contains multiple samples + per pixel at varying depths.""" ) uniform int2 resolution = (2048, 1080) ( doc = """The image pixel resolution, corresponding to the @@ -388,26 +395,36 @@ class RenderProduct "RenderProduct" ( } class RenderPass "RenderPass" ( - apiSchemas = ["CollectionAPI:renderVisibility"] + apiSchemas = ["CollectionAPI:renderVisibility", "CollectionAPI:prune"] customData = { token[] apiSchemaOverridePropertyNames = ["collection:renderVisibility:includeRoot"] } - doc = """A RenderPass prim encapsulates the necessary information - to generate multipass renders. It houses properties for generating - dependencies and the necessary commands to run to generate renders, as - well as visibility controls for the scene. While RenderSettings - describes the information needed to generate images from a single - invocation of a renderer, RenderPass describes the additional information - needed to generate a time varying set of images. + doc = """A RenderPass prim encapsulates necessary information + to generate multi-pass renders. In a multi-pass render, multiple + invocations (\"passes\") of the rendering process are used to + generate products using potentially distinct configurations of the + stage and renderer. + + UsdRenderPass houses properties for generating dependencies and + the necessary commands to run to generate renders, as well as + visibility and pruning controls for the scene. + + Whereas UsdRenderSettings describes information about the rendering + process itself (such as path-tracing parameters), UsdRenderPass + describes information to configure the scene contents and to + invoke the renderer as part of a render job that produces a + time-varying sequence of images. There are two consumers of RenderPass prims - a runtime executable that generates images from usdRender prims, and pipeline specific code that translates between usdRender prims and the pipeline's resource scheduling software. We'll refer to the latter as 'job submission code'. + The name of the prim is used as the pass's name. + \\anchor usdRender_renderVisibility - The objects that are relevant to the render is specified via the - renderVisibility collection (UsdCollectionAPI) and can be accessed via + The set of objects visible in the render is specified via the + renderVisibility collection (UsdCollectionAPI), which can be accessed via GetRenderVisibilityCollectionAPI(). This collection has includeRoot set to true so that all objects participate in the render by default. To render only a specific set of objects, there are two options. One is to modify the @@ -416,7 +433,35 @@ class RenderPass "RenderPass" ( false and explicitly include the desired objects. These are complementary approaches that may each be preferable depending on the scenario. - The name of the prim is used as the pass's name. + In addition, UsdCollectionAPI offers a membershipExpression attribute + providing a pattern-based description of the collection. To use + membershipExpression, includeRoot should be overridden to false. + + Note that prims for which UsdGeomImageable::ComputeEffectiveVisibility() + returns \"invisible\" cannot be overridden back to a visible state + via renderVisibility. Conceptually, render passes may be used to + partition scene contents across multiple images rendered from the + scene; they are not intended to restore parts of the scene that + had been marked invisible. + + In addition, renderVisibility only applies to renderable contents + of the scene itself, such as geometry and lights; it does not apply + to objects associated with the render settings, such as image + post-processing filters, even when UsdGeomVisibilityAPI may apply. + + \\anchor usdRender_pruning + The prune collection specifies a collection of objects to be removed + (\"pruned\") from the scene prior to rendering. Whereas visibility + may be implemented by the renderer as a lightweight attribute + that is relatively cheap to toggle during interactive workflows, + pruning entirely removes the objects from the renderer's + extracted representation of the scene. This can provide a greater + runtime cost savings for batch rendering, with the tradeoff that + interactively modifying the prune collection is likely to be more + expensive than toggling visibility. In addition, some renderers + may not support visibility of certain kinds of scene objects or in + certain conditions; in these cases, pruning offers a guaranteed way + to remove such objects from the scene. """ ) { diff --git a/pxr/usd/usdRender/module.cpp b/pxr/usd/usdRender/module.cpp index b83cd76161..a06fc1819d 100644 --- a/pxr/usd/usdRender/module.cpp +++ b/pxr/usd/usdRender/module.cpp @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/base/tf/pyModule.h" diff --git a/pxr/usd/usdRender/moduleDeps.cpp b/pxr/usd/usdRender/moduleDeps.cpp index 4a4351780a..ed3794a647 100644 --- a/pxr/usd/usdRender/moduleDeps.cpp +++ b/pxr/usd/usdRender/moduleDeps.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/pxr/usd/usdRender/pass.cpp b/pxr/usd/usdRender/pass.cpp index fad7e5db88..3f9ecef158 100644 --- a/pxr/usd/usdRender/pass.cpp +++ b/pxr/usd/usdRender/pass.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdRender/pass.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usdRender/pass.h b/pxr/usd/usdRender/pass.h index 0d28cdc388..e56a829066 100644 --- a/pxr/usd/usdRender/pass.h +++ b/pxr/usd/usdRender/pass.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDRENDER_GENERATED_PASS_H #define USDRENDER_GENERATED_PASS_H @@ -54,22 +37,32 @@ class SdfAssetPath; /// \class UsdRenderPass /// -/// A RenderPass prim encapsulates the necessary information -/// to generate multipass renders. It houses properties for generating -/// dependencies and the necessary commands to run to generate renders, as -/// well as visibility controls for the scene. While RenderSettings -/// describes the information needed to generate images from a single -/// invocation of a renderer, RenderPass describes the additional information -/// needed to generate a time varying set of images. +/// A RenderPass prim encapsulates necessary information +/// to generate multi-pass renders. In a multi-pass render, multiple +/// invocations ("passes") of the rendering process are used to +/// generate products using potentially distinct configurations of the +/// stage and renderer. +/// +/// UsdRenderPass houses properties for generating dependencies and +/// the necessary commands to run to generate renders, as well as +/// visibility and pruning controls for the scene. +/// +/// Whereas UsdRenderSettings describes information about the rendering +/// process itself (such as path-tracing parameters), UsdRenderPass +/// describes information to configure the scene contents and to +/// invoke the renderer as part of a render job that produces a +/// time-varying sequence of images. /// /// There are two consumers of RenderPass prims - a runtime executable that /// generates images from usdRender prims, and pipeline specific code that /// translates between usdRender prims and the pipeline's resource scheduling /// software. We'll refer to the latter as 'job submission code'. /// +/// The name of the prim is used as the pass's name. +/// /// \anchor usdRender_renderVisibility -/// The objects that are relevant to the render is specified via the -/// renderVisibility collection (UsdCollectionAPI) and can be accessed via +/// The set of objects visible in the render is specified via the +/// renderVisibility collection (UsdCollectionAPI), which can be accessed via /// GetRenderVisibilityCollectionAPI(). This collection has includeRoot set to /// true so that all objects participate in the render by default. To render /// only a specific set of objects, there are two options. One is to modify the @@ -78,7 +71,35 @@ class SdfAssetPath; /// false and explicitly include the desired objects. These are complementary /// approaches that may each be preferable depending on the scenario. /// -/// The name of the prim is used as the pass's name. +/// In addition, UsdCollectionAPI offers a membershipExpression attribute +/// providing a pattern-based description of the collection. To use +/// membershipExpression, includeRoot should be overridden to false. +/// +/// Note that prims for which UsdGeomImageable::ComputeEffectiveVisibility() +/// returns "invisible" cannot be overridden back to a visible state +/// via renderVisibility. Conceptually, render passes may be used to +/// partition scene contents across multiple images rendered from the +/// scene; they are not intended to restore parts of the scene that +/// had been marked invisible. +/// +/// In addition, renderVisibility only applies to renderable contents +/// of the scene itself, such as geometry and lights; it does not apply +/// to objects associated with the render settings, such as image +/// post-processing filters, even when UsdGeomVisibilityAPI may apply. +/// +/// \anchor usdRender_pruning +/// The prune collection specifies a collection of objects to be removed +/// ("pruned") from the scene prior to rendering. Whereas visibility +/// may be implemented by the renderer as a lightweight attribute +/// that is relatively cheap to toggle during interactive workflows, +/// pruning entirely removes the objects from the renderer's +/// extracted representation of the scene. This can provide a greater +/// runtime cost savings for batch rendering, with the tradeoff that +/// interactively modifying the prune collection is likely to be more +/// expensive than toggling visibility. In addition, some renderers +/// may not support visibility of certain kinds of scene objects or in +/// certain conditions; in these cases, pruning offers a guaranteed way +/// to remove such objects from the scene. /// /// /// For any described attribute \em Fallback \em Value or \em Allowed \em Values below diff --git a/pxr/usd/usdRender/pch.h b/pxr/usd/usdRender/pch.h index 7802ec3e2d..af51fc4fd6 100644 --- a/pxr/usd/usdRender/pch.h +++ b/pxr/usd/usdRender/pch.h @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // // WARNING: THIS FILE IS GENERATED. DO NOT EDIT. // @@ -31,6 +14,7 @@ #include #endif #if defined(ARCH_OS_LINUX) +#include #include #endif #if defined(ARCH_OS_WINDOWS) @@ -38,12 +22,12 @@ #define WIN32_LEAN_AND_MEAN #endif +#include #include -#include -#include -#include #endif #include +#include +#include #include #include #include @@ -67,8 +51,9 @@ #include #include #include -#include #include +#include +#include #include #include #include @@ -77,60 +62,15 @@ #include #include #include +#include #include #include #include #include #include #include +#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #ifdef PXR_PYTHON_SUPPORT_ENABLED #include #include @@ -151,27 +91,9 @@ #undef toupper #endif #endif // PXR_PYTHON_SUPPORT_ENABLED -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include #include +#include #include #include #include @@ -179,7 +101,7 @@ #include #include #include -#include +#include #ifdef PXR_PYTHON_SUPPORT_ENABLED #include "pxr/base/tf/pySafePython.h" #endif // PXR_PYTHON_SUPPORT_ENABLED diff --git a/pxr/usd/usdRender/product.cpp b/pxr/usd/usdRender/product.cpp index 3477a856cc..357327cbc8 100644 --- a/pxr/usd/usdRender/product.cpp +++ b/pxr/usd/usdRender/product.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdRender/product.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usdRender/product.h b/pxr/usd/usdRender/product.h index 9b9ef9c3ce..841e3eba31 100644 --- a/pxr/usd/usdRender/product.h +++ b/pxr/usd/usdRender/product.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDRENDER_GENERATED_PRODUCT_H #define USDRENDER_GENERATED_PRODUCT_H @@ -168,11 +151,17 @@ class UsdRenderProduct : public UsdRenderSettingsBase // --------------------------------------------------------------------- // // PRODUCTTYPE // --------------------------------------------------------------------- // - /// The type of output to produce. - /// The default, "raster", indicates a 2D image. + /// The type of output to produce; allowed values are ones most + /// renderers should be able to support. + /// Renderers that support custom output types are encouraged to supply an + /// applied API schema that will add an `token myRenderContext:productType` + /// attribute (e.g. `token ri:productType`), which will override this + /// attribute's value for that renderer. /// - /// \note In the future, UsdRender may define additional product - /// types. + /// - "raster": This is the default type and indicates a 2D raster image of + /// pixels. + /// - "deepRaster": Indicates a deep image that contains multiple samples + /// per pixel at varying depths. /// /// | || /// | -- | -- | @@ -180,6 +169,7 @@ class UsdRenderProduct : public UsdRenderSettingsBase /// | C++ Type | TfToken | /// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Token | /// | \ref SdfVariability "Variability" | SdfVariabilityUniform | + /// | \ref UsdRenderTokens "Allowed Values" | raster, deepRaster | USDRENDER_API UsdAttribute GetProductTypeAttr() const; diff --git a/pxr/usd/usdRender/schema.usda b/pxr/usd/usdRender/schema.usda index 37428cfb30..7f0fddfa55 100644 --- a/pxr/usd/usdRender/schema.usda +++ b/pxr/usd/usdRender/schema.usda @@ -229,20 +229,21 @@ class RenderProduct "RenderProduct" ( """ customData = { string className = "Product" - dictionary schemaTokens = { - dictionary raster = { - string doc = """RenderProduct productType value that - indicates a 2D raster image of pixels.""" - } - } } ) { uniform token productType = "raster" ( - doc = """The type of output to produce. - The default, "raster", indicates a 2D image. + allowedTokens = ["raster", "deepRaster"] + doc = """The type of output to produce; allowed values are ones most + renderers should be able to support. + Renderers that support custom output types are encouraged to supply an + applied API schema that will add an `token myRenderContext:productType` + attribute (e.g. `token ri:productType`), which will override this + attribute's value for that renderer. - \\note In the future, UsdRender may define additional product - types.""" + - "raster": This is the default type and indicates a 2D raster image of + pixels. + - "deepRaster": Indicates a deep image that contains multiple samples + per pixel at varying depths.""" ) token productName = "" ( doc = """Specifies the name that the output/display driver @@ -261,22 +262,32 @@ class RenderProduct "RenderProduct" ( class RenderPass "RenderPass" ( inherits = - doc = """A RenderPass prim encapsulates the necessary information - to generate multipass renders. It houses properties for generating - dependencies and the necessary commands to run to generate renders, as - well as visibility controls for the scene. While RenderSettings - describes the information needed to generate images from a single - invocation of a renderer, RenderPass describes the additional information - needed to generate a time varying set of images. + doc = """A RenderPass prim encapsulates necessary information + to generate multi-pass renders. In a multi-pass render, multiple + invocations ("passes") of the rendering process are used to + generate products using potentially distinct configurations of the + stage and renderer. + + UsdRenderPass houses properties for generating dependencies and + the necessary commands to run to generate renders, as well as + visibility and pruning controls for the scene. + + Whereas UsdRenderSettings describes information about the rendering + process itself (such as path-tracing parameters), UsdRenderPass + describes information to configure the scene contents and to + invoke the renderer as part of a render job that produces a + time-varying sequence of images. There are two consumers of RenderPass prims - a runtime executable that generates images from usdRender prims, and pipeline specific code that translates between usdRender prims and the pipeline's resource scheduling software. We'll refer to the latter as 'job submission code'. + The name of the prim is used as the pass's name. + \\anchor usdRender_renderVisibility - The objects that are relevant to the render is specified via the - renderVisibility collection (UsdCollectionAPI) and can be accessed via + The set of objects visible in the render is specified via the + renderVisibility collection (UsdCollectionAPI), which can be accessed via GetRenderVisibilityCollectionAPI(). This collection has includeRoot set to true so that all objects participate in the render by default. To render only a specific set of objects, there are two options. One is to modify the @@ -285,14 +296,42 @@ class RenderPass "RenderPass" ( false and explicitly include the desired objects. These are complementary approaches that may each be preferable depending on the scenario. - The name of the prim is used as the pass's name. + In addition, UsdCollectionAPI offers a membershipExpression attribute + providing a pattern-based description of the collection. To use + membershipExpression, includeRoot should be overridden to false. + + Note that prims for which UsdGeomImageable::ComputeEffectiveVisibility() + returns "invisible" cannot be overridden back to a visible state + via renderVisibility. Conceptually, render passes may be used to + partition scene contents across multiple images rendered from the + scene; they are not intended to restore parts of the scene that + had been marked invisible. + + In addition, renderVisibility only applies to renderable contents + of the scene itself, such as geometry and lights; it does not apply + to objects associated with the render settings, such as image + post-processing filters, even when UsdGeomVisibilityAPI may apply. + + \\anchor usdRender_pruning + The prune collection specifies a collection of objects to be removed + ("pruned") from the scene prior to rendering. Whereas visibility + may be implemented by the renderer as a lightweight attribute + that is relatively cheap to toggle during interactive workflows, + pruning entirely removes the objects from the renderer's + extracted representation of the scene. This can provide a greater + runtime cost savings for batch rendering, with the tradeoff that + interactively modifying the prune collection is likely to be more + expensive than toggling visibility. In addition, some renderers + may not support visibility of certain kinds of scene objects or in + certain conditions; in these cases, pruning offers a guaranteed way + to remove such objects from the scene. """ customData = { string className = "Pass" string extraIncludes = """ #include "pxr/usd/usd/collectionAPI.h" """ } - prepend apiSchemas = ["CollectionAPI:renderVisibility"] + prepend apiSchemas = ["CollectionAPI:renderVisibility", "CollectionAPI:prune"] ) { uniform token passType ( doc = """A string used to categorize differently structured diff --git a/pxr/usd/usdRender/settings.cpp b/pxr/usd/usdRender/settings.cpp index 449f86ae76..473887ee8a 100644 --- a/pxr/usd/usdRender/settings.cpp +++ b/pxr/usd/usdRender/settings.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdRender/settings.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usdRender/settings.h b/pxr/usd/usdRender/settings.h index a361f8868b..a05f375fad 100644 --- a/pxr/usd/usdRender/settings.h +++ b/pxr/usd/usdRender/settings.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDRENDER_GENERATED_SETTINGS_H #define USDRENDER_GENERATED_SETTINGS_H diff --git a/pxr/usd/usdRender/settingsBase.cpp b/pxr/usd/usdRender/settingsBase.cpp index 6ba677c039..7edbab61bb 100644 --- a/pxr/usd/usdRender/settingsBase.cpp +++ b/pxr/usd/usdRender/settingsBase.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdRender/settingsBase.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usdRender/settingsBase.h b/pxr/usd/usdRender/settingsBase.h index 82b40e2e7a..883651523d 100644 --- a/pxr/usd/usdRender/settingsBase.h +++ b/pxr/usd/usdRender/settingsBase.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDRENDER_GENERATED_SETTINGSBASE_H #define USDRENDER_GENERATED_SETTINGSBASE_H diff --git a/pxr/usd/usdRender/spec.cpp b/pxr/usd/usdRender/spec.cpp index a3e72bbafe..11b1e3adca 100644 --- a/pxr/usd/usdRender/spec.cpp +++ b/pxr/usd/usdRender/spec.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdRender/spec.h" #include "pxr/usd/usdRender/settings.h" diff --git a/pxr/usd/usdRender/spec.h b/pxr/usd/usdRender/spec.h index 2fbc7d73e2..48bf554380 100644 --- a/pxr/usd/usdRender/spec.h +++ b/pxr/usd/usdRender/spec.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_RENDER_SPEC_H #define PXR_USD_USD_RENDER_SPEC_H diff --git a/pxr/usd/usdRender/tokens.cpp b/pxr/usd/usdRender/tokens.cpp index 7a41b4b9b2..c6d9b3b286 100644 --- a/pxr/usd/usdRender/tokens.cpp +++ b/pxr/usd/usdRender/tokens.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdRender/tokens.h" @@ -37,6 +20,7 @@ UsdRenderTokensType::UsdRenderTokensType() : cropAperture("cropAperture", TfToken::Immortal), dataType("dataType", TfToken::Immortal), dataWindowNDC("dataWindowNDC", TfToken::Immortal), + deepRaster("deepRaster", TfToken::Immortal), denoiseEnable("denoise:enable", TfToken::Immortal), denoisePass("denoise:pass", TfToken::Immortal), disableDepthOfField("disableDepthOfField", TfToken::Immortal), @@ -85,6 +69,7 @@ UsdRenderTokensType::UsdRenderTokensType() : cropAperture, dataType, dataWindowNDC, + deepRaster, denoiseEnable, denoisePass, disableDepthOfField, diff --git a/pxr/usd/usdRender/tokens.h b/pxr/usd/usdRender/tokens.h index 0b59575707..86994164ab 100644 --- a/pxr/usd/usdRender/tokens.h +++ b/pxr/usd/usdRender/tokens.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDRENDER_TOKENS_H #define USDRENDER_TOKENS_H @@ -106,6 +89,10 @@ struct UsdRenderTokensType { /// /// UsdRenderSettingsBase const TfToken dataWindowNDC; + /// \brief "deepRaster" + /// + /// Possible value for UsdRenderProduct::GetProductTypeAttr() + const TfToken deepRaster; /// \brief "denoise:enable" /// /// UsdRenderPass @@ -192,7 +179,7 @@ struct UsdRenderTokensType { const TfToken productType; /// \brief "raster" /// - /// Fallback value for UsdRenderProduct::GetProductTypeAttr(), RenderProduct productType value that indicates a 2D raster image of pixels. + /// Fallback value for UsdRenderProduct::GetProductTypeAttr() const TfToken raster; /// \brief "raw" /// diff --git a/pxr/usd/usdRender/var.cpp b/pxr/usd/usdRender/var.cpp index c12d4c3798..eaabed9503 100644 --- a/pxr/usd/usdRender/var.cpp +++ b/pxr/usd/usdRender/var.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdRender/var.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usdRender/var.h b/pxr/usd/usdRender/var.h index 8f700cf4ec..847ce4a8da 100644 --- a/pxr/usd/usdRender/var.h +++ b/pxr/usd/usdRender/var.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDRENDER_GENERATED_VAR_H #define USDRENDER_GENERATED_VAR_H diff --git a/pxr/usd/usdRender/wrapDenoisePass.cpp b/pxr/usd/usdRender/wrapDenoisePass.cpp index 4dc6294017..bbee508165 100644 --- a/pxr/usd/usdRender/wrapDenoisePass.cpp +++ b/pxr/usd/usdRender/wrapDenoisePass.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdRender/denoisePass.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdRender/wrapPass.cpp b/pxr/usd/usdRender/wrapPass.cpp index 49b431a4dd..8ae83beff5 100644 --- a/pxr/usd/usdRender/wrapPass.cpp +++ b/pxr/usd/usdRender/wrapPass.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdRender/pass.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdRender/wrapProduct.cpp b/pxr/usd/usdRender/wrapProduct.cpp index 119bb0487d..bb33cb3bf8 100644 --- a/pxr/usd/usdRender/wrapProduct.cpp +++ b/pxr/usd/usdRender/wrapProduct.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdRender/product.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdRender/wrapSettings.cpp b/pxr/usd/usdRender/wrapSettings.cpp index d4d86d712f..2ccda3ff97 100644 --- a/pxr/usd/usdRender/wrapSettings.cpp +++ b/pxr/usd/usdRender/wrapSettings.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdRender/settings.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdRender/wrapSettingsBase.cpp b/pxr/usd/usdRender/wrapSettingsBase.cpp index f1c1b93af7..81fe107ae6 100644 --- a/pxr/usd/usdRender/wrapSettingsBase.cpp +++ b/pxr/usd/usdRender/wrapSettingsBase.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdRender/settingsBase.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdRender/wrapTokens.cpp b/pxr/usd/usdRender/wrapTokens.cpp index 2cd4d730be..fa7cda3889 100644 --- a/pxr/usd/usdRender/wrapTokens.cpp +++ b/pxr/usd/usdRender/wrapTokens.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // // GENERATED FILE. DO NOT EDIT. #include @@ -75,6 +58,7 @@ void wrapUsdRenderTokens() _AddToken(cls, "cropAperture", UsdRenderTokens->cropAperture); _AddToken(cls, "dataType", UsdRenderTokens->dataType); _AddToken(cls, "dataWindowNDC", UsdRenderTokens->dataWindowNDC); + _AddToken(cls, "deepRaster", UsdRenderTokens->deepRaster); _AddToken(cls, "denoiseEnable", UsdRenderTokens->denoiseEnable); _AddToken(cls, "denoisePass", UsdRenderTokens->denoisePass); _AddToken(cls, "disableDepthOfField", UsdRenderTokens->disableDepthOfField); diff --git a/pxr/usd/usdRender/wrapVar.cpp b/pxr/usd/usdRender/wrapVar.cpp index 38fed1bdad..b4fb5a8668 100644 --- a/pxr/usd/usdRender/wrapVar.cpp +++ b/pxr/usd/usdRender/wrapVar.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdRender/var.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdRi/__init__.py b/pxr/usd/usdRi/__init__.py index 21792ee990..d830462be1 100644 --- a/pxr/usd/usdRi/__init__.py +++ b/pxr/usd/usdRi/__init__.py @@ -1,25 +1,8 @@ # # Copyright 2016 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # from pxr import Tf Tf.PreparePythonModule() diff --git a/pxr/usd/usdRi/api.h b/pxr/usd/usdRi/api.h index 1908d742d9..4fe90d1c15 100644 --- a/pxr/usd/usdRi/api.h +++ b/pxr/usd/usdRi/api.h @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDRI_API_H #define USDRI_API_H diff --git a/pxr/usd/usdRi/materialAPI.cpp b/pxr/usd/usdRi/materialAPI.cpp index 6876fca0c3..8cd2287ecf 100644 --- a/pxr/usd/usdRi/materialAPI.cpp +++ b/pxr/usd/usdRi/materialAPI.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdRi/materialAPI.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usdRi/materialAPI.h b/pxr/usd/usdRi/materialAPI.h index d7c4eca6ff..2d9c15e31c 100644 --- a/pxr/usd/usdRi/materialAPI.h +++ b/pxr/usd/usdRi/materialAPI.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDRI_GENERATED_MATERIALAPI_H #define USDRI_GENERATED_MATERIALAPI_H diff --git a/pxr/usd/usdRi/module.cpp b/pxr/usd/usdRi/module.cpp index 21377d484f..51a177cd75 100644 --- a/pxr/usd/usdRi/module.cpp +++ b/pxr/usd/usdRi/module.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/base/tf/pyModule.h" diff --git a/pxr/usd/usdRi/moduleDeps.cpp b/pxr/usd/usdRi/moduleDeps.cpp index 901e2f7f9e..8c6f4d8c3a 100644 --- a/pxr/usd/usdRi/moduleDeps.cpp +++ b/pxr/usd/usdRi/moduleDeps.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/pxr/usd/usdRi/pch.h b/pxr/usd/usdRi/pch.h index 905d2a1236..2c939b9801 100644 --- a/pxr/usd/usdRi/pch.h +++ b/pxr/usd/usdRi/pch.h @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // // WARNING: THIS FILE IS GENERATED. DO NOT EDIT. // @@ -31,6 +14,7 @@ #include #endif #if defined(ARCH_OS_LINUX) +#include #include #endif #if defined(ARCH_OS_WINDOWS) @@ -38,12 +22,11 @@ #define WIN32_LEAN_AND_MEAN #endif +#include #include -#include -#include -#include #endif #include +#include #include #include #include @@ -67,8 +50,9 @@ #include #include #include -#include #include +#include +#include #include #include #include @@ -77,60 +61,15 @@ #include #include #include +#include #include #include #include #include #include #include +#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #ifdef PXR_PYTHON_SUPPORT_ENABLED #include #include @@ -144,6 +83,7 @@ #include #include #include +#include #include #include #include @@ -154,27 +94,9 @@ #undef toupper #endif #endif // PXR_PYTHON_SUPPORT_ENABLED -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include #include +#include #include #include #include @@ -182,7 +104,7 @@ #include #include #include -#include +#include #ifdef PXR_PYTHON_SUPPORT_ENABLED #include "pxr/base/tf/pySafePython.h" #endif // PXR_PYTHON_SUPPORT_ENABLED diff --git a/pxr/usd/usdRi/renderPassAPI.cpp b/pxr/usd/usdRi/renderPassAPI.cpp index df29b107f6..c657623cf8 100644 --- a/pxr/usd/usdRi/renderPassAPI.cpp +++ b/pxr/usd/usdRi/renderPassAPI.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdRi/renderPassAPI.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usdRi/renderPassAPI.h b/pxr/usd/usdRi/renderPassAPI.h index 1ab45741f8..db2ccf1af1 100644 --- a/pxr/usd/usdRi/renderPassAPI.h +++ b/pxr/usd/usdRi/renderPassAPI.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDRI_GENERATED_RENDERPASSAPI_H #define USDRI_GENERATED_RENDERPASSAPI_H diff --git a/pxr/usd/usdRi/rmanUtilities.cpp b/pxr/usd/usdRi/rmanUtilities.cpp index b757e6cf29..77993dfb10 100644 --- a/pxr/usd/usdRi/rmanUtilities.cpp +++ b/pxr/usd/usdRi/rmanUtilities.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usdRi/rmanUtilities.h" diff --git a/pxr/usd/usdRi/rmanUtilities.h b/pxr/usd/usdRi/rmanUtilities.h index c453323f9f..a7abd2cf67 100644 --- a/pxr/usd/usdRi/rmanUtilities.h +++ b/pxr/usd/usdRi/rmanUtilities.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_RI_RMAN_UTILITIES_H #define PXR_USD_USD_RI_RMAN_UTILITIES_H diff --git a/pxr/usd/usdRi/splineAPI.cpp b/pxr/usd/usdRi/splineAPI.cpp index d01f03e760..99c707779d 100644 --- a/pxr/usd/usdRi/splineAPI.cpp +++ b/pxr/usd/usdRi/splineAPI.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdRi/splineAPI.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usdRi/splineAPI.h b/pxr/usd/usdRi/splineAPI.h index 3ec3bfbb36..4ebcbf649f 100644 --- a/pxr/usd/usdRi/splineAPI.h +++ b/pxr/usd/usdRi/splineAPI.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDRI_GENERATED_SPLINEAPI_H #define USDRI_GENERATED_SPLINEAPI_H diff --git a/pxr/usd/usdRi/statementsAPI.cpp b/pxr/usd/usdRi/statementsAPI.cpp index 7e6c793e36..473c817f11 100644 --- a/pxr/usd/usdRi/statementsAPI.cpp +++ b/pxr/usd/usdRi/statementsAPI.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdRi/statementsAPI.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usdRi/statementsAPI.h b/pxr/usd/usdRi/statementsAPI.h index 4517c85783..1bf32276fe 100644 --- a/pxr/usd/usdRi/statementsAPI.h +++ b/pxr/usd/usdRi/statementsAPI.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDRI_GENERATED_STATEMENTSAPI_H #define USDRI_GENERATED_STATEMENTSAPI_H diff --git a/pxr/usd/usdRi/testenv/testUsdRiSchemata.py b/pxr/usd/usdRi/testenv/testUsdRiSchemata.py index a3cb6010b7..def694971c 100644 --- a/pxr/usd/usdRi/testenv/testUsdRiSchemata.py +++ b/pxr/usd/usdRi/testenv/testUsdRiSchemata.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # from __future__ import print_function diff --git a/pxr/usd/usdRi/testenv/testUsdRiSplineAPI.py b/pxr/usd/usdRi/testenv/testUsdRiSplineAPI.py index 1f3b559319..da9ad3f402 100644 --- a/pxr/usd/usdRi/testenv/testUsdRiSplineAPI.py +++ b/pxr/usd/usdRi/testenv/testUsdRiSplineAPI.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # from pxr import Sdf, Usd, UsdLux, UsdRi diff --git a/pxr/usd/usdRi/testenv/testUsdRiUtilities.py b/pxr/usd/usdRi/testenv/testUsdRiUtilities.py index 6209a0b8ab..1ecbe1ebfa 100644 --- a/pxr/usd/usdRi/testenv/testUsdRiUtilities.py +++ b/pxr/usd/usdRi/testenv/testUsdRiUtilities.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # import unittest diff --git a/pxr/usd/usdRi/tokens.cpp b/pxr/usd/usdRi/tokens.cpp index b412c90ae2..03d036a920 100644 --- a/pxr/usd/usdRi/tokens.cpp +++ b/pxr/usd/usdRi/tokens.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdRi/tokens.h" diff --git a/pxr/usd/usdRi/tokens.h b/pxr/usd/usdRi/tokens.h index 1d083dd27f..dbfb2d2529 100644 --- a/pxr/usd/usdRi/tokens.h +++ b/pxr/usd/usdRi/tokens.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDRI_TOKENS_H #define USDRI_TOKENS_H diff --git a/pxr/usd/usdRi/typeUtils.cpp b/pxr/usd/usdRi/typeUtils.cpp index 164467cd4c..fd870fa963 100644 --- a/pxr/usd/usdRi/typeUtils.cpp +++ b/pxr/usd/usdRi/typeUtils.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "typeUtils.h" diff --git a/pxr/usd/usdRi/typeUtils.h b/pxr/usd/usdRi/typeUtils.h index c1352dff57..a4f1239a22 100644 --- a/pxr/usd/usdRi/typeUtils.h +++ b/pxr/usd/usdRi/typeUtils.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_RI_TYPE_UTILS_H #define PXR_USD_USD_RI_TYPE_UTILS_H diff --git a/pxr/usd/usdRi/wrapMaterialAPI.cpp b/pxr/usd/usdRi/wrapMaterialAPI.cpp index ed3acdad69..efc8c1e20f 100644 --- a/pxr/usd/usdRi/wrapMaterialAPI.cpp +++ b/pxr/usd/usdRi/wrapMaterialAPI.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdRi/materialAPI.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdRi/wrapRenderPassAPI.cpp b/pxr/usd/usdRi/wrapRenderPassAPI.cpp index d1f1786ffb..4d47460359 100644 --- a/pxr/usd/usdRi/wrapRenderPassAPI.cpp +++ b/pxr/usd/usdRi/wrapRenderPassAPI.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdRi/renderPassAPI.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdRi/wrapRmanUtilities.cpp b/pxr/usd/usdRi/wrapRmanUtilities.cpp index dd928393ac..159b974ecf 100644 --- a/pxr/usd/usdRi/wrapRmanUtilities.cpp +++ b/pxr/usd/usdRi/wrapRmanUtilities.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/usdRi/wrapSplineAPI.cpp b/pxr/usd/usdRi/wrapSplineAPI.cpp index 9541e19027..e7566214c8 100644 --- a/pxr/usd/usdRi/wrapSplineAPI.cpp +++ b/pxr/usd/usdRi/wrapSplineAPI.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdRi/splineAPI.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdRi/wrapStatementsAPI.cpp b/pxr/usd/usdRi/wrapStatementsAPI.cpp index 0f7ebc5bf5..2edf264820 100644 --- a/pxr/usd/usdRi/wrapStatementsAPI.cpp +++ b/pxr/usd/usdRi/wrapStatementsAPI.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdRi/statementsAPI.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdRi/wrapTokens.cpp b/pxr/usd/usdRi/wrapTokens.cpp index f5afcab2f5..20f82a9977 100644 --- a/pxr/usd/usdRi/wrapTokens.cpp +++ b/pxr/usd/usdRi/wrapTokens.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // // GENERATED FILE. DO NOT EDIT. #include diff --git a/pxr/usd/usdShade/CMakeLists.txt b/pxr/usd/usdShade/CMakeLists.txt index 9c714f0820..e389098ac2 100644 --- a/pxr/usd/usdShade/CMakeLists.txt +++ b/pxr/usd/usdShade/CMakeLists.txt @@ -11,6 +11,10 @@ pxr_library(usdShade sdr usd usdGeom + ${TBB_tbb_LIBRARY} + + INCLUDE_DIRS + ${TBB_INCLUDE_DIRS} PUBLIC_CLASSES connectableAPI @@ -26,6 +30,7 @@ pxr_library(usdShade shaderDefUtils nodeGraph tokens + validatorTokens udimUtils utils @@ -33,6 +38,9 @@ pxr_library(usdShade api.h types.h + CPPFILES + validators.cpp + PYTHON_CPPFILES moduleDeps.cpp @@ -75,6 +83,16 @@ pxr_build_test(testUsdShadeHasConnectableAPI testenv/testUsdShadeHasConnectableAPI.cpp ) +pxr_build_test(testUsdShadeValidators + LIBRARIES + sdr + tf + usd + usdShade + CPPFILES + testenv/testUsdShadeValidators.cpp +) + pxr_test_scripts( testenv/testUsdShadeBinding.py testenv/testUsdShadeConnectability.py @@ -151,6 +169,11 @@ pxr_install_test_dir( DEST testUsdShadeUdimUtils ) +pxr_install_test_dir( + SRC testenv/testUsdShadeValidators + DEST testUsdShadeValidators +) + pxr_register_test(testUsdShadeBinding PYTHON COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdShadeBinding" @@ -260,3 +283,9 @@ pxr_register_test(testUsdShadeUdimUtils COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdShadeUdimUtils" EXPECTED_RETURN_CODE 0 ) + +pxr_register_test(testUsdShadeValidators + COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdShadeValidators" + EXPECTED_RETURN_CODE 0 +) + diff --git a/pxr/usd/usdShade/__init__.py b/pxr/usd/usdShade/__init__.py index 21792ee990..d830462be1 100644 --- a/pxr/usd/usdShade/__init__.py +++ b/pxr/usd/usdShade/__init__.py @@ -1,25 +1,8 @@ # # Copyright 2016 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # from pxr import Tf Tf.PreparePythonModule() diff --git a/pxr/usd/usdShade/api.h b/pxr/usd/usdShade/api.h index d57ef8b3e8..640b95552c 100644 --- a/pxr/usd/usdShade/api.h +++ b/pxr/usd/usdShade/api.h @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDSHADE_API_H #define USDSHADE_API_H diff --git a/pxr/usd/usdShade/connectableAPI.cpp b/pxr/usd/usdShade/connectableAPI.cpp index d95c1da9eb..8f25664888 100644 --- a/pxr/usd/usdShade/connectableAPI.cpp +++ b/pxr/usd/usdShade/connectableAPI.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdShade/connectableAPI.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usdShade/connectableAPI.h b/pxr/usd/usdShade/connectableAPI.h index 6f024561d4..78a66644af 100644 --- a/pxr/usd/usdShade/connectableAPI.h +++ b/pxr/usd/usdShade/connectableAPI.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDSHADE_GENERATED_CONNECTABLEAPI_H #define USDSHADE_GENERATED_CONNECTABLEAPI_H diff --git a/pxr/usd/usdShade/connectableAPIBehavior.cpp b/pxr/usd/usdShade/connectableAPIBehavior.cpp index a08bd808bb..ceaf613773 100644 --- a/pxr/usd/usdShade/connectableAPIBehavior.cpp +++ b/pxr/usd/usdShade/connectableAPIBehavior.cpp @@ -1,23 +1,8 @@ // // Copyright 2020 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/usdShade/connectableAPIBehavior.h b/pxr/usd/usdShade/connectableAPIBehavior.h index ce1c3fd0db..a5e42031e5 100644 --- a/pxr/usd/usdShade/connectableAPIBehavior.h +++ b/pxr/usd/usdShade/connectableAPIBehavior.h @@ -1,25 +1,8 @@ // // Copyright 2020 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_SHADE_CONNECTABLE_BEHAVIOR_H #define PXR_USD_USD_SHADE_CONNECTABLE_BEHAVIOR_H diff --git a/pxr/usd/usdShade/coordSysAPI.cpp b/pxr/usd/usdShade/coordSysAPI.cpp index 6780de7018..1113bc83ad 100644 --- a/pxr/usd/usdShade/coordSysAPI.cpp +++ b/pxr/usd/usdShade/coordSysAPI.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdShade/coordSysAPI.h" #include "pxr/usd/usd/schemaRegistry.h" @@ -28,8 +11,6 @@ #include "pxr/usd/sdf/types.h" #include "pxr/usd/sdf/assetPath.h" -#include "pxr/base/tf/staticTokens.h" - PXR_NAMESPACE_OPEN_SCOPE // Register the schema with the TfType system. @@ -40,11 +21,6 @@ TF_REGISTRY_FUNCTION(TfType) } -TF_DEFINE_PRIVATE_TOKENS( - _schemaTokens, - (coordSys) -); - /* virtual */ UsdShadeCoordSysAPI::~UsdShadeCoordSysAPI() { @@ -121,9 +97,9 @@ UsdShadeCoordSysAPI::IsCoordSysAPIPath( } if (tokens.size() >= 2 - && tokens[0] == _schemaTokens->coordSys) { + && tokens[0] == UsdShadeTokens->coordSys) { *name = TfToken(propertyName.substr( - _schemaTokens->coordSys.GetString().size() + 1)); + UsdShadeTokens->coordSys.GetString().size() + 1)); return true; } @@ -332,7 +308,7 @@ UsdShadeCoordSysAPI::GetLocalBindings() const } for (const UsdProperty &prop: - GetPrim().GetAuthoredPropertiesInNamespace(_schemaTokens->coordSys)) { + GetPrim().GetAuthoredPropertiesInNamespace(UsdShadeTokens->coordSys)) { if (UsdRelationship rel = prop.As()) { targets.clear(); if (rel.GetForwardedTargets(&targets) && !targets.empty()) { @@ -449,7 +425,7 @@ UsdShadeCoordSysAPI::FindBindingsWithInheritance() const for (UsdPrim prim = GetPrim(); prim; prim = prim.GetParent()) { SdfPathVector targets; for (UsdProperty prop : prim.GetAuthoredPropertiesInNamespace( - _schemaTokens->coordSys)) { + UsdShadeTokens->coordSys)) { if (UsdRelationship rel = prop.As()) { // Check if name is already bound; skip if bound. bool nameIsAlreadyBound = false; @@ -542,7 +518,7 @@ UsdShadeCoordSysAPI::HasLocalBindings() const } for (const UsdProperty &prop: - GetPrim().GetAuthoredPropertiesInNamespace(_schemaTokens->coordSys)) { + GetPrim().GetAuthoredPropertiesInNamespace(UsdShadeTokens->coordSys)) { if (UsdRelationship rel = prop.As()) { if (rel) { if (checker == 2) { @@ -711,7 +687,7 @@ UsdShadeCoordSysAPI::BlockBinding() const TfToken UsdShadeCoordSysAPI::GetCoordSysRelationshipName(const std::string &name) { - return TfToken(_schemaTokens->coordSys.GetString() + ":" + name); + return TfToken(UsdShadeTokens->coordSys.GetString() + ":" + name); } /* static */ diff --git a/pxr/usd/usdShade/coordSysAPI.h b/pxr/usd/usdShade/coordSysAPI.h index a8b89ab013..6c35e485a4 100644 --- a/pxr/usd/usdShade/coordSysAPI.h +++ b/pxr/usd/usdShade/coordSysAPI.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDSHADE_GENERATED_COORDSYSAPI_H #define USDSHADE_GENERATED_COORDSYSAPI_H diff --git a/pxr/usd/usdShade/input.cpp b/pxr/usd/usdShade/input.cpp index f924157204..e66ebd8ca9 100644 --- a/pxr/usd/usdShade/input.cpp +++ b/pxr/usd/usdShade/input.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usdShade/input.h" diff --git a/pxr/usd/usdShade/input.h b/pxr/usd/usdShade/input.h index 97a7003ecc..c41d24d05c 100644 --- a/pxr/usd/usdShade/input.h +++ b/pxr/usd/usdShade/input.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_SHADE_INPUT_H #define PXR_USD_USD_SHADE_INPUT_H diff --git a/pxr/usd/usdShade/material.cpp b/pxr/usd/usdShade/material.cpp index 4bce2cbeb7..58e16fc584 100644 --- a/pxr/usd/usdShade/material.cpp +++ b/pxr/usd/usdShade/material.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdShade/material.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usdShade/material.h b/pxr/usd/usdShade/material.h index 1c1f750e82..502f95cc54 100644 --- a/pxr/usd/usdShade/material.h +++ b/pxr/usd/usdShade/material.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDSHADE_GENERATED_MATERIAL_H #define USDSHADE_GENERATED_MATERIAL_H diff --git a/pxr/usd/usdShade/materialBindingAPI.cpp b/pxr/usd/usdShade/materialBindingAPI.cpp index 51b331c167..cb311f0509 100644 --- a/pxr/usd/usdShade/materialBindingAPI.cpp +++ b/pxr/usd/usdShade/materialBindingAPI.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdShade/materialBindingAPI.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usdShade/materialBindingAPI.h b/pxr/usd/usdShade/materialBindingAPI.h index fa5459ca7c..2a6b54c743 100644 --- a/pxr/usd/usdShade/materialBindingAPI.h +++ b/pxr/usd/usdShade/materialBindingAPI.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDSHADE_GENERATED_MATERIALBINDINGAPI_H #define USDSHADE_GENERATED_MATERIALBINDINGAPI_H diff --git a/pxr/usd/usdShade/module.cpp b/pxr/usd/usdShade/module.cpp index a52625a1c6..d26c4f47c9 100644 --- a/pxr/usd/usdShade/module.cpp +++ b/pxr/usd/usdShade/module.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/base/tf/pyModule.h" diff --git a/pxr/usd/usdShade/moduleDeps.cpp b/pxr/usd/usdShade/moduleDeps.cpp index 1a5b5f3a2c..976877aee8 100644 --- a/pxr/usd/usdShade/moduleDeps.cpp +++ b/pxr/usd/usdShade/moduleDeps.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/pxr/usd/usdShade/nodeDefAPI.cpp b/pxr/usd/usdShade/nodeDefAPI.cpp index 043b84d708..d5264306c8 100644 --- a/pxr/usd/usdShade/nodeDefAPI.cpp +++ b/pxr/usd/usdShade/nodeDefAPI.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdShade/nodeDefAPI.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usdShade/nodeDefAPI.h b/pxr/usd/usdShade/nodeDefAPI.h index ad93c72b4b..1e87203678 100644 --- a/pxr/usd/usdShade/nodeDefAPI.h +++ b/pxr/usd/usdShade/nodeDefAPI.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDSHADE_GENERATED_NODEDEFAPI_H #define USDSHADE_GENERATED_NODEDEFAPI_H diff --git a/pxr/usd/usdShade/nodeGraph.cpp b/pxr/usd/usdShade/nodeGraph.cpp index bdb3e0c342..cb832065c8 100644 --- a/pxr/usd/usdShade/nodeGraph.cpp +++ b/pxr/usd/usdShade/nodeGraph.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdShade/nodeGraph.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usdShade/nodeGraph.h b/pxr/usd/usdShade/nodeGraph.h index edfcb5907a..d7e3a493b9 100644 --- a/pxr/usd/usdShade/nodeGraph.h +++ b/pxr/usd/usdShade/nodeGraph.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDSHADE_GENERATED_NODEGRAPH_H #define USDSHADE_GENERATED_NODEGRAPH_H diff --git a/pxr/usd/usdShade/output.cpp b/pxr/usd/usdShade/output.cpp index 295f5e9711..8c9d10aa5e 100644 --- a/pxr/usd/usdShade/output.cpp +++ b/pxr/usd/usdShade/output.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usdShade/output.h" diff --git a/pxr/usd/usdShade/output.h b/pxr/usd/usdShade/output.h index 0d5a15d035..1146ed39fd 100644 --- a/pxr/usd/usdShade/output.h +++ b/pxr/usd/usdShade/output.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_SHADE_OUTPUT_H #define PXR_USD_USD_SHADE_OUTPUT_H diff --git a/pxr/usd/usdShade/pch.h b/pxr/usd/usdShade/pch.h index 698ab0ca65..c6e0a1ba12 100644 --- a/pxr/usd/usdShade/pch.h +++ b/pxr/usd/usdShade/pch.h @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // // WARNING: THIS FILE IS GENERATED. DO NOT EDIT. // @@ -28,9 +11,19 @@ #include "pxr/pxr.h" #include "pxr/base/arch/defines.h" #if defined(ARCH_OS_DARWIN) +#include +#include +#include +#include +#include #include #endif #if defined(ARCH_OS_LINUX) +#include +#include +#include +#include +#include #include #endif #if defined(ARCH_OS_WINDOWS) @@ -38,12 +31,13 @@ #define WIN32_LEAN_AND_MEAN #endif +#include #include -#include -#include -#include +#include +#include #endif #include +#include #include #include #include @@ -57,6 +51,7 @@ #include #include #include +#include #include #include #include @@ -70,6 +65,8 @@ #include #include #include +#include +#include #include #include #include @@ -77,63 +74,18 @@ #include #include #include +#include #include #include +#include #include #include #include #include #include #include +#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #ifdef PXR_PYTHON_SUPPORT_ENABLED #include #include @@ -150,6 +102,7 @@ #include #include #include +#include #include #include #include @@ -160,28 +113,9 @@ #undef toupper #endif #endif // PXR_PYTHON_SUPPORT_ENABLED -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include #include +#include #include #include #include @@ -189,10 +123,11 @@ #include #include #include +#include #include #include #include -#include +#include #ifdef PXR_PYTHON_SUPPORT_ENABLED #include "pxr/base/tf/pySafePython.h" #endif // PXR_PYTHON_SUPPORT_ENABLED diff --git a/pxr/usd/usdShade/plugInfo.json b/pxr/usd/usdShade/plugInfo.json index 5e91885371..f2377e4117 100644 --- a/pxr/usd/usdShade/plugInfo.json +++ b/pxr/usd/usdShade/plugInfo.json @@ -126,6 +126,17 @@ ], "displayName": "USD-based shader definition parser plugin" } + }, + "Validators": { + "ShaderSdrCompliance": { + "doc": "Shader prim's input types must be conforming to their appropriate sdf types in the respective sdr shader.", + "schemaTypes": [ + "UsdShadeShader" + ] + }, + "keywords": [ + "UsdShadeValidators" + ] } }, "LibraryPath": "@PLUG_INFO_LIBRARY_PATH@", diff --git a/pxr/usd/usdShade/shader.cpp b/pxr/usd/usdShade/shader.cpp index 79ef2e4cc5..16702dd9e4 100644 --- a/pxr/usd/usdShade/shader.cpp +++ b/pxr/usd/usdShade/shader.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdShade/shader.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usdShade/shader.h b/pxr/usd/usdShade/shader.h index d94fa7a3c7..d7a9badd57 100644 --- a/pxr/usd/usdShade/shader.h +++ b/pxr/usd/usdShade/shader.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDSHADE_GENERATED_SHADER_H #define USDSHADE_GENERATED_SHADER_H diff --git a/pxr/usd/usdShade/shaderDefParser.cpp b/pxr/usd/usdShade/shaderDefParser.cpp index 69fc1a0bf7..b7d3c89090 100644 --- a/pxr/usd/usdShade/shaderDefParser.cpp +++ b/pxr/usd/usdShade/shaderDefParser.cpp @@ -1,25 +1,8 @@ // // Copyright 2018 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdShade/shaderDefParser.h" diff --git a/pxr/usd/usdShade/shaderDefParser.h b/pxr/usd/usdShade/shaderDefParser.h index 80a0a27845..5ddd78ee96 100644 --- a/pxr/usd/usdShade/shaderDefParser.h +++ b/pxr/usd/usdShade/shaderDefParser.h @@ -1,25 +1,8 @@ // // Copyright 2018 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_SHADE_SHADER_DEF_PARSER_H #define PXR_USD_USD_SHADE_SHADER_DEF_PARSER_H diff --git a/pxr/usd/usdShade/shaderDefUtils.cpp b/pxr/usd/usdShade/shaderDefUtils.cpp index 4e39c172b6..01c936ec29 100644 --- a/pxr/usd/usdShade/shaderDefUtils.cpp +++ b/pxr/usd/usdShade/shaderDefUtils.cpp @@ -1,25 +1,8 @@ // // Copyright 2018 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdShade/shaderDefUtils.h" diff --git a/pxr/usd/usdShade/shaderDefUtils.h b/pxr/usd/usdShade/shaderDefUtils.h index 2322ab5634..6c970bbcb3 100644 --- a/pxr/usd/usdShade/shaderDefUtils.h +++ b/pxr/usd/usdShade/shaderDefUtils.h @@ -1,25 +1,8 @@ // // Copyright 2018 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_SHADE_SHADER_DEF_UTILS_H #define PXR_USD_USD_SHADE_SHADER_DEF_UTILS_H diff --git a/pxr/usd/usdShade/testenv/testUsdShadeBinding.py b/pxr/usd/usdShade/testenv/testUsdShadeBinding.py index 6b4338e7e4..60fe21821d 100644 --- a/pxr/usd/usdShade/testenv/testUsdShadeBinding.py +++ b/pxr/usd/usdShade/testenv/testUsdShadeBinding.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from __future__ import print_function diff --git a/pxr/usd/usdShade/testenv/testUsdShadeConnectability.py b/pxr/usd/usdShade/testenv/testUsdShadeConnectability.py index 0534ad7bb5..68f87c6223 100644 --- a/pxr/usd/usdShade/testenv/testUsdShadeConnectability.py +++ b/pxr/usd/usdShade/testenv/testUsdShadeConnectability.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from pxr import Sdf, Usd, UsdShade import unittest diff --git a/pxr/usd/usdShade/testenv/testUsdShadeConnectableAPIBehavior.py b/pxr/usd/usdShade/testenv/testUsdShadeConnectableAPIBehavior.py index d1411f1767..e006e9fe96 100644 --- a/pxr/usd/usdShade/testenv/testUsdShadeConnectableAPIBehavior.py +++ b/pxr/usd/usdShade/testenv/testUsdShadeConnectableAPIBehavior.py @@ -2,25 +2,8 @@ # # Copyright 2021 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from pxr import Plug, Sdf, Usd, UsdShade, Tf import os, unittest diff --git a/pxr/usd/usdShade/testenv/testUsdShadeCoordSysAPI.py b/pxr/usd/usdShade/testenv/testUsdShadeCoordSysAPI.py index e6ae639954..f41b3f28dd 100644 --- a/pxr/usd/usdShade/testenv/testUsdShadeCoordSysAPI.py +++ b/pxr/usd/usdShade/testenv/testUsdShadeCoordSysAPI.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. import sys, unittest from pxr import Usd, UsdShade, UsdGeom, Sdf, Tf diff --git a/pxr/usd/usdShade/testenv/testUsdShadeCoordSysAPIDeprecated.py b/pxr/usd/usdShade/testenv/testUsdShadeCoordSysAPIDeprecated.py index 0b9d72171f..840a66cfa7 100644 --- a/pxr/usd/usdShade/testenv/testUsdShadeCoordSysAPIDeprecated.py +++ b/pxr/usd/usdShade/testenv/testUsdShadeCoordSysAPIDeprecated.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. import sys, unittest from pxr import Usd, UsdShade, UsdGeom, Sdf, Tf diff --git a/pxr/usd/usdShade/testenv/testUsdShadeGetValueProducingAttribute.py b/pxr/usd/usdShade/testenv/testUsdShadeGetValueProducingAttribute.py index 3eae89aa11..7f37f9b0d0 100644 --- a/pxr/usd/usdShade/testenv/testUsdShadeGetValueProducingAttribute.py +++ b/pxr/usd/usdShade/testenv/testUsdShadeGetValueProducingAttribute.py @@ -2,25 +2,8 @@ # # Copyright 2019 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from __future__ import print_function diff --git a/pxr/usd/usdShade/testenv/testUsdShadeHasConnectableAPI.cpp b/pxr/usd/usdShade/testenv/testUsdShadeHasConnectableAPI.cpp index ff1f805472..bd9d6757ec 100644 --- a/pxr/usd/usdShade/testenv/testUsdShadeHasConnectableAPI.cpp +++ b/pxr/usd/usdShade/testenv/testUsdShadeHasConnectableAPI.cpp @@ -1,25 +1,8 @@ // // Copyright 2020 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdGeom/sphere.h" diff --git a/pxr/usd/usdShade/testenv/testUsdShadeInterfaceInputConsumers.py b/pxr/usd/usdShade/testenv/testUsdShadeInterfaceInputConsumers.py index c3edf96050..3c600ef3e2 100644 --- a/pxr/usd/usdShade/testenv/testUsdShadeInterfaceInputConsumers.py +++ b/pxr/usd/usdShade/testenv/testUsdShadeInterfaceInputConsumers.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from pxr import Sdf, Usd, UsdShade import unittest diff --git a/pxr/usd/usdShade/testenv/testUsdShadeMaterialAuthoring.py b/pxr/usd/usdShade/testenv/testUsdShadeMaterialAuthoring.py index a4ed10c009..02434ab7b1 100644 --- a/pxr/usd/usdShade/testenv/testUsdShadeMaterialAuthoring.py +++ b/pxr/usd/usdShade/testenv/testUsdShadeMaterialAuthoring.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from pxr import Sdf, Usd, UsdGeom, UsdShade import unittest diff --git a/pxr/usd/usdShade/testenv/testUsdShadeMaterialBaseMaterial.py b/pxr/usd/usdShade/testenv/testUsdShadeMaterialBaseMaterial.py index c2639f0a2c..192c89f4cc 100644 --- a/pxr/usd/usdShade/testenv/testUsdShadeMaterialBaseMaterial.py +++ b/pxr/usd/usdShade/testenv/testUsdShadeMaterialBaseMaterial.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from __future__ import print_function diff --git a/pxr/usd/usdShade/testenv/testUsdShadeMaterialBindFaceSubset.py b/pxr/usd/usdShade/testenv/testUsdShadeMaterialBindFaceSubset.py index 0d8e972ca0..6778833d1a 100644 --- a/pxr/usd/usdShade/testenv/testUsdShadeMaterialBindFaceSubset.py +++ b/pxr/usd/usdShade/testenv/testUsdShadeMaterialBindFaceSubset.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from pxr import Usd, UsdGeom, UsdShade, Vt import unittest diff --git a/pxr/usd/usdShade/testenv/testUsdShadeMaterialBinding.py b/pxr/usd/usdShade/testenv/testUsdShadeMaterialBinding.py index 464d4a31ec..e977d6d2d5 100644 --- a/pxr/usd/usdShade/testenv/testUsdShadeMaterialBinding.py +++ b/pxr/usd/usdShade/testenv/testUsdShadeMaterialBinding.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from pxr import Sdf, Usd, UsdShade import unittest diff --git a/pxr/usd/usdShade/testenv/testUsdShadeMaterialOutputs.py b/pxr/usd/usdShade/testenv/testUsdShadeMaterialOutputs.py index f6e17ceb59..f71a1dc109 100644 --- a/pxr/usd/usdShade/testenv/testUsdShadeMaterialOutputs.py +++ b/pxr/usd/usdShade/testenv/testUsdShadeMaterialOutputs.py @@ -2,25 +2,8 @@ # # Copyright 2018 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from pxr import Sdf, Usd, UsdShade import os, unittest diff --git a/pxr/usd/usdShade/testenv/testUsdShadeMaterialSpecializesBaseComposition.py b/pxr/usd/usdShade/testenv/testUsdShadeMaterialSpecializesBaseComposition.py index 6f32887538..e45270f7a2 100644 --- a/pxr/usd/usdShade/testenv/testUsdShadeMaterialSpecializesBaseComposition.py +++ b/pxr/usd/usdShade/testenv/testUsdShadeMaterialSpecializesBaseComposition.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from pxr import Sdf, Usd, UsdShade import os, unittest diff --git a/pxr/usd/usdShade/testenv/testUsdShadeNodeGraphs.py b/pxr/usd/usdShade/testenv/testUsdShadeNodeGraphs.py index de988b894d..2b063f8eea 100644 --- a/pxr/usd/usdShade/testenv/testUsdShadeNodeGraphs.py +++ b/pxr/usd/usdShade/testenv/testUsdShadeNodeGraphs.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from pxr import Sdf, Usd, UsdShade import unittest diff --git a/pxr/usd/usdShade/testenv/testUsdShadeShaderDef.py b/pxr/usd/usdShade/testenv/testUsdShadeShaderDef.py index 443c98687c..10d726f78a 100644 --- a/pxr/usd/usdShade/testenv/testUsdShadeShaderDef.py +++ b/pxr/usd/usdShade/testenv/testUsdShadeShaderDef.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from pxr import Ndr, Sdf, Sdr, Usd, UsdShade from pxr.Sdr import shaderParserTestUtils as utils diff --git a/pxr/usd/usdShade/testenv/testUsdShadeShaderDef/TestShaderPropertiesNode.glslfx b/pxr/usd/usdShade/testenv/testUsdShadeShaderDef/TestShaderPropertiesNode.glslfx index ffa8923b0c..7a9fb0a0cb 100644 --- a/pxr/usd/usdShade/testenv/testUsdShadeShaderDef/TestShaderPropertiesNode.glslfx +++ b/pxr/usd/usdShade/testenv/testUsdShadeShaderDef/TestShaderPropertiesNode.glslfx @@ -1,5 +1,11 @@ -- glslfx version 0.1 +// +// Copyright 2019 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // TestShaderPropertiesNode -- configuration diff --git a/pxr/usd/usdShade/testenv/testUsdShadeShaders.py b/pxr/usd/usdShade/testenv/testUsdShadeShaders.py index fff851d855..7158706b02 100644 --- a/pxr/usd/usdShade/testenv/testUsdShadeShaders.py +++ b/pxr/usd/usdShade/testenv/testUsdShadeShaders.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from __future__ import print_function diff --git a/pxr/usd/usdShade/testenv/testUsdShadeUdimUtils.py b/pxr/usd/usdShade/testenv/testUsdShadeUdimUtils.py index b45b27f365..52a9f03a6a 100644 --- a/pxr/usd/usdShade/testenv/testUsdShadeUdimUtils.py +++ b/pxr/usd/usdShade/testenv/testUsdShadeUdimUtils.py @@ -2,25 +2,8 @@ # # Copyright 2023 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from pxr import UsdShade, Sdf import os diff --git a/pxr/usd/usdShade/testenv/testUsdShadeValidators.cpp b/pxr/usd/usdShade/testenv/testUsdShadeValidators.cpp new file mode 100644 index 0000000000..9306ae9da9 --- /dev/null +++ b/pxr/usd/usdShade/testenv/testUsdShadeValidators.cpp @@ -0,0 +1,128 @@ +// +// Copyright 2024 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// + +#include "pxr/pxr.h" +#include "pxr/base/tf/token.h" +#include "pxr/usd/sdr/registry.h" +#include "pxr/usd/usd/validationRegistry.h" +#include "pxr/usd/usd/validationError.h" +#include "pxr/usd/usd/validator.h" +#include "pxr/usd/usdShade/shader.h" +#include "pxr/usd/usdShade/shaderDefUtils.h" +#include "pxr/usd/usdShade/validatorTokens.h" + +#include + +PXR_NAMESPACE_USING_DIRECTIVE + +void +TestUsdShadeValidators() +{ + // This should be updated with every new validators added with + // UsdShadeValidators keyword. + UsdValidationRegistry ®istry = UsdValidationRegistry::GetInstance(); + UsdValidatorMetadataVector metadata = + registry.GetValidatorMetadataForKeyword( + UsdShadeValidatorKeywordTokens->UsdShadeValidators); + // Since other validators can be can registered with a UsdShadeValidators + // keyword, our validators registered in usdShade are a subset of the entire + // set. + std::set validatorMetadataNameSet; + for (const UsdValidatorMetadata &metadata : metadata) { + validatorMetadataNameSet.insert(metadata.name); + } + + const std::set expectedValidatorNames = + {UsdShadeValidatorNameTokens->shaderSdrCompliance}; + + TF_AXIOM(std::includes(validatorMetadataNameSet.begin(), + validatorMetadataNameSet.end(), + expectedValidatorNames.begin(), + expectedValidatorNames.end())); +} + +void +TestUsdShadeShaderPropertyCompliance() +{ + // Need to setup our test shader in sdrRegistry first + UsdStageRefPtr shaderDefStage = UsdStage::Open("./shaderDefs.usda"); + UsdShadeShader shaderDef = + UsdShadeShader::Get(shaderDefStage, SdfPath("/TestShaderNode")); + SdrRegistry::GetInstance().AddDiscoveryResult( + UsdShadeShaderDefUtils::GetNodeDiscoveryResults( + shaderDef, shaderDefStage->GetRootLayer()->GetRealPath())[0]); + + // Now lets test our ShaderProperty validator + UsdValidationRegistry ®istry = UsdValidationRegistry::GetInstance(); + const UsdValidator *validator = registry.GetOrLoadValidatorByName( + UsdShadeValidatorNameTokens->shaderSdrCompliance); + TF_AXIOM(validator); + + static const std::string layerContents = + R"usda(#usda 1.0 + def Shader "Test" + { + uniform token info:id = "TestShaderNode" + int inputs:inputInt = 2 + float inputs:inputFloat = 2.0 + float3 inputs:inputColor = (2.0, 3.0, 4.0) + token outputs:surface + } + def Shader "Bogus" + { + uniform token info:id = "Bogus" + })usda"; + SdfLayerRefPtr layer = SdfLayer::CreateAnonymous(".usda"); + layer->ImportFromString(layerContents); + UsdStageRefPtr usdStage = UsdStage::Open(layer); + TF_AXIOM(usdStage); + + { + const UsdPrim usdPrim = usdStage->GetPrimAtPath( + SdfPath("/Test")); + + UsdValidationErrorVector errors = validator->Validate(usdPrim); + + TF_AXIOM(errors.size() == 1); + TF_AXIOM(errors[0].GetType() == UsdValidationErrorType::Error); + TF_AXIOM(errors[0].GetSites().size() == 1); + TF_AXIOM(errors[0].GetSites()[0].IsValid()); + TF_AXIOM(errors[0].GetSites()[0].IsProperty()); + TF_AXIOM(errors[0].GetSites()[0].GetProperty().GetPath() == + SdfPath("/Test.inputs:inputColor")); + const std::string expectedErrorMsg = "Incorrect type for " + "/Test.inputs:inputColor. Expected 'color3f'; " + "got 'float3'."; + TF_AXIOM(errors[0].GetMessage() == expectedErrorMsg); + } + + { + const UsdPrim usdPrim = usdStage->GetPrimAtPath( + SdfPath("/Bogus")); + + UsdValidationErrorVector errors = validator->Validate(usdPrim); + TF_AXIOM(errors.size() == 1); + TF_AXIOM(errors[0].GetType() == UsdValidationErrorType::Error); + TF_AXIOM(errors[0].GetSites().size() == 1); + TF_AXIOM(errors[0].GetSites()[0].IsValid()); + TF_AXIOM(errors[0].GetSites()[0].IsProperty()); + TF_AXIOM(errors[0].GetSites()[0].GetProperty().GetPath() == + SdfPath("/Bogus.info:id")); + const std::string expectedErrorMsg = "shaderId 'Bogus' specified on " + "shader prim not found in sdrRegistry."; + TF_AXIOM(errors[0].GetMessage() == expectedErrorMsg); + } +} + +int +main() +{ + TestUsdShadeValidators(); + TestUsdShadeShaderPropertyCompliance(); + printf("OK\n"); + return EXIT_SUCCESS; +}; diff --git a/pxr/usd/usdShade/testenv/testUsdShadeValidators/TestShader.glslfx b/pxr/usd/usdShade/testenv/testUsdShadeValidators/TestShader.glslfx new file mode 100644 index 0000000000..bc799c33f3 --- /dev/null +++ b/pxr/usd/usdShade/testenv/testUsdShadeValidators/TestShader.glslfx @@ -0,0 +1,19 @@ +-- glslfx version 0.1 + +// +// Copyright 2024 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// +// TestShader + +-- configuration +{ + "techniques": { + "default": { + } + } +} + +-- This file is intentionally empty. diff --git a/pxr/usd/usdShade/testenv/testUsdShadeValidators/shaderDefs.usda b/pxr/usd/usdShade/testenv/testUsdShadeValidators/shaderDefs.usda new file mode 100644 index 0000000000..0600e47a84 --- /dev/null +++ b/pxr/usd/usdShade/testenv/testUsdShadeValidators/shaderDefs.usda @@ -0,0 +1,14 @@ +#usda 1.0 + +def Shader "TestShaderNode" ( + doc = "This node is used for testing UsdShadeValidator test" +) +{ + uniform asset info:glslfx:sourceAsset = @./TestShader.glslfx@ + uniform token info:id = "TestShaderNode" + uniform token info:implementationSource = "sourceAsset" + int inputs:inputInt = 1 + string inputs:inputString = "foo" + float inputs:inputFloat = 1.0 + color3f inputs:inputColor = (1.0, 1.0, 1.0) +} diff --git a/pxr/usd/usdShade/tokens.cpp b/pxr/usd/usdShade/tokens.cpp index f2a5e7504b..bce1b64525 100644 --- a/pxr/usd/usdShade/tokens.cpp +++ b/pxr/usd/usdShade/tokens.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdShade/tokens.h" diff --git a/pxr/usd/usdShade/tokens.h b/pxr/usd/usdShade/tokens.h index 8b26d92182..807f47558a 100644 --- a/pxr/usd/usdShade/tokens.h +++ b/pxr/usd/usdShade/tokens.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDSHADE_TOKENS_H #define USDSHADE_TOKENS_H diff --git a/pxr/usd/usdShade/types.h b/pxr/usd/usdShade/types.h index 4d98595b70..122b42c600 100644 --- a/pxr/usd/usdShade/types.h +++ b/pxr/usd/usdShade/types.h @@ -1,25 +1,8 @@ // // Copyright 2020 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_SHADE_TYPES_H #define PXR_USD_USD_SHADE_TYPES_H diff --git a/pxr/usd/usdShade/udimUtils.cpp b/pxr/usd/usdShade/udimUtils.cpp index 08c1cd33a4..951068ea9a 100644 --- a/pxr/usd/usdShade/udimUtils.cpp +++ b/pxr/usd/usdShade/udimUtils.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/base/tf/pathUtils.h" diff --git a/pxr/usd/usdShade/udimUtils.h b/pxr/usd/usdShade/udimUtils.h index 224323af44..8b808536fe 100644 --- a/pxr/usd/usdShade/udimUtils.h +++ b/pxr/usd/usdShade/udimUtils.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_SHADE_UDIM_UTILS_H #define PXR_USD_USD_SHADE_UDIM_UTILS_H diff --git a/pxr/usd/usdShade/utils.cpp b/pxr/usd/usdShade/utils.cpp index 2aed8da669..446b0119e4 100644 --- a/pxr/usd/usdShade/utils.cpp +++ b/pxr/usd/usdShade/utils.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usdShade/utils.h" diff --git a/pxr/usd/usdShade/utils.h b/pxr/usd/usdShade/utils.h index a9acdac476..aa8214610b 100644 --- a/pxr/usd/usdShade/utils.h +++ b/pxr/usd/usdShade/utils.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_SHADE_UTILS_H #define PXR_USD_USD_SHADE_UTILS_H diff --git a/pxr/usd/usdShade/validatorTokens.cpp b/pxr/usd/usdShade/validatorTokens.cpp new file mode 100644 index 0000000000..fd32d4243b --- /dev/null +++ b/pxr/usd/usdShade/validatorTokens.cpp @@ -0,0 +1,17 @@ +// +// Copyright 2024 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// + +#include "pxr/usd/usdShade/validatorTokens.h" + +PXR_NAMESPACE_OPEN_SCOPE + +TF_DEFINE_PUBLIC_TOKENS(UsdShadeValidatorNameTokens, + USD_SHADE_VALIDATOR_NAME_TOKENS); +TF_DEFINE_PUBLIC_TOKENS(UsdShadeValidatorKeywordTokens, + USD_SHADE_VALIDATOR_KEYWORD_TOKENS); + +PXR_NAMESPACE_CLOSE_SCOPE diff --git a/pxr/usd/usdShade/validatorTokens.h b/pxr/usd/usdShade/validatorTokens.h new file mode 100644 index 0000000000..2720aaaa6a --- /dev/null +++ b/pxr/usd/usdShade/validatorTokens.h @@ -0,0 +1,42 @@ +// +// Copyright 2024 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// + +#ifndef USDSHADE_VALIDATOR_TOKENS_H +#define USDSHADE_VALIDATOR_TOKENS_H + +/// \file + +#include "pxr/pxr.h" +#include "pxr/usd/usdShade/api.h" +#include "pxr/base/tf/staticTokens.h" + +PXR_NAMESPACE_OPEN_SCOPE + +#define USD_SHADE_VALIDATOR_NAME_TOKENS \ + ((shaderSdrCompliance, "usdShade:ShaderSdrCompliance")) + +#define USD_SHADE_VALIDATOR_KEYWORD_TOKENS \ + (UsdShadeValidators) + +///\def +/// Tokens representing validator names. Note that for plugin provided +/// validators, the names must be prefixed by usdShade:, which is the name of +/// the usdShade plugin. +TF_DECLARE_PUBLIC_TOKENS(UsdShadeValidatorNameTokens, USDSHADE_API, + USD_SHADE_VALIDATOR_NAME_TOKENS); + +///\def +/// Tokens representing keywords associated with any validator in the usdShade +/// plugin. Cliends can use this to inspect validators contained within a +/// specific keywords, or use these to be added as keywords to any new +/// validator. +TF_DECLARE_PUBLIC_TOKENS(UsdShadeValidatorKeywordTokens, USDSHADE_API, + USD_SHADE_VALIDATOR_KEYWORD_TOKENS); + +PXR_NAMESPACE_CLOSE_SCOPE + +#endif diff --git a/pxr/usd/usdShade/validators.cpp b/pxr/usd/usdShade/validators.cpp new file mode 100644 index 0000000000..295c5beb0d --- /dev/null +++ b/pxr/usd/usdShade/validators.cpp @@ -0,0 +1,204 @@ +// +// Copyright 2024 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// + +#include "pxr/usd/sdr/shaderProperty.h" +#include "pxr/usd/usd/prim.h" +#include "pxr/usd/usd/schemaRegistry.h" +#include "pxr/usd/usd/validationError.h" +#include "pxr/usd/usd/validationRegistry.h" +#include "pxr/usd/usd/validator.h" +#include "pxr/usd/sdr/registry.h" +#include "pxr/base/tf/token.h" +#include "pxr/base/tf/stringUtils.h" +#include "pxr/usd/usdShade/shader.h" +#include "pxr/usd/usdShade/validatorTokens.h" + +#include +#include + +PXR_NAMESPACE_OPEN_SCOPE + +static +UsdValidationErrorVector +_ShaderPropertyTypeConformance(const UsdPrim &usdPrim) +{ + if (!(usdPrim && usdPrim.IsInFamily( + UsdSchemaRegistry::VersionPolicy::All))) { + return {}; + } + UsdShadeShader shader(usdPrim); + if (!shader) { + return {}; + } + + const TfTokenVector expectedImplSource = + {UsdShadeTokens->id, UsdShadeTokens->sourceAsset, + UsdShadeTokens->sourceCode}; + + const TfToken implSource = shader.GetImplementationSource(); + if (std::find(expectedImplSource.begin(), expectedImplSource.end(), + implSource) == expectedImplSource.end()) { + const UsdValidationErrorSites implSourceErrorSite = { + UsdValidationErrorSite( + usdPrim.GetStage(), + shader.GetImplementationSourceAttr().GetPath()) }; + return {UsdValidationError(UsdValidationErrorType::Error, + implSourceErrorSite, + TfStringPrintf("Shader <%s> has invalid " + "implementation source '%s'.", + usdPrim.GetPath().GetText(), + implSource.GetText()))}; + } + + const std::vector sourceTypes = shader.GetSourceTypes(); + if (sourceTypes.empty() && implSource != UsdShadeTokens->id) { + const UsdValidationErrorSites primErrorSite = { + UsdValidationErrorSite(usdPrim.GetStage(), + usdPrim.GetPath()) }; + return {UsdValidationError( + UsdValidationErrorType::Error, + primErrorSite, + TfStringPrintf("Shader <%s> has no sourceType.", + usdPrim.GetPath().GetText()))}; + } + + UsdValidationErrorVector errors; + std::unordered_map propNameToPropertyMap; + if (sourceTypes.empty() && implSource == UsdShadeTokens->id) { + TfToken shaderId; + if (shader.GetShaderId(&shaderId)) { + // Single shaderNode, just emplace all properties, no need to find + // anything. + if (SdrShaderNodeConstPtr sdrShaderNode = + SdrRegistry::GetInstance().GetShaderNodeByIdentifier( + shaderId)) { + for (const TfToken &propName : sdrShaderNode->GetInputNames()) { + if (const SdrShaderPropertyConstPtr sdrProp = + sdrShaderNode->GetShaderInput(propName)) { + propNameToPropertyMap.emplace(propName, sdrProp); + } + } + } else { + const UsdValidationErrorSites shaderIdErrorSite = { + UsdValidationErrorSite(usdPrim.GetStage(), + shader.GetIdAttr().GetPath()) }; + return {UsdValidationError( + UsdValidationErrorType::Error, + shaderIdErrorSite, + TfStringPrintf("shaderId '%s' specified on shader prim " + "<%s> not found in sdrRegistry.", + shaderId.GetText(), + usdPrim.GetPath().GetText()))}; + } + } + } else { + // Use the SdrShaderNode::CheckPropertyCompliance to find if these do + // not match, then report a ValidationError as a warning, since asset + // authors have no control on fixing the shaders. + std::vector shaderNodesFromSourceTypes; + + // We need to gather all unique inputs from all sdrShaderNodes queried + // using multiple sourceTypes. + for (const auto& sourceType : sourceTypes) { + if (SdrShaderNodeConstPtr sdrShaderNode = + shader.GetShaderNodeForSourceType(TfToken(sourceType))) { + shaderNodesFromSourceTypes.push_back(sdrShaderNode); + + for (const TfToken &propName : sdrShaderNode->GetInputNames()) { + // Check if property has already been added to the map. + if (propNameToPropertyMap.find(propName) == + propNameToPropertyMap.end()) { + if (const SdrShaderPropertyConstPtr sdrProp = + sdrShaderNode->GetShaderInput(propName)) { + propNameToPropertyMap.emplace(propName, sdrProp); + } + } + } + } else { + UsdValidationErrorSites sourceTypeSites; + for (const auto& sourceTypeProp : + usdPrim.GetPropertiesInNamespace( + SdfPath::JoinIdentifier("info", sourceType))) { + sourceTypeSites.emplace_back(usdPrim.GetStage(), + sourceTypeProp.GetPath()); + } + errors.emplace_back( + UsdValidationErrorType::Error, + sourceTypeSites, + TfStringPrintf("sourceType '%s' specified on shader prim " + "<%s> not found in sdrRegistry.", + sourceType.c_str(), + usdPrim.GetPath().GetText())); + } + } + SdrShaderNode::ComplianceResults sdrShaderComplianceResults = + SdrShaderNode::CheckPropertyCompliance(shaderNodesFromSourceTypes); + const UsdValidationErrorSites sdrWarnSite = { + UsdValidationErrorSite(usdPrim.GetStage(), usdPrim.GetPath()) + }; + for (const auto& entry : sdrShaderComplianceResults) { + // need this for getting the error message! + std::vector shaderNames; + shaderNames.reserve(entry.second.size()); + for (const auto& shaderName : entry.second) { + shaderNames.push_back(shaderName.GetString()); + } + errors.emplace_back( + UsdValidationErrorType::Warn, sdrWarnSite, + TfStringPrintf("Shader nodes '%s' have incompatible property " + "'%s'.", TfStringJoin(shaderNames).c_str(), + entry.first.GetText())); + } + } + + // Get ground truth data about inputName to types from sdrNode + const auto sdrPropnameToSdfType = [&propNameToPropertyMap]() { + std::unordered_map map; + for (const auto& prop : propNameToPropertyMap) { + map.emplace(prop.first, prop.second->GetTypeAsSdfType().first); + } + return map; + }(); + + // Compare ground truth data with the inputs on UsdShadeShader prim + for (const UsdShadeInput &input : shader.GetInputs(false)) { + const TfToken baseName = input.GetBaseName(); + if (sdrPropnameToSdfType.find(baseName) != + sdrPropnameToSdfType.end()) { + const SdfValueTypeName &expectedSdrInputType = + sdrPropnameToSdfType.at(baseName); + const SdfValueTypeName usdInputType = input.GetTypeName(); + if (usdInputType != expectedSdrInputType) { + const UsdValidationErrorSites inputErrorSite = { + UsdValidationErrorSite(usdPrim.GetStage(), + input.GetAttr().GetPath()) + }; + errors.emplace_back( + UsdValidationErrorType::Error, + inputErrorSite, + TfStringPrintf("Incorrect type for %s. " + "Expected '%s'; got '%s'.", + input.GetAttr().GetPath().GetText(), + expectedSdrInputType.GetAsToken().GetText(), + usdInputType.GetAsToken().GetText())); + } + } + } + return errors; +} + +TF_REGISTRY_FUNCTION(UsdValidationRegistry) +{ + UsdValidationRegistry ®istry = UsdValidationRegistry::GetInstance(); + + registry.RegisterPluginValidator( + UsdShadeValidatorNameTokens->shaderSdrCompliance, + _ShaderPropertyTypeConformance); +} + +PXR_NAMESPACE_CLOSE_SCOPE diff --git a/pxr/usd/usdShade/wrapConnectableAPI.cpp b/pxr/usd/usdShade/wrapConnectableAPI.cpp index 77dec046bd..ddb8d09c27 100644 --- a/pxr/usd/usdShade/wrapConnectableAPI.cpp +++ b/pxr/usd/usdShade/wrapConnectableAPI.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdShade/connectableAPI.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdShade/wrapCoordSysAPI.cpp b/pxr/usd/usdShade/wrapCoordSysAPI.cpp index 45c6f66a17..aca46d704b 100644 --- a/pxr/usd/usdShade/wrapCoordSysAPI.cpp +++ b/pxr/usd/usdShade/wrapCoordSysAPI.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdShade/coordSysAPI.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdShade/wrapInput.cpp b/pxr/usd/usdShade/wrapInput.cpp index 980f85de75..b0f7b99b0d 100644 --- a/pxr/usd/usdShade/wrapInput.cpp +++ b/pxr/usd/usdShade/wrapInput.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdShade/input.h" #include "pxr/usd/usdShade/output.h" diff --git a/pxr/usd/usdShade/wrapMaterial.cpp b/pxr/usd/usdShade/wrapMaterial.cpp index 1349590c0d..cd0a5277b3 100644 --- a/pxr/usd/usdShade/wrapMaterial.cpp +++ b/pxr/usd/usdShade/wrapMaterial.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdShade/material.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdShade/wrapMaterialBindingAPI.cpp b/pxr/usd/usdShade/wrapMaterialBindingAPI.cpp index 1a2e596bdd..c2c464c91f 100644 --- a/pxr/usd/usdShade/wrapMaterialBindingAPI.cpp +++ b/pxr/usd/usdShade/wrapMaterialBindingAPI.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdShade/materialBindingAPI.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdShade/wrapNodeDefAPI.cpp b/pxr/usd/usdShade/wrapNodeDefAPI.cpp index 7e972d4611..6c2df3ed3b 100644 --- a/pxr/usd/usdShade/wrapNodeDefAPI.cpp +++ b/pxr/usd/usdShade/wrapNodeDefAPI.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdShade/nodeDefAPI.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdShade/wrapNodeGraph.cpp b/pxr/usd/usdShade/wrapNodeGraph.cpp index 4f65b2081d..c8437a88a6 100644 --- a/pxr/usd/usdShade/wrapNodeGraph.cpp +++ b/pxr/usd/usdShade/wrapNodeGraph.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdShade/nodeGraph.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdShade/wrapOutput.cpp b/pxr/usd/usdShade/wrapOutput.cpp index 050ca13127..a690d06c30 100644 --- a/pxr/usd/usdShade/wrapOutput.cpp +++ b/pxr/usd/usdShade/wrapOutput.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usdShade/output.h" diff --git a/pxr/usd/usdShade/wrapShader.cpp b/pxr/usd/usdShade/wrapShader.cpp index eb17d1e59d..14dcfb7c6a 100644 --- a/pxr/usd/usdShade/wrapShader.cpp +++ b/pxr/usd/usdShade/wrapShader.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdShade/shader.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdShade/wrapShaderDefParser.cpp b/pxr/usd/usdShade/wrapShaderDefParser.cpp index 92d003e4cd..4804a47de8 100644 --- a/pxr/usd/usdShade/wrapShaderDefParser.cpp +++ b/pxr/usd/usdShade/wrapShaderDefParser.cpp @@ -1,25 +1,8 @@ // // Copyright 2018 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/usdShade/wrapShaderDefUtils.cpp b/pxr/usd/usdShade/wrapShaderDefUtils.cpp index 83e48bf729..bbec8b8567 100644 --- a/pxr/usd/usdShade/wrapShaderDefUtils.cpp +++ b/pxr/usd/usdShade/wrapShaderDefUtils.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/usdShade/wrapTokens.cpp b/pxr/usd/usdShade/wrapTokens.cpp index e30109f72f..d8c6da61b0 100644 --- a/pxr/usd/usdShade/wrapTokens.cpp +++ b/pxr/usd/usdShade/wrapTokens.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // // GENERATED FILE. DO NOT EDIT. #include diff --git a/pxr/usd/usdShade/wrapTypes.cpp b/pxr/usd/usdShade/wrapTypes.cpp index 1b1f2b7aee..40d66c4686 100644 --- a/pxr/usd/usdShade/wrapTypes.cpp +++ b/pxr/usd/usdShade/wrapTypes.cpp @@ -1,25 +1,8 @@ // // Copyright 2020 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/usdShade/wrapUdimUtils.cpp b/pxr/usd/usdShade/wrapUdimUtils.cpp index a951a1bea4..d0895b5e5a 100644 --- a/pxr/usd/usdShade/wrapUdimUtils.cpp +++ b/pxr/usd/usdShade/wrapUdimUtils.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/usdShade/wrapUtils.cpp b/pxr/usd/usdShade/wrapUtils.cpp index 299c70a49c..8e86388d29 100644 --- a/pxr/usd/usdShade/wrapUtils.cpp +++ b/pxr/usd/usdShade/wrapUtils.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/usdSkel/__init__.py b/pxr/usd/usdSkel/__init__.py index 21792ee990..d830462be1 100644 --- a/pxr/usd/usdSkel/__init__.py +++ b/pxr/usd/usdSkel/__init__.py @@ -1,25 +1,8 @@ # # Copyright 2016 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # from pxr import Tf Tf.PreparePythonModule() diff --git a/pxr/usd/usdSkel/animMapper.cpp b/pxr/usd/usdSkel/animMapper.cpp index e4b33cb4d4..85003772c0 100644 --- a/pxr/usd/usdSkel/animMapper.cpp +++ b/pxr/usd/usdSkel/animMapper.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdSkel/animMapper.h" diff --git a/pxr/usd/usdSkel/animMapper.h b/pxr/usd/usdSkel/animMapper.h index 09c905b507..f6e4a15c8b 100644 --- a/pxr/usd/usdSkel/animMapper.h +++ b/pxr/usd/usdSkel/animMapper.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_SKEL_ANIM_MAPPER_H #define PXR_USD_USD_SKEL_ANIM_MAPPER_H diff --git a/pxr/usd/usdSkel/animQuery.cpp b/pxr/usd/usdSkel/animQuery.cpp index 37413006e4..878a738f9f 100644 --- a/pxr/usd/usdSkel/animQuery.cpp +++ b/pxr/usd/usdSkel/animQuery.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdSkel/animQuery.h" diff --git a/pxr/usd/usdSkel/animQuery.h b/pxr/usd/usdSkel/animQuery.h index d8ad9d7025..e0798b8734 100644 --- a/pxr/usd/usdSkel/animQuery.h +++ b/pxr/usd/usdSkel/animQuery.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_SKEL_ANIM_QUERY_H #define PXR_USD_USD_SKEL_ANIM_QUERY_H diff --git a/pxr/usd/usdSkel/animQueryImpl.cpp b/pxr/usd/usdSkel/animQueryImpl.cpp index 2f3dab1342..480049828c 100644 --- a/pxr/usd/usdSkel/animQueryImpl.cpp +++ b/pxr/usd/usdSkel/animQueryImpl.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdSkel/animQueryImpl.h" diff --git a/pxr/usd/usdSkel/animQueryImpl.h b/pxr/usd/usdSkel/animQueryImpl.h index f62326ca49..a7183c4f74 100644 --- a/pxr/usd/usdSkel/animQueryImpl.h +++ b/pxr/usd/usdSkel/animQueryImpl.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_SKEL_ANIM_QUERY_IMPL_H #define PXR_USD_USD_SKEL_ANIM_QUERY_IMPL_H diff --git a/pxr/usd/usdSkel/animation.cpp b/pxr/usd/usdSkel/animation.cpp index e4414b3bb0..1b102951e6 100644 --- a/pxr/usd/usdSkel/animation.cpp +++ b/pxr/usd/usdSkel/animation.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdSkel/animation.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usdSkel/animation.h b/pxr/usd/usdSkel/animation.h index e25c87ab2c..fa3826debf 100644 --- a/pxr/usd/usdSkel/animation.h +++ b/pxr/usd/usdSkel/animation.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDSKEL_GENERATED_ANIMATION_H #define USDSKEL_GENERATED_ANIMATION_H diff --git a/pxr/usd/usdSkel/api.h b/pxr/usd/usdSkel/api.h index 9e87b48e66..e59fd92f22 100644 --- a/pxr/usd/usdSkel/api.h +++ b/pxr/usd/usdSkel/api.h @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDSKEL_API_H #define USDSKEL_API_H diff --git a/pxr/usd/usdSkel/bakeSkinning.cpp b/pxr/usd/usdSkel/bakeSkinning.cpp index be816de0fc..e87e11b963 100644 --- a/pxr/usd/usdSkel/bakeSkinning.cpp +++ b/pxr/usd/usdSkel/bakeSkinning.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdSkel/bakeSkinning.h" diff --git a/pxr/usd/usdSkel/bakeSkinning.h b/pxr/usd/usdSkel/bakeSkinning.h index b75eac1ccb..c05002d429 100644 --- a/pxr/usd/usdSkel/bakeSkinning.h +++ b/pxr/usd/usdSkel/bakeSkinning.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_SKEL_BAKE_SKINNING_H #define PXR_USD_USD_SKEL_BAKE_SKINNING_H diff --git a/pxr/usd/usdSkel/binding.h b/pxr/usd/usdSkel/binding.h index cc2dad091c..8192e82241 100644 --- a/pxr/usd/usdSkel/binding.h +++ b/pxr/usd/usdSkel/binding.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_SKEL_BINDING_H #define PXR_USD_USD_SKEL_BINDING_H diff --git a/pxr/usd/usdSkel/bindingAPI.cpp b/pxr/usd/usdSkel/bindingAPI.cpp index 14a42ec57f..d163d3773f 100644 --- a/pxr/usd/usdSkel/bindingAPI.cpp +++ b/pxr/usd/usdSkel/bindingAPI.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdSkel/bindingAPI.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usdSkel/bindingAPI.h b/pxr/usd/usdSkel/bindingAPI.h index c650b52149..ffc229f965 100644 --- a/pxr/usd/usdSkel/bindingAPI.h +++ b/pxr/usd/usdSkel/bindingAPI.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDSKEL_GENERATED_BINDINGAPI_H #define USDSKEL_GENERATED_BINDINGAPI_H diff --git a/pxr/usd/usdSkel/blendShape.cpp b/pxr/usd/usdSkel/blendShape.cpp index d89678ce91..47a304fe2f 100644 --- a/pxr/usd/usdSkel/blendShape.cpp +++ b/pxr/usd/usdSkel/blendShape.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdSkel/blendShape.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usdSkel/blendShape.h b/pxr/usd/usdSkel/blendShape.h index 59ade491d7..8e83910e70 100644 --- a/pxr/usd/usdSkel/blendShape.h +++ b/pxr/usd/usdSkel/blendShape.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDSKEL_GENERATED_BLENDSHAPE_H #define USDSKEL_GENERATED_BLENDSHAPE_H diff --git a/pxr/usd/usdSkel/blendShapeQuery.cpp b/pxr/usd/usdSkel/blendShapeQuery.cpp index b129d90716..e855cd234f 100644 --- a/pxr/usd/usdSkel/blendShapeQuery.cpp +++ b/pxr/usd/usdSkel/blendShapeQuery.cpp @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdSkel/blendShapeQuery.h" diff --git a/pxr/usd/usdSkel/blendShapeQuery.h b/pxr/usd/usdSkel/blendShapeQuery.h index ae98c23fdf..28b07dfe2f 100644 --- a/pxr/usd/usdSkel/blendShapeQuery.h +++ b/pxr/usd/usdSkel/blendShapeQuery.h @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_SKEL_BLEND_SHAPE_QUERY_H #define PXR_USD_USD_SKEL_BLEND_SHAPE_QUERY_H diff --git a/pxr/usd/usdSkel/cache.cpp b/pxr/usd/usdSkel/cache.cpp index c5fe3aa522..46feb4e42c 100644 --- a/pxr/usd/usdSkel/cache.cpp +++ b/pxr/usd/usdSkel/cache.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdSkel/cache.h" diff --git a/pxr/usd/usdSkel/cache.h b/pxr/usd/usdSkel/cache.h index 099b045a97..25f89f0aec 100644 --- a/pxr/usd/usdSkel/cache.h +++ b/pxr/usd/usdSkel/cache.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_SKEL_CACHE_H #define PXR_USD_USD_SKEL_CACHE_H diff --git a/pxr/usd/usdSkel/cacheImpl.cpp b/pxr/usd/usdSkel/cacheImpl.cpp index fb782c1113..5188527c0f 100644 --- a/pxr/usd/usdSkel/cacheImpl.cpp +++ b/pxr/usd/usdSkel/cacheImpl.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdSkel/cacheImpl.h" diff --git a/pxr/usd/usdSkel/cacheImpl.h b/pxr/usd/usdSkel/cacheImpl.h index c0fae44935..aee6fac44b 100644 --- a/pxr/usd/usdSkel/cacheImpl.h +++ b/pxr/usd/usdSkel/cacheImpl.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_SKEL_CACHE_IMPL_H #define PXR_USD_USD_SKEL_CACHE_IMPL_H diff --git a/pxr/usd/usdSkel/debugCodes.cpp b/pxr/usd/usdSkel/debugCodes.cpp index 3c54fc4e16..d134ecd39e 100644 --- a/pxr/usd/usdSkel/debugCodes.cpp +++ b/pxr/usd/usdSkel/debugCodes.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdSkel/debugCodes.h" diff --git a/pxr/usd/usdSkel/debugCodes.h b/pxr/usd/usdSkel/debugCodes.h index d759e5cbec..affb48357e 100644 --- a/pxr/usd/usdSkel/debugCodes.h +++ b/pxr/usd/usdSkel/debugCodes.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_SKEL_DEBUG_CODES_H #define PXR_USD_USD_SKEL_DEBUG_CODES_H diff --git a/pxr/usd/usdSkel/inbetweenShape.cpp b/pxr/usd/usdSkel/inbetweenShape.cpp index 53ea9abfc4..ec6884091b 100644 --- a/pxr/usd/usdSkel/inbetweenShape.cpp +++ b/pxr/usd/usdSkel/inbetweenShape.cpp @@ -1,25 +1,8 @@ // // Copyright 2018 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usdSkel/inbetweenShape.h" diff --git a/pxr/usd/usdSkel/inbetweenShape.h b/pxr/usd/usdSkel/inbetweenShape.h index 5534333ae3..566941de2a 100644 --- a/pxr/usd/usdSkel/inbetweenShape.h +++ b/pxr/usd/usdSkel/inbetweenShape.h @@ -1,25 +1,8 @@ // // Copyright 2018 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_SKEL_INBETWEEN_SHAPE_H #define PXR_USD_USD_SKEL_INBETWEEN_SHAPE_H diff --git a/pxr/usd/usdSkel/module.cpp b/pxr/usd/usdSkel/module.cpp index 679ac2dc2a..2292758dfe 100644 --- a/pxr/usd/usdSkel/module.cpp +++ b/pxr/usd/usdSkel/module.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/base/tf/pyModule.h" diff --git a/pxr/usd/usdSkel/moduleDeps.cpp b/pxr/usd/usdSkel/moduleDeps.cpp index 0dc56e2b02..fdae869dde 100644 --- a/pxr/usd/usdSkel/moduleDeps.cpp +++ b/pxr/usd/usdSkel/moduleDeps.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/pxr/usd/usdSkel/pch.h b/pxr/usd/usdSkel/pch.h index a4205ac46d..052c6a520b 100644 --- a/pxr/usd/usdSkel/pch.h +++ b/pxr/usd/usdSkel/pch.h @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // // WARNING: THIS FILE IS GENERATED. DO NOT EDIT. // @@ -31,6 +14,7 @@ #include #endif #if defined(ARCH_OS_LINUX) +#include #include #endif #if defined(ARCH_OS_WINDOWS) @@ -38,12 +22,11 @@ #define WIN32_LEAN_AND_MEAN #endif +#include #include -#include -#include -#include #endif #include +#include #include #include #include @@ -67,9 +50,9 @@ #include #include #include -#include #include #include +#include #include #include #include @@ -78,60 +61,15 @@ #include #include #include +#include #include #include #include #include #include #include +#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #ifdef PXR_PYTHON_SUPPORT_ENABLED #include #include @@ -151,6 +89,8 @@ #include #include #include +#include +#include #include #include #include @@ -159,30 +99,9 @@ #undef toupper #endif #endif // PXR_PYTHON_SUPPORT_ENABLED -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include #include +#include #include #include #include @@ -193,7 +112,7 @@ #include #include #include -#include +#include #ifdef PXR_PYTHON_SUPPORT_ENABLED #include "pxr/base/tf/pySafePython.h" #endif // PXR_PYTHON_SUPPORT_ENABLED diff --git a/pxr/usd/usdSkel/root.cpp b/pxr/usd/usdSkel/root.cpp index e2bd2ddf08..6827c2ed47 100644 --- a/pxr/usd/usdSkel/root.cpp +++ b/pxr/usd/usdSkel/root.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdSkel/root.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usdSkel/root.h b/pxr/usd/usdSkel/root.h index f601fbc3d0..5dbc4f7dce 100644 --- a/pxr/usd/usdSkel/root.h +++ b/pxr/usd/usdSkel/root.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDSKEL_GENERATED_ROOT_H #define USDSKEL_GENERATED_ROOT_H diff --git a/pxr/usd/usdSkel/skelDefinition.cpp b/pxr/usd/usdSkel/skelDefinition.cpp index 84777591aa..29fa40ab0d 100644 --- a/pxr/usd/usdSkel/skelDefinition.cpp +++ b/pxr/usd/usdSkel/skelDefinition.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdSkel/skelDefinition.h" diff --git a/pxr/usd/usdSkel/skelDefinition.h b/pxr/usd/usdSkel/skelDefinition.h index 9c76cca12c..076c209d37 100644 --- a/pxr/usd/usdSkel/skelDefinition.h +++ b/pxr/usd/usdSkel/skelDefinition.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_SKEL_SKEL_DEFINITION_H #define PXR_USD_USD_SKEL_SKEL_DEFINITION_H diff --git a/pxr/usd/usdSkel/skeleton.cpp b/pxr/usd/usdSkel/skeleton.cpp index bfc098fe33..ca6cf18127 100644 --- a/pxr/usd/usdSkel/skeleton.cpp +++ b/pxr/usd/usdSkel/skeleton.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdSkel/skeleton.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usdSkel/skeleton.h b/pxr/usd/usdSkel/skeleton.h index 28f818fd6f..ef94c8569c 100644 --- a/pxr/usd/usdSkel/skeleton.h +++ b/pxr/usd/usdSkel/skeleton.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDSKEL_GENERATED_SKELETON_H #define USDSKEL_GENERATED_SKELETON_H diff --git a/pxr/usd/usdSkel/skeletonQuery.cpp b/pxr/usd/usdSkel/skeletonQuery.cpp index 0aa768220e..470445e410 100644 --- a/pxr/usd/usdSkel/skeletonQuery.cpp +++ b/pxr/usd/usdSkel/skeletonQuery.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdSkel/skeletonQuery.h" diff --git a/pxr/usd/usdSkel/skeletonQuery.h b/pxr/usd/usdSkel/skeletonQuery.h index 3f9d3038f7..a70075b608 100644 --- a/pxr/usd/usdSkel/skeletonQuery.h +++ b/pxr/usd/usdSkel/skeletonQuery.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_SKEL_SKELETON_QUERY_H #define PXR_USD_USD_SKEL_SKELETON_QUERY_H diff --git a/pxr/usd/usdSkel/skinningQuery.cpp b/pxr/usd/usdSkel/skinningQuery.cpp index a191f8ac12..ddf255ee45 100644 --- a/pxr/usd/usdSkel/skinningQuery.cpp +++ b/pxr/usd/usdSkel/skinningQuery.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdSkel/skinningQuery.h" diff --git a/pxr/usd/usdSkel/skinningQuery.h b/pxr/usd/usdSkel/skinningQuery.h index 91b5105ff0..165b7d5de8 100644 --- a/pxr/usd/usdSkel/skinningQuery.h +++ b/pxr/usd/usdSkel/skinningQuery.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_SKEL_SKINNING_QUERY_H #define PXR_USD_USD_SKEL_SKINNING_QUERY_H diff --git a/pxr/usd/usdSkel/testenv/testUsdSkelAnimMapper.py b/pxr/usd/usdSkel/testenv/testUsdSkelAnimMapper.py index e2ccf30bbf..85af2254f2 100644 --- a/pxr/usd/usdSkel/testenv/testUsdSkelAnimMapper.py +++ b/pxr/usd/usdSkel/testenv/testUsdSkelAnimMapper.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from pxr import UsdSkel, Vt, Sdf, Tf import unittest diff --git a/pxr/usd/usdSkel/testenv/testUsdSkelAnimQuery.py b/pxr/usd/usdSkel/testenv/testUsdSkelAnimQuery.py index 1a36a40059..37fda4f04f 100644 --- a/pxr/usd/usdSkel/testenv/testUsdSkelAnimQuery.py +++ b/pxr/usd/usdSkel/testenv/testUsdSkelAnimQuery.py @@ -2,25 +2,8 @@ # # Copyright 2018 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from pxr import Usd, UsdSkel, Gf, Sdf, Tf, Vt import unittest, random diff --git a/pxr/usd/usdSkel/testenv/testUsdSkelBakeSkinning.py b/pxr/usd/usdSkel/testenv/testUsdSkelBakeSkinning.py index 4728dea6c7..b6b4c8a450 100644 --- a/pxr/usd/usdSkel/testenv/testUsdSkelBakeSkinning.py +++ b/pxr/usd/usdSkel/testenv/testUsdSkelBakeSkinning.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from pxr import Gf, Usd, UsdSkel import unittest diff --git a/pxr/usd/usdSkel/testenv/testUsdSkelBindingAPI.py b/pxr/usd/usdSkel/testenv/testUsdSkelBindingAPI.py index 64ea78fbd7..77e8beb329 100644 --- a/pxr/usd/usdSkel/testenv/testUsdSkelBindingAPI.py +++ b/pxr/usd/usdSkel/testenv/testUsdSkelBindingAPI.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from pxr import Usd, UsdSkel, UsdGeom, Vt, Sdf import unittest diff --git a/pxr/usd/usdSkel/testenv/testUsdSkelBlendShape.py b/pxr/usd/usdSkel/testenv/testUsdSkelBlendShape.py index 49d10dc52e..a3a12e6556 100644 --- a/pxr/usd/usdSkel/testenv/testUsdSkelBlendShape.py +++ b/pxr/usd/usdSkel/testenv/testUsdSkelBlendShape.py @@ -2,25 +2,8 @@ # # Copyright 2018 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from pxr import Usd, UsdSkel, Gf, Vt import unittest diff --git a/pxr/usd/usdSkel/testenv/testUsdSkelCache.py b/pxr/usd/usdSkel/testenv/testUsdSkelCache.py index e611876def..e39aa74b03 100644 --- a/pxr/usd/usdSkel/testenv/testUsdSkelCache.py +++ b/pxr/usd/usdSkel/testenv/testUsdSkelCache.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from pxr import Usd, UsdSkel, UsdGeom, Vt, Sdf import unittest diff --git a/pxr/usd/usdSkel/testenv/testUsdSkelRoot.py b/pxr/usd/usdSkel/testenv/testUsdSkelRoot.py index bf25cc95a8..7f4d2536bc 100644 --- a/pxr/usd/usdSkel/testenv/testUsdSkelRoot.py +++ b/pxr/usd/usdSkel/testenv/testUsdSkelRoot.py @@ -2,25 +2,8 @@ # # Copyright 2018 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from pxr import Usd, UsdSkel, UsdGeom import unittest diff --git a/pxr/usd/usdSkel/testenv/testUsdSkelSkeletonQuery.py b/pxr/usd/usdSkel/testenv/testUsdSkelSkeletonQuery.py index 6f74173d3f..08b1f79049 100644 --- a/pxr/usd/usdSkel/testenv/testUsdSkelSkeletonQuery.py +++ b/pxr/usd/usdSkel/testenv/testUsdSkelSkeletonQuery.py @@ -2,25 +2,8 @@ # # Copyright 2018 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from pxr import Usd, UsdGeom, UsdSkel, Gf, Vt import unittest, random diff --git a/pxr/usd/usdSkel/testenv/testUsdSkelSkinningQuery.py b/pxr/usd/usdSkel/testenv/testUsdSkelSkinningQuery.py index f9c4abd1db..d76bf5afa2 100644 --- a/pxr/usd/usdSkel/testenv/testUsdSkelSkinningQuery.py +++ b/pxr/usd/usdSkel/testenv/testUsdSkelSkinningQuery.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from pxr import Usd, UsdSkel, UsdGeom, Vt, Sdf import unittest diff --git a/pxr/usd/usdSkel/testenv/testUsdSkelTopology.py b/pxr/usd/usdSkel/testenv/testUsdSkelTopology.py index 1227eedde2..08f87f1c9d 100644 --- a/pxr/usd/usdSkel/testenv/testUsdSkelTopology.py +++ b/pxr/usd/usdSkel/testenv/testUsdSkelTopology.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from pxr import Usd, UsdSkel, Vt, Sdf import unittest diff --git a/pxr/usd/usdSkel/testenv/testUsdSkelUtils.py b/pxr/usd/usdSkel/testenv/testUsdSkelUtils.py index 544d3593d9..a3f9c5daa1 100644 --- a/pxr/usd/usdSkel/testenv/testUsdSkelUtils.py +++ b/pxr/usd/usdSkel/testenv/testUsdSkelUtils.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from __future__ import print_function diff --git a/pxr/usd/usdSkel/tokens.cpp b/pxr/usd/usdSkel/tokens.cpp index c35c975fbc..333712c757 100644 --- a/pxr/usd/usdSkel/tokens.cpp +++ b/pxr/usd/usdSkel/tokens.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdSkel/tokens.h" diff --git a/pxr/usd/usdSkel/tokens.h b/pxr/usd/usdSkel/tokens.h index aaa99386c1..c263997d48 100644 --- a/pxr/usd/usdSkel/tokens.h +++ b/pxr/usd/usdSkel/tokens.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDSKEL_TOKENS_H #define USDSKEL_TOKENS_H diff --git a/pxr/usd/usdSkel/topology.cpp b/pxr/usd/usdSkel/topology.cpp index 7c9fc718c9..ef3d80c5dc 100644 --- a/pxr/usd/usdSkel/topology.cpp +++ b/pxr/usd/usdSkel/topology.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdSkel/topology.h" diff --git a/pxr/usd/usdSkel/topology.h b/pxr/usd/usdSkel/topology.h index f39a5d7a6e..93cbbf884f 100644 --- a/pxr/usd/usdSkel/topology.h +++ b/pxr/usd/usdSkel/topology.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_SKEL_TOPOLOGY_H #define PXR_USD_USD_SKEL_TOPOLOGY_H diff --git a/pxr/usd/usdSkel/utils.cpp b/pxr/usd/usdSkel/utils.cpp index d81e87a8a8..f40dca0318 100644 --- a/pxr/usd/usdSkel/utils.cpp +++ b/pxr/usd/usdSkel/utils.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdSkel/utils.h" diff --git a/pxr/usd/usdSkel/utils.h b/pxr/usd/usdSkel/utils.h index ece3e6ddbc..04919a0a9b 100644 --- a/pxr/usd/usdSkel/utils.h +++ b/pxr/usd/usdSkel/utils.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_SKEL_UTILS_H #define PXR_USD_USD_SKEL_UTILS_H diff --git a/pxr/usd/usdSkel/wrapAnimMapper.cpp b/pxr/usd/usdSkel/wrapAnimMapper.cpp index ab09677da3..6201aec9cd 100644 --- a/pxr/usd/usdSkel/wrapAnimMapper.cpp +++ b/pxr/usd/usdSkel/wrapAnimMapper.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdSkel/animMapper.h" diff --git a/pxr/usd/usdSkel/wrapAnimQuery.cpp b/pxr/usd/usdSkel/wrapAnimQuery.cpp index 4ccca9fec3..3de961fca9 100644 --- a/pxr/usd/usdSkel/wrapAnimQuery.cpp +++ b/pxr/usd/usdSkel/wrapAnimQuery.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdSkel/animQuery.h" diff --git a/pxr/usd/usdSkel/wrapAnimation.cpp b/pxr/usd/usdSkel/wrapAnimation.cpp index 5e6c5fbde0..350a9683d6 100644 --- a/pxr/usd/usdSkel/wrapAnimation.cpp +++ b/pxr/usd/usdSkel/wrapAnimation.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdSkel/animation.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdSkel/wrapBakeSkinning.cpp b/pxr/usd/usdSkel/wrapBakeSkinning.cpp index b2937a5f76..bbd83fe3ba 100644 --- a/pxr/usd/usdSkel/wrapBakeSkinning.cpp +++ b/pxr/usd/usdSkel/wrapBakeSkinning.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdSkel/bakeSkinning.h" diff --git a/pxr/usd/usdSkel/wrapBinding.cpp b/pxr/usd/usdSkel/wrapBinding.cpp index b1540a2212..39c0d0e74b 100644 --- a/pxr/usd/usdSkel/wrapBinding.cpp +++ b/pxr/usd/usdSkel/wrapBinding.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdSkel/binding.h" diff --git a/pxr/usd/usdSkel/wrapBindingAPI.cpp b/pxr/usd/usdSkel/wrapBindingAPI.cpp index 864fbfe53c..53d710f14f 100644 --- a/pxr/usd/usdSkel/wrapBindingAPI.cpp +++ b/pxr/usd/usdSkel/wrapBindingAPI.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdSkel/bindingAPI.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdSkel/wrapBlendShape.cpp b/pxr/usd/usdSkel/wrapBlendShape.cpp index 7c98d49ccc..ee31c616ba 100644 --- a/pxr/usd/usdSkel/wrapBlendShape.cpp +++ b/pxr/usd/usdSkel/wrapBlendShape.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdSkel/blendShape.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdSkel/wrapBlendShapeQuery.cpp b/pxr/usd/usdSkel/wrapBlendShapeQuery.cpp index 6edc219bb7..fc3664838f 100644 --- a/pxr/usd/usdSkel/wrapBlendShapeQuery.cpp +++ b/pxr/usd/usdSkel/wrapBlendShapeQuery.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdSkel/blendShapeQuery.h" diff --git a/pxr/usd/usdSkel/wrapCache.cpp b/pxr/usd/usdSkel/wrapCache.cpp index 04c5466a85..d21fe92a5e 100644 --- a/pxr/usd/usdSkel/wrapCache.cpp +++ b/pxr/usd/usdSkel/wrapCache.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdSkel/cache.h" diff --git a/pxr/usd/usdSkel/wrapInbetweenShape.cpp b/pxr/usd/usdSkel/wrapInbetweenShape.cpp index 518bf9f134..448cec2da3 100644 --- a/pxr/usd/usdSkel/wrapInbetweenShape.cpp +++ b/pxr/usd/usdSkel/wrapInbetweenShape.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdSkel/inbetweenShape.h" diff --git a/pxr/usd/usdSkel/wrapRoot.cpp b/pxr/usd/usdSkel/wrapRoot.cpp index 3d10faf7c5..60eabb8766 100644 --- a/pxr/usd/usdSkel/wrapRoot.cpp +++ b/pxr/usd/usdSkel/wrapRoot.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdSkel/root.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdSkel/wrapSkeleton.cpp b/pxr/usd/usdSkel/wrapSkeleton.cpp index 3b4392ac53..d2d6c79bb4 100644 --- a/pxr/usd/usdSkel/wrapSkeleton.cpp +++ b/pxr/usd/usdSkel/wrapSkeleton.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdSkel/skeleton.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdSkel/wrapSkeletonQuery.cpp b/pxr/usd/usdSkel/wrapSkeletonQuery.cpp index bd0f978cdf..6e85af50f8 100644 --- a/pxr/usd/usdSkel/wrapSkeletonQuery.cpp +++ b/pxr/usd/usdSkel/wrapSkeletonQuery.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdSkel/skeletonQuery.h" diff --git a/pxr/usd/usdSkel/wrapSkinningQuery.cpp b/pxr/usd/usdSkel/wrapSkinningQuery.cpp index 913256978e..fb2d54e5af 100644 --- a/pxr/usd/usdSkel/wrapSkinningQuery.cpp +++ b/pxr/usd/usdSkel/wrapSkinningQuery.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdSkel/skinningQuery.h" diff --git a/pxr/usd/usdSkel/wrapTokens.cpp b/pxr/usd/usdSkel/wrapTokens.cpp index a052b6a65c..23caa62093 100644 --- a/pxr/usd/usdSkel/wrapTokens.cpp +++ b/pxr/usd/usdSkel/wrapTokens.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // // GENERATED FILE. DO NOT EDIT. #include diff --git a/pxr/usd/usdSkel/wrapTopology.cpp b/pxr/usd/usdSkel/wrapTopology.cpp index b691a65f4e..1938d1a23b 100644 --- a/pxr/usd/usdSkel/wrapTopology.cpp +++ b/pxr/usd/usdSkel/wrapTopology.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdSkel/topology.h" diff --git a/pxr/usd/usdSkel/wrapUtils.cpp b/pxr/usd/usdSkel/wrapUtils.cpp index be97b8c4d0..1e936d055f 100644 --- a/pxr/usd/usdSkel/wrapUtils.cpp +++ b/pxr/usd/usdSkel/wrapUtils.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdSkel/utils.h" diff --git a/pxr/usd/usdUI/__init__.py b/pxr/usd/usdUI/__init__.py index 21792ee990..d830462be1 100644 --- a/pxr/usd/usdUI/__init__.py +++ b/pxr/usd/usdUI/__init__.py @@ -1,25 +1,8 @@ # # Copyright 2016 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # from pxr import Tf Tf.PreparePythonModule() diff --git a/pxr/usd/usdUI/api.h b/pxr/usd/usdUI/api.h index 1dcbb2c9fd..4dc3e37eba 100644 --- a/pxr/usd/usdUI/api.h +++ b/pxr/usd/usdUI/api.h @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDUI_API_H #define USDUI_API_H diff --git a/pxr/usd/usdUI/backdrop.cpp b/pxr/usd/usdUI/backdrop.cpp index 88b858798d..bf6914fd88 100644 --- a/pxr/usd/usdUI/backdrop.cpp +++ b/pxr/usd/usdUI/backdrop.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdUI/backdrop.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usdUI/backdrop.h b/pxr/usd/usdUI/backdrop.h index f86efffdea..7ed3ea2733 100644 --- a/pxr/usd/usdUI/backdrop.h +++ b/pxr/usd/usdUI/backdrop.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDUI_GENERATED_BACKDROP_H #define USDUI_GENERATED_BACKDROP_H diff --git a/pxr/usd/usdUI/module.cpp b/pxr/usd/usdUI/module.cpp index e5871875ef..9bc1bccfa8 100644 --- a/pxr/usd/usdUI/module.cpp +++ b/pxr/usd/usdUI/module.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/base/tf/pyModule.h" diff --git a/pxr/usd/usdUI/moduleDeps.cpp b/pxr/usd/usdUI/moduleDeps.cpp index 7314f31938..1d9f3b900c 100644 --- a/pxr/usd/usdUI/moduleDeps.cpp +++ b/pxr/usd/usdUI/moduleDeps.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/pxr/usd/usdUI/nodeGraphNodeAPI.cpp b/pxr/usd/usdUI/nodeGraphNodeAPI.cpp index 96d2088b8f..c795c493ff 100644 --- a/pxr/usd/usdUI/nodeGraphNodeAPI.cpp +++ b/pxr/usd/usdUI/nodeGraphNodeAPI.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdUI/nodeGraphNodeAPI.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usdUI/nodeGraphNodeAPI.h b/pxr/usd/usdUI/nodeGraphNodeAPI.h index b1e0ebe5ad..6aed8ffcd7 100644 --- a/pxr/usd/usdUI/nodeGraphNodeAPI.h +++ b/pxr/usd/usdUI/nodeGraphNodeAPI.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDUI_GENERATED_NODEGRAPHNODEAPI_H #define USDUI_GENERATED_NODEGRAPHNODEAPI_H diff --git a/pxr/usd/usdUI/pch.h b/pxr/usd/usdUI/pch.h index 47666439a2..3b58a92a35 100644 --- a/pxr/usd/usdUI/pch.h +++ b/pxr/usd/usdUI/pch.h @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // // WARNING: THIS FILE IS GENERATED. DO NOT EDIT. // @@ -31,6 +14,7 @@ #include #endif #if defined(ARCH_OS_LINUX) +#include #include #endif #if defined(ARCH_OS_WINDOWS) @@ -38,12 +22,11 @@ #define WIN32_LEAN_AND_MEAN #endif +#include #include -#include -#include -#include #endif #include +#include #include #include #include @@ -66,8 +49,9 @@ #include #include #include -#include #include +#include +#include #include #include #include @@ -76,6 +60,7 @@ #include #include #include +#include #include #include #include @@ -83,53 +68,6 @@ #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #ifdef PXR_PYTHON_SUPPORT_ENABLED #include #include @@ -142,6 +80,8 @@ #include #include #include +#include +#include #include #include #include @@ -150,26 +90,9 @@ #undef toupper #endif #endif // PXR_PYTHON_SUPPORT_ENABLED -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include #include +#include #include #include #include @@ -177,7 +100,7 @@ #include #include #include -#include +#include #ifdef PXR_PYTHON_SUPPORT_ENABLED #include "pxr/base/tf/pySafePython.h" #endif // PXR_PYTHON_SUPPORT_ENABLED diff --git a/pxr/usd/usdUI/sceneGraphPrimAPI.cpp b/pxr/usd/usdUI/sceneGraphPrimAPI.cpp index 7b7dc1b8c5..7f9dbff523 100644 --- a/pxr/usd/usdUI/sceneGraphPrimAPI.cpp +++ b/pxr/usd/usdUI/sceneGraphPrimAPI.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdUI/sceneGraphPrimAPI.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usdUI/sceneGraphPrimAPI.h b/pxr/usd/usdUI/sceneGraphPrimAPI.h index 57d745bde2..bf1e1772b2 100644 --- a/pxr/usd/usdUI/sceneGraphPrimAPI.h +++ b/pxr/usd/usdUI/sceneGraphPrimAPI.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDUI_GENERATED_SCENEGRAPHPRIMAPI_H #define USDUI_GENERATED_SCENEGRAPHPRIMAPI_H diff --git a/pxr/usd/usdUI/testenv/testUsdUIBackdrop.py b/pxr/usd/usdUI/testenv/testUsdUIBackdrop.py index d7cc3d6ad2..c8681fa7fd 100644 --- a/pxr/usd/usdUI/testenv/testUsdUIBackdrop.py +++ b/pxr/usd/usdUI/testenv/testUsdUIBackdrop.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # from pxr import Usd, UsdUI diff --git a/pxr/usd/usdUI/testenv/testUsdUINodeGraphNode.py b/pxr/usd/usdUI/testenv/testUsdUINodeGraphNode.py index 6050c1a094..d2d8fc8053 100644 --- a/pxr/usd/usdUI/testenv/testUsdUINodeGraphNode.py +++ b/pxr/usd/usdUI/testenv/testUsdUINodeGraphNode.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # from pxr import Usd, UsdUI, Gf diff --git a/pxr/usd/usdUI/testenv/testUsdUISceneGraphPrim.py b/pxr/usd/usdUI/testenv/testUsdUISceneGraphPrim.py index b76dbc0902..fcb6f85b39 100644 --- a/pxr/usd/usdUI/testenv/testUsdUISceneGraphPrim.py +++ b/pxr/usd/usdUI/testenv/testUsdUISceneGraphPrim.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # from pxr import Usd, UsdUI diff --git a/pxr/usd/usdUI/tokens.cpp b/pxr/usd/usdUI/tokens.cpp index 01a3427bd5..0290a50b41 100644 --- a/pxr/usd/usdUI/tokens.cpp +++ b/pxr/usd/usdUI/tokens.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdUI/tokens.h" diff --git a/pxr/usd/usdUI/tokens.h b/pxr/usd/usdUI/tokens.h index 776d10c905..b3d80f18fc 100644 --- a/pxr/usd/usdUI/tokens.h +++ b/pxr/usd/usdUI/tokens.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDUI_TOKENS_H #define USDUI_TOKENS_H diff --git a/pxr/usd/usdUI/wrapBackdrop.cpp b/pxr/usd/usdUI/wrapBackdrop.cpp index 7f22ad6357..8740c92393 100644 --- a/pxr/usd/usdUI/wrapBackdrop.cpp +++ b/pxr/usd/usdUI/wrapBackdrop.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdUI/backdrop.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdUI/wrapNodeGraphNodeAPI.cpp b/pxr/usd/usdUI/wrapNodeGraphNodeAPI.cpp index e6a9f7ab10..c859abda45 100644 --- a/pxr/usd/usdUI/wrapNodeGraphNodeAPI.cpp +++ b/pxr/usd/usdUI/wrapNodeGraphNodeAPI.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdUI/nodeGraphNodeAPI.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdUI/wrapSceneGraphPrimAPI.cpp b/pxr/usd/usdUI/wrapSceneGraphPrimAPI.cpp index 01bf18e419..d73962e12e 100644 --- a/pxr/usd/usdUI/wrapSceneGraphPrimAPI.cpp +++ b/pxr/usd/usdUI/wrapSceneGraphPrimAPI.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdUI/sceneGraphPrimAPI.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdUI/wrapTokens.cpp b/pxr/usd/usdUI/wrapTokens.cpp index a76ae31e6f..9db2eaa5ed 100644 --- a/pxr/usd/usdUI/wrapTokens.cpp +++ b/pxr/usd/usdUI/wrapTokens.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // // GENERATED FILE. DO NOT EDIT. #include diff --git a/pxr/usd/usdUtils/CMakeLists.txt b/pxr/usd/usdUtils/CMakeLists.txt index 6f6d6f8124..65c96bd366 100644 --- a/pxr/usd/usdUtils/CMakeLists.txt +++ b/pxr/usd/usdUtils/CMakeLists.txt @@ -11,9 +11,12 @@ pxr_library(usdUtils usdGeom usdShade ${Boost_PYTHON_LIBRARY} + ${TBB_tbb_LIBRARY} INCLUDE_DIRS ${Boost_INCLUDE_DIRS} + ${TBB_INCLUDE_DIRS} + PUBLIC_CLASSES authoring @@ -595,7 +598,7 @@ pxr_register_test(testUsdUtilsLocalizeAssetUdims pxr_register_test(testUsdUtilsModifyAssetPaths PYTHON COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdUtilsModifyAssetPaths layer.usda modified.usda" - DIFF_COMPARE modified.usda duplicates.usda removal.usda ref_layer_mod.usda ref_unmodified.usda + DIFF_COMPARE modified.usda duplicates.usda removal.usda removal_preserve_length.usda ref_layer_mod.usda ref_unmodified.usda EXPECTED_RETURN_CODE 0 ) diff --git a/pxr/usd/usdUtils/__init__.py b/pxr/usd/usdUtils/__init__.py index e5b6a14401..c664c1ac80 100644 --- a/pxr/usd/usdUtils/__init__.py +++ b/pxr/usd/usdUtils/__init__.py @@ -1,25 +1,8 @@ # # Copyright 2016 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # from pxr import Tf Tf.PreparePythonModule() diff --git a/pxr/usd/usdUtils/api.h b/pxr/usd/usdUtils/api.h index b8afd9554d..6004804053 100644 --- a/pxr/usd/usdUtils/api.h +++ b/pxr/usd/usdUtils/api.h @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_UTILS_API_H #define PXR_USD_USD_UTILS_API_H diff --git a/pxr/usd/usdUtils/assetLocalization.cpp b/pxr/usd/usdUtils/assetLocalization.cpp index 7a3e4c0209..1df66c4fdb 100644 --- a/pxr/usd/usdUtils/assetLocalization.cpp +++ b/pxr/usd/usdUtils/assetLocalization.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // /// /// \file usdUtils/assetLocalization.cpp @@ -477,17 +460,15 @@ UsdUtils_LocalizationContext::_ProcessAssetValue( auto assetPath = val.UncheckedGet(); const std::string& rawAssetPath = assetPath.GetAssetPath(); - if (!rawAssetPath.empty()) { - const std::vector dependencies = - _GetDependencies(layer, rawAssetPath); + const std::vector dependencies = + _GetDependencies(layer, rawAssetPath); - const std::vector processedDeps = - _delegate->ProcessValuePath( - layer, keyPath, rawAssetPath, dependencies); - - _EnqueueDependency(layer, rawAssetPath); - _EnqueueDependencies(layer, processedDeps); - } + const std::vector processedDeps = + _delegate->ProcessValuePath( + layer, keyPath, rawAssetPath, dependencies); + + _EnqueueDependency(layer, rawAssetPath); + _EnqueueDependencies(layer, processedDeps); } else if (val.IsHolding>()) { const VtArray& originalArray = val.UncheckedGet< VtArray >(); @@ -499,17 +480,15 @@ UsdUtils_LocalizationContext::_ProcessAssetValue( for (const SdfAssetPath& assetPath : originalArray) { const std::string& rawAssetPath = assetPath.GetAssetPath(); - if (!rawAssetPath.empty()) { - const std::vector dependencies = - _GetDependencies(layer, rawAssetPath); + const std::vector dependencies = + _GetDependencies(layer, rawAssetPath); - const std::vector processedDeps = - _delegate->ProcessValuePathArrayElement( - layer, keyPath, rawAssetPath, dependencies); - - _EnqueueDependency(layer, rawAssetPath); - _EnqueueDependencies(layer, processedDeps); - } + const std::vector processedDeps = + _delegate->ProcessValuePathArrayElement( + layer, keyPath, rawAssetPath, dependencies); + + _EnqueueDependency(layer, rawAssetPath); + _EnqueueDependencies(layer, processedDeps); } _delegate->EndProcessingValuePathArray(layer, keyPath); diff --git a/pxr/usd/usdUtils/assetLocalization.h b/pxr/usd/usdUtils/assetLocalization.h index ff2204c46e..4150879698 100644 --- a/pxr/usd/usdUtils/assetLocalization.h +++ b/pxr/usd/usdUtils/assetLocalization.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_UTILS_ASSET_LOCALIZATION_H #define PXR_USD_USD_UTILS_ASSET_LOCALIZATION_H diff --git a/pxr/usd/usdUtils/assetLocalizationDelegate.cpp b/pxr/usd/usdUtils/assetLocalizationDelegate.cpp index 2459913f21..8495271b37 100644 --- a/pxr/usd/usdUtils/assetLocalizationDelegate.cpp +++ b/pxr/usd/usdUtils/assetLocalizationDelegate.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // /// /// \file usdUtils/assetLocalizationDelegate.cpp @@ -235,6 +218,10 @@ UsdUtils_WritableLocalizationDelegate::ProcessValuePath( const std::string &authoredPath, const std::vector &dependencies) { + if (authoredPath.empty()) { + return {}; + } + UsdUtilsDependencyInfo depInfo = {authoredPath, dependencies}; UsdUtilsDependencyInfo info = _pathCache.GetProcessedInfo( layer, depInfo, UsdUtils_DependencyType::Reference); @@ -271,9 +258,15 @@ UsdUtils_WritableLocalizationDelegate::ProcessValuePathArrayElement( return _AllDependenciesForInfo(info); } else { + // We don't want to remove empty paths from arrays. They may be + // meaningful, for example in primvar attributes that need to be + // a certain length. + if (_keepEmptyPathsInArrays) { + _currentPathArray.emplace_back(SdfAssetPath()); + } + return {}; } - } void @@ -576,6 +569,10 @@ UsdUtils_ReadOnlyLocalizationDelegate::ProcessValuePath( const std::string &authoredPath, const std::vector &dependencies) { + if (authoredPath.empty()) { + return {}; + } + return _AllDependenciesForInfo(_pathCache.GetProcessedInfo(layer, {authoredPath, dependencies}, UsdUtils_DependencyType::Reference)); } @@ -587,6 +584,12 @@ UsdUtils_ReadOnlyLocalizationDelegate::ProcessValuePathArrayElement( const std::string &authoredPath, const std::vector &dependencies) { + // We may get passed an empty authored path if an array has some + // explicitly empty elements. + if (authoredPath.empty()) { + return {}; + } + return _AllDependenciesForInfo(_pathCache.GetProcessedInfo(layer, {authoredPath, dependencies}, UsdUtils_DependencyType::Reference)); } diff --git a/pxr/usd/usdUtils/assetLocalizationDelegate.h b/pxr/usd/usdUtils/assetLocalizationDelegate.h index 75e0069504..4a36dcb48e 100644 --- a/pxr/usd/usdUtils/assetLocalizationDelegate.h +++ b/pxr/usd/usdUtils/assetLocalizationDelegate.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_UTILS_ASSET_LOCALIZATION_DELEGATE_H #define PXR_USD_USD_UTILS_ASSET_LOCALIZATION_DELEGATE_H @@ -214,6 +197,16 @@ class UsdUtils_WritableLocalizationDelegate _editLayersInPlace = editLayersInPlace; } + // Controls whether empty asset paths are kept in arrays. + // If the value is false, paths that are empty after processing are + // removed from the layer. Setting this to true will write empty asset + // paths into the array so that it's length remains unchanged after + // processing. + inline void SetKeepEmptyPathsInArrays(bool keep) + { + _keepEmptyPathsInArrays = keep; + } + // Returns the layer that was used for writing the passed in layer. // Note that if _editLayersInPlace is true, or there were no edits to // the particular layer, the passed in value will be returned. @@ -260,6 +253,8 @@ class UsdUtils_WritableLocalizationDelegate bool _editLayersInPlace = false; + bool _keepEmptyPathsInArrays = false; + // Maps source layer identifiers to their anonymous writable copies. std::map _layerCopyMap; }; diff --git a/pxr/usd/usdUtils/assetLocalizationPackage.cpp b/pxr/usd/usdUtils/assetLocalizationPackage.cpp index 38ef4a97e4..9a803d4843 100644 --- a/pxr/usd/usdUtils/assetLocalizationPackage.cpp +++ b/pxr/usd/usdUtils/assetLocalizationPackage.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/usdUtils/assetLocalizationPackage.h b/pxr/usd/usdUtils/assetLocalizationPackage.h index c9b2db4c0d..e7b7124441 100644 --- a/pxr/usd/usdUtils/assetLocalizationPackage.h +++ b/pxr/usd/usdUtils/assetLocalizationPackage.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_UTILS_ASSET_LOCALIZATION_PACKAGE #define PXR_USD_USD_UTILS_ASSET_LOCALIZATION_PACKAGE diff --git a/pxr/usd/usdUtils/authoring.cpp b/pxr/usd/usdUtils/authoring.cpp index b80b20c525..b9c445e860 100644 --- a/pxr/usd/usdUtils/authoring.cpp +++ b/pxr/usd/usdUtils/authoring.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usdUtils/authoring.h" diff --git a/pxr/usd/usdUtils/authoring.h b/pxr/usd/usdUtils/authoring.h index c1626f5e8e..8064cd50f6 100644 --- a/pxr/usd/usdUtils/authoring.h +++ b/pxr/usd/usdUtils/authoring.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_UTILS_AUTHORING_H #define PXR_USD_USD_UTILS_AUTHORING_H diff --git a/pxr/usd/usdUtils/coalescingDiagnosticDelegate.cpp b/pxr/usd/usdUtils/coalescingDiagnosticDelegate.cpp index 83868f0c84..43b417ac9d 100644 --- a/pxr/usd/usdUtils/coalescingDiagnosticDelegate.cpp +++ b/pxr/usd/usdUtils/coalescingDiagnosticDelegate.cpp @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/usdUtils/coalescingDiagnosticDelegate.h b/pxr/usd/usdUtils/coalescingDiagnosticDelegate.h index d9ebc1b79f..9de0d483a9 100644 --- a/pxr/usd/usdUtils/coalescingDiagnosticDelegate.h +++ b/pxr/usd/usdUtils/coalescingDiagnosticDelegate.h @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_UTILS_COALESCING_DIAGNOSTIC_DELEGATE_H #define PXR_USD_USD_UTILS_COALESCING_DIAGNOSTIC_DELEGATE_H diff --git a/pxr/usd/usdUtils/complianceChecker.py b/pxr/usd/usdUtils/complianceChecker.py index 22ecebd6e1..60370b9110 100644 --- a/pxr/usd/usdUtils/complianceChecker.py +++ b/pxr/usd/usdUtils/complianceChecker.py @@ -1,25 +1,8 @@ # # Copyright 2018 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # from __future__ import print_function diff --git a/pxr/usd/usdUtils/conditionalAbortDiagnosticDelegate.cpp b/pxr/usd/usdUtils/conditionalAbortDiagnosticDelegate.cpp index 2153f552dd..a66b44b640 100644 --- a/pxr/usd/usdUtils/conditionalAbortDiagnosticDelegate.cpp +++ b/pxr/usd/usdUtils/conditionalAbortDiagnosticDelegate.cpp @@ -1,25 +1,8 @@ // // Copyright 2020 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdUtils/conditionalAbortDiagnosticDelegate.h" diff --git a/pxr/usd/usdUtils/conditionalAbortDiagnosticDelegate.h b/pxr/usd/usdUtils/conditionalAbortDiagnosticDelegate.h index aed259021f..b76da5448c 100644 --- a/pxr/usd/usdUtils/conditionalAbortDiagnosticDelegate.h +++ b/pxr/usd/usdUtils/conditionalAbortDiagnosticDelegate.h @@ -1,25 +1,8 @@ // // Copyright 2020 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_UTILS_CONDITIONAL_ABORT_DIAGNOSTIC_DELEGATE_H #define PXR_USD_USD_UTILS_CONDITIONAL_ABORT_DIAGNOSTIC_DELEGATE_H diff --git a/pxr/usd/usdUtils/constantsGroup.py b/pxr/usd/usdUtils/constantsGroup.py index efa833684a..d8030b1025 100644 --- a/pxr/usd/usdUtils/constantsGroup.py +++ b/pxr/usd/usdUtils/constantsGroup.py @@ -1,25 +1,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # """A module for creating groups of constants. This is similar to the enum diff --git a/pxr/usd/usdUtils/debugCodes.cpp b/pxr/usd/usdUtils/debugCodes.cpp index 6363a3f49c..644965967c 100644 --- a/pxr/usd/usdUtils/debugCodes.cpp +++ b/pxr/usd/usdUtils/debugCodes.cpp @@ -1,25 +1,8 @@ // // Copyright 2018 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usdUtils/debugCodes.h" diff --git a/pxr/usd/usdUtils/debugCodes.h b/pxr/usd/usdUtils/debugCodes.h index 8858992d58..85f417fd8e 100644 --- a/pxr/usd/usdUtils/debugCodes.h +++ b/pxr/usd/usdUtils/debugCodes.h @@ -1,25 +1,8 @@ // // Copyright 2018 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_UTILS_DEBUG_CODES_H #define PXR_USD_USD_UTILS_DEBUG_CODES_H diff --git a/pxr/usd/usdUtils/dependencies.cpp b/pxr/usd/usdUtils/dependencies.cpp index 04b90b9997..56c92f8e60 100644 --- a/pxr/usd/usdUtils/dependencies.cpp +++ b/pxr/usd/usdUtils/dependencies.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // /// /// \file usdUtils/dependencies.cpp @@ -204,7 +187,8 @@ UsdUtilsComputeAllDependencies( void UsdUtilsModifyAssetPaths( const SdfLayerHandle& layer, - const UsdUtilsModifyAssetPathFn& modifyFn) + const UsdUtilsModifyAssetPathFn& modifyFn, + bool keepEmptyPathsInArrays) { auto processingFunc = [&modifyFn](const SdfLayerRefPtr&, @@ -219,6 +203,9 @@ UsdUtilsModifyAssetPaths( UsdUtils_LocalizationContext context(&delegate); delegate.SetEditLayersInPlace(true); context.SetRecurseLayerDependencies(false); + + delegate.SetKeepEmptyPathsInArrays(keepEmptyPathsInArrays); + context.Process(layer); } diff --git a/pxr/usd/usdUtils/dependencies.h b/pxr/usd/usdUtils/dependencies.h index c187847705..648dbffed4 100644 --- a/pxr/usd/usdUtils/dependencies.h +++ b/pxr/usd/usdUtils/dependencies.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_UTILS_DEPENDENCIES_H #define PXR_USD_USD_UTILS_DEPENDENCIES_H @@ -99,7 +82,10 @@ using UsdUtilsModifyAssetPathFn = std::function #include #include -#include -#include -#include +#include #endif #include +#include +#include #include #include #include @@ -65,6 +49,7 @@ #include #include #include +#include #include #include #include @@ -81,6 +66,8 @@ #include #include #include +#include +#include #include #include #include @@ -100,63 +87,8 @@ #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #ifdef PXR_PYTHON_SUPPORT_ENABLED +#include #include #include #include @@ -185,6 +117,7 @@ #include #include #include +#include #include #include #include @@ -196,28 +129,9 @@ #undef toupper #endif #endif // PXR_PYTHON_SUPPORT_ENABLED -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include #include +#include #include #include #include @@ -228,7 +142,7 @@ #include #include #include -#include +#include #ifdef PXR_PYTHON_SUPPORT_ENABLED #include "pxr/base/tf/pySafePython.h" #endif // PXR_PYTHON_SUPPORT_ENABLED diff --git a/pxr/usd/usdUtils/pipeline.cpp b/pxr/usd/usdUtils/pipeline.cpp index 99d5950dc6..48b2261651 100644 --- a/pxr/usd/usdUtils/pipeline.cpp +++ b/pxr/usd/usdUtils/pipeline.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usdUtils/pipeline.h" diff --git a/pxr/usd/usdUtils/pipeline.h b/pxr/usd/usdUtils/pipeline.h index 03ca5635cb..daced31a7c 100644 --- a/pxr/usd/usdUtils/pipeline.h +++ b/pxr/usd/usdUtils/pipeline.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_UTILS_PIPELINE_H #define PXR_USD_USD_UTILS_PIPELINE_H diff --git a/pxr/usd/usdUtils/registeredVariantSet.cpp b/pxr/usd/usdUtils/registeredVariantSet.cpp index ef5577b9eb..3bcfc23472 100644 --- a/pxr/usd/usdUtils/registeredVariantSet.cpp +++ b/pxr/usd/usdUtils/registeredVariantSet.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdUtils/registeredVariantSet.h" #include "pxr/pxr.h" diff --git a/pxr/usd/usdUtils/registeredVariantSet.h b/pxr/usd/usdUtils/registeredVariantSet.h index 7070a1c1d2..e6b91f3a27 100644 --- a/pxr/usd/usdUtils/registeredVariantSet.h +++ b/pxr/usd/usdUtils/registeredVariantSet.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_UTILS_REGISTERED_VARIANT_SET_H #define PXR_USD_USD_UTILS_REGISTERED_VARIANT_SET_H diff --git a/pxr/usd/usdUtils/sparseValueWriter.cpp b/pxr/usd/usdUtils/sparseValueWriter.cpp index 0616d68121..7ccb23005e 100644 --- a/pxr/usd/usdUtils/sparseValueWriter.cpp +++ b/pxr/usd/usdUtils/sparseValueWriter.cpp @@ -1,25 +1,8 @@ // // Copyright 2018 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdUtils/sparseValueWriter.h" diff --git a/pxr/usd/usdUtils/sparseValueWriter.h b/pxr/usd/usdUtils/sparseValueWriter.h index 233df2a9c9..e9036927f7 100644 --- a/pxr/usd/usdUtils/sparseValueWriter.h +++ b/pxr/usd/usdUtils/sparseValueWriter.h @@ -1,25 +1,8 @@ // // Copyright 2018 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_UTILS_SPARSE_VALUE_WRITER_H #define PXR_USD_USD_UTILS_SPARSE_VALUE_WRITER_H diff --git a/pxr/usd/usdUtils/stageCache.cpp b/pxr/usd/usdUtils/stageCache.cpp index f802095326..5f2d58cbaa 100644 --- a/pxr/usd/usdUtils/stageCache.cpp +++ b/pxr/usd/usdUtils/stageCache.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usdUtils/stageCache.h" diff --git a/pxr/usd/usdUtils/stageCache.h b/pxr/usd/usdUtils/stageCache.h index 3d2cdf939e..c5ccbccaaf 100644 --- a/pxr/usd/usdUtils/stageCache.h +++ b/pxr/usd/usdUtils/stageCache.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_UTILS_STAGE_CACHE_H #define PXR_USD_USD_UTILS_STAGE_CACHE_H diff --git a/pxr/usd/usdUtils/stitch.cpp b/pxr/usd/usdUtils/stitch.cpp index 13957b68a7..13d1420aa5 100644 --- a/pxr/usd/usdUtils/stitch.cpp +++ b/pxr/usd/usdUtils/stitch.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usdUtils/stitch.h" diff --git a/pxr/usd/usdUtils/stitch.h b/pxr/usd/usdUtils/stitch.h index daa80bb7d9..dadb2a9b4d 100644 --- a/pxr/usd/usdUtils/stitch.h +++ b/pxr/usd/usdUtils/stitch.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_UTILS_STITCH_H #define PXR_USD_USD_UTILS_STITCH_H diff --git a/pxr/usd/usdUtils/stitchClips.cpp b/pxr/usd/usdUtils/stitchClips.cpp index 06ef6c3e61..bf4c9c9ad0 100644 --- a/pxr/usd/usdUtils/stitchClips.cpp +++ b/pxr/usd/usdUtils/stitchClips.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usdUtils/stitchClips.h" diff --git a/pxr/usd/usdUtils/stitchClips.h b/pxr/usd/usdUtils/stitchClips.h index ecd3c913e1..4f2d125d18 100644 --- a/pxr/usd/usdUtils/stitchClips.h +++ b/pxr/usd/usdUtils/stitchClips.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_UTILS_STITCH_CLIPS_H #define PXR_USD_USD_UTILS_STITCH_CLIPS_H diff --git a/pxr/usd/usdUtils/testenv/TestUsdUtilsDependenciesCustomResolver_plugin.cpp b/pxr/usd/usdUtils/testenv/TestUsdUtilsDependenciesCustomResolver_plugin.cpp index 95dd43eace..3eb0b9071e 100644 --- a/pxr/usd/usdUtils/testenv/TestUsdUtilsDependenciesCustomResolver_plugin.cpp +++ b/pxr/usd/usdUtils/testenv/TestUsdUtilsDependenciesCustomResolver_plugin.cpp @@ -1,25 +1,8 @@ // // Copyright 2020 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/usdUtils/testenv/testUsdUtilsAuthoring.py b/pxr/usd/usdUtils/testenv/testUsdUtilsAuthoring.py index 9663fc0708..17bb05f1d7 100644 --- a/pxr/usd/usdUtils/testenv/testUsdUtilsAuthoring.py +++ b/pxr/usd/usdUtils/testenv/testUsdUtilsAuthoring.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from pxr import UsdUtils, Sdf, Usd import unittest diff --git a/pxr/usd/usdUtils/testenv/testUsdUtilsCoalescingDiagnosticDelegate.cpp b/pxr/usd/usdUtils/testenv/testUsdUtilsCoalescingDiagnosticDelegate.cpp index 0f5be4654e..ce3cc6a270 100644 --- a/pxr/usd/usdUtils/testenv/testUsdUtilsCoalescingDiagnosticDelegate.cpp +++ b/pxr/usd/usdUtils/testenv/testUsdUtilsCoalescingDiagnosticDelegate.cpp @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/usdUtils/testenv/testUsdUtilsCoalescingDiagnosticDelegate.py b/pxr/usd/usdUtils/testenv/testUsdUtilsCoalescingDiagnosticDelegate.py index 27c7ddb197..20985fd69d 100644 --- a/pxr/usd/usdUtils/testenv/testUsdUtilsCoalescingDiagnosticDelegate.py +++ b/pxr/usd/usdUtils/testenv/testUsdUtilsCoalescingDiagnosticDelegate.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # from pxr import Tf, Sdf, UsdUtils @@ -29,7 +12,7 @@ def _genWarning(): Tf.Warn('.') -EXPECTED_LINE_NO = 30 +EXPECTED_LINE_NO = 13 EXPECTED_FUNC_NAME = '__main__._genWarning' delegate = UsdUtils.CoalescingDiagnosticDelegate() diff --git a/pxr/usd/usdUtils/testenv/testUsdUtilsConditionalAbortDiagnosticDelegate.py b/pxr/usd/usdUtils/testenv/testUsdUtilsConditionalAbortDiagnosticDelegate.py index 280be42bc4..18dc40954a 100644 --- a/pxr/usd/usdUtils/testenv/testUsdUtilsConditionalAbortDiagnosticDelegate.py +++ b/pxr/usd/usdUtils/testenv/testUsdUtilsConditionalAbortDiagnosticDelegate.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # from __future__ import print_function from pxr import Tf, UsdUtils diff --git a/pxr/usd/usdUtils/testenv/testUsdUtilsConstantsGroup.py b/pxr/usd/usdUtils/testenv/testUsdUtilsConstantsGroup.py index 20c6b39fe0..6a681292aa 100644 --- a/pxr/usd/usdUtils/testenv/testUsdUtilsConstantsGroup.py +++ b/pxr/usd/usdUtils/testenv/testUsdUtilsConstantsGroup.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # import sys diff --git a/pxr/usd/usdUtils/testenv/testUsdUtilsCreateNewUsdzPackage.py b/pxr/usd/usdUtils/testenv/testUsdUtilsCreateNewUsdzPackage.py index 7dd24957a3..066da6d69f 100644 --- a/pxr/usd/usdUtils/testenv/testUsdUtilsCreateNewUsdzPackage.py +++ b/pxr/usd/usdUtils/testenv/testUsdUtilsCreateNewUsdzPackage.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from __future__ import print_function from pxr import Ar, Sdf, Usd, UsdUtils diff --git a/pxr/usd/usdUtils/testenv/testUsdUtilsDependencies.py b/pxr/usd/usdUtils/testenv/testUsdUtilsDependencies.py index 8a71c73507..93d7bb39b0 100644 --- a/pxr/usd/usdUtils/testenv/testUsdUtilsDependencies.py +++ b/pxr/usd/usdUtils/testenv/testUsdUtilsDependencies.py @@ -2,25 +2,8 @@ # # Copyright 2020 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from pxr import Ar, UsdUtils, Sdf, Usd from pathlib import Path diff --git a/pxr/usd/usdUtils/testenv/testUsdUtilsDependenciesCustomResolver.py b/pxr/usd/usdUtils/testenv/testUsdUtilsDependenciesCustomResolver.py index 5ee30a738e..75bdb17871 100644 --- a/pxr/usd/usdUtils/testenv/testUsdUtilsDependenciesCustomResolver.py +++ b/pxr/usd/usdUtils/testenv/testUsdUtilsDependenciesCustomResolver.py @@ -2,25 +2,8 @@ # # Copyright 2023 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from pxr import Ar, Plug, Sdf, Usd, UsdUtils import os, shutil, unittest diff --git a/pxr/usd/usdUtils/testenv/testUsdUtilsDependencyExtractor.py b/pxr/usd/usdUtils/testenv/testUsdUtilsDependencyExtractor.py index dfa17b98c3..95a9e27320 100644 --- a/pxr/usd/usdUtils/testenv/testUsdUtilsDependencyExtractor.py +++ b/pxr/usd/usdUtils/testenv/testUsdUtilsDependencyExtractor.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from __future__ import print_function from pxr import UsdUtils, Sdf import argparse, contextlib, sys, os diff --git a/pxr/usd/usdUtils/testenv/testUsdUtilsFlattenLayerStack.py b/pxr/usd/usdUtils/testenv/testUsdUtilsFlattenLayerStack.py index e4c1409912..97aefe7c6b 100644 --- a/pxr/usd/usdUtils/testenv/testUsdUtilsFlattenLayerStack.py +++ b/pxr/usd/usdUtils/testenv/testUsdUtilsFlattenLayerStack.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from __future__ import print_function diff --git a/pxr/usd/usdUtils/testenv/testUsdUtilsIntrospection.py b/pxr/usd/usdUtils/testenv/testUsdUtilsIntrospection.py index 078a067efc..8c1a6b5149 100644 --- a/pxr/usd/usdUtils/testenv/testUsdUtilsIntrospection.py +++ b/pxr/usd/usdUtils/testenv/testUsdUtilsIntrospection.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from pxr import UsdUtils import unittest diff --git a/pxr/usd/usdUtils/testenv/testUsdUtilsLocalizeAsset.py b/pxr/usd/usdUtils/testenv/testUsdUtilsLocalizeAsset.py index 03f7da7fbe..2d64f23d6b 100644 --- a/pxr/usd/usdUtils/testenv/testUsdUtilsLocalizeAsset.py +++ b/pxr/usd/usdUtils/testenv/testUsdUtilsLocalizeAsset.py @@ -2,25 +2,8 @@ # # Copyright 2023 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from pxr import Ar, Sdf, Usd, UsdUtils diff --git a/pxr/usd/usdUtils/testenv/testUsdUtilsModifyAssetPaths.py b/pxr/usd/usdUtils/testenv/testUsdUtilsModifyAssetPaths.py index 96866107f0..e1e06b2621 100644 --- a/pxr/usd/usdUtils/testenv/testUsdUtilsModifyAssetPaths.py +++ b/pxr/usd/usdUtils/testenv/testUsdUtilsModifyAssetPaths.py @@ -2,31 +2,14 @@ # # Copyright 2018 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from pxr import UsdUtils from pxr import Sdf -def Test(usdFile, outFile, fn): +def Test(usdFile, outFile, fn, keepEmptyPathsInArrays = False): layer = Sdf.Layer.FindOrOpen(usdFile) - UsdUtils.ModifyAssetPaths(layer, fn) + UsdUtils.ModifyAssetPaths(layer, fn, keepEmptyPathsInArrays) layer.Export(outFile) def TestBasic(): @@ -58,6 +41,17 @@ def fn(s): TestRemoval() +def TestRemovalPreserveLength(): + # Tests behavior when modify callback returns empty asset + # paths and preserve array length is enabled. + def fn(s): + return '' + + Test('layer.usda', 'removal_preserve_length.usda', fn, + keepEmptyPathsInArrays=True) + +TestRemovalPreserveLength() + def TestDoesNotRecurseDeps(): # Tests reference paths are not traversed during asset path modification def fn(s): diff --git a/pxr/usd/usdUtils/testenv/testUsdUtilsModifyAssetPaths/baseline/removal_preserve_length.usda b/pxr/usd/usdUtils/testenv/testUsdUtilsModifyAssetPaths/baseline/removal_preserve_length.usda new file mode 100644 index 0000000000..1462e85a62 --- /dev/null +++ b/pxr/usd/usdUtils/testenv/testUsdUtilsModifyAssetPaths/baseline/removal_preserve_length.usda @@ -0,0 +1,47 @@ +#usda 1.0 + +def Xform "Model" ( + assetInfo = { + asset[] payloadAssetDependencies = [@@, @@] + } + customData = { + dictionary d = { + asset[] bar = [@@, @@] + } + dictionary emptyDict = { + } + } + payload = None + references = None +) +{ + asset[] bar = [@@, @@] + asset[] emptyArr = [] + asset foo ( + customData = { + asset[] bar = [@@, @@] + } + ) + asset[] varBar.timeSamples = { + 1: [@@, @@], + 2: [@@, @@], + } + asset varFoo +} + +def Xform "Variants" ( + add variantSets = "standin" +) +{ + variantSet "standin" = { + "render" { + asset foo + + } + } +} + +def "PrependPayload" +{ +} + diff --git a/pxr/usd/usdUtils/testenv/testUsdUtilsPipeline.py b/pxr/usd/usdUtils/testenv/testUsdUtilsPipeline.py index 6df911a69f..ed8efebc71 100644 --- a/pxr/usd/usdUtils/testenv/testUsdUtilsPipeline.py +++ b/pxr/usd/usdUtils/testenv/testUsdUtilsPipeline.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from pxr import UsdUtils, Sdf import unittest diff --git a/pxr/usd/usdUtils/testenv/testUsdUtilsSparseValueWriter.py b/pxr/usd/usdUtils/testenv/testUsdUtilsSparseValueWriter.py index 6e89b580de..4cf23d0b36 100644 --- a/pxr/usd/usdUtils/testenv/testUsdUtilsSparseValueWriter.py +++ b/pxr/usd/usdUtils/testenv/testUsdUtilsSparseValueWriter.py @@ -2,25 +2,8 @@ # # Copyright 2018 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from __future__ import division from pxr import UsdUtils, Usd, Sdf, UsdGeom, Gf, Tf diff --git a/pxr/usd/usdUtils/testenv/testUsdUtilsStageCache.py b/pxr/usd/usdUtils/testenv/testUsdUtilsStageCache.py index 8eba390220..770255b9f0 100644 --- a/pxr/usd/usdUtils/testenv/testUsdUtilsStageCache.py +++ b/pxr/usd/usdUtils/testenv/testUsdUtilsStageCache.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from pxr import UsdUtils, Sdf, Usd import unittest diff --git a/pxr/usd/usdUtils/testenv/testUsdUtilsStitch.cpp b/pxr/usd/usdUtils/testenv/testUsdUtilsStitch.cpp index 7f122e5093..22d6ae1f19 100644 --- a/pxr/usd/usdUtils/testenv/testUsdUtilsStitch.cpp +++ b/pxr/usd/usdUtils/testenv/testUsdUtilsStitch.cpp @@ -1,25 +1,8 @@ // // Copyright 2018 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/usdUtils/testenv/testUsdUtilsStitch.py b/pxr/usd/usdUtils/testenv/testUsdUtilsStitch.py index ff0d7e2cc4..b7212abed5 100644 --- a/pxr/usd/usdUtils/testenv/testUsdUtilsStitch.py +++ b/pxr/usd/usdUtils/testenv/testUsdUtilsStitch.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from pxr import Tf, Sdf, UsdUtils import unittest diff --git a/pxr/usd/usdUtils/testenv/testUsdUtilsStitchClips.py b/pxr/usd/usdUtils/testenv/testUsdUtilsStitchClips.py index 7b1cd5796e..0178d8615c 100644 --- a/pxr/usd/usdUtils/testenv/testUsdUtilsStitchClips.py +++ b/pxr/usd/usdUtils/testenv/testUsdUtilsStitchClips.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from __future__ import print_function diff --git a/pxr/usd/usdUtils/testenv/testUsdUtilsTimeCodeRange.cpp b/pxr/usd/usdUtils/testenv/testUsdUtilsTimeCodeRange.cpp index 2e858579b2..27eb4ebcec 100644 --- a/pxr/usd/usdUtils/testenv/testUsdUtilsTimeCodeRange.cpp +++ b/pxr/usd/usdUtils/testenv/testUsdUtilsTimeCodeRange.cpp @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/usdUtils/testenv/testUsdUtilsTimeCodeRange.py b/pxr/usd/usdUtils/testenv/testUsdUtilsTimeCodeRange.py index ca995536a3..89f6c32d37 100644 --- a/pxr/usd/usdUtils/testenv/testUsdUtilsTimeCodeRange.py +++ b/pxr/usd/usdUtils/testenv/testUsdUtilsTimeCodeRange.py @@ -2,25 +2,8 @@ # # Copyright 2019 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from pxr import Gf from pxr import Tf diff --git a/pxr/usd/usdUtils/testenv/testUsdUtilsUpdateSchemaWithSdrNode.py b/pxr/usd/usdUtils/testenv/testUsdUtilsUpdateSchemaWithSdrNode.py index 053f794b23..48853c3f15 100644 --- a/pxr/usd/usdUtils/testenv/testUsdUtilsUpdateSchemaWithSdrNode.py +++ b/pxr/usd/usdUtils/testenv/testUsdUtilsUpdateSchemaWithSdrNode.py @@ -2,25 +2,8 @@ # # Copyright 2021 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from pxr import UsdUtils, Sdf, Usd, Sdr, UsdShade, Tf, Plug import os, sys diff --git a/pxr/usd/usdUtils/testenv/testUsdUtilsUpdateSchemaWithSdrNode/testDummy.glslfx b/pxr/usd/usdUtils/testenv/testUsdUtilsUpdateSchemaWithSdrNode/testDummy.glslfx index ffa8923b0c..e792ce9b80 100644 --- a/pxr/usd/usdUtils/testenv/testUsdUtilsUpdateSchemaWithSdrNode/testDummy.glslfx +++ b/pxr/usd/usdUtils/testenv/testUsdUtilsUpdateSchemaWithSdrNode/testDummy.glslfx @@ -1,5 +1,11 @@ -- glslfx version 0.1 +// +// Copyright 2021 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // TestShaderPropertiesNode -- configuration diff --git a/pxr/usd/usdUtils/testenv/testUsdUtilsUsdzUtils.py b/pxr/usd/usdUtils/testenv/testUsdUtilsUsdzUtils.py index 5bc5cfa6b1..3cd2fd2efe 100644 --- a/pxr/usd/usdUtils/testenv/testUsdUtilsUsdzUtils.py +++ b/pxr/usd/usdUtils/testenv/testUsdUtilsUsdzUtils.py @@ -2,25 +2,8 @@ # # Copyright 2023 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from pxr import Ar, Sdf, Usd, UsdUtils import os import unittest diff --git a/pxr/usd/usdUtils/testenv/testUsdUtilsUserProcessingFunc.py b/pxr/usd/usdUtils/testenv/testUsdUtilsUserProcessingFunc.py index 98e9da7f28..c7c062db6d 100644 --- a/pxr/usd/usdUtils/testenv/testUsdUtilsUserProcessingFunc.py +++ b/pxr/usd/usdUtils/testenv/testUsdUtilsUserProcessingFunc.py @@ -2,25 +2,8 @@ # # Copyright 2023 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from pxr import Ar, Sdf, Tf, Usd, UsdUtils import os, sys, shutil, tempfile, unittest diff --git a/pxr/usd/usdUtils/testenv/testUsdUtilsVarSelsSessionLayer.py b/pxr/usd/usdUtils/testenv/testUsdUtilsVarSelsSessionLayer.py index e544c7bb37..5229436d96 100644 --- a/pxr/usd/usdUtils/testenv/testUsdUtilsVarSelsSessionLayer.py +++ b/pxr/usd/usdUtils/testenv/testUsdUtilsVarSelsSessionLayer.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from pxr import UsdUtils, Sdf import unittest diff --git a/pxr/usd/usdUtils/timeCodeRange.cpp b/pxr/usd/usdUtils/timeCodeRange.cpp index 81fbd8dee7..bb2e11f0d4 100644 --- a/pxr/usd/usdUtils/timeCodeRange.cpp +++ b/pxr/usd/usdUtils/timeCodeRange.cpp @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usdUtils/timeCodeRange.h" diff --git a/pxr/usd/usdUtils/timeCodeRange.h b/pxr/usd/usdUtils/timeCodeRange.h index e4fa67b4c6..c7795274d4 100644 --- a/pxr/usd/usdUtils/timeCodeRange.h +++ b/pxr/usd/usdUtils/timeCodeRange.h @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_UTILS_TIME_CODE_RANGE_H #define PXR_USD_USD_UTILS_TIME_CODE_RANGE_H diff --git a/pxr/usd/usdUtils/toolPaths.py b/pxr/usd/usdUtils/toolPaths.py index 9adf45ec13..daf47e8ab2 100644 --- a/pxr/usd/usdUtils/toolPaths.py +++ b/pxr/usd/usdUtils/toolPaths.py @@ -1,25 +1,8 @@ # # Copyright 2022 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # import os import platform diff --git a/pxr/usd/usdUtils/updateSchemaWithSdrNode.py b/pxr/usd/usdUtils/updateSchemaWithSdrNode.py index 5e28fb8d25..2c085bef80 100644 --- a/pxr/usd/usdUtils/updateSchemaWithSdrNode.py +++ b/pxr/usd/usdUtils/updateSchemaWithSdrNode.py @@ -2,25 +2,8 @@ # # Copyright 2021 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # from pxr import Tf, Sdf, Sdr, Usd, UsdShade, Vt diff --git a/pxr/usd/usdUtils/usdzPackage.cpp b/pxr/usd/usdUtils/usdzPackage.cpp index 0e7b09c40e..f53cb45153 100644 --- a/pxr/usd/usdUtils/usdzPackage.cpp +++ b/pxr/usd/usdUtils/usdzPackage.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // /// /// \file usdUtils/usdzPackage.cpp diff --git a/pxr/usd/usdUtils/usdzPackage.h b/pxr/usd/usdUtils/usdzPackage.h index c3b7462a3c..d9d766fd91 100644 --- a/pxr/usd/usdUtils/usdzPackage.h +++ b/pxr/usd/usdUtils/usdzPackage.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_UTILS_USDZ_PACKAGE_H #define PXR_USD_USD_UTILS_USDZ_PACKAGE_H diff --git a/pxr/usd/usdUtils/usdzUtils.py b/pxr/usd/usdUtils/usdzUtils.py index 1cc41e88a6..91544ad34b 100644 --- a/pxr/usd/usdUtils/usdzUtils.py +++ b/pxr/usd/usdUtils/usdzUtils.py @@ -1,25 +1,8 @@ # # Copyright 2022 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # # - method to extract usdz package contents to a given location diff --git a/pxr/usd/usdUtils/userProcessingFunc.h b/pxr/usd/usdUtils/userProcessingFunc.h index 9c732f7a45..89f73b0a10 100644 --- a/pxr/usd/usdUtils/userProcessingFunc.h +++ b/pxr/usd/usdUtils/userProcessingFunc.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_USD_UTILS_USER_PROCESSING_FUNC diff --git a/pxr/usd/usdUtils/wrapAuthoring.cpp b/pxr/usd/usdUtils/wrapAuthoring.cpp index 84a99d058c..7ccb3269a6 100644 --- a/pxr/usd/usdUtils/wrapAuthoring.cpp +++ b/pxr/usd/usdUtils/wrapAuthoring.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include diff --git a/pxr/usd/usdUtils/wrapCoalescingDiagnosticDelegate.cpp b/pxr/usd/usdUtils/wrapCoalescingDiagnosticDelegate.cpp index 766c01c7af..4e90d4cb64 100644 --- a/pxr/usd/usdUtils/wrapCoalescingDiagnosticDelegate.cpp +++ b/pxr/usd/usdUtils/wrapCoalescingDiagnosticDelegate.cpp @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/usdUtils/wrapConditionalAbortDiagnosticDelegate.cpp b/pxr/usd/usdUtils/wrapConditionalAbortDiagnosticDelegate.cpp index 7ecb191bbe..667aa5a84b 100644 --- a/pxr/usd/usdUtils/wrapConditionalAbortDiagnosticDelegate.cpp +++ b/pxr/usd/usdUtils/wrapConditionalAbortDiagnosticDelegate.cpp @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/usdUtils/wrapDependencies.cpp b/pxr/usd/usdUtils/wrapDependencies.cpp index 1b62068d1c..4732c2d138 100644 --- a/pxr/usd/usdUtils/wrapDependencies.cpp +++ b/pxr/usd/usdUtils/wrapDependencies.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // /// /// \file usdUtils/wrapDependencies.cpp @@ -104,6 +87,8 @@ void wrapDependencies() using Py_UsdUtilsModifyAssetPathFn = std::string(const std::string&); TfPyFunctionFromPython(); bp::def("ModifyAssetPaths", &UsdUtilsModifyAssetPaths, - (bp::arg("layer"), bp::arg("modifyFn"))); + (bp::arg("layer"), + bp::arg("modifyFn"), + bp::arg("keepEmptyPathsInArrays") = false)); } diff --git a/pxr/usd/usdUtils/wrapFlattenLayerStack.cpp b/pxr/usd/usdUtils/wrapFlattenLayerStack.cpp index 7002b8603c..b5c568710c 100644 --- a/pxr/usd/usdUtils/wrapFlattenLayerStack.cpp +++ b/pxr/usd/usdUtils/wrapFlattenLayerStack.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include diff --git a/pxr/usd/usdUtils/wrapIntrospection.cpp b/pxr/usd/usdUtils/wrapIntrospection.cpp index 25e68f3a5c..effeaf7d81 100644 --- a/pxr/usd/usdUtils/wrapIntrospection.cpp +++ b/pxr/usd/usdUtils/wrapIntrospection.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include diff --git a/pxr/usd/usdUtils/wrapLocalizeAsset.cpp b/pxr/usd/usdUtils/wrapLocalizeAsset.cpp index 727a2c281d..c737fdb0b1 100644 --- a/pxr/usd/usdUtils/wrapLocalizeAsset.cpp +++ b/pxr/usd/usdUtils/wrapLocalizeAsset.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/usdUtils/wrapPipeline.cpp b/pxr/usd/usdUtils/wrapPipeline.cpp index 5c3f113270..25cc38c654 100644 --- a/pxr/usd/usdUtils/wrapPipeline.cpp +++ b/pxr/usd/usdUtils/wrapPipeline.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include diff --git a/pxr/usd/usdUtils/wrapRegisteredVariantSet.cpp b/pxr/usd/usdUtils/wrapRegisteredVariantSet.cpp index 03d2f90e9e..be67481ce2 100644 --- a/pxr/usd/usdUtils/wrapRegisteredVariantSet.cpp +++ b/pxr/usd/usdUtils/wrapRegisteredVariantSet.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include diff --git a/pxr/usd/usdUtils/wrapSparseValueWriter.cpp b/pxr/usd/usdUtils/wrapSparseValueWriter.cpp index f925dc3be6..ddfebad531 100644 --- a/pxr/usd/usdUtils/wrapSparseValueWriter.cpp +++ b/pxr/usd/usdUtils/wrapSparseValueWriter.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/usdUtils/wrapStageCache.cpp b/pxr/usd/usdUtils/wrapStageCache.cpp index 107fa55111..9e86d616b3 100644 --- a/pxr/usd/usdUtils/wrapStageCache.cpp +++ b/pxr/usd/usdUtils/wrapStageCache.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include diff --git a/pxr/usd/usdUtils/wrapStitch.cpp b/pxr/usd/usdUtils/wrapStitch.cpp index 2374d49e14..21461ff704 100644 --- a/pxr/usd/usdUtils/wrapStitch.cpp +++ b/pxr/usd/usdUtils/wrapStitch.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // /// \file wrapStitch.cpp diff --git a/pxr/usd/usdUtils/wrapStitchClips.cpp b/pxr/usd/usdUtils/wrapStitchClips.cpp index c2d7c77982..7011936924 100644 --- a/pxr/usd/usdUtils/wrapStitchClips.cpp +++ b/pxr/usd/usdUtils/wrapStitchClips.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // /// \file wrapStitchClips.cpp diff --git a/pxr/usd/usdUtils/wrapTimeCodeRange.cpp b/pxr/usd/usdUtils/wrapTimeCodeRange.cpp index 121e5bb1c0..f8aa203008 100644 --- a/pxr/usd/usdUtils/wrapTimeCodeRange.cpp +++ b/pxr/usd/usdUtils/wrapTimeCodeRange.cpp @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usd/usdUtils/timeCodeRange.h" diff --git a/pxr/usd/usdUtils/wrapUserProcessingFunc.cpp b/pxr/usd/usdUtils/wrapUserProcessingFunc.cpp index 1053326c35..8f73ca3eb4 100644 --- a/pxr/usd/usdUtils/wrapUserProcessingFunc.cpp +++ b/pxr/usd/usdUtils/wrapUserProcessingFunc.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usd/usdVol/__init__.py b/pxr/usd/usdVol/__init__.py index 85c7173035..5e0d06a196 100644 --- a/pxr/usd/usdVol/__init__.py +++ b/pxr/usd/usdVol/__init__.py @@ -1,25 +1,8 @@ # # Copyright 2018 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # from pxr import Tf Tf.PreparePythonModule() diff --git a/pxr/usd/usdVol/api.h b/pxr/usd/usdVol/api.h index c21ad89a39..da844e3011 100644 --- a/pxr/usd/usdVol/api.h +++ b/pxr/usd/usdVol/api.h @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDVOL_API_H #define USDVOL_API_H diff --git a/pxr/usd/usdVol/field3DAsset.cpp b/pxr/usd/usdVol/field3DAsset.cpp index ffdb67d18a..7a029f6948 100644 --- a/pxr/usd/usdVol/field3DAsset.cpp +++ b/pxr/usd/usdVol/field3DAsset.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdVol/field3DAsset.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usdVol/field3DAsset.h b/pxr/usd/usdVol/field3DAsset.h index c780557f2c..32002f1ec3 100644 --- a/pxr/usd/usdVol/field3DAsset.h +++ b/pxr/usd/usdVol/field3DAsset.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDVOL_GENERATED_FIELD3DASSET_H #define USDVOL_GENERATED_FIELD3DASSET_H diff --git a/pxr/usd/usdVol/fieldAsset.cpp b/pxr/usd/usdVol/fieldAsset.cpp index ed0e081e7b..5e6be28d98 100644 --- a/pxr/usd/usdVol/fieldAsset.cpp +++ b/pxr/usd/usdVol/fieldAsset.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdVol/fieldAsset.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usdVol/fieldAsset.h b/pxr/usd/usdVol/fieldAsset.h index 8b8c83ed98..1524df8731 100644 --- a/pxr/usd/usdVol/fieldAsset.h +++ b/pxr/usd/usdVol/fieldAsset.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDVOL_GENERATED_FIELDASSET_H #define USDVOL_GENERATED_FIELDASSET_H diff --git a/pxr/usd/usdVol/fieldBase.cpp b/pxr/usd/usdVol/fieldBase.cpp index 809ee71cc4..dcfe8f3330 100644 --- a/pxr/usd/usdVol/fieldBase.cpp +++ b/pxr/usd/usdVol/fieldBase.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdVol/fieldBase.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usdVol/fieldBase.h b/pxr/usd/usdVol/fieldBase.h index db5aea3816..328d8ea7f1 100644 --- a/pxr/usd/usdVol/fieldBase.h +++ b/pxr/usd/usdVol/fieldBase.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDVOL_GENERATED_FIELDBASE_H #define USDVOL_GENERATED_FIELDBASE_H diff --git a/pxr/usd/usdVol/generatedSchema.usda b/pxr/usd/usdVol/generatedSchema.usda index 44ef8062b4..5cc4c50102 100644 --- a/pxr/usd/usdVol/generatedSchema.usda +++ b/pxr/usd/usdVol/generatedSchema.usda @@ -4,6 +4,10 @@ ) class Volume "Volume" ( + customData = { + string userDocBrief = """A renderable volume containing one or more +volumetric data fields, used to represent a volume effect such as smoke or fire.""" + } doc = """A renderable volume primitive. A volume is made up of any number of FieldBase primitives bound together in this volume. Each FieldBase primitive is specified as a relationship with a @@ -136,6 +140,9 @@ class Volume "Volume" ( } class "FieldBase" ( + customData = { + string userDocBrief = "The base schema class for volume field primitives." + } doc = "Base class for field primitives." ) { @@ -193,10 +200,18 @@ class "FieldBase" ( } class "FieldAsset" ( + customData = { + string userDocBrief = """The base schema class for volume field +primitives defined by an external file.""" + } doc = "Base class for field primitives defined by an external file." ) { token fieldDataType ( + customData = { + string userDocBrief = """Token used to indicate the data type of an +individual field""" + } doc = """Token which is used to indicate the data type of an individual field. Authors use this to tell consumers more about the field without opening the file on disk. The list of @@ -204,16 +219,27 @@ class "FieldAsset" ( A missing value is considered an error.""" ) int fieldIndex ( + customData = { + string userDocBrief = """Optional attribute that stores an index used +to disambiguate between fields with the same name.""" + } doc = """A file can contain multiple fields with the same name. This optional attribute is an index used to disambiguate between these multiple fields with the same name.""" ) token fieldName ( + customData = { + string userDocBrief = """Name of an individual field within the file +specified by the filePath attribute.""" + } doc = """Name of an individual field within the file specified by the filePath attribute.""" ) asset filePath ( + customData = { + string userDocBrief = "An asset path attribute that points to a file on disk." + } doc = """An asset path attribute that points to a file on disk. For each supported file format, a separate FieldAsset subclass is required. @@ -256,6 +282,10 @@ class "FieldAsset" ( ) token vectorDataRoleHint = "None" ( allowedTokens = ["None", "Point", "Normal", "Vector", "Color"] + customData = { + string userDocBrief = """Optional token used to indicate the role of +a vector valued field.""" + } doc = """Optional token which is used to indicate the role of a vector valued field. This can drive the data type in which fields are made available in a renderer or whether the vector values @@ -284,12 +314,19 @@ class "FieldAsset" ( } class Field3DAsset "Field3DAsset" ( + customData = { + string userDocBrief = "Field3D field primitive." + } doc = """Field3D field primitive. The FieldAsset filePath attribute must specify a file in the Field3D format on disk.""" ) { token fieldDataType ( allowedTokens = ["half", "float", "double", "half3", "float3", "double3"] + customData = { + string userDocBrief = """Token used to indicate the data type of an +individual field.""" + } doc = """Token which is used to indicate the data type of an individual field. Authors use this to tell consumers more about the field without opening the file on disk. The list of @@ -297,21 +334,36 @@ class Field3DAsset "Field3DAsset" ( volumes.""" ) int fieldIndex ( + customData = { + string userDocBrief = """Optional attribute that stores an index used +to disambiguate between fields with the same name.""" + } doc = """A file can contain multiple fields with the same name. This optional attribute is an index used to disambiguate between these multiple fields with the same name.""" ) token fieldName ( + customData = { + string userDocBrief = """Name of an individual field within the file +specified by the filePath attribute.""" + } doc = """Name of an individual field within the file specified by the filePath attribute.""" ) token fieldPurpose ( + customData = { + string userDocBrief = """Optional token used to indicate the purpose or +grouping of an individual field.""" + } doc = """Optional token which can be used to indicate the purpose or grouping of an individual field. Clients which consume Field3D files should treat this as the Field3D field name.""" ) asset filePath ( + customData = { + string userDocBrief = "An asset path attribute that points to a file on disk." + } doc = """An asset path attribute that points to a file on disk. For each supported file format, a separate FieldAsset subclass is required. @@ -354,6 +406,10 @@ class Field3DAsset "Field3DAsset" ( ) token vectorDataRoleHint = "None" ( allowedTokens = ["None", "Point", "Normal", "Vector", "Color"] + customData = { + string userDocBrief = """Optional token used to indicate the role of +a vector valued field.""" + } doc = """Optional token which is used to indicate the role of a vector valued field. This can drive the data type in which fields are made available in a renderer or whether the vector values @@ -382,12 +438,19 @@ class Field3DAsset "Field3DAsset" ( } class OpenVDBAsset "OpenVDBAsset" ( + customData = { + string userDocBrief = "OpenVDB field primitive." + } doc = """OpenVDB field primitive. The FieldAsset filePath attribute must specify a file in the OpenVDB format on disk.""" ) { token fieldClass ( allowedTokens = ["levelSet", "fogVolume", "staggered", "unknown"] + customData = { + string userDocBrief = """Optional token used to indicate the class of +an individual grid.""" + } doc = """Optional token which can be used to indicate the class of an individual grid. This is a mapping to openvdb::GridClass where the values are GRID_LEVEL_SET, GRID_FOG_VOLUME, @@ -395,6 +458,10 @@ class OpenVDBAsset "OpenVDBAsset" ( ) token fieldDataType ( allowedTokens = ["half", "float", "double", "int", "uint", "int64", "half2", "float2", "double2", "int2", "half3", "float3", "double3", "int3", "matrix3d", "matrix4d", "quatd", "bool", "mask", "string"] + customData = { + string userDocBrief = """Token used to indicate the data type of an +individual field.""" + } doc = """Token which is used to indicate the data type of an individual field. Authors use this to tell consumers more about the field without opening the file on disk. The list of @@ -402,16 +469,27 @@ class OpenVDBAsset "OpenVDBAsset" ( volumes.""" ) int fieldIndex ( + customData = { + string userDocBrief = """Optional attribute that stores an index used +to disambiguate between fields with the same name.""" + } doc = """A file can contain multiple fields with the same name. This optional attribute is an index used to disambiguate between these multiple fields with the same name.""" ) token fieldName ( + customData = { + string userDocBrief = """Name of an individual field within the file +specified by the filePath attribute.""" + } doc = """Name of an individual field within the file specified by the filePath attribute.""" ) asset filePath ( + customData = { + string userDocBrief = "An asset path attribute that points to a file on disk." + } doc = """An asset path attribute that points to a file on disk. For each supported file format, a separate FieldAsset subclass is required. @@ -454,6 +532,10 @@ class OpenVDBAsset "OpenVDBAsset" ( ) token vectorDataRoleHint = "None" ( allowedTokens = ["None", "Point", "Normal", "Vector", "Color"] + customData = { + string userDocBrief = """Optional token used to indicate the role of +a vector valued field.""" + } doc = """Optional token which is used to indicate the role of a vector valued field. This can drive the data type in which fields are made available in a renderer or whether the vector values diff --git a/pxr/usd/usdVol/module.cpp b/pxr/usd/usdVol/module.cpp index e1310e87da..36d3bbb3b8 100644 --- a/pxr/usd/usdVol/module.cpp +++ b/pxr/usd/usdVol/module.cpp @@ -1,25 +1,8 @@ // // Copyright 2018 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/base/tf/pyModule.h" diff --git a/pxr/usd/usdVol/moduleDeps.cpp b/pxr/usd/usdVol/moduleDeps.cpp index 5c165dd329..7aa7d7199e 100644 --- a/pxr/usd/usdVol/moduleDeps.cpp +++ b/pxr/usd/usdVol/moduleDeps.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/pxr/usd/usdVol/openVDBAsset.cpp b/pxr/usd/usdVol/openVDBAsset.cpp index 37a5d7dfe7..1f26a1859d 100644 --- a/pxr/usd/usdVol/openVDBAsset.cpp +++ b/pxr/usd/usdVol/openVDBAsset.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdVol/openVDBAsset.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usdVol/openVDBAsset.h b/pxr/usd/usdVol/openVDBAsset.h index 7a929b1091..8cd7ec9df8 100644 --- a/pxr/usd/usdVol/openVDBAsset.h +++ b/pxr/usd/usdVol/openVDBAsset.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDVOL_GENERATED_OPENVDBASSET_H #define USDVOL_GENERATED_OPENVDBASSET_H diff --git a/pxr/usd/usdVol/pch.h b/pxr/usd/usdVol/pch.h index 7802ec3e2d..f8e8af37dd 100644 --- a/pxr/usd/usdVol/pch.h +++ b/pxr/usd/usdVol/pch.h @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // // WARNING: THIS FILE IS GENERATED. DO NOT EDIT. // @@ -31,6 +14,7 @@ #include #endif #if defined(ARCH_OS_LINUX) +#include #include #endif #if defined(ARCH_OS_WINDOWS) @@ -38,12 +22,11 @@ #define WIN32_LEAN_AND_MEAN #endif +#include #include -#include -#include -#include #endif #include +#include #include #include #include @@ -67,8 +50,9 @@ #include #include #include -#include #include +#include +#include #include #include #include @@ -77,60 +61,15 @@ #include #include #include +#include #include #include #include #include #include #include +#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #ifdef PXR_PYTHON_SUPPORT_ENABLED #include #include @@ -151,27 +90,9 @@ #undef toupper #endif #endif // PXR_PYTHON_SUPPORT_ENABLED -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include #include +#include #include #include #include @@ -179,7 +100,7 @@ #include #include #include -#include +#include #ifdef PXR_PYTHON_SUPPORT_ENABLED #include "pxr/base/tf/pySafePython.h" #endif // PXR_PYTHON_SUPPORT_ENABLED diff --git a/pxr/usd/usdVol/testenv/testUsdVolVolume.py b/pxr/usd/usdVol/testenv/testUsdVolVolume.py index 61a1bf0848..dcc9888f22 100644 --- a/pxr/usd/usdVol/testenv/testUsdVolVolume.py +++ b/pxr/usd/usdVol/testenv/testUsdVolVolume.py @@ -2,25 +2,8 @@ # # Copyright 2018 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. import sys, os, unittest from pxr import Usd, UsdGeom, UsdVol, Sdf diff --git a/pxr/usd/usdVol/tokens.cpp b/pxr/usd/usdVol/tokens.cpp index 5430b0ed94..9754c06fb5 100644 --- a/pxr/usd/usdVol/tokens.cpp +++ b/pxr/usd/usdVol/tokens.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdVol/tokens.h" diff --git a/pxr/usd/usdVol/tokens.h b/pxr/usd/usdVol/tokens.h index 642ca91f2c..6c7da7fae1 100644 --- a/pxr/usd/usdVol/tokens.h +++ b/pxr/usd/usdVol/tokens.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDVOL_TOKENS_H #define USDVOL_TOKENS_H diff --git a/pxr/usd/usdVol/userDoc/overview.md b/pxr/usd/usdVol/userDoc/overview.md new file mode 100644 index 0000000000..b56e08ddd2 --- /dev/null +++ b/pxr/usd/usdVol/userDoc/overview.md @@ -0,0 +1,148 @@ +# Overview + +The UsdVol schema domain contains schemas for working with volumes and +volumetric data. Volumes encapsulate fields of discretized volumetric data, +where the data can potentially be sparse or time-varying. Volumes can be used +to represent effects like smoke or fire. + +The volumetric data referenced by Volumes can be contained in OpenVDB or Field3D +assets. UsdVol can also be extended to support other volume formats or sources. + +The following screenshot shows a Volume with density fields that point to +OpenVDB assets. + +![Example screenshot](volExample.png) + +(usdVol_working_with_volumes)= +## Working With Volumes + +A Volume prim represents a renderable volume, such as a fog or fire effect. + +Volumes contain volumetric data represented as relationships to prims that +have a FieldBase-derived schema applied. Each field relationship is specified +as a relationship with a namespace prefix of "field". The relationship names, +such as "density", are used by the renderer to associate individual fields with +the named input parameters on a volume shader. + +For example, the following Volume defines a field relationship to an OpenVDB +asset. The field relationship name specifies that the OpenVDB asset contains +data that the renderer and volume shader should use for the density of the +volume. The Volume also has a material binding to a Material (not defined in +this example). + +```{code-block} usda +def Volume "Volume" ( + prepend apiSchemas = ["MaterialBindingAPI"] +) +{ + custom rel field:density = + uniform token purpose = "render" + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, -3, 0) + token[] xformOpOrder = ["xformOp:translate", "xformOp:scale"] + rel material:binding = + + def OpenVDBAsset "densityVDB" + { + token fieldName = "density" + asset filePath = @/vdbdata/smoke_plume.101.vdb@, + } + } +} + +``` + +Volume additionally inherits from GPrim and inherits GPrim and Imageable +schema properties for rendering, and supports using primvars to bind data +to the USD Material/Shader pipeline during rendering. In the above example, +the bound material, :usda:``, would have a volume +shader as a terminal node in the Material's shader network, and you would +provide primvars to bind Volume or GPrim data to that shader to control how +your Volume is rendered. Note that Hydra uses a fallback volume material if +your Volume doesn't have a material binding. + +```{admonition} Volume Use Cases +:class: note + +Because Volume inherits from GPrim, it is primarily intended to +be used for renderable/imageable volumes. However, UsdVol Volume prims could +be used for "non-renderable" use cases such as encapsulating volumetric data +used for simulations, depending on your workflow. +``` + +(usdVol_working_with_fields)= +## Working With Fields + +UsdVol provides a several abstract schemas that other field schemas inherit +from, including FieldBase (the base schema class for all field schemas) and +FieldAsset (the base schema class for schemas that represent a field asset with +volumetric data stored outside the layer, e.g. in a file asset). In practice, +you'll use FieldAsset-derived schemas, such as OpenVDBAsset or Field3DAsset, +to work with volumetric data of a specific format. + +### Making Fields Child Prims of Volumes + +A general best practice is to make your Field prims children of the containing +Volume prim. This helps organize things in your USD scene, making the Fields +easy to find and reference. Also, the grid extracted from a Field prim is +positioned in world space by the local-to-world transformation of the Field +prim, plus, in the case of prims with Field-Asset derived schemas, any +transformation contained in the external asset encoding. By making +the Field prim a child of a Volume, re-positioning the Volume will automatically +move all its child Field prims along with it. + +```{admonition} Using Fields in Multiple Volumes +:class: note + +While it is recommended, it is not required to have Field prims be children of +Volume prims. If you have a use-case where need to use the same Field prim +for multiple Volumes, you may find it helpful organizationally to not have the +Field prim as a child of any Volume prim. +``` + +(usdVol_using_animated_field_data)= +### Using Animated Field Data + +Volumetric data is often animated. For Volumes with FieldAsset-derived Fields, +animation is represented by setting time samples on the filePath attribute. +The following example sets time samples in a OpenVDBAsset field to different +VDB assets: + +```{code} +def Volume "wisp" +{ + float3[] extent = [(-57, -91, -44), (57, 31, -23)] + + rel field:density = + + def OpenVDBAsset "density" + { + asset filePath.timeSamples = { + 101: @./wisp_01.101.vdb@, + 102: @./wisp_01.102.vdb@, + 103: @./wisp_01.103.vdb@, + 104: @./wisp_01.104.vdb@, + } + token fieldName = "density" + } +} +``` + +(usdVol_understanding_fieldname)= +### Understanding `fieldName` and the Field's Relationship Name + +FieldAsset-derived fields provide a `fieldName` attribute that is used to +identify the name of a field in the Field's asset. In an OpenVDB asset, this +might be the name of a grid in a VDB file. A Volume also provides a way to +specify the "name" for a field, via the +{ref}`relationships grouped inside the 'field' namespace `, but +this name is not tied to the asset data. Instead, a Volume defines fields using +names appropriate for the Volume and/or rendering pipeline. Additionally, being +able to define a field name at the Volume level lets you re-use Field prims for +multiple volume fields if needed. + +For example, you might have a situation where your Volume needs a "velocity" +field for the purposes of shader parameters, but you have an OpenVDB asset with +a grid named "vel". You would specify a `field:velocity` relationship in your +Volume prim to the OpenVDBAsset that references the desired VDB data with a +"vel" fieldName. diff --git a/pxr/usd/usdVol/userDoc/schemaUserDoc.usda b/pxr/usd/usdVol/userDoc/schemaUserDoc.usda new file mode 100644 index 0000000000..604154c63f --- /dev/null +++ b/pxr/usd/usdVol/userDoc/schemaUserDoc.usda @@ -0,0 +1,302 @@ +#usda 1.0 +( + subLayers = [ + # Sublayer "parent" user doc to get user doc for inherited properties. + #@usdGeom/userDoc/schemaUserDoc.usda@ + # Sublayer domain schema.usda to get proper schema inheritance structure + # and property fallback values. User doc is added as overs to schema + # class metadata. + @../schema.usda@ + ] +) + +over "GLOBAL" ( + customData = { + string libraryName = "usdVol" + string userDocTitle = "Volumes" + } +) +{ +} + +over Volume "Volume" ( + customData = { + string userDocBrief = """A renderable volume containing one or more +volumetric data fields, used to represent a volume effect such as smoke or fire.""" + string userDoc = """A renderable volume containing one or more +volumetric data fields, used to represent a volume effect such as smoke or fire. + +Volume inherits from GPrim and inherits GPrim and Imageable schema properties, +so volumes are transformable, renderable, can have a material binding, etc. + +Volume also contains any number of volumetric fields, specified via +relationships to FieldBase-derived primitives using a namespace prefix of +"field". The relationship names, such as "density", are used by the renderer to +associate individual fields with the named input parameters on a volume shader. + +For example, the following Volume defines a field relationship to an +OpenVDBField asset. The field relationship name specifies that the OpenVDB asset +contains data that the renderer and volume shader should use to render the +optical density ("extinction") of the volume. + +```{code-block} usda +def Volume "Volume" ( +) +{ + custom rel field:extinction = + uniform token purpose = "render" + + def OpenVDBAsset "densityVDB" + { + token fieldName = "density" + asset filePath = @/vdbdata/smoke_plume.101.vdb@, + } + } +} + +``` + +See {ref}`usdVol_working_with_volumes` for best practices when working with +Volumes. +""" + } +) +{ +} + +over "FieldBase" ( + customData = { + string userDocBrief = """The base schema class for volume field primitives.""" + string userDoc = """FieldBase is an abstract schema that acts as the +base class for all UsdVol field schemas. If you need to extend UsdVol with your +own custom Field schemas, your Field schemas should directly or indirectly +inherit from FieldBase. + +```{admonition} Don't Create FieldBase Prims Directly +:class: note + +As FieldBase is an abstract schema, in practice you will most likely use one +of the various derived field schemas when creating new field prims, such as +OpenVDBAsset or Field3DAsset. +``` +""" + } +) +{ +} + +over "FieldAsset" ( + customData = { + string userDocBrief = """The base schema class for volume field +primitives defined by an external file.""" + string userDoc = """FieldAsset is an abstract schema (that inherits +from {ref}`FieldBase`) that represents a volumetric field +where the volumetric data is stored outside the layer, e.g. in a file asset. +It is used as a base class for schemas that reference specific volume data +asset types, such as OpenVDB data. + +If you need to extend UsdVol with your own custom file-based field schemas, +your custom schemas should inherit from FieldAsset. + +```{admonition} Create Prims Using FieldAsset-derived Schemas +:class: note + +Like FieldBase, FieldAsset is an abstract schema. In practice you will most +likely create prims using one of the field schemas that inherit from FieldAsset, +such as OpenVDBAsset or Field3DAsset. +``` +""" + } +) +{ + asset filePath ( + customData = { + string userDocBrief = """An asset path attribute that points to a file on disk.""" + string userDoc = """An asset path attribute that points to a file on disk. + +The asset pointed to by filePath must be a file type that the FieldAsset-derived +schema supports. For example, for OpenVDBAsset, the file type must be an +OpenVDB (.vdb) file. For Field3DAsset, the file type must be a Field3D (.f3d) +file. + +This attribute's value can be animated over time, as most +volume asset formats represent just a single timeSample of +a volume. However, it does not, at this time, support +any pattern substitutions like \"$F\". + +See {ref}`usdVol_using_animated_field_data` for an example of using `filePath` +to refer to animated volumetric data. +""" + } + ) + token fieldName ( + customData = { + string userDocBrief = """Name of an individual field within the file +specified by the filePath attribute.""" + string userDoc = """Represents the name of an individual field within +a FieldAsset asset file. + +A FieldAsset file asset may contain multiple fields in a single asset file. This +attribute specifies the name of field **within** the asset file. For example, an +OpenVDB file asset might have multiple named Grids, such as "density", +"temperature", etc. `fieldName` would specify one of the named Grids in the +OpenVDB file asset. + +Note that a Volume also provides a way to specify the "name" for a field, via +the field relationship. This name is not associated with asset data and is used +by the Volume for organizing fields for the rendering pipeline. See +{ref}`usdVol_understanding_fieldname` for more details on how the field's +relationship name differs from `fieldName`. +""" + } + ) + int fieldIndex ( + customData = { + string userDocBrief = """Optional attribute that stores an index used +to disambiguate between fields with the same name.""" + string userDoc = """The index of a field within a FieldAsset asset +file. This attribute is optional. + +An asset file can contain multiple fields with the same name. This optional +attribute is an index used to disambiguate between multiple fields with the same +name. For example, in an OpenVDB file asset, there might be two Grids named +"density". A `fieldIndex` of 0 would specify that this Field refers to the first +"density" Grid. +""" + } + ) + token fieldDataType ( + customData = { + string userDocBrief = """Token used to indicate the data type of an +individual field""" + string userDoc = """The data type of a field, such as "float". + +Use this attribute to tell consumers more about the field without requiring the +consumer access the asset file directly. The list of allowed tokens is specified +with the specific asset type. A missing value is considered an error.""" + } + ) + token vectorDataRoleHint ( + customData = { + string userDocBrief = """Optional token used to indicate the role of +a vector valued field.""" + string userDoc = """Specifies the role of a vector valued field, +such as "Color". This can drive the data type in which fields are made available +in a renderer or whether the vector values are to be transformed. This attribute +is optional. + +This token can drive the data type in which fields are made available in a +renderer or whether the vector values are to be transformed. Allowed tokens +include `None`, `Point`, `Normal`, `Vector`, and `Color`. +""" + } + ) +} + +over Field3DAsset "Field3DAsset" ( + customData = { + string userDocBrief = """Field3D field primitive.""" + string userDoc = """A Field representing a Field3D volume field. See +the [Field3D github repo](https://github.com/imageworks/Field3D/tree/master) +for more information on Field3D. + +An example Field3DAsset referencing a single density field in a .f3d file: + +```{code-block} usda +def Field3DAsset "densityField3D" +{ + token fieldDataType = "float" + token fieldName = "density" + token fieldPurpose = "cluster_0" + asset filePath.timeSamples = { + 1: @/f3ddata/Volumes_Cumulus01_Puff01M.1.f3d@, + } +} +``` + +The FieldAsset `filePath` attribute must specify a file in the Field3D (.f3d) +format on disk. +""" + } +) +{ + token fieldDataType ( + customData = { + string userDocBrief = """Token used to indicate the data type of an +individual field.""" + string userDoc = """The data type of a field, such as "float". + +Use this attribute to tell consumers more about the field without requiring the +consumer access the asset file directly. The list of allowed tokens reflects the +available choices for Field3D. +""" + } + ) + token fieldPurpose ( + customData = { + string userDocBrief = """Optional token used to indicate the purpose or +grouping of an individual field.""" + string userDoc = """Specifies the purpose or grouping of an +individual field. Clients which consume Field3D files should treat this as the +Field3D field *name*. This attribute is optional. +""" + } + ) +} + +over OpenVDBAsset "OpenVDBAsset" ( + customData = { + string userDocBrief = """OpenVDB field primitive.""" + string userDoc = """A Field representing an OpenVDB volume grid. See +the [OpenVDB website](https://www.openvdb.org/documentation/doxygen/index.html) +for more information on OpenVDB. + +An example OpenVDBAsset referencing a single density field in a .vdb file: + +```{code-block} usda +def OpenVDBAsset "densityVDB" +{ + token fieldDataType = "float" + int fieldIndex.timeSamples = { + 10: 0, + } + token fieldName = "density" + asset filePath.timeSamples = { + 10: @/vdb_test_data/grids.vdb@, + } +} + +``` + +The FieldAsset `filePath` attribute must specify a file in the OpenVDB (.vdb) +format on disk. +""" + } +) +{ + token fieldDataType ( + customData = { + string userDocBrief = """Token used to indicate the data type of an +individual field.""" + string userDoc = """The data type of a field, such as "float". + +Use this attribute to tell consumers more about the field without requiring the +consumer access the asset file directly. The list of allowed tokens reflects the +available choices for OpenVDB volumes. +""" + } + ) + token fieldClass ( + customData = { + string userDocBrief = """Optional token used to indicate the class of +an individual grid.""" + string userDoc = """Represents the class of an individual grid. +This attribute is optional. + +This is a mapping to OpenVDB's openvdb::GridClass where the values are +`GRID_LEVEL_SET`, `GRID_FOG_VOLUME`, `GRID_STAGGERED`, and `GRID_UNKNOWN`. +""" + } + ) +} + diff --git a/pxr/usd/usdVol/userDoc/volExample.png b/pxr/usd/usdVol/userDoc/volExample.png new file mode 100644 index 0000000000..1bd4ba06de Binary files /dev/null and b/pxr/usd/usdVol/userDoc/volExample.png differ diff --git a/pxr/usd/usdVol/volume.cpp b/pxr/usd/usdVol/volume.cpp index 330ed30872..c0e8ed93aa 100644 --- a/pxr/usd/usdVol/volume.cpp +++ b/pxr/usd/usdVol/volume.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdVol/volume.h" #include "pxr/usd/usd/schemaRegistry.h" diff --git a/pxr/usd/usdVol/volume.h b/pxr/usd/usdVol/volume.h index e1c93979f4..3ef96889fc 100644 --- a/pxr/usd/usdVol/volume.h +++ b/pxr/usd/usdVol/volume.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef USDVOL_GENERATED_VOLUME_H #define USDVOL_GENERATED_VOLUME_H diff --git a/pxr/usd/usdVol/wrapField3DAsset.cpp b/pxr/usd/usdVol/wrapField3DAsset.cpp index 5cad5fa0c4..faf89124ad 100644 --- a/pxr/usd/usdVol/wrapField3DAsset.cpp +++ b/pxr/usd/usdVol/wrapField3DAsset.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdVol/field3DAsset.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdVol/wrapFieldAsset.cpp b/pxr/usd/usdVol/wrapFieldAsset.cpp index b60159f65b..c0195b8ca6 100644 --- a/pxr/usd/usdVol/wrapFieldAsset.cpp +++ b/pxr/usd/usdVol/wrapFieldAsset.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdVol/fieldAsset.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdVol/wrapFieldBase.cpp b/pxr/usd/usdVol/wrapFieldBase.cpp index 23bbb4dd64..c9e3b462c2 100644 --- a/pxr/usd/usdVol/wrapFieldBase.cpp +++ b/pxr/usd/usdVol/wrapFieldBase.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdVol/fieldBase.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdVol/wrapOpenVDBAsset.cpp b/pxr/usd/usdVol/wrapOpenVDBAsset.cpp index 057de7c3c4..39c5283bb3 100644 --- a/pxr/usd/usdVol/wrapOpenVDBAsset.cpp +++ b/pxr/usd/usdVol/wrapOpenVDBAsset.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdVol/openVDBAsset.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usd/usdVol/wrapTokens.cpp b/pxr/usd/usdVol/wrapTokens.cpp index d6521e759e..94975a4404 100644 --- a/pxr/usd/usdVol/wrapTokens.cpp +++ b/pxr/usd/usdVol/wrapTokens.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // // GENERATED FILE. DO NOT EDIT. #include diff --git a/pxr/usd/usdVol/wrapVolume.cpp b/pxr/usd/usdVol/wrapVolume.cpp index 409434c532..53ed4c33a2 100644 --- a/pxr/usd/usdVol/wrapVolume.cpp +++ b/pxr/usd/usdVol/wrapVolume.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usd/usdVol/volume.h" #include "pxr/usd/usd/schemaBase.h" diff --git a/pxr/usdImaging/bin/testusdview/CMakeLists.txt b/pxr/usdImaging/bin/testusdview/CMakeLists.txt index 529df06436..84f90d310a 100644 --- a/pxr/usdImaging/bin/testusdview/CMakeLists.txt +++ b/pxr/usdImaging/bin/testusdview/CMakeLists.txt @@ -283,6 +283,16 @@ pxr_install_test_dir( DEST testUsdviewLights_yup ) +pxr_install_test_dir( + SRC testenv/testUsdviewSceneLights + DEST testUsdviewSceneLights +) + +pxr_install_test_dir( + SRC testenv/testUsdviewSceneLights + DEST testUsdviewSceneLights_Delegate +) + pxr_install_test_dir( SRC testenv/testUsdviewLightVisibility DEST testUsdviewLightVisibility @@ -719,6 +729,48 @@ pxr_register_test(testUsdviewLights_yup EXPECTED_RETURN_CODE 0 ) +pxr_register_test(testUsdviewSceneLights + PYTHON + COMMAND "${CMAKE_INSTALL_PREFIX}/bin/testusdview --testScript testUsdviewSceneLights.py test.usda" + IMAGE_DIFF_COMPARE + camera_noScene_GL.png + camera_scene_GL.png + domeVis_noScene_GL.png + domeVis_scene_GL.png + domeInvis_noScene_GL.png + domeInvis_scene_GL.png + sceneLights_GL.png + sceneLights_edit_GL.png + noLights_GL.png + FAIL 0.05 + FAIL_PERCENT 0.03 + PERCEPTUAL + EXPECTED_RETURN_CODE 0 + ENV + USDIMAGINGGL_ENGINE_ENABLE_SCENE_INDEX=1 +) + +pxr_register_test(testUsdviewSceneLights_Delegate + PYTHON + COMMAND "${CMAKE_INSTALL_PREFIX}/bin/testusdview --testScript testUsdviewSceneLights.py test.usda" + IMAGE_DIFF_COMPARE + camera_noScene_GL.png + camera_scene_GL.png + domeVis_noScene_GL.png + domeVis_scene_GL.png + domeInvis_noScene_GL.png + domeInvis_scene_GL.png + sceneLights_GL.png + sceneLights_edit_GL.png + noLights_GL.png + FAIL 0.05 + FAIL_PERCENT 0.03 + PERCEPTUAL + EXPECTED_RETURN_CODE 0 + ENV + USDIMAGINGGL_ENGINE_ENABLE_SCENE_INDEX=0 +) + pxr_register_test(testUsdviewLightVisibility PYTHON COMMAND "${CMAKE_INSTALL_PREFIX}/bin/testusdview --testScript testUsdviewLightVisibility.py test.usda" diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewAdditive/shader1.glslfx b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewAdditive/shader1.glslfx index dd8dfbcc7e..93f4ee9048 100644 --- a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewAdditive/shader1.glslfx +++ b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewAdditive/shader1.glslfx @@ -3,25 +3,8 @@ // // Copyright 2020 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // -- configuration diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewAdditive/testUsdviewAdditive.py b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewAdditive/testUsdviewAdditive.py index 92d5821a14..e80bce7ab0 100644 --- a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewAdditive/testUsdviewAdditive.py +++ b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewAdditive/testUsdviewAdditive.py @@ -2,25 +2,8 @@ # # Copyright 2020 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # def _modifySettings(appController): diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewAlive/testAlive.py b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewAlive/testAlive.py index 4bd676555d..2c1e1f81ba 100644 --- a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewAlive/testAlive.py +++ b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewAlive/testAlive.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # def testUsdviewInputFunction(appController): diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewAlive/testUsdviewAliveSetup.py b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewAlive/testUsdviewAliveSetup.py index 3dd6443b9c..79d412e286 100644 --- a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewAlive/testUsdviewAliveSetup.py +++ b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewAlive/testUsdviewAliveSetup.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from pxr import Usd, UsdGeom s = Usd.Stage.CreateInMemory() diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewAnimatedBounds/testUsdviewAnimatedBounds.py b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewAnimatedBounds/testUsdviewAnimatedBounds.py index 64d3af83e9..73cd224fbf 100644 --- a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewAnimatedBounds/testUsdviewAnimatedBounds.py +++ b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewAnimatedBounds/testUsdviewAnimatedBounds.py @@ -2,25 +2,8 @@ # # Copyright 2020 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # NUM_TIME_SAMPLES = 3 diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewBackgroundColor/testUsdviewBackgroundColor.py b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewBackgroundColor/testUsdviewBackgroundColor.py index 4f130e74d1..5037cb19f8 100644 --- a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewBackgroundColor/testUsdviewBackgroundColor.py +++ b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewBackgroundColor/testUsdviewBackgroundColor.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # # Remove any unwanted visuals from the view. diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewCameraMaskMode/testUsdviewCameraMaskMode.py b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewCameraMaskMode/testUsdviewCameraMaskMode.py index 5096f6fc1e..8c2ce25be1 100644 --- a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewCameraMaskMode/testUsdviewCameraMaskMode.py +++ b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewCameraMaskMode/testUsdviewCameraMaskMode.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # from pxr.Usdviewq.qt import QtWidgets diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewClippingPlanes/testUsdviewClippingPlanes.py b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewClippingPlanes/testUsdviewClippingPlanes.py index 14fee698f4..c4240fd862 100644 --- a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewClippingPlanes/testUsdviewClippingPlanes.py +++ b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewClippingPlanes/testUsdviewClippingPlanes.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # from pxr import Gf diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewColorManagement/testUsdviewColorManagement.py b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewColorManagement/testUsdviewColorManagement.py index 76c9c5accf..392e995bbd 100644 --- a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewColorManagement/testUsdviewColorManagement.py +++ b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewColorManagement/testUsdviewColorManagement.py @@ -2,25 +2,8 @@ # # Copyright 2019 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # # The OCIO env var is set to the test.ocio config in the test directory before diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewComplexity/testUsdviewComplexity.py b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewComplexity/testUsdviewComplexity.py index 2a1d055c97..cfe8fa5759 100644 --- a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewComplexity/testUsdviewComplexity.py +++ b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewComplexity/testUsdviewComplexity.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # from pxr.UsdAppUtils.complexityArgs import RefinementComplexities diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewDeactivate/testUsdviewDeactivate.py b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewDeactivate/testUsdviewDeactivate.py index fc86e78aa6..255e339d20 100644 --- a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewDeactivate/testUsdviewDeactivate.py +++ b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewDeactivate/testUsdviewDeactivate.py @@ -2,25 +2,8 @@ # # Copyright 2018 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewDefaultFontFamily/testUsdviewDefaultFontFamily.py b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewDefaultFontFamily/testUsdviewDefaultFontFamily.py index b8885671c6..4dbc19745a 100644 --- a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewDefaultFontFamily/testUsdviewDefaultFontFamily.py +++ b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewDefaultFontFamily/testUsdviewDefaultFontFamily.py @@ -2,25 +2,8 @@ # # Copyright 2020 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # from pxr.Usdviewq.qt import QtWidgets diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewDefaultMaterial/testUsdviewDefaultMaterial.py b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewDefaultMaterial/testUsdviewDefaultMaterial.py index 5597058e8f..b3af6cda90 100644 --- a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewDefaultMaterial/testUsdviewDefaultMaterial.py +++ b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewDefaultMaterial/testUsdviewDefaultMaterial.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # # Set all light settings and refresh the view. diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewDetachedLayers/testDetachedLayers_1.py b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewDetachedLayers/testDetachedLayers_1.py index 6b10f80655..420dc24212 100644 --- a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewDetachedLayers/testDetachedLayers_1.py +++ b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewDetachedLayers/testDetachedLayers_1.py @@ -2,25 +2,8 @@ # # Copyright 2022 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # def testUsdviewInputFunction(appController): diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewDetachedLayers/testDetachedLayers_2.py b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewDetachedLayers/testDetachedLayers_2.py index 800082cab9..e558d2acf2 100644 --- a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewDetachedLayers/testDetachedLayers_2.py +++ b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewDetachedLayers/testDetachedLayers_2.py @@ -2,25 +2,8 @@ # # Copyright 2022 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # def testUsdviewInputFunction(appController): diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewDetachedLayers/testDetachedLayers_3.py b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewDetachedLayers/testDetachedLayers_3.py index 84ce0687e5..2a76283cf8 100644 --- a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewDetachedLayers/testDetachedLayers_3.py +++ b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewDetachedLayers/testDetachedLayers_3.py @@ -2,25 +2,8 @@ # # Copyright 2022 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # def testUsdviewInputFunction(appController): diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewDetachedLayers/testDetachedLayers_4.py b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewDetachedLayers/testDetachedLayers_4.py index cd80617954..0a844e2a19 100644 --- a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewDetachedLayers/testDetachedLayers_4.py +++ b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewDetachedLayers/testDetachedLayers_4.py @@ -2,25 +2,8 @@ # # Copyright 2022 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # def testUsdviewInputFunction(appController): diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewDisplayFilterEdits/baseline/firstFilter.png b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewDisplayFilterEdits/baseline/firstFilter.png index fcd52822ee..a56b6a4bb7 100644 Binary files a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewDisplayFilterEdits/baseline/firstFilter.png and b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewDisplayFilterEdits/baseline/firstFilter.png differ diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewDisplayFilterEdits/baseline/multiFilters1.png b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewDisplayFilterEdits/baseline/multiFilters1.png index 6537bd9739..6f5ae36cd1 100644 Binary files a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewDisplayFilterEdits/baseline/multiFilters1.png and b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewDisplayFilterEdits/baseline/multiFilters1.png differ diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewDisplayFilterEdits/baseline/multiFilters2.png b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewDisplayFilterEdits/baseline/multiFilters2.png index 0be3877ff9..c5585a2875 100644 Binary files a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewDisplayFilterEdits/baseline/multiFilters2.png and b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewDisplayFilterEdits/baseline/multiFilters2.png differ diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewDisplayFilterEdits/baseline/secondFilter.png b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewDisplayFilterEdits/baseline/secondFilter.png index 7f74731818..5586aea437 100644 Binary files a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewDisplayFilterEdits/baseline/secondFilter.png and b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewDisplayFilterEdits/baseline/secondFilter.png differ diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewDisplayFilterEdits/baseline/secondFilter_modified.png b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewDisplayFilterEdits/baseline/secondFilter_modified.png index 2390bd36ec..708f465969 100644 Binary files a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewDisplayFilterEdits/baseline/secondFilter_modified.png and b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewDisplayFilterEdits/baseline/secondFilter_modified.png differ diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewDisplayFilterEdits/testUsdviewDisplayFilterEdits.py b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewDisplayFilterEdits/testUsdviewDisplayFilterEdits.py index d67c34f316..02e28affc1 100644 --- a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewDisplayFilterEdits/testUsdviewDisplayFilterEdits.py +++ b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewDisplayFilterEdits/testUsdviewDisplayFilterEdits.py @@ -2,25 +2,8 @@ # # Copyright 2022 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # from pxr import UsdShade, Gf diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewEmbreeRenderer/testUsdviewEmbreeRenderer.py b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewEmbreeRenderer/testUsdviewEmbreeRenderer.py index 6db153267b..8b567258fd 100644 --- a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewEmbreeRenderer/testUsdviewEmbreeRenderer.py +++ b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewEmbreeRenderer/testUsdviewEmbreeRenderer.py @@ -2,25 +2,8 @@ # # Copyright 2018 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # def _modifySettings(appController): diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewExpressionVariableEdits/testUsdviewExpressionVariableEdits.py b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewExpressionVariableEdits/testUsdviewExpressionVariableEdits.py index f7faa34381..6302d7a1c5 100644 --- a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewExpressionVariableEdits/testUsdviewExpressionVariableEdits.py +++ b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewExpressionVariableEdits/testUsdviewExpressionVariableEdits.py @@ -2,25 +2,8 @@ # # Copyright 2023 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # # Remove any unwanted visuals from the view, and enable autoClip diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewFieldOfView/testUsdviewFieldOfView.py b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewFieldOfView/testUsdviewFieldOfView.py index 3b9983fe28..78789eba49 100644 --- a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewFieldOfView/testUsdviewFieldOfView.py +++ b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewFieldOfView/testUsdviewFieldOfView.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # # Remove any unwanted visuals from the view. diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewFileArguments/test.py b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewFileArguments/test.py index 2988ad08b7..13d79eb2ce 100644 --- a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewFileArguments/test.py +++ b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewFileArguments/test.py @@ -1,2 +1,8 @@ +# +# Copyright 2016 Pixar +# +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. +# from __future__ import print_function print("hello I am a python file") diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewFileArguments/testInvalidFileArg.py b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewFileArguments/testInvalidFileArg.py index c2b150a35f..e231f6c9b2 100644 --- a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewFileArguments/testInvalidFileArg.py +++ b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewFileArguments/testInvalidFileArg.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # def testUsdviewInputFunction(appController): diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewFileArguments/testValidFileArg.py b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewFileArguments/testValidFileArg.py index cf6c8c910f..532c1341be 100644 --- a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewFileArguments/testValidFileArg.py +++ b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewFileArguments/testValidFileArg.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # def testUsdviewInputFunction(appController): diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewFrameSelection/testUsdviewFrameSelection.py b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewFrameSelection/testUsdviewFrameSelection.py index 939a4f0da9..9723fd3949 100644 --- a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewFrameSelection/testUsdviewFrameSelection.py +++ b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewFrameSelection/testUsdviewFrameSelection.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # from pxr.Usdviewq.qt import QtWidgets diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewFreeCamera/testUsdviewFreeCamera.py b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewFreeCamera/testUsdviewFreeCamera.py index 4d4727c1cc..e1e42be7b6 100644 --- a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewFreeCamera/testUsdviewFreeCamera.py +++ b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewFreeCamera/testUsdviewFreeCamera.py @@ -2,25 +2,8 @@ # # Copyright 2018 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # from pxr.Usdviewq.freeCamera import FreeCamera diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewFreeCameraAspect/testUsdviewFreeCameraAspect.py b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewFreeCameraAspect/testUsdviewFreeCameraAspect.py index 1495f7480f..29f2e8f0c3 100644 --- a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewFreeCameraAspect/testUsdviewFreeCameraAspect.py +++ b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewFreeCameraAspect/testUsdviewFreeCameraAspect.py @@ -2,25 +2,8 @@ # # Copyright 2021 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # # Remove any unwanted visuals from the view. diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewInfGeom/testUsdviewInfGeom.py b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewInfGeom/testUsdviewInfGeom.py index 4bb9e61ac2..3119b1379d 100644 --- a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewInfGeom/testUsdviewInfGeom.py +++ b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewInfGeom/testUsdviewInfGeom.py @@ -2,25 +2,8 @@ # # Copyright 2019 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # from pxr.Usdviewq.common import Usd, UsdGeom diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewInstancingEdits/testUsdviewInstancingEdits.py b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewInstancingEdits/testUsdviewInstancingEdits.py index fa89b814b8..73fbed5d03 100644 --- a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewInstancingEdits/testUsdviewInstancingEdits.py +++ b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewInstancingEdits/testUsdviewInstancingEdits.py @@ -2,25 +2,8 @@ # # Copyright 2020 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # from pxr.Usdviewq.qt import QtWidgets diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewIntegratorEdits/baseline/directLighting.png b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewIntegratorEdits/baseline/directLighting.png index 9950e18f56..2cd61d4d2a 100644 Binary files a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewIntegratorEdits/baseline/directLighting.png and b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewIntegratorEdits/baseline/directLighting.png differ diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewIntegratorEdits/baseline/directLighting_sphereAsMesh.png b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewIntegratorEdits/baseline/directLighting_sphereAsMesh.png index b5ca5338c8..2c584ff19a 100644 Binary files a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewIntegratorEdits/baseline/directLighting_sphereAsMesh.png and b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewIntegratorEdits/baseline/directLighting_sphereAsMesh.png differ diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewIntegratorEdits/baseline/pathTracer.png b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewIntegratorEdits/baseline/pathTracer.png index 0da1f1faeb..70b7a346ac 100644 Binary files a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewIntegratorEdits/baseline/pathTracer.png and b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewIntegratorEdits/baseline/pathTracer.png differ diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewIntegratorEdits/baseline/pathTracer_modified.png b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewIntegratorEdits/baseline/pathTracer_modified.png index b3fc6daa07..248a197f2a 100644 Binary files a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewIntegratorEdits/baseline/pathTracer_modified.png and b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewIntegratorEdits/baseline/pathTracer_modified.png differ diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewIntegratorEdits/baseline/pathTracer_modified_sphereAsMesh.png b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewIntegratorEdits/baseline/pathTracer_modified_sphereAsMesh.png index 049b7f3f73..c3124c71e2 100644 Binary files a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewIntegratorEdits/baseline/pathTracer_modified_sphereAsMesh.png and b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewIntegratorEdits/baseline/pathTracer_modified_sphereAsMesh.png differ diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewIntegratorEdits/baseline/pathTracer_sphereAsMesh.png b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewIntegratorEdits/baseline/pathTracer_sphereAsMesh.png index 93d99a113e..398f46af1d 100644 Binary files a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewIntegratorEdits/baseline/pathTracer_sphereAsMesh.png and b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewIntegratorEdits/baseline/pathTracer_sphereAsMesh.png differ diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewIntegratorEdits/testUsdviewIntegratorEdits.py b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewIntegratorEdits/testUsdviewIntegratorEdits.py index 115c875e85..f4040f80ac 100644 --- a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewIntegratorEdits/testUsdviewIntegratorEdits.py +++ b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewIntegratorEdits/testUsdviewIntegratorEdits.py @@ -2,25 +2,8 @@ # # Copyright 2023 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # from pxr import UsdShade diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewInterpreterNoRender/testUsdviewInterpreterNoRender.py b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewInterpreterNoRender/testUsdviewInterpreterNoRender.py index d41c412ddf..f63a37630f 100644 --- a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewInterpreterNoRender/testUsdviewInterpreterNoRender.py +++ b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewInterpreterNoRender/testUsdviewInterpreterNoRender.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # # Leaving these in for future debugging diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewLightVisibility/testUsdviewLightVisibility.py b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewLightVisibility/testUsdviewLightVisibility.py index bed3e8ae28..9c02b8a06c 100644 --- a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewLightVisibility/testUsdviewLightVisibility.py +++ b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewLightVisibility/testUsdviewLightVisibility.py @@ -2,25 +2,8 @@ # # Copyright 2020 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewLightVisibility/testUsdviewVaryLightVisibility.py b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewLightVisibility/testUsdviewVaryLightVisibility.py index 6ce0969efa..4f748bdda9 100644 --- a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewLightVisibility/testUsdviewVaryLightVisibility.py +++ b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewLightVisibility/testUsdviewVaryLightVisibility.py @@ -2,25 +2,8 @@ # # Copyright 2020 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewLights/testUsdviewLights.py b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewLights/testUsdviewLights.py index ecba6e7d90..2a9ba67ccd 100644 --- a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewLights/testUsdviewLights.py +++ b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewLights/testUsdviewLights.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # # Remove any unwanted visuals from the view. diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewLights/testUsdviewLightsYup.py b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewLights/testUsdviewLightsYup.py index a374a03e51..deb57c6255 100644 --- a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewLights/testUsdviewLightsYup.py +++ b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewLights/testUsdviewLightsYup.py @@ -2,25 +2,8 @@ # # Copyright 2019 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # # Remove any unwanted visuals from the view. diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewLightsPrman/testUsdviewLightsPrman.py b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewLightsPrman/testUsdviewLightsPrman.py index 505d80686f..899ac1587d 100644 --- a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewLightsPrman/testUsdviewLightsPrman.py +++ b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewLightsPrman/testUsdviewLightsPrman.py @@ -2,25 +2,8 @@ # # Copyright 2021 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # # Remove any unwanted visuals from the view. diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewLoadPlugins/plugins/extraPlugin/__init__.py b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewLoadPlugins/plugins/extraPlugin/__init__.py index 27e626d492..29f0f46ec1 100644 --- a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewLoadPlugins/plugins/extraPlugin/__init__.py +++ b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewLoadPlugins/plugins/extraPlugin/__init__.py @@ -1,3 +1,9 @@ +# +# Copyright 2018 Pixar +# +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. +# from __future__ import print_function from pxr import Tf diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewLoadPlugins/plugins/extraPluginChained/__init__.py b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewLoadPlugins/plugins/extraPluginChained/__init__.py index 7f41710249..19bd330448 100644 --- a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewLoadPlugins/plugins/extraPluginChained/__init__.py +++ b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewLoadPlugins/plugins/extraPluginChained/__init__.py @@ -1,3 +1,9 @@ +# +# Copyright 2018 Pixar +# +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. +# from __future__ import print_function from pxr import Tf diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewLoadPlugins/plugins/extraPluginDuplicateCommand/__init__.py b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewLoadPlugins/plugins/extraPluginDuplicateCommand/__init__.py index c790c540d8..d4f4ae2509 100644 --- a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewLoadPlugins/plugins/extraPluginDuplicateCommand/__init__.py +++ b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewLoadPlugins/plugins/extraPluginDuplicateCommand/__init__.py @@ -1,3 +1,9 @@ +# +# Copyright 2018 Pixar +# +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. +# from __future__ import print_function from pxr import Tf diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewLoadPlugins/plugins/extraPluginMissingContainer/__init__.py b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewLoadPlugins/plugins/extraPluginMissingContainer/__init__.py index b571979940..789d06ce43 100644 --- a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewLoadPlugins/plugins/extraPluginMissingContainer/__init__.py +++ b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewLoadPlugins/plugins/extraPluginMissingContainer/__init__.py @@ -1,3 +1,9 @@ +# +# Copyright 2018 Pixar +# +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. +# from __future__ import print_function from pxr import Tf diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewLoadPlugins/plugins/extraPluginMultipleContainers/__init__.py b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewLoadPlugins/plugins/extraPluginMultipleContainers/__init__.py index 1877018771..f8d07dd15c 100644 --- a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewLoadPlugins/plugins/extraPluginMultipleContainers/__init__.py +++ b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewLoadPlugins/plugins/extraPluginMultipleContainers/__init__.py @@ -1,3 +1,9 @@ +# +# Copyright 2018 Pixar +# +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. +# from __future__ import print_function from pxr import Tf diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewLoadPlugins/testUsdviewLoadPlugins_alive.py b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewLoadPlugins/testUsdviewLoadPlugins_alive.py index a6258975ee..176a0e44b3 100644 --- a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewLoadPlugins/testUsdviewLoadPlugins_alive.py +++ b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewLoadPlugins/testUsdviewLoadPlugins_alive.py @@ -2,25 +2,8 @@ # # Copyright 2018 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # import os, sys diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewLoadPlugins/testUsdviewLoadPlugins_chained.py b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewLoadPlugins/testUsdviewLoadPlugins_chained.py index 70548391ea..eb63970241 100644 --- a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewLoadPlugins/testUsdviewLoadPlugins_chained.py +++ b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewLoadPlugins/testUsdviewLoadPlugins_chained.py @@ -2,25 +2,8 @@ # # Copyright 2018 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # import os, sys diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewLoadPlugins/testUsdviewLoadPlugins_duplicateCommand.py b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewLoadPlugins/testUsdviewLoadPlugins_duplicateCommand.py index bd2027eefe..9ae7a044cb 100644 --- a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewLoadPlugins/testUsdviewLoadPlugins_duplicateCommand.py +++ b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewLoadPlugins/testUsdviewLoadPlugins_duplicateCommand.py @@ -2,25 +2,8 @@ # # Copyright 2018 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # import os, sys diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewLoadPlugins/testUsdviewLoadPlugins_missingContainer.py b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewLoadPlugins/testUsdviewLoadPlugins_missingContainer.py index 341c8d6708..293a5ec62a 100644 --- a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewLoadPlugins/testUsdviewLoadPlugins_missingContainer.py +++ b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewLoadPlugins/testUsdviewLoadPlugins_missingContainer.py @@ -2,25 +2,8 @@ # # Copyright 2018 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # import os, sys diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewLoadPlugins/testUsdviewLoadPlugins_multipleContainers.py b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewLoadPlugins/testUsdviewLoadPlugins_multipleContainers.py index 1dbba2733c..16f2642cc8 100644 --- a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewLoadPlugins/testUsdviewLoadPlugins_multipleContainers.py +++ b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewLoadPlugins/testUsdviewLoadPlugins_multipleContainers.py @@ -2,25 +2,8 @@ # # Copyright 2018 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # import os, sys diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewMaterialEdits/testUsdviewMaterialEdits.py b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewMaterialEdits/testUsdviewMaterialEdits.py index 20f43a2f9d..332a5b072a 100644 --- a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewMaterialEdits/testUsdviewMaterialEdits.py +++ b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewMaterialEdits/testUsdviewMaterialEdits.py @@ -2,25 +2,8 @@ # # Copyright 2018 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # from pxr import UsdShade diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewMeshBounds/testUsdviewMeshBounds.py b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewMeshBounds/testUsdviewMeshBounds.py index 4059e272ed..54498cb8d9 100644 --- a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewMeshBounds/testUsdviewMeshBounds.py +++ b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewMeshBounds/testUsdviewMeshBounds.py @@ -2,25 +2,8 @@ # # Copyright 2022 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # from pxr.Usdviewq.qt import QtWidgets diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewMetadatatabSelect/testUsdviewMetadatatabSelect.py b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewMetadatatabSelect/testUsdviewMetadatatabSelect.py index bbcfe584c1..ea225d73e7 100644 --- a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewMetadatatabSelect/testUsdviewMetadatatabSelect.py +++ b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewMetadatatabSelect/testUsdviewMetadatatabSelect.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. def _testSelectionChangeScrollPosition(appController): # A test to ensure changing the selection in the metadata diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewNavigationKeys/testUsdviewNavigationKeys.py b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewNavigationKeys/testUsdviewNavigationKeys.py index 1fc946798e..d3547cd3a0 100644 --- a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewNavigationKeys/testUsdviewNavigationKeys.py +++ b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewNavigationKeys/testUsdviewNavigationKeys.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # # Leaving these in for future debugging diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewNoPlugins/testUsdviewNoPlugins.py b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewNoPlugins/testUsdviewNoPlugins.py index 53864b95f2..caa72dea14 100644 --- a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewNoPlugins/testUsdviewNoPlugins.py +++ b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewNoPlugins/testUsdviewNoPlugins.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # def _testBasic(appController): diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewOIT/shader1.glslfx b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewOIT/shader1.glslfx index c6f325e79e..33b25d7437 100644 --- a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewOIT/shader1.glslfx +++ b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewOIT/shader1.glslfx @@ -3,25 +3,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // -- configuration diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewOIT/testUsdviewOIT.py b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewOIT/testUsdviewOIT.py index f8df0d56f8..151a3e1a4f 100644 --- a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewOIT/testUsdviewOIT.py +++ b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewOIT/testUsdviewOIT.py @@ -2,25 +2,8 @@ # # Copyright 2019 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # def _modifySettings(appController): diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewPickMode/testUsdviewPickMode.py b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewPickMode/testUsdviewPickMode.py index 3813e84ae4..97f73b767c 100644 --- a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewPickMode/testUsdviewPickMode.py +++ b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewPickMode/testUsdviewPickMode.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # from pxr import Sdf diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewPointInstancerVariant/testUsdviewPointInstancerVariant.py b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewPointInstancerVariant/testUsdviewPointInstancerVariant.py index b01fdd23db..82bea4033d 100644 --- a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewPointInstancerVariant/testUsdviewPointInstancerVariant.py +++ b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewPointInstancerVariant/testUsdviewPointInstancerVariant.py @@ -2,25 +2,8 @@ # # Copyright 2023 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # from pxr import UsdShade, Gf diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewPointWidths/testUsdviewPointWidths.py b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewPointWidths/testUsdviewPointWidths.py index 7e657a6799..a15287788b 100644 --- a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewPointWidths/testUsdviewPointWidths.py +++ b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewPointWidths/testUsdviewPointWidths.py @@ -2,25 +2,8 @@ # # Copyright 2020 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # from __future__ import print_function diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewPrimPathBar/testUsdviewPrimPathBar.py b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewPrimPathBar/testUsdviewPrimPathBar.py index 31ff0ceda8..3093de0719 100644 --- a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewPrimPathBar/testUsdviewPrimPathBar.py +++ b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewPrimPathBar/testUsdviewPrimPathBar.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # from pxr import Sdf diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewPrimSearch/testUsdviewPrimSearch.py b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewPrimSearch/testUsdviewPrimSearch.py index 4043d631e2..9502a8fa52 100644 --- a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewPrimSearch/testUsdviewPrimSearch.py +++ b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewPrimSearch/testUsdviewPrimSearch.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # def _assertSelectedPrim(appController, primName): diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewPrimTreeExpansion/testUsdviewPrimTreeExpansion.py b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewPrimTreeExpansion/testUsdviewPrimTreeExpansion.py index 5a7d5f4b5a..060c0c247c 100644 --- a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewPrimTreeExpansion/testUsdviewPrimTreeExpansion.py +++ b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewPrimTreeExpansion/testUsdviewPrimTreeExpansion.py @@ -2,25 +2,8 @@ # # Copyright 2019 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # # positions and names of our variants diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewPrimvarEdits/testUsdviewPrimvarEdits.py b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewPrimvarEdits/testUsdviewPrimvarEdits.py index 440e35002b..1bbdeda69c 100644 --- a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewPrimvarEdits/testUsdviewPrimvarEdits.py +++ b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewPrimvarEdits/testUsdviewPrimvarEdits.py @@ -2,25 +2,8 @@ # # Copyright 2020 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # from __future__ import print_function diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewPropertySearch/testUsdviewPropertySearch.py b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewPropertySearch/testUsdviewPropertySearch.py index f53de91463..5d6b51f7ec 100644 --- a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewPropertySearch/testUsdviewPropertySearch.py +++ b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewPropertySearch/testUsdviewPropertySearch.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # def _assertSelectedProp(appController, propName): diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewReloadReopen/testUsdviewReloadReopen.py b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewReloadReopen/testUsdviewReloadReopen.py index eac2b9f42e..63a4ecb3c6 100644 --- a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewReloadReopen/testUsdviewReloadReopen.py +++ b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewReloadReopen/testUsdviewReloadReopen.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # from pxr.Usdviewq.qt import QtWidgets diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewRenderMode/testUsdviewRenderMode.py b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewRenderMode/testUsdviewRenderMode.py index 951b43aede..590a42000d 100644 --- a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewRenderMode/testUsdviewRenderMode.py +++ b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewRenderMode/testUsdviewRenderMode.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # from pxr import Sdf diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewRenderSettingsEdits/basline/DofDisabled.png b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewRenderSettingsEdits/basline/DofDisabled.png index 47eb30a3d3..366d87aa16 100644 Binary files a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewRenderSettingsEdits/basline/DofDisabled.png and b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewRenderSettingsEdits/basline/DofDisabled.png differ diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewRenderSettingsEdits/basline/DofEnabled.png b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewRenderSettingsEdits/basline/DofEnabled.png index 42242d3fae..6e1fc8bd2c 100644 Binary files a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewRenderSettingsEdits/basline/DofEnabled.png and b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewRenderSettingsEdits/basline/DofEnabled.png differ diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewRenderSettingsEdits/testUsdviewRenderSettingsEdits.py b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewRenderSettingsEdits/testUsdviewRenderSettingsEdits.py index 8aed29236d..237d2600a2 100644 --- a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewRenderSettingsEdits/testUsdviewRenderSettingsEdits.py +++ b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewRenderSettingsEdits/testUsdviewRenderSettingsEdits.py @@ -2,25 +2,8 @@ # # Copyright 2023 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # from pxr import UsdShade diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSampleAndDisplayFilters/baseline/displayOnly.png b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSampleAndDisplayFilters/baseline/displayOnly.png index 7d3c2ad034..1432d56cbc 100644 Binary files a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSampleAndDisplayFilters/baseline/displayOnly.png and b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSampleAndDisplayFilters/baseline/displayOnly.png differ diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSampleAndDisplayFilters/testUsdviewSampleAndDisplayFilters.py b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSampleAndDisplayFilters/testUsdviewSampleAndDisplayFilters.py index af1acfd4b5..33b6bdc401 100644 --- a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSampleAndDisplayFilters/testUsdviewSampleAndDisplayFilters.py +++ b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSampleAndDisplayFilters/testUsdviewSampleAndDisplayFilters.py @@ -2,25 +2,8 @@ # # Copyright 2022 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # from pxr import UsdShade diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSampleFilterEdits/testUsdviewSampleFilterEdits.py b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSampleFilterEdits/testUsdviewSampleFilterEdits.py index 4c3bb74f33..eff3f1a9fd 100644 --- a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSampleFilterEdits/testUsdviewSampleFilterEdits.py +++ b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSampleFilterEdits/testUsdviewSampleFilterEdits.py @@ -2,25 +2,8 @@ # # Copyright 2022 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # from pxr import UsdShade diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSceneLights/baseline/camera_noScene_GL.png b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSceneLights/baseline/camera_noScene_GL.png new file mode 100644 index 0000000000..ccc5ea1e25 Binary files /dev/null and b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSceneLights/baseline/camera_noScene_GL.png differ diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSceneLights/baseline/camera_noScene_Prman.png b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSceneLights/baseline/camera_noScene_Prman.png new file mode 100644 index 0000000000..9874e95b48 Binary files /dev/null and b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSceneLights/baseline/camera_noScene_Prman.png differ diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSceneLights/baseline/camera_noScene_Prman_sphereAsMesh.png b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSceneLights/baseline/camera_noScene_Prman_sphereAsMesh.png new file mode 100644 index 0000000000..30c8e50931 Binary files /dev/null and b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSceneLights/baseline/camera_noScene_Prman_sphereAsMesh.png differ diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSceneLights/baseline/camera_scene_GL.png b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSceneLights/baseline/camera_scene_GL.png new file mode 100644 index 0000000000..7968b7315a Binary files /dev/null and b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSceneLights/baseline/camera_scene_GL.png differ diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSceneLights/baseline/camera_scene_Prman.png b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSceneLights/baseline/camera_scene_Prman.png new file mode 100644 index 0000000000..1ff0eac38f Binary files /dev/null and b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSceneLights/baseline/camera_scene_Prman.png differ diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSceneLights/baseline/camera_scene_Prman_sphereAsMesh.png b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSceneLights/baseline/camera_scene_Prman_sphereAsMesh.png new file mode 100644 index 0000000000..5e4b735fb7 Binary files /dev/null and b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSceneLights/baseline/camera_scene_Prman_sphereAsMesh.png differ diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSceneLights/baseline/domeInvis_noScene_GL.png b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSceneLights/baseline/domeInvis_noScene_GL.png new file mode 100644 index 0000000000..87aa1f8b76 Binary files /dev/null and b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSceneLights/baseline/domeInvis_noScene_GL.png differ diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSceneLights/baseline/domeInvis_noScene_Prman.png b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSceneLights/baseline/domeInvis_noScene_Prman.png new file mode 100644 index 0000000000..c00f22e518 Binary files /dev/null and b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSceneLights/baseline/domeInvis_noScene_Prman.png differ diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSceneLights/baseline/domeInvis_noScene_Prman_sphereAsMesh.png b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSceneLights/baseline/domeInvis_noScene_Prman_sphereAsMesh.png new file mode 100644 index 0000000000..b1f4b4b03a Binary files /dev/null and b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSceneLights/baseline/domeInvis_noScene_Prman_sphereAsMesh.png differ diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSceneLights/baseline/domeInvis_scene_GL.png b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSceneLights/baseline/domeInvis_scene_GL.png new file mode 100644 index 0000000000..2aa60c2a96 Binary files /dev/null and b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSceneLights/baseline/domeInvis_scene_GL.png differ diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSceneLights/baseline/domeInvis_scene_Prman.png b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSceneLights/baseline/domeInvis_scene_Prman.png new file mode 100644 index 0000000000..7c525129fc Binary files /dev/null and b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSceneLights/baseline/domeInvis_scene_Prman.png differ diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSceneLights/baseline/domeInvis_scene_Prman_sphereAsMesh.png b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSceneLights/baseline/domeInvis_scene_Prman_sphereAsMesh.png new file mode 100644 index 0000000000..ad4ce88696 Binary files /dev/null and b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSceneLights/baseline/domeInvis_scene_Prman_sphereAsMesh.png differ diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSceneLights/baseline/domeVis_noScene_GL.png b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSceneLights/baseline/domeVis_noScene_GL.png new file mode 100644 index 0000000000..51d7472024 Binary files /dev/null and b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSceneLights/baseline/domeVis_noScene_GL.png differ diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSceneLights/baseline/domeVis_noScene_Prman.png b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSceneLights/baseline/domeVis_noScene_Prman.png new file mode 100644 index 0000000000..f0fa12e509 Binary files /dev/null and b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSceneLights/baseline/domeVis_noScene_Prman.png differ diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSceneLights/baseline/domeVis_noScene_Prman_sphereAsMesh.png b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSceneLights/baseline/domeVis_noScene_Prman_sphereAsMesh.png new file mode 100644 index 0000000000..021069ff5d Binary files /dev/null and b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSceneLights/baseline/domeVis_noScene_Prman_sphereAsMesh.png differ diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSceneLights/baseline/domeVis_scene_GL.png b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSceneLights/baseline/domeVis_scene_GL.png new file mode 100644 index 0000000000..6433d0cbe0 Binary files /dev/null and b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSceneLights/baseline/domeVis_scene_GL.png differ diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSceneLights/baseline/domeVis_scene_Prman.png b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSceneLights/baseline/domeVis_scene_Prman.png new file mode 100644 index 0000000000..ce04d8b787 Binary files /dev/null and b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSceneLights/baseline/domeVis_scene_Prman.png differ diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSceneLights/baseline/domeVis_scene_Prman_sphereAsMesh.png b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSceneLights/baseline/domeVis_scene_Prman_sphereAsMesh.png new file mode 100644 index 0000000000..6dc7f59f24 Binary files /dev/null and b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSceneLights/baseline/domeVis_scene_Prman_sphereAsMesh.png differ diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSceneLights/baseline/noLights_GL.png b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSceneLights/baseline/noLights_GL.png new file mode 100644 index 0000000000..8c6e35c29d Binary files /dev/null and b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSceneLights/baseline/noLights_GL.png differ diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSceneLights/baseline/noLights_Prman.png b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSceneLights/baseline/noLights_Prman.png new file mode 100644 index 0000000000..97e98d3f0e Binary files /dev/null and b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSceneLights/baseline/noLights_Prman.png differ diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSceneLights/baseline/noLights_Prman_sphereAsMesh.png b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSceneLights/baseline/noLights_Prman_sphereAsMesh.png new file mode 100644 index 0000000000..ce54def4da Binary files /dev/null and b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSceneLights/baseline/noLights_Prman_sphereAsMesh.png differ diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSceneLights/baseline/sceneLights_GL.png b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSceneLights/baseline/sceneLights_GL.png new file mode 100644 index 0000000000..b0984d424e Binary files /dev/null and b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSceneLights/baseline/sceneLights_GL.png differ diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSceneLights/baseline/sceneLights_Prman.png b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSceneLights/baseline/sceneLights_Prman.png new file mode 100644 index 0000000000..4ffb8413d8 Binary files /dev/null and b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSceneLights/baseline/sceneLights_Prman.png differ diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSceneLights/baseline/sceneLights_Prman_sphereAsMesh.png b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSceneLights/baseline/sceneLights_Prman_sphereAsMesh.png new file mode 100644 index 0000000000..1f10f5bbc9 Binary files /dev/null and b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSceneLights/baseline/sceneLights_Prman_sphereAsMesh.png differ diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSceneLights/baseline/sceneLights_edit_GL.png b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSceneLights/baseline/sceneLights_edit_GL.png new file mode 100644 index 0000000000..d8a78cc74e Binary files /dev/null and b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSceneLights/baseline/sceneLights_edit_GL.png differ diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSceneLights/baseline/sceneLights_edit_Prman.png b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSceneLights/baseline/sceneLights_edit_Prman.png new file mode 100644 index 0000000000..970763f347 Binary files /dev/null and b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSceneLights/baseline/sceneLights_edit_Prman.png differ diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSceneLights/baseline/sceneLights_edit_Prman_sphereAsMesh.png b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSceneLights/baseline/sceneLights_edit_Prman_sphereAsMesh.png new file mode 100644 index 0000000000..694b2a693a Binary files /dev/null and b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSceneLights/baseline/sceneLights_edit_Prman_sphereAsMesh.png differ diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSceneLights/test.usda b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSceneLights/test.usda new file mode 100644 index 0000000000..7270ee92b5 --- /dev/null +++ b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSceneLights/test.usda @@ -0,0 +1,26 @@ +#usda 1.0 +( + upAxis = "Z" +) + +def Scope "World" +{ + def Sphere "Sphere" ( + prepend apiSchemas = ["MaterialBindingAPI"] + ) + { + color3f[] primvars:displayColor = [(0.1, 0.5, 0.5)] + double radius = 0.5 + } +} + +def Scope "Lights" +{ + def SphereLight "light1" + { + color3f inputs:color = (1, 1, 1) + float inputs:intensity = 20 + double3 xformOp:translate = (3, -3, 0) + uniform token[] xformOpOrder = ["xformOp:translate"] + } +} diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSceneLights/testUsdviewSceneLights.py b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSceneLights/testUsdviewSceneLights.py new file mode 100644 index 0000000000..1d8f867467 --- /dev/null +++ b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSceneLights/testUsdviewSceneLights.py @@ -0,0 +1,119 @@ +#!/pxrpythonsubst +# +# Copyright 2024 Pixar +# +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. +# + +# Remove any unwanted visuals from the view. +def _modifySettings(appController): + appController._dataModel.viewSettings.showBBoxes = False + appController._dataModel.viewSettings.showHUD = False + +# Set builtin light settings and refresh the view. +def _setBuiltinLights(appController, cameraLight, domeLight, domeCamVis): + appController._ui.actionAmbient_Only.setChecked(cameraLight) + appController._ambientOnlyClicked(cameraLight) + + appController._ui.actionDomeLight.setChecked(domeLight) + appController._onDomeLightClicked(domeLight) + + appController._ui.actionDomeLightTexturesVisible.setChecked(domeCamVis) + appController._onDomeLightTexturesVisibleClicked(domeCamVis) + +# Set SceneLights enabled or disabled and refresh the view +def _setSceneLights(appController, sceneLightsEnabled): + appController._ui.actionEnable_Scene_Lights.setChecked(sceneLightsEnabled) + appController._toggleEnableSceneLights() + +def _getRendererAppendedImageName(appController, filename): + rendererName = appController._stageView.rendererDisplayName + imageName = filename + "_" + rendererName + ".png" + print(" -", imageName) + return imageName + + +# Test the camera light with scene lights disabled +def _testCameraLight(appController): + _setBuiltinLights(appController, True, False, False) + _setSceneLights(appController, False) + filename = _getRendererAppendedImageName(appController, "camera_noScene") + appController._takeShot(filename, waitForConvergence=True) + +# Test the camera light with scene lights enabled +def _testCamera_SceneLight(appController): + _setBuiltinLights(appController, True, False, False) + _setSceneLights(appController, True) + filename = _getRendererAppendedImageName(appController, "camera_scene") + appController._takeShot(filename, waitForConvergence=True) + +# Test dome light with scene lights disabled +def _testDomeVis(appController): + _setBuiltinLights(appController, False, True, True) + _setSceneLights(appController, False) + filename = _getRendererAppendedImageName(appController, "domeVis_noScene") + appController._takeShot(filename, waitForConvergence=True) + +# Test dome light with scene lights disabled +def _testDomeVis_SceneLight(appController): + _setBuiltinLights(appController, False, True, True) + _setSceneLights(appController, True) + filename = _getRendererAppendedImageName(appController, "domeVis_scene") + appController._takeShot(filename, waitForConvergence=True) + +# Test dome light with scene lights disabled +def _testDomeInvis(appController): + _setBuiltinLights(appController, False, True, False) + _setSceneLights(appController, False) + filename = _getRendererAppendedImageName(appController, "domeInvis_noScene") + appController._takeShot(filename, waitForConvergence=True) + +# Test dome light with scene lights disabled +def _testDomeInvis_SceneLight(appController): + _setBuiltinLights(appController, False, True, False) + _setSceneLights(appController, True) + filename = _getRendererAppendedImageName(appController, "domeInvis_scene") + appController._takeShot(filename, waitForConvergence=True) + +# Test scene lights with out any built in lights +def _testSceneLights(appController): + _setBuiltinLights(appController, False, False, False) + _setSceneLights(appController, True) + filename = _getRendererAppendedImageName(appController, "sceneLights") + appController._takeShot(filename, waitForConvergence=True) + + # Edit the light color of the scene light + s = appController._dataModel.stage + l = s.GetSessionLayer() + s.SetEditTarget(l) + light = s.GetPrimAtPath('/Lights/light1') + light.GetAttribute('inputs:color').Set((1,0,0)) + filename = _getRendererAppendedImageName(appController, "sceneLights_edit") + appController._takeShot(filename, waitForConvergence=True) + +# Test no built in or scene lights +def _testNoLights(appController): + _setBuiltinLights(appController, False, False, False) + _setSceneLights(appController, False) + filename = _getRendererAppendedImageName(appController, "noLights") + appController._takeShot(filename, waitForConvergence=True) + + +# Test that lights work properly in usdview. +def testUsdviewInputFunction(appController): + _modifySettings(appController) + + # Builtin Camera light with and without scene lights + _testCameraLight(appController) + _testCamera_SceneLight(appController) + + # Builtin Dome light (camera Vis and invis) with and without scene lights + _testDomeVis_SceneLight(appController) + _testDomeVis(appController) + _testDomeInvis(appController) + _testDomeInvis_SceneLight(appController) + + # no builtin lights with and without scene lights + _testSceneLights(appController) + _testNoLights(appController) diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSelectionHighlighting/testUsdviewSelectionHighlighting.py b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSelectionHighlighting/testUsdviewSelectionHighlighting.py index 399ce7d49c..4b21330f0f 100644 --- a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSelectionHighlighting/testUsdviewSelectionHighlighting.py +++ b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSelectionHighlighting/testUsdviewSelectionHighlighting.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # from pxr import Sdf diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewShaderEdits/testUsdviewShaderEdits.py b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewShaderEdits/testUsdviewShaderEdits.py index dfa7018dbe..d438258eee 100644 --- a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewShaderEdits/testUsdviewShaderEdits.py +++ b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewShaderEdits/testUsdviewShaderEdits.py @@ -2,25 +2,8 @@ # # Copyright 2019 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # from pxr import UsdShade from pxr import Sdf diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSkinning/testUsdviewSkinning.py b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSkinning/testUsdviewSkinning.py index d972f44c66..9fdec6884b 100644 --- a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSkinning/testUsdviewSkinning.py +++ b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewSkinning/testUsdviewSkinning.py @@ -2,25 +2,8 @@ # # Copyright 2019 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # from __future__ import print_function diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewTimeSamples/testUsdviewTimeSamples.py b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewTimeSamples/testUsdviewTimeSamples.py index ad982aec71..c72702eb12 100644 --- a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewTimeSamples/testUsdviewTimeSamples.py +++ b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewTimeSamples/testUsdviewTimeSamples.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # NUM_TIME_SAMPLES = 6 diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewUpAxis/testUsdviewUpAxis_yUp.py b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewUpAxis/testUsdviewUpAxis_yUp.py index 9738de3172..fdd847192e 100644 --- a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewUpAxis/testUsdviewUpAxis_yUp.py +++ b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewUpAxis/testUsdviewUpAxis_yUp.py @@ -2,25 +2,8 @@ # # Copyright 2018 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # # Remove any unwanted visuals from the view, and enable autoClip diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewUpAxis/testUsdviewUpAxis_zUp.py b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewUpAxis/testUsdviewUpAxis_zUp.py index 94802a099d..287530052c 100644 --- a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewUpAxis/testUsdviewUpAxis_zUp.py +++ b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewUpAxis/testUsdviewUpAxis_zUp.py @@ -2,25 +2,8 @@ # # Copyright 2018 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # # Remove any unwanted visuals from the view, and enable autoClip diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewVariantSelection/testUsdviewVariantSelection.py b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewVariantSelection/testUsdviewVariantSelection.py index f45b008db8..ca523e1a1f 100644 --- a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewVariantSelection/testUsdviewVariantSelection.py +++ b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewVariantSelection/testUsdviewVariantSelection.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from pxr.Usdviewq.qt import QtWidgets diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewWrapper/testCallback.py b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewWrapper/testCallback.py index f3878e5548..35df767244 100644 --- a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewWrapper/testCallback.py +++ b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewWrapper/testCallback.py @@ -1,3 +1,9 @@ +# +# Copyright 2018 Pixar +# +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. +# from __future__ import print_function def testUsdviewInputFunction(mw): print('callback') diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewWrapper/testCallback_Invalid_1.py b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewWrapper/testCallback_Invalid_1.py index 21317afa41..4fcbcd6f91 100644 --- a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewWrapper/testCallback_Invalid_1.py +++ b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewWrapper/testCallback_Invalid_1.py @@ -1,3 +1,9 @@ +# +# Copyright 2018 Pixar +# +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. +# # Invalid because we don't match the expected args def testUsdviewInputFunction(mw, mw1): return 5 diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewWrapper/testCallback_Invalid_2.py b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewWrapper/testCallback_Invalid_2.py index d9030c336d..249d7d4c92 100644 --- a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewWrapper/testCallback_Invalid_2.py +++ b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewWrapper/testCallback_Invalid_2.py @@ -1,3 +1,9 @@ +# +# Copyright 2018 Pixar +# +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. +# # Invalid because we don't match the callback name def testUsdviewInputFunction_(mw): return 5 diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewWrapper/testCallback_Invalid_3.py b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewWrapper/testCallback_Invalid_3.py index 4950c1a3fb..75e772fd17 100644 --- a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewWrapper/testCallback_Invalid_3.py +++ b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewWrapper/testCallback_Invalid_3.py @@ -1,3 +1,9 @@ +# +# Copyright 2018 Pixar +# +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. +# # Invalid because we have default args def testUsdviewInputFunction(mw=None): return 5 diff --git a/pxr/usdImaging/bin/testusdview/testusdview.py b/pxr/usdImaging/bin/testusdview/testusdview.py index 04ffa8bbcb..8240ee2e48 100644 --- a/pxr/usdImaging/bin/testusdview/testusdview.py +++ b/pxr/usdImaging/bin/testusdview/testusdview.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # # This is a wrapper around Usdview's launcher code to allow injection of a @@ -45,26 +28,24 @@ def RegisterOptions(self, parser): help="The test script to run after loading. " "This script must expect to take a single") - def Run(self): - parser = argparse.ArgumentParser(prog=sys.argv[0], - description=self.GetHelpDescription()) - self.RegisterOptions(parser) - super(TestUsdView, self).RegisterPositionals(parser) + def ParseOptions(self, parser): arg_parse_result = super(TestUsdView, self).ParseOptions(parser) # We always set --defaultsettings to ensure a consistent test # environment for our test scripts. arg_parse_result.defaultSettings = True - super(TestUsdView, self).ValidateOptions(arg_parse_result) - - self.__LaunchProcess(arg_parse_result) + return arg_parse_result - def __LaunchProcess(self, arg_parse_result): - callBack = self._ValidateTestFile(arg_parse_result.testScript) - (app, appController) = ( - super(TestUsdView, self).LaunchPreamble( - arg_parse_result, overrideMaxSamples = False)) + def OverrideMaxSamples(self): + return False + def LaunchPreamble(self, arg_parse_result): + # Load the test script. This must be done before the creation + # of the AppController in the base class' LaunchPreamble. + self._LoadTestFile(arg_parse_result.testScript) + return super(TestUsdView, self).LaunchPreamble(arg_parse_result) + + def LaunchProcess(self, arg_parse_result, app, appController): # Set a fixed size on the stage view so that any image tests get a # consistent resolution - but only if we've created a viewer if appController._stageView: @@ -72,19 +53,19 @@ def __LaunchProcess(self, arg_parse_result): # Process initial loading events app.processEvents() - callBack(appController) + self.callBack(appController) # Process event triggered by the callbacks app.processEvents() # Trigger application shutdown. app.instance().closeAllWindows() - return # Verify that we have a valid file as input, and it contains # our expected entry point for testing. # - # Upon success, this will return the callback to be called after - # launching Usdview and doing the initial load pass - def _ValidateTestFile(self, filePath): + # Upon success, this will set the callback to be called after + # launching Usdview and doing the initial load pass into + # self.callBack. + def _LoadTestFile(self, filePath): if not os.path.exists(filePath): sys.stderr.write('Invalid file supplied, does not exist: {}\n' .format(filePath)) @@ -107,8 +88,8 @@ def _ValidateTestFile(self, filePath): with open(filePath) as inputFile: code = compile(inputFile.read(), filePath, 'exec') exec(code, localVars) - callBack = localVars.get(TEST_USD_VIEW_CALLBACK_IDENT) - if not callBack: + self.callBack = localVars.get(TEST_USD_VIEW_CALLBACK_IDENT) + if not self.callBack: sys.stderr.write('Invalid file supplied, must contain a function of ' 'the signature' + TEST_USD_VIEW_CALLBACK_IDENT + '(appController): {}\n'.format(filePath)) @@ -120,16 +101,13 @@ def _ValidateTestFile(self, filePath): 'Error: %s') (args, varargs, keywords, defaults, _, _, _) = \ - inspect.getfullargspec(callBack) + inspect.getfullargspec(self.callBack) assert not varargs, errorMsg % 'Varargs are disallowed' assert not keywords, errorMsg % 'Kwargs are disallowed' assert not defaults, errorMsg % 'Defaults are disallowed' assert len(args) == 1, errorMsg % 'Incorrect number of args (1 expected)' - return callBack - - # Monkey patch AppController to add helper test interface methods def _processEvents(self, iterations=10, waitForConvergence=False): diff --git a/pxr/usdImaging/bin/usdBakeMtlx/__init__.py b/pxr/usdImaging/bin/usdBakeMtlx/__init__.py index f18c7c0369..6758dd3cc1 100644 --- a/pxr/usdImaging/bin/usdBakeMtlx/__init__.py +++ b/pxr/usdImaging/bin/usdBakeMtlx/__init__.py @@ -1,25 +1,8 @@ # # Copyright 2022 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # from pxr import Tf Tf.PreparePythonModule() diff --git a/pxr/usdImaging/bin/usdBakeMtlx/api.h b/pxr/usdImaging/bin/usdBakeMtlx/api.h index b9d746b5a1..88d47d2eca 100644 --- a/pxr/usdImaging/bin/usdBakeMtlx/api.h +++ b/pxr/usdImaging/bin/usdBakeMtlx/api.h @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_BAKE_MTLX_API_H #define PXR_USD_IMAGING_USD_BAKE_MTLX_API_H diff --git a/pxr/usdImaging/bin/usdBakeMtlx/bakeMaterialX.cpp b/pxr/usdImaging/bin/usdBakeMtlx/bakeMaterialX.cpp index 0748a13468..e2f7da905c 100644 --- a/pxr/usdImaging/bin/usdBakeMtlx/bakeMaterialX.cpp +++ b/pxr/usdImaging/bin/usdBakeMtlx/bakeMaterialX.cpp @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/bin/usdBakeMtlx/bakeMaterialX.h" diff --git a/pxr/usdImaging/bin/usdBakeMtlx/bakeMaterialX.h b/pxr/usdImaging/bin/usdBakeMtlx/bakeMaterialX.h index b0f8f54922..54f617fa14 100644 --- a/pxr/usdImaging/bin/usdBakeMtlx/bakeMaterialX.h +++ b/pxr/usdImaging/bin/usdBakeMtlx/bakeMaterialX.h @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_BIN_USD_BAKE_MTLX_BAKE_MATERIALX_H diff --git a/pxr/usdImaging/bin/usdBakeMtlx/module.cpp b/pxr/usdImaging/bin/usdBakeMtlx/module.cpp index 4e4fb4e6ce..8f5f9f9528 100644 --- a/pxr/usdImaging/bin/usdBakeMtlx/module.cpp +++ b/pxr/usdImaging/bin/usdBakeMtlx/module.cpp @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usdImaging/bin/usdBakeMtlx/moduleDeps.cpp b/pxr/usdImaging/bin/usdBakeMtlx/moduleDeps.cpp index b65f3f4bc7..d96189c24f 100644 --- a/pxr/usdImaging/bin/usdBakeMtlx/moduleDeps.cpp +++ b/pxr/usdImaging/bin/usdBakeMtlx/moduleDeps.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/pxr/usdImaging/bin/usdBakeMtlx/usdBakeMaterialX.py b/pxr/usdImaging/bin/usdBakeMtlx/usdBakeMaterialX.py index 7751c3a3a1..7bb1c87430 100644 --- a/pxr/usdImaging/bin/usdBakeMtlx/usdBakeMaterialX.py +++ b/pxr/usdImaging/bin/usdBakeMtlx/usdBakeMaterialX.py @@ -2,25 +2,8 @@ # # Copyright 2022 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # from __future__ import print_function diff --git a/pxr/usdImaging/bin/usdBakeMtlx/wrapBakeMaterialX.cpp b/pxr/usdImaging/bin/usdBakeMtlx/wrapBakeMaterialX.cpp index 82d4c3f117..8989321558 100644 --- a/pxr/usdImaging/bin/usdBakeMtlx/wrapBakeMaterialX.cpp +++ b/pxr/usdImaging/bin/usdBakeMtlx/wrapBakeMaterialX.cpp @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/bin/usdBakeMtlx/bakeMaterialX.h" diff --git a/pxr/usdImaging/bin/usdrecord/CMakeLists.txt b/pxr/usdImaging/bin/usdrecord/CMakeLists.txt index d8189e88a2..9feb1f4ea6 100644 --- a/pxr/usdImaging/bin/usdrecord/CMakeLists.txt +++ b/pxr/usdImaging/bin/usdrecord/CMakeLists.txt @@ -59,6 +59,36 @@ pxr_install_test_dir( DEST testUsdRecordSmallObject ) +pxr_install_test_dir( + SRC testenv/MotionBlurTest + DEST testUsdRecordMotionBlur +) + +# Versions of the the above tests using the new stage scene index +pxr_install_test_dir( + SRC testenv/RecordTest + DEST testUsdRecordSingleFrame_SceneIndex +) + +pxr_install_test_dir( + SRC testenv/RecordTest + DEST testUsdRecordMultipleFrames_SceneIndex +) + +pxr_install_test_dir( + SRC testenv/RecordTest + DEST testUsdRecordSessionLayer_SceneIndex +) + +pxr_install_test_dir( + SRC testenv/SmallObjectTest + DEST testUsdRecordSmallObject_SceneIndex +) + +pxr_install_test_dir( + SRC testenv/MotionBlurTest + DEST testUsdRecordMotionBlur_SceneIndex +) pxr_register_test(testUsdRecordSingleFrame PYTHON @@ -138,7 +168,7 @@ pxr_register_test(testUsdRecordSessionLayer pxr_register_test(testUsdRecordSmallObject PYTHON - COMMAND "${CMAKE_INSTALL_PREFIX}/bin/usdrecord test.usda out.png" + COMMAND "${CMAKE_INSTALL_PREFIX}/bin/usdrecord --enableDomeLightVisibility test.usda out.png" IMAGE_DIFF_COMPARE out.png FAIL 0.5 @@ -149,3 +179,138 @@ pxr_register_test(testUsdRecordSmallObject TESTENV testUsdRecordSmallObject ) +# XXX: Temporarily disable test due to intermittent failures +# if (PXR_BUILD_PRMAN_PLUGIN) +# pxr_register_test(testUsdRecordMotionBlur +# PYTHON +# COMMAND "${CMAKE_INSTALL_PREFIX}/bin/usdrecord motionBlur.usda motionBlur.exr -cam /first_cam -r Prman" +# IMAGE_DIFF_COMPARE +# motionBlur.exr +# FAIL 0.5 +# FAIL_PERCENT 0.005 +# WARN 0.05 +# WARN_PERCENT 0.0075 +# EXPECTED_RETURN_CODE 0 +# TESTENV testUsdRecordMotionBlur +# ENV +# RMANTREE=${RENDERMAN_LOCATION} +# ) +# endif() + + +# Versions of the the above tests using the new stage scene index +pxr_register_test(testUsdRecordSingleFrame_SceneIndex + PYTHON + COMMAND "${CMAKE_INSTALL_PREFIX}/bin/usdrecord AnimCube.usda AnimCube.1.png" + IMAGE_DIFF_COMPARE + AnimCube.1.png + FAIL 0.5 + FAIL_PERCENT 0.005 + WARN 0.05 + WARN_PERCENT 0.0075 + EXPECTED_RETURN_CODE 0 + TESTENV testUsdRecordSingleFrame_SceneIndex + ENV + USDIMAGINGGL_ENGINE_ENABLE_SCENE_INDEX=true +) + +pxr_register_test(testUsdRecordMultipleFrames_SceneIndex + PYTHON + COMMAND "${CMAKE_INSTALL_PREFIX}/bin/usdrecord AnimCube.usda AnimCube.#.png --frames 1,5,10" + IMAGE_DIFF_COMPARE + AnimCube.1.png + AnimCube.5.png + AnimCube.10.png + FAIL 0.5 + FAIL_PERCENT 0.005 + WARN 0.05 + WARN_PERCENT 0.0075 + EXPECTED_RETURN_CODE 0 + TESTENV testUsdRecordMultipleFrames_SceneIndex + ENV + USDIMAGINGGL_ENGINE_ENABLE_SCENE_INDEX=true +) + +if (PXR_BUILD_PRMAN_PLUGIN OR PXR_BUILD_EMBREE_PLUGIN) + pxr_register_test(testUsdRecordSingleFrame_SceneIndex_NoGpu + PYTHON + COMMAND "${CMAKE_INSTALL_PREFIX}/bin/usdrecord --disableGpu AnimCube.usda AnimCubeNoGpu.1.png" + IMAGE_DIFF_COMPARE + AnimCubeNoGpu.1.png + FAIL 0.5 + FAIL_PERCENT 0.005 + WARN 0.05 + WARN_PERCENT 0.0075 + EXPECTED_RETURN_CODE 0 + TESTENV testUsdRecordSingleFrame_SceneIndex + ENV + USDIMAGINGGL_ENGINE_ENABLE_SCENE_INDEX=true + RMANTREE=${RENDERMAN_LOCATION} + ) + pxr_register_test(testUsdRecordMultipleFrames_SceneIndex_NoGpu + PYTHON + COMMAND "${CMAKE_INSTALL_PREFIX}/bin/usdrecord AnimCube.usda --disableGpu AnimCubeNoGpu.#.png --frames 1,5,10" + IMAGE_DIFF_COMPARE + AnimCubeNoGpu.1.png + AnimCubeNoGpu.5.png + AnimCubeNoGpu.10.png + FAIL 0.5 + FAIL_PERCENT 0.005 + WARN 0.05 + WARN_PERCENT 0.0075 + EXPECTED_RETURN_CODE 0 + TESTENV testUsdRecordMultipleFrames_SceneIndex + ENV + USDIMAGINGGL_ENGINE_ENABLE_SCENE_INDEX=true + RMANTREE=${RENDERMAN_LOCATION} + ) +endif() + +pxr_register_test(testUsdRecordSessionLayer_SceneIndex + PYTHON + COMMAND "${CMAKE_INSTALL_PREFIX}/bin/usdrecord --sessionLayer overrideDisplayColor.usda AnimCube.usda AnimCube_overrides.1.png" + IMAGE_DIFF_COMPARE + AnimCube_overrides.1.png + FAIL 0.5 + FAIL_PERCENT 0.005 + WARN 0.05 + WARN_PERCENT 0.0075 + EXPECTED_RETURN_CODE 0 + TESTENV testUsdRecordSessionLayer_SceneIndex + ENV + USDIMAGINGGL_ENGINE_ENABLE_SCENE_INDEX=true +) + +pxr_register_test(testUsdRecordSmallObject_SceneIndex + PYTHON + COMMAND "${CMAKE_INSTALL_PREFIX}/bin/usdrecord --enableDomeLightVisibility test.usda out.png" + IMAGE_DIFF_COMPARE + out.png + FAIL 0.5 + FAIL_PERCENT 0.005 + WARN 0.05 + WARN_PERCENT 0.0075 + EXPECTED_RETURN_CODE 0 + TESTENV testUsdRecordSmallObject_SceneIndex + ENV + USDIMAGINGGL_ENGINE_ENABLE_SCENE_INDEX=true +) + +# XXX: Temporarily disable test due to intermittent failures +# if (PXR_BUILD_PRMAN_PLUGIN) +# pxr_register_test(testUsdRecordMotionBlur_SceneIndex +# PYTHON +# COMMAND "${CMAKE_INSTALL_PREFIX}/bin/usdrecord motionBlur.usda motionBlur_SI.exr -cam /first_cam -r Prman" +# IMAGE_DIFF_COMPARE +# motionBlur_SI.exr +# FAIL 0.5 +# FAIL_PERCENT 0.005 +# WARN 0.05 +# WARN_PERCENT 0.0075 +# EXPECTED_RETURN_CODE 0 +# TESTENV testUsdRecordMotionBlur +# ENV +# USDIMAGINGGL_ENGINE_ENABLE_SCENE_INDEX=true +# RMANTREE=${RENDERMAN_LOCATION} +# ) +# endif() diff --git a/pxr/usdImaging/bin/usdrecord/testenv/MotionBlurTest/baseline/motionBlur.1.exr b/pxr/usdImaging/bin/usdrecord/testenv/MotionBlurTest/baseline/motionBlur.1.exr deleted file mode 100644 index dc22662b48..0000000000 Binary files a/pxr/usdImaging/bin/usdrecord/testenv/MotionBlurTest/baseline/motionBlur.1.exr and /dev/null differ diff --git a/pxr/usdImaging/bin/usdrecord/testenv/MotionBlurTest/baseline/motionBlur.exr b/pxr/usdImaging/bin/usdrecord/testenv/MotionBlurTest/baseline/motionBlur.exr new file mode 100644 index 0000000000..a0afe302fb Binary files /dev/null and b/pxr/usdImaging/bin/usdrecord/testenv/MotionBlurTest/baseline/motionBlur.exr differ diff --git a/pxr/usdImaging/bin/usdrecord/testenv/MotionBlurTest/baseline/motionBlur_SI.1.exr b/pxr/usdImaging/bin/usdrecord/testenv/MotionBlurTest/baseline/motionBlur_SI.1.exr deleted file mode 100644 index 31ea787e2e..0000000000 Binary files a/pxr/usdImaging/bin/usdrecord/testenv/MotionBlurTest/baseline/motionBlur_SI.1.exr and /dev/null differ diff --git a/pxr/usdImaging/bin/usdrecord/testenv/MotionBlurTest/baseline/motionBlur_SI.exr b/pxr/usdImaging/bin/usdrecord/testenv/MotionBlurTest/baseline/motionBlur_SI.exr new file mode 100644 index 0000000000..646adf2b72 Binary files /dev/null and b/pxr/usdImaging/bin/usdrecord/testenv/MotionBlurTest/baseline/motionBlur_SI.exr differ diff --git a/pxr/usdImaging/bin/usdrecord/testenv/RecordTest/baseline/AnimCubeNoGpu.1.png b/pxr/usdImaging/bin/usdrecord/testenv/RecordTest/baseline/AnimCubeNoGpu.1.png index 0c4f4cc51b..87431544a4 100644 Binary files a/pxr/usdImaging/bin/usdrecord/testenv/RecordTest/baseline/AnimCubeNoGpu.1.png and b/pxr/usdImaging/bin/usdrecord/testenv/RecordTest/baseline/AnimCubeNoGpu.1.png differ diff --git a/pxr/usdImaging/bin/usdrecord/testenv/RecordTest/baseline/AnimCubeNoGpu.10.png b/pxr/usdImaging/bin/usdrecord/testenv/RecordTest/baseline/AnimCubeNoGpu.10.png index 614780f38e..041ad14b63 100644 Binary files a/pxr/usdImaging/bin/usdrecord/testenv/RecordTest/baseline/AnimCubeNoGpu.10.png and b/pxr/usdImaging/bin/usdrecord/testenv/RecordTest/baseline/AnimCubeNoGpu.10.png differ diff --git a/pxr/usdImaging/bin/usdrecord/testenv/RecordTest/baseline/AnimCubeNoGpu.5.png b/pxr/usdImaging/bin/usdrecord/testenv/RecordTest/baseline/AnimCubeNoGpu.5.png index b219739d64..2b61ad8da1 100644 Binary files a/pxr/usdImaging/bin/usdrecord/testenv/RecordTest/baseline/AnimCubeNoGpu.5.png and b/pxr/usdImaging/bin/usdrecord/testenv/RecordTest/baseline/AnimCubeNoGpu.5.png differ diff --git a/pxr/usdImaging/bin/usdrecord/usdrecord.py b/pxr/usdImaging/bin/usdrecord/usdrecord.py index e3ff537af5..f45f7839ee 100644 --- a/pxr/usdImaging/bin/usdrecord/usdrecord.py +++ b/pxr/usdImaging/bin/usdrecord/usdrecord.py @@ -2,25 +2,8 @@ # # Copyright 2019 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # from pxr import Usd @@ -95,7 +78,7 @@ def _SetupOpenGLContext(width=100, height=100): return glWidget -def main(): +def main() -> int: programName = os.path.basename(sys.argv[0]) parser = argparse.ArgumentParser(prog=programName, description='Generates images from a USD file') @@ -163,6 +146,13 @@ def main(): 'Width of the output image. The height will be computed from this ' 'value and the camera\'s aspect ratio (default=%(default)s)')) + parser.add_argument('--enableDomeLightVisibility', action='store_true', + dest='domeLightVisibility', + help=('Show the dome light background in the rendered output. ' + 'If this option is not included and there is a dome light in ' + 'the stage, the IBL from it will be used for lighting but not ' + 'drawn into the background.')) + parser.add_argument('--renderPassPrimPath', '-rp', action='store', type=str, dest='rpPrimPath', help=( @@ -185,9 +175,6 @@ def main(): args = parser.parse_args() - UsdAppUtils.framesArgs.ValidateCmdlineArgs(parser, args, - frameFormatArgName='outputImagePath') - args.imageWidth = max(args.imageWidth, 1) purposes = args.purposes.replace(',', ' ').split() @@ -223,6 +210,9 @@ def main(): _Err('Could not open USD stage: %s' % args.usdFilePath) return 1 + UsdAppUtils.framesArgs.ValidateCmdlineArgs(parser, args, usdStage, + frameFormatArgName='outputImagePath') + # Get the camera at the given path (or with the given name). usdCamera = UsdAppUtils.GetCameraAtPath(usdStage, args.camera) @@ -266,30 +256,36 @@ def main(): # Initialize FrameRecorder frameRecorder = UsdAppUtils.FrameRecorder( - rendererPluginId, args.gpuEnabled, args.rsPrimPath) + rendererPluginId, args.gpuEnabled) + if args.rpPrimPath: + frameRecorder.SetActiveRenderPassPrimPath(args.rpPrimPath) + if args.rsPrimPath: + frameRecorder.SetActiveRenderSettingsPrimPath(args.rsPrimPath) frameRecorder.SetImageWidth(args.imageWidth) frameRecorder.SetComplexity(args.complexity.value) frameRecorder.SetCameraLightEnabled(args.cameraLightEnabled) frameRecorder.SetColorCorrectionMode(args.colorCorrectionMode) frameRecorder.SetIncludedPurposes(purposes) + frameRecorder.SetDomeLightVisibility(args.domeLightVisibility) _Msg('Camera: %s' % usdCamera.GetPath().pathString) _Msg('Renderer plugin: %s' % frameRecorder.GetCurrentRendererId()) for timeCode in args.frames: - _Msg('Recording time code: %s' % timeCode) - outputImagePath = args.outputImagePath.format(frame=timeCode.GetValue()) + _Msg('Recording time code: %f' % timeCode) + outputImagePath = args.outputImagePath.format(frame=timeCode) try: frameRecorder.Record(usdStage, usdCamera, timeCode, outputImagePath) except Tf.ErrorException as e: _Err("Recording aborted due to the following failure at time code " "{0}: {1}".format(timeCode, str(e))) - break + return 1 # Release our reference to the frame recorder so it can be deleted before # the Qt stuff. frameRecorder = None + return 0 if __name__ == '__main__': diff --git a/pxr/usdImaging/bin/usdview/usdview.py b/pxr/usdImaging/bin/usdview/usdview.py index 55480e80c8..3d4275fd1c 100644 --- a/pxr/usdImaging/bin/usdview/usdview.py +++ b/pxr/usdImaging/bin/usdview/usdview.py @@ -2,25 +2,8 @@ # # Copyright 2016 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # from __future__ import print_function diff --git a/pxr/usdImaging/plugin/sdrGlslfx/__init__.py b/pxr/usdImaging/plugin/sdrGlslfx/__init__.py index 2cf52faa84..b795ede8bd 100644 --- a/pxr/usdImaging/plugin/sdrGlslfx/__init__.py +++ b/pxr/usdImaging/plugin/sdrGlslfx/__init__.py @@ -1,25 +1,8 @@ # # Copyright 2019 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # # This file makes this module importable from python, which avoids a warning diff --git a/pxr/usdImaging/plugin/sdrGlslfx/moduleDeps.cpp b/pxr/usdImaging/plugin/sdrGlslfx/moduleDeps.cpp index 2e52c460f1..b118260148 100644 --- a/pxr/usdImaging/plugin/sdrGlslfx/moduleDeps.cpp +++ b/pxr/usdImaging/plugin/sdrGlslfx/moduleDeps.cpp @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/pxr/usdImaging/plugin/sdrGlslfx/parserPlugin.cpp b/pxr/usdImaging/plugin/sdrGlslfx/parserPlugin.cpp index c68c360633..095fa06ce6 100644 --- a/pxr/usdImaging/plugin/sdrGlslfx/parserPlugin.cpp +++ b/pxr/usdImaging/plugin/sdrGlslfx/parserPlugin.cpp @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/plugin/sdrGlslfx/parserPlugin.h" diff --git a/pxr/usdImaging/plugin/sdrGlslfx/parserPlugin.h b/pxr/usdImaging/plugin/sdrGlslfx/parserPlugin.h index 18136466a9..3430e2a4e8 100644 --- a/pxr/usdImaging/plugin/sdrGlslfx/parserPlugin.h +++ b/pxr/usdImaging/plugin/sdrGlslfx/parserPlugin.h @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef SDRGLSLFX_PARSER_PLUGIN_H #define SDRGLSLFX_PARSER_PLUGIN_H diff --git a/pxr/usdImaging/plugin/sdrGlslfx/pch.h b/pxr/usdImaging/plugin/sdrGlslfx/pch.h index 43da5ee7ac..98a88ac977 100644 --- a/pxr/usdImaging/plugin/sdrGlslfx/pch.h +++ b/pxr/usdImaging/plugin/sdrGlslfx/pch.h @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // // WARNING: THIS FILE IS GENERATED. DO NOT EDIT. // @@ -27,16 +10,11 @@ #define TF_MAX_ARITY 7 #include "pxr/pxr.h" #include "pxr/base/arch/defines.h" -#if defined(ARCH_OS_WINDOWS) -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif - -#include -#include -#include +#if defined(ARCH_OS_LINUX) +#include #endif #include +#include #include #include #include @@ -49,20 +27,21 @@ #include #include #include +#include #include #include #include #include #include #include -#include +#include #include #include #include #include -#include #include #include +#include #include #include #include @@ -70,42 +49,6 @@ #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #ifdef PXR_PYTHON_SUPPORT_ENABLED #include #include @@ -115,18 +58,6 @@ #undef toupper #endif #endif // PXR_PYTHON_SUPPORT_ENABLED -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #ifdef PXR_PYTHON_SUPPORT_ENABLED #include "pxr/base/tf/pySafePython.h" #endif // PXR_PYTHON_SUPPORT_ENABLED diff --git a/pxr/usdImaging/plugin/usdShaders/__init__.py b/pxr/usdImaging/plugin/usdShaders/__init__.py index 2fac052247..cb2b1682df 100644 --- a/pxr/usdImaging/plugin/usdShaders/__init__.py +++ b/pxr/usdImaging/plugin/usdShaders/__init__.py @@ -1,25 +1,8 @@ # # Copyright 2018 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # # This file makes this module importable from python, which avoids a warning diff --git a/pxr/usdImaging/plugin/usdShaders/discoveryPlugin.cpp b/pxr/usdImaging/plugin/usdShaders/discoveryPlugin.cpp index 302b8d3bfe..a975410070 100644 --- a/pxr/usdImaging/plugin/usdShaders/discoveryPlugin.cpp +++ b/pxr/usdImaging/plugin/usdShaders/discoveryPlugin.cpp @@ -1,25 +1,8 @@ // // Copyright 2018 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/plugin/usdShaders/discoveryPlugin.h" diff --git a/pxr/usdImaging/plugin/usdShaders/discoveryPlugin.h b/pxr/usdImaging/plugin/usdShaders/discoveryPlugin.h index bcb25aa957..85659ce71c 100644 --- a/pxr/usdImaging/plugin/usdShaders/discoveryPlugin.h +++ b/pxr/usdImaging/plugin/usdShaders/discoveryPlugin.h @@ -1,25 +1,8 @@ // // Copyright 2018 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_PLUGIN_USD_SHADERS_DISCOVERY_PLUGIN_H #define PXR_USD_IMAGING_PLUGIN_USD_SHADERS_DISCOVERY_PLUGIN_H diff --git a/pxr/usdImaging/plugin/usdShaders/moduleDeps.cpp b/pxr/usdImaging/plugin/usdShaders/moduleDeps.cpp index 4c6a4da0ce..e258543788 100644 --- a/pxr/usdImaging/plugin/usdShaders/moduleDeps.cpp +++ b/pxr/usdImaging/plugin/usdShaders/moduleDeps.cpp @@ -1,25 +1,8 @@ // // Copyright 2018 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/pxr/usdImaging/plugin/usdShaders/pch.h b/pxr/usdImaging/plugin/usdShaders/pch.h index 2037e25b8b..846e6028f0 100644 --- a/pxr/usdImaging/plugin/usdShaders/pch.h +++ b/pxr/usdImaging/plugin/usdShaders/pch.h @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // // WARNING: THIS FILE IS GENERATED. DO NOT EDIT. // @@ -31,6 +14,7 @@ #include #endif #if defined(ARCH_OS_LINUX) +#include #include #endif #if defined(ARCH_OS_WINDOWS) @@ -38,12 +22,11 @@ #define WIN32_LEAN_AND_MEAN #endif +#include #include -#include -#include -#include #endif #include +#include #include #include #include @@ -68,6 +51,8 @@ #include #include #include +#include +#include #include #include #include @@ -76,6 +61,7 @@ #include #include #include +#include #include #include #include @@ -83,53 +69,6 @@ #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #ifdef PXR_PYTHON_SUPPORT_ENABLED #include #include @@ -143,25 +82,9 @@ #undef toupper #endif #endif // PXR_PYTHON_SUPPORT_ENABLED -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include #include +#include #include #include #include @@ -169,7 +92,7 @@ #include #include #include -#include +#include #ifdef PXR_PYTHON_SUPPORT_ENABLED #include "pxr/base/tf/pySafePython.h" #endif // PXR_PYTHON_SUPPORT_ENABLED diff --git a/pxr/usdImaging/plugin/usdShaders/shaders/previewSurface.glslfx b/pxr/usdImaging/plugin/usdShaders/shaders/previewSurface.glslfx index 717f06ba7d..2d048a6c2b 100644 --- a/pxr/usdImaging/plugin/usdShaders/shaders/previewSurface.glslfx +++ b/pxr/usdImaging/plugin/usdShaders/shaders/previewSurface.glslfx @@ -3,25 +3,8 @@ // // Copyright 2018 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #import $TOOLS/hdSt/shaders/surfaceHelpers.glslfx diff --git a/pxr/usdImaging/plugin/usdShaders/shaders/primvarReader.glslfx b/pxr/usdImaging/plugin/usdShaders/shaders/primvarReader.glslfx index ffe586e9c1..cc20f4fd1a 100644 --- a/pxr/usdImaging/plugin/usdShaders/shaders/primvarReader.glslfx +++ b/pxr/usdImaging/plugin/usdShaders/shaders/primvarReader.glslfx @@ -3,25 +3,8 @@ // // Copyright 2018 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // -- configuration diff --git a/pxr/usdImaging/plugin/usdShaders/shaders/transform2d.glslfx b/pxr/usdImaging/plugin/usdShaders/shaders/transform2d.glslfx index 64cffe4bf7..ef78f864f6 100644 --- a/pxr/usdImaging/plugin/usdShaders/shaders/transform2d.glslfx +++ b/pxr/usdImaging/plugin/usdShaders/shaders/transform2d.glslfx @@ -3,25 +3,8 @@ // // Copyright 2020 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // -- configuration diff --git a/pxr/usdImaging/plugin/usdShaders/shaders/uvTexture.glslfx b/pxr/usdImaging/plugin/usdShaders/shaders/uvTexture.glslfx index ffe586e9c1..cc20f4fd1a 100644 --- a/pxr/usdImaging/plugin/usdShaders/shaders/uvTexture.glslfx +++ b/pxr/usdImaging/plugin/usdShaders/shaders/uvTexture.glslfx @@ -3,25 +3,8 @@ // // Copyright 2018 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // -- configuration diff --git a/pxr/usdImaging/usdAppUtils/CMakeLists.txt b/pxr/usdImaging/usdAppUtils/CMakeLists.txt index 2d8ccb94f1..dbeef54efd 100644 --- a/pxr/usdImaging/usdAppUtils/CMakeLists.txt +++ b/pxr/usdImaging/usdAppUtils/CMakeLists.txt @@ -66,6 +66,11 @@ pxr_register_test(testUsdAppUtilsCamera EXPECTED_RETURN_CODE 0 ) + +pxr_install_test_dir( + SRC testenv/CmdlineArgsTest + DEST testUsdAppUtilsCmdlineArgs +) pxr_register_test(testUsdAppUtilsCmdlineArgs PYTHON COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdAppUtilsCmdlineArgs" diff --git a/pxr/usdImaging/usdAppUtils/__init__.py b/pxr/usdImaging/usdAppUtils/__init__.py index 6c8ed60689..588ca33911 100644 --- a/pxr/usdImaging/usdAppUtils/__init__.py +++ b/pxr/usdImaging/usdAppUtils/__init__.py @@ -1,25 +1,8 @@ # # Copyright 2019 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # from pxr import Tf diff --git a/pxr/usdImaging/usdAppUtils/api.h b/pxr/usdImaging/usdAppUtils/api.h index 7dd6b7e6e4..2a96183b58 100644 --- a/pxr/usdImaging/usdAppUtils/api.h +++ b/pxr/usdImaging/usdAppUtils/api.h @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_APP_UTILS_API_H #define PXR_USD_IMAGING_USD_APP_UTILS_API_H diff --git a/pxr/usdImaging/usdAppUtils/camera.cpp b/pxr/usdImaging/usdAppUtils/camera.cpp index 0b7bf7924d..089761929c 100644 --- a/pxr/usdImaging/usdAppUtils/camera.cpp +++ b/pxr/usdImaging/usdAppUtils/camera.cpp @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usdImaging/usdAppUtils/camera.h" diff --git a/pxr/usdImaging/usdAppUtils/camera.h b/pxr/usdImaging/usdAppUtils/camera.h index 4381354c92..4b755a233e 100644 --- a/pxr/usdImaging/usdAppUtils/camera.h +++ b/pxr/usdImaging/usdAppUtils/camera.h @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_APP_UTILS_CAMERA_H #define PXR_USD_IMAGING_USD_APP_UTILS_CAMERA_H diff --git a/pxr/usdImaging/usdAppUtils/cameraArgs.py b/pxr/usdImaging/usdAppUtils/cameraArgs.py index eb7983220f..fe74b5b710 100644 --- a/pxr/usdImaging/usdAppUtils/cameraArgs.py +++ b/pxr/usdImaging/usdAppUtils/cameraArgs.py @@ -1,25 +1,8 @@ # # Copyright 2019 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # def AddCmdlineArgs(argsParser, defaultValue=None, altHelpText=''): diff --git a/pxr/usdImaging/usdAppUtils/colorArgs.py b/pxr/usdImaging/usdAppUtils/colorArgs.py index 4a648ea07d..2146a5e1d5 100644 --- a/pxr/usdImaging/usdAppUtils/colorArgs.py +++ b/pxr/usdImaging/usdAppUtils/colorArgs.py @@ -1,25 +1,8 @@ # # Copyright 2019 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # def AddCmdlineArgs(argsParser, defaultValue='sRGB', altHelpText=''): diff --git a/pxr/usdImaging/usdAppUtils/complexityArgs.py b/pxr/usdImaging/usdAppUtils/complexityArgs.py index 2f0093302e..16099fa529 100644 --- a/pxr/usdImaging/usdAppUtils/complexityArgs.py +++ b/pxr/usdImaging/usdAppUtils/complexityArgs.py @@ -1,25 +1,8 @@ # # Copyright 2019 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # class RefinementComplexities(object): diff --git a/pxr/usdImaging/usdAppUtils/frameRecorder.cpp b/pxr/usdImaging/usdAppUtils/frameRecorder.cpp index 9474f4bedb..4fd4b5b8c6 100644 --- a/pxr/usdImaging/usdAppUtils/frameRecorder.cpp +++ b/pxr/usdImaging/usdAppUtils/frameRecorder.cpp @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdAppUtils/frameRecorder.h" @@ -52,15 +35,14 @@ PXR_NAMESPACE_OPEN_SCOPE UsdAppUtilsFrameRecorder::UsdAppUtilsFrameRecorder( const TfToken& rendererPluginId, - bool gpuEnabled, - const SdfPath& renderSettingsPrimPath) : + bool gpuEnabled) : _imagingEngine(HdDriver(), rendererPluginId, gpuEnabled), _imageWidth(960u), _complexity(1.0f), _colorCorrectionMode(HdxColorCorrectionTokens->disabled), _purposes({UsdGeomTokens->default_, UsdGeomTokens->proxy}), - _renderSettingsPrimPath(renderSettingsPrimPath), - _cameraLightEnabled(true) + _cameraLightEnabled(true), + _domeLightsVisible(false) { // Disable presentation to avoid the need to create an OpenGL context when // using other graphics APIs such as Metal and Vulkan. @@ -69,10 +51,23 @@ UsdAppUtilsFrameRecorder::UsdAppUtilsFrameRecorder( // Set the interactive to be false on the HdRenderSettingsMap _imagingEngine.SetRendererSetting( HdRenderSettingsTokens->enableInteractive, VtValue(false)); +} - // Set the Active RenderSettings Prim path when not empty. - if (!renderSettingsPrimPath.IsEmpty()) { - _imagingEngine.SetActiveRenderSettingsPrimPath(renderSettingsPrimPath); +void +UsdAppUtilsFrameRecorder::SetActiveRenderSettingsPrimPath(SdfPath const& path) +{ + _renderSettingsPrimPath = path; + if (!_renderSettingsPrimPath.IsEmpty()) { + _imagingEngine.SetActiveRenderSettingsPrimPath(_renderSettingsPrimPath); + } +} + +void +UsdAppUtilsFrameRecorder::SetActiveRenderPassPrimPath(SdfPath const& path) +{ + _renderPassPrimPath = path; + if (!_renderPassPrimPath.IsEmpty()) { + _imagingEngine.SetActiveRenderPassPrimPath(_renderPassPrimPath); } } @@ -103,6 +98,12 @@ UsdAppUtilsFrameRecorder::SetCameraLightEnabled(bool cameraLightEnabled) _cameraLightEnabled = cameraLightEnabled; } +void +UsdAppUtilsFrameRecorder::SetDomeLightVisibility(bool domeLightsVisible) +{ + _domeLightsVisible = domeLightsVisible; +} + void UsdAppUtilsFrameRecorder::SetIncludedPurposes(const TfTokenVector& purposes) { @@ -410,6 +411,7 @@ UsdAppUtilsFrameRecorder::Record( const GfVec3d &cameraPos = frustum.GetPosition(); GlfSimpleLight cameraLight( GfVec4f(cameraPos[0], cameraPos[1], cameraPos[2], 1.0f)); + cameraLight.SetTransform(frustum.ComputeViewInverse()); cameraLight.SetAmbient(SCENE_AMBIENT); lights.push_back(cameraLight); } @@ -424,6 +426,10 @@ UsdAppUtilsFrameRecorder::Record( _imagingEngine.SetLightingState(lights, material, SCENE_AMBIENT); + _imagingEngine.SetRendererSetting( + HdRenderSettingsTokens->domeLightCameraVisibility, + VtValue(_domeLightsVisible)); + UsdImagingGLRenderParams renderParams; renderParams.frame = timeCode; renderParams.complexity = _complexity; diff --git a/pxr/usdImaging/usdAppUtils/frameRecorder.h b/pxr/usdImaging/usdAppUtils/frameRecorder.h index f9e08453eb..d5dd1bc0d5 100644 --- a/pxr/usdImaging/usdAppUtils/frameRecorder.h +++ b/pxr/usdImaging/usdAppUtils/frameRecorder.h @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_APP_UTILS_FRAME_RECORDER_H #define PXR_USD_IMAGING_USD_APP_UTILS_FRAME_RECORDER_H @@ -62,16 +45,10 @@ class UsdAppUtilsFrameRecorder /// plugin will be chosen depending on the value of \p gpuEnabled. /// The \p gpuEnabled argument determines if the UsdAppUtilsFrameRecorder /// instance will allow Hydra to use the GPU to produce images. - /// The \p renderSettingsPrimPath argument is used to set the active - /// render settings prim path in Hydra. - /// The \p defaultLights argument determines if the - /// UsdAppUtilsFrameRecorder will add a default set of lights, - /// in addition to any present in the scene. USDAPPUTILS_API UsdAppUtilsFrameRecorder( const TfToken& rendererPluginId = TfToken(), - bool gpuEnabled = true, - const SdfPath& renderSettingsPrimPath = SdfPath()); + bool gpuEnabled = true); /// Gets the ID of the Hydra renderer plugin that will be used for /// recording. @@ -92,6 +69,20 @@ class UsdAppUtilsFrameRecorder return succeeded; } + /// Sets the path to the render pass prim to use. + /// + /// \note If there is a render settings prim designated by the + /// render pass prim via renderSource, it must also be set + /// with SetActiveRenderSettingsPrimPath(). + USDAPPUTILS_API + void SetActiveRenderPassPrimPath(SdfPath const& path); + + /// Sets the path to the render settings prim to use. + /// + /// \see SetActiveRenderPassPrimPath() + USDAPPUTILS_API + void SetActiveRenderSettingsPrimPath(SdfPath const& path); + /// Sets the width of the recorded image. /// /// The height of the recorded image will be computed using this value and @@ -126,6 +117,13 @@ class UsdAppUtilsFrameRecorder USDAPPUTILS_API void SetCameraLightEnabled(bool cameraLightEnabled); + /// Sets the camera visibility of dome lights. + /// + /// When on, dome light textures will be drawn to the background as if + /// mapped onto a sphere infinitely far away. + USDAPPUTILS_API + void SetDomeLightVisibility(bool domeLightsVisible); + /// Sets the UsdGeomImageable purposes to be used for rendering /// /// We will __always__ include "default" purpose, and by default, @@ -164,8 +162,10 @@ class UsdAppUtilsFrameRecorder float _complexity; TfToken _colorCorrectionMode; TfTokenVector _purposes; + SdfPath _renderPassPrimPath; SdfPath _renderSettingsPrimPath; bool _cameraLightEnabled; + bool _domeLightsVisible; }; diff --git a/pxr/usdImaging/usdAppUtils/framesArgs.py b/pxr/usdImaging/usdAppUtils/framesArgs.py index ea41a4bd29..5b9da05ddf 100644 --- a/pxr/usdImaging/usdAppUtils/framesArgs.py +++ b/pxr/usdImaging/usdAppUtils/framesArgs.py @@ -1,25 +1,8 @@ # # Copyright 2019 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # def _GetFloatStringPrecision(floatString): @@ -83,7 +66,7 @@ def __init__(self, frameSpec): def __iter__(self): for timeCodeRange in self._timeCodeRanges: for timeCode in timeCodeRange: - yield timeCode + yield timeCode.GetValue() @property def minFloatPrecision(self): @@ -97,11 +80,12 @@ def AddCmdlineArgs(argsParser, altDefaultTimeHelpText='', altFramesHelpText=''): The resulting 'frames' argument will be an iterable of UsdTimeCodes. If no command-line arguments are given, 'frames' will be a list containing - only Usd.TimeCode.EarliestTime(). If '--defaultTime' is given, 'frames' - will be a list containing only Usd.TimeCode.Default(). Otherwise, - '--frames' must be given a FrameSpec (or a comma-separated list of - multiple FrameSpecs), and 'frames' will be a FrameSpecIterator which when - iterated will yield the time codes specified by the FrameSpec(s). + the startTimeCode from the usdStage, using UsdStage::GetStartTimeCode(). + If '--defaultTime' is given, 'frames' will be a list containing only + Usd.TimeCode.Default(). Otherwise, '--frames' must be given a FrameSpec (or + a comma-separated list of multiple FrameSpecs), and 'frames' will be a + FrameSpecIterator which when iterated will yield the time codes specified + by the FrameSpec(s) as floats. """ timeGroup = argsParser.add_mutually_exclusive_group() @@ -109,7 +93,8 @@ def AddCmdlineArgs(argsParser, altDefaultTimeHelpText='', altFramesHelpText=''): if not helpText: helpText = ( 'explicitly operate at the Default time code (the default ' - 'behavior is to operate at the Earliest time code)') + 'behavior is to operate at the startTimeCode authored on the ' + 'UsdStage which defaults to 0.0)') timeGroup.add_argument('--defaultTime', '-d', action='store_true', dest='defaultTime', help=helpText) @@ -205,7 +190,7 @@ def ConvertFramePlaceholderToFloatSpec(frameFormat): return frameFormat.replace(placeholder, floatSpec) -def ValidateCmdlineArgs(argsParser, args, frameFormatArgName=None): +def ValidateCmdlineArgs(argsParser, args, usdStage, frameFormatArgName=None): """ Validates the frame-related arguments in args parsed by argsParser. @@ -262,8 +247,8 @@ def ValidateCmdlineArgs(argsParser, args, frameFormatArgName=None): 'when not operating on a frame range.' % frameFormatArgName) if args.defaultTime: - args.frames = [Usd.TimeCode.Default()] + args.frames = [Usd.TimeCode.Default().GetValue()] else: - args.frames = [Usd.TimeCode.EarliestTime()] + args.frames = [usdStage.GetStartTimeCode()] return args diff --git a/pxr/usdImaging/usdAppUtils/module.cpp b/pxr/usdImaging/usdAppUtils/module.cpp index dfe1d6883f..fd9c9299f7 100644 --- a/pxr/usdImaging/usdAppUtils/module.cpp +++ b/pxr/usdImaging/usdAppUtils/module.cpp @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/base/tf/pyModule.h" diff --git a/pxr/usdImaging/usdAppUtils/moduleDeps.cpp b/pxr/usdImaging/usdAppUtils/moduleDeps.cpp index cd1fe41811..5e237ee76d 100644 --- a/pxr/usdImaging/usdAppUtils/moduleDeps.cpp +++ b/pxr/usdImaging/usdAppUtils/moduleDeps.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/pxr/usdImaging/usdAppUtils/pch.h b/pxr/usdImaging/usdAppUtils/pch.h index 70b9602d5e..f33d34d8b0 100644 --- a/pxr/usdImaging/usdAppUtils/pch.h +++ b/pxr/usdImaging/usdAppUtils/pch.h @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // // WARNING: THIS FILE IS GENERATED. DO NOT EDIT. // @@ -28,9 +11,19 @@ #include "pxr/pxr.h" #include "pxr/base/arch/defines.h" #if defined(ARCH_OS_DARWIN) +#include +#include +#include +#include +#include #include #endif #if defined(ARCH_OS_LINUX) +#include +#include +#include +#include +#include #include #endif #if defined(ARCH_OS_WINDOWS) @@ -40,11 +33,12 @@ #include #include -#include -#include -#include +#include +#include #endif #include +#include +#include #include #include #include @@ -57,6 +51,7 @@ #include #include #include +#include #include #include #include @@ -70,69 +65,28 @@ #include #include #include +#include +#include +#include #include #include #include #include #include +#include #include +#include #include #include +#include #include #include #include #include #include #include +#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #ifdef PXR_PYTHON_SUPPORT_ENABLED #include #include @@ -151,30 +105,9 @@ #undef toupper #endif #endif // PXR_PYTHON_SUPPORT_ENABLED -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include #include +#include #include #include #include @@ -182,7 +115,7 @@ #include #include #include -#include +#include #ifdef PXR_PYTHON_SUPPORT_ENABLED #include "pxr/base/tf/pySafePython.h" #endif // PXR_PYTHON_SUPPORT_ENABLED diff --git a/pxr/usdImaging/usdAppUtils/rendererArgs.py b/pxr/usdImaging/usdAppUtils/rendererArgs.py index 453fab532d..5d2ed960db 100644 --- a/pxr/usdImaging/usdAppUtils/rendererArgs.py +++ b/pxr/usdImaging/usdAppUtils/rendererArgs.py @@ -1,25 +1,8 @@ # # Copyright 2019 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # def GetAllPluginArguments(): diff --git a/pxr/usdImaging/usdAppUtils/testenv/CmdlineArgsTest/noTimeCode.usda b/pxr/usdImaging/usdAppUtils/testenv/CmdlineArgsTest/noTimeCode.usda new file mode 100644 index 0000000000..bcbddd6a87 --- /dev/null +++ b/pxr/usdImaging/usdAppUtils/testenv/CmdlineArgsTest/noTimeCode.usda @@ -0,0 +1,5 @@ +#usda 1.0 + +def Sphere "Sphere" +{ +} \ No newline at end of file diff --git a/pxr/usdImaging/usdAppUtils/testenv/CmdlineArgsTest/startTimeCode.usda b/pxr/usdImaging/usdAppUtils/testenv/CmdlineArgsTest/startTimeCode.usda new file mode 100644 index 0000000000..85f5318f82 --- /dev/null +++ b/pxr/usdImaging/usdAppUtils/testenv/CmdlineArgsTest/startTimeCode.usda @@ -0,0 +1,8 @@ +#usda 1.0 +( + startTimeCode = 5.0 +) + +def Sphere "Sphere" +{ +} \ No newline at end of file diff --git a/pxr/usdImaging/usdAppUtils/testenv/testUsdAppUtilsCamera.py b/pxr/usdImaging/usdAppUtils/testenv/testUsdAppUtilsCamera.py index 4b095ce9bf..e9a1560540 100644 --- a/pxr/usdImaging/usdAppUtils/testenv/testUsdAppUtilsCamera.py +++ b/pxr/usdImaging/usdAppUtils/testenv/testUsdAppUtilsCamera.py @@ -2,25 +2,8 @@ # # Copyright 2019 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from pxr import Sdf from pxr import Tf diff --git a/pxr/usdImaging/usdAppUtils/testenv/testUsdAppUtilsCmdlineArgs.py b/pxr/usdImaging/usdAppUtils/testenv/testUsdAppUtilsCmdlineArgs.py index c9fe5610c4..d386535a8b 100644 --- a/pxr/usdImaging/usdAppUtils/testenv/testUsdAppUtilsCmdlineArgs.py +++ b/pxr/usdImaging/usdAppUtils/testenv/testUsdAppUtilsCmdlineArgs.py @@ -2,25 +2,8 @@ # # Copyright 2019 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from pxr import Sdf from pxr import Usd @@ -45,6 +28,8 @@ class TestUsdAppUtilsCmdlineArgs(unittest.TestCase): @classmethod def setUpClass(cls): cls._progName = os.path.basename(sys.argv[0]) + cls._noTimeCodeStage = Usd.Stage.Open(os.path.abspath('noTimeCode.usda')) + cls._startTimeCodeStage = Usd.Stage.Open(os.path.abspath('startTimeCode.usda')) def setUp(self): self._parser = argparse.ArgumentParser(prog=self._progName) @@ -151,19 +136,28 @@ def testFramesCmdlineArgs(self): UsdAppUtils.framesArgs.AddCmdlineArgs(self._parser) args = self._parser.parse_args([]) - UsdAppUtils.framesArgs.ValidateCmdlineArgs(self._parser, args) - self.assertEqual(args.frames, [Usd.TimeCode.EarliestTime()]) + UsdAppUtils.framesArgs.ValidateCmdlineArgs( + self._parser, args, self._noTimeCodeStage) + self.assertEqual(args.frames, [0.0]) + + args = self._parser.parse_args([]) + UsdAppUtils.framesArgs.ValidateCmdlineArgs( + self._parser, args, self._startTimeCodeStage) + self.assertEqual(args.frames, [5.0]) args = self._parser.parse_args(['--defaultTime']) - UsdAppUtils.framesArgs.ValidateCmdlineArgs(self._parser, args) + UsdAppUtils.framesArgs.ValidateCmdlineArgs( + self._parser, args, self._noTimeCodeStage) self.assertEqual(args.frames, [Usd.TimeCode.Default()]) args = self._parser.parse_args(['--d']) - UsdAppUtils.framesArgs.ValidateCmdlineArgs(self._parser, args) + UsdAppUtils.framesArgs.ValidateCmdlineArgs( + self._parser, args, self._noTimeCodeStage) self.assertEqual(args.frames, [Usd.TimeCode.Default()]) args = self._parser.parse_args(['--frames', '1:4']) - UsdAppUtils.framesArgs.ValidateCmdlineArgs(self._parser, args) + UsdAppUtils.framesArgs.ValidateCmdlineArgs( + self._parser, args, self._noTimeCodeStage) self.assertEqual(type(args.frames), UsdAppUtils.framesArgs.FrameSpecIterator) self.assertEqual(list(args.frames), @@ -173,7 +167,8 @@ def testFramesCmdlineArgs(self): Usd.TimeCode(4.0)]) args = self._parser.parse_args(['-f', '11,13:15x2,17']) - UsdAppUtils.framesArgs.ValidateCmdlineArgs(self._parser, args) + UsdAppUtils.framesArgs.ValidateCmdlineArgs( + self._parser, args, self._noTimeCodeStage) self.assertEqual(type(args.frames), UsdAppUtils.framesArgs.FrameSpecIterator) self.assertEqual(list(args.frames), @@ -189,13 +184,13 @@ def testFramesCmdlineArgs(self): parser.add_argument('outputImagePath', action='store', type=str, help='output image path') args = parser.parse_args(['test_image.#.png', '--frames', '1:4']) - UsdAppUtils.framesArgs.ValidateCmdlineArgs(parser, args, - frameFormatArgName='outputImagePath') + UsdAppUtils.framesArgs.ValidateCmdlineArgs(parser, args, + self._noTimeCodeStage, frameFormatArgName='outputImagePath') self.assertEqual(args.outputImagePath, 'test_image.{frame:01.0f}.png') args = parser.parse_args(['test_image.###.#.png', '--frames', '1:4']) - UsdAppUtils.framesArgs.ValidateCmdlineArgs(parser, args, - frameFormatArgName='outputImagePath') + UsdAppUtils.framesArgs.ValidateCmdlineArgs(parser, args, + self._noTimeCodeStage, frameFormatArgName='outputImagePath') self.assertEqual(args.outputImagePath, 'test_image.{frame:05.1f}.png') # Test that an error is raised if the frame format arg does not contain @@ -207,7 +202,7 @@ def testFramesCmdlineArgs(self): args = parser.parse_args(['test_image.png', '--frames', '1:4']) with self.assertRaises(ValueError): UsdAppUtils.framesArgs.ValidateCmdlineArgs(parser, args, - frameFormatArgName='outputImagePath') + self._noTimeCodeStage, frameFormatArgName='outputImagePath') # Test that an error is raised if the frame format arg does contain # a frame placeholder but no frames are given. @@ -218,12 +213,12 @@ def testFramesCmdlineArgs(self): args = parser.parse_args(['test_image.#.png']) with self.assertRaises(ValueError): UsdAppUtils.framesArgs.ValidateCmdlineArgs(parser, args, - frameFormatArgName='outputImagePath') + self._noTimeCodeStage, frameFormatArgName='outputImagePath') args = parser.parse_args(['test_image.#.png', '--defaultTime']) with self.assertRaises(ValueError): UsdAppUtils.framesArgs.ValidateCmdlineArgs(parser, args, - frameFormatArgName='outputImagePath') + self._noTimeCodeStage, frameFormatArgName='outputImagePath') # Tests that an error is raised if the floating point precision # specified in the frame format arg is less than the minimum floating @@ -235,12 +230,12 @@ def testFramesCmdlineArgs(self): args = parser.parse_args(['test_image.#.png', '--frames', '1:4x0.1']) with self.assertRaises(ValueError): UsdAppUtils.framesArgs.ValidateCmdlineArgs(parser, args, - frameFormatArgName='outputImagePath') + self._noTimeCodeStage, frameFormatArgName='outputImagePath') args = parser.parse_args(['test_image.#.##.png', '--frames', '101:105x0.1,106:109x0.125,110:114x0.25']) with self.assertRaises(ValueError): UsdAppUtils.framesArgs.ValidateCmdlineArgs(parser, args, - frameFormatArgName='outputImagePath') + self._noTimeCodeStage, frameFormatArgName='outputImagePath') def testRendererCmdlineArgs(self): """ diff --git a/pxr/usdImaging/usdAppUtils/testenv/testUsdAppUtilsComplexity.py b/pxr/usdImaging/usdAppUtils/testenv/testUsdAppUtilsComplexity.py index ad821fd1d0..7e47b6a665 100644 --- a/pxr/usdImaging/usdAppUtils/testenv/testUsdAppUtilsComplexity.py +++ b/pxr/usdImaging/usdAppUtils/testenv/testUsdAppUtilsComplexity.py @@ -2,25 +2,8 @@ # # Copyright 2019 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from pxr.UsdAppUtils import complexityArgs diff --git a/pxr/usdImaging/usdAppUtils/testenv/testUsdAppUtilsFrameRecorder.py b/pxr/usdImaging/usdAppUtils/testenv/testUsdAppUtilsFrameRecorder.py index 4ad5f8fc31..665fef8e7a 100644 --- a/pxr/usdImaging/usdAppUtils/testenv/testUsdAppUtilsFrameRecorder.py +++ b/pxr/usdImaging/usdAppUtils/testenv/testUsdAppUtilsFrameRecorder.py @@ -2,25 +2,8 @@ # # Copyright 2019 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. from pxr import Usd from pxr import UsdAppUtils @@ -96,7 +79,7 @@ def testRecordSingleFrame(self): outputImagePath = os.path.abspath('AnimCube.png') self.assertTrue( self._frameRecorder.Record(self._stage, self._usdCamera, - Usd.TimeCode.EarliestTime(), outputImagePath)) + self._stage.GetStartTimeCode(), outputImagePath)) def testRecordMultipleFrames(self): """ @@ -110,7 +93,7 @@ def testRecordMultipleFrames(self): for timeCode in frameSpecIter: self.assertTrue( self._frameRecorder.Record(self._stage, self._usdCamera, - timeCode, outputImagePath.format(frame=timeCode.GetValue()))) + timeCode, outputImagePath.format(frame=timeCode))) if __name__ == "__main__": diff --git a/pxr/usdImaging/usdAppUtils/wrapCamera.cpp b/pxr/usdImaging/usdAppUtils/wrapCamera.cpp index 9268c7ac62..76350f55e8 100644 --- a/pxr/usdImaging/usdAppUtils/wrapCamera.cpp +++ b/pxr/usdImaging/usdAppUtils/wrapCamera.cpp @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usdImaging/usdAppUtils/camera.h" diff --git a/pxr/usdImaging/usdAppUtils/wrapFrameRecorder.cpp b/pxr/usdImaging/usdAppUtils/wrapFrameRecorder.cpp index 7e854ea9ac..7d859c89f1 100644 --- a/pxr/usdImaging/usdAppUtils/wrapFrameRecorder.cpp +++ b/pxr/usdImaging/usdAppUtils/wrapFrameRecorder.cpp @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usdImaging/usdAppUtils/frameRecorder.h" @@ -42,14 +25,18 @@ wrapFrameRecorder() scope s = class_("FrameRecorder") .def(init<>()) - .def(init( + .def(init( (arg("rendererPluginId") = TfToken(), - arg("gpuEnabled") = true, - arg("renderSettingsPrimPath") = SdfPath()))) + arg("gpuEnabled") = true))) .def("GetCurrentRendererId", &This::GetCurrentRendererId) + .def("SetActiveRenderPassPrimPath", + &This::SetActiveRenderPassPrimPath) + .def("SetActiveRenderSettingsPrimPath", + &This::SetActiveRenderSettingsPrimPath) .def("SetRendererPlugin", &This::SetRendererPlugin) .def("SetImageWidth", &This::SetImageWidth) .def("SetCameraLightEnabled", &This::SetCameraLightEnabled) + .def("SetDomeLightVisibility", &This::SetDomeLightVisibility) .def("SetComplexity", &This::SetComplexity) .def("SetColorCorrectionMode", &This::SetColorCorrectionMode) .def("SetIncludedPurposes", &This::SetIncludedPurposes, diff --git a/pxr/usdImaging/usdImaging/CMakeLists.txt b/pxr/usdImaging/usdImaging/CMakeLists.txt index 55d4e146b4..e26a07a6e5 100644 --- a/pxr/usdImaging/usdImaging/CMakeLists.txt +++ b/pxr/usdImaging/usdImaging/CMakeLists.txt @@ -39,6 +39,7 @@ pxr_library(usdImaging dataSourceBasisCurves dataSourceCamera dataSourceGprim + dataSourceMapped dataSourceMaterial dataSourceMesh dataSourceNurbsCurves @@ -123,6 +124,7 @@ pxr_library(usdImaging usdRenderSettingsSchema usdRenderVarSchema rectLightAdapter + renderPassAdapter renderProductAdapter renderSettingsAdapter renderSettingsFlatteningSceneIndex @@ -146,7 +148,6 @@ pxr_library(usdImaging PUBLIC_HEADERS api.h - dataSourceSchemaBased.h types.h unitTestHelper.h version.h diff --git a/pxr/usdImaging/usdImaging/adapterManager.cpp b/pxr/usdImaging/usdImaging/adapterManager.cpp index c4e91a127e..ea62b1017d 100644 --- a/pxr/usdImaging/usdImaging/adapterManager.cpp +++ b/pxr/usdImaging/usdImaging/adapterManager.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/adapterManager.h" diff --git a/pxr/usdImaging/usdImaging/adapterManager.h b/pxr/usdImaging/usdImaging/adapterManager.h index 74ffd1342d..2d963c0195 100644 --- a/pxr/usdImaging/usdImaging/adapterManager.h +++ b/pxr/usdImaging/usdImaging/adapterManager.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_ADAPTER_MANAGER_H #define PXR_USD_IMAGING_USD_IMAGING_ADAPTER_MANAGER_H diff --git a/pxr/usdImaging/usdImaging/adapterRegistry.cpp b/pxr/usdImaging/usdImaging/adapterRegistry.cpp index 30930cb3d4..46f25d86de 100644 --- a/pxr/usdImaging/usdImaging/adapterRegistry.cpp +++ b/pxr/usdImaging/usdImaging/adapterRegistry.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/adapterRegistry.h" diff --git a/pxr/usdImaging/usdImaging/adapterRegistry.h b/pxr/usdImaging/usdImaging/adapterRegistry.h index 532343af4d..c4c8348fa7 100644 --- a/pxr/usdImaging/usdImaging/adapterRegistry.h +++ b/pxr/usdImaging/usdImaging/adapterRegistry.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_ADAPTER_REGISTRY_H #define PXR_USD_IMAGING_USD_IMAGING_ADAPTER_REGISTRY_H diff --git a/pxr/usdImaging/usdImaging/api.h b/pxr/usdImaging/usdImaging/api.h index a29f567e06..c592a827cb 100644 --- a/pxr/usdImaging/usdImaging/api.h +++ b/pxr/usdImaging/usdImaging/api.h @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_API_H #define PXR_USD_IMAGING_USD_IMAGING_API_H diff --git a/pxr/usdImaging/usdImaging/apiSchemaAdapter.cpp b/pxr/usdImaging/usdImaging/apiSchemaAdapter.cpp index 175958b2cd..5d7e3c75e2 100644 --- a/pxr/usdImaging/usdImaging/apiSchemaAdapter.cpp +++ b/pxr/usdImaging/usdImaging/apiSchemaAdapter.cpp @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/apiSchemaAdapter.h" diff --git a/pxr/usdImaging/usdImaging/apiSchemaAdapter.h b/pxr/usdImaging/usdImaging/apiSchemaAdapter.h index 81ea89314d..24965fcbb4 100644 --- a/pxr/usdImaging/usdImaging/apiSchemaAdapter.h +++ b/pxr/usdImaging/usdImaging/apiSchemaAdapter.h @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_API_SCHEMA_ADAPTER_H #define PXR_USD_IMAGING_USD_IMAGING_API_SCHEMA_ADAPTER_H diff --git a/pxr/usdImaging/usdImaging/basisCurvesAdapter.cpp b/pxr/usdImaging/usdImaging/basisCurvesAdapter.cpp index f98e34b8d6..b6b430fc42 100644 --- a/pxr/usdImaging/usdImaging/basisCurvesAdapter.cpp +++ b/pxr/usdImaging/usdImaging/basisCurvesAdapter.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/basisCurvesAdapter.h" diff --git a/pxr/usdImaging/usdImaging/basisCurvesAdapter.h b/pxr/usdImaging/usdImaging/basisCurvesAdapter.h index e7dafb2fa1..717bb07f12 100644 --- a/pxr/usdImaging/usdImaging/basisCurvesAdapter.h +++ b/pxr/usdImaging/usdImaging/basisCurvesAdapter.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_BASIS_CURVES_ADAPTER_H #define PXR_USD_IMAGING_USD_IMAGING_BASIS_CURVES_ADAPTER_H diff --git a/pxr/usdImaging/usdImaging/cameraAdapter.cpp b/pxr/usdImaging/usdImaging/cameraAdapter.cpp index 939893e4bd..10f96e0026 100644 --- a/pxr/usdImaging/usdImaging/cameraAdapter.cpp +++ b/pxr/usdImaging/usdImaging/cameraAdapter.cpp @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/cameraAdapter.h" diff --git a/pxr/usdImaging/usdImaging/cameraAdapter.h b/pxr/usdImaging/usdImaging/cameraAdapter.h index 0b1a5a46fe..308b9798cc 100644 --- a/pxr/usdImaging/usdImaging/cameraAdapter.h +++ b/pxr/usdImaging/usdImaging/cameraAdapter.h @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_CAMERA_ADAPTER_H #define PXR_USD_IMAGING_USD_IMAGING_CAMERA_ADAPTER_H diff --git a/pxr/usdImaging/usdImaging/capsuleAdapter.cpp b/pxr/usdImaging/usdImaging/capsuleAdapter.cpp index ccd163857c..4e6665cf18 100644 --- a/pxr/usdImaging/usdImaging/capsuleAdapter.cpp +++ b/pxr/usdImaging/usdImaging/capsuleAdapter.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/capsuleAdapter.h" diff --git a/pxr/usdImaging/usdImaging/capsuleAdapter.h b/pxr/usdImaging/usdImaging/capsuleAdapter.h index 5ee30d18f8..58b896e81c 100644 --- a/pxr/usdImaging/usdImaging/capsuleAdapter.h +++ b/pxr/usdImaging/usdImaging/capsuleAdapter.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_CAPSULE_ADAPTER_H #define PXR_USD_IMAGING_USD_IMAGING_CAPSULE_ADAPTER_H diff --git a/pxr/usdImaging/usdImaging/collectionAPIAdapter.cpp b/pxr/usdImaging/usdImaging/collectionAPIAdapter.cpp index b2baeb8a96..594457fd24 100644 --- a/pxr/usdImaging/usdImaging/collectionAPIAdapter.cpp +++ b/pxr/usdImaging/usdImaging/collectionAPIAdapter.cpp @@ -1,45 +1,22 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/collectionAPIAdapter.h" #include "pxr/usdImaging/usdImaging/dataSourceAttribute.h" #include "pxr/usd/usd/collectionAPI.h" +#include "pxr/usd/usd/collectionMembershipQuery.h" + +#include "pxr/imaging/hd/collectionsSchema.h" #include "pxr/imaging/hd/retainedDataSource.h" #include "pxr/base/tf/stringUtils.h" PXR_NAMESPACE_OPEN_SCOPE -TF_DEFINE_PRIVATE_TOKENS( - _tokens, - (usdCollections) - (includes) - (excludes) - (expansionRule) - (includeRoot) -); - TF_REGISTRY_FUNCTION(TfType) { typedef UsdImagingCollectionAPIAdapter Adapter; @@ -57,77 +34,47 @@ class _CollectionContainerDataSource : public HdContainerDataSource public: HD_DECLARE_DATASOURCE(_CollectionContainerDataSource); - _CollectionContainerDataSource(const UsdCollectionAPI &api, - const UsdImagingDataSourceStageGlobals &stageGlobals) + _CollectionContainerDataSource(const UsdCollectionAPI &api) : _api(api) - , _stageGlobals(stageGlobals){ - } + {} TfTokenVector GetNames() override { - TfTokenVector result; - result.reserve(4); - - if (_api.GetExpansionRuleAttr()) { - result.push_back(_tokens->expansionRule); - } - - if (_api.GetIncludeRootAttr()) { - result.push_back(_tokens->includeRoot); - } - - if (_api.GetIncludesRel()) { - result.push_back(_tokens->includes); - } - - if (_api.GetExcludesRel()) { - result.push_back(_tokens->excludes); - } - - return result; + static TfTokenVector names = + { HdCollectionSchemaTokens->membershipExpression }; + return names; } HdDataSourceBaseHandle Get(const TfToken &name) override { - if (name == _tokens->expansionRule) { - if (UsdAttribute attr = _api.GetExpansionRuleAttr()) { - return UsdImagingDataSourceAttributeNew(attr, _stageGlobals); - } - } else if (name == _tokens->includeRoot) { - if (UsdAttribute attr = _api.GetIncludeRootAttr()) { - // not intended to be time-varying so not providing a - // path/locator. - return UsdImagingDataSourceAttributeNew(attr, _stageGlobals); - } - } else if (name == _tokens->includes) { - if (UsdRelationship rel = _api.GetIncludesRel()) { - return _BuildRelationshipDataSource(rel); - } - } else if (name == _tokens->excludes) { - if (UsdRelationship rel = _api.GetExcludesRel()) { - return _BuildRelationshipDataSource(rel); - } + if (name == HdCollectionSchemaTokens->membershipExpression) { + return + HdRetainedTypedSampledDataSource::New( + _ComputePathExpressionFromCollection(_api)); } return nullptr; } private: - - HdDataSourceBaseHandle _BuildRelationshipDataSource( - const UsdRelationship &rel) { - - SdfPathVector targets; - rel.GetForwardedTargets(&targets); - if (targets.empty()) { - return nullptr; + static SdfPathExpression + _ComputePathExpressionFromCollection( + const UsdCollectionAPI &api) + { + // A collection can be either rule-based (includes, excludes, ..) + // or path-expression-based. + // Construct a query object to determine the flavor. + const UsdCollectionMembershipQuery query = api.ComputeMembershipQuery(); + + if (query.UsesPathExpansionRuleMap()) { + const auto &ruleMap = query.GetAsPathExpansionRuleMap(); + return + UsdComputePathExpressionFromCollectionMembershipQueryRuleMap( + ruleMap); } - VtArray targetArray(targets.begin(), targets.end()); - return HdRetainedTypedSampledDataSource>::New( - targetArray); + + return api.ResolveCompleteMembershipExpression(); } - UsdCollectionAPI _api; - const UsdImagingDataSourceStageGlobals &_stageGlobals; }; HD_DECLARE_DATASOURCE_HANDLES(_CollectionContainerDataSource); @@ -141,11 +88,9 @@ class _CollectionsContainerDataSource : public HdContainerDataSource _CollectionsContainerDataSource( const UsdPrim &prim, - const TfToken &name, - const UsdImagingDataSourceStageGlobals &stageGlobals - ) : _api(prim, name) - , _stageGlobals(stageGlobals) { - } + const TfToken &name) + : _api(prim, name) + {} TfTokenVector GetNames() override { return {_api.GetName()}; @@ -153,14 +98,13 @@ class _CollectionsContainerDataSource : public HdContainerDataSource HdDataSourceBaseHandle Get(const TfToken &name) override { if (name == _api.GetName()) { - return _CollectionContainerDataSource::New(_api, _stageGlobals); + return _CollectionContainerDataSource::New(_api); } return nullptr; } private: UsdCollectionAPI _api; - const UsdImagingDataSourceStageGlobals &_stageGlobals; }; HD_DECLARE_DATASOURCE_HANDLES(_CollectionsContainerDataSource); @@ -180,10 +124,11 @@ UsdImagingCollectionAPIAdapter::GetImagingSubprimData( return nullptr; } + // Note: When multiple collections are present, we'll overlay the containers + // and thus aggregate the individual collection's. return HdRetainedContainerDataSource::New( - _tokens->usdCollections, - _CollectionsContainerDataSource::New( - prim, appliedInstanceName, stageGlobals) + HdCollectionsSchemaTokens->collections, + _CollectionsContainerDataSource::New(prim, appliedInstanceName) ); } @@ -205,7 +150,7 @@ UsdImagingCollectionAPIAdapter::InvalidateImagingSubprim( for (const TfToken &propertyName : properties) { if (TfStringStartsWith(propertyName.GetString(), prefix)) { return HdDataSourceLocator( - _tokens->usdCollections, appliedInstanceName); + HdCollectionsSchemaTokens->collections, appliedInstanceName); } } diff --git a/pxr/usdImaging/usdImaging/collectionAPIAdapter.h b/pxr/usdImaging/usdImaging/collectionAPIAdapter.h index 205a6f5657..1b28aea785 100644 --- a/pxr/usdImaging/usdImaging/collectionAPIAdapter.h +++ b/pxr/usdImaging/usdImaging/collectionAPIAdapter.h @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_COLLECTION_API_ADAPTER_H #define PXR_USD_IMAGING_USD_IMAGING_COLLECTION_API_ADAPTER_H diff --git a/pxr/usdImaging/usdImaging/collectionCache.cpp b/pxr/usdImaging/usdImaging/collectionCache.cpp index 0529e2001e..950bbf7478 100644 --- a/pxr/usdImaging/usdImaging/collectionCache.cpp +++ b/pxr/usdImaging/usdImaging/collectionCache.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/collectionCache.h" #include "pxr/usdImaging/usdImaging/debugCodes.h" diff --git a/pxr/usdImaging/usdImaging/collectionCache.h b/pxr/usdImaging/usdImaging/collectionCache.h index b80e256fad..a977470a74 100644 --- a/pxr/usdImaging/usdImaging/collectionCache.h +++ b/pxr/usdImaging/usdImaging/collectionCache.h @@ -1,25 +1,8 @@ // // Copyright 2018 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_COLLECTION_CACHE_H #define PXR_USD_IMAGING_USD_IMAGING_COLLECTION_CACHE_H diff --git a/pxr/usdImaging/usdImaging/collectionMaterialBindingSchema.cpp b/pxr/usdImaging/usdImaging/collectionMaterialBindingSchema.cpp index a6cc062384..a241277c8a 100644 --- a/pxr/usdImaging/usdImaging/collectionMaterialBindingSchema.cpp +++ b/pxr/usdImaging/usdImaging/collectionMaterialBindingSchema.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/pxr/usdImaging/usdImaging/collectionMaterialBindingSchema.h b/pxr/usdImaging/usdImaging/collectionMaterialBindingSchema.h index 0bf42f45f8..cf3c644011 100644 --- a/pxr/usdImaging/usdImaging/collectionMaterialBindingSchema.h +++ b/pxr/usdImaging/usdImaging/collectionMaterialBindingSchema.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/pxr/usdImaging/usdImaging/collectionMaterialBindingsSchema.cpp b/pxr/usdImaging/usdImaging/collectionMaterialBindingsSchema.cpp index d8ddb73dac..103c4a2664 100644 --- a/pxr/usdImaging/usdImaging/collectionMaterialBindingsSchema.cpp +++ b/pxr/usdImaging/usdImaging/collectionMaterialBindingsSchema.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/pxr/usdImaging/usdImaging/collectionMaterialBindingsSchema.h b/pxr/usdImaging/usdImaging/collectionMaterialBindingsSchema.h index 8c55a15cfc..7844bcb7ce 100644 --- a/pxr/usdImaging/usdImaging/collectionMaterialBindingsSchema.h +++ b/pxr/usdImaging/usdImaging/collectionMaterialBindingsSchema.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/pxr/usdImaging/usdImaging/coneAdapter.cpp b/pxr/usdImaging/usdImaging/coneAdapter.cpp index ab63d843e1..8dd8049bb5 100644 --- a/pxr/usdImaging/usdImaging/coneAdapter.cpp +++ b/pxr/usdImaging/usdImaging/coneAdapter.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/coneAdapter.h" diff --git a/pxr/usdImaging/usdImaging/coneAdapter.h b/pxr/usdImaging/usdImaging/coneAdapter.h index 3cd000ebbf..2e1ebf9be6 100644 --- a/pxr/usdImaging/usdImaging/coneAdapter.h +++ b/pxr/usdImaging/usdImaging/coneAdapter.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_CONE_ADAPTER_H #define PXR_USD_IMAGING_USD_IMAGING_CONE_ADAPTER_H diff --git a/pxr/usdImaging/usdImaging/coordSysAPIAdapter.cpp b/pxr/usdImaging/usdImaging/coordSysAPIAdapter.cpp index 2341ca01b0..c47f9ec3d5 100644 --- a/pxr/usdImaging/usdImaging/coordSysAPIAdapter.cpp +++ b/pxr/usdImaging/usdImaging/coordSysAPIAdapter.cpp @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/coordSysAPIAdapter.h" diff --git a/pxr/usdImaging/usdImaging/coordSysAPIAdapter.h b/pxr/usdImaging/usdImaging/coordSysAPIAdapter.h index 6d65916e12..076de54208 100644 --- a/pxr/usdImaging/usdImaging/coordSysAPIAdapter.h +++ b/pxr/usdImaging/usdImaging/coordSysAPIAdapter.h @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_COORD_SYS_API_ADAPTER_H #define PXR_USD_IMAGING_USD_IMAGING_COORD_SYS_API_ADAPTER_H diff --git a/pxr/usdImaging/usdImaging/coordSysAdapter.cpp b/pxr/usdImaging/usdImaging/coordSysAdapter.cpp index d8768a3db0..f7ff1c8f1f 100644 --- a/pxr/usdImaging/usdImaging/coordSysAdapter.cpp +++ b/pxr/usdImaging/usdImaging/coordSysAdapter.cpp @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/coordSysAdapter.h" #include "pxr/usdImaging/usdImaging/delegate.h" diff --git a/pxr/usdImaging/usdImaging/coordSysAdapter.h b/pxr/usdImaging/usdImaging/coordSysAdapter.h index 24d80fc249..f25ced75d1 100644 --- a/pxr/usdImaging/usdImaging/coordSysAdapter.h +++ b/pxr/usdImaging/usdImaging/coordSysAdapter.h @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_COORD_SYS_ADAPTER_H #define PXR_USD_IMAGING_USD_IMAGING_COORD_SYS_ADAPTER_H diff --git a/pxr/usdImaging/usdImaging/cubeAdapter.cpp b/pxr/usdImaging/usdImaging/cubeAdapter.cpp index 1959447aba..5bf73630a3 100644 --- a/pxr/usdImaging/usdImaging/cubeAdapter.cpp +++ b/pxr/usdImaging/usdImaging/cubeAdapter.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/cubeAdapter.h" diff --git a/pxr/usdImaging/usdImaging/cubeAdapter.h b/pxr/usdImaging/usdImaging/cubeAdapter.h index 3fee9dfca3..514768a9b7 100644 --- a/pxr/usdImaging/usdImaging/cubeAdapter.h +++ b/pxr/usdImaging/usdImaging/cubeAdapter.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_CUBE_ADAPTER_H #define PXR_USD_IMAGING_USD_IMAGING_CUBE_ADAPTER_H diff --git a/pxr/usdImaging/usdImaging/cylinderAdapter.cpp b/pxr/usdImaging/usdImaging/cylinderAdapter.cpp index 24ef710143..31579c6ec0 100644 --- a/pxr/usdImaging/usdImaging/cylinderAdapter.cpp +++ b/pxr/usdImaging/usdImaging/cylinderAdapter.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/cylinderAdapter.h" diff --git a/pxr/usdImaging/usdImaging/cylinderAdapter.h b/pxr/usdImaging/usdImaging/cylinderAdapter.h index 60ae4f1235..22f77817cb 100644 --- a/pxr/usdImaging/usdImaging/cylinderAdapter.h +++ b/pxr/usdImaging/usdImaging/cylinderAdapter.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_CYLINDER_ADAPTER_H #define PXR_USD_IMAGING_USD_IMAGING_CYLINDER_ADAPTER_H diff --git a/pxr/usdImaging/usdImaging/cylinderLightAdapter.cpp b/pxr/usdImaging/usdImaging/cylinderLightAdapter.cpp index 6de4fa5983..2c6b364eda 100644 --- a/pxr/usdImaging/usdImaging/cylinderLightAdapter.cpp +++ b/pxr/usdImaging/usdImaging/cylinderLightAdapter.cpp @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/cylinderLightAdapter.h" #include "pxr/usdImaging/usdImaging/delegate.h" @@ -42,6 +25,24 @@ UsdImagingCylinderLightAdapter::~UsdImagingCylinderLightAdapter() { } +TfTokenVector +UsdImagingCylinderLightAdapter::GetImagingSubprims(UsdPrim const& prim) +{ + return { TfToken() }; +} + +TfToken +UsdImagingCylinderLightAdapter::GetImagingSubprimType( + UsdPrim const& prim, + TfToken const& subprim) +{ + if (subprim.IsEmpty()) { + return HdPrimTypeTokens->cylinderLight; + } + + return TfToken(); +} + bool UsdImagingCylinderLightAdapter::IsSupported(UsdImagingIndexProxy const* index) const { diff --git a/pxr/usdImaging/usdImaging/cylinderLightAdapter.h b/pxr/usdImaging/usdImaging/cylinderLightAdapter.h index a74e0897f2..74dbda5852 100644 --- a/pxr/usdImaging/usdImaging/cylinderLightAdapter.h +++ b/pxr/usdImaging/usdImaging/cylinderLightAdapter.h @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_CYLINDER_LIGHT_ADAPTER_H #define PXR_USD_IMAGING_USD_IMAGING_CYLINDER_LIGHT_ADAPTER_H @@ -50,6 +33,19 @@ class UsdImagingCylinderLightAdapter : public UsdImagingLightAdapter { USDIMAGING_API virtual ~UsdImagingCylinderLightAdapter(); + // ---------------------------------------------------------------------- // + /// \name Scene Index Support + // ---------------------------------------------------------------------- // + + USDIMAGING_API + TfTokenVector GetImagingSubprims(UsdPrim const& prim) override; + + USDIMAGING_API + TfToken GetImagingSubprimType(UsdPrim const& prim, TfToken const& subprim) + override; + + // ---------------------------------------------------------------------- // + USDIMAGING_API virtual SdfPath Populate(UsdPrim const& prim, UsdImagingIndexProxy* index, diff --git a/pxr/usdImaging/usdImaging/dataSourceAttribute.cpp b/pxr/usdImaging/usdImaging/dataSourceAttribute.cpp index e522972fc1..c76768566b 100644 --- a/pxr/usdImaging/usdImaging/dataSourceAttribute.cpp +++ b/pxr/usdImaging/usdImaging/dataSourceAttribute.cpp @@ -1,25 +1,8 @@ // // Copyright 2020 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/dataSourceAttribute.h" diff --git a/pxr/usdImaging/usdImaging/dataSourceAttribute.h b/pxr/usdImaging/usdImaging/dataSourceAttribute.h index 91eb6f1be5..112ae89819 100644 --- a/pxr/usdImaging/usdImaging/dataSourceAttribute.h +++ b/pxr/usdImaging/usdImaging/dataSourceAttribute.h @@ -1,25 +1,8 @@ // // Copyright 2020 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_DATA_SOURCE_ATTRIBUTE_H #define PXR_USD_IMAGING_USD_IMAGING_DATA_SOURCE_ATTRIBUTE_H @@ -31,6 +14,8 @@ #include "pxr/imaging/hd/dataSource.h" #include "pxr/imaging/hd/dataSourceTypeDefs.h" +#include + PXR_NAMESPACE_OPEN_SCOPE /// \class UsdImagingDataSourceAttribute @@ -83,14 +68,32 @@ class UsdImagingDataSourceAttribute : public HdTypedSampledDataSource time.GetValue() + startTime, time.GetValue() + endTime); std::vector timeSamples; + + // Start with the times that fall within the interval _usdAttrQuery.GetTimeSamplesInInterval(interval, &timeSamples); - - // Add boundary timesamples, if necessary. - if (timeSamples.empty() || timeSamples[0] > interval.GetMin()) { - timeSamples.insert(timeSamples.begin(), interval.GetMin()); + // Add bracketing sample times for the leading and trailing edges of the + // interval. + double first, ignore, last; + bool hasFirst, hasLast; + // If hasFirst/hasLast comes back false for an edge, or if both the left and + // right bracketing times for the edge are the same, it means there's no + // bracketing sample time anywhere beyond that edge, so we fall back to the + // interval's edge. + _usdAttrQuery.GetBracketingTimeSamples(interval.GetMin(), &first, &ignore, &hasFirst); + if (!hasFirst || first == ignore) { + first = interval.GetMin(); + } + _usdAttrQuery.GetBracketingTimeSamples(interval.GetMax(), &ignore, &last, &hasLast); + if (!hasLast || last == ignore ) { + last = interval.GetMax(); + } + // Add the bracketing sample times only if they actually fall outside the + // interval. This maintains ordering and uniqueness. + if (timeSamples.empty() || first < timeSamples.front()) { + timeSamples.insert(timeSamples.begin(), first); } - if (timeSamples.back() < interval.GetMax()) { - timeSamples.push_back(interval.GetMax()); + if (last > timeSamples.back()) { + timeSamples.insert(timeSamples.end(), last); } // We need to convert the time array because usd uses double and @@ -100,7 +103,7 @@ class UsdImagingDataSourceAttribute : public HdTypedSampledDataSource (*outSampleTimes)[i] = timeSamples[i] - time.GetValue(); } - return true; + return outSampleTimes->size() > 1; } private: diff --git a/pxr/usdImaging/usdImaging/dataSourceAttributeColorSpace.cpp b/pxr/usdImaging/usdImaging/dataSourceAttributeColorSpace.cpp index 6ca2ba454d..df6862a78e 100644 --- a/pxr/usdImaging/usdImaging/dataSourceAttributeColorSpace.cpp +++ b/pxr/usdImaging/usdImaging/dataSourceAttributeColorSpace.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/dataSourceAttributeColorSpace.h" diff --git a/pxr/usdImaging/usdImaging/dataSourceAttributeColorSpace.h b/pxr/usdImaging/usdImaging/dataSourceAttributeColorSpace.h index 6f5a4c6e29..404c1b669b 100644 --- a/pxr/usdImaging/usdImaging/dataSourceAttributeColorSpace.h +++ b/pxr/usdImaging/usdImaging/dataSourceAttributeColorSpace.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_DATA_SOURCE_ATTRIBUTE_COLORSPACE_H #define PXR_USD_IMAGING_USD_IMAGING_DATA_SOURCE_ATTRIBUTE_COLORSPACE_H diff --git a/pxr/usdImaging/usdImaging/dataSourceBasisCurves.cpp b/pxr/usdImaging/usdImaging/dataSourceBasisCurves.cpp index 1e5263ddb3..13437a6165 100644 --- a/pxr/usdImaging/usdImaging/dataSourceBasisCurves.cpp +++ b/pxr/usdImaging/usdImaging/dataSourceBasisCurves.cpp @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/dataSourceBasisCurves.h" #include "pxr/usdImaging/usdImaging/dataSourcePrimvars.h" diff --git a/pxr/usdImaging/usdImaging/dataSourceBasisCurves.h b/pxr/usdImaging/usdImaging/dataSourceBasisCurves.h index e1197368b1..36a09fcd23 100644 --- a/pxr/usdImaging/usdImaging/dataSourceBasisCurves.h +++ b/pxr/usdImaging/usdImaging/dataSourceBasisCurves.h @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_DATA_SOURCE_BASISCURVES_H #define PXR_USD_IMAGING_USD_IMAGING_DATA_SOURCE_BASISCURVES_H diff --git a/pxr/usdImaging/usdImaging/dataSourceCamera.cpp b/pxr/usdImaging/usdImaging/dataSourceCamera.cpp index 5ae96824dd..0f96d88448 100644 --- a/pxr/usdImaging/usdImaging/dataSourceCamera.cpp +++ b/pxr/usdImaging/usdImaging/dataSourceCamera.cpp @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/dataSourceCamera.h" #include "pxr/usdImaging/usdImaging/dataSourceAttribute.h" diff --git a/pxr/usdImaging/usdImaging/dataSourceCamera.h b/pxr/usdImaging/usdImaging/dataSourceCamera.h index 450be4ad14..6b2e5938f0 100644 --- a/pxr/usdImaging/usdImaging/dataSourceCamera.h +++ b/pxr/usdImaging/usdImaging/dataSourceCamera.h @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_DATA_SOURCE_CAMERA_H diff --git a/pxr/usdImaging/usdImaging/dataSourceGprim.cpp b/pxr/usdImaging/usdImaging/dataSourceGprim.cpp index 281d85e5a1..6742c6af18 100644 --- a/pxr/usdImaging/usdImaging/dataSourceGprim.cpp +++ b/pxr/usdImaging/usdImaging/dataSourceGprim.cpp @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/dataSourceGprim.h" diff --git a/pxr/usdImaging/usdImaging/dataSourceGprim.h b/pxr/usdImaging/usdImaging/dataSourceGprim.h index 0731b4daee..9d2ede6a00 100644 --- a/pxr/usdImaging/usdImaging/dataSourceGprim.h +++ b/pxr/usdImaging/usdImaging/dataSourceGprim.h @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_DATA_SOURCE_GPRIM_H #define PXR_USD_IMAGING_USD_IMAGING_DATA_SOURCE_GPRIM_H diff --git a/pxr/usdImaging/usdImaging/dataSourceImplicits-Impl.h b/pxr/usdImaging/usdImaging/dataSourceImplicits-Impl.h index 325610e73c..f15307a59f 100644 --- a/pxr/usdImaging/usdImaging/dataSourceImplicits-Impl.h +++ b/pxr/usdImaging/usdImaging/dataSourceImplicits-Impl.h @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_DATA_SOURCE_IMPLICITS_IMPL_H @@ -27,33 +10,10 @@ #include "pxr/usdImaging/usdImaging/dataSourceGprim.h" #include "pxr/usdImaging/usdImaging/dataSourceStageGlobals.h" -#include "pxr/usdImaging/usdImaging/dataSourceSchemaBased.h" +#include "pxr/usdImaging/usdImaging/dataSourceMapped.h" PXR_NAMESPACE_OPEN_SCOPE -template -struct UsdImagingImplicitsSchemaTranslator -{ - static - TfToken - UsdAttributeNameToHdName(const TfToken &name) - { - // Skip extent since this is already dealt with - // in UsdImagingDataSourcePrim::Get. - if (name == UsdGeomTokens->extent) { - return TfToken(); - } - return name; - } - - static - HdDataSourceLocator - GetContainerLocator() - { - return HdSchemaType::GetDefaultLocator(); - } -}; - /// \class UsdImagingDataSourceImplicitsPrim /// /// A prim data source for a cube, ... @@ -69,16 +29,17 @@ class UsdImagingDataSourceImplicitsPrim : public UsdImagingDataSourceGprim TfTokenVector GetNames() override { TfTokenVector result = UsdImagingDataSourceGprim::GetNames(); - result.push_back(_GetLocatorToken()); + result.push_back(HdSchemaType::GetSchemaToken()); return result; } HdDataSourceBaseHandle Get(const TfToken &name) override { - if (name == _GetLocatorToken()) { + if (name == HdSchemaType::GetSchemaToken()) { return - _DataSource::New( + UsdImagingDataSourceMapped::New( + _GetUsdPrim(), _GetSceneIndexPath(), - UsdSchemaType(_GetUsdPrim()), + _GetMappings(), _GetStageGlobals()); } @@ -92,8 +53,8 @@ class UsdImagingDataSourceImplicitsPrim : public UsdImagingDataSourceGprim const TfTokenVector &properties, const UsdImagingPropertyInvalidationType invalidationType) { HdDataSourceLocatorSet locators = - _DataSource::Invalidate( - subprim, properties); + UsdImagingDataSourceMapped::Invalidate( + properties, _GetMappings()); locators.insert( UsdImagingDataSourceGprim::Invalidate( @@ -103,11 +64,31 @@ class UsdImagingDataSourceImplicitsPrim : public UsdImagingDataSourceGprim } private: - using _DataSource = - UsdImagingDataSourceSchemaBased< - UsdSchemaType, - /* UsdSchemaBaseTypes = */ std::tuple<>, - UsdImagingImplicitsSchemaTranslator>; + static + std::vector + _GetAttributeMappings() { + std::vector result; + + for (const TfToken &usdName : + UsdSchemaType::GetSchemaAttributeNames( + /* includeInherited = */ false)) { + if (usdName == UsdGeomTokens->extent) { + // Skip extent since this is already dealt with + // in UsdImagingDataSourcePrim::Get. + continue; + } + result.push_back({ usdName, HdDataSourceLocator(usdName)}); + } + return result; + } + + static + const UsdImagingDataSourceMapped::AttributeMappings & + _GetMappings() { + static const UsdImagingDataSourceMapped::AttributeMappings result( + _GetAttributeMappings(), HdSchemaType::GetDefaultLocator()); + return result; + } // Private constructor, use static New() instead. UsdImagingDataSourceImplicitsPrim( @@ -117,25 +98,6 @@ class UsdImagingDataSourceImplicitsPrim : public UsdImagingDataSourceGprim : UsdImagingDataSourceGprim(sceneIndexPath, usdPrim, stageGlobals) { } - - static - TfToken - _GetLocatorTokenUncached() { - const HdDataSourceLocator locator = - HdSchemaType::GetDefaultLocator(); - if (locator.GetElementCount() != 1) { - TF_CODING_ERROR("Expected data source locator with one element."); - return TfToken(); - } - return locator.GetFirstElement(); - } - - static - const TfToken & - _GetLocatorToken() { - static const TfToken result = _GetLocatorTokenUncached(); - return result; - } }; PXR_NAMESPACE_CLOSE_SCOPE diff --git a/pxr/usdImaging/usdImaging/dataSourceMapped.cpp b/pxr/usdImaging/usdImaging/dataSourceMapped.cpp new file mode 100644 index 0000000000..e0c48651ba --- /dev/null +++ b/pxr/usdImaging/usdImaging/dataSourceMapped.cpp @@ -0,0 +1,235 @@ +// +// Copyright 2024 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// + +#include "pxr/usdImaging/usdImaging/dataSourceMapped.h" + +#include + +PXR_NAMESPACE_OPEN_SCOPE + +namespace UsdImagingDataSourceMapped_Impl +{ + +// For a given location within UsdImagingDataSourceMapped, +// information what data source to create. +// +// Such a data source is either an HdSampledDataSource giving +// the value of an Usd attribute. Or a container data source. +using _DataSourceInfo = + std::variant; + +// Data for a container data source. +struct _ContainerMappings +{ + // Names within the container data source - sorted lexicographically. + TfTokenVector hdNames; + // What data source should be returned for the above name. + // This vector runs in parallel with hdNames. + // + // _DataSourceInfo can store another _ContainerMappings so this + // data structure is a tree mirroring the tree of given data source + // locators. + std::vector<_DataSourceInfo> dataSourceInfos; +}; + +} + +using namespace UsdImagingDataSourceMapped_Impl; + +UsdImagingDataSourceMapped::UsdImagingDataSourceMapped( + UsdPrim const &usdPrim, + const SdfPath &sceneIndexPath, + const AttributeMappings &mappings, + const UsdImagingDataSourceStageGlobals &stageGlobals) + : UsdImagingDataSourceMapped( + usdPrim, + sceneIndexPath, + mappings._containerMappings, + stageGlobals) +{ +} + +UsdImagingDataSourceMapped::UsdImagingDataSourceMapped( + UsdPrim const &usdPrim, + const SdfPath &sceneIndexPath, + const _ContainerMappingsSharedPtr &containerMappings, + const UsdImagingDataSourceStageGlobals &stageGlobals) + : _usdPrim(usdPrim) + , _sceneIndexPath(sceneIndexPath) + , _containerMappings(containerMappings) + , _stageGlobals(stageGlobals) +{ +} + +UsdImagingDataSourceMapped::~UsdImagingDataSourceMapped() = default; + +TfTokenVector +UsdImagingDataSourceMapped::GetNames() +{ + return _containerMappings->hdNames; +} + +HdDataSourceBaseHandle +UsdImagingDataSourceMapped::Get(const TfToken &name) +{ + // Look for name in hdNames. + + const auto itName = std::lower_bound( + _containerMappings->hdNames.begin(), + _containerMappings->hdNames.end(), + name); + + if (!(itName != _containerMappings->hdNames.end() && + *itName == name)) { + return nullptr; + } + + const auto itInfo = + _containerMappings->dataSourceInfos.begin() + + (itName - _containerMappings->hdNames.begin()); + + const _DataSourceInfo &info = *itInfo; + if (auto const mapping = std::get_if(&info)) { + // We create a data source from the UsdAttribute. + UsdAttribute attr = _usdPrim.GetAttribute(mapping->usdName); + if (!attr) { + TF_CODING_ERROR( + "Expected usd attribute '%s' on prim '%s' to serve " + "data source at locator '%s'.", + mapping->usdName.GetText(), + _usdPrim.GetPath().GetText(), + mapping->hdLocator.GetString().c_str()); + return nullptr; + } + return mapping->factory( + attr, _stageGlobals, _sceneIndexPath, mapping->hdLocator); + } else { + // We are in the nested case. + return UsdImagingDataSourceMapped::New( + _usdPrim, + _sceneIndexPath, + std::get<_ContainerMappingsSharedPtr>(info), + _stageGlobals); + } +} + +HdDataSourceLocatorSet +UsdImagingDataSourceMapped::Invalidate( + const TfTokenVector &usdNames, const AttributeMappings &mappings) +{ + HdDataSourceLocatorSet locators; + + for (const TfToken &usdName : usdNames) { + for (const AttributeMapping &mapping : mappings._absoluteMappings) { + if (mapping.usdName == usdName) { + locators.insert(mapping.hdLocator); + } + } + } + + return locators; +} + +// Find or add name as key to given containerMappings - returning the +// _ContainerMappings at that key. +_ContainerMappingsSharedPtr +_FindOrCreateChild(const TfToken &name, + _ContainerMappingsSharedPtr const &containerMappings) +{ + const auto itName = std::lower_bound( + containerMappings->hdNames.begin(), + containerMappings->hdNames.end(), + name); + const auto itInfo = + containerMappings->dataSourceInfos.begin() + + (itName - containerMappings->hdNames.begin()); + + if (itName != containerMappings->hdNames.end() && *itName == name) { + const _DataSourceInfo &info = *itInfo; + auto * const child = std::get_if<_ContainerMappingsSharedPtr>(&info); + if (!child) { + const auto &mapping = + std::get(info); + TF_CODING_ERROR( + "Adding data source locator when there was already an " + "ascendant locator added for a Usd attribute with name '%s'.", + mapping.usdName.GetText()); + return nullptr; + } + return *child; + } + + // Create new item. + _ContainerMappingsSharedPtr child = std::make_shared<_ContainerMappings>(); + + containerMappings->hdNames.insert(itName, name); + containerMappings->dataSourceInfos.insert(itInfo, child); + + return child; +} + +// Add mapping to containerMappins at given locator. +void +_Add(const HdDataSourceLocator &locator, + const UsdImagingDataSourceMapped::AttributeMapping &mapping, + _ContainerMappingsSharedPtr containerMappings) +{ + const size_t n = locator.GetElementCount(); + if (n == 0) { + TF_CODING_ERROR("Expected non-trivial data source locator for " + "attribute %s.", mapping.usdName.GetText()); + return; + } + + // Find or create the nested container data sources. + for (size_t i = 0; i < n - 1; ++i) { + const TfToken &hdName = locator.GetElement(i); + containerMappings = _FindOrCreateChild(hdName, containerMappings); + if (!containerMappings) { + return; + } + } + + const TfToken &name = mapping.hdLocator.GetLastElement(); + + // And add the AttributeMapping as leaf. + const auto itName = std::lower_bound( + containerMappings->hdNames.begin(), + containerMappings->hdNames.end(), + name); + const auto itInfo = + containerMappings->dataSourceInfos.begin() + + (itName - containerMappings->hdNames.begin()); + + containerMappings->hdNames.insert(itName, name); + containerMappings->dataSourceInfos.insert(itInfo, mapping); +} + +UsdImagingDataSourceMapped::AttributeMappings::AttributeMappings( + const std::vector &mappings, + const HdDataSourceLocator &dataSourcePrefix) +{ + _absoluteMappings.reserve(mappings.size()); + _containerMappings = std::make_shared<_ContainerMappings>(); + + for (const AttributeMapping &mapping : mappings) { + // Making locator absolute. + const AttributeMapping absoluteMapping{ + mapping.usdName, + dataSourcePrefix.Append(mapping.hdLocator), + mapping.factory}; + + _absoluteMappings.push_back(absoluteMapping); + + _Add(mapping.hdLocator, absoluteMapping, _containerMappings); + } +} + +UsdImagingDataSourceMapped::AttributeMappings::~AttributeMappings() = default; + +PXR_NAMESPACE_CLOSE_SCOPE diff --git a/pxr/usdImaging/usdImaging/dataSourceMapped.h b/pxr/usdImaging/usdImaging/dataSourceMapped.h new file mode 100644 index 0000000000..49b4a83a37 --- /dev/null +++ b/pxr/usdImaging/usdImaging/dataSourceMapped.h @@ -0,0 +1,159 @@ +// +// Copyright 2024 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// + +#ifndef PXR_USD_IMAGING_USD_IMAGING_DATA_SOURCE_MAPPED_H +#define PXR_USD_IMAGING_USD_IMAGING_DATA_SOURCE_MAPPED_H + +#include "pxr/usdImaging/usdImaging/dataSourceAttribute.h" +#include "pxr/usdImaging/usdImaging/dataSourceStageGlobals.h" + +#include "pxr/imaging/hd/dataSource.h" +#include "pxr/imaging/hd/dataSourceLocator.h" + +PXR_NAMESPACE_OPEN_SCOPE + +namespace UsdImagingDataSourceMapped_Impl +{ +using _ContainerMappingsSharedPtr = std::shared_ptr; +} + +/// \class UsdImagingDataSourceMapped +/// +/// A data source that is a (potentially nested) container for the values of +/// the attributes of a given UsdPrim. +/// +/// That is, this container data source contains `HdSampledDataSource`s giving +/// the value of an attribute, either directly or in a nested fashion by +/// containing container data sources itself. +/// +/// The mapping of attributes to locations in the (nested) container data +/// source can be specified through AttributeMapping. These locations are +/// relative to the UsdImagingDataSourceMapped itself. To compute the correct +/// data source locators for invalidation purposes, the location of the +/// UsdImagingDataSourceMapped needs to be given to AttributeMappings so that +/// absolute locators (that is relative to the prim data source) can be +/// computed. +/// +class UsdImagingDataSourceMapped : public HdContainerDataSource +{ +public: + + HD_DECLARE_DATASOURCE(UsdImagingDataSourceMapped); + + /// Signature of function to compute data source from attribute. + /// + /// This could be generalized to HdDataSourceBaseHandle but we use + /// HdSampledDataSourceHandle as result instead so that we can use + /// the UsdImagingDataSourceAttributeNew function pointer. + /// + using DataSourceAttributeFactory = + HdSampledDataSourceHandle(const UsdAttribute &, + const UsdImagingDataSourceStageGlobals &, + const SdfPath &, + const HdDataSourceLocator &); + using DataSourceAttributeFactoryFn = + std::function; + using DataSourceAttributeFactoryPtr = + DataSourceAttributeFactory *; + + /// Specify how one attribute on given Usd prim maps to data source in + /// this (nested) container data source. + struct AttributeMapping final + { + /// Name of attribute on Usd Prim. + /// + TfToken usdName; + + /// Corresponding location in this data source. + /// + /// Has to be non-empty. If length is greater than one, nested + /// container data sources will be created. + /// + HdDataSourceLocator hdLocator; + + /// Function to compute data source from UsdAttribute. + /// + /// Defaults to the appropriate overload of + /// UsdImagingDataSourceAttributeNew. + /// + /// Clients can implement custom behavior. For example, following + /// the connection of a UsdShadeOutput and return the path of the + /// connected prim. + /// + DataSourceAttributeFactoryFn factory = + DataSourceAttributeFactoryPtr( + UsdImagingDataSourceAttributeNew); + }; + + /// Specify how attributes on given Usd prim maps to data sources in + /// this (nested) container data source. + class AttributeMappings final + { + public: + /// dataSourcePrefix is the location of this + /// UsdImagingDataSourceMapped within a prim data source. + USDIMAGING_API + AttributeMappings( + const std::vector &mappings, + const HdDataSourceLocator &datasourcePrefix); + + USDIMAGING_API + ~AttributeMappings(); + + private: + friend class UsdImagingDataSourceMapped; + + using _ContainerMappingsSharedPtr = + UsdImagingDataSourceMapped_Impl::_ContainerMappingsSharedPtr; + + // Flat list with absolute locators for invalidation. + std::vector _absoluteMappings; + // Nested list to implement HdContainerDataSource::Get. + _ContainerMappingsSharedPtr _containerMappings; + }; + + USDIMAGING_API + TfTokenVector GetNames() override; + + USDIMAGING_API + HdDataSourceBaseHandle Get(const TfToken &name) override; + + USDIMAGING_API + static + HdDataSourceLocatorSet + Invalidate(const TfTokenVector &usdNames, + const AttributeMappings &mappings); + + USDIMAGING_API + ~UsdImagingDataSourceMapped() override; + +private: + using _ContainerMappingsSharedPtr = + UsdImagingDataSourceMapped_Impl::_ContainerMappingsSharedPtr; + + USDIMAGING_API + UsdImagingDataSourceMapped( + UsdPrim const &usdPrim, + const SdfPath &sceneIndexPath, + const AttributeMappings &mappings, + const UsdImagingDataSourceStageGlobals &stageGlobals); + + UsdImagingDataSourceMapped( + UsdPrim const &usdPrim, + const SdfPath &sceneIndexPath, + const _ContainerMappingsSharedPtr &containerMappings, + const UsdImagingDataSourceStageGlobals &stageGlobals); + + UsdPrim _usdPrim; + const SdfPath _sceneIndexPath; + _ContainerMappingsSharedPtr const _containerMappings; + const UsdImagingDataSourceStageGlobals & _stageGlobals; +}; + +PXR_NAMESPACE_CLOSE_SCOPE + +#endif diff --git a/pxr/usdImaging/usdImaging/dataSourceMaterial.cpp b/pxr/usdImaging/usdImaging/dataSourceMaterial.cpp index c8da30e1c1..d3be543b34 100644 --- a/pxr/usdImaging/usdImaging/dataSourceMaterial.cpp +++ b/pxr/usdImaging/usdImaging/dataSourceMaterial.cpp @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/dataSourceMaterial.h" diff --git a/pxr/usdImaging/usdImaging/dataSourceMaterial.h b/pxr/usdImaging/usdImaging/dataSourceMaterial.h index 696a171e80..6d986be99c 100644 --- a/pxr/usdImaging/usdImaging/dataSourceMaterial.h +++ b/pxr/usdImaging/usdImaging/dataSourceMaterial.h @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_DATA_SOURCE_MATERIAL_H #define PXR_USD_IMAGING_USD_IMAGING_DATA_SOURCE_MATERIAL_H diff --git a/pxr/usdImaging/usdImaging/dataSourceMesh.cpp b/pxr/usdImaging/usdImaging/dataSourceMesh.cpp index 7197c35533..7b48d61675 100644 --- a/pxr/usdImaging/usdImaging/dataSourceMesh.cpp +++ b/pxr/usdImaging/usdImaging/dataSourceMesh.cpp @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/dataSourceMesh.h" diff --git a/pxr/usdImaging/usdImaging/dataSourceMesh.h b/pxr/usdImaging/usdImaging/dataSourceMesh.h index de6c08b449..47fc42d3e6 100644 --- a/pxr/usdImaging/usdImaging/dataSourceMesh.h +++ b/pxr/usdImaging/usdImaging/dataSourceMesh.h @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_DATA_SOURCE_MESH_H #define PXR_USD_IMAGING_USD_IMAGING_DATA_SOURCE_MESH_H diff --git a/pxr/usdImaging/usdImaging/dataSourceNurbsCurves.cpp b/pxr/usdImaging/usdImaging/dataSourceNurbsCurves.cpp index 5f0a025822..e84ad9f289 100644 --- a/pxr/usdImaging/usdImaging/dataSourceNurbsCurves.cpp +++ b/pxr/usdImaging/usdImaging/dataSourceNurbsCurves.cpp @@ -1,29 +1,12 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/dataSourceNurbsCurves.h" -#include "pxr/usdImaging/usdImaging/dataSourceSchemaBased.h" +#include "pxr/usdImaging/usdImaging/dataSourceMapped.h" #include "pxr/usd/usdGeom/nurbsCurves.h" @@ -37,38 +20,42 @@ PXR_NAMESPACE_OPEN_SCOPE namespace { -struct _NurbsCurvesTranslator +std::vector +_GetAttributeMappings() { - static - TfToken - UsdAttributeNameToHdName(const TfToken &name) - { - // Suppress widths from UsdGeomCurves (which is a custom - // primvar that UsdImagingDataSourceGprim gives us) and - // pointWeights from UsdGeomNurbsCurves (which is a custom - // primvar we process in the prim source below). - if (name == UsdGeomTokens->widths || - name == UsdGeomTokens->pointWeights) { - return TfToken(); + std::vector result; + + for (const TfToken &usdName : + UsdGeomNurbsCurves::GetSchemaAttributeNames( + /* includeInherited = */ false)) { + if (usdName == UsdGeomTokens->pointWeights) { + // Suppress pointWeights from UsdGeomNurbsCurves (which is a custom + // primvar we process in the prim source below). + continue; } - - return name; + result.push_back({ usdName, HdDataSourceLocator(usdName) }); } - static - HdDataSourceLocator - GetContainerLocator() - { - return HdNurbsCurvesSchema::GetDefaultLocator(); + for (const TfToken &usdName : + UsdGeomCurves::GetSchemaAttributeNames( + /* includeInherited = */ false)) { + if (usdName == UsdGeomTokens->widths) { + // Suppress widths from UsdGeomCurves (which is a custom + // primvar that UsdImagingDataSourceGprim gives us). + continue; + } + result.push_back({ usdName, HdDataSourceLocator(usdName) }); } -}; -// Data source for locator nurbsCurves -// -// Include (non-inherited) attributes of UsdGeomNurbsCurves and -// of UsdGeomCurves (to pick up curveVertexCounts). -using _NurbsCurvesDataSource = UsdImagingDataSourceSchemaBased< - UsdGeomNurbsCurves, std::tuple, _NurbsCurvesTranslator>; + return result; +} + +const UsdImagingDataSourceMapped::AttributeMappings & +_GetMappings() { + static const UsdImagingDataSourceMapped::AttributeMappings result( + _GetAttributeMappings(), HdNurbsCurvesSchema::GetDefaultLocator()); + return result; +} const UsdImagingDataSourceCustomPrimvars::Mappings & _GetCustomPrimvarMappings(const UsdPrim &usdPrim) @@ -107,9 +94,10 @@ UsdImagingDataSourceNurbsCurvesPrim::Get(const TfToken & name) { if (name == HdNurbsCurvesSchema::GetSchemaToken()) { return - _NurbsCurvesDataSource::New( + UsdImagingDataSourceMapped::New( + _GetUsdPrim(), _GetSceneIndexPath(), - UsdGeomNurbsCurves(_GetUsdPrim()), + _GetMappings(), _GetStageGlobals()); } @@ -138,8 +126,8 @@ UsdImagingDataSourceNurbsCurvesPrim::Invalidate( TRACE_FUNCTION(); HdDataSourceLocatorSet locators = - _NurbsCurvesDataSource::Invalidate( - subprim, properties); + UsdImagingDataSourceMapped::Invalidate( + properties, _GetMappings()); locators.insert( UsdImagingDataSourceGprim::Invalidate( diff --git a/pxr/usdImaging/usdImaging/dataSourceNurbsCurves.h b/pxr/usdImaging/usdImaging/dataSourceNurbsCurves.h index ff3780eb05..c71103b4d8 100644 --- a/pxr/usdImaging/usdImaging/dataSourceNurbsCurves.h +++ b/pxr/usdImaging/usdImaging/dataSourceNurbsCurves.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_DATA_SOURCE_NURBS_CURVES_H diff --git a/pxr/usdImaging/usdImaging/dataSourceNurbsPatch.cpp b/pxr/usdImaging/usdImaging/dataSourceNurbsPatch.cpp index dc4ab8c3f7..f2223d31af 100644 --- a/pxr/usdImaging/usdImaging/dataSourceNurbsPatch.cpp +++ b/pxr/usdImaging/usdImaging/dataSourceNurbsPatch.cpp @@ -1,29 +1,12 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/dataSourceNurbsPatch.h" -#include "pxr/usdImaging/usdImaging/dataSourceSchemaBased.h" +#include "pxr/usdImaging/usdImaging/dataSourceMapped.h" #include "pxr/usd/usdGeom/nurbsPatch.h" @@ -36,78 +19,48 @@ PXR_NAMESPACE_OPEN_SCOPE namespace { -// _NurbsPatchDataSource is a container data source for locator -// nurbsPatch. -// -// It contains all non-space USD attributes of the UsdGeomNurbsPatch schema -// (that is, the name contains no ":"). This means it skips the -// trimCurve prefixed attributes from UsdGeomNurbsPatch as well as the -// pointWeights (which is a primvar) and the primvars from UsdGeomGprim. -// -struct _NurbsPatchTranslator +HdDataSourceLocator +_ToLocator(const TfToken &name) { - static - TfToken - UsdAttributeNameToHdName(const TfToken &name) - { - if (SdfPath::TokenizeIdentifier(name.GetString()).size() != 1) { - return TfToken(); - } - if (name == UsdGeomTokens->pointWeights) { - return TfToken(); - } - - return name; - } - - static - HdDataSourceLocator - GetContainerLocator() - { - return HdNurbsPatchSchema::GetDefaultLocator(); - } -}; - -using _NurbsPatchDataSource = UsdImagingDataSourceSchemaBased< - UsdGeomNurbsPatch, - /* UsdSchemaBaseTypes = */ std::tuple, - _NurbsPatchTranslator>; - -// _TrimCurveTranslator is a container data source for locator -// nurbsPatch/trimCurve. -// -// It contains all USD attributes in the trimCurve namespace -// of the UsdGeomNurbsPatch schema (prefixed by trimCurve:). -// -struct _TrimCurveTranslator + const TfTokenVector tokens = SdfPath::TokenizeIdentifierAsTokens(name); + return HdDataSourceLocator(tokens.size(), tokens.data()); +} + +std::vector +_GetAttributeMappings() { - static - TfToken - UsdAttributeNameToHdName(const TfToken &name) - { - static const TfToken prefix("trimCurve"); - - const std::pair strippedName = - SdfPath::StripPrefixNamespace(name, prefix); - if (strippedName.second) { - return TfToken(strippedName.first); + std::vector result; + + // Pick up from UsdGeomGprim + result.push_back( + {UsdGeomTokens->doubleSided, + HdDataSourceLocator(HdNurbsPatchSchemaTokens->doubleSided)}); + result.push_back( + {UsdGeomTokens->orientation, + HdDataSourceLocator(HdNurbsPatchSchemaTokens->orientation)}); + + for (const TfToken &usdName : + UsdGeomNurbsPatch::GetSchemaAttributeNames( + /* includeInherited = */ false)) { + if (usdName == UsdGeomTokens->pointWeights) { + // Suppress pointWeights from UsdGeomNurbsCurves (which is a custom + // primvar we process in the prim source below). + continue; } - return TfToken(); - } - static - HdDataSourceLocator - GetContainerLocator() - { - return HdNurbsPatchTrimCurveSchema::GetDefaultLocator(); + result.push_back({ usdName, _ToLocator(usdName)}); } -}; -using _TrimCurveDataSource = UsdImagingDataSourceSchemaBased< - UsdGeomNurbsPatch, - /* UsdSchemaBaseTypes = */ std::tuple<>, - _TrimCurveTranslator>; + return result; +} +const UsdImagingDataSourceMapped::AttributeMappings & +_GetMappings() { + static const UsdImagingDataSourceMapped::AttributeMappings result( + _GetAttributeMappings(), HdNurbsPatchSchema::GetDefaultLocator()); + return result; +} + const UsdImagingDataSourceCustomPrimvars::Mappings & _GetCustomPrimvarMappings(const UsdPrim &usdPrim) { @@ -145,19 +98,11 @@ UsdImagingDataSourceNurbsPatchPrim::Get(const TfToken & name) { if (name == HdNurbsPatchSchema::GetSchemaToken()) { return - HdOverlayContainerDataSource::New( - // Container for locator nurbsPatch - _NurbsPatchDataSource::New( - _GetSceneIndexPath(), - UsdGeomNurbsPatch(_GetUsdPrim()), - _GetStageGlobals()), - HdRetainedContainerDataSource::New( - HdNurbsPatchTrimCurveSchemaTokens->trimCurve, - // Container for locator nurbsPatch/trimCurve - _TrimCurveDataSource::New( - _GetSceneIndexPath(), - UsdGeomNurbsPatch(_GetUsdPrim()), - _GetStageGlobals()))); + UsdImagingDataSourceMapped::New( + _GetUsdPrim(), + _GetSceneIndexPath(), + _GetMappings(), + _GetStageGlobals()); } if (name == HdPrimvarsSchema::GetSchemaToken()) { return @@ -184,12 +129,8 @@ UsdImagingDataSourceNurbsPatchPrim::Invalidate( TRACE_FUNCTION(); HdDataSourceLocatorSet locators = - _NurbsPatchDataSource::Invalidate( - subprim, properties); - - locators.insert( - _TrimCurveDataSource::Invalidate( - subprim, properties)); + UsdImagingDataSourceMapped::Invalidate( + properties, _GetMappings()); locators.insert( UsdImagingDataSourceGprim::Invalidate( diff --git a/pxr/usdImaging/usdImaging/dataSourceNurbsPatch.h b/pxr/usdImaging/usdImaging/dataSourceNurbsPatch.h index 685d999112..3af81a2292 100644 --- a/pxr/usdImaging/usdImaging/dataSourceNurbsPatch.h +++ b/pxr/usdImaging/usdImaging/dataSourceNurbsPatch.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_DATA_SOURCE_NURBS_PATCH_H diff --git a/pxr/usdImaging/usdImaging/dataSourcePointInstancer.cpp b/pxr/usdImaging/usdImaging/dataSourcePointInstancer.cpp index 1112e42c3a..9ae7dfbdca 100644 --- a/pxr/usdImaging/usdImaging/dataSourcePointInstancer.cpp +++ b/pxr/usdImaging/usdImaging/dataSourcePointInstancer.cpp @@ -1,25 +1,8 @@ // // Copyright 2020 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/dataSourcePointInstancer.h" @@ -181,27 +164,74 @@ UsdImagingDataSourcePointInstancerTopology::GetNames() }; } +static UsdImagingDataSourceCustomPrimvars::Mappings -_GetCustomPrimvarMappings(const UsdPrim &usdPrim) +_Merge(const UsdImagingDataSourceCustomPrimvars::Mappings &a, + const UsdImagingDataSourceCustomPrimvars::Mappings &b) { - TfToken usdOrientationsToken; - UsdGeomPointInstancer instancer(usdPrim); + UsdImagingDataSourceCustomPrimvars::Mappings result = a; + for (const auto &mapping : b) { + result.push_back(mapping); + } + return result; +} - return { +const UsdImagingDataSourceCustomPrimvars::Mappings & +_GetCustomPrimvarMappings(const UsdPrim &usdPrim) +{ + static const UsdImagingDataSourceCustomPrimvars::Mappings baseMappings = { { HdInstancerTokens->instanceTranslations, UsdGeomTokens->positions, - HdPrimvarSchemaTokens->instance }, - { - HdInstancerTokens->instanceRotations, - instancer.UsesOrientationsf() - ? UsdGeomTokens->orientationsf - : UsdGeomTokens->orientations, - HdPrimvarSchemaTokens->instance }, + HdPrimvarSchemaTokens->instance + }, { HdInstancerTokens->instanceScales, UsdGeomTokens->scales, - HdPrimvarSchemaTokens->instance } }; + HdPrimvarSchemaTokens->instance + }, + { + HdTokens->velocities, + UsdGeomTokens->velocities, + HdPrimvarSchemaTokens->instance + }, + { + HdTokens->accelerations, + UsdGeomTokens->accelerations, + HdPrimvarSchemaTokens->instance + }, + { + HdTokens->angularVelocities, + UsdGeomTokens->angularVelocities, + HdPrimvarSchemaTokens->instance + } + }; + + TfToken usdOrientationsToken; + UsdGeomPointInstancer instancer(usdPrim); + if (instancer.UsesOrientationsf(&usdOrientationsToken)) { + static const UsdImagingDataSourceCustomPrimvars::Mappings + mappingsOrientationsf = _Merge(baseMappings, + { + { + HdInstancerTokens->instanceRotations, + UsdGeomTokens->orientationsf, + HdPrimvarSchemaTokens->instance + } + }); + return mappingsOrientationsf; + } else { + static const UsdImagingDataSourceCustomPrimvars::Mappings + mappingsOrientations = _Merge(baseMappings, + { + { + HdInstancerTokens->instanceRotations, + UsdGeomTokens->orientations, + HdPrimvarSchemaTokens->instance + } + }); + return mappingsOrientations; + } } HdDataSourceBaseHandle diff --git a/pxr/usdImaging/usdImaging/dataSourcePointInstancer.h b/pxr/usdImaging/usdImaging/dataSourcePointInstancer.h index 73d2ede2da..5a7a8f31ef 100644 --- a/pxr/usdImaging/usdImaging/dataSourcePointInstancer.h +++ b/pxr/usdImaging/usdImaging/dataSourcePointInstancer.h @@ -1,25 +1,8 @@ // // Copyright 2020 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_DATA_SOURCE_POINT_INSTANCER_H #define PXR_USD_IMAGING_USD_IMAGING_DATA_SOURCE_POINT_INSTANCER_H diff --git a/pxr/usdImaging/usdImaging/dataSourcePoints.cpp b/pxr/usdImaging/usdImaging/dataSourcePoints.cpp index c3150c587d..2838d01bc0 100644 --- a/pxr/usdImaging/usdImaging/dataSourcePoints.cpp +++ b/pxr/usdImaging/usdImaging/dataSourcePoints.cpp @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/dataSourcePoints.h" #include "pxr/usdImaging/usdImaging/dataSourcePrimvars.h" diff --git a/pxr/usdImaging/usdImaging/dataSourcePoints.h b/pxr/usdImaging/usdImaging/dataSourcePoints.h index 8333cbaaf1..cf346ca765 100644 --- a/pxr/usdImaging/usdImaging/dataSourcePoints.h +++ b/pxr/usdImaging/usdImaging/dataSourcePoints.h @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_DATA_SOURCE_POINTS_H diff --git a/pxr/usdImaging/usdImaging/dataSourcePrim.cpp b/pxr/usdImaging/usdImaging/dataSourcePrim.cpp index bdd4c98bb6..03f77a947c 100644 --- a/pxr/usdImaging/usdImaging/dataSourcePrim.cpp +++ b/pxr/usdImaging/usdImaging/dataSourcePrim.cpp @@ -1,25 +1,8 @@ // // Copyright 2020 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/dataSourcePrim.h" #include "pxr/usdImaging/usdImaging/dataSourceAttribute.h" diff --git a/pxr/usdImaging/usdImaging/dataSourcePrim.h b/pxr/usdImaging/usdImaging/dataSourcePrim.h index 3105958591..a0521034f9 100644 --- a/pxr/usdImaging/usdImaging/dataSourcePrim.h +++ b/pxr/usdImaging/usdImaging/dataSourcePrim.h @@ -1,25 +1,8 @@ // // Copyright 2020 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_DATA_SOURCE_PRIM_H #define PXR_USD_IMAGING_USD_IMAGING_DATA_SOURCE_PRIM_H diff --git a/pxr/usdImaging/usdImaging/dataSourcePrimvars.cpp b/pxr/usdImaging/usdImaging/dataSourcePrimvars.cpp index 052c9856a1..7f46cefb02 100644 --- a/pxr/usdImaging/usdImaging/dataSourcePrimvars.cpp +++ b/pxr/usdImaging/usdImaging/dataSourcePrimvars.cpp @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/dataSourcePrimvars.h" @@ -133,9 +116,15 @@ UsdImagingDataSourcePrimvars::Get(const TfToken & name) if (nsIt != _namespacedPrimvars.end()) { const UsdGeomPrimvar &usdPrimvar = nsIt->second; const UsdAttribute &attr = usdPrimvar.GetAttr(); + + UsdAttributeQuery valueQuery(attr); + if (!valueQuery.HasAuthoredValue()) { + return nullptr; + } + return UsdImagingDataSourcePrimvar::New( _sceneIndexPath, name, _stageGlobals, - /* value = */ UsdAttributeQuery(attr), + /* value = */ std::move(valueQuery), /* indices = */ UsdAttributeQuery(usdPrimvar.GetIndicesAttr()), HdPrimvarSchema::BuildInterpolationDataSource( UsdImagingUsdToHdInterpolationToken( @@ -168,24 +157,20 @@ UsdImagingDataSourceCustomPrimvars::UsdImagingDataSourceCustomPrimvars( : _sceneIndexPath(sceneIndexPath) , _usdPrim(usdPrim) , _stageGlobals(stageGlobals) +, _mappings(mappings) { - for (const Mapping& cp : mappings) { - UsdAttributeQuery attrQ( - _usdPrim.GetPrim().GetAttribute(cp.usdAttrName)); - if (attrQ.HasAuthoredValue()) { - _customPrimvars[cp.primvarName] = { attrQ, cp.interpolation }; - } - } } TfTokenVector UsdImagingDataSourceCustomPrimvars::GetNames() { + TRACE_FUNCTION(); + TfTokenVector result; - result.reserve(_customPrimvars.size()); + result.reserve(_mappings.size()); - for (const auto &entry : _customPrimvars) { - result.push_back(entry.first); + for (const auto &mapping : _mappings) { + result.push_back(mapping.primvarName); } return result; @@ -194,20 +179,28 @@ UsdImagingDataSourceCustomPrimvars::GetNames() HdDataSourceBaseHandle UsdImagingDataSourceCustomPrimvars::Get(const TfToken &name) { - const auto cIt = _customPrimvars.find(name); - if (cIt != _customPrimvars.end()) { - const UsdAttributeQuery &attrQ = cIt->second.first; - const UsdAttribute &attr = attrQ.GetAttribute(); - const TfToken &interpolation = cIt->second.second; + TRACE_FUNCTION(); + + for (const Mapping &mapping : _mappings) { + if (mapping.primvarName != name) { + continue; + } + + const UsdAttribute attr = _usdPrim.GetAttribute(mapping.usdAttrName); + UsdAttributeQuery valueQuery(attr); + + if (!valueQuery.HasAuthoredValue()) { + return nullptr; + } return UsdImagingDataSourcePrimvar::New( _sceneIndexPath, name, _stageGlobals, - /* value = */ attrQ, + /* value = */ std::move(valueQuery), /* indices = */ UsdAttributeQuery(), HdPrimvarSchema::BuildInterpolationDataSource( - interpolation.IsEmpty() + mapping.interpolation.IsEmpty() ? _GetInterpolation(attr) - : interpolation), + : mapping.interpolation), HdPrimvarSchema::BuildRoleDataSource( UsdImagingUsdToHdRole(attr.GetRoleName()))); } @@ -316,7 +309,7 @@ UsdImagingDataSourcePrimvar::Get(const TfToken & name) if (indexed) { if (name == HdPrimvarSchemaTokens->indexedPrimvarValue) { return UsdImagingDataSourceAttributeNew( - _valueQuery, _stageGlobals); + _valueQuery, _stageGlobals); } else if (name == HdPrimvarSchemaTokens->indices) { return UsdImagingDataSourceAttributeNew( _indicesQuery, _stageGlobals); @@ -324,7 +317,7 @@ UsdImagingDataSourcePrimvar::Get(const TfToken & name) } else { if (name == HdPrimvarSchemaTokens->primvarValue) { return UsdImagingDataSourceAttributeNew( - _valueQuery, _stageGlobals); + _valueQuery, _stageGlobals); } } diff --git a/pxr/usdImaging/usdImaging/dataSourcePrimvars.h b/pxr/usdImaging/usdImaging/dataSourcePrimvars.h index 4f8eb35b46..8cbe2313e7 100644 --- a/pxr/usdImaging/usdImaging/dataSourcePrimvars.h +++ b/pxr/usdImaging/usdImaging/dataSourcePrimvars.h @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_DATA_SOURCE_PRIMVARS_H #define PXR_USD_IMAGING_USD_IMAGING_DATA_SOURCE_PRIMVARS_H @@ -123,11 +106,7 @@ class UsdImagingDataSourceCustomPrimvars : public HdContainerDataSource // Stage globals handle. const UsdImagingDataSourceStageGlobals &_stageGlobals; - using _CustomPrimvarsMap = - std::map>; - _CustomPrimvarsMap _customPrimvars; + const Mappings _mappings; }; HD_DECLARE_DATASOURCE_HANDLES(UsdImagingDataSourceCustomPrimvars); diff --git a/pxr/usdImaging/usdImaging/dataSourceRelationship.cpp b/pxr/usdImaging/usdImaging/dataSourceRelationship.cpp index 175037dec2..5a88d68b57 100644 --- a/pxr/usdImaging/usdImaging/dataSourceRelationship.cpp +++ b/pxr/usdImaging/usdImaging/dataSourceRelationship.cpp @@ -1,25 +1,8 @@ // // Copyright 2020 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/dataSourceRelationship.h" diff --git a/pxr/usdImaging/usdImaging/dataSourceRelationship.h b/pxr/usdImaging/usdImaging/dataSourceRelationship.h index e048d15d5e..dc2c0f008a 100644 --- a/pxr/usdImaging/usdImaging/dataSourceRelationship.h +++ b/pxr/usdImaging/usdImaging/dataSourceRelationship.h @@ -1,25 +1,8 @@ // // Copyright 2020 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_DATA_SOURCE_RELATIONSHIP_H #define PXR_USD_IMAGING_USD_IMAGING_DATA_SOURCE_RELATIONSHIP_H diff --git a/pxr/usdImaging/usdImaging/dataSourceRenderPrims.cpp b/pxr/usdImaging/usdImaging/dataSourceRenderPrims.cpp index cb33fedd90..91caa9114f 100644 --- a/pxr/usdImaging/usdImaging/dataSourceRenderPrims.cpp +++ b/pxr/usdImaging/usdImaging/dataSourceRenderPrims.cpp @@ -1,18 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License atNAMESPACE -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/dataSourceRenderPrims.h" @@ -21,11 +11,13 @@ #include "pxr/usdImaging/usdImaging/usdRenderSettingsSchema.h" #include "pxr/usdImaging/usdImaging/usdRenderVarSchema.h" +#include "pxr/usd/usdRender/pass.h" #include "pxr/usd/usdRender/product.h" #include "pxr/usd/usdRender/settings.h" #include "pxr/usd/usdRender/spec.h" #include "pxr/usd/usdRender/var.h" +#include "pxr/imaging/hd/renderPassSchema.h" #include "pxr/imaging/hd/retainedDataSource.h" #include "pxr/base/tf/token.h" @@ -74,6 +66,136 @@ _ComputeNamespacedSettings(const UsdPrim &prim) } +// ---------------------------------------------------------------------------- +// RENDER PASS +// ---------------------------------------------------------------------------- +namespace { + +/// +/// A container data source representing render pass +/// +class _DataSourceRenderPass : public HdContainerDataSource +{ +public: + HD_DECLARE_DATASOURCE(_DataSourceRenderPass); + + static + const TfTokenVector& GetPropertyNames() { + // We do not supply all of the UsdRenderPass attributes, + // since some are for batch processing purposes. + static TfTokenVector names = { + UsdRenderTokens->passType, + UsdRenderTokens->renderSource }; + return names; + } + + TfTokenVector GetNames() override + { + return GetPropertyNames(); + } + + HdDataSourceBaseHandle Get(const TfToken &name) override + { + if (name == UsdRenderTokens->passType) { + TfToken passType; + if (_usdRenderPass.GetPassTypeAttr().Get(&passType)) { + return HdRetainedTypedSampledDataSource::New(passType); + } + return nullptr; + } else if (name == UsdRenderTokens->renderSource) { + if (UsdRelationship renderSourceRel = + _usdRenderPass.GetRenderSourceRel()) { + SdfPathVector targets; + renderSourceRel.GetForwardedTargets(&targets); + if (!targets.empty()) { + return HdRetainedTypedSampledDataSource::New( + targets[0]); + } + } + return nullptr; + } + return nullptr; + } + +private: + + // Private constructor, use static New() instead. + _DataSourceRenderPass( + const SdfPath &sceneIndexPath, + UsdRenderPass usdRenderPass, + const UsdImagingDataSourceStageGlobals &stageGlobals) + : _sceneIndexPath(sceneIndexPath) + , _usdRenderPass(usdRenderPass) + , _stageGlobals(stageGlobals) + {} + +private: + const SdfPath _sceneIndexPath; + UsdRenderPass _usdRenderPass; + const UsdImagingDataSourceStageGlobals & _stageGlobals; +}; + +HD_DECLARE_DATASOURCE_HANDLES(_DataSourceRenderPass); + +} + +UsdImagingDataSourceRenderPassPrim::UsdImagingDataSourceRenderPassPrim( + const SdfPath &sceneIndexPath, + UsdPrim usdPrim, + const UsdImagingDataSourceStageGlobals &stageGlobals) + : UsdImagingDataSourcePrim(sceneIndexPath, usdPrim, stageGlobals) +{ +} + +TfTokenVector +UsdImagingDataSourceRenderPassPrim::GetNames() +{ + // Note: Skip properties on UsdImagingDataSourcePrim. + return { HdRenderPassSchema::GetSchemaToken() }; +} + +HdDataSourceBaseHandle +UsdImagingDataSourceRenderPassPrim::Get(const TfToken & name) +{ + if (name == HdRenderPassSchema::GetSchemaToken()) { + return _DataSourceRenderPass::New( + _GetSceneIndexPath(), + UsdRenderPass(_GetUsdPrim()), + _GetStageGlobals()); + } + + // Note: Skip properties on UsdImagingDataSourcePrim. + return nullptr; +} + +HdDataSourceLocatorSet +UsdImagingDataSourceRenderPassPrim::Invalidate( + UsdPrim const& prim, + const TfToken &subprim, + const TfTokenVector &properties, + const UsdImagingPropertyInvalidationType invalidationType) + +{ + TRACE_FUNCTION(); + + const TfTokenVector &names = _DataSourceRenderPass::GetPropertyNames(); + static TfToken::HashSet tokensSet(names.begin(), names.end()); + + HdDataSourceLocatorSet locators; + + for (const TfToken &propertyName : properties) { + if (tokensSet.find(propertyName) != tokensSet.end()) { + locators.insert( + HdRenderPassSchema::GetDefaultLocator() + .Append(propertyName)); + } + // Note: Skip UsdImagingDataSourcePrim::Invalidate(...) + // since none of the "base" set of properties are relevant here. + } + + return locators; +} + // ---------------------------------------------------------------------------- // RENDER SETTINGS // ---------------------------------------------------------------------------- diff --git a/pxr/usdImaging/usdImaging/dataSourceRenderPrims.h b/pxr/usdImaging/usdImaging/dataSourceRenderPrims.h index 7e37130070..138482e67a 100644 --- a/pxr/usdImaging/usdImaging/dataSourceRenderPrims.h +++ b/pxr/usdImaging/usdImaging/dataSourceRenderPrims.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_DATA_SOURCE_RENDER_PRIMS_H @@ -33,6 +16,41 @@ PXR_NAMESPACE_OPEN_SCOPE +/// \class UsdImagingDataSourceRenderPassPrim +/// +/// A prim data source representing UsdRenderPass. +/// +class UsdImagingDataSourceRenderPassPrim : public UsdImagingDataSourcePrim +{ +public: + HD_DECLARE_DATASOURCE(UsdImagingDataSourceRenderPassPrim); + + USDIMAGING_API + TfTokenVector GetNames() override; + + USDIMAGING_API + HdDataSourceBaseHandle Get(const TfToken &name) override; + + USDIMAGING_API + static + HdDataSourceLocatorSet + Invalidate( + UsdPrim const& prim, + const TfToken &subprim, + const TfTokenVector &properties, + UsdImagingPropertyInvalidationType invalidationType); + +private: + // Private constructor, use static New() instead. + UsdImagingDataSourceRenderPassPrim( + const SdfPath &sceneIndexPath, + UsdPrim usdPrim, + const UsdImagingDataSourceStageGlobals &stageGlobals); +}; + +HD_DECLARE_DATASOURCE_HANDLES(UsdImagingDataSourceRenderPassPrim); + + /// \class UsdImagingDataSourceRenderSettingsPrim /// /// A prim data source representing UsdRenderSettings. diff --git a/pxr/usdImaging/usdImaging/dataSourceSchemaBased.h b/pxr/usdImaging/usdImaging/dataSourceSchemaBased.h deleted file mode 100644 index cc86f4ccfd..0000000000 --- a/pxr/usdImaging/usdImaging/dataSourceSchemaBased.h +++ /dev/null @@ -1,276 +0,0 @@ -// -// Copyright 2022 Pixar -// -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. -// - -#ifndef PXR_USD_IMAGING_USD_IMAGING_DATA_SOURCE_SCHEMA_BASED_H -#define PXR_USD_IMAGING_USD_IMAGING_DATA_SOURCE_SCHEMA_BASED_H - -#include "pxr/usdImaging/usdImaging/dataSourceAttribute.h" -#include "pxr/usdImaging/usdImaging/dataSourceStageGlobals.h" - -#include "pxr/imaging/hd/dataSource.h" - -PXR_NAMESPACE_OPEN_SCOPE - -namespace UsdImagingDataSourceSchemaBased_Impl -{ -struct _Mapping; -}; - -/// \class UsdImagingDataSourceSchemaBased -/// -/// A container data source created from a Usd schema and optionally some -/// of its base classes which accesses the attributes on the underlying Usd -/// prim performing translation between the Usd attribute name and the key in -/// the container data source (for implementing Get) or the data source -/// locator (for implementing Invalidate). -/// -/// The translation starts by taking the non-inherited attributes from the -/// the given UsdSchemaType (e.g., UsdGeomSphere) and the given UsdSchemaBaseTypes -/// and calling Translator::UsdAttributeNameToHdName(usdAttributeName) which -/// can either return the corresponding hydra token or an empty token if -/// the usd attribute should not occur in the data source. -/// -/// UsdSchemaBaseTypes is a std::tuple of the base schema types that should -/// also be considered and can be std::tuple<> if there is no base schema or -/// no attribute of a base schema should be included. -/// -/// The data source locator (relevant for invalidation) will be created -/// by appending the hydra token to the data source locator returned by -/// Translator::GetContainerLocator(). -/// -template -class UsdImagingDataSourceSchemaBased : public HdContainerDataSource -{ -public: - using This = UsdImagingDataSourceSchemaBased< - UsdSchemaType, UsdSchemaBaseTypes, Translator>; - - HD_DECLARE_DATASOURCE(This); - - TfTokenVector GetNames() override; - - HdDataSourceBaseHandle Get(const TfToken &name) override; - - /// Translate usdNames to data source locators. - static - HdDataSourceLocatorSet - Invalidate(const TfToken &subprim, const TfTokenVector &usdNames); - -private: - // Private constructor, use static New() instead. - UsdImagingDataSourceSchemaBased( - const SdfPath &sceneIndexPath, - UsdSchemaType usdSchema, - const UsdImagingDataSourceStageGlobals &stageGlobals); - - using _Mapping = UsdImagingDataSourceSchemaBased_Impl::_Mapping; - - static const std::vector<_Mapping> &_GetMappings(); - -private: - const SdfPath _sceneIndexPath; - UsdSchemaType _usdSchema; - const UsdImagingDataSourceStageGlobals & _stageGlobals; -}; - -/// Implementation - -namespace UsdImagingDataSourceSchemaBased_Impl -{ - -struct _Mapping -{ - TfToken usdAttributeName; - TfToken hdName; - HdDataSourceLocator locator; -}; - -template -void _FillMappings(std::vector<_Mapping> * const result) -{ - for (const TfToken &usdAttributeName : - ThisUsdSchemaType::GetSchemaAttributeNames( - /* includeInherited = */ false)) - { - const TfToken hdName = - Translator::UsdAttributeNameToHdName(usdAttributeName); - if (!hdName.IsEmpty()) { - result->push_back( - { usdAttributeName, - hdName, - Translator::GetContainerLocator().Append(hdName) }); - } - } -} - -template -struct _MappingsFiller; - -template -struct _MappingsFiller> -{ - static void Fill(std::vector<_Mapping> * const result) - { - } -}; - -template -struct _MappingsFiller> -{ - static void Fill(std::vector<_Mapping> * const result) - { - _FillMappings(result); - _MappingsFiller>::Fill(result); - } -}; - -template -std::vector<_Mapping> -_GetMappings() -{ - std::vector<_Mapping> result; - - _FillMappings(&result); - _MappingsFiller::Fill(&result); - - return result; -} - -TfTokenVector -inline _GetNames(const std::vector<_Mapping> &mappings) -{ - TfTokenVector result; - for (const _Mapping &mapping : mappings) { - result.push_back(mapping.hdName); - } - return result; -} - -} // namespace UsdImagingDataSourceSchemaBased_Impl - -template -TfTokenVector -UsdImagingDataSourceSchemaBased:: -GetNames() -{ - static const TfTokenVector names = - UsdImagingDataSourceSchemaBased_Impl::_GetNames(_GetMappings()); - return names; -} - -template -HdDataSourceBaseHandle -UsdImagingDataSourceSchemaBased:: -Get(const TfToken &name) -{ - for (const _Mapping &mapping : _GetMappings()) { - if (mapping.hdName == name) { - if (UsdAttribute attr = - _usdSchema.GetPrim().GetAttribute( - mapping.usdAttributeName)) { - return - UsdImagingDataSourceAttributeNew( - attr, - _stageGlobals, - _sceneIndexPath, - mapping.locator); - } else { - // Has(name) has returned true, but we return - // nullptr - an inconsistency. - TF_CODING_ERROR( - "Could not get usd attribute '%s' even though " - "it is on the schema.", - mapping.usdAttributeName.GetText()); - return nullptr; - } - } - } - return nullptr; -} - -template -HdDataSourceLocatorSet -UsdImagingDataSourceSchemaBased:: -Invalidate( - const TfToken &subprim, - const TfTokenVector &usdNames) -{ - HdDataSourceLocatorSet locators; - - for (const TfToken &usdName : usdNames) { - for (const _Mapping &mapping : _GetMappings()) { - if (mapping.usdAttributeName == usdName) { - locators.insert(mapping.locator); - } - } - } - - return locators; -} - -template -UsdImagingDataSourceSchemaBased:: -UsdImagingDataSourceSchemaBased( - const SdfPath &sceneIndexPath, - UsdSchemaType usdSchema, - const UsdImagingDataSourceStageGlobals &stageGlobals) - : _sceneIndexPath(sceneIndexPath) - , _usdSchema(usdSchema) - , _stageGlobals(stageGlobals) -{ -} - -template -const std::vector & -UsdImagingDataSourceSchemaBased:: -_GetMappings() -{ - static const std::vector<_Mapping> mappings = - UsdImagingDataSourceSchemaBased_Impl:: - _GetMappings(); - return mappings; -} - - -PXR_NAMESPACE_CLOSE_SCOPE - -#endif // PXR_USD_IMAGING_USD_IMAGING_DATA_SOURCE_SCHEMA_BASED_H diff --git a/pxr/usdImaging/usdImaging/dataSourceStage.cpp b/pxr/usdImaging/usdImaging/dataSourceStage.cpp index 762d50d498..6be69c4090 100644 --- a/pxr/usdImaging/usdImaging/dataSourceStage.cpp +++ b/pxr/usdImaging/usdImaging/dataSourceStage.cpp @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/dataSourceStage.h" diff --git a/pxr/usdImaging/usdImaging/dataSourceStage.h b/pxr/usdImaging/usdImaging/dataSourceStage.h index 5cd787c443..8525c7d219 100644 --- a/pxr/usdImaging/usdImaging/dataSourceStage.h +++ b/pxr/usdImaging/usdImaging/dataSourceStage.h @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_DATA_SOURCE_STAGE_H #define PXR_USD_IMAGING_USD_IMAGING_DATA_SOURCE_STAGE_H diff --git a/pxr/usdImaging/usdImaging/dataSourceStageGlobals.cpp b/pxr/usdImaging/usdImaging/dataSourceStageGlobals.cpp index 18ed73753c..1f3fab59ae 100644 --- a/pxr/usdImaging/usdImaging/dataSourceStageGlobals.cpp +++ b/pxr/usdImaging/usdImaging/dataSourceStageGlobals.cpp @@ -1,25 +1,8 @@ // // Copyright 2020 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/dataSourceStageGlobals.h" diff --git a/pxr/usdImaging/usdImaging/dataSourceStageGlobals.h b/pxr/usdImaging/usdImaging/dataSourceStageGlobals.h index d29c6f0452..cfc6b20eb9 100644 --- a/pxr/usdImaging/usdImaging/dataSourceStageGlobals.h +++ b/pxr/usdImaging/usdImaging/dataSourceStageGlobals.h @@ -1,25 +1,8 @@ // // Copyright 2020 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_DATA_SOURCE_STAGE_GLOBALS_H #define PXR_USD_IMAGING_USD_IMAGING_DATA_SOURCE_STAGE_GLOBALS_H diff --git a/pxr/usdImaging/usdImaging/dataSourceTetMesh.cpp b/pxr/usdImaging/usdImaging/dataSourceTetMesh.cpp index e018be8651..af2b57fdf6 100644 --- a/pxr/usdImaging/usdImaging/dataSourceTetMesh.cpp +++ b/pxr/usdImaging/usdImaging/dataSourceTetMesh.cpp @@ -1,25 +1,8 @@ // // Copyright 2024 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/dataSourceTetMesh.h" @@ -47,6 +30,7 @@ UsdImagingDataSourceTetMeshTopology::GetNames() return { HdTetMeshTopologySchemaTokens->orientation, HdTetMeshTopologySchemaTokens->tetVertexIndices, + HdTetMeshTopologySchemaTokens->surfaceFaceVertexIndices, }; } @@ -59,6 +43,11 @@ UsdImagingDataSourceTetMeshTopology::Get(const TfToken &name) _usdTetMesh.GetTetVertexIndicesAttr(), _stageGlobals, _sceneIndexPath, HdTetMeshTopologySchema::GetTetVertexIndicesLocator()); + } else if (name == HdTetMeshTopologySchemaTokens->surfaceFaceVertexIndices) { + return UsdImagingDataSourceAttribute::New( + _usdTetMesh.GetSurfaceFaceVertexIndicesAttr(), + _stageGlobals, _sceneIndexPath, + HdTetMeshTopologySchema::GetSurfaceFaceVertexIndicesLocator()); } else if (name == HdTetMeshTopologySchemaTokens->orientation) { return UsdImagingDataSourceAttribute::New( _usdTetMesh.GetOrientationAttr(), _stageGlobals); @@ -146,6 +135,7 @@ UsdImagingDataSourceTetMeshPrim::Invalidate( for (const TfToken &propertyName : properties) { if (propertyName == UsdGeomTokens->tetVertexIndices || + propertyName == UsdGeomTokens->surfaceFaceVertexIndices || propertyName == UsdGeomTokens->orientation) { locators.insert(HdTetMeshSchema::GetTopologyLocator()); } diff --git a/pxr/usdImaging/usdImaging/dataSourceTetMesh.h b/pxr/usdImaging/usdImaging/dataSourceTetMesh.h index 22ee15abcd..1cd097131f 100644 --- a/pxr/usdImaging/usdImaging/dataSourceTetMesh.h +++ b/pxr/usdImaging/usdImaging/dataSourceTetMesh.h @@ -1,25 +1,8 @@ // // Copyright 2024 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_DATA_SOURCE_TET_MESH_H #define PXR_USD_IMAGING_USD_IMAGING_DATA_SOURCE_TET_MESH_H diff --git a/pxr/usdImaging/usdImaging/dataSourceUsdPrimInfo.cpp b/pxr/usdImaging/usdImaging/dataSourceUsdPrimInfo.cpp index 7f16e9a5f2..f74b2186e1 100644 --- a/pxr/usdImaging/usdImaging/dataSourceUsdPrimInfo.cpp +++ b/pxr/usdImaging/usdImaging/dataSourceUsdPrimInfo.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/dataSourceUsdPrimInfo.h" diff --git a/pxr/usdImaging/usdImaging/dataSourceUsdPrimInfo.h b/pxr/usdImaging/usdImaging/dataSourceUsdPrimInfo.h index 28569d985d..be199bbd76 100644 --- a/pxr/usdImaging/usdImaging/dataSourceUsdPrimInfo.h +++ b/pxr/usdImaging/usdImaging/dataSourceUsdPrimInfo.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_DATA_SOURCE_USD_PRIM_INFO_H diff --git a/pxr/usdImaging/usdImaging/dataSourceVolume.cpp b/pxr/usdImaging/usdImaging/dataSourceVolume.cpp index f132df39b9..bf077b17c4 100644 --- a/pxr/usdImaging/usdImaging/dataSourceVolume.cpp +++ b/pxr/usdImaging/usdImaging/dataSourceVolume.cpp @@ -1,25 +1,8 @@ // // Copyright 2020 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/dataSourceVolume.h" diff --git a/pxr/usdImaging/usdImaging/dataSourceVolume.h b/pxr/usdImaging/usdImaging/dataSourceVolume.h index 0a0d09f50a..646f02d20c 100644 --- a/pxr/usdImaging/usdImaging/dataSourceVolume.h +++ b/pxr/usdImaging/usdImaging/dataSourceVolume.h @@ -1,25 +1,8 @@ // // Copyright 2020 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_DATA_SOURCE_VOLUME_H diff --git a/pxr/usdImaging/usdImaging/debugCodes.cpp b/pxr/usdImaging/usdImaging/debugCodes.cpp index 6c9c4a5c56..692845236c 100644 --- a/pxr/usdImaging/usdImaging/debugCodes.cpp +++ b/pxr/usdImaging/usdImaging/debugCodes.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/debugCodes.h" diff --git a/pxr/usdImaging/usdImaging/debugCodes.h b/pxr/usdImaging/usdImaging/debugCodes.h index 1524cfd13e..26e6bb7ae2 100644 --- a/pxr/usdImaging/usdImaging/debugCodes.h +++ b/pxr/usdImaging/usdImaging/debugCodes.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_DEBUG_CODES_H #define PXR_USD_IMAGING_USD_IMAGING_DEBUG_CODES_H diff --git a/pxr/usdImaging/usdImaging/delegate.cpp b/pxr/usdImaging/usdImaging/delegate.cpp index b46268aa2f..f20ce7117c 100644 --- a/pxr/usdImaging/usdImaging/delegate.cpp +++ b/pxr/usdImaging/usdImaging/delegate.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/delegate.h" @@ -880,10 +863,13 @@ UsdImagingDelegate::SetTime(UsdTimeCode time) // Mark varying attributes as dirty. if (_timeVaryingPrimCacheValid) { for (SdfPath const& path : _timeVaryingPrimCache) { - _HdPrimInfo &primInfo = _hdPrimInfoMap[path]; - primInfo.adapter->MarkDirty(primInfo.usdPrim, + _HdPrimInfoMap::iterator it = _hdPrimInfoMap.find(path); + if (it == _hdPrimInfoMap.end()) { + continue; + } + it->second.adapter->MarkDirty(it->second.usdPrim, path, - primInfo.timeVaryingBits, + it->second.timeVaryingBits, &indexProxy); } } else { @@ -1859,8 +1845,8 @@ UsdImagingDelegate::SetSceneLightsEnabled(bool enable) const SdfPath &cachePath = pair.first; _HdPrimInfo &primInfo = pair.second; if (TF_VERIFY(primInfo.adapter, "%s", cachePath.GetText())) { - primInfo.adapter->MarkLightParamsDirty(primInfo.usdPrim, - cachePath, &indexProxy); + primInfo.adapter->MarkDirty(primInfo.usdPrim, cachePath, + HdLight::DirtyParams | HdLight::DirtyResource, &indexProxy); } } } @@ -2787,6 +2773,23 @@ VtArray UsdImagingDelegate::GetCategories(SdfPath const &id) { SdfPath cachePath = ConvertIndexPathToCachePath(id); + + // XXX: We must not ask the collection cache about instancer prototypes. + // When instancer prototypes had property paths, the collection cache + // would return an empty list for them. Now that they have prim paths, + // the collection cache will return the list of collections inherited by + // the prototype from the first instance. If subsequent instances belong to + // a conflicting set of collections, we get incorrect results. Since the + // collection cache has no way to identify prototype paths, we must do the + // check here where we have access to the adapter. Instances will receive + // the correct list of collections via GetInstanceCategories(). + _HdPrimInfo* primInfo = _GetHdPrimInfo(cachePath); + if (primInfo && + primInfo->adapter && + primInfo->adapter->IsInstancerAdapter() && + primInfo->adapter->IsChildPath(cachePath)) { + return { }; + } return _collectionCache.ComputeCollectionsContainingPath(cachePath); } diff --git a/pxr/usdImaging/usdImaging/delegate.h b/pxr/usdImaging/usdImaging/delegate.h index 5da0ae33e8..d124aa0e5e 100644 --- a/pxr/usdImaging/usdImaging/delegate.h +++ b/pxr/usdImaging/usdImaging/delegate.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_DELEGATE_H #define PXR_USD_IMAGING_USD_IMAGING_DELEGATE_H diff --git a/pxr/usdImaging/usdImaging/directMaterialBindingSchema.cpp b/pxr/usdImaging/usdImaging/directMaterialBindingSchema.cpp index 37c8eb289e..e768bbd128 100644 --- a/pxr/usdImaging/usdImaging/directMaterialBindingSchema.cpp +++ b/pxr/usdImaging/usdImaging/directMaterialBindingSchema.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/pxr/usdImaging/usdImaging/directMaterialBindingSchema.h b/pxr/usdImaging/usdImaging/directMaterialBindingSchema.h index a67c84649a..b4958b8990 100644 --- a/pxr/usdImaging/usdImaging/directMaterialBindingSchema.h +++ b/pxr/usdImaging/usdImaging/directMaterialBindingSchema.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/pxr/usdImaging/usdImaging/directMaterialBindingsSchema.cpp b/pxr/usdImaging/usdImaging/directMaterialBindingsSchema.cpp index 3b5d496739..3f64aac7f3 100644 --- a/pxr/usdImaging/usdImaging/directMaterialBindingsSchema.cpp +++ b/pxr/usdImaging/usdImaging/directMaterialBindingsSchema.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/pxr/usdImaging/usdImaging/directMaterialBindingsSchema.h b/pxr/usdImaging/usdImaging/directMaterialBindingsSchema.h index 6a4ab5af5c..5cae440e94 100644 --- a/pxr/usdImaging/usdImaging/directMaterialBindingsSchema.h +++ b/pxr/usdImaging/usdImaging/directMaterialBindingsSchema.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/pxr/usdImaging/usdImaging/diskLightAdapter.cpp b/pxr/usdImaging/usdImaging/diskLightAdapter.cpp index 1f1f9afcc4..7df86b4a72 100644 --- a/pxr/usdImaging/usdImaging/diskLightAdapter.cpp +++ b/pxr/usdImaging/usdImaging/diskLightAdapter.cpp @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/diskLightAdapter.h" #include "pxr/usdImaging/usdImaging/delegate.h" diff --git a/pxr/usdImaging/usdImaging/diskLightAdapter.h b/pxr/usdImaging/usdImaging/diskLightAdapter.h index 1df659f3e6..868c7c01d9 100644 --- a/pxr/usdImaging/usdImaging/diskLightAdapter.h +++ b/pxr/usdImaging/usdImaging/diskLightAdapter.h @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_DISK_LIGHT_ADAPTER_H #define PXR_USD_IMAGING_USD_IMAGING_DISK_LIGHT_ADAPTER_H diff --git a/pxr/usdImaging/usdImaging/distantLightAdapter.cpp b/pxr/usdImaging/usdImaging/distantLightAdapter.cpp index bbbe503aa0..8db5493482 100644 --- a/pxr/usdImaging/usdImaging/distantLightAdapter.cpp +++ b/pxr/usdImaging/usdImaging/distantLightAdapter.cpp @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/distantLightAdapter.h" #include "pxr/usdImaging/usdImaging/delegate.h" diff --git a/pxr/usdImaging/usdImaging/distantLightAdapter.h b/pxr/usdImaging/usdImaging/distantLightAdapter.h index 738574e472..1c6c4e35c6 100644 --- a/pxr/usdImaging/usdImaging/distantLightAdapter.h +++ b/pxr/usdImaging/usdImaging/distantLightAdapter.h @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_DISTANT_LIGHT_ADAPTER_H #define PXR_USD_IMAGING_USD_IMAGING_DISTANT_LIGHT_ADAPTER_H diff --git a/pxr/usdImaging/usdImaging/domeLightAdapter.cpp b/pxr/usdImaging/usdImaging/domeLightAdapter.cpp index e9ca248d71..af5e25a337 100644 --- a/pxr/usdImaging/usdImaging/domeLightAdapter.cpp +++ b/pxr/usdImaging/usdImaging/domeLightAdapter.cpp @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/domeLightAdapter.h" #include "pxr/usdImaging/usdImaging/delegate.h" diff --git a/pxr/usdImaging/usdImaging/domeLightAdapter.h b/pxr/usdImaging/usdImaging/domeLightAdapter.h index e5b60fdbc3..8f23db8254 100644 --- a/pxr/usdImaging/usdImaging/domeLightAdapter.h +++ b/pxr/usdImaging/usdImaging/domeLightAdapter.h @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_DOME_LIGHT_ADAPTER_H #define PXR_USD_IMAGING_USD_IMAGING_DOME_LIGHT_ADAPTER_H diff --git a/pxr/usdImaging/usdImaging/domeLight_1Adapter.cpp b/pxr/usdImaging/usdImaging/domeLight_1Adapter.cpp index 03b9d3c35c..eeb60e744a 100644 --- a/pxr/usdImaging/usdImaging/domeLight_1Adapter.cpp +++ b/pxr/usdImaging/usdImaging/domeLight_1Adapter.cpp @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/domeLight_1Adapter.h" #include "pxr/usdImaging/usdImaging/delegate.h" diff --git a/pxr/usdImaging/usdImaging/domeLight_1Adapter.h b/pxr/usdImaging/usdImaging/domeLight_1Adapter.h index 1923c2ab1f..4f5a549559 100644 --- a/pxr/usdImaging/usdImaging/domeLight_1Adapter.h +++ b/pxr/usdImaging/usdImaging/domeLight_1Adapter.h @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_DOME_LIGHT_1_ADAPTER_H #define PXR_USD_IMAGING_USD_IMAGING_DOME_LIGHT_1_ADAPTER_H diff --git a/pxr/usdImaging/usdImaging/drawModeAdapter.cpp b/pxr/usdImaging/usdImaging/drawModeAdapter.cpp index e4bc75781d..48dcaa5973 100644 --- a/pxr/usdImaging/usdImaging/drawModeAdapter.cpp +++ b/pxr/usdImaging/usdImaging/drawModeAdapter.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/drawModeAdapter.h" @@ -37,6 +20,7 @@ #include "pxr/usd/usdGeom/modelAPI.h" #include "pxr/usd/sdr/registry.h" #include "pxr/usd/sdr/shaderNode.h" +#include "pxr/usd/usd/prim.h" #include "pxr/base/gf/matrix4f.h" #include "pxr/base/tf/type.h" @@ -215,7 +199,10 @@ UsdImagingDrawModeAdapter::Populate(UsdPrim const& prim, UsdImagingInstancerContext const* instancerContext) { - SdfPath cachePath = ResolveCachePath(prim.GetPath(), instancerContext); + const SdfPath cachePath = ResolveCachePath( + prim.GetPath(), instancerContext); + const SdfPath proxyPrimPath = ResolveProxyPrimPath( + cachePath, instancerContext); // The draw mode adapter only supports models or unloaded prims. // This is enforced in UsdImagingDelegate::_IsDrawModeApplied. @@ -244,10 +231,10 @@ UsdImagingDrawModeAdapter::Populate(UsdPrim const& prim, instancerContext->instancerAdapter : shared_from_this(); - // If this prim isn't instanced, cachePrim will be the same as "prim", but + // If this prim isn't instanced, proxyPrim will be the same as "prim", but // if it is instanced the instancer adapters expect us to pass in this // prim, which should point to the instancer. - UsdPrim cachePrim = _GetPrim(cachePath.GetAbsoluteRootOrPrimPath()); + UsdPrim proxyPrim = _GetPrim(proxyPrimPath); if (drawMode == UsdGeomTokens->origin || drawMode == UsdGeomTokens->bounds) { @@ -261,7 +248,7 @@ UsdImagingDrawModeAdapter::Populate(UsdPrim const& prim, _drawModeMap.insert({ cachePath, drawMode }); index->InsertRprim(HdPrimTypeTokens->basisCurves, - cachePath, cachePrim, rprimAdapter); + cachePath, proxyPrim, rprimAdapter); HD_PERF_COUNTER_INCR(UsdImagingTokens->usdPopulatedPrimCount); } else if (drawMode == UsdGeomTokens->cards) { // Cards draw as a mesh @@ -274,7 +261,7 @@ UsdImagingDrawModeAdapter::Populate(UsdPrim const& prim, _drawModeMap.insert({ cachePath, drawMode }); index->InsertRprim(HdPrimTypeTokens->mesh, - cachePath, cachePrim, rprimAdapter); + cachePath, proxyPrim, rprimAdapter); HD_PERF_COUNTER_INCR(UsdImagingTokens->usdPopulatedPrimCount); } else { TF_CODING_ERROR("Model <%s> has unsupported drawMode '%s'", @@ -284,17 +271,13 @@ UsdImagingDrawModeAdapter::Populate(UsdPrim const& prim, // As long as we're passing cachePrim to InsertRprim, we need to fix up // the dependency map ourselves. For USD edit purposes, we depend on the - // prototype prim ("prim"), rather than the instancer prim. + // prototype prim ("prim"), rather than the instancer prim ("proxyPrim"). // See similar code in GprimAdapter::_AddRprim. if (instancerContext != nullptr) { index->RemovePrimInfoDependency(cachePath); index->AddDependency(cachePath, prim); } - // When instancing, cachePath may have a proto prop part on the end. - // This will strip the prop part, leaving primPath as the instancer's path. - SdfPath primPath = cachePath.GetAbsoluteRootOrPrimPath(); - // Additionally, insert the material. if (drawMode == UsdGeomTokens->cards) { diff --git a/pxr/usdImaging/usdImaging/drawModeAdapter.h b/pxr/usdImaging/usdImaging/drawModeAdapter.h index a37a06d858..2355462c84 100644 --- a/pxr/usdImaging/usdImaging/drawModeAdapter.h +++ b/pxr/usdImaging/usdImaging/drawModeAdapter.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_DRAW_MODE_ADAPTER_H #define PXR_USD_IMAGING_USD_IMAGING_DRAW_MODE_ADAPTER_H diff --git a/pxr/usdImaging/usdImaging/drawModeSceneIndex.cpp b/pxr/usdImaging/usdImaging/drawModeSceneIndex.cpp index c2dc70b1b5..7191b8fd9a 100644 --- a/pxr/usdImaging/usdImaging/drawModeSceneIndex.cpp +++ b/pxr/usdImaging/usdImaging/drawModeSceneIndex.cpp @@ -1,32 +1,17 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. #include "pxr/usdImaging/usdImaging/drawModeSceneIndex.h" -#include "pxr/usdImaging/usdImaging/drawModeStandin.h" +#include "pxr/usdImaging/usdImaging/drawModeStandin.h" #include "pxr/usdImaging/usdImaging/geomModelSchema.h" #include "pxr/usdImaging/usdImaging/usdPrimInfoSchema.h" +#include "pxr/usd/sdf/path.h" + #include "pxr/base/trace/trace.h" PXR_NAMESPACE_OPEN_SCOPE @@ -161,23 +146,26 @@ UsdImagingDrawModeSceneIndex::GetPrim( if (relPathLen == 0) { // Example - // Querried prim is /Foo and the DrawModeStandin is at /Foo. + // Queried prim is /Foo and the DrawModeStandin is at /Foo. // - // We query the DrawmodeStandin for its prim. + // We query the DrawmodeStandin for its self, untyped prim. return standin->GetPrim(); } - if (relPathLen == 1) { + if (relPathLen == 1 || relPathLen == 2) { // Example: - // Querried prim is /Foo/mesh and the DrawModeStandin is at /Foo. + // DrawModeStandin is at /Foo, and queried prim is at + // /Foo/cardsMesh, or + // /Foo/subsetMaterialXPos, or + // /Foo/cardsMesh/subsetXPos // - // We query the DrawmodeStandin for the child prim mesh. - return standin->GetChildPrim(primPath.GetNameToken()); + // We query the DrawmodeStandin for the descendant prim. + return standin->GetDescendantPrim(primPath); } // Example: - // Querried prim is /Foo/A/B and the DrawModeStandin is at /Foo. + // Queried prim is /Foo/A/B and the DrawModeStandin is at /Foo. // // We block everything at this level since draw mode standin's - // only have immediate children. + // only have children (depth 1) or grandchildren (depth 2). return { TfToken(), nullptr }; } @@ -195,12 +183,21 @@ UsdImagingDrawModeSceneIndex::GetChildPrimPaths( size_t relPathLen; if (UsdImaging_DrawModeStandinSharedPtr const standin = _FindStandinForPrimOrAncestor(primPath, &relPathLen)) { - if (relPathLen == 0) { - // List immediate children of standin. - return standin->GetChildPrimPaths(); + // standin->GetDescendantPrimPaths() gives all descendants, but + // we just want the queried prim's direct children so we only + // want the descendant paths with the full queried path as prefix and + // exactly one additional path component. This works whether the + // queried path is for the typeless container (children: standin prim + + // materials), the standin prim (children: subsets), a subset (children: + // none), or a material (children: none). + SdfPathVector paths; + for (const SdfPath& path : standin->GetDescendantPrimPaths()) { + if (path.HasPrefix(primPath) && path.GetPathElementCount() + - primPath.GetPathElementCount() == 1) { + paths.push_back(path); + } } - // Standin only has immediate children. So just block. - return {}; + return paths; } return _GetInputSceneIndex()->GetChildPrimPaths(primPath); @@ -416,7 +413,7 @@ UsdImagingDrawModeSceneIndex::_PrimsDirtied( // Add new stand-in geometry. standin->ComputePrimAddedEntries(&addedEntries); _prims[path] = std::move(standin); - // Do not traverse ancestors of this prim. + // Do not traverse descendants of this prim. lastPath = path; } } else { @@ -473,7 +470,7 @@ UsdImagingDrawModeSceneIndex::_PrimsDirtied( } if (relPathLen > 0) { - // Ancestors of prims with non-default draw mode can be ignored. + // Descendants of prims with non-default draw mode can be ignored. continue; } diff --git a/pxr/usdImaging/usdImaging/drawModeSceneIndex.h b/pxr/usdImaging/usdImaging/drawModeSceneIndex.h index 33eb18b837..66ecc0195a 100644 --- a/pxr/usdImaging/usdImaging/drawModeSceneIndex.h +++ b/pxr/usdImaging/usdImaging/drawModeSceneIndex.h @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. #ifndef PXR_USD_IMAGING_USD_IMAGING_DRAW_MODE_SCENE_INDEX_H #define PXR_USD_IMAGING_USD_IMAGING_DRAW_MODE_SCENE_INDEX_H diff --git a/pxr/usdImaging/usdImaging/drawModeStandin.cpp b/pxr/usdImaging/usdImaging/drawModeStandin.cpp index 8a57ed0699..942c748e91 100644 --- a/pxr/usdImaging/usdImaging/drawModeStandin.cpp +++ b/pxr/usdImaging/usdImaging/drawModeStandin.cpp @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. #include "pxr/usdImaging/usdImaging/drawModeStandin.h" @@ -28,18 +11,20 @@ #include "pxr/imaging/hd/basisCurvesSchema.h" #include "pxr/imaging/hd/basisCurvesTopologySchema.h" +#include "pxr/imaging/hd/dataSource.h" +#include "pxr/imaging/hd/dataSourceTypeDefs.h" #include "pxr/imaging/hd/extentSchema.h" +#include "pxr/imaging/hd/geomSubsetSchema.h" #include "pxr/imaging/hd/instancedBySchema.h" #include "pxr/imaging/hd/legacyDisplayStyleSchema.h" #include "pxr/imaging/hd/materialBindingsSchema.h" #include "pxr/imaging/hd/materialConnectionSchema.h" #include "pxr/imaging/hd/materialNetworkSchema.h" -#include "pxr/imaging/hd/materialNodeSchema.h" #include "pxr/imaging/hd/materialNodeParameterSchema.h" +#include "pxr/imaging/hd/materialNodeSchema.h" #include "pxr/imaging/hd/materialSchema.h" -#include "pxr/imaging/hd/meshTopologySchema.h" #include "pxr/imaging/hd/meshSchema.h" -#include "pxr/imaging/hd/overlayContainerDataSource.h" +#include "pxr/imaging/hd/meshTopologySchema.h" #include "pxr/imaging/hd/primvarSchema.h" #include "pxr/imaging/hd/primvarsSchema.h" #include "pxr/imaging/hd/purposeSchema.h" @@ -47,19 +32,20 @@ #include "pxr/imaging/hd/tokens.h" #include "pxr/imaging/hd/visibilitySchema.h" #include "pxr/imaging/hd/xformSchema.h" -#include "pxr/imaging/hio/glslfx.h" #include "pxr/imaging/hio/image.h" #include "pxr/usd/usdGeom/tokens.h" -#include "pxr/usd/sdr/registry.h" -#include "pxr/usd/sdr/shaderNode.h" +#include "pxr/usd/sdf/path.h" #include "pxr/base/gf/matrix4f.h" #include "pxr/base/gf/range3d.h" +#include "pxr/base/tf/token.h" + +#include "pxr/pxr.h" #include -#include #include +#include PXR_NAMESPACE_OPEN_SCOPE @@ -79,19 +65,30 @@ UsdImaging_DrawModeStandin::GetPrim() const } HdSceneIndexPrim -UsdImaging_DrawModeStandin::GetChildPrim(const TfToken &name) const +UsdImaging_DrawModeStandin::GetDescendantPrim(const SdfPath& path) const { - return { _GetChildPrimType(name), _GetChildPrimSource(name) }; + if (path.IsAbsolutePath() && path.HasPrefix(_path)) { + const SdfPath relPath = path.MakeRelativePath(_path); + return { + _GetDescendantPrimType(relPath), + _GetDescendantPrimSource(relPath) }; + } + if (!path.IsAbsolutePath()) { + return { + _GetDescendantPrimType(path), + _GetDescendantPrimSource(path) }; + } + return { TfToken(), nullptr }; } SdfPathVector -UsdImaging_DrawModeStandin::GetChildPrimPaths() const +UsdImaging_DrawModeStandin::GetDescendantPrimPaths() const { - const TfTokenVector &childNames = _GetChildNames(); + const SdfPathVector& relPaths = _GetDescendantPaths(); SdfPathVector result; - result.reserve(childNames.size()); - for (const TfToken &childName : childNames) { - result.push_back(_path.AppendChild(childName)); + result.reserve(relPaths.size()); + for (const SdfPath& relPath : relPaths) { + result.push_back(_path.AppendPath(relPath)); } return result; } @@ -100,14 +97,26 @@ void UsdImaging_DrawModeStandin::ComputePrimAddedEntries( HdSceneIndexObserver::AddedPrimEntries * entries) const { - entries->push_back({_path, TfToken()}); - const TfTokenVector &childNames = _GetChildNames(); - for (const TfToken &childName : childNames) { - const SdfPath childPath = _path.AppendChild(childName); - entries->push_back( { childPath, _GetChildPrimType(childName) }); + entries->push_back({ _path, TfToken() }); + const SdfPathVector& relPaths = _GetDescendantPaths(); + for (const SdfPath& relPath : relPaths) { + entries->push_back({ + _path.AppendPath(relPath), + _GetDescendantPrimType(relPath) }); } } +void +UsdImaging_DrawModeStandin::ComputePrimRemovedEntries( + HdSceneIndexObserver::RemovedPrimEntries* entries) const +{ + const SdfPathVector& relPaths = _GetDescendantPaths(); + for (const SdfPath& relPath : relPaths) { + entries->push_back({ _path.AppendPath(relPath) }); + } + entries->push_back({ _path }); +} + namespace { //////////////////////////////////////////////////////////////////////////////// @@ -624,19 +633,20 @@ class _BoundsStandin : public UsdImaging_DrawModeStandin { } - const TfTokenVector - _GetChildNames() const override { - static const TfTokenVector childNames{ _primNameTokens->boundsCurves }; - return childNames; + const SdfPathVector + _GetDescendantPaths() const override { + static const SdfPathVector paths { + SdfPath(_primNameTokens->boundsCurves) }; + return paths; } TfToken - _GetChildPrimType(const TfToken &name) const override { + _GetDescendantPrimType(const SdfPath& /*path*/) const override { return HdPrimTypeTokens->basisCurves; } HdContainerDataSourceHandle - _GetChildPrimSource(const TfToken &name) const override { + _GetDescendantPrimSource(const SdfPath& /*path*/) const override { return _BoundsPrimDataSource::New(_primSource); } @@ -678,12 +688,12 @@ class _BoundsStandin : public UsdImaging_DrawModeStandin .Append(HdTokens->displayColor); primDirtyLocators.insert(displayColor); } - for (const SdfPath &path : GetChildPrimPaths()) { + for (const SdfPath &path : GetDescendantPrimPaths()) { entries->push_back({path, primDirtyLocators}); } } else { // Can just forward the dirty locators to the basis curves prim. - for (const SdfPath &path : GetChildPrimPaths()) { + for (const SdfPath &path : GetDescendantPrimPaths()) { entries->push_back({path, dirtyLocators}); } } @@ -842,19 +852,20 @@ class _OriginStandin : public UsdImaging_DrawModeStandin { } - const TfTokenVector - _GetChildNames() const override { - static const TfTokenVector childNames{ _primNameTokens->originCurves }; - return childNames; + const SdfPathVector + _GetDescendantPaths() const override { + static const SdfPathVector paths { + SdfPath(_primNameTokens->originCurves) }; + return paths; } TfToken - _GetChildPrimType(const TfToken &name) const override { + _GetDescendantPrimType(const SdfPath& /*path*/) const override { return HdPrimTypeTokens->basisCurves; } HdContainerDataSourceHandle - _GetChildPrimSource(const TfToken &name) const override { + _GetDescendantPrimSource(const SdfPath& /*path*/) const override { return _OriginPrimDataSource::New(_primSource); } @@ -881,11 +892,11 @@ class _OriginStandin : public UsdImaging_DrawModeStandin HdPrimvarsSchema::GetDefaultLocator() .Append(HdTokens->displayColor); primDirtyLocators.insert(displayColorValue); - for (const SdfPath &path : GetChildPrimPaths()) { + for (const SdfPath &path : GetDescendantPrimPaths()) { entries->push_back({path, primDirtyLocators}); } } else { - for (const SdfPath &path : GetChildPrimPaths()) { + for (const SdfPath &path : GetDescendantPrimPaths()) { entries->push_back({path, dirtyLocators}); } } @@ -947,10 +958,10 @@ using _MaterialsDict = std::unordered_map< /// /// Implements stand-in for cards draw mode. /// -/// It is providing a mesh with a material. The mesh consists of up to 6 quads. -/// Besides points, it has the vertex-varying cardsUv and face-varying -/// cardsTexAssgin - determining where to sample which of the up to 6 textures -/// that can be specified by the UsdImagingGeomModelSchema. +/// It is providing a mesh with a material. The mesh consists of up to 6 quads, +/// each assigned to its own geom subset. Up to six materials, each bound to a +/// geom subset, are also supplied. The parent mesh has the vertex-varying +/// primvar `cardsUv`, used for correctly sampling any assigned texture. /// /// Details vary based on the card geometry which is box, cross, or fromTexture. /// @@ -988,9 +999,20 @@ class _CardsDataCache HdDataSourceBaseHandle GetUVs() { return _GetCardsData()->uvs; } - /// The individual face geometry subsets. + /// An individual face geometry subset. HdContainerDataSourceHandle - GetGeomSubsets() { return _GetCardsData()->geomSubsets; } + GetGeomSubset(const TfToken& name) { + return _GetCardsData()->GetSubset(name); + } + + TfTokenVector + GetGeomSubsetNames() { + TfTokenVector names; + for (const auto& kv :_GetCardsData()->geomSubsets) { + names.push_back(kv.first); + } + return names; + } /// The topology. HdContainerDataSourceHandle @@ -1044,16 +1066,28 @@ class _CardsDataCache /// The cached data. struct _CardsData { + using SubsetMap = std::unordered_map; + _CardsData(const _SchemaValues &values, const SdfPath &primPath); TfToken cardGeometry; VtVec3fArray points; HdContainerDataSourceHandle extent; HdDataSourceBaseHandle uvs; - HdContainerDataSourceHandle geomSubsets; + SubsetMap geomSubsets; HdContainerDataSourceHandle meshTopology; _MaterialsDict materials; + HdContainerDataSourceHandle + GetSubset(const TfToken& name) { + const auto it = geomSubsets.find(name); + if (it != geomSubsets.end()) { + return it->second; + } + return nullptr; + } + private: static VtVec3fArray @@ -1062,7 +1096,7 @@ class _CardsDataCache VtVec2fArray _ComputeUVs(const _SchemaValues &values); static - HdContainerDataSourceHandle + SubsetMap _ComputeGeomSubsets(const _SchemaValues &values, const SdfPath &primPath); static const @@ -1397,7 +1431,7 @@ _CardsDataCache::_CardsData::_ComputePoints(const _SchemaValues &values) return points; } -HdContainerDataSourceHandle +_CardsDataCache::_CardsData::SubsetMap _CardsDataCache::_CardsData::_ComputeGeomSubsets( const _SchemaValues &values, const SdfPath &primPath) { @@ -1406,8 +1440,7 @@ _CardsDataCache::_CardsData::_ComputeGeomSubsets( static const std::array materialNameTokens = _AddAxesToNames("subsetMaterial", ""); - std::vector subsetNames; - std::vector subsets; + SubsetMap subsets; // Do not generate subsets if there are no textures for any face. // The entire standin prim will use the renderer's fallback material, which @@ -1430,60 +1463,61 @@ _CardsDataCache::_CardsData::_ComputeGeomSubsets( for (size_t i = 0; i < 6; i++) { const size_t vi = (i % 2 == 0 ? 0 : 3) + i / 2; - if (values.hasFace[vi]) { - static HdTokenDataSourceHandle const typeSource = - HdGeomSubsetSchema::BuildTypeDataSource( - HdGeomSubsetSchemaTokens->typeFaceSet); - const int subsetIndex(subsets.size()); - // use the opposite face's material if no texture for this face - const size_t matIndex = values.hasTexture[vi] ? vi : (vi + 3) % 6; - static const TfToken purposes[] = { - HdMaterialBindingsSchemaTokens->allPurpose - }; - const SdfPath materialPath = - // geomSubset's materialBinding path must be absolute - primPath.AppendChild(materialNameTokens[matIndex]); - - // Note that we use the hydra material bindings schema here (and - // below) rather than UsdImagingDirectMaterialBinding(s)Schema. - // We want these bindings to be unaffected by any USD material - // bindings up-namespace. - // - HdDataSourceBaseHandle const materialBindingSources[] = { - HdMaterialBindingSchema::Builder() - .SetPath( - HdRetainedTypedSampledDataSource::New( - materialPath)) - .Build() - }; - - subsetNames.push_back(subsetNameTokens[vi]); - subsets.push_back( - HdOverlayContainerDataSource::New( - HdGeomSubsetSchema::Builder() - .SetType(typeSource) - .SetIndices( - HdRetainedTypedSampledDataSource::New( - { subsetIndex })) - .Build(), - - HdRetainedContainerDataSource::New( - HdMaterialBindingsSchema::GetSchemaToken(), - HdMaterialBindingsSchema::BuildRetained( - TfArraySize(purposes), - purposes, - materialBindingSources)))); - + if (!values.hasFace[vi]) { + continue; } + static HdTokenDataSourceHandle const typeSource = + HdGeomSubsetSchema::BuildTypeDataSource( + HdGeomSubsetSchemaTokens->typeFaceSet); + static const HdBoolDataSourceHandle trueSource = + HdRetainedTypedSampledDataSource::New(true); + const int subsetIndex((int)(subsets.size())); + // use the opposite face's material if no texture for this face + const size_t mi = values.hasTexture[vi] ? vi : (vi + 3) % 6; + static const TfToken materialBindingNames[] = { + HdMaterialBindingsSchemaTokens->allPurpose + }; + const SdfPath materialPath = + // geomSubset's materialBinding path must be absolute + primPath.AppendChild(materialNameTokens[mi]); + + // Note that we use the hydra material bindings schema here (and + // below) rather than UsdImagingDirectMaterialBinding(s)Schema. + // We want these bindings to be unaffected by any USD material + // bindings up-namespace. + // + HdDataSourceBaseHandle const materialBindingSources[] = { + HdMaterialBindingSchema::Builder() + .SetPath(HdRetainedTypedSampledDataSource::New( + materialPath)) + .Build() + }; + + subsets.insert({ + subsetNameTokens[vi], + HdRetainedContainerDataSource::New( + HdGeomSubsetSchema::GetSchemaToken(), + HdGeomSubsetSchema::Builder() + .SetType(typeSource) + .SetIndices( + HdRetainedTypedSampledDataSource::New( + { subsetIndex })) + .Build(), + + HdVisibilitySchema::GetSchemaToken(), + HdVisibilitySchema::Builder() + .SetVisibility(trueSource) + .Build(), + + HdMaterialBindingsSchema::GetSchemaToken(), + HdMaterialBindingsSchema::BuildRetained( + TfArraySize(materialBindingNames), + materialBindingNames, + materialBindingSources)) }); } } - if (subsetNames.empty()) { - return nullptr; - } else { - return HdRetainedContainerDataSource::New( - subsetNames.size(), subsetNames.data(), subsets.data()); - } + return subsets; } HdContainerDataSourceHandle @@ -1955,7 +1989,6 @@ class _CardsPrimDataSource : public _PrimDataSource .SetTopology(_dataCache->GetMeshTopology()) .SetDoubleSided( HdRetainedTypedSampledDataSource::New(false)) - .SetGeomSubsets(_dataCache->GetGeomSubsets()) .Build(); } if (name == HdPrimvarsSchemaTokens->primvars) { @@ -2020,34 +2053,50 @@ class _CardsStandin : public UsdImaging_DrawModeStandin { } - const TfTokenVector - _GetChildNames() const override { - TfTokenVector names = { _primNameTokens->cardsMesh }; - const _MaterialsDict mats = _dataCache->GetMaterials(); - for (const auto &kv : mats) { - names.push_back(kv.first); + const SdfPathVector + _GetDescendantPaths() const override { + SdfPathVector paths = { SdfPath(_primNameTokens->cardsMesh) }; + // materials are siblings of 'cardsMesh' + for (const auto &kv : _dataCache->GetMaterials()) { + paths.emplace_back(kv.first); } - return names; + // geom subsets are children of 'cardsMesh' + for (const TfToken& name : _dataCache->GetGeomSubsetNames()) { + paths.push_back(paths.front().AppendChild(name)); + } + return paths; } TfToken - _GetChildPrimType(const TfToken &name) const override { - if (name == _primNameTokens->cardsMesh) { + _GetDescendantPrimType(const SdfPath& path) const override { + static const SdfPath cardsMeshPath = SdfPath(_primNameTokens->cardsMesh); + if (path == cardsMeshPath) { return HdPrimTypeTokens->mesh; } + if (path.HasPrefix(cardsMeshPath)) { + return HdPrimTypeTokens->geomSubset; + } return HdPrimTypeTokens->material; } HdContainerDataSourceHandle - _GetChildPrimSource(const TfToken &name) const override { + _GetDescendantPrimSource(const SdfPath& path) const override { + static const SdfPath cardsMeshPath = SdfPath(_primNameTokens->cardsMesh); + if (path == cardsMeshPath) { + return _CardsPrimDataSource::New(_path, _primSource, _dataCache); + } + if (path.HasPrefix(cardsMeshPath)) { + return _dataCache->GetGeomSubset(path.GetNameToken()); + } // We rely on the consumer calling HdSceneIndex::GetPrim() // again when we send a prim dirtied for the material prims // with an empty data source locators. const _MaterialsDict &materials = _dataCache->GetMaterials(); + const TfToken& name = path.GetNameToken(); if (materials.count(name)) { return materials.at(name); } - return _CardsPrimDataSource::New(_path, _primSource, _dataCache); + return nullptr; } void ProcessDirtyLocators( @@ -2077,7 +2126,7 @@ class _CardsStandin : public UsdImaging_DrawModeStandin // Blast the entire thing. if (dirtyLocators.Intersects(cardLocators)) { (*needsRefresh) = true; - for (const SdfPath &path : GetChildPrimPaths()) { + for (const SdfPath &path : GetDescendantPrimPaths()) { static const HdDataSourceLocator empty; entries->push_back({path, empty}); } diff --git a/pxr/usdImaging/usdImaging/drawModeStandin.h b/pxr/usdImaging/usdImaging/drawModeStandin.h index bb360ffdae..b017757d55 100644 --- a/pxr/usdImaging/usdImaging/drawModeStandin.h +++ b/pxr/usdImaging/usdImaging/drawModeStandin.h @@ -1,34 +1,22 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. #ifndef PXR_USD_IMAGING_USD_IMAGING_DRAW_MODE_STANDIN_H #define PXR_USD_IMAGING_USD_IMAGING_DRAW_MODE_STANDIN_H -#include "pxr/pxr.h" - +#include "pxr/imaging/hd/dataSource.h" #include "pxr/imaging/hd/sceneIndex.h" #include "pxr/imaging/hd/sceneIndexObserver.h" +#include "pxr/usd/sdf/path.h" + +#include "pxr/base/tf/token.h" + +#include "pxr/pxr.h" + PXR_NAMESPACE_OPEN_SCOPE /// \class UsdImaging_DrawModeStandin @@ -44,16 +32,22 @@ class UsdImaging_DrawModeStandin /// Get prim replacing the original prim. /// - /// For now, this is just a typeless prim without data source. + /// For now, this is just a typeless container prim without data source. const HdSceneIndexPrim &GetPrim() const; - /// Get immediate children of the prim replacing the original prim. - SdfPathVector GetChildPrimPaths() const; - HdSceneIndexPrim GetChildPrim(const TfToken &name) const; + /// Get paths of all descendants of the typeless container. + SdfPathVector GetDescendantPrimPaths() const; + + /// GetDescendant prim by absolute or relative path. + HdSceneIndexPrim GetDescendantPrim(const SdfPath& path) const; - // Compute added entries for the stand-in geometry + /// Compute added entries for the stand-in geometry void ComputePrimAddedEntries( HdSceneIndexObserver::AddedPrimEntries * entries) const; + + /// Compute removed entries for the stand-in geometry + void ComputePrimRemovedEntries( + HdSceneIndexObserver::RemovedPrimEntries* entries) const; /// Given dirty data source locators for the original prim, invalidate /// cached data and emit dirty entries for the stand-in geometry. @@ -63,9 +57,13 @@ class UsdImaging_DrawModeStandin bool * needsRefresh) = 0; protected: - virtual const TfTokenVector _GetChildNames() const = 0; - virtual TfToken _GetChildPrimType(const TfToken &name) const = 0; - virtual HdContainerDataSourceHandle _GetChildPrimSource(const TfToken &name) const = 0; + /// returns paths relative to the typeless container. + virtual const SdfPathVector _GetDescendantPaths() const = 0; + /// accepts paths relative to the typeless container. + virtual TfToken _GetDescendantPrimType(const SdfPath& path) const = 0; + /// accepts paths relative to the typeless container. + virtual HdContainerDataSourceHandle _GetDescendantPrimSource( + const SdfPath& path) const = 0; UsdImaging_DrawModeStandin( const SdfPath &path, diff --git a/pxr/usdImaging/usdImaging/extentResolvingSceneIndex.cpp b/pxr/usdImaging/usdImaging/extentResolvingSceneIndex.cpp index 5ce7669d04..2575524e9b 100644 --- a/pxr/usdImaging/usdImaging/extentResolvingSceneIndex.cpp +++ b/pxr/usdImaging/usdImaging/extentResolvingSceneIndex.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. #include "pxr/usdImaging/usdImaging/extentResolvingSceneIndex.h" diff --git a/pxr/usdImaging/usdImaging/extentResolvingSceneIndex.h b/pxr/usdImaging/usdImaging/extentResolvingSceneIndex.h index eda49bf51b..f26037f98b 100644 --- a/pxr/usdImaging/usdImaging/extentResolvingSceneIndex.h +++ b/pxr/usdImaging/usdImaging/extentResolvingSceneIndex.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. #ifndef PXR_USD_IMAGING_USD_IMAGING_EXTENT_RESOLVING_SCENE_INDEX_H #define PXR_USD_IMAGING_USD_IMAGING_EXTENT_RESOLVING_SCENE_INDEX_H diff --git a/pxr/usdImaging/usdImaging/extentsHintSchema.cpp b/pxr/usdImaging/usdImaging/extentsHintSchema.cpp index 5b5ee012e6..a69f722e45 100644 --- a/pxr/usdImaging/usdImaging/extentsHintSchema.cpp +++ b/pxr/usdImaging/usdImaging/extentsHintSchema.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/pxr/usdImaging/usdImaging/extentsHintSchema.h b/pxr/usdImaging/usdImaging/extentsHintSchema.h index 441f785a4f..6b47cf59de 100644 --- a/pxr/usdImaging/usdImaging/extentsHintSchema.h +++ b/pxr/usdImaging/usdImaging/extentsHintSchema.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/pxr/usdImaging/usdImaging/fieldAdapter.cpp b/pxr/usdImaging/usdImaging/fieldAdapter.cpp index bdb699328c..f5fb33b97e 100644 --- a/pxr/usdImaging/usdImaging/fieldAdapter.cpp +++ b/pxr/usdImaging/usdImaging/fieldAdapter.cpp @@ -1,25 +1,8 @@ // // Copyright 2018 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/fieldAdapter.h" #include "pxr/usdImaging/usdImaging/delegate.h" @@ -84,10 +67,8 @@ UsdImagingFieldAdapter::TrackVariability(UsdPrim const& prim, // If any of the field attributes is time varying // we will assume all field params are time-varying. - const std::vector &attrs = prim.GetAttributes(); - TF_FOR_ALL(attrIter, attrs) { - const UsdAttribute& attr = *attrIter; - if (attr.GetNumTimeSamples()>1){ + for (UsdAttribute const& attr : prim.GetAttributes()) { + if (attr.ValueMightBeTimeVarying()) { *timeVaryingBits |= HdField::DirtyBits::DirtyParams; } } diff --git a/pxr/usdImaging/usdImaging/fieldAdapter.h b/pxr/usdImaging/usdImaging/fieldAdapter.h index 0437fd6e98..a6524cc307 100644 --- a/pxr/usdImaging/usdImaging/fieldAdapter.h +++ b/pxr/usdImaging/usdImaging/fieldAdapter.h @@ -1,25 +1,8 @@ // // Copyright 2018 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_FIELD_ADAPTER_H #define PXR_USD_IMAGING_USD_IMAGING_FIELD_ADAPTER_H diff --git a/pxr/usdImaging/usdImaging/flattenedDataSourceProviders.cpp b/pxr/usdImaging/usdImaging/flattenedDataSourceProviders.cpp index 304927b7cc..fea6840f4d 100644 --- a/pxr/usdImaging/usdImaging/flattenedDataSourceProviders.cpp +++ b/pxr/usdImaging/usdImaging/flattenedDataSourceProviders.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/flattenedDataSourceProviders.h" diff --git a/pxr/usdImaging/usdImaging/flattenedDataSourceProviders.h b/pxr/usdImaging/usdImaging/flattenedDataSourceProviders.h index a384ec45a6..6a8709f1ec 100644 --- a/pxr/usdImaging/usdImaging/flattenedDataSourceProviders.h +++ b/pxr/usdImaging/usdImaging/flattenedDataSourceProviders.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_FLATTENED_DATA_SOURCE_PROVIDERS_H #define PXR_USD_IMAGING_USD_IMAGING_FLATTENED_DATA_SOURCE_PROVIDERS_H diff --git a/pxr/usdImaging/usdImaging/flattenedDirectMaterialBindingsDataSourceProvider.cpp b/pxr/usdImaging/usdImaging/flattenedDirectMaterialBindingsDataSourceProvider.cpp index e14a4423c4..0d3e52ec84 100644 --- a/pxr/usdImaging/usdImaging/flattenedDirectMaterialBindingsDataSourceProvider.cpp +++ b/pxr/usdImaging/usdImaging/flattenedDirectMaterialBindingsDataSourceProvider.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/flattenedDirectMaterialBindingsDataSourceProvider.h" diff --git a/pxr/usdImaging/usdImaging/flattenedDirectMaterialBindingsDataSourceProvider.h b/pxr/usdImaging/usdImaging/flattenedDirectMaterialBindingsDataSourceProvider.h index 5aeda6ee78..2bd34238f1 100644 --- a/pxr/usdImaging/usdImaging/flattenedDirectMaterialBindingsDataSourceProvider.h +++ b/pxr/usdImaging/usdImaging/flattenedDirectMaterialBindingsDataSourceProvider.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_FLATTENED_MATERIAL_BINDINGS_DATA_SOURCE_PROVIDER_H #define PXR_USD_IMAGING_USD_IMAGING_FLATTENED_MATERIAL_BINDINGS_DATA_SOURCE_PROVIDER_H diff --git a/pxr/usdImaging/usdImaging/flattenedGeomModelDataSourceProvider.cpp b/pxr/usdImaging/usdImaging/flattenedGeomModelDataSourceProvider.cpp index 76fe25c4af..318e1b4095 100644 --- a/pxr/usdImaging/usdImaging/flattenedGeomModelDataSourceProvider.cpp +++ b/pxr/usdImaging/usdImaging/flattenedGeomModelDataSourceProvider.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. #include "pxr/usdImaging/usdImaging/flattenedGeomModelDataSourceProvider.h" diff --git a/pxr/usdImaging/usdImaging/flattenedGeomModelDataSourceProvider.h b/pxr/usdImaging/usdImaging/flattenedGeomModelDataSourceProvider.h index ff11a22b3b..78a5377712 100644 --- a/pxr/usdImaging/usdImaging/flattenedGeomModelDataSourceProvider.h +++ b/pxr/usdImaging/usdImaging/flattenedGeomModelDataSourceProvider.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. #ifndef PXR_USD_IMAGING_USD_IMAGING_FLATTENED_GEOM_MODEL_DATA_SOURCE_PROVIDER_H #define PXR_USD_IMAGING_USD_IMAGING_FLATTENED_GEOM_MODEL_DATA_SOURCE_PROVIDER_H diff --git a/pxr/usdImaging/usdImaging/geomModelAPIAdapter.cpp b/pxr/usdImaging/usdImaging/geomModelAPIAdapter.cpp index fbc6410608..352fb17e1d 100644 --- a/pxr/usdImaging/usdImaging/geomModelAPIAdapter.cpp +++ b/pxr/usdImaging/usdImaging/geomModelAPIAdapter.cpp @@ -1,29 +1,12 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/geomModelAPIAdapter.h" -#include "pxr/usdImaging/usdImaging/dataSourceSchemaBased.h" +#include "pxr/usdImaging/usdImaging/dataSourceMapped.h" #include "pxr/usdImaging/usdImaging/geomModelSchema.h" #include "pxr/usdImaging/usdImaging/tokens.h" #include "pxr/imaging/hd/extentSchema.h" @@ -38,30 +21,34 @@ PXR_NAMESPACE_OPEN_SCOPE namespace { -struct _GeomModelTranslator +std::vector +_GetAttributeMappings() { - static - TfToken - UsdAttributeNameToHdName(const TfToken &name) - { - const std::vector tokens = - SdfPath::TokenizeIdentifier(name.GetString()); - if (tokens.size() == 2 && tokens[0] == "model") { - return TfToken(tokens[1]); + std::vector result; + + for (const TfToken &usdName : + UsdGeomModelAPI::GetSchemaAttributeNames( + /* includeInherited = */ false)) { + + const std::pair nameAndMatch = + SdfPath::StripPrefixNamespace( + usdName.GetString(), "model"); + if (nameAndMatch.second) { + result.push_back( + { usdName, + HdDataSourceLocator(TfToken(nameAndMatch.first)) }); } - return TfToken(); } - static - HdDataSourceLocator - GetContainerLocator() - { - return UsdImagingGeomModelSchema::GetDefaultLocator(); - } -}; + return result; +} -using _GeomModelDataSource = UsdImagingDataSourceSchemaBased< - UsdGeomModelAPI, std::tuple<>, _GeomModelTranslator>; +const UsdImagingDataSourceMapped::AttributeMappings & +_GetMappings() { + static const UsdImagingDataSourceMapped::AttributeMappings result( + _GetAttributeMappings(), UsdImagingGeomModelSchema::GetDefaultLocator()); + return result; +} } @@ -83,27 +70,24 @@ UsdImagingGeomModelAPIAdapter::GetImagingSubprimData( return nullptr; } - if (subprim.IsEmpty()) { - // Reflect UsdGeomModelAPI as UsdImagingGeomModelSchema. - HdContainerDataSourceHandle geomModelDs = _GeomModelDataSource::New( - prim.GetPath(), UsdGeomModelAPI(prim), stageGlobals); - - // For model components, overlay applyDrawMode=true. - if (UsdModelAPI(prim).IsKind(KindTokens->component)) { - static HdContainerDataSourceHandle const applyDrawModeDs = - UsdImagingGeomModelSchema::Builder() - .SetApplyDrawMode( - HdRetainedTypedSampledDataSource::New(true)) - .Build(); - geomModelDs = HdOverlayContainerDataSource:: - OverlayedContainerDataSources(applyDrawModeDs, geomModelDs); - } - - return HdRetainedContainerDataSource::New( - UsdImagingGeomModelSchema::GetSchemaToken(), geomModelDs); + // Reflect UsdGeomModelAPI as UsdImagingGeomModelSchema. + HdContainerDataSourceHandle geomModelDs = + UsdImagingDataSourceMapped::New( + prim, prim.GetPath(), _GetMappings(), stageGlobals); + + // For model components, overlay applyDrawMode=true. + if (UsdModelAPI(prim).IsKind(KindTokens->component)) { + static HdContainerDataSourceHandle const applyDrawModeDs = + UsdImagingGeomModelSchema::Builder() + .SetApplyDrawMode( + HdRetainedTypedSampledDataSource::New(true)) + .Build(); + geomModelDs = HdOverlayContainerDataSource:: + OverlayedContainerDataSources(applyDrawModeDs, geomModelDs); } - - return nullptr; + + return HdRetainedContainerDataSource::New( + UsdImagingGeomModelSchema::GetSchemaToken(), geomModelDs); } @@ -119,7 +103,8 @@ UsdImagingGeomModelAPIAdapter::InvalidateImagingSubprim( return HdDataSourceLocatorSet(); } - return _GeomModelDataSource::Invalidate(subprim, properties); + return UsdImagingDataSourceMapped::Invalidate( + properties, _GetMappings()); } PXR_NAMESPACE_CLOSE_SCOPE diff --git a/pxr/usdImaging/usdImaging/geomModelAPIAdapter.h b/pxr/usdImaging/usdImaging/geomModelAPIAdapter.h index e80e6f720a..a88bfe29b8 100644 --- a/pxr/usdImaging/usdImaging/geomModelAPIAdapter.h +++ b/pxr/usdImaging/usdImaging/geomModelAPIAdapter.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_GEOM_MODEL_API_ADAPTER_H #define PXR_USD_IMAGING_USD_IMAGING_GEOM_MODEL_API_ADAPTER_H diff --git a/pxr/usdImaging/usdImaging/geomModelSchema.cpp b/pxr/usdImaging/usdImaging/geomModelSchema.cpp index f38cd7a182..77e0e2ad71 100644 --- a/pxr/usdImaging/usdImaging/geomModelSchema.cpp +++ b/pxr/usdImaging/usdImaging/geomModelSchema.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/pxr/usdImaging/usdImaging/geomModelSchema.h b/pxr/usdImaging/usdImaging/geomModelSchema.h index c514521209..bd9ffb3b36 100644 --- a/pxr/usdImaging/usdImaging/geomModelSchema.h +++ b/pxr/usdImaging/usdImaging/geomModelSchema.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/pxr/usdImaging/usdImaging/geomSubsetAdapter.cpp b/pxr/usdImaging/usdImaging/geomSubsetAdapter.cpp index d35986979e..ae31e6ac87 100644 --- a/pxr/usdImaging/usdImaging/geomSubsetAdapter.cpp +++ b/pxr/usdImaging/usdImaging/geomSubsetAdapter.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/geomSubsetAdapter.h" @@ -34,6 +17,7 @@ #include "pxr/imaging/hd/dataSourceTypeDefs.h" #include "pxr/imaging/hd/geomSubsetSchema.h" #include "pxr/imaging/hd/overlayContainerDataSource.h" +#include "pxr/imaging/hd/retainedDataSource.h" #include "pxr/imaging/hd/tokens.h" #include "pxr/imaging/hd/types.h" @@ -157,13 +141,15 @@ UsdImagingGeomSubsetAdapter::GetImagingSubprimData( if (subprim.IsEmpty()) { UsdGeomSubset subset(prim); return HdOverlayContainerDataSource::New( - HdGeomSubsetSchema::Builder() - .SetIndices(UsdImagingDataSourceAttribute::New( - subset.GetIndicesAttr(), stageGlobals)) - .SetType(_ElementTypeConversionDataSource::New( - UsdImagingDataSourceAttribute::New( - subset.GetElementTypeAttr(), stageGlobals))) - .Build(), + HdRetainedContainerDataSource::New( + HdGeomSubsetSchema::GetSchemaToken(), + HdGeomSubsetSchema::Builder() + .SetIndices(UsdImagingDataSourceAttribute::New( + subset.GetIndicesAttr(), stageGlobals)) + .SetType(_ElementTypeConversionDataSource::New( + UsdImagingDataSourceAttribute::New( + subset.GetElementTypeAttr(), stageGlobals))) + .Build()), // The geomSubset must also be a prim so it can // pick up existing material binding handling. UsdImagingDataSourcePrim::New( diff --git a/pxr/usdImaging/usdImaging/geomSubsetAdapter.h b/pxr/usdImaging/usdImaging/geomSubsetAdapter.h index 1dbb2209e9..814d6a1d18 100644 --- a/pxr/usdImaging/usdImaging/geomSubsetAdapter.h +++ b/pxr/usdImaging/usdImaging/geomSubsetAdapter.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_GEOM_SUBSET_ADAPTER_H #define PXR_USD_IMAGING_USD_IMAGING_GEOM_SUBSET_ADAPTER_H diff --git a/pxr/usdImaging/usdImaging/geometryLightAdapter.cpp b/pxr/usdImaging/usdImaging/geometryLightAdapter.cpp index 9e3f10bddc..6367ffeff2 100644 --- a/pxr/usdImaging/usdImaging/geometryLightAdapter.cpp +++ b/pxr/usdImaging/usdImaging/geometryLightAdapter.cpp @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/geometryLightAdapter.h" #include "pxr/usdImaging/usdImaging/delegate.h" diff --git a/pxr/usdImaging/usdImaging/geometryLightAdapter.h b/pxr/usdImaging/usdImaging/geometryLightAdapter.h index 2825f0bd10..5c1abf5960 100644 --- a/pxr/usdImaging/usdImaging/geometryLightAdapter.h +++ b/pxr/usdImaging/usdImaging/geometryLightAdapter.h @@ -1,25 +1,8 @@ // // Copyright 2021 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_GEOMETRY_LIGHT_ADAPTER_H #define PXR_USD_IMAGING_USD_IMAGING_GEOMETRY_LIGHT_ADAPTER_H diff --git a/pxr/usdImaging/usdImaging/gprimAdapter.cpp b/pxr/usdImaging/usdImaging/gprimAdapter.cpp index 0e11190114..41b3195364 100644 --- a/pxr/usdImaging/usdImaging/gprimAdapter.cpp +++ b/pxr/usdImaging/usdImaging/gprimAdapter.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/gprimAdapter.h" @@ -103,10 +86,8 @@ UsdImagingGprimAdapter::_AddRprim(TfToken const& primType, { SdfPath cachePath = ResolveCachePath(usdPrim.GetPath(), instancerContext); - // For an instanced gprim, this is the instancer prim. - // For a non-instanced gprim, this is just the gprim. - UsdPrim proxyPrim = usdPrim.GetStage()->GetPrimAtPath( - cachePath.GetAbsoluteRootOrPrimPath()); + UsdPrim proxyPrim = _GetPrim(ResolveProxyPrimPath( + cachePath, instancerContext)); index->InsertRprim(primType, cachePath, proxyPrim, instancerContext ? instancerContext->instancerAdapter diff --git a/pxr/usdImaging/usdImaging/gprimAdapter.h b/pxr/usdImaging/usdImaging/gprimAdapter.h index 643ddfdf63..aad7e16017 100644 --- a/pxr/usdImaging/usdImaging/gprimAdapter.h +++ b/pxr/usdImaging/usdImaging/gprimAdapter.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_GPRIM_ADAPTER_H #define PXR_USD_IMAGING_USD_IMAGING_GPRIM_ADAPTER_H diff --git a/pxr/usdImaging/usdImaging/hdSchemaDefs.py b/pxr/usdImaging/usdImaging/hdSchemaDefs.py index 0f55b0d99d..df0160f3d1 100644 --- a/pxr/usdImaging/usdImaging/hdSchemaDefs.py +++ b/pxr/usdImaging/usdImaging/hdSchemaDefs.py @@ -1,25 +1,8 @@ # # Copyright 2023 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http:#www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # [ dict( diff --git a/pxr/usdImaging/usdImaging/hermiteCurvesAdapter.cpp b/pxr/usdImaging/usdImaging/hermiteCurvesAdapter.cpp index f343f7dafb..72ea2aeea5 100644 --- a/pxr/usdImaging/usdImaging/hermiteCurvesAdapter.cpp +++ b/pxr/usdImaging/usdImaging/hermiteCurvesAdapter.cpp @@ -1,25 +1,8 @@ // // Copyright 2020 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/hermiteCurvesAdapter.h" diff --git a/pxr/usdImaging/usdImaging/hermiteCurvesAdapter.h b/pxr/usdImaging/usdImaging/hermiteCurvesAdapter.h index 23cc7f7889..d912552497 100644 --- a/pxr/usdImaging/usdImaging/hermiteCurvesAdapter.h +++ b/pxr/usdImaging/usdImaging/hermiteCurvesAdapter.h @@ -1,25 +1,8 @@ // // Copyright 2020 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_HERMITE_CURVES_ADAPTER_H #define PXR_USD_IMAGING_USD_IMAGING_HERMITE_CURVES_ADAPTER_H diff --git a/pxr/usdImaging/usdImaging/implicitSurfaceMeshUtils.cpp b/pxr/usdImaging/usdImaging/implicitSurfaceMeshUtils.cpp index 42c8f8b871..a86f0234b2 100644 --- a/pxr/usdImaging/usdImaging/implicitSurfaceMeshUtils.cpp +++ b/pxr/usdImaging/usdImaging/implicitSurfaceMeshUtils.cpp @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/implicitSurfaceMeshUtils.h" diff --git a/pxr/usdImaging/usdImaging/implicitSurfaceMeshUtils.h b/pxr/usdImaging/usdImaging/implicitSurfaceMeshUtils.h index 9453dd60b1..642cf8c6b0 100644 --- a/pxr/usdImaging/usdImaging/implicitSurfaceMeshUtils.h +++ b/pxr/usdImaging/usdImaging/implicitSurfaceMeshUtils.h @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_IMPLICIT_SURFACE_MESH_UTILS_H #define PXR_USD_IMAGING_USD_IMAGING_IMPLICIT_SURFACE_MESH_UTILS_H diff --git a/pxr/usdImaging/usdImaging/indexProxy.cpp b/pxr/usdImaging/usdImaging/indexProxy.cpp index 37e48ceb30..098da95b1c 100644 --- a/pxr/usdImaging/usdImaging/indexProxy.cpp +++ b/pxr/usdImaging/usdImaging/indexProxy.cpp @@ -1,25 +1,8 @@ // // Copyright 2018 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/indexProxy.h" diff --git a/pxr/usdImaging/usdImaging/indexProxy.h b/pxr/usdImaging/usdImaging/indexProxy.h index 5d04423663..93dc8bfc64 100644 --- a/pxr/usdImaging/usdImaging/indexProxy.h +++ b/pxr/usdImaging/usdImaging/indexProxy.h @@ -1,25 +1,8 @@ // // Copyright 2018 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_INDEX_PROXY_H #define PXR_USD_IMAGING_USD_IMAGING_INDEX_PROXY_H diff --git a/pxr/usdImaging/usdImaging/instanceAdapter.cpp b/pxr/usdImaging/usdImaging/instanceAdapter.cpp index 8a02125c79..091678c496 100644 --- a/pxr/usdImaging/usdImaging/instanceAdapter.cpp +++ b/pxr/usdImaging/usdImaging/instanceAdapter.cpp @@ -1,28 +1,12 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/instanceAdapter.h" +#include "pxr/base/trace/trace.h" #include "pxr/usdImaging/usdImaging/delegate.h" #include "pxr/usdImaging/usdImaging/indexProxy.h" #include "pxr/usdImaging/usdImaging/instancerContext.h" @@ -62,6 +46,7 @@ #include #include +#include PXR_NAMESPACE_OPEN_SCOPE @@ -418,9 +403,9 @@ UsdImagingInstanceAdapter::_Populate(UsdPrim const& prim, // We're done modifying data structures for the passed in instance, // so now it's safe to re-enter this function to populate the // nested instances we discovered. - for (UsdPrim &prim : nestedInstances) { - _Populate(prim, index, instancerContext, instancerProxyPath); - instancerData.nestedInstances.push_back(prim.GetPath()); + for (UsdPrim &nestedPrim : nestedInstances) { + _Populate(nestedPrim, index, instancerContext, instancerProxyPath); + instancerData.nestedInstances.push_back(nestedPrim.GetPath()); } // Add a dependency on any associated hydra instancers (instancerPath, if @@ -529,7 +514,8 @@ UsdImagingInstanceAdapter::TrackVariability(UsdPrim const& prim, { if (_IsChildPrim(prim, cachePath)) { UsdImagingInstancerContext instancerContext; - _ProtoPrim const& proto = _GetProtoPrim(prim.GetPath(), + const SdfPath instancerPath = cachePath.GetParentPath(); + _ProtoPrim const& proto = _GetProtoPrim(instancerPath, cachePath, &instancerContext); if (!TF_VERIFY(proto.adapter, "%s", cachePath.GetText())) { @@ -1219,7 +1205,8 @@ UsdImagingInstanceAdapter::UpdateForTime(UsdPrim const& prim, if (_IsChildPrim(prim, cachePath)) { UsdImagingInstancerContext instancerContext; - _ProtoPrim const& proto = _GetProtoPrim(prim.GetPath(), + const SdfPath instancerPath = cachePath.GetParentPath(); + _ProtoPrim const& proto = _GetProtoPrim(instancerPath, cachePath, &instancerContext); if (!TF_VERIFY(proto.adapter, "%s", cachePath.GetText())) { @@ -1263,7 +1250,8 @@ UsdImagingInstanceAdapter::ProcessPropertyChange(UsdPrim const& prim, // a native instancing prim), pass the call through. if (_IsChildPrim(prim, cachePath)) { UsdImagingInstancerContext instancerContext; - _ProtoPrim const& proto = _GetProtoPrim(prim.GetPath(), + const SdfPath instancerPath = cachePath.GetParentPath(); + _ProtoPrim const& proto = _GetProtoPrim(instancerPath, cachePath, &instancerContext); if (!proto.adapter) { @@ -1363,7 +1351,7 @@ UsdImagingInstanceAdapter::_ResyncPath(SdfPath const& cachePath, void UsdImagingInstanceAdapter::ProcessPrimResync(SdfPath const& cachePath, UsdImagingIndexProxy* index) { - if (cachePath.IsPropertyPath()) { + if (IsChildPath(cachePath)) { _ResyncPath(cachePath.GetParentPath(), index, /*reload=*/true); } else { _ResyncPath(cachePath, index, /*reload=*/true); @@ -1373,7 +1361,7 @@ void UsdImagingInstanceAdapter::ProcessPrimResync(SdfPath const& cachePath, void UsdImagingInstanceAdapter::ProcessPrimRemoval(SdfPath const& cachePath, UsdImagingIndexProxy* index) { - if (cachePath.IsPropertyPath()) { + if (IsChildPath(cachePath)) { _ResyncPath(cachePath.GetParentPath(), index, /*reload=*/false); } else { _ResyncPath(cachePath, index, /*reload=*/false); @@ -1388,7 +1376,8 @@ UsdImagingInstanceAdapter::MarkDirty(UsdPrim const& prim, { if (_IsChildPrim(prim, cachePath)) { UsdImagingInstancerContext instancerContext; - _ProtoPrim const& proto = _GetProtoPrim(prim.GetPath(), + const SdfPath instancerPath = cachePath.GetParentPath(); + _ProtoPrim const& proto = _GetProtoPrim(instancerPath, cachePath, &instancerContext); if (TF_VERIFY(proto.adapter, "%s", cachePath.GetText())) { @@ -1414,7 +1403,8 @@ UsdImagingInstanceAdapter::MarkRefineLevelDirty(UsdPrim const& prim, // so make sure the message gets forwarded if (_IsChildPrim(prim, cachePath)) { UsdImagingInstancerContext instancerContext; - _ProtoPrim const& proto = _GetProtoPrim(prim.GetPath(), + const SdfPath instancerPath = cachePath.GetParentPath(); + _ProtoPrim const& proto = _GetProtoPrim(instancerPath, cachePath, &instancerContext); @@ -1433,7 +1423,8 @@ UsdImagingInstanceAdapter::MarkReprDirty(UsdPrim const& prim, // so make sure the message gets forwarded if (_IsChildPrim(prim, cachePath)) { UsdImagingInstancerContext instancerContext; - _ProtoPrim const& proto = _GetProtoPrim(prim.GetPath(), + const SdfPath instancerPath = cachePath.GetParentPath(); + _ProtoPrim const& proto = _GetProtoPrim(instancerPath, cachePath, &instancerContext); @@ -1452,7 +1443,8 @@ UsdImagingInstanceAdapter::MarkCullStyleDirty(UsdPrim const& prim, // so make sure the message gets forwarded if (_IsChildPrim(prim, cachePath)) { UsdImagingInstancerContext instancerContext; - _ProtoPrim const& proto = _GetProtoPrim(prim.GetPath(), + const SdfPath instancerPath = cachePath.GetParentPath(); + _ProtoPrim const& proto = _GetProtoPrim(instancerPath, cachePath, &instancerContext); @@ -1471,7 +1463,8 @@ UsdImagingInstanceAdapter::MarkRenderTagDirty(UsdPrim const& prim, // so make sure the message gets forwarded if (_IsChildPrim(prim, cachePath)) { UsdImagingInstancerContext instancerContext; - _ProtoPrim const& proto = _GetProtoPrim(prim.GetPath(), + const SdfPath instancerPath = cachePath.GetParentPath(); + _ProtoPrim const& proto = _GetProtoPrim(instancerPath, cachePath, &instancerContext); @@ -1487,7 +1480,8 @@ UsdImagingInstanceAdapter::MarkTransformDirty(UsdPrim const& prim, { if (_IsChildPrim(prim, cachePath)) { UsdImagingInstancerContext instancerContext; - _ProtoPrim const& proto = _GetProtoPrim(prim.GetPath(), + const SdfPath instancerPath = cachePath.GetParentPath(); + _ProtoPrim const& proto = _GetProtoPrim(instancerPath, cachePath, &instancerContext); @@ -1513,7 +1507,8 @@ UsdImagingInstanceAdapter::MarkVisibilityDirty(UsdPrim const& prim, { if (_IsChildPrim(prim, cachePath)) { UsdImagingInstancerContext instancerContext; - _ProtoPrim const& proto = _GetProtoPrim(prim.GetPath(), + const SdfPath instancerPath = cachePath.GetParentPath(); + _ProtoPrim const& proto = _GetProtoPrim(instancerPath, cachePath, &instancerContext); @@ -1599,7 +1594,8 @@ UsdImagingInstanceAdapter::GetInstancerTransform(UsdPrim const& instancerPrim, TRACE_FUNCTION(); UsdImagingInstancerContext instancerContext; _ProtoPrim const *proto; - if (_GetProtoPrimForChild(instancerPrim, instancerPath, &proto, &instancerContext)) { + if (_GetProtoPrimForChild(instancerPrim, instancerPath, + &proto, &instancerContext)) { return proto->adapter->GetInstancerTransform( _GetPrim(proto->path), instancerPath, time); } @@ -1635,7 +1631,8 @@ UsdImagingInstanceAdapter::GetInstancerPrototypes( if (_IsChildPrim(usdPrim, cachePath)) { UsdImagingInstancerContext instancerContext; - _ProtoPrim const& proto = _GetProtoPrim(usdPrim.GetPath(), + const SdfPath instancerPath = cachePath.GetParentPath(); + _ProtoPrim const& proto = _GetProtoPrim(instancerPath, cachePath, &instancerContext); if (!TF_VERIFY(proto.adapter, "%s", cachePath.GetText())) { return SdfPathVector(); @@ -1693,7 +1690,8 @@ UsdImagingInstanceAdapter::SampleTransform( // Note that the proto group in this proto has not yet been // updated with new instances at this point. UsdImagingInstancerContext instancerContext; - _ProtoPrim const& proto = _GetProtoPrim(usdPrim.GetPath(), + const SdfPath instancerPath = cachePath.GetParentPath(); + _ProtoPrim const& proto = _GetProtoPrim(instancerPath, cachePath, &instancerContext); if (!TF_VERIFY(proto.adapter, "%s", cachePath.GetText())) { @@ -1730,7 +1728,8 @@ UsdImagingInstanceAdapter::SamplePrimvar( // Note that the proto group in this proto has not yet been // updated with new instances at this point. UsdImagingInstancerContext instancerContext; - _ProtoPrim const& proto = _GetProtoPrim(usdPrim.GetPath(), + const SdfPath instancerPath = cachePath.GetParentPath(); + _ProtoPrim const& proto = _GetProtoPrim(instancerPath, cachePath, &instancerContext); if (!TF_VERIFY(proto.adapter, "%s", cachePath.GetText())) { @@ -1877,6 +1876,15 @@ UsdImagingInstanceAdapter::GetExtent(UsdPrim const& usdPrim, return BaseAdapter::GetExtent(usdPrim, cachePath, time); } +bool +UsdImagingInstanceAdapter::IsChildPath( + const SdfPath& path) const +{ + TRACE_FUNCTION(); + static const std::regex regex("^proto_[^.\\/\\s]+_id\\d+$"); + return std::regex_match(path.GetName(), regex); +} + /*virtual*/ bool UsdImagingInstanceAdapter::GetVisible(UsdPrim const& usdPrim, @@ -2120,7 +2128,8 @@ UsdImagingInstanceAdapter::Get(UsdPrim const& usdPrim, if (_IsChildPrim(usdPrim, cachePath)) { UsdImagingInstancerContext instancerContext; - _ProtoPrim const& proto = _GetProtoPrim(usdPrim.GetPath(), + const SdfPath instancerPath = cachePath.GetParentPath(); + _ProtoPrim const& proto = _GetProtoPrim(instancerPath, cachePath, &instancerContext); if (!TF_VERIFY(proto.adapter, "%s", cachePath.GetText())) { @@ -2303,8 +2312,8 @@ UsdImagingInstanceAdapter::_GetProtoPrimForChild( if (!_IsChildPrim(usdPrim, cachePath)) { return false; } - - *proto = &_GetProtoPrim(usdPrim.GetPath(),cachePath, ctx); + const SdfPath instancerPath = cachePath.GetParentPath(); + *proto = &_GetProtoPrim(instancerPath, cachePath, ctx); if (!TF_VERIFY((*proto)->adapter, "%s", cachePath.GetText())) { return false; @@ -2593,9 +2602,9 @@ UsdImagingInstanceAdapter::GetScenePrimPaths( "GetScenePrimPaths: instance proto = %s\n", cachePath.GetText()); UsdImagingInstancerContext instancerContext; + const SdfPath instancerPath = cachePath.GetParentPath(); _ProtoPrim const& proto = _GetProtoPrim( - cachePath.GetAbsoluteRootOrPrimPath(), - cachePath, &instancerContext); + instancerPath, cachePath, &instancerContext); if (!proto.adapter) { return SdfPathVector(instanceIndices.size()); @@ -2636,6 +2645,10 @@ UsdImagingInstanceAdapter::GetScenePrimPaths( } } + // Ensure the result vector is the same size as instanceIndices + // even if there are no valid instance indices. + result.resize(instanceIndices.size()); + // at least one index was valid, get the prim paths if (validIndices > 0) { // For each valid requested index provide a mapping into the result vector @@ -2656,7 +2669,6 @@ UsdImagingInstanceAdapter::GetScenePrimPaths( } } - result.resize(validIndices); _GetScenePrimPathsFn primPathsFn( this, requestedIndicesMap, minIdx, result, proto.path); _RunForAllInstancesToDraw(instancerPrim, &primPathsFn); @@ -2833,7 +2845,7 @@ struct UsdImagingInstanceAdapter::_PopulateInstanceSelectionFn if (selectionCount == selectionPathVec.size()) { for (auto const& pair : instrData->primMap) { UsdPrim prefixPrim = - adapter->_GetPrim(pair.first.GetAbsoluteRootOrPrimPath()); + adapter->_GetPrim(pair.first.GetParentPath()); added |= pair.second.adapter->PopulateSelection( highlightMode, pair.first, prefixPrim, hydraInstanceIndex, instanceIndices, result); @@ -2859,7 +2871,7 @@ struct UsdImagingInstanceAdapter::_PopulateInstanceSelectionFn // use a prefix prim to fully select the proto, in case // it's a gprim with name mangling. selectionPrim = adapter->_GetPrim( - pair.first.GetAbsoluteRootOrPrimPath()); + pair.first.GetParentPath()); } else if (!selectionPathVec[selectionCount].HasPrefix( pair.second.path)) { // If the selection path isn't a prefix of the proto, @@ -2913,9 +2925,9 @@ UsdImagingInstanceAdapter::PopulateSelection( // path; this is reflected in the fact that _GetProtoPrim has a case // for this to walk all of the instancer datas looking for a match. UsdImagingInstancerContext instancerContext; + const SdfPath instancerPath = cachePath.GetParentPath(); _ProtoPrim const& proto = _GetProtoPrim( - cachePath.GetAbsoluteRootOrPrimPath(), - cachePath, &instancerContext); + instancerPath, cachePath, &instancerContext); if (!proto.adapter) { return false; @@ -3007,7 +3019,8 @@ UsdImagingInstanceAdapter::GetVolumeFieldDescriptors( if (IsChildPath(id)) { // Delegate to child adapter and USD prim. UsdImagingInstancerContext instancerContext; - _ProtoPrim const& proto = _GetProtoPrim(usdPrim.GetPath(), + const SdfPath instancerPath = id.GetParentPath(); + _ProtoPrim const& proto = _GetProtoPrim(instancerPath, id, &instancerContext); if (!TF_VERIFY(proto.adapter, "%s", usdPrim.GetPath().GetText())) { diff --git a/pxr/usdImaging/usdImaging/instanceAdapter.h b/pxr/usdImaging/usdImaging/instanceAdapter.h index 55d6dfeb53..415fc78ae7 100644 --- a/pxr/usdImaging/usdImaging/instanceAdapter.h +++ b/pxr/usdImaging/usdImaging/instanceAdapter.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_INSTANCE_ADAPTER_H #define PXR_USD_IMAGING_USD_IMAGING_INSTANCE_ADAPTER_H @@ -27,6 +10,7 @@ /// \file usdImaging/instanceAdapter.h #include "pxr/pxr.h" +#include "pxr/usdImaging/usdImaging/api.h" #include "pxr/usdImaging/usdImaging/primAdapter.h" #include "pxr/base/tf/hashmap.h" @@ -258,6 +242,8 @@ class UsdImagingInstanceAdapter : public UsdImagingPrimAdapter UsdTimeCode time) const override; USDIMAGING_API + bool IsChildPath(const SdfPath& path) const override; + bool GetVisible(UsdPrim const& usdPrim, SdfPath const& cachePath, UsdTimeCode time) const override; diff --git a/pxr/usdImaging/usdImaging/instanceablePrimAdapter.cpp b/pxr/usdImaging/usdImaging/instanceablePrimAdapter.cpp index e345c36a5f..9cb5a890b0 100644 --- a/pxr/usdImaging/usdImaging/instanceablePrimAdapter.cpp +++ b/pxr/usdImaging/usdImaging/instanceablePrimAdapter.cpp @@ -1,25 +1,8 @@ // // Copyright 2024 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/instanceablePrimAdapter.h" @@ -52,7 +35,7 @@ UsdImagingInstanceablePrimAdapter::ResolveCachePath( // for instanced prims, cachePath will be something like: // // primPath: /__Prototype_1/cube - // cachePath: /Models/cube_0.proto_cube_id0 + // cachePath: /Models/cube_0/proto_cube_id0 // // The name-mangling is so that multiple instancers/adapters can track the // same underlying UsdPrim. @@ -66,10 +49,21 @@ UsdImagingInstanceablePrimAdapter::ResolveCachePath( cachePath = instancer; } if (!childName.IsEmpty()) { - cachePath = cachePath.AppendProperty(childName); + cachePath = cachePath.AppendChild(childName); } } return cachePath; } +SdfPath +UsdImagingInstanceablePrimAdapter::ResolveProxyPrimPath( + const SdfPath& cachePath, + const UsdImagingInstancerContext* instancerContext) const +{ + if (instancerContext && !instancerContext->instancerCachePath.IsEmpty()) { + return instancerContext->instancerCachePath.GetAbsoluteRootOrPrimPath(); + } + return cachePath; +} + PXR_NAMESPACE_CLOSE_SCOPE diff --git a/pxr/usdImaging/usdImaging/instanceablePrimAdapter.h b/pxr/usdImaging/usdImaging/instanceablePrimAdapter.h index a9fd2401f0..65f990c82a 100644 --- a/pxr/usdImaging/usdImaging/instanceablePrimAdapter.h +++ b/pxr/usdImaging/usdImaging/instanceablePrimAdapter.h @@ -1,25 +1,8 @@ // // Copyright 2024 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_INSTANCEABLE_PRIM_ADAPTER_H #define PXR_USD_IMAGING_USD_IMAGING_INSTANCEABLE_PRIM_ADAPTER_H @@ -56,6 +39,14 @@ class UsdImagingInstanceablePrimAdapter : public UsdImagingPrimAdapter const SdfPath& usdPath, const UsdImagingInstancerContext* instancerContext = nullptr) const override; + + // Given the cachePath and instancerContext, resolve the proxy prim path + USDIMAGING_API + SdfPath + ResolveProxyPrimPath( + const SdfPath& cachePath, + const UsdImagingInstancerContext* + instancerContext = nullptr) const; }; PXR_NAMESPACE_CLOSE_SCOPE diff --git a/pxr/usdImaging/usdImaging/instancerContext.cpp b/pxr/usdImaging/usdImaging/instancerContext.cpp index 2d6269fe50..4f9eadce02 100644 --- a/pxr/usdImaging/usdImaging/instancerContext.cpp +++ b/pxr/usdImaging/usdImaging/instancerContext.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/instancerContext.h" diff --git a/pxr/usdImaging/usdImaging/instancerContext.h b/pxr/usdImaging/usdImaging/instancerContext.h index 86dab4d3bc..f2d631cc98 100644 --- a/pxr/usdImaging/usdImaging/instancerContext.h +++ b/pxr/usdImaging/usdImaging/instancerContext.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_INSTANCER_CONTEXT_H #define PXR_USD_IMAGING_USD_IMAGING_INSTANCER_CONTEXT_H diff --git a/pxr/usdImaging/usdImaging/lightAPIAdapter.cpp b/pxr/usdImaging/usdImaging/lightAPIAdapter.cpp index e83066fcbf..5da776ffd3 100644 --- a/pxr/usdImaging/usdImaging/lightAPIAdapter.cpp +++ b/pxr/usdImaging/usdImaging/lightAPIAdapter.cpp @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/lightAPIAdapter.h" #include "pxr/usdImaging/usdImaging/primAdapter.h" @@ -48,24 +31,6 @@ TF_REGISTRY_FUNCTION(TfType) namespace { -// XXX: Borrowed from collectionCache.cpp. Need to be able to prevent creation -// of meaningless categories for light and shadow linking as both an -// optimization and to allow lights without linking to work correctly now. -// TODO: Remove copy of this code once collection-to-category mechanisms -// are defined -- which may mean use of a refactored -// UsdImaging_CollectionCache in which the code is already shared. -// A query is trivial if it includes everything. -bool -_IsQueryTrivial(UsdCollectionAPI::MembershipQuery const& query) -{ - // XXX Should be a faster way to do this! - UsdCollectionAPI::MembershipQuery::PathExpansionRuleMap ruleMap = - query.GetAsPathExpansionRuleMap(); - return ruleMap.size() == 1 && - ruleMap.begin()->first == SdfPath::AbsoluteRootPath() && - ruleMap.begin()->second == UsdTokens->expandPrims; -} - class _LightDataSource final : public HdContainerDataSource { public: @@ -84,37 +49,12 @@ class _LightDataSource final : public HdContainerDataSource SdfPathVector filterPaths; _lightApi.GetFiltersRel().GetForwardedTargets(&filterPaths); return HdCreateTypedRetainedDataSource(VtValue(filterPaths)); - } else if (name == HdTokens->lightLink) { - // exclude lightLink values for unauthored or collections which - // would otherwise match everything - UsdCollectionAPI c = _lightApi.GetLightLinkCollectionAPI(); - if (_IsQueryTrivial(c.ComputeMembershipQuery())) { - return nullptr; - } - - // NOTE: The value here corresponds to the "category" name - // generated from our linking collection. For USD lights, - // that will be the full property path to the linking - // collection. - return HdRetainedTypedSampledDataSource::New( - c.GetCollectionPath().GetToken()); - } else if (name == HdTokens->shadowLink) { - // exclude shadowLink values for unauthored or collections which - // would otherwise match everything - UsdCollectionAPI c = _lightApi.GetShadowLinkCollectionAPI(); - if (_IsQueryTrivial(c.ComputeMembershipQuery())) { - return nullptr; - } - // NOTE: The value here corresponds to the "category" name - // generated from our linking collection. For USD lights, - // that will be the full property path to the linking - // collection. - return HdRetainedTypedSampledDataSource::New( - c.GetCollectionPath().GetToken()); - } else if (name == HdTokens->isLight) { + } + if (name == HdTokens->isLight) { return HdRetainedTypedSampledDataSource::New(true); - } else if (name == HdTokens->materialSyncMode) { + } + if (name == HdTokens->materialSyncMode) { if (UsdAttribute attr = _lightApi.GetMaterialSyncModeAttr()) { TfToken v; if (attr.Get(&v)) { @@ -135,8 +75,6 @@ class _LightDataSource final : public HdContainerDataSource _lightApi.GetPrim().GetPath(), HdLightSchema::GetDefaultLocator().Append(name)); } - - } return nullptr; @@ -146,10 +84,13 @@ class _LightDataSource final : public HdContainerDataSource static const TfTokenVector & _GetNames() { + // Light linking fields 'lightLink' and 'shadowLink' that provide the + // category ID for the corresponding collection are computed by a + // scene index downstream. + // The collections are transported by collectionAPIAdapter. + // static const TfTokenVector names = { HdTokens->filters, - HdTokens->lightLink, - HdTokens->shadowLink, HdTokens->isLight, HdTokens->materialSyncMode, }; @@ -227,18 +168,11 @@ UsdImagingLightAPIAdapter::InvalidateImagingSubprim( // since we report parameter values in the "light" data source // also, we need to invalidate it also result.insert(HdLightSchema::GetDefaultLocator()); - } - // NOTE: Having to make assumptions regarding relevant linking - // parameters as the relevant USD schemas don't offer static - // functions for name comparison without access to the prim - // instance. Let's assume collections defined here are linking - // related. - if (!dirtiedLight - && (UsdCollectionAPI::CanContainPropertyName(propertyName) - // This will capture other contents of light data source - || TfStringStartsWith(propertyName.GetString(), "light:"))){ + if (!dirtiedLight && !dirtiedMaterial && + // This will capture other contents of light data source + TfStringStartsWith(propertyName.GetString(), "light:")) { dirtiedLight = true; result.insert(HdLightSchema::GetDefaultLocator()); } diff --git a/pxr/usdImaging/usdImaging/lightAPIAdapter.h b/pxr/usdImaging/usdImaging/lightAPIAdapter.h index cddfb12adb..8aff9ff1f9 100644 --- a/pxr/usdImaging/usdImaging/lightAPIAdapter.h +++ b/pxr/usdImaging/usdImaging/lightAPIAdapter.h @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_LIGHT_API_ADAPTER_H #define PXR_USD_IMAGING_USD_IMAGING_LIGHT_API_ADAPTER_H diff --git a/pxr/usdImaging/usdImaging/lightAdapter.cpp b/pxr/usdImaging/usdImaging/lightAdapter.cpp index e2d3faede2..7acd957f86 100644 --- a/pxr/usdImaging/usdImaging/lightAdapter.cpp +++ b/pxr/usdImaging/usdImaging/lightAdapter.cpp @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/lightAdapter.h" #include "pxr/usdImaging/usdImaging/dataSourcePrim.h" @@ -273,10 +256,6 @@ UsdImagingLightAdapter::GetMaterialResource(UsdPrim const &prim, SdfPath const& cachePath, UsdTimeCode time) const { - if (!_GetSceneLightsEnabled()) { - return VtValue(); - } - if (!prim.HasAPI()) { TF_RUNTIME_ERROR("Expected light prim at <%s> to have an applied API " "of type 'UsdLuxLightAPI'; ignoring", @@ -298,6 +277,14 @@ UsdImagingLightAdapter::GetMaterialResource(UsdPrim const &prim, &networkMap, time); + if (!_GetSceneLightsEnabled()) { + // When scene lights are disabeled we need to mark them as disabled + // by setting the intensity value to 0. This parameter is found on + // the terminal node, which is the last node in the light network. + networkMap.map[HdMaterialTerminalTokens->light].nodes.back(). + parameters[HdLightTokens->intensity] = 0.0f; + } + return VtValue(networkMap); } @@ -309,11 +296,8 @@ UsdImagingLightAdapter::_AddSprim( const UsdImagingInstancerContext* instancerContext) { SdfPath cachePath = ResolveCachePath(usdPrim.GetPath(), instancerContext); - - // For an instanced light prim, this is the instancer prim. - // For a non-instanced light prim, this is just the light prim. - UsdPrim proxyPrim = usdPrim.GetStage()->GetPrimAtPath( - cachePath.GetAbsoluteRootOrPrimPath()); + UsdPrim proxyPrim = _GetPrim(ResolveProxyPrimPath( + cachePath, instancerContext)); if (instancerContext != nullptr) { index->InsertSprim( diff --git a/pxr/usdImaging/usdImaging/lightAdapter.h b/pxr/usdImaging/usdImaging/lightAdapter.h index ed9e7c1096..2fa45d076a 100644 --- a/pxr/usdImaging/usdImaging/lightAdapter.h +++ b/pxr/usdImaging/usdImaging/lightAdapter.h @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_LIGHT_ADAPTER_H #define PXR_USD_IMAGING_USD_IMAGING_LIGHT_ADAPTER_H diff --git a/pxr/usdImaging/usdImaging/lightFilterAdapter.cpp b/pxr/usdImaging/usdImaging/lightFilterAdapter.cpp index 779341063c..875d768f82 100644 --- a/pxr/usdImaging/usdImaging/lightFilterAdapter.cpp +++ b/pxr/usdImaging/usdImaging/lightFilterAdapter.cpp @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/lightFilterAdapter.h" @@ -170,7 +153,8 @@ UsdImagingLightFilterAdapter::MarkVisibilityDirty(UsdPrim const& prim, SdfPath const& cachePath, UsdImagingIndexProxy* index) { - // TBD + // "DirtyParam" is the catch-all bit for light params. + index->MarkSprimDirty(cachePath, HdLight::DirtyBits::DirtyParams); } VtValue diff --git a/pxr/usdImaging/usdImaging/lightFilterAdapter.h b/pxr/usdImaging/usdImaging/lightFilterAdapter.h index c243b08966..9b3cd5dde4 100644 --- a/pxr/usdImaging/usdImaging/lightFilterAdapter.h +++ b/pxr/usdImaging/usdImaging/lightFilterAdapter.h @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_LIGHT_FILTER_ADAPTER_H #define PXR_USD_IMAGING_USD_IMAGING_LIGHT_FILTER_ADAPTER_H diff --git a/pxr/usdImaging/usdImaging/materialAdapter.cpp b/pxr/usdImaging/usdImaging/materialAdapter.cpp index 78dc14a2ce..070189a305 100644 --- a/pxr/usdImaging/usdImaging/materialAdapter.cpp +++ b/pxr/usdImaging/usdImaging/materialAdapter.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/materialAdapter.h" #include "pxr/usdImaging/usdImaging/dataSourceMaterial.h" @@ -335,6 +318,11 @@ UsdImagingMaterialAdapter::GetMaterialResource(UsdPrim const &prim, UsdTimeCode time) const { TRACE_FUNCTION(); + if (!prim) { + TF_RUNTIME_ERROR("Received prim is null."); + return VtValue(); + } + if (!_GetSceneMaterialsEnabled()) { return VtValue(); } diff --git a/pxr/usdImaging/usdImaging/materialAdapter.h b/pxr/usdImaging/usdImaging/materialAdapter.h index 17db5bd66b..d8644d4fb5 100644 --- a/pxr/usdImaging/usdImaging/materialAdapter.h +++ b/pxr/usdImaging/usdImaging/materialAdapter.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_MATERIAL_ADAPTER_H #define PXR_USD_IMAGING_USD_IMAGING_MATERIAL_ADAPTER_H diff --git a/pxr/usdImaging/usdImaging/materialBindingAPIAdapter.cpp b/pxr/usdImaging/usdImaging/materialBindingAPIAdapter.cpp index 031287e356..ae366c7bfa 100644 --- a/pxr/usdImaging/usdImaging/materialBindingAPIAdapter.cpp +++ b/pxr/usdImaging/usdImaging/materialBindingAPIAdapter.cpp @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/materialBindingAPIAdapter.h" diff --git a/pxr/usdImaging/usdImaging/materialBindingAPIAdapter.h b/pxr/usdImaging/usdImaging/materialBindingAPIAdapter.h index 1c93804a93..e829b4c8d0 100644 --- a/pxr/usdImaging/usdImaging/materialBindingAPIAdapter.h +++ b/pxr/usdImaging/usdImaging/materialBindingAPIAdapter.h @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_MATERIAL_BINDING_API_ADAPTER_H #define PXR_USD_IMAGING_USD_IMAGING_MATERIAL_BINDING_API_ADAPTER_H diff --git a/pxr/usdImaging/usdImaging/materialBindingsResolvingSceneIndex.cpp b/pxr/usdImaging/usdImaging/materialBindingsResolvingSceneIndex.cpp index 7981365736..24ebf9ab94 100644 --- a/pxr/usdImaging/usdImaging/materialBindingsResolvingSceneIndex.cpp +++ b/pxr/usdImaging/usdImaging/materialBindingsResolvingSceneIndex.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. #include "pxr/usdImaging/usdImaging/materialBindingsResolvingSceneIndex.h" @@ -28,8 +11,6 @@ #include "pxr/usdImaging/usdImaging/directMaterialBindingSchema.h" #include "pxr/usdImaging/usdImaging/directMaterialBindingsSchema.h" -#include "pxr/imaging/hd/geomSubsetSchema.h" -#include "pxr/imaging/hd/geomSubsetsSchema.h" #include "pxr/imaging/hd/materialBindingsSchema.h" #include "pxr/imaging/hd/materialBindingSchema.h" #include "pxr/imaging/hd/meshSchema.h" @@ -134,95 +115,6 @@ class _HdMaterialBindingsDataSource final : public HdContainerDataSource const SdfPath _primPath; }; -// Overide that provides the resolved material bindings for a geom subset. -// -class _GeomSubsetDataSource final : public HdContainerDataSource -{ -public: - HD_DECLARE_DATASOURCE(_GeomSubsetDataSource); - - _GeomSubsetDataSource( - const HdContainerDataSourceHandle &geomSubsetContainer, - const HdSceneIndexBaseRefPtr &si, - const SdfPath &geomSubsetPath) - : _geomSubsetContainer(geomSubsetContainer) - , _si(si) - , _geomSubsetPath(geomSubsetPath) - {} - - TfTokenVector - GetNames() override - { - TfTokenVector names = _geomSubsetContainer->GetNames(); - names.push_back(HdMaterialBindingsSchema::GetSchemaToken()); - return names; - } - - HdDataSourceBaseHandle - Get(const TfToken &name) override - { - HdDataSourceBaseHandle result = _geomSubsetContainer->Get(name); - - if (name == HdMaterialBindingsSchema::GetSchemaToken()) { - // Check if we have direct or collection material bindings to - // avoid returning an empty non-null container. - if (_HasDirectOrCollectionMaterialBindings(_geomSubsetContainer)) { - - // We don't expect to have hydra material bindings on the - // prim container. Use an overlay just in case such that the - // existing opinion wins. - return - HdOverlayContainerDataSource::New( - HdContainerDataSource::Cast(result), - _HdMaterialBindingsDataSource::New( - _geomSubsetContainer, _si, _geomSubsetPath)); - } - } - - return result; - } - -private: - HdContainerDataSourceHandle _geomSubsetContainer; - const HdSceneIndexBaseRefPtr _si; - const SdfPath _geomSubsetPath; -}; - -class _GeomSubsetsDataSource final : public HdContainerDataSource -{ -public: - HD_DECLARE_DATASOURCE(_GeomSubsetsDataSource); - - _GeomSubsetsDataSource( - const HdContainerDataSourceHandle &geomSubsetsContainer, - const HdSceneIndexBaseRefPtr &si, - const SdfPath &primPath) - : _geomSubsetsContainer(geomSubsetsContainer) - , _si(si) - , _primPath(primPath) - {} - - TfTokenVector - GetNames() override - { - return _geomSubsetsContainer->GetNames(); - } - - HdDataSourceBaseHandle - Get(const TfToken &name) override - { - HdDataSourceBaseHandle result = _geomSubsetsContainer->Get(name); - const SdfPath geomSubsetPath = _primPath.AppendChild(name); - return _GeomSubsetDataSource::New( - HdContainerDataSource::Cast(result), _si, geomSubsetPath); - } - -private: - HdContainerDataSourceHandle _geomSubsetsContainer; - const HdSceneIndexBaseRefPtr _si; - const SdfPath _primPath; -}; - class _MeshDataSource final : public HdContainerDataSource { public: @@ -248,11 +140,6 @@ class _MeshDataSource final : public HdContainerDataSource { HdDataSourceBaseHandle result = _meshContainer->Get(name); - if (name == HdGeomSubsetsSchema::GetSchemaToken()) { - return _GeomSubsetsDataSource::New( - HdContainerDataSource::Cast(result), _si, _primPath); - } - return result; } @@ -263,8 +150,7 @@ class _MeshDataSource final : public HdContainerDataSource }; // Prim container override that provides the resolved hydra material bindings -// if direct or collection USD material bindings are present. This is done for -// material bindings on both the prim and any geom subsets. +// if direct or collection USD material bindings are present. // class _PrimDataSource final : public HdContainerDataSource { @@ -293,7 +179,7 @@ class _PrimDataSource final : public HdContainerDataSource { HdDataSourceBaseHandle result = _primContainer->Get(name); - // Material bindings on the prim. Geom subsets are handled below. + // Material bindings on the prim. if (name == HdMaterialBindingsSchema::GetSchemaToken()) { // Check if we have direct or collection material bindings to @@ -310,20 +196,6 @@ class _PrimDataSource final : public HdContainerDataSource } } - - // XXX Current geom subsets support is limited to meshes. When that - // changes, this needs to be updated. - if (name == HdMeshSchema::GetSchemaToken()) { - // Wrap the data source only if we have geom subsets. - if (HdContainerDataSourceHandle c = - HdContainerDataSource::Cast(result)) { - - if (HdGeomSubsetsSchema gs = HdMeshSchema(c).GetGeomSubsets()) { - return _MeshDataSource::New(c, _si, _primPath); - } - } - } - return result; } @@ -451,13 +323,12 @@ UsdImagingMaterialBindingsResolvingSceneIndex::_PrimsDirtied( if (entry.dirtyLocators.Intersects(usdMaterialBindingLocators)) { HdDataSourceLocatorSet newLocators(entry.dirtyLocators); - newLocators.ReplacePrefix( + newLocators = newLocators.ReplacePrefix( UsdImagingDirectMaterialBindingsSchema::GetDefaultLocator(), HdMaterialBindingsSchema::GetDefaultLocator()); - newLocators.ReplacePrefix( + newLocators = newLocators.ReplacePrefix( UsdImagingCollectionMaterialBindingsSchema::GetDefaultLocator(), HdMaterialBindingsSchema::GetDefaultLocator()); - newEntries.push_back({entry.primPath, newLocators}); } else { newEntries.push_back(entry); diff --git a/pxr/usdImaging/usdImaging/materialBindingsResolvingSceneIndex.h b/pxr/usdImaging/usdImaging/materialBindingsResolvingSceneIndex.h index bf4950a544..5833209dd4 100644 --- a/pxr/usdImaging/usdImaging/materialBindingsResolvingSceneIndex.h +++ b/pxr/usdImaging/usdImaging/materialBindingsResolvingSceneIndex.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. #ifndef PXR_USD_IMAGING_USD_IMAGING_MATERIAL_BINDINGS_RESOLVING_SCENE_INDEX_H #define PXR_USD_IMAGING_USD_IMAGING_MATERIAL_BINDINGS_RESOLVING_SCENE_INDEX_H diff --git a/pxr/usdImaging/usdImaging/materialParamUtils.cpp b/pxr/usdImaging/usdImaging/materialParamUtils.cpp index cea038342a..047540597b 100644 --- a/pxr/usdImaging/usdImaging/materialParamUtils.cpp +++ b/pxr/usdImaging/usdImaging/materialParamUtils.cpp @@ -1,25 +1,8 @@ // // Copyright 2020 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/materialParamUtils.h" diff --git a/pxr/usdImaging/usdImaging/materialParamUtils.h b/pxr/usdImaging/usdImaging/materialParamUtils.h index 250c534023..f658cf4170 100644 --- a/pxr/usdImaging/usdImaging/materialParamUtils.h +++ b/pxr/usdImaging/usdImaging/materialParamUtils.h @@ -1,25 +1,8 @@ // // Copyright 2020 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_MATERIAL_PARAM_UTILS_H #define PXR_USD_IMAGING_MATERIAL_PARAM_UTILS_H diff --git a/pxr/usdImaging/usdImaging/meshAdapter.cpp b/pxr/usdImaging/usdImaging/meshAdapter.cpp index 7fc3bf5ec8..025c5ac70b 100644 --- a/pxr/usdImaging/usdImaging/meshAdapter.cpp +++ b/pxr/usdImaging/usdImaging/meshAdapter.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/meshAdapter.h" diff --git a/pxr/usdImaging/usdImaging/meshAdapter.h b/pxr/usdImaging/usdImaging/meshAdapter.h index e060a8161e..109cf4a694 100644 --- a/pxr/usdImaging/usdImaging/meshAdapter.h +++ b/pxr/usdImaging/usdImaging/meshAdapter.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_MESH_ADAPTER_H #define PXR_USD_IMAGING_USD_IMAGING_MESH_ADAPTER_H diff --git a/pxr/usdImaging/usdImaging/modelSchema.cpp b/pxr/usdImaging/usdImaging/modelSchema.cpp index cd54e578d3..32692e4fcd 100644 --- a/pxr/usdImaging/usdImaging/modelSchema.cpp +++ b/pxr/usdImaging/usdImaging/modelSchema.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/pxr/usdImaging/usdImaging/modelSchema.h b/pxr/usdImaging/usdImaging/modelSchema.h index e24477e1f7..1835682efe 100644 --- a/pxr/usdImaging/usdImaging/modelSchema.h +++ b/pxr/usdImaging/usdImaging/modelSchema.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/pxr/usdImaging/usdImaging/niInstanceAggregationSceneIndex.cpp b/pxr/usdImaging/usdImaging/niInstanceAggregationSceneIndex.cpp index 4806b22d1f..c88cf14144 100644 --- a/pxr/usdImaging/usdImaging/niInstanceAggregationSceneIndex.cpp +++ b/pxr/usdImaging/usdImaging/niInstanceAggregationSceneIndex.cpp @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/niInstanceAggregationSceneIndex.h" diff --git a/pxr/usdImaging/usdImaging/niInstanceAggregationSceneIndex.h b/pxr/usdImaging/usdImaging/niInstanceAggregationSceneIndex.h index 16a272ba7c..eee7c57d26 100644 --- a/pxr/usdImaging/usdImaging/niInstanceAggregationSceneIndex.h +++ b/pxr/usdImaging/usdImaging/niInstanceAggregationSceneIndex.h @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_NI_INSTANCE_AGGREGATION_SCENE_INDEX_H #define PXR_USD_IMAGING_NI_INSTANCE_AGGREGATION_SCENE_INDEX_H diff --git a/pxr/usdImaging/usdImaging/niPrototypePropagatingSceneIndex.cpp b/pxr/usdImaging/usdImaging/niPrototypePropagatingSceneIndex.cpp index 2feea9a29f..ca6cba7197 100644 --- a/pxr/usdImaging/usdImaging/niPrototypePropagatingSceneIndex.cpp +++ b/pxr/usdImaging/usdImaging/niPrototypePropagatingSceneIndex.cpp @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/niPrototypePropagatingSceneIndex.h" @@ -474,6 +457,12 @@ UsdImagingNiPrototypePropagatingSceneIndex::GetInputScenes() const } } +std::vector +UsdImagingNiPrototypePropagatingSceneIndex::GetEncapsulatedScenes() const +{ + return { _mergingSceneIndex }; +} + HdSceneIndexPrim UsdImagingNiPrototypePropagatingSceneIndex::GetPrim( const SdfPath &primPath) const diff --git a/pxr/usdImaging/usdImaging/niPrototypePropagatingSceneIndex.h b/pxr/usdImaging/usdImaging/niPrototypePropagatingSceneIndex.h index 28a5f7879e..67dcddcb32 100644 --- a/pxr/usdImaging/usdImaging/niPrototypePropagatingSceneIndex.h +++ b/pxr/usdImaging/usdImaging/niPrototypePropagatingSceneIndex.h @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_NI_PROTOTYPE_PROPAGATING_SCENE_INDEX_H #define PXR_USD_IMAGING_USD_IMAGING_NI_PROTOTYPE_PROPAGATING_SCENE_INDEX_H @@ -302,6 +285,7 @@ TF_DECLARE_REF_PTRS(UsdImagingNiPrototypePropagatingSceneIndex); /// class UsdImagingNiPrototypePropagatingSceneIndex final : public HdFilteringSceneIndexBase + , public HdEncapsulatingSceneIndexBase { public: using SceneIndexAppendCallback = @@ -337,6 +321,9 @@ class UsdImagingNiPrototypePropagatingSceneIndex final USDIMAGING_API std::vector GetInputScenes() const override; + USDIMAGING_API + std::vector GetEncapsulatedScenes() const override; + private: class _SceneIndexCache; using _SceneIndexCacheSharedPtr = diff --git a/pxr/usdImaging/usdImaging/niPrototypePruningSceneIndex.cpp b/pxr/usdImaging/usdImaging/niPrototypePruningSceneIndex.cpp index a294af4787..05474c3a4c 100644 --- a/pxr/usdImaging/usdImaging/niPrototypePruningSceneIndex.cpp +++ b/pxr/usdImaging/usdImaging/niPrototypePruningSceneIndex.cpp @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/niPrototypePruningSceneIndex.h" diff --git a/pxr/usdImaging/usdImaging/niPrototypePruningSceneIndex.h b/pxr/usdImaging/usdImaging/niPrototypePruningSceneIndex.h index de4e42fb2f..93681e4df6 100644 --- a/pxr/usdImaging/usdImaging/niPrototypePruningSceneIndex.h +++ b/pxr/usdImaging/usdImaging/niPrototypePruningSceneIndex.h @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_NI_PROTOTYPE_PRUNING_SCENE_INDEX_H #define PXR_USD_IMAGING_USD_IMAGING_NI_PROTOTYPE_PRUNING_SCENE_INDEX_H diff --git a/pxr/usdImaging/usdImaging/niPrototypeSceneIndex.cpp b/pxr/usdImaging/usdImaging/niPrototypeSceneIndex.cpp index 5c3a314a26..bd21ae7313 100644 --- a/pxr/usdImaging/usdImaging/niPrototypeSceneIndex.cpp +++ b/pxr/usdImaging/usdImaging/niPrototypeSceneIndex.cpp @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/niPrototypeSceneIndex.h" diff --git a/pxr/usdImaging/usdImaging/niPrototypeSceneIndex.h b/pxr/usdImaging/usdImaging/niPrototypeSceneIndex.h index 8088391d55..0f203c86fa 100644 --- a/pxr/usdImaging/usdImaging/niPrototypeSceneIndex.h +++ b/pxr/usdImaging/usdImaging/niPrototypeSceneIndex.h @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_NI_PROTOTYPE_SCENE_INDEX_H #define PXR_USD_IMAGING_USD_IMAGING_NI_PROTOTYPE_SCENE_INDEX_H diff --git a/pxr/usdImaging/usdImaging/nurbsCurvesAdapter.cpp b/pxr/usdImaging/usdImaging/nurbsCurvesAdapter.cpp index 89443c8a27..459b1ca6ff 100644 --- a/pxr/usdImaging/usdImaging/nurbsCurvesAdapter.cpp +++ b/pxr/usdImaging/usdImaging/nurbsCurvesAdapter.cpp @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/nurbsCurvesAdapter.h" diff --git a/pxr/usdImaging/usdImaging/nurbsCurvesAdapter.h b/pxr/usdImaging/usdImaging/nurbsCurvesAdapter.h index 889ae2687e..a5bb2faba8 100644 --- a/pxr/usdImaging/usdImaging/nurbsCurvesAdapter.h +++ b/pxr/usdImaging/usdImaging/nurbsCurvesAdapter.h @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_NURBS_CURVES_ADAPTER_H #define PXR_USD_IMAGING_USD_IMAGING_NURBS_CURVES_ADAPTER_H diff --git a/pxr/usdImaging/usdImaging/nurbsPatchAdapter.cpp b/pxr/usdImaging/usdImaging/nurbsPatchAdapter.cpp index de86ffabbc..1f0b72c720 100644 --- a/pxr/usdImaging/usdImaging/nurbsPatchAdapter.cpp +++ b/pxr/usdImaging/usdImaging/nurbsPatchAdapter.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/nurbsPatchAdapter.h" diff --git a/pxr/usdImaging/usdImaging/nurbsPatchAdapter.h b/pxr/usdImaging/usdImaging/nurbsPatchAdapter.h index cd6f4b1126..a7e23267c2 100644 --- a/pxr/usdImaging/usdImaging/nurbsPatchAdapter.h +++ b/pxr/usdImaging/usdImaging/nurbsPatchAdapter.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_NURBS_PATCH_ADAPTER_H #define PXR_USD_IMAGING_USD_IMAGING_NURBS_PATCH_ADAPTER_H diff --git a/pxr/usdImaging/usdImaging/pch.h b/pxr/usdImaging/usdImaging/pch.h index 35ea5620ec..662b7fb10d 100644 --- a/pxr/usdImaging/usdImaging/pch.h +++ b/pxr/usdImaging/usdImaging/pch.h @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // // WARNING: THIS FILE IS GENERATED. DO NOT EDIT. // @@ -28,9 +11,19 @@ #include "pxr/pxr.h" #include "pxr/base/arch/defines.h" #if defined(ARCH_OS_DARWIN) +#include +#include +#include +#include +#include #include #endif #if defined(ARCH_OS_LINUX) +#include +#include +#include +#include +#include #include #endif #if defined(ARCH_OS_WINDOWS) @@ -38,14 +31,17 @@ #define WIN32_LEAN_AND_MEAN #endif +#include #include -#include -#include -#include +#include +#include #endif #include +#include +#include #include #include +#include #include #include #include @@ -56,6 +52,7 @@ #include #include #include +#include #include #include #include @@ -69,14 +66,19 @@ #include #include #include +#include +#include #include #include +#include #include #include #include #include #include +#include #include +#include #include #include #include @@ -86,56 +88,8 @@ #include #include #include +#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #ifdef PXR_PYTHON_SUPPORT_ENABLED #include #include @@ -149,33 +103,9 @@ #undef toupper #endif #endif // PXR_PYTHON_SUPPORT_ENABLED -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include #include +#include #include #include #include @@ -186,7 +116,7 @@ #include #include #include -#include +#include #ifdef PXR_PYTHON_SUPPORT_ENABLED #include "pxr/base/tf/pySafePython.h" #endif // PXR_PYTHON_SUPPORT_ENABLED diff --git a/pxr/usdImaging/usdImaging/piPrototypePropagatingSceneIndex.cpp b/pxr/usdImaging/usdImaging/piPrototypePropagatingSceneIndex.cpp index b4165b9f0d..1af248a547 100644 --- a/pxr/usdImaging/usdImaging/piPrototypePropagatingSceneIndex.cpp +++ b/pxr/usdImaging/usdImaging/piPrototypePropagatingSceneIndex.cpp @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/piPrototypePropagatingSceneIndex.h" @@ -659,12 +642,18 @@ std::vector UsdImagingPiPrototypePropagatingSceneIndex::GetInputScenes() const { if (TfGetEnvSetting(USDIMAGING_SHOW_POINT_PROTOTYPE_SCENE_INDICES)) { - return { _context->mergingSceneIndex->GetInputScenes() }; + return _context->mergingSceneIndex->GetInputScenes(); } else { return { _context->inputSceneIndex }; } } +std::vector +UsdImagingPiPrototypePropagatingSceneIndex::GetEncapsulatedScenes() const +{ + return { _context->mergingSceneIndex }; +} + HdSceneIndexPrim UsdImagingPiPrototypePropagatingSceneIndex::GetPrim( const SdfPath &primPath) const diff --git a/pxr/usdImaging/usdImaging/piPrototypePropagatingSceneIndex.h b/pxr/usdImaging/usdImaging/piPrototypePropagatingSceneIndex.h index a2ff405086..8723366467 100644 --- a/pxr/usdImaging/usdImaging/piPrototypePropagatingSceneIndex.h +++ b/pxr/usdImaging/usdImaging/piPrototypePropagatingSceneIndex.h @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_PI_PROTOTYPE_PROPAGATING_SCENE_INDEX_H #define PXR_USD_IMAGING_USD_IMAGING_PI_PROTOTYPE_PROPAGATING_SCENE_INDEX_H @@ -365,6 +348,7 @@ using _InstancerObserverUniquePtr = std::unique_ptr; /// class UsdImagingPiPrototypePropagatingSceneIndex final : public HdFilteringSceneIndexBase + , public HdEncapsulatingSceneIndexBase { public: USDIMAGING_API @@ -380,6 +364,9 @@ class UsdImagingPiPrototypePropagatingSceneIndex final USDIMAGING_API std::vector GetInputScenes() const override; + USDIMAGING_API + std::vector GetEncapsulatedScenes() const override; + private: UsdImagingPiPrototypePropagatingSceneIndex( const HdSceneIndexBaseRefPtr &inputSceneIndex); diff --git a/pxr/usdImaging/usdImaging/piPrototypeSceneIndex.cpp b/pxr/usdImaging/usdImaging/piPrototypeSceneIndex.cpp index 00e02b78b3..bc4f5f2c49 100644 --- a/pxr/usdImaging/usdImaging/piPrototypeSceneIndex.cpp +++ b/pxr/usdImaging/usdImaging/piPrototypeSceneIndex.cpp @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/piPrototypeSceneIndex.h" diff --git a/pxr/usdImaging/usdImaging/piPrototypeSceneIndex.h b/pxr/usdImaging/usdImaging/piPrototypeSceneIndex.h index 3e85c60966..6052c5f570 100644 --- a/pxr/usdImaging/usdImaging/piPrototypeSceneIndex.h +++ b/pxr/usdImaging/usdImaging/piPrototypeSceneIndex.h @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_PI_PROTOTYPE_SCENE_INDEX_H #define PXR_USD_IMAGING_USD_IMAGING_PI_PROTOTYPE_SCENE_INDEX_H diff --git a/pxr/usdImaging/usdImaging/planeAdapter.cpp b/pxr/usdImaging/usdImaging/planeAdapter.cpp index 0719dfeed3..392faac04f 100644 --- a/pxr/usdImaging/usdImaging/planeAdapter.cpp +++ b/pxr/usdImaging/usdImaging/planeAdapter.cpp @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/planeAdapter.h" diff --git a/pxr/usdImaging/usdImaging/planeAdapter.h b/pxr/usdImaging/usdImaging/planeAdapter.h index 544e89335a..e50fe64f91 100644 --- a/pxr/usdImaging/usdImaging/planeAdapter.h +++ b/pxr/usdImaging/usdImaging/planeAdapter.h @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_PLANE_ADAPTER_H #define PXR_USD_IMAGING_USD_IMAGING_PLANE_ADAPTER_H diff --git a/pxr/usdImaging/usdImaging/plugInfo.json b/pxr/usdImaging/usdImaging/plugInfo.json index 093b4e06c0..19096d48b6 100644 --- a/pxr/usdImaging/usdImaging/plugInfo.json +++ b/pxr/usdImaging/usdImaging/plugInfo.json @@ -186,6 +186,13 @@ "isInternal": true, "primTypeName": "Sphere" }, + "UsdImagingRenderPassAdapter": { + "bases": [ + "UsdImagingPrimAdapter" + ], + "isInternal": true, + "primTypeName": "RenderPass" + }, "UsdImagingRenderSettingsAdapter": { "bases": [ "UsdImagingPrimAdapter" diff --git a/pxr/usdImaging/usdImaging/pluginLightAdapter.cpp b/pxr/usdImaging/usdImaging/pluginLightAdapter.cpp index f0aa1731e3..76a9f4fde9 100644 --- a/pxr/usdImaging/usdImaging/pluginLightAdapter.cpp +++ b/pxr/usdImaging/usdImaging/pluginLightAdapter.cpp @@ -1,25 +1,8 @@ // // Copyright 2021 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/pluginLightAdapter.h" #include "pxr/usdImaging/usdImaging/delegate.h" diff --git a/pxr/usdImaging/usdImaging/pluginLightAdapter.h b/pxr/usdImaging/usdImaging/pluginLightAdapter.h index fa9cbe708d..463df120d2 100644 --- a/pxr/usdImaging/usdImaging/pluginLightAdapter.h +++ b/pxr/usdImaging/usdImaging/pluginLightAdapter.h @@ -1,25 +1,8 @@ // // Copyright 2021 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_PLUGIN_LIGHT_ADAPTER_H #define PXR_USD_IMAGING_USD_IMAGING_PLUGIN_LIGHT_ADAPTER_H diff --git a/pxr/usdImaging/usdImaging/pluginLightFilterAdapter.cpp b/pxr/usdImaging/usdImaging/pluginLightFilterAdapter.cpp index 2e3e3154a4..02489da236 100644 --- a/pxr/usdImaging/usdImaging/pluginLightFilterAdapter.cpp +++ b/pxr/usdImaging/usdImaging/pluginLightFilterAdapter.cpp @@ -1,25 +1,8 @@ // // Copyright 2021 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/pluginLightFilterAdapter.h" #include "pxr/usdImaging/usdImaging/lightAdapter.h" diff --git a/pxr/usdImaging/usdImaging/pluginLightFilterAdapter.h b/pxr/usdImaging/usdImaging/pluginLightFilterAdapter.h index b5dab7109b..e3c66c2896 100644 --- a/pxr/usdImaging/usdImaging/pluginLightFilterAdapter.h +++ b/pxr/usdImaging/usdImaging/pluginLightFilterAdapter.h @@ -1,25 +1,8 @@ // // Copyright 2021 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_PLUGIN_LIGHT_FILTER_ADAPTER_H #define PXR_USD_IMAGING_USD_IMAGING_PLUGIN_LIGHT_FILTER_ADAPTER_H diff --git a/pxr/usdImaging/usdImaging/pointInstancerAdapter.cpp b/pxr/usdImaging/usdImaging/pointInstancerAdapter.cpp index a62bc3fcf7..0198e4500f 100644 --- a/pxr/usdImaging/usdImaging/pointInstancerAdapter.cpp +++ b/pxr/usdImaging/usdImaging/pointInstancerAdapter.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/pointInstancerAdapter.h" @@ -51,6 +34,7 @@ #include #include #include +#include #include PXR_NAMESPACE_OPEN_SCOPE @@ -531,8 +515,9 @@ UsdImagingPointInstancerAdapter::TrackVariability(UsdPrim const& prim, UsdTimeCode time(1.0); if (IsChildPath(cachePath)) { + const SdfPath instancerPath = cachePath.GetParentPath(); _ProtoPrim& proto = - const_cast<_ProtoPrim&>(_GetProtoPrim(prim.GetPath(), cachePath)); + const_cast<_ProtoPrim&>(_GetProtoPrim(instancerPath, cachePath)); if (!TF_VERIFY(proto.adapter, "%s", cachePath.GetText())) { return; } @@ -652,17 +637,29 @@ UsdImagingPointInstancerAdapter::TrackVariability(UsdPrim const& prim, HdChangeTracker::DirtyPrimvar, HdInstancerTokens->instancer, timeVaryingBits, + false) || + _IsVarying(prim, + UsdGeomTokens->angularVelocities, + HdChangeTracker::DirtyPrimvar, + HdInstancerTokens->instancer, + timeVaryingBits, false); + // See if any of the inherited primvars are time-dependent. + UsdImaging_InheritedPrimvarStrategy::value_type inheritedPrimvarRecord = + _GetInheritedPrimvars(prim.GetParent()); + if (inheritedPrimvarRecord && inheritedPrimvarRecord->variable) { + *timeVaryingBits |= HdChangeTracker::DirtyPrimvar; + HD_PERF_COUNTER_INCR(UsdImagingTokens->usdVaryingPrimvar); + } + // See if other local primvars are time-dependent. if (!(*timeVaryingBits & HdChangeTracker::DirtyPrimvar)) { UsdGeomPrimvarsAPI primvars(prim); for (auto const &pv: primvars.GetPrimvarsWithValues()) { TfToken const& interp = pv.GetInterpolation(); - if (interp != UsdGeomTokens->constant && - interp != UsdGeomTokens->uniform && - pv.ValueMightBeTimeVarying()) { + if (pv.ValueMightBeTimeVarying()) { *timeVaryingBits |= HdChangeTracker::DirtyPrimvar; - HD_PERF_COUNTER_INCR(HdInstancerTokens->instancer); + HD_PERF_COUNTER_INCR(UsdImagingTokens->usdVaryingPrimvar); break; } } @@ -684,7 +681,7 @@ UsdImagingPointInstancerAdapter::UpdateForTime(UsdPrim const& prim, // Allow the prototype's adapter to update, if there's anything left // to do. if (requestedBits != HdChangeTracker::Clean) { - // cachePath : /path/instancerPath.proto_* + // cachePath : /path/instancerPath/proto_* // instancerPath : /path/instancerPath SdfPath instancerPath = cachePath.GetParentPath(); _ProtoPrim const& proto = _GetProtoPrim(instancerPath, cachePath); @@ -700,9 +697,8 @@ UsdImagingPointInstancerAdapter::UpdateForTime(UsdPrim const& prim, protoPrim, cachePath, time, requestedBits); } } else if (_instancerData.find(cachePath) != _instancerData.end()) { - // For the instancer itself, we only send translate, rotate, scale, - // velocities, and accelerations back as primvars, which all fall into - // the DirtyPrimvar bucket currently. + // For the instancer itself, we send per-instance transform attributes + // back as primvars, which all fall into DirtyPrimvar currently. if (requestedBits & HdChangeTracker::DirtyPrimvar) { UsdGeomPointInstancer instancer(prim); @@ -764,18 +760,39 @@ UsdImagingPointInstancerAdapter::UpdateForTime(UsdPrim const& prim, HdInterpolationInstance); } - // Convert non-uniform primvars on UsdGeomPointInstancer into - // instance-rate primvars. Note: this only gets local primvars. - // Inherited primvars don't vary per-instance, so we let the - // prototypes pick them up. - UsdGeomPrimvarsAPI primvars(instancer); - for (auto const &pv: primvars.GetPrimvarsWithValues()) { - TfToken const& interp = pv.GetInterpolation(); - if (interp != UsdGeomTokens->constant && - interp != UsdGeomTokens->uniform) { - HdInterpolation interp = HdInterpolationInstance; - _ComputeAndMergePrimvar(prim, pv, time, &vPrimvars, &interp); + VtVec3fArray angularVelocities; + if (instancer.GetAngularVelocitiesAttr() + .Get(&angularVelocities, time)) { + _MergePrimvar( + &vPrimvars, + HdTokens->angularVelocities, + HdInterpolationInstance); + } + + // Pick up inherited and local constant primvars, and convert + // non-constant primvars on UsdGeomPointInstancer into + // instance-rate primvars. + std::vector primvars; + UsdImaging_InheritedPrimvarStrategy::value_type + inheritedPrimvarRecord = + _GetInheritedPrimvars(prim.GetParent()); + if (inheritedPrimvarRecord) { + primvars = inheritedPrimvarRecord->primvars; + } + + UsdGeomPrimvarsAPI primvarsApi(instancer); + std::vector local = + primvarsApi.GetPrimvarsWithValues(); + primvars.insert(primvars.end(), local.begin(), local.end()); + + for (auto const &pv: primvars) { + TfToken const& usdInterp = pv.GetInterpolation(); + HdInterpolation hdInterp = HdInterpolationInstance; + if (usdInterp == UsdGeomTokens->constant || + usdInterp == UsdGeomTokens->uniform) { + hdInterp = HdInterpolationConstant; } + _ComputeAndMergePrimvar(prim, pv, time, &vPrimvars, &hdInterp); } } } @@ -787,7 +804,8 @@ UsdImagingPointInstancerAdapter::ProcessPropertyChange(UsdPrim const& prim, TfToken const& propertyName) { if (IsChildPath(cachePath)) { - _ProtoPrim const& proto = _GetProtoPrim(prim.GetPath(), cachePath); + const SdfPath instancerPath = cachePath.GetParentPath(); + _ProtoPrim const& proto = _GetProtoPrim(instancerPath, cachePath); if (!proto.adapter || (proto.paths.size() <= 0)) { // It's possible we'll get multiple USD edits for the same // prototype, one of which will cause a resync. On resync, @@ -829,7 +847,8 @@ UsdImagingPointInstancerAdapter::ProcessPropertyChange(UsdPrim const& prim, propertyName == UsdGeomTokens->orientationsf || propertyName == UsdGeomTokens->scales || propertyName == UsdGeomTokens->velocities || - propertyName == UsdGeomTokens->accelerations) { + propertyName == UsdGeomTokens->accelerations || + propertyName == UsdGeomTokens->angularVelocities) { TfToken primvarName = propertyName; if (propertyName == UsdGeomTokens->positions) { @@ -844,6 +863,8 @@ UsdImagingPointInstancerAdapter::ProcessPropertyChange(UsdPrim const& prim, primvarName = HdTokens->velocities; } else if (propertyName == UsdGeomTokens->accelerations) { primvarName = HdTokens->accelerations; + } else if (propertyName == UsdGeomTokens->angularVelocities) { + primvarName = HdTokens->angularVelocities; } return _ProcessNonPrefixedPrimvarPropertyChange( @@ -858,18 +879,8 @@ UsdImagingPointInstancerAdapter::ProcessPropertyChange(UsdPrim const& prim, // Is the property a primvar? if (UsdGeomPrimvarsAPI::CanContainPropertyName(propertyName)) { - // Ignore local constant/uniform primvars. - UsdGeomPrimvar pv = UsdGeomPrimvarsAPI(prim).GetPrimvar(propertyName); - if (pv && (pv.GetInterpolation() == UsdGeomTokens->constant || - pv.GetInterpolation() == UsdGeomTokens->uniform)) { - return HdChangeTracker::Clean; - } - - return UsdImagingPrimAdapter::_ProcessPrefixedPrimvarPropertyChange( - prim, cachePath, propertyName, - /*valueChangeDirtyBit*/HdChangeTracker::DirtyPrimvar, - /*inherited=*/false); + prim, cachePath, propertyName); } // XXX: Treat transform & visibility changes as re-sync, until we untangle @@ -965,7 +976,7 @@ UsdImagingPointInstancerAdapter::MarkDirty(UsdPrim const& prim, UsdImagingIndexProxy* index) { if (IsChildPath(cachePath)) { - // cachePath : /path/instancerPath.proto_* + // cachePath : /path/instancerPath/proto_* // instancerPath : /path/instancerPath SdfPath instancerPath = cachePath.GetParentPath(); _ProtoPrim const& proto = _GetProtoPrim(instancerPath, cachePath); @@ -989,7 +1000,7 @@ UsdImagingPointInstancerAdapter::MarkRefineLevelDirty( UsdImagingIndexProxy* index) { if (IsChildPath(cachePath)) { - // cachePath : /path/instancerPath.proto_* + // cachePath : /path/instancerPath/proto_* // instancerPath : /path/instancerPath SdfPath instancerPath = cachePath.GetParentPath(); _ProtoPrim const& proto = _GetProtoPrim(instancerPath, cachePath); @@ -1004,7 +1015,7 @@ UsdImagingPointInstancerAdapter::MarkReprDirty(UsdPrim const& prim, UsdImagingIndexProxy* index) { if (IsChildPath(cachePath)) { - // cachePath : /path/instancerPath.proto_* + // cachePath : /path/instancerPath/proto_* // instancerPath : /path/instancerPath SdfPath instancerPath = cachePath.GetParentPath(); _ProtoPrim const& proto = _GetProtoPrim(instancerPath, cachePath); @@ -1019,7 +1030,7 @@ UsdImagingPointInstancerAdapter::MarkCullStyleDirty(UsdPrim const& prim, UsdImagingIndexProxy* index) { if (IsChildPath(cachePath)) { - // cachePath : /path/instancerPath.proto_* + // cachePath : /path/instancerPath/proto_* // instancerPath : /path/instancerPath SdfPath instancerPath = cachePath.GetParentPath(); _ProtoPrim const& proto = _GetProtoPrim(instancerPath, cachePath); @@ -1034,7 +1045,7 @@ UsdImagingPointInstancerAdapter::MarkRenderTagDirty(UsdPrim const& prim, UsdImagingIndexProxy* index) { if (IsChildPath(cachePath)) { - // cachePath : /path/instancerPath.proto_* + // cachePath : /path/instancerPath/proto_* // instancerPath : /path/instancerPath SdfPath instancerPath = cachePath.GetParentPath(); _ProtoPrim const& proto = _GetProtoPrim(instancerPath, cachePath); @@ -1049,7 +1060,7 @@ UsdImagingPointInstancerAdapter::MarkTransformDirty(UsdPrim const& prim, UsdImagingIndexProxy* index) { if (IsChildPath(cachePath)) { - // cachePath : /path/instancerPath.proto_* + // cachePath : /path/instancerPath/proto_* // instancerPath : /path/instancerPath SdfPath instancerPath = cachePath.GetParentPath(); _ProtoPrim const& proto = _GetProtoPrim(instancerPath, cachePath); @@ -1070,7 +1081,7 @@ UsdImagingPointInstancerAdapter::MarkVisibilityDirty( UsdImagingIndexProxy* index) { if (IsChildPath(cachePath)) { - // cachePath : /path/instancerPath.proto_* + // cachePath : /path/instancerPath/proto_* // instancerPath : /path/instancerPath SdfPath instancerPath = cachePath.GetParentPath(); _ProtoPrim const& proto = _GetProtoPrim(instancerPath, cachePath); @@ -1179,15 +1190,13 @@ UsdImagingPointInstancerAdapter::_GetProtoPrimForChild( UsdImagingInstancerContext* ctx) const { if (IsChildPath(cachePath)) { - *proto = &_GetProtoPrim(usdPrim.GetPath(), cachePath); + const SdfPath instancerPath = cachePath.GetParentPath(); + *proto = &_GetProtoPrim(instancerPath, cachePath); if (!TF_VERIFY(*proto)) { return false; } UsdPrim protoPrim = _GetProtoUsdPrim(**proto); - // The instancer path since IsChildPath is true - const SdfPath instancerPath = cachePath.GetParentPath(); - ctx->instancerCachePath = instancerPath; ctx->childName = cachePath.GetNameToken(); ctx->instancerMaterialUsdPath = SdfPath(); @@ -1659,7 +1668,8 @@ UsdImagingPointInstancerAdapter::GetInstancerPrototypes( HD_TRACE_FUNCTION(); if (IsChildPath(cachePath)) { - _ProtoPrim const& proto = _GetProtoPrim(usdPrim.GetPath(), cachePath); + const SdfPath instancerPath = cachePath.GetParentPath(); + _ProtoPrim const& proto = _GetProtoPrim(instancerPath, cachePath); UsdPrim protoPrim = _GetProtoUsdPrim(proto); return proto.adapter->GetInstancerPrototypes(protoPrim, cachePath); } else { @@ -1761,7 +1771,7 @@ UsdImagingPointInstancerAdapter::GetTransform(UsdPrim const& prim, ignoreRootTransform); } - // cachePath : /path/instancerPath.proto_* + // cachePath : /path/instancerPath/proto_* // instancerPath : /path/instancerPath SdfPath instancerPath = cachePath.GetParentPath(); _ProtoPrim const& proto = _GetProtoPrim(instancerPath, cachePath); @@ -1835,8 +1845,8 @@ UsdImagingPointInstancerAdapter::SamplePrimvar( if (IsChildPath(cachePath)) { // Delegate to prototype adapter and USD prim. - _ProtoPrim const& proto = _GetProtoPrim(usdPrim.GetPath(), - cachePath); + const SdfPath instancerPath = cachePath.GetParentPath(); + _ProtoPrim const& proto = _GetProtoPrim(instancerPath, cachePath); UsdPrim protoPrim = _GetProtoUsdPrim(proto); return proto.adapter->SamplePrimvar( protoPrim, cachePath, key, time, @@ -1855,6 +1865,8 @@ UsdImagingPointInstancerAdapter::SamplePrimvar( usdKey = UsdGeomTokens->velocities; } else if (key == HdTokens->accelerations) { usdKey = UsdGeomTokens->accelerations; + } else if (key == HdTokens->angularVelocities) { + usdKey = UsdGeomTokens->angularVelocities; } return UsdImagingPrimAdapter::SamplePrimvar( usdPrim, cachePath, usdKey, time, @@ -1862,6 +1874,15 @@ UsdImagingPointInstancerAdapter::SamplePrimvar( } } +bool +UsdImagingPointInstancerAdapter::IsChildPath( + const SdfPath& path) const +{ + TRACE_FUNCTION(); + static const std::regex regex("^proto\\d+_[^.\\/\\s]+_id\\d+$"); + return std::regex_match(path.GetName(), regex); +} + /*virtual*/ bool UsdImagingPointInstancerAdapter::GetVisible(UsdPrim const& prim, @@ -1875,7 +1896,7 @@ UsdImagingPointInstancerAdapter::GetVisible(UsdPrim const& prim, if (IsChildPath(cachePath)) { bool vis = false; - // cachePath : /path/instancerPath.proto_* + // cachePath : /path/instancerPath/proto_* // instancerPath : /path/instancerPath SdfPath instancerPath = cachePath.GetParentPath(); _ProtoPrim const& proto = _GetProtoPrim(instancerPath, cachePath); @@ -1932,7 +1953,8 @@ UsdImagingPointInstancerAdapter::GetPurpose( { if (IsChildPath(cachePath)) { // Delegate to prototype adapter and USD prim - _ProtoPrim const& proto = _GetProtoPrim(usdPrim.GetPath(), cachePath); + const SdfPath instancerPath = cachePath.GetParentPath(); + _ProtoPrim const& proto = _GetProtoPrim(instancerPath, cachePath); UsdPrim protoUsdPrim = _GetProtoUsdPrim(proto); UsdPrim instanceProxyPrim = _GetPrim(_GetPrimPathFromInstancerChain( @@ -1956,7 +1978,8 @@ UsdImagingPointInstancerAdapter::GetSubdivTags(UsdPrim const& usdPrim, { if (IsChildPath(cachePath)) { // Delegate to prototype adapter and USD prim. - _ProtoPrim const& proto = _GetProtoPrim(usdPrim.GetPath(), cachePath); + const SdfPath instancerPath = cachePath.GetParentPath(); + _ProtoPrim const& proto = _GetProtoPrim(instancerPath, cachePath); UsdPrim protoPrim = _GetProtoUsdPrim(proto); return proto.adapter->GetSubdivTags(protoPrim, cachePath, time); } @@ -1971,7 +1994,8 @@ UsdImagingPointInstancerAdapter::GetTopology(UsdPrim const& usdPrim, { if (IsChildPath(cachePath)) { // Delegate to prototype adapter and USD prim. - _ProtoPrim const& proto = _GetProtoPrim(usdPrim.GetPath(), cachePath); + const SdfPath instancerPath = cachePath.GetParentPath(); + _ProtoPrim const& proto = _GetProtoPrim(instancerPath, cachePath); UsdPrim protoPrim = _GetProtoUsdPrim(proto); return proto.adapter->GetTopology(protoPrim, cachePath, time); } @@ -1986,7 +2010,8 @@ UsdImagingPointInstancerAdapter::GetCullStyle(UsdPrim const& usdPrim, { if (IsChildPath(cachePath)) { // Delegate to prototype adapter and USD prim. - _ProtoPrim const& proto = _GetProtoPrim(usdPrim.GetPath(), cachePath); + const SdfPath instancerPath = cachePath.GetParentPath(); + _ProtoPrim const& proto = _GetProtoPrim(instancerPath, cachePath); UsdPrim protoPrim = _GetProtoUsdPrim(proto); return proto.adapter->GetCullStyle(protoPrim, cachePath, time); } @@ -2001,7 +2026,8 @@ UsdImagingPointInstancerAdapter::GetExtent(UsdPrim const& usdPrim, { if (IsChildPath(cachePath)) { // Delegate to prototype adapter and USD prim. - _ProtoPrim const& proto = _GetProtoPrim(usdPrim.GetPath(), cachePath); + const SdfPath instancerPath = cachePath.GetParentPath(); + _ProtoPrim const& proto = _GetProtoPrim(instancerPath, cachePath); UsdPrim protoPrim = _GetProtoUsdPrim(proto); return proto.adapter->GetExtent(protoPrim, cachePath, time); } @@ -2017,7 +2043,8 @@ UsdImagingPointInstancerAdapter::GetDoubleSided(UsdPrim const& usdPrim, { if (IsChildPath(cachePath)) { // Delegate to prototype adapter and USD prim. - _ProtoPrim const& proto = _GetProtoPrim(usdPrim.GetPath(), cachePath); + const SdfPath instancerPath = cachePath.GetParentPath(); + _ProtoPrim const& proto = _GetProtoPrim(instancerPath, cachePath); UsdPrim protoPrim = _GetProtoUsdPrim(proto); return proto.adapter->GetDoubleSided(protoPrim, cachePath, time); } @@ -2032,7 +2059,8 @@ UsdImagingPointInstancerAdapter::GetMaterialId(UsdPrim const& usdPrim, { if (IsChildPath(cachePath)) { // Delegate to prototype adapter and USD prim. - _ProtoPrim const& proto = _GetProtoPrim(usdPrim.GetPath(), cachePath); + const SdfPath instancerPath = cachePath.GetParentPath(); + _ProtoPrim const& proto = _GetProtoPrim(instancerPath, cachePath); UsdPrim protoPrim = _GetProtoUsdPrim(proto); SdfPath materialId = proto.adapter->GetMaterialId(protoPrim, cachePath, time); @@ -2057,7 +2085,8 @@ UsdImagingPointInstancerAdapter::GetLightParamValue( UsdTimeCode time) const { if (IsChildPath(cachePath)) { - const _ProtoPrim proto = _GetProtoPrim(prim.GetPath(), cachePath); + const SdfPath instancerPath = cachePath.GetParentPath(); + const _ProtoPrim proto = _GetProtoPrim(instancerPath, cachePath); UsdPrim protoPrim = _GetProtoUsdPrim(proto); return proto.adapter->GetLightParamValue( protoPrim, cachePath, paramName, time); @@ -2074,7 +2103,8 @@ UsdImagingPointInstancerAdapter::GetMaterialResource( { if (IsChildPath(cachePath)) { // Delegate to prototype adapter and USD prim. - const _ProtoPrim& proto = _GetProtoPrim(prim.GetPath(), cachePath); + const SdfPath instancerPath = cachePath.GetParentPath(); + const _ProtoPrim& proto = _GetProtoPrim(instancerPath, cachePath); UsdPrim protoPrim = _GetProtoUsdPrim(proto); return proto.adapter->GetMaterialResource(protoPrim, cachePath, time); } @@ -2093,7 +2123,8 @@ UsdImagingPointInstancerAdapter::Get(UsdPrim const& usdPrim, if (IsChildPath(cachePath)) { // Delegate to prototype adapter and USD prim. - _ProtoPrim const& proto = _GetProtoPrim(usdPrim.GetPath(), cachePath); + const SdfPath instancerPath = cachePath.GetParentPath(); + _ProtoPrim const& proto = _GetProtoPrim(instancerPath, cachePath); UsdPrim protoPrim = _GetProtoUsdPrim(proto); return proto.adapter->Get(protoPrim, cachePath, key, time, outIndices); @@ -2144,18 +2175,33 @@ UsdImagingPointInstancerAdapter::Get(UsdPrim const& usdPrim, return VtValue(accelerations); } - } else { - UsdGeomPrimvarsAPI primvars(usdPrim); - if (UsdGeomPrimvar pv = primvars.GetPrimvar(key)) { - VtValue value; - if (outIndices) { - if (pv && pv.Get(&value, time)) { - pv.GetIndices(outIndices, time); - return value; - } - } else if (pv && pv.ComputeFlattened(&value, time)) { + } else if (key == HdTokens->angularVelocities) { + UsdGeomPointInstancer instancer(usdPrim); + VtVec3fArray angularVelocities; + if (instancer.GetAngularVelocitiesAttr() + .Get(&angularVelocities, time)) { + return VtValue(angularVelocities); + } + } else if (UsdGeomPrimvar pv = + UsdGeomPrimvarsAPI(usdPrim).GetPrimvar(key)) { + VtValue value; + if (outIndices) { + if (pv && pv.Get(&value, time)) { + pv.GetIndices(outIndices, time); + return value; + } + } else if (pv && pv.ComputeFlattened(&value, time)) { + return value; + } + } else if (UsdGeomPrimvar pv = _GetInheritedPrimvar(usdPrim, key)) { + VtValue value; + if (outIndices) { + if (pv && pv.Get(&value, time)) { + pv.GetIndices(outIndices, time); return value; } + } else if (pv && pv.ComputeFlattened(&value, time)) { + return value; } } } @@ -2386,7 +2432,7 @@ UsdImagingPointInstancerAdapter::PopulateSelection( // (since we've verified the path above), so take the prim at // cachePath.GetPrimPath, since that's guaranteed to exist and be a // prefix... - UsdPrim prefixPrim = _GetPrim(cachePath.GetAbsoluteRootOrPrimPath()); + UsdPrim prefixPrim = _GetPrim(instancerPath); return proto.adapter->PopulateSelection( highlightMode, cachePath, prefixPrim, hydraInstanceIndex, instanceIndices, result); @@ -2459,7 +2505,7 @@ UsdImagingPointInstancerAdapter::PopulateSelection( instanceIndices.push_back(foundIndex); } UsdPrim selectionPrim = - _GetPrim(pair.first.GetAbsoluteRootOrPrimPath()); + _GetPrim(pair.first.GetParentPath()); added |= pair.second.adapter->PopulateSelection( highlightMode, pair.first, selectionPrim, @@ -2505,7 +2551,7 @@ UsdImagingPointInstancerAdapter::PopulateSelection( // If we've accounted for the whole selection path, fully // populate this prototype. selectionPrim = - _GetPrim(pair.first.GetAbsoluteRootOrPrimPath()); + _GetPrim(pair.first.GetParentPath()); } else if (selectionCount != 0 && instanceCount == pair.second.paths.size()) { @@ -2569,7 +2615,8 @@ UsdImagingPointInstancerAdapter::GetVolumeFieldDescriptors( { if (IsChildPath(id)) { // Delegate to prototype adapter and USD prim. - _ProtoPrim const& proto = _GetProtoPrim(usdPrim.GetPath(), id); + const SdfPath instancerPath = id.GetParentPath(); + _ProtoPrim const& proto = _GetProtoPrim(instancerPath, id); UsdPrim protoPrim = _GetProtoUsdPrim(proto); return proto.adapter->GetVolumeFieldDescriptors( protoPrim, id, time); diff --git a/pxr/usdImaging/usdImaging/pointInstancerAdapter.h b/pxr/usdImaging/usdImaging/pointInstancerAdapter.h index d41897d8be..fcc4c6d22c 100644 --- a/pxr/usdImaging/usdImaging/pointInstancerAdapter.h +++ b/pxr/usdImaging/usdImaging/pointInstancerAdapter.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_POINT_INSTANCER_ADAPTER_H #define PXR_USD_IMAGING_USD_IMAGING_POINT_INSTANCER_ADAPTER_H @@ -226,6 +209,8 @@ class UsdImagingPointInstancerAdapter : public UsdImagingInstanceablePrimAdapter UsdTimeCode time) const override; USDIMAGING_API + bool IsChildPath(const SdfPath& path) const override; + bool GetVisible(UsdPrim const& prim, SdfPath const& cachePath, UsdTimeCode time) const override; diff --git a/pxr/usdImaging/usdImaging/pointsAdapter.cpp b/pxr/usdImaging/usdImaging/pointsAdapter.cpp index df41381c06..9b3b9819e2 100644 --- a/pxr/usdImaging/usdImaging/pointsAdapter.cpp +++ b/pxr/usdImaging/usdImaging/pointsAdapter.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/pointsAdapter.h" diff --git a/pxr/usdImaging/usdImaging/pointsAdapter.h b/pxr/usdImaging/usdImaging/pointsAdapter.h index 05742caafe..29e8a641ca 100644 --- a/pxr/usdImaging/usdImaging/pointsAdapter.h +++ b/pxr/usdImaging/usdImaging/pointsAdapter.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_POINTS_ADAPTER_H #define PXR_USD_IMAGING_USD_IMAGING_POINTS_ADAPTER_H diff --git a/pxr/usdImaging/usdImaging/portalLightAdapter.cpp b/pxr/usdImaging/usdImaging/portalLightAdapter.cpp index 0f958eb684..0f1e05eebc 100644 --- a/pxr/usdImaging/usdImaging/portalLightAdapter.cpp +++ b/pxr/usdImaging/usdImaging/portalLightAdapter.cpp @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/portalLightAdapter.h" #include "pxr/usdImaging/usdImaging/delegate.h" diff --git a/pxr/usdImaging/usdImaging/portalLightAdapter.h b/pxr/usdImaging/usdImaging/portalLightAdapter.h index e536d5759c..9472a40b23 100644 --- a/pxr/usdImaging/usdImaging/portalLightAdapter.h +++ b/pxr/usdImaging/usdImaging/portalLightAdapter.h @@ -1,25 +1,8 @@ // // Copyright 2021 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_PORTAL_LIGHT_ADAPTER_H #define PXR_USD_IMAGING_USD_IMAGING_PORTAL_LIGHT_ADAPTER_H diff --git a/pxr/usdImaging/usdImaging/primAdapter.cpp b/pxr/usdImaging/usdImaging/primAdapter.cpp index 742bc0aa03..c587c372ba 100644 --- a/pxr/usdImaging/usdImaging/primAdapter.cpp +++ b/pxr/usdImaging/usdImaging/primAdapter.cpp @@ -1,28 +1,13 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/primAdapter.h" +#include "pxr/base/gf/interval.h" +#include "pxr/usd/usd/attribute.h" #include "pxr/usdImaging/usdImaging/dataSourcePrim.h" #include "pxr/usdImaging/usdImaging/debugCodes.h" #include "pxr/usdImaging/usdImaging/delegate.h" @@ -46,6 +31,8 @@ #include "pxr/base/tf/staticTokens.h" #include "pxr/base/tf/type.h" +#include +#include #include PXR_NAMESPACE_OPEN_SCOPE @@ -413,6 +400,40 @@ UsdImagingPrimAdapter::GetInstancerPrototypes( return SdfPathVector(); } +static void +_GetTimeSamplesForInterval( + const UsdAttribute& attr, + const GfInterval& interval, + std::vector* timeSamples) +{ + // Start with the times that fall within the interval + attr.GetTimeSamplesInInterval(interval, timeSamples); + // Add bracketing sample times for the leading and trailing edges of the + // interval. + double first, ignore, last; + bool hasFirst, hasLast; + // If hasFirst/hasLast comes back false for an edge, or if both the left and + // right bracketing times for the edge are the same, it means there's no + // bracketing sample time anywhere beyond that edge, so we fall back to the + // interval's edge. + attr.GetBracketingTimeSamples(interval.GetMin(), &first, &ignore, &hasFirst); + if (!hasFirst || first == ignore) { + first = interval.GetMin(); + } + attr.GetBracketingTimeSamples(interval.GetMax(), &ignore, &last, &hasLast); + if (!hasLast || last == ignore ) { + last = interval.GetMax(); + } + // Add the bracketing sample times only if they actually fall outside the + // interval. This maintains ordering and uniqueness. + if (timeSamples->empty() || first < timeSamples->front()) { + timeSamples->insert(timeSamples->begin(), first); + } + if (last > timeSamples->back()) { + timeSamples->insert(timeSamples->end(), last); + } +} + /*virtual*/ size_t UsdImagingPrimAdapter::SamplePrimvar( @@ -440,19 +461,35 @@ UsdImagingPrimAdapter::SamplePrimvar( std::vector timeSamples; if (pv && pv.HasValue()) { - if (pv.ValueMightBeTimeVarying()) { - pv.GetTimeSamplesInInterval(interval, &timeSamples); - - // Add time samples at the boundary conditions - timeSamples.push_back(interval.GetMin()); - timeSamples.push_back(interval.GetMax()); - - // Sort here - std::sort(timeSamples.begin(), timeSamples.end()); - timeSamples.erase( - std::unique(timeSamples.begin(), - timeSamples.end()), + if (pv.ValueMightBeTimeVarying()) { + // Start with the contributing times for value, including any + // contributing bracketing times. + _GetTimeSamplesForInterval(pv.GetAttr(), interval, &timeSamples); + // Only include times derived from the indices if the caller wants + // the indices separately. Otherwise we'll use ComputeFlattened, and + // the only times we need for that are the ones with authored value. + if (sampleIndices && pv.IsIndexed()) { + // Index changes during the interval that fall on times with no + // authored value are important, so we need to add the sample + // times due to indices. We don't need bracketing times though + // because indices never interpolate. + std::vector indicesTimeSamples; + pv.GetIndicesAttr().GetTimeSamplesInInterval( + interval, &indicesTimeSamples); + // Combine them, merge and uniquify + const size_t mid = timeSamples.size(); + timeSamples.insert( + timeSamples.end(), + indicesTimeSamples.begin(), indicesTimeSamples.end()); + // since both sets are already sorted, inplace_merge beats sort + std::inplace_merge( + timeSamples.begin(), + timeSamples.begin() + mid, + timeSamples.end()); + timeSamples.erase( + std::unique(timeSamples.begin(), timeSamples.end()), timeSamples.end()); + } size_t numSamples = timeSamples.size(); @@ -497,18 +534,7 @@ UsdImagingPrimAdapter::SamplePrimvar( // are considered primvars by Hydra but non-primvar attributes by USD. if (UsdAttribute attr = usdPrim.GetAttribute(key)) { if (attr.ValueMightBeTimeVarying()) { - attr.GetTimeSamplesInInterval(interval, &timeSamples); - - // Add time samples at the boudary conditions - timeSamples.push_back(interval.GetMin()); - timeSamples.push_back(interval.GetMax()); - - // Sort here - std::sort(timeSamples.begin(), timeSamples.end()); - timeSamples.erase( - std::unique(timeSamples.begin(), - timeSamples.end()), - timeSamples.end()); + _GetTimeSamplesForInterval(attr, interval, &timeSamples); size_t numSamples = timeSamples.size(); @@ -939,12 +965,16 @@ UsdImagingPrimAdapter::_MergePrimvar( bool indexed) const { HdPrimvarDescriptor primvar(name, interp, role, indexed); - HdPrimvarDescriptorVector::iterator it = - std::find(vec->begin(), vec->end(), primvar); - if (it == vec->end()) - vec->push_back(primvar); - else - *it = primvar; + + for (HdPrimvarDescriptorVector::iterator it = vec->begin(); + it != vec->end(); ++it) { + if (it->name == name) { + *it = primvar; + return; + } + } + + vec->push_back(primvar); } void diff --git a/pxr/usdImaging/usdImaging/primAdapter.h b/pxr/usdImaging/usdImaging/primAdapter.h index 6101ddd8e6..befc919507 100644 --- a/pxr/usdImaging/usdImaging/primAdapter.h +++ b/pxr/usdImaging/usdImaging/primAdapter.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_PRIM_ADAPTER_H #define PXR_USD_IMAGING_USD_IMAGING_PRIM_ADAPTER_H @@ -494,7 +477,7 @@ class UsdImagingPrimAdapter void SetDelegate(UsdImagingDelegate* delegate); USDIMAGING_API - bool IsChildPath(SdfPath const& path) const; + virtual bool IsChildPath(const SdfPath& path) const; /// Returns true if the given prim is visible, taking into account inherited /// visibility values. Inherited values are strongest, Usd has no notion of diff --git a/pxr/usdImaging/usdImaging/primvarDescCache.cpp b/pxr/usdImaging/usdImaging/primvarDescCache.cpp index 27980d3a94..e8de231bbf 100644 --- a/pxr/usdImaging/usdImaging/primvarDescCache.cpp +++ b/pxr/usdImaging/usdImaging/primvarDescCache.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/primvarDescCache.h" diff --git a/pxr/usdImaging/usdImaging/primvarDescCache.h b/pxr/usdImaging/usdImaging/primvarDescCache.h index 7f376b725d..304c6b67e9 100644 --- a/pxr/usdImaging/usdImaging/primvarDescCache.h +++ b/pxr/usdImaging/usdImaging/primvarDescCache.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_PRIMVARDESC_CACHE_H #define PXR_USD_IMAGING_USD_IMAGING_PRIMVARDESC_CACHE_H diff --git a/pxr/usdImaging/usdImaging/primvarUtils.cpp b/pxr/usdImaging/usdImaging/primvarUtils.cpp index 23e5d4eb39..4076e6ccfa 100644 --- a/pxr/usdImaging/usdImaging/primvarUtils.cpp +++ b/pxr/usdImaging/usdImaging/primvarUtils.cpp @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/primvarUtils.h" diff --git a/pxr/usdImaging/usdImaging/primvarUtils.h b/pxr/usdImaging/usdImaging/primvarUtils.h index d1d50f1678..34f1999380 100644 --- a/pxr/usdImaging/usdImaging/primvarUtils.h +++ b/pxr/usdImaging/usdImaging/primvarUtils.h @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_PRIMVAR_UTILS_H #define PXR_USD_IMAGING_USD_IMAGING_PRIMVAR_UTILS_H diff --git a/pxr/usdImaging/usdImaging/rectLightAdapter.cpp b/pxr/usdImaging/usdImaging/rectLightAdapter.cpp index f6af565db9..2c85898e60 100644 --- a/pxr/usdImaging/usdImaging/rectLightAdapter.cpp +++ b/pxr/usdImaging/usdImaging/rectLightAdapter.cpp @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/rectLightAdapter.h" #include "pxr/usdImaging/usdImaging/delegate.h" diff --git a/pxr/usdImaging/usdImaging/rectLightAdapter.h b/pxr/usdImaging/usdImaging/rectLightAdapter.h index e7740d35e5..628115fd60 100644 --- a/pxr/usdImaging/usdImaging/rectLightAdapter.h +++ b/pxr/usdImaging/usdImaging/rectLightAdapter.h @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_RECT_LIGHT_ADAPTER_H #define PXR_USD_IMAGING_USD_IMAGING_RECT_LIGHT_ADAPTER_H diff --git a/pxr/usdImaging/usdImaging/renderPassAdapter.cpp b/pxr/usdImaging/usdImaging/renderPassAdapter.cpp new file mode 100644 index 0000000000..730b747f37 --- /dev/null +++ b/pxr/usdImaging/usdImaging/renderPassAdapter.cpp @@ -0,0 +1,158 @@ +// +// Copyright 2024 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// +#include "pxr/usdImaging/usdImaging/renderPassAdapter.h" +#include "pxr/usdImaging/usdImaging/dataSourceRenderPrims.h" +#include "pxr/usdImaging/usdImaging/delegate.h" +#include "pxr/usdImaging/usdImaging/indexProxy.h" +#include "pxr/usdImaging/usdImaging/tokens.h" + +#include "pxr/imaging/hd/tokens.h" + +#include "pxr/usd/usdRender/pass.h" + + +PXR_NAMESPACE_OPEN_SCOPE + +TF_REGISTRY_FUNCTION(TfType) +{ + typedef UsdImagingRenderPassAdapter Adapter; + TfType t = TfType::Define >(); + t.SetFactory< UsdImagingPrimAdapterFactory >(); +} + +UsdImagingRenderPassAdapter::~UsdImagingRenderPassAdapter() +{ +} + +// -------------------------------------------------------------------------- // +// 2.0 Prim adapter API +// -------------------------------------------------------------------------- // + +TfTokenVector +UsdImagingRenderPassAdapter::GetImagingSubprims(UsdPrim const& prim) +{ + return { TfToken() }; +} + +TfToken +UsdImagingRenderPassAdapter::GetImagingSubprimType( + UsdPrim const& prim, + TfToken const& subprim) +{ + if (subprim.IsEmpty()) { + return HdPrimTypeTokens->renderPass; + } + return TfToken(); +} + +HdContainerDataSourceHandle +UsdImagingRenderPassAdapter::GetImagingSubprimData( + UsdPrim const& prim, + TfToken const& subprim, + const UsdImagingDataSourceStageGlobals &stageGlobals) +{ + if (subprim.IsEmpty()) { + return UsdImagingDataSourceRenderPassPrim::New( + prim.GetPath(), prim, stageGlobals); + } + + return nullptr; +} + +HdDataSourceLocatorSet +UsdImagingRenderPassAdapter::InvalidateImagingSubprim( + UsdPrim const& prim, + TfToken const& subprim, + TfTokenVector const& properties, + const UsdImagingPropertyInvalidationType invalidationType) +{ + if (subprim.IsEmpty()) { + return UsdImagingDataSourceRenderPassPrim::Invalidate( + prim, subprim, properties, invalidationType); + } + + return HdDataSourceLocatorSet(); +} + +// -------------------------------------------------------------------------- // +// 1.0 Prim adapter API +// -------------------------------------------------------------------------- // + +bool +UsdImagingRenderPassAdapter::IsSupported( + UsdImagingIndexProxy const* index) const +{ + // Note that we do not plan to implement render pass prims for Hydra 1.0. + return false; +} + +SdfPath +UsdImagingRenderPassAdapter::Populate( + UsdPrim const& prim, + UsdImagingIndexProxy* index, + UsdImagingInstancerContext const* instancerContext) +{ + return SdfPath(); +} + +void +UsdImagingRenderPassAdapter::_RemovePrim( + SdfPath const& cachePath, + UsdImagingIndexProxy* index) +{ +} + +void +UsdImagingRenderPassAdapter::TrackVariability( + UsdPrim const& prim, + SdfPath const& cachePath, + HdDirtyBits* timeVaryingBits, + UsdImagingInstancerContext const* instancerContext) const +{ +} + +void +UsdImagingRenderPassAdapter::UpdateForTime( + UsdPrim const& prim, + SdfPath const& cachePath, + UsdTimeCode time, + HdDirtyBits requestedBits, + UsdImagingInstancerContext const* + instancerContext) const +{ +} + +HdDirtyBits +UsdImagingRenderPassAdapter::ProcessPropertyChange( + UsdPrim const& prim, + SdfPath const& cachePath, + TfToken const& propertyName) +{ + return HdDirtyBits(); +} + +void +UsdImagingRenderPassAdapter::MarkDirty( + UsdPrim const& prim, + SdfPath const& cachePath, + HdDirtyBits dirty, + UsdImagingIndexProxy* index) +{ +} + +VtValue +UsdImagingRenderPassAdapter::Get( + UsdPrim const& prim, + SdfPath const& cachePath, + TfToken const& key, + UsdTimeCode time, + VtIntArray *outIndices) const +{ + return VtValue(); +} + +PXR_NAMESPACE_CLOSE_SCOPE diff --git a/pxr/usdImaging/usdImaging/renderPassAdapter.h b/pxr/usdImaging/usdImaging/renderPassAdapter.h new file mode 100644 index 0000000000..92a1f2f107 --- /dev/null +++ b/pxr/usdImaging/usdImaging/renderPassAdapter.h @@ -0,0 +1,130 @@ +// +// Copyright 2024 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// +#ifndef PXR_USD_IMAGING_USD_IMAGING_RENDER_PASS_ADAPTER_H +#define PXR_USD_IMAGING_USD_IMAGING_RENDER_PASS_ADAPTER_H + +/// \file usdImaging/renderPassAdapter.h + +#include "pxr/pxr.h" +#include "pxr/usdImaging/usdImaging/api.h" +#include "pxr/usdImaging/usdImaging/primAdapter.h" + +PXR_NAMESPACE_OPEN_SCOPE + +/// \class UsdImagingRenderPassAdapter +/// +/// Delegate support for UsdRenderPass. +/// +class UsdImagingRenderPassAdapter : public UsdImagingPrimAdapter +{ +public: + using BaseAdapter = UsdImagingPrimAdapter; + + UsdImagingRenderPassAdapter() + : UsdImagingPrimAdapter() + {} + + USDIMAGING_API + ~UsdImagingRenderPassAdapter() override; + + // ---------------------------------------------------------------------- // + /// \name Scene Index Support + // ---------------------------------------------------------------------- // + + USDIMAGING_API + TfTokenVector GetImagingSubprims(UsdPrim const& prim) override; + + USDIMAGING_API + TfToken GetImagingSubprimType( + UsdPrim const& prim, + TfToken const& subprim) override; + + USDIMAGING_API + HdContainerDataSourceHandle GetImagingSubprimData( + UsdPrim const& prim, + TfToken const& subprim, + const UsdImagingDataSourceStageGlobals &stageGlobals) override; + + USDIMAGING_API + HdDataSourceLocatorSet InvalidateImagingSubprim( + UsdPrim const& prim, + TfToken const& subprim, + TfTokenVector const& properties, + UsdImagingPropertyInvalidationType invalidationType) override; + + // ---------------------------------------------------------------------- // + /// \name Initialization + // ---------------------------------------------------------------------- // + + USDIMAGING_API + SdfPath Populate(UsdPrim const& prim, + UsdImagingIndexProxy* index, + UsdImagingInstancerContext const* + instancerContext = nullptr) override; + + USDIMAGING_API + bool IsSupported(UsdImagingIndexProxy const* index) const override; + + // ---------------------------------------------------------------------- // + /// \name Parallel Setup and Resolve + // ---------------------------------------------------------------------- // + + /// Thread Safe. + USDIMAGING_API + void TrackVariability(UsdPrim const& prim, + SdfPath const& cachePath, + HdDirtyBits* timeVaryingBits, + UsdImagingInstancerContext const* + instancerContext = nullptr) const override; + + + /// Thread Safe. + USDIMAGING_API + void UpdateForTime(UsdPrim const& prim, + SdfPath const& cachePath, + UsdTimeCode time, + HdDirtyBits requestedBits, + UsdImagingInstancerContext const* + instancerContext = nullptr) const override; + + // ---------------------------------------------------------------------- // + /// \name Change Processing + // ---------------------------------------------------------------------- // + + /// Returns a bit mask of attributes to be udpated, or + /// HdChangeTracker::AllDirty if the entire prim must be resynchronized. + USDIMAGING_API + HdDirtyBits ProcessPropertyChange(UsdPrim const& prim, + SdfPath const& cachePath, + TfToken const& propertyName) override; + + USDIMAGING_API + void MarkDirty(UsdPrim const& prim, + SdfPath const& cachePath, + HdDirtyBits dirty, + UsdImagingIndexProxy* index) override; + + // ---------------------------------------------------------------------- // + /// \name Data access + // ---------------------------------------------------------------------- // + + USDIMAGING_API + VtValue Get(UsdPrim const& prim, + SdfPath const& cachePath, + TfToken const& key, + UsdTimeCode time, + VtIntArray *outIndices) const override; + +protected: + USDIMAGING_API + void _RemovePrim(SdfPath const& cachePath, + UsdImagingIndexProxy* index) override; +}; + +PXR_NAMESPACE_CLOSE_SCOPE + +#endif // PXR_USD_IMAGING_USD_IMAGING_RENDER_PASS_ADAPTER_H diff --git a/pxr/usdImaging/usdImaging/renderProductAdapter.cpp b/pxr/usdImaging/usdImaging/renderProductAdapter.cpp index c6ae6e8b02..52d7f28010 100644 --- a/pxr/usdImaging/usdImaging/renderProductAdapter.cpp +++ b/pxr/usdImaging/usdImaging/renderProductAdapter.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/renderProductAdapter.h" #include "pxr/usdImaging/usdImaging/dataSourceRenderPrims.h" @@ -106,7 +89,10 @@ bool UsdImagingRenderProductAdapter::IsSupported( UsdImagingIndexProxy const* index) const { - return false; + // Since we flatten products and vars into the targeting settings prim, 1.0 + // render delegates won't typically support render product prims as such. + // Return true to supress warnings that the prim type isn't supported. + return true; } SdfPath diff --git a/pxr/usdImaging/usdImaging/renderProductAdapter.h b/pxr/usdImaging/usdImaging/renderProductAdapter.h index 9efb249486..51509b3848 100644 --- a/pxr/usdImaging/usdImaging/renderProductAdapter.h +++ b/pxr/usdImaging/usdImaging/renderProductAdapter.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_RENDER_PRODUCT_ADAPTER_H #define PXR_USD_IMAGING_USD_IMAGING_RENDER_PRODUCT_ADAPTER_H diff --git a/pxr/usdImaging/usdImaging/renderSettingsAdapter.cpp b/pxr/usdImaging/usdImaging/renderSettingsAdapter.cpp index 0d60f2ba58..185158a32a 100644 --- a/pxr/usdImaging/usdImaging/renderSettingsAdapter.cpp +++ b/pxr/usdImaging/usdImaging/renderSettingsAdapter.cpp @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/renderSettingsAdapter.h" #include "pxr/usdImaging/usdImaging/dataSourceRenderPrims.h" @@ -232,8 +215,7 @@ UsdImagingRenderSettingsAdapter::UpdateForTime( SdfPath const& cachePath, UsdTimeCode time, HdDirtyBits requestedBits, - UsdImagingInstancerContext const* - instancerContext) const + UsdImagingInstancerContext const* instancerContext) const { } diff --git a/pxr/usdImaging/usdImaging/renderSettingsAdapter.h b/pxr/usdImaging/usdImaging/renderSettingsAdapter.h index 5eb9a0b92a..5f68ac26ee 100644 --- a/pxr/usdImaging/usdImaging/renderSettingsAdapter.h +++ b/pxr/usdImaging/usdImaging/renderSettingsAdapter.h @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_RENDER_SETTINGS_ADAPTER_H #define PXR_USD_IMAGING_USD_IMAGING_RENDER_SETTINGS_ADAPTER_H diff --git a/pxr/usdImaging/usdImaging/renderSettingsFlatteningSceneIndex.cpp b/pxr/usdImaging/usdImaging/renderSettingsFlatteningSceneIndex.cpp index e0272b3785..dfbdbed9c1 100644 --- a/pxr/usdImaging/usdImaging/renderSettingsFlatteningSceneIndex.cpp +++ b/pxr/usdImaging/usdImaging/renderSettingsFlatteningSceneIndex.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. #include "pxr/usdImaging/usdImaging/renderSettingsFlatteningSceneIndex.h" diff --git a/pxr/usdImaging/usdImaging/renderSettingsFlatteningSceneIndex.h b/pxr/usdImaging/usdImaging/renderSettingsFlatteningSceneIndex.h index 753fa221ad..bf0dfe12b9 100644 --- a/pxr/usdImaging/usdImaging/renderSettingsFlatteningSceneIndex.h +++ b/pxr/usdImaging/usdImaging/renderSettingsFlatteningSceneIndex.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. #ifndef PXR_USD_IMAGING_USD_IMAGING_RENDER_SETTINGS_FLATTENING_SCENE_INDEX_H #define PXR_USD_IMAGING_USD_IMAGING_RENDER_SETTINGS_FLATTENING_SCENE_INDEX_H diff --git a/pxr/usdImaging/usdImaging/renderVarAdapter.cpp b/pxr/usdImaging/usdImaging/renderVarAdapter.cpp index a359342144..c7d94b8a15 100644 --- a/pxr/usdImaging/usdImaging/renderVarAdapter.cpp +++ b/pxr/usdImaging/usdImaging/renderVarAdapter.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or var names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -//` -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/renderVarAdapter.h" #include "pxr/usdImaging/usdImaging/dataSourceRenderPrims.h" @@ -99,7 +82,7 @@ UsdImagingRenderVarAdapter::InvalidateImagingSubprim( // -------------------------------------------------------------------------- // // 1.0 Prim adapter API // -// \note No hydra prims are added/managed for UsdRenderProduct prims. +// \note No hydra prims are added/managed for UsdRenderVar prims. // UsdImagingRenderSettingsAdapter handles the flattening of // targeted products and vars. // -------------------------------------------------------------------------- // @@ -108,7 +91,10 @@ bool UsdImagingRenderVarAdapter::IsSupported( UsdImagingIndexProxy const* index) const { - return false; + // Since we flatten products and vars into the targeting settings prim, 1.0 + // render delegates won't typically support render var prims as such. + // Return true to supress warnings that the prim type isn't supported. + return true; } SdfPath diff --git a/pxr/usdImaging/usdImaging/renderVarAdapter.h b/pxr/usdImaging/usdImaging/renderVarAdapter.h index e05fac0c39..06241dadf1 100644 --- a/pxr/usdImaging/usdImaging/renderVarAdapter.h +++ b/pxr/usdImaging/usdImaging/renderVarAdapter.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_RENDER_VAR_ADAPTER_H #define PXR_USD_IMAGING_USD_IMAGING_RENDER_VAR_ADAPTER_H diff --git a/pxr/usdImaging/usdImaging/representedByAncestorPrimAdapter.cpp b/pxr/usdImaging/usdImaging/representedByAncestorPrimAdapter.cpp index a87e521858..54d189c9f2 100644 --- a/pxr/usdImaging/usdImaging/representedByAncestorPrimAdapter.cpp +++ b/pxr/usdImaging/usdImaging/representedByAncestorPrimAdapter.cpp @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/representedByAncestorPrimAdapter.h" @@ -34,6 +17,12 @@ TF_REGISTRY_FUNCTION(TfType) // No factory here, UsdImagingRepresentedByAncestorPrimAdapter is abstract. } +TfTokenVector +UsdImagingRepresentedByAncestorPrimAdapter::GetImagingSubprims(UsdPrim const& prim) +{ + return TfTokenVector(); +} + UsdImagingPrimAdapter::PopulationMode UsdImagingRepresentedByAncestorPrimAdapter::GetPopulationMode() { @@ -58,4 +47,4 @@ UsdImagingRepresentedByAncestorPrimAdapter::ProcessPropertyChange( return HdChangeTracker::Clean; } -PXR_NAMESPACE_CLOSE_SCOPE \ No newline at end of file +PXR_NAMESPACE_CLOSE_SCOPE diff --git a/pxr/usdImaging/usdImaging/representedByAncestorPrimAdapter.h b/pxr/usdImaging/usdImaging/representedByAncestorPrimAdapter.h index 57e53b9178..9474faa8c1 100644 --- a/pxr/usdImaging/usdImaging/representedByAncestorPrimAdapter.h +++ b/pxr/usdImaging/usdImaging/representedByAncestorPrimAdapter.h @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_REPRESENTED_BY_ANCESTOR_PRIM_ADAPTER_H #define PXR_USD_IMAGING_USD_IMAGING_REPRESENTED_BY_ANCESTOR_PRIM_ADAPTER_H @@ -52,6 +35,7 @@ class UsdImagingRepresentedByAncestorPrimAdapter : public UsdImagingPrimAdapter /// \name Scene Index Support // ---------------------------------------------------------------------- // + TfTokenVector GetImagingSubprims(UsdPrim const& prim) override; PopulationMode GetPopulationMode() override; // ---------------------------------------------------------------------- // diff --git a/pxr/usdImaging/usdImaging/rerootingSceneIndex.cpp b/pxr/usdImaging/usdImaging/rerootingSceneIndex.cpp index 5d944208bb..5d57862e2a 100644 --- a/pxr/usdImaging/usdImaging/rerootingSceneIndex.cpp +++ b/pxr/usdImaging/usdImaging/rerootingSceneIndex.cpp @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/rerootingSceneIndex.h" diff --git a/pxr/usdImaging/usdImaging/rerootingSceneIndex.h b/pxr/usdImaging/usdImaging/rerootingSceneIndex.h index 214f976d89..cb2812e7bb 100644 --- a/pxr/usdImaging/usdImaging/rerootingSceneIndex.h +++ b/pxr/usdImaging/usdImaging/rerootingSceneIndex.h @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_REROOTING_SCENE_INDEX_H #define PXR_USD_IMAGING_USD_IMAGING_REROOTING_SCENE_INDEX_H diff --git a/pxr/usdImaging/usdImaging/resolvedAttributeCache.cpp b/pxr/usdImaging/usdImaging/resolvedAttributeCache.cpp index 6ef3543c2d..874a43b35d 100644 --- a/pxr/usdImaging/usdImaging/resolvedAttributeCache.cpp +++ b/pxr/usdImaging/usdImaging/resolvedAttributeCache.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/resolvedAttributeCache.h" diff --git a/pxr/usdImaging/usdImaging/resolvedAttributeCache.h b/pxr/usdImaging/usdImaging/resolvedAttributeCache.h index 0e2e024ad2..df4a7eac73 100644 --- a/pxr/usdImaging/usdImaging/resolvedAttributeCache.h +++ b/pxr/usdImaging/usdImaging/resolvedAttributeCache.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_RESOLVED_ATTRIBUTE_CACHE_H #define PXR_USD_IMAGING_USD_IMAGING_RESOLVED_ATTRIBUTE_CACHE_H @@ -297,9 +280,23 @@ class UsdImaging_ResolvedAttributeCache , version(version_) { } + _Entry(const _Entry &other) + : query(other.query) + , value(other.value) + { + version.store(other.version.load()); + } + + _Entry(_Entry &&other) + : query(std::move(other.query)) + , value(std::move(other.value)) + { + version.store(other.version.load()); + } + query_type query; value_type value; - tbb::atomic version; + std::atomic version; }; // Returns the version number for a valid cache entry @@ -339,7 +336,7 @@ class UsdImaging_ResolvedAttributeCache // A serial number indicating the valid state of entries in the cache. When // an entry has an equal or greater value, the entry is valid. - tbb::atomic _cacheVersion; + std::atomic _cacheVersion; // Value overrides for a set of descendents. ValueOverridesMap _valueOverrides; @@ -358,7 +355,7 @@ UsdImaging_ResolvedAttributeCache::_SetCacheEntryForPrim( // Note: _cacheVersion is not allowed to change during cache access. unsigned v = entry->version; if (v < _cacheVersion - && entry->version.compare_and_swap(_cacheVersion, v) == v) + && entry->version.compare_exchange_strong(v,_cacheVersion.load())) { entry->value = value; entry->version = _GetValidVersion(); @@ -378,7 +375,7 @@ typename UsdImaging_ResolvedAttributeCache::_Entry* UsdImaging_ResolvedAttributeCache::_GetCacheEntryForPrim( const UsdPrim &prim) const { - typename _CacheMap::const_iterator it = _cache.find(prim); + typename _CacheMap::iterator it = _cache.find(prim); if (it != _cache.end()) { return &it->second; } diff --git a/pxr/usdImaging/usdImaging/rootOverridesSceneIndex.cpp b/pxr/usdImaging/usdImaging/rootOverridesSceneIndex.cpp index 0c458331e5..a6c091fa15 100644 --- a/pxr/usdImaging/usdImaging/rootOverridesSceneIndex.cpp +++ b/pxr/usdImaging/usdImaging/rootOverridesSceneIndex.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/rootOverridesSceneIndex.h" diff --git a/pxr/usdImaging/usdImaging/rootOverridesSceneIndex.h b/pxr/usdImaging/usdImaging/rootOverridesSceneIndex.h index 864fceb4f5..d5939f0416 100644 --- a/pxr/usdImaging/usdImaging/rootOverridesSceneIndex.h +++ b/pxr/usdImaging/usdImaging/rootOverridesSceneIndex.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_ROOT_OVERRIDES_SCENE_INDEX_H #define PXR_USD_IMAGING_USD_IMAGING_ROOT_OVERRIDES_SCENE_INDEX_H diff --git a/pxr/usdImaging/usdImaging/sceneIndices.cpp b/pxr/usdImaging/usdImaging/sceneIndices.cpp index b326517541..8f223910fc 100644 --- a/pxr/usdImaging/usdImaging/sceneIndices.cpp +++ b/pxr/usdImaging/usdImaging/sceneIndices.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/sceneIndices.h" @@ -43,6 +26,7 @@ #include "pxr/imaging/hd/retainedDataSource.h" #include "pxr/imaging/hd/tokens.h" #include "pxr/imaging/hd/purposeSchema.h" +#include "pxr/imaging/hd/sceneIndexUtil.h" PXR_NAMESPACE_OPEN_SCOPE @@ -78,6 +62,20 @@ _ExtentResolvingSceneIndexInputArgs() purposeDataSources)); } +static +std::string +_GetStageName(UsdStageRefPtr const &stage) +{ + if (!stage) { + return {}; + } + SdfLayerHandle const rootLayer = stage->GetRootLayer(); + if (!rootLayer) { + return {}; + } + return rootLayer->GetIdentifier(); +} + UsdImagingSceneIndices UsdImagingCreateSceneIndices( const UsdImagingCreateSceneIndicesInfo &createInfo) @@ -176,6 +174,12 @@ UsdImagingCreateSceneIndices( sceneIndex = UsdImagingRenderSettingsFlatteningSceneIndex::New(sceneIndex); + if (TfGetEnvSetting(HD_USE_ENCAPSULATING_SCENE_INDICES)) { + sceneIndex = HdMakeEncapsulatingSceneIndex({}, sceneIndex); + sceneIndex->SetDisplayName( + "UsdImaging " + _GetStageName(createInfo.stage)); + } + result.finalSceneIndex = sceneIndex; return result; diff --git a/pxr/usdImaging/usdImaging/sceneIndices.h b/pxr/usdImaging/usdImaging/sceneIndices.h index c1e4401928..aa005c39ee 100644 --- a/pxr/usdImaging/usdImaging/sceneIndices.h +++ b/pxr/usdImaging/usdImaging/sceneIndices.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_SCENE_INDICES_H #define PXR_USD_IMAGING_USD_IMAGING_SCENE_INDICES_H diff --git a/pxr/usdImaging/usdImaging/selectionSceneIndex.cpp b/pxr/usdImaging/usdImaging/selectionSceneIndex.cpp index ea1ee7c933..8370c46380 100644 --- a/pxr/usdImaging/usdImaging/selectionSceneIndex.cpp +++ b/pxr/usdImaging/usdImaging/selectionSceneIndex.cpp @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/selectionSceneIndex.h" @@ -626,7 +609,7 @@ _AppendNameToSceneIndexPrimsAndInstanceIndices( // } // } // -// The NI and PI prototype progating scene indices turn this into: +// The NI and PI prototype propagating scene indices turn this into: // // /MyInstancer // primType: instancer @@ -709,7 +692,7 @@ _AppendNameToSceneIndexPrimsAndInstanceIndices( // uniform token[] xformOpOrder = ["xformOp:translate"] // } // -// The NI and PI prototype progating scene indices turn this into: +// The NI and PI prototype propagating scene indices turn this into: // // /Instance1 // primType: "" @@ -746,7 +729,7 @@ _AppendNameToSceneIndexPrimsAndInstanceIndices( // nestedInstanceIndices: [ // instancer: /UsdNiPropagatedPrototypes/NoPrimvars_NoMaterialBindings/__Prototype_1/UsdNiInstancer // prototypeIndex: 0 -// instanceIndices: [ 0, 1 ] +// instanceIndices: [ 0 ] // // Next, we process Cube from /Instance1/Cube. Since // /UsdNiPropagatedPrototypes/NoPrimvars_NoMaterialBindings/__Prototype_1/UsdNiInstancer/UsdNiPrototype/cube @@ -756,7 +739,7 @@ _AppendNameToSceneIndexPrimsAndInstanceIndices( // nestedInstanceIndices: [ // instancer: /UsdNiPropagatedPrototypes/NoPrimvars_NoMaterialBindings/__Prototype_1/UsdNiInstancer // prototypeIndex: 0 -// instanceIndices: [ 0, 1 ] +// instanceIndices: [ 0 ] // std::vector<_PrimAndNestedInstanceIndices> _ComputeSceneIndexPrimsAndInstanceIndices( @@ -787,9 +770,9 @@ _ComputeSceneIndexPrimsAndInstanceIndices( } TF_DEBUG(USDIMAGING_SELECTION).Msg( - " Traversing ancestors of usdPath\n"); + " Traversing descendants of usdPath %s\n", usdPath.GetText()); - // Now add all namespace ancestors of the paths we determined. + // Now add all namespace descendants of the paths we determined. size_t i = 0; while (i < result.size()) { TF_DEBUG(USDIMAGING_SELECTION).Msg( diff --git a/pxr/usdImaging/usdImaging/selectionSceneIndex.h b/pxr/usdImaging/usdImaging/selectionSceneIndex.h index fb45a11ff2..646c89e6bc 100644 --- a/pxr/usdImaging/usdImaging/selectionSceneIndex.h +++ b/pxr/usdImaging/usdImaging/selectionSceneIndex.h @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_SELECTION_SCENE_INDEX_H #define PXR_USD_IMAGING_USD_IMAGING_SELECTION_SCENE_INDEX_H diff --git a/pxr/usdImaging/usdImaging/sphereAdapter.cpp b/pxr/usdImaging/usdImaging/sphereAdapter.cpp index 1d446f2006..01da10bf2b 100644 --- a/pxr/usdImaging/usdImaging/sphereAdapter.cpp +++ b/pxr/usdImaging/usdImaging/sphereAdapter.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/sphereAdapter.h" diff --git a/pxr/usdImaging/usdImaging/sphereAdapter.h b/pxr/usdImaging/usdImaging/sphereAdapter.h index 5b428b45fb..382febada5 100644 --- a/pxr/usdImaging/usdImaging/sphereAdapter.h +++ b/pxr/usdImaging/usdImaging/sphereAdapter.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_SPHERE_ADAPTER_H #define PXR_USD_IMAGING_USD_IMAGING_SPHERE_ADAPTER_H diff --git a/pxr/usdImaging/usdImaging/sphereLightAdapter.cpp b/pxr/usdImaging/usdImaging/sphereLightAdapter.cpp index 17fb39eaa2..2dcef20265 100644 --- a/pxr/usdImaging/usdImaging/sphereLightAdapter.cpp +++ b/pxr/usdImaging/usdImaging/sphereLightAdapter.cpp @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/sphereLightAdapter.h" #include "pxr/usdImaging/usdImaging/delegate.h" diff --git a/pxr/usdImaging/usdImaging/sphereLightAdapter.h b/pxr/usdImaging/usdImaging/sphereLightAdapter.h index 1489914b72..13faef05f4 100644 --- a/pxr/usdImaging/usdImaging/sphereLightAdapter.h +++ b/pxr/usdImaging/usdImaging/sphereLightAdapter.h @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_SPHERE_LIGHT_ADAPTER_H #define PXR_USD_IMAGING_USD_IMAGING_SPHERE_LIGHT_ADAPTER_H diff --git a/pxr/usdImaging/usdImaging/stageSceneIndex.cpp b/pxr/usdImaging/usdImaging/stageSceneIndex.cpp index 5f781efc8a..6b06799293 100644 --- a/pxr/usdImaging/usdImaging/stageSceneIndex.cpp +++ b/pxr/usdImaging/usdImaging/stageSceneIndex.cpp @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/stageSceneIndex.h" @@ -261,6 +244,9 @@ UsdImagingStageSceneIndex::GetPrim(const SdfPath &path) const if (prim.IsInstanceProxy()) { return s_emptyPrim; } + if (!_GetPrimPredicate()(prim)) { + return s_emptyPrim; + } const TfToken subprim = path.IsPropertyPath() ? path.GetNameToken() : TfToken(); @@ -312,7 +298,7 @@ UsdImagingStageSceneIndex::GetChildPrimPaths( entry.primAdapter->GetPopulationMode() == UsdImagingPrimAdapter::RepresentsSelfAndDescendents)) { UsdPrimSiblingRange range = - prim.GetFilteredChildren(_GetTraversalPredicate()); + prim.GetFilteredChildren(_GetPrimPredicate()); for (const UsdPrim &child: range) { result.push_back(child.GetPath()); } @@ -410,7 +396,7 @@ void UsdImagingStageSceneIndex::_PopulateSubtree(UsdPrim subtreeRoot) HdSceneIndexObserver::AddedPrimEntries addedPrims; size_t lastEnd = 0; - UsdPrimRange range(subtreeRoot, _GetTraversalPredicate()); + UsdPrimRange range(subtreeRoot, _GetPrimPredicate()); for (auto it = range.begin(); it != range.end(); ++it) { const UsdPrim &prim = *it; @@ -460,8 +446,8 @@ void UsdImagingStageSceneIndex::_PopulateSubtree(UsdPrim subtreeRoot) _SendPrimsAdded(addedPrims); } -Usd_PrimFlagsConjunction -UsdImagingStageSceneIndex::_GetTraversalPredicate() const +Usd_PrimFlagsPredicate +UsdImagingStageSceneIndex::_GetPrimPredicate() const { // Note that it differs from the UsdPrimDefaultPredicate by not requiring // UsdPrimIsDefined. This way, we pick up instance and over's and their @@ -518,7 +504,7 @@ UsdImagingStageSceneIndex::_OnUsdObjectsChanged( _usdPropertiesToResync[it->GetPrimPath()] .push_back(it->GetNameToken()); TF_DEBUG(USDIMAGING_CHANGES).Msg( - " - Property update due to property resync queued: %s\n", + " - Property resync queued: %s\n", it->GetText()); } diff --git a/pxr/usdImaging/usdImaging/stageSceneIndex.h b/pxr/usdImaging/usdImaging/stageSceneIndex.h index 0da7a58918..6fad935c82 100644 --- a/pxr/usdImaging/usdImaging/stageSceneIndex.h +++ b/pxr/usdImaging/usdImaging/stageSceneIndex.h @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_STAGE_SCENE_INDEX_H #define PXR_USD_IMAGING_USD_IMAGING_STAGE_SCENE_INDEX_H @@ -103,7 +86,7 @@ class UsdImagingStageSceneIndex : public HdSceneIndexBase USDIMAGING_API UsdImagingStageSceneIndex(HdContainerDataSourceHandle const &inputArgs); - Usd_PrimFlagsConjunction _GetTraversalPredicate() const; + Usd_PrimFlagsPredicate _GetPrimPredicate() const; void _ApplyPendingResyncs(); void _ComputeDirtiedEntries( diff --git a/pxr/usdImaging/usdImaging/testenv/testUsdImagingDataSourceAttribute.cpp b/pxr/usdImaging/usdImaging/testenv/testUsdImagingDataSourceAttribute.cpp index 4aa05e4a3c..44b8b81b79 100644 --- a/pxr/usdImaging/usdImaging/testenv/testUsdImagingDataSourceAttribute.cpp +++ b/pxr/usdImaging/usdImaging/testenv/testUsdImagingDataSourceAttribute.cpp @@ -1,25 +1,8 @@ // // Copyright 2024 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/dataSourceAttribute.h" diff --git a/pxr/usdImaging/usdImaging/testenv/testUsdImagingDelegate.cpp b/pxr/usdImaging/usdImaging/testenv/testUsdImagingDelegate.cpp index e64563b571..ef5dc180ac 100644 --- a/pxr/usdImaging/usdImaging/testenv/testUsdImagingDelegate.cpp +++ b/pxr/usdImaging/usdImaging/testenv/testUsdImagingDelegate.cpp @@ -1,25 +1,8 @@ // // Copyright 2024 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/unitTestHelper.h" diff --git a/pxr/usdImaging/usdImaging/testenv/testUsdImagingDelegate/shader1.glslfx b/pxr/usdImaging/usdImaging/testenv/testUsdImagingDelegate/shader1.glslfx index 6966f25715..ddcf644051 100644 --- a/pxr/usdImaging/usdImaging/testenv/testUsdImagingDelegate/shader1.glslfx +++ b/pxr/usdImaging/usdImaging/testenv/testUsdImagingDelegate/shader1.glslfx @@ -3,25 +3,8 @@ // // Copyright 2024 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // -- configuration diff --git a/pxr/usdImaging/usdImaging/testenv/testUsdImagingDelegateChanges.cpp b/pxr/usdImaging/usdImaging/testenv/testUsdImagingDelegateChanges.cpp index 25403b7ba1..eecc0fb870 100644 --- a/pxr/usdImaging/usdImaging/testenv/testUsdImagingDelegateChanges.cpp +++ b/pxr/usdImaging/usdImaging/testenv/testUsdImagingDelegateChanges.cpp @@ -1,25 +1,8 @@ // // Copyright 2024 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/unitTestHelper.h" @@ -1364,7 +1347,7 @@ InstanceTransformTest() delegate->Populate(stage->GetPseudoRoot()); delegate->SetTime(0); delegate->SyncAll(true); - tracker.MarkRprimClean(SdfPath("/geo_1.proto_cube_id0")); + tracker.MarkRprimClean(SdfPath("/geo_1/proto_cube_id0")); // Set /geo/cube transform to translate(0,4,0) UsdGeomXformable xf = UsdGeomXformable(stage->GetPrimAtPath(SdfPath("/geo/cube"))); @@ -1376,7 +1359,7 @@ InstanceTransformTest() delegate->SetTime(0); // Verify that /geo_1.cube_id0 has DirtyTransform - HdDirtyBits dirtyBits = tracker.GetRprimDirtyBits(SdfPath("/geo_1.proto_cube_id0")); + HdDirtyBits dirtyBits = tracker.GetRprimDirtyBits(SdfPath("/geo_1/proto_cube_id0")); TF_AXIOM(dirtyBits & HdChangeTracker::DirtyTransform); } diff --git a/pxr/usdImaging/usdImaging/testenv/testUsdImagingExcluded.cpp b/pxr/usdImaging/usdImaging/testenv/testUsdImagingExcluded.cpp index d5a778d559..758b190f93 100644 --- a/pxr/usdImaging/usdImaging/testenv/testUsdImagingExcluded.cpp +++ b/pxr/usdImaging/usdImaging/testenv/testUsdImagingExcluded.cpp @@ -1,25 +1,8 @@ // // Copyright 2024 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/unitTestHelper.h" diff --git a/pxr/usdImaging/usdImaging/testenv/testUsdImagingMaterialBinding.cpp b/pxr/usdImaging/usdImaging/testenv/testUsdImagingMaterialBinding.cpp index 61956291ee..acbc073224 100644 --- a/pxr/usdImaging/usdImaging/testenv/testUsdImagingMaterialBinding.cpp +++ b/pxr/usdImaging/usdImaging/testenv/testUsdImagingMaterialBinding.cpp @@ -1,25 +1,8 @@ // // Copyright 2024 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/base/tf/errorMark.h" diff --git a/pxr/usdImaging/usdImaging/testenv/testUsdImagingNestedInstancingCategories.cpp b/pxr/usdImaging/usdImaging/testenv/testUsdImagingNestedInstancingCategories.cpp index 03cffead04..4d483cfa9c 100644 --- a/pxr/usdImaging/usdImaging/testenv/testUsdImagingNestedInstancingCategories.cpp +++ b/pxr/usdImaging/usdImaging/testenv/testUsdImagingNestedInstancingCategories.cpp @@ -1,25 +1,8 @@ // // Copyright 2024 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/base/tf/errorMark.h" @@ -105,7 +88,7 @@ TestNestedInstancingCategories() "/W/LiExBB.collection:lightLink" } ), Instance("/W/B/B/Sphere", { "/W/ShExBA.collection:shadowLink" } ) }; - const SdfPath protoPath = SdfPath("/__Prototype_1/A.proto_Sphere_id0"); + const SdfPath protoPath = SdfPath("/__Prototype_1/A/proto_Sphere_id0"); const SdfPath& instancerId = delegate->GetInstancerId(protoPath); const std::vector instanceCategories = delegate->GetInstanceCategories(instancerId); @@ -151,4 +134,4 @@ main() } else { std::cout << "FAILED" << std::endl; } -} \ No newline at end of file +} diff --git a/pxr/usdImaging/usdImaging/testenv/testUsdImagingPrimvarUtils.cpp b/pxr/usdImaging/usdImaging/testenv/testUsdImagingPrimvarUtils.cpp index d41b3c3e87..d839655205 100644 --- a/pxr/usdImaging/usdImaging/testenv/testUsdImagingPrimvarUtils.cpp +++ b/pxr/usdImaging/usdImaging/testenv/testUsdImagingPrimvarUtils.cpp @@ -1,25 +1,8 @@ // // Copyright 2024 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/primvarUtils.h" diff --git a/pxr/usdImaging/usdImaging/testenv/testUsdImagingRerootingSceneIndex.cpp b/pxr/usdImaging/usdImaging/testenv/testUsdImagingRerootingSceneIndex.cpp index 32546f6f94..9f6eca3137 100644 --- a/pxr/usdImaging/usdImaging/testenv/testUsdImagingRerootingSceneIndex.cpp +++ b/pxr/usdImaging/usdImaging/testenv/testUsdImagingRerootingSceneIndex.cpp @@ -1,25 +1,8 @@ // // Copyright 2024 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/rerootingSceneIndex.h" diff --git a/pxr/usdImaging/usdImaging/testenv/testUsdImagingRootPrim.cpp b/pxr/usdImaging/usdImaging/testenv/testUsdImagingRootPrim.cpp index 55e728d87e..b016c58383 100644 --- a/pxr/usdImaging/usdImaging/testenv/testUsdImagingRootPrim.cpp +++ b/pxr/usdImaging/usdImaging/testenv/testUsdImagingRootPrim.cpp @@ -1,25 +1,8 @@ // // Copyright 2024 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/unitTestHelper.h" diff --git a/pxr/usdImaging/usdImaging/testenv/testUsdImagingStageSceneIndex.cpp b/pxr/usdImaging/usdImaging/testenv/testUsdImagingStageSceneIndex.cpp index 884828e3cd..4a207395ef 100644 --- a/pxr/usdImaging/usdImaging/testenv/testUsdImagingStageSceneIndex.cpp +++ b/pxr/usdImaging/usdImaging/testenv/testUsdImagingStageSceneIndex.cpp @@ -1,25 +1,8 @@ // // Copyright 2024 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/stageSceneIndex.h" @@ -29,6 +12,7 @@ #include "pxr/usd/usd/attribute.h" #include "pxr/usd/usd/stage.h" #include "pxr/usd/usdGeom/cube.h" +#include "pxr/usd/usdGeom/points.h" #include "pxr/imaging/hd/dataSourceTypeDefs.h" #include "pxr/imaging/hd/meshTopologySchema.h" @@ -41,7 +25,6 @@ #include #include - PXR_NAMESPACE_OPEN_SCOPE static std::ostream & @@ -124,6 +107,11 @@ class PrimListener : public HdSceneIndexObserver AddedPrimEntries const& GetAdded() { return _added; } DirtiedPrimEntries const& GetDirtied() { return _dirtied; } + void ResetEntries() { + _added.clear(); + _dirtied.clear(); + } + private: SdfPathSet _prims; AddedPrimEntries _added; @@ -486,6 +474,242 @@ void AddNonEmptyLayerTest() } } +bool +_Contains(const TfTokenVector &vec, const TfToken &t) +{ + return std::count(vec.begin(), vec.end(), t); +} + +// A class that caches the data sources related to a primvar on a prim +// in a scene index. +// +// The class is intended to check that sufficient invalidation is send out +// and that there is no stale state cached somewhere in the scene index. +// +// It holds on to each data source and the primvar value and only pulls it +// again if an explicit notice with a generic enough data source locator +// was send. +// +class _PrimvarDataSourcesCache +{ +public: + _PrimvarDataSourcesCache(HdSceneIndexBaseRefPtr const &sceneIndex, + const SdfPath &primPath, + const TfToken &primvarName) + : primvarsSchema(nullptr) + , primvarSchema(nullptr) + , hasPrimvarName(false) + , _sceneIndex(sceneIndex) + , _primPath(primPath) + , _primvarName(primvarName) + { + // Initialize data sources if scene index was already populated. + _ProcessEntry(_primPath, HdDataSourceLocatorSet::UniversalSet()); + + _sceneIndex->AddObserver(HdSceneIndexObserverPtr(&_primListener)); + } + + HdContainerDataSourceHandle primSource; + HdPrimvarsSchema primvarsSchema; + HdPrimvarSchema primvarSchema; + HdSampledDataSourceHandle primvarValueSource; + VtArray primvarValue; + + // Did the primvar name appear in the result of + // HdContainerDataSource::GetNames() for the primvars? + bool hasPrimvarName; + + // Pull data in response to invalidation notices. + void + Pull() { + for (const HdSceneIndexObserver::AddedPrimEntry &entry : + _primListener.GetAdded()) { + _ProcessEntry( + entry.primPath, HdDataSourceLocatorSet::UniversalSet()); + } + for (const HdSceneIndexObserver::DirtiedPrimEntry &entry : + _primListener.GetDirtied()) { + _ProcessEntry( + entry.primPath, entry.dirtyLocators); + } + + _primListener.ResetEntries(); + } + +private: + void + _ProcessEntry(const SdfPath &primPath, + const HdDataSourceLocatorSet &dirtyLocators) + { + if (primPath != _primPath) { + return; + } + if (dirtyLocators.Contains( + HdDataSourceLocator::EmptyLocator())) { + primSource = + _sceneIndex->GetPrim(_primPath).dataSource; + } + if (dirtyLocators.Contains( + HdPrimvarsSchema::GetDefaultLocator())) { + // Note that Contains is true if dirtyLocators contains + // a prefix. So if we refresh the primSource above, we + // would automatically refresh primvarsSchema as well. + primvarsSchema = + HdPrimvarsSchema::GetFromParent(primSource); + } + if (dirtyLocators.Contains( + HdPrimvarsSchema::GetDefaultLocator() + .Append(_primvarName))) { + + primvarSchema = + primvarsSchema.GetPrimvar(_primvarName); + + // If a name appears or disappears in + // HdContainerDataSource::GetNames() is it sufficient to + // send the more specific data source locator for the name + // within the data source or should we send out the locator for + // the container data source itself? + // + // We are conservative here and call GetNames() when we + // get the specific data source locator (and thus also the more + // generic data source locator). + // + hasPrimvarName = _Contains( + primvarsSchema.GetPrimvarNames(), _primvarName); + } + if (dirtyLocators.Contains( + HdPrimvarsSchema::GetDefaultLocator() + .Append(_primvarName) + .Append(HdPrimvarSchemaTokens->primvarValue))) { + primvarValueSource = + primvarSchema.GetPrimvarValue(); + + if (HdFloatArrayDataSourceHandle const typedSource = + HdFloatArrayDataSource::Cast(primvarValueSource)) { + primvarValue = typedSource->GetTypedValue(0.0f); + } else { + primvarValue = {}; + } + } + } + + HdSceneIndexBaseRefPtr const _sceneIndex; + PrimListener _primListener; + const SdfPath _primPath; + const TfToken _primvarName; +}; + +void CustomPrimvarChangeTest() +{ + SdfLayerRefPtr rootLayer = SdfLayer::CreateAnonymous(".usda"); + UsdStageRefPtr stage = UsdStage::Open(rootLayer); + if (!TF_VERIFY(stage)) { + return; + } + + UsdImagingStageSceneIndexRefPtr inputSceneIndex = + UsdImagingStageSceneIndex::New(); + if (!TF_VERIFY(inputSceneIndex)) { + return; + } + + inputSceneIndex->SetStage(stage); + + const SdfPath primPath("/points"); + _PrimvarDataSourcesCache dataSourcesCache( + inputSceneIndex, primPath, TfToken("widths")); + + inputSceneIndex->ApplyPendingUpdates(); + dataSourcesCache.Pull(); + + if (!TF_VERIFY(!dataSourcesCache.primSource)) { + // Expect no prim since prim has not yet been created. + return; + } + + UsdGeomPoints points = UsdGeomPoints::Define(stage, SdfPath("/points")); + if (!TF_VERIFY(points)) { + return; + } + + inputSceneIndex->ApplyPendingUpdates(); + dataSourcesCache.Pull(); + + if (!TF_VERIFY(dataSourcesCache.primSource)) { + // Prim has been created. + return; + } + + // Note that we do not check dataSourcesCache.hasPrimvarName + // or dataSourcesCache.primvarSchema. + // As long as the primvar value data source is null, the implementation + // is correct - whether the primvars container data source lists the + // primvar (and whether on top, gives a data source for the primvar + // schema). + + if (!TF_VERIFY(!dataSourcesCache.primvarValueSource)) { + // Nothing authored, so we do not expect a data source for the value. + return; + } + + UsdAttribute widthsAttr = points.CreateWidthsAttr(); + if (!TF_VERIFY(widthsAttr)) { + return; + } + + inputSceneIndex->ApplyPendingUpdates(); + dataSourcesCache.Pull(); + + if (!TF_VERIFY(!dataSourcesCache.primvarValueSource)) { + // Attribute has been created in authoring layer but has no opinion, + // so we still do not expect a data source for the value. + return; + } + + for (int i = 0; i < 2; ++i) { + const VtArray widths{ + 1.0f + 3.0f * i, 2.0f + 3.0f * i, 3.0f + 3.0f * i}; + + // Author opinion. + if (!TF_VERIFY(widthsAttr.Set(widths))) { + return; + } + + inputSceneIndex->ApplyPendingUpdates(); + dataSourcesCache.Pull(); + + if (!TF_VERIFY(dataSourcesCache.hasPrimvarName)) { + // We expect that the primvar is listed by the + // primvars container data source, now that we + // have an authored value. + return; + } + + if (!TF_VERIFY(dataSourcesCache.primvarValueSource)) { + // Same for data source for primvar value. + return; + } + + if (!TF_VERIFY(dataSourcesCache.primvarValue == widths)) { + // And the data source better provided the authored + // value. + return; + } + } + + // Clear attribute. + widthsAttr.Clear(); + + inputSceneIndex->ApplyPendingUpdates(); + dataSourcesCache.Pull(); + + if (!TF_VERIFY(!dataSourcesCache.primvarValueSource)) { + // Authored opinion is cleared, so we should not a + // data source for the prim var value. + return; + } +} + int main() { TfErrorMark mark; @@ -510,6 +734,8 @@ int main() // appropriate resyncs. AddNonEmptyLayerTest(); + CustomPrimvarChangeTest(); + if (TF_VERIFY(mark.IsClean())) { std::cout << "OK" << std::endl; } else { diff --git a/pxr/usdImaging/usdImaging/testenv/testUsdImagingStageSceneIndexContents.cpp b/pxr/usdImaging/usdImaging/testenv/testUsdImagingStageSceneIndexContents.cpp index fdade497f8..0fa61b8240 100644 --- a/pxr/usdImaging/usdImaging/testenv/testUsdImagingStageSceneIndexContents.cpp +++ b/pxr/usdImaging/usdImaging/testenv/testUsdImagingStageSceneIndexContents.cpp @@ -1,25 +1,8 @@ // // Copyright 2024 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/stageSceneIndex.h" diff --git a/pxr/usdImaging/usdImaging/tetMeshAdapter.cpp b/pxr/usdImaging/usdImaging/tetMeshAdapter.cpp index d5b34a8782..19db01c431 100644 --- a/pxr/usdImaging/usdImaging/tetMeshAdapter.cpp +++ b/pxr/usdImaging/usdImaging/tetMeshAdapter.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. #include "pxr/usdImaging/usdImaging/tetMeshAdapter.h" #include "pxr/usdImaging/usdImaging/dataSourceTetMesh.h" @@ -33,7 +16,6 @@ #include "pxr/imaging/pxOsd/tokens.h" #include "pxr/base/tf/type.h" -#include "pxr/usd/usdGeom/tetMesh.h" PXR_NAMESPACE_OPEN_SCOPE @@ -156,10 +138,11 @@ UsdImagingTetMeshAdapter::GetTopology(UsdPrim const& prim, TRACE_FUNCTION(); HF_MALLOC_TAG_FUNCTION(); - // Compute the surfaceFaceIndices for the Tet Mesh + // Get the surfaceFaceIndices attribute for the Tet Mesh + const UsdAttribute& surfaceFaceVertexIndicesAttr = + UsdGeomTetMesh(prim).GetSurfaceFaceVertexIndicesAttr(); VtVec3iArray surfaceFaceIndices; - UsdGeomTetMesh::ComputeSurfaceFaces( - UsdGeomTetMesh(prim), &surfaceFaceIndices, time); + surfaceFaceVertexIndicesAttr.Get(&surfaceFaceIndices, time); // Compute faceVertexIndices and faceVertexCounts for the HdMeshTopology const size_t numCounts = surfaceFaceIndices.size(); diff --git a/pxr/usdImaging/usdImaging/tetMeshAdapter.h b/pxr/usdImaging/usdImaging/tetMeshAdapter.h index 79656ccdc0..00cbe5873f 100644 --- a/pxr/usdImaging/usdImaging/tetMeshAdapter.h +++ b/pxr/usdImaging/usdImaging/tetMeshAdapter.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_TET_MESH_ADAPTER_H #define PXR_USD_IMAGING_USD_IMAGING_TET_MESH_ADAPTER_H diff --git a/pxr/usdImaging/usdImaging/textureUtils.cpp b/pxr/usdImaging/usdImaging/textureUtils.cpp index b6d96c2f1f..428c982ac6 100644 --- a/pxr/usdImaging/usdImaging/textureUtils.cpp +++ b/pxr/usdImaging/usdImaging/textureUtils.cpp @@ -1,25 +1,8 @@ // // Copyright 2018 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/textureUtils.h" diff --git a/pxr/usdImaging/usdImaging/textureUtils.h b/pxr/usdImaging/usdImaging/textureUtils.h index 7f1283f886..814b3d756b 100644 --- a/pxr/usdImaging/usdImaging/textureUtils.h +++ b/pxr/usdImaging/usdImaging/textureUtils.h @@ -1,25 +1,8 @@ // // Copyright 2018 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_TEXTURE_UTILS_H #define PXR_USD_IMAGING_USD_IMAGING_TEXTURE_UTILS_H diff --git a/pxr/usdImaging/usdImaging/tokens.cpp b/pxr/usdImaging/usdImaging/tokens.cpp index 1e9bb4d893..84291300d1 100644 --- a/pxr/usdImaging/usdImaging/tokens.cpp +++ b/pxr/usdImaging/usdImaging/tokens.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/tokens.h" diff --git a/pxr/usdImaging/usdImaging/tokens.h b/pxr/usdImaging/usdImaging/tokens.h index ab17837b04..4c0b91dd29 100644 --- a/pxr/usdImaging/usdImaging/tokens.h +++ b/pxr/usdImaging/usdImaging/tokens.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_TOKENS_H #define PXR_USD_IMAGING_USD_IMAGING_TOKENS_H diff --git a/pxr/usdImaging/usdImaging/types.h b/pxr/usdImaging/usdImaging/types.h index 0a7d05442a..531fd571d3 100644 --- a/pxr/usdImaging/usdImaging/types.h +++ b/pxr/usdImaging/usdImaging/types.h @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_TYPES_H #define PXR_USD_IMAGING_USD_IMAGING_TYPES_H diff --git a/pxr/usdImaging/usdImaging/unitTestHelper.h b/pxr/usdImaging/usdImaging/unitTestHelper.h index 376f38c268..14fec69606 100644 --- a/pxr/usdImaging/usdImaging/unitTestHelper.h +++ b/pxr/usdImaging/usdImaging/unitTestHelper.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_UNIT_TEST_HELPER_H #define PXR_USD_IMAGING_USD_IMAGING_UNIT_TEST_HELPER_H diff --git a/pxr/usdImaging/usdImaging/unloadedDrawModeSceneIndex.cpp b/pxr/usdImaging/usdImaging/unloadedDrawModeSceneIndex.cpp index a999d06517..ca879d3d70 100644 --- a/pxr/usdImaging/usdImaging/unloadedDrawModeSceneIndex.cpp +++ b/pxr/usdImaging/usdImaging/unloadedDrawModeSceneIndex.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. #include "pxr/usdImaging/usdImaging/unloadedDrawModeSceneIndex.h" diff --git a/pxr/usdImaging/usdImaging/unloadedDrawModeSceneIndex.h b/pxr/usdImaging/usdImaging/unloadedDrawModeSceneIndex.h index 671ac15feb..871c2f3851 100644 --- a/pxr/usdImaging/usdImaging/unloadedDrawModeSceneIndex.h +++ b/pxr/usdImaging/usdImaging/unloadedDrawModeSceneIndex.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. #ifndef PXR_USD_IMAGING_USD_IMAGING_UNLOADED_DRAW_MODE_SCENE_INDEX_H #define PXR_USD_IMAGING_USD_IMAGING_UNLOADED_DRAW_MODE_SCENE_INDEX_H diff --git a/pxr/usdImaging/usdImaging/usdPrimInfoSchema.cpp b/pxr/usdImaging/usdImaging/usdPrimInfoSchema.cpp index 764662d6d2..aa75095fdc 100644 --- a/pxr/usdImaging/usdImaging/usdPrimInfoSchema.cpp +++ b/pxr/usdImaging/usdImaging/usdPrimInfoSchema.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/pxr/usdImaging/usdImaging/usdPrimInfoSchema.h b/pxr/usdImaging/usdImaging/usdPrimInfoSchema.h index 7b4651b613..4b98f599bb 100644 --- a/pxr/usdImaging/usdImaging/usdPrimInfoSchema.h +++ b/pxr/usdImaging/usdImaging/usdPrimInfoSchema.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/pxr/usdImaging/usdImaging/usdRenderProductSchema.cpp b/pxr/usdImaging/usdImaging/usdRenderProductSchema.cpp index e6f7a7d1a6..894a0e372d 100644 --- a/pxr/usdImaging/usdImaging/usdRenderProductSchema.cpp +++ b/pxr/usdImaging/usdImaging/usdRenderProductSchema.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/pxr/usdImaging/usdImaging/usdRenderProductSchema.h b/pxr/usdImaging/usdImaging/usdRenderProductSchema.h index 635469c6be..34633e57b0 100644 --- a/pxr/usdImaging/usdImaging/usdRenderProductSchema.h +++ b/pxr/usdImaging/usdImaging/usdRenderProductSchema.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/pxr/usdImaging/usdImaging/usdRenderSettingsSchema.cpp b/pxr/usdImaging/usdImaging/usdRenderSettingsSchema.cpp index 26ebfd4e2c..4c865de9ea 100644 --- a/pxr/usdImaging/usdImaging/usdRenderSettingsSchema.cpp +++ b/pxr/usdImaging/usdImaging/usdRenderSettingsSchema.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/pxr/usdImaging/usdImaging/usdRenderSettingsSchema.h b/pxr/usdImaging/usdImaging/usdRenderSettingsSchema.h index e61bad270a..6c66a54875 100644 --- a/pxr/usdImaging/usdImaging/usdRenderSettingsSchema.h +++ b/pxr/usdImaging/usdImaging/usdRenderSettingsSchema.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/pxr/usdImaging/usdImaging/usdRenderVarSchema.cpp b/pxr/usdImaging/usdImaging/usdRenderVarSchema.cpp index b4539190f4..f4525c0537 100644 --- a/pxr/usdImaging/usdImaging/usdRenderVarSchema.cpp +++ b/pxr/usdImaging/usdImaging/usdRenderVarSchema.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/pxr/usdImaging/usdImaging/usdRenderVarSchema.h b/pxr/usdImaging/usdImaging/usdRenderVarSchema.h index 6e532bc830..e3c0d3abc9 100644 --- a/pxr/usdImaging/usdImaging/usdRenderVarSchema.h +++ b/pxr/usdImaging/usdImaging/usdRenderVarSchema.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/pxr/usdImaging/usdImaging/version.h b/pxr/usdImaging/usdImaging/version.h index fca0150a18..fa1d43d8e3 100644 --- a/pxr/usdImaging/usdImaging/version.h +++ b/pxr/usdImaging/usdImaging/version.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_VERSION_H #define PXR_USD_IMAGING_USD_IMAGING_VERSION_H diff --git a/pxr/usdImaging/usdImaging/volumeAdapter.cpp b/pxr/usdImaging/usdImaging/volumeAdapter.cpp index 62fda38727..9ed1f8c313 100644 --- a/pxr/usdImaging/usdImaging/volumeAdapter.cpp +++ b/pxr/usdImaging/usdImaging/volumeAdapter.cpp @@ -1,25 +1,8 @@ // // Copyright 2018 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImaging/volumeAdapter.h" diff --git a/pxr/usdImaging/usdImaging/volumeAdapter.h b/pxr/usdImaging/usdImaging/volumeAdapter.h index 6ac5eee884..0047f981ce 100644 --- a/pxr/usdImaging/usdImaging/volumeAdapter.h +++ b/pxr/usdImaging/usdImaging/volumeAdapter.h @@ -1,25 +1,8 @@ // // Copyright 2018 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_VOLUME_ADAPTER_H #define PXR_USD_IMAGING_USD_IMAGING_VOLUME_ADAPTER_H @@ -76,17 +59,20 @@ class UsdImagingVolumeAdapter : public UsdImagingGprimAdapter { /// \name Initialization // ---------------------------------------------------------------------- // + USDIMAGING_API virtual SdfPath Populate(UsdPrim const& prim, UsdImagingIndexProxy* index, UsdImagingInstancerContext const* instancerContext = NULL) override; + USDIMAGING_API virtual bool IsSupported(UsdImagingIndexProxy const* index) const override; // ---------------------------------------------------------------------- // /// \name Parallel Setup and Resolve // ---------------------------------------------------------------------- // /// Thread Safe. + USDIMAGING_API virtual void TrackVariability(UsdPrim const& prim, SdfPath const& cachePath, HdDirtyBits* timeVaryingBits, @@ -94,6 +80,7 @@ class UsdImagingVolumeAdapter : public UsdImagingGprimAdapter { instancerContext = NULL) const override; /// Thread Safe. + USDIMAGING_API virtual void UpdateForTime(UsdPrim const& prim, SdfPath const& cachePath, UsdTimeCode time, @@ -101,6 +88,7 @@ class UsdImagingVolumeAdapter : public UsdImagingGprimAdapter { UsdImagingInstancerContext const* instancerContext = NULL) const override; + USDIMAGING_API virtual HdVolumeFieldDescriptorVector GetVolumeFieldDescriptors(UsdPrim const& usdPrim, SdfPath const &id, UsdTimeCode time) const override; diff --git a/pxr/usdImaging/usdImagingGL/CMakeLists.txt b/pxr/usdImaging/usdImagingGL/CMakeLists.txt index 0032e2ca1b..f710b3e157 100644 --- a/pxr/usdImaging/usdImagingGL/CMakeLists.txt +++ b/pxr/usdImaging/usdImagingGL/CMakeLists.txt @@ -644,6 +644,16 @@ pxr_install_test_dir( DEST testUsdImagingGLDomeLightTaskController ) +pxr_install_test_dir( + SRC testenv/testUsdImagingGLVelocityMotion + DEST testUsdImagingGLVelocityMotion +) + +pxr_install_test_dir( + SRC testenv/testUsdImagingGLVelocityMotion + DEST testUsdImagingGLVelocityMotion_SceneIndex +) + # # Register tests that don't depend on build configuration or external libraries # (such as MaterialX, OpenVDB, PTEX). @@ -652,8 +662,8 @@ pxr_register_test(testUsdImagingGLBasicDrawing COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -offscreen -stage basicDrawing/basicDrawing.usda -write testUsdImagingGLBasicDrawing.png" IMAGE_DIFF_COMPARE testUsdImagingGLBasicDrawing.png - FAIL 1 - FAIL_PERCENT 1 + FAIL 0.2 + FAIL_PERCENT 0.5 PERCEPTUAL EXPECTED_RETURN_CODE 0 ENV @@ -691,7 +701,7 @@ pxr_register_test(testUsdImagingGLBasicDrawing_clipped IMAGE_DIFF_COMPARE testUsdImagingGLBasicDrawing_clipped.png FAIL 1 - FAIL_PERCENT 1 + FAIL_PERCENT 0.9 PERCEPTUAL EXPECTED_RETURN_CODE 0 TESTENV testUsdImagingGLBasicDrawing @@ -783,8 +793,8 @@ pxr_register_test(testUsdImagingGLBasicLighting COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -offscreen -lighting -stage basicDrawing.usda -write testUsdImagingGLBasicLighting.png" IMAGE_DIFF_COMPARE testUsdImagingGLBasicLighting.png - FAIL 1 - FAIL_PERCENT 1 + FAIL 0.5 + FAIL_PERCENT 0.1 PERCEPTUAL EXPECTED_RETURN_CODE 0 TESTENV testUsdImagingGLBasicLighting @@ -823,56 +833,56 @@ pxr_register_test(testUsdImagingGLCurves_refined TESTENV testUsdImagingGLCurves ) -pxr_register_test(testUsdImagingGL_moreCurves +pxr_register_test(testUsdImagingGLCurves_moreCurves COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -offscreen -frameAll -stage moreCurves.usda -camlight -shading smooth -write testUsdImagingGL_moreCurves.png" IMAGE_DIFF_COMPARE testUsdImagingGL_moreCurves.png FAIL 1 - FAIL_PERCENT 1 + FAIL_PERCENT 0.5 PERCEPTUAL EXPECTED_RETURN_CODE 0 TESTENV testUsdImagingGLCurves ) -pxr_register_test(testUsdImagingGL_moreCurves_refined +pxr_register_test(testUsdImagingGLCurves_moreCurves_refined COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -offscreen -frameAll -complexity 1.1 -stage moreCurves.usda -camlight -shading smooth -write testUsdImagingGL_moreCurves_refined.png" IMAGE_DIFF_COMPARE testUsdImagingGL_moreCurves_refined.png FAIL 1 - FAIL_PERCENT 1 + FAIL_PERCENT 0.9 PERCEPTUAL EXPECTED_RETURN_CODE 0 TESTENV testUsdImagingGLCurves ) -pxr_register_test(testUsdImagingGL_moreCurves_faketubes +pxr_register_test(testUsdImagingGLCurves_moreCurves_faketubes COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -offscreen -frameAll -complexity 1.2 -stage moreCurves.usda -camlight -shading smooth -write testUsdImagingGL_moreCurves_faketubes.png" IMAGE_DIFF_COMPARE testUsdImagingGL_moreCurves_faketubes.png FAIL 1 - FAIL_PERCENT 1 + FAIL_PERCENT 0.9 PERCEPTUAL EXPECTED_RETURN_CODE 0 TESTENV testUsdImagingGLCurves ) -pxr_register_test(testUsdImagingGL_moreCurves_tubes +pxr_register_test(testUsdImagingGLCurves_moreCurves_tubes COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -offscreen -frameAll -complexity 1.3 -stage moreCurves.usda -camlight -shading smooth -write testUsdImagingGL_moreCurves_tubes.png" IMAGE_DIFF_COMPARE testUsdImagingGL_moreCurves_tubes.png FAIL 1 - FAIL_PERCENT 1 + FAIL_PERCENT 0.9 PERCEPTUAL EXPECTED_RETURN_CODE 0 TESTENV testUsdImagingGLCurves ) -pxr_register_test(testUsdImagingGL_pinnedCurves +pxr_register_test(testUsdImagingGLCurves_pinnedCurves COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -offscreen -frameAll -complexity 1.3 -stage pinnedCurves.usda -camlight -shading smooth -write testUsdImagingGL_pinnedCurves.png" IMAGE_DIFF_COMPARE testUsdImagingGL_pinnedCurves.png FAIL 1 - FAIL_PERCENT 1 + FAIL_PERCENT 0.2 PERCEPTUAL EXPECTED_RETURN_CODE 0 TESTENV testUsdImagingGLCurves @@ -883,7 +893,7 @@ pxr_register_test(testUsdImagingGLPoints IMAGE_DIFF_COMPARE testUsdImagingGLPoints.png FAIL 1 - FAIL_PERCENT 1 + FAIL_PERCENT 0.9 PERCEPTUAL EXPECTED_RETURN_CODE 0 TESTENV testUsdImagingGLPoints @@ -1206,7 +1216,7 @@ pxr_register_test(testUsdImagingGLSubdivisionSchemeNone IMAGE_DIFF_COMPARE testUsdImagingGLSubdivisionSchemeNone_1.png testUsdImagingGLSubdivisionSchemeNone_1.3.png - FAIL 1 + FAIL 0.3 FAIL_PERCENT 1 PERCEPTUAL EXPECTED_RETURN_CODE 0 @@ -1218,7 +1228,7 @@ pxr_register_test(testUsdImagingGLSubdivisionSchemeNone_NoLights IMAGE_DIFF_COMPARE testUsdImagingGLSubdivisionSchemeNone_NoLights_1.png testUsdImagingGLSubdivisionSchemeNone_NoLights_1.3.png - FAIL 1 + FAIL 0.2 FAIL_PERCENT 1 PERCEPTUAL EXPECTED_RETURN_CODE 0 @@ -1306,9 +1316,8 @@ pxr_register_test(testUsdImagingGLFlatShading COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -offscreen -frameAll -lighting -shading flat -stage primitives.usda -write testUsdImagingGLFlatShading.png" IMAGE_DIFF_COMPARE testUsdImagingGLFlatShading.png - FAIL 1 + FAIL 0.1 FAIL_PERCENT 1 - PERCEPTUAL EXPECTED_RETURN_CODE 0 TESTENV testUsdImagingGLFlatShading ) @@ -1317,9 +1326,8 @@ pxr_register_test(testUsdImagingGLShadeMaterial COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -offscreen -frameAll -stage coloredCubes.usda -write testUsdImagingGLShadeMaterial.png" IMAGE_DIFF_COMPARE testUsdImagingGLShadeMaterial.png - FAIL 1 - FAIL_PERCENT 1 - PERCEPTUAL + FAIL 0.3 + FAIL_PERCENT 0.9 EXPECTED_RETURN_CODE 0 TESTENV testUsdImagingGLShadeMaterial ENV @@ -1975,7 +1983,6 @@ pxr_register_test(testUsdImagingGLPointInstancer_pi_pi_time pi_pi_time_001.png FAIL .05 FAIL_PERCENT .03 - PERCEPTUAL EXPECTED_RETURN_CODE 0 TESTENV testUsdImagingGLPointInstancer ) @@ -2303,7 +2310,6 @@ pxr_register_test(testUsdImagingGLPointInstancer_SceneIndex_pi_pi_time pi_pi_time_001.png FAIL .05 FAIL_PERCENT .03 - PERCEPTUAL EXPECTED_RETURN_CODE 0 TESTENV testUsdImagingGLPointInstancer_SceneIndex ENV @@ -2376,7 +2382,6 @@ pxr_register_test(testUsdImagingGLResync world_2.png FAIL .05 FAIL_PERCENT .03 - PERCEPTUAL EXPECTED_RETURN_CODE 0 TESTENV testUsdImagingGLResync ) @@ -2389,7 +2394,6 @@ pxr_register_test(testUsdImagingGLResync_instancer instancer_2.png FAIL .05 FAIL_PERCENT .03 - PERCEPTUAL EXPECTED_RETURN_CODE 0 TESTENV testUsdImagingGLResync ) @@ -2429,9 +2433,8 @@ pxr_register_test(testUsdImagingGLPrimvarSharing_refined refined_000.png refined_001.png refined_002.png - FAIL 1 + FAIL 0.1 FAIL_PERCENT 1 - PERCEPTUAL EXPECTED_RETURN_CODE 0 TESTENV testUsdImagingGLPrimvarSharing ENV @@ -2595,9 +2598,8 @@ pxr_register_test(testUsdImagingGLNormals COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -offscreen -lighting -shading smooth -frameAll -stage testNormals.usda -write testNormals.png" IMAGE_DIFF_COMPARE testNormals.png - FAIL 1 + FAIL 0.1 FAIL_PERCENT 1 - PERCEPTUAL EXPECTED_RETURN_CODE 0 TESTENV testUsdImagingGLNormals ) @@ -2705,7 +2707,7 @@ pxr_register_test(testUsdImagingGLPreviewSurface_Displacement IMAGE_DIFF_COMPARE testPreviewSurfaceDisplacement.png FAIL 1 - FAIL_PERCENT 1 + FAIL_PERCENT 0.7 PERCEPTUAL EXPECTED_RETURN_CODE 0 TESTENV testUsdImagingGLPreviewSurface @@ -2985,7 +2987,7 @@ pxr_register_test(testUsdImagingGLPreviewSurfaceNonBindless_Displacement IMAGE_DIFF_COMPARE testPreviewSurfaceDisplacement.png FAIL 1 - FAIL_PERCENT 1 + FAIL_PERCENT 0.7 PERCEPTUAL EXPECTED_RETURN_CODE 0 TESTENV testUsdImagingGLPreviewSurface @@ -3544,9 +3546,8 @@ pxr_register_test(testUsdImagingGLUsdLux COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -offscreen -lighting -shading smooth -frameAll -stage usdLux.usda -write usdLux.png" IMAGE_DIFF_COMPARE usdLux.png - FAIL 1 + FAIL 0.1 FAIL_PERCENT 1 - PERCEPTUAL EXPECTED_RETURN_CODE 0 TESTENV testUsdImagingGLUsdLux ) @@ -3674,9 +3675,8 @@ pxr_register_test(testUsdImagingGLUsdSkelExtCompCPU_arm_baked usdSkel_arm_baked_001.png usdSkel_arm_baked_003.png usdSkel_arm_baked_007.png - FAIL 1 + FAIL 0.1 FAIL_PERCENT 1 - PERCEPTUAL EXPECTED_RETURN_CODE 0 TESTENV testUsdImagingGLUsdSkel ENV @@ -3689,9 +3689,8 @@ pxr_register_test(testUsdImagingGLUsdSkelExtCompCPU_arm usdSkel_arm_extComp_CPU_001.png usdSkel_arm_extComp_CPU_003.png usdSkel_arm_extComp_CPU_007.png - FAIL 1 + FAIL 0.1 FAIL_PERCENT 1 - PERCEPTUAL EXPECTED_RETURN_CODE 0 TESTENV testUsdImagingGLUsdSkel ENV @@ -3702,9 +3701,8 @@ pxr_register_test(testUsdImagingGLUsdSkelExtCompCPU_twoBends COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -offscreen -frameAll -lighting -camlight -shading wireOnSurface -stage twoBends.usda -write usdSkel_twoBends_extComp_CPU.png" IMAGE_DIFF_COMPARE usdSkel_twoBends_extComp_CPU.png - FAIL 1 + FAIL 0.1 FAIL_PERCENT 1 - PERCEPTUAL EXPECTED_RETURN_CODE 0 TESTENV testUsdImagingGLUsdSkel ENV @@ -3717,9 +3715,8 @@ pxr_register_test(testUsdImagingGLUsdSkelExtCompGPU_arm_baked usdSkel_arm_baked_001.png usdSkel_arm_baked_003.png usdSkel_arm_baked_007.png - FAIL 1 + FAIL 0.1 FAIL_PERCENT 1 - PERCEPTUAL EXPECTED_RETURN_CODE 0 TESTENV testUsdImagingGLUsdSkel ENV @@ -3825,7 +3822,6 @@ pxr_register_test(testUsdImagingGLMaterialStrengthOrder USDIMAGINGGL_ENGINE_ENABLE_SCENE_INDEX=true ) - pxr_register_test(testUsdImagingGLInstancePrimvars COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -offscreen -frameAll -stage test.usda -write testUsdImagingGLInstancePrimvars.png" IMAGE_DIFF_COMPARE @@ -3984,9 +3980,8 @@ pxr_register_test(testUsdImagingGLInheritedPurpose_none COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -guidesPurpose hide -renderPurpose hide -proxyPurpose hide -offscreen -lighting -frameAll -stage InheritedPurposes.usd -write testUsdImagingGLInheritedPurpose_none.png" IMAGE_DIFF_COMPARE testUsdImagingGLInheritedPurpose_none.png - FAIL 1 - FAIL_PERCENT 2 - PERCEPTUAL + FAIL 0.1 + FAIL_PERCENT 0.2 EXPECTED_RETURN_CODE 0 TESTENV testUsdImagingGLInheritedPurpose ) @@ -3996,9 +3991,8 @@ pxr_register_test(testUsdImagingGLInheritedPurpose_guides COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -guidesPurpose show -renderPurpose hide -proxyPurpose hide -offscreen -lighting -frameAll -stage InheritedPurposes.usd -write testUsdImagingGLInheritedPurpose_guides.png" IMAGE_DIFF_COMPARE testUsdImagingGLInheritedPurpose_guides.png - FAIL 1 - FAIL_PERCENT 2 - PERCEPTUAL + FAIL 0.1 + FAIL_PERCENT 0.4 EXPECTED_RETURN_CODE 0 TESTENV testUsdImagingGLInheritedPurpose ) @@ -4008,9 +4002,8 @@ pxr_register_test(testUsdImagingGLInheritedPurpose_render COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -guidesPurpose hide -renderPurpose show -proxyPurpose hide -offscreen -lighting -frameAll -stage InheritedPurposes.usd -write testUsdImagingGLInheritedPurpose_render.png" IMAGE_DIFF_COMPARE testUsdImagingGLInheritedPurpose_render.png - FAIL 1 - FAIL_PERCENT 2 - PERCEPTUAL + FAIL 0.1 + FAIL_PERCENT 0.4 EXPECTED_RETURN_CODE 0 TESTENV testUsdImagingGLInheritedPurpose ) @@ -4020,9 +4013,8 @@ pxr_register_test(testUsdImagingGLInheritedPurpose_proxy COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -guidesPurpose hide -renderPurpose hide -proxyPurpose show -offscreen -lighting -frameAll -stage InheritedPurposes.usd -write testUsdImagingGLInheritedPurpose_proxy.png" IMAGE_DIFF_COMPARE testUsdImagingGLInheritedPurpose_proxy.png - FAIL 1 - FAIL_PERCENT 1 - PERCEPTUAL + FAIL 0.1 + FAIL_PERCENT 0.35 EXPECTED_RETURN_CODE 0 TESTENV testUsdImagingGLInheritedPurpose ) @@ -4032,9 +4024,8 @@ pxr_register_test(testUsdImagingGLInheritedPurpose_all COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -guidesPurpose show -renderPurpose show -proxyPurpose show -offscreen -lighting -frameAll -stage InheritedPurposes.usd -write testUsdImagingGLInheritedPurpose_all.png" IMAGE_DIFF_COMPARE testUsdImagingGLInheritedPurpose_all.png - FAIL 1 - FAIL_PERCENT 1 - PERCEPTUAL + FAIL 0.1 + FAIL_PERCENT 0.4 EXPECTED_RETURN_CODE 0 TESTENV testUsdImagingGLInheritedPurpose ) @@ -4046,9 +4037,8 @@ pxr_register_test(testUsdImagingGLInheritedPurpose_Instanced_none COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -guidesPurpose hide -renderPurpose hide -proxyPurpose hide -offscreen -lighting -frameAll -stage InheritedPurposes_Instanced.usd -write testUsdImagingGLInheritedPurpose_none.png" IMAGE_DIFF_COMPARE testUsdImagingGLInheritedPurpose_none.png - FAIL 1 - FAIL_PERCENT 1.1 - PERCEPTUAL + FAIL 0.1 + FAIL_PERCENT 0.2 EXPECTED_RETURN_CODE 0 TESTENV testUsdImagingGLInheritedPurpose ) @@ -4058,9 +4048,8 @@ pxr_register_test(testUsdImagingGLInheritedPurpose_Instanced_guides COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -guidesPurpose show -renderPurpose hide -proxyPurpose hide -offscreen -lighting -frameAll -stage InheritedPurposes_Instanced.usd -write testUsdImagingGLInheritedPurpose_guides.png" IMAGE_DIFF_COMPARE testUsdImagingGLInheritedPurpose_guides.png - FAIL 1 - FAIL_PERCENT 1.25 - PERCEPTUAL + FAIL 0.1 + FAIL_PERCENT 0.4 EXPECTED_RETURN_CODE 0 TESTENV testUsdImagingGLInheritedPurpose ) @@ -4070,9 +4059,8 @@ pxr_register_test(testUsdImagingGLInheritedPurpose_Instanced_render COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -guidesPurpose hide -renderPurpose show -proxyPurpose hide -offscreen -lighting -frameAll -stage InheritedPurposes_Instanced.usd -write testUsdImagingGLInheritedPurpose_render.png" IMAGE_DIFF_COMPARE testUsdImagingGLInheritedPurpose_render.png - FAIL 1 - FAIL_PERCENT 1.85 - PERCEPTUAL + FAIL 0.1 + FAIL_PERCENT 0.4 EXPECTED_RETURN_CODE 0 TESTENV testUsdImagingGLInheritedPurpose ) @@ -4082,9 +4070,8 @@ pxr_register_test(testUsdImagingGLInheritedPurpose_Instanced_proxy COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -guidesPurpose hide -renderPurpose hide -proxyPurpose show -offscreen -lighting -frameAll -stage InheritedPurposes_Instanced.usd -write testUsdImagingGLInheritedPurpose_proxy.png" IMAGE_DIFF_COMPARE testUsdImagingGLInheritedPurpose_proxy.png - FAIL 1 - FAIL_PERCENT 1 - PERCEPTUAL + FAIL 0.1 + FAIL_PERCENT 0.4 EXPECTED_RETURN_CODE 0 TESTENV testUsdImagingGLInheritedPurpose ) @@ -4094,9 +4081,8 @@ pxr_register_test(testUsdImagingGLInheritedPurpose_Instanced_all COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -guidesPurpose show -renderPurpose show -proxyPurpose show -offscreen -lighting -frameAll -stage InheritedPurposes_Instanced.usd -write testUsdImagingGLInheritedPurpose_all.png" IMAGE_DIFF_COMPARE testUsdImagingGLInheritedPurpose_all.png - FAIL 1 - FAIL_PERCENT 1 - PERCEPTUAL + FAIL 0.1 + FAIL_PERCENT 0.4 EXPECTED_RETURN_CODE 0 TESTENV testUsdImagingGLInheritedPurpose ) @@ -4565,6 +4551,32 @@ pxr_register_test(testUsdImagingGLDomeLightTaskController TESTENV testUsdImagingGLDomeLightTaskController ) +pxr_register_test(testUsdImagingGLVelocityMotion + COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -offscreen -lighting -camlight -shading wireOnSurface -camera /World/main_cam -stage scene.usda -times 1 2.5 4 -write testUsdImagingGLVelocityMotion.png" + IMAGE_DIFF_COMPARE + testUsdImagingGLVelocityMotion_001.png + testUsdImagingGLVelocityMotion_2.5.png + testUsdImagingGLVelocityMotion_004.png + FAIL 1 + FAIL_PERCENT 1 + PERCEPTUAL + EXPECTED_RETURN_CODE 0 + TESTENV testUsdImagingGLVelocityMotion) + +pxr_register_test(testUsdImagingGLVelocityMotion_SceneIndex + COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -offscreen -lighting -camlight -shading wireOnSurface -camera /World/main_cam -stage scene.usda -times 1 2.5 4 -write testUsdImagingGLVelocityMotion.png" + IMAGE_DIFF_COMPARE + testUsdImagingGLVelocityMotion_001.png + testUsdImagingGLVelocityMotion_2.5.png + testUsdImagingGLVelocityMotion_004.png + FAIL 1 + FAIL_PERCENT 1 + PERCEPTUAL + EXPECTED_RETURN_CODE 0 + TESTENV testUsdImagingGLVelocityMotion_SceneIndex + ENV + USDIMAGINGGL_ENGINE_ENABLE_SCENE_INDEX=1) + # # Conditionally install and register MaterialX tests # @@ -4578,10 +4590,10 @@ if (MaterialX_FOUND AND ${PXR_ENABLE_MATERIALX_SUPPORT}) COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -frameAll -stage mxSimple.usda -write mxSimple.png" IMAGE_DIFF_COMPARE mxSimple.png - FAIL 0.5 + FAIL 0.3 FAIL_PERCENT 0.005 WARN 0.05 - WARN_PERCENT 0.0075 + WARN_PERCENT 0.03 EXPECTED_RETURN_CODE 0 TESTENV testUsdImagingGLMaterialXBasic ) @@ -4590,7 +4602,7 @@ if (MaterialX_FOUND AND ${PXR_ENABLE_MATERIALX_SUPPORT}) COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -frameAll -stage standardSurface.usda -write standardSurface.png" IMAGE_DIFF_COMPARE standardSurface.png - FAIL 0.5 + FAIL 0.3 FAIL_PERCENT 0.005 WARN 0.05 WARN_PERCENT 0.2 @@ -4602,10 +4614,10 @@ if (MaterialX_FOUND AND ${PXR_ENABLE_MATERIALX_SUPPORT}) COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -frameAll -stage standardSurfaceMarble.usda -write standardSurfaceMarble.png" IMAGE_DIFF_COMPARE standardSurfaceMarble.png - FAIL 0.5 + FAIL 0.1 FAIL_PERCENT 0.005 WARN 0.05 - WARN_PERCENT 0.02 + WARN_PERCENT 0.01 EXPECTED_RETURN_CODE 0 TESTENV testUsdImagingGLMaterialXBasic ) @@ -4614,10 +4626,10 @@ if (MaterialX_FOUND AND ${PXR_ENABLE_MATERIALX_SUPPORT}) COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -frameAll -stage usdPreviewSurface.usda -write usdPreviewSurface.png" IMAGE_DIFF_COMPARE usdPreviewSurface.png - FAIL 0.5 + FAIL 0.3 FAIL_PERCENT 0.005 WARN 0.05 - WARN_PERCENT 0.06 + WARN_PERCENT 0.09 EXPECTED_RETURN_CODE 0 TESTENV testUsdImagingGLMaterialXBasic ) @@ -4626,7 +4638,7 @@ if (MaterialX_FOUND AND ${PXR_ENABLE_MATERIALX_SUPPORT}) COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -frameAll -stage mxGlass.usda -write mxGlass.png" IMAGE_DIFF_COMPARE mxGlass.png - FAIL 0.5 + FAIL 0.3 FAIL_PERCENT 0.005 WARN 0.05 WARN_PERCENT 0.02 @@ -4638,7 +4650,7 @@ if (MaterialX_FOUND AND ${PXR_ENABLE_MATERIALX_SUPPORT}) COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -stage basicMxYup.usda -camera /FrontCamera -write basicMxYup.png" IMAGE_DIFF_COMPARE basicMxYup.png - FAIL 0.5 + FAIL 0.1 FAIL_PERCENT 0.005 WARN 0.05 WARN_PERCENT 0.0025 @@ -4650,7 +4662,7 @@ if (MaterialX_FOUND AND ${PXR_ENABLE_MATERIALX_SUPPORT}) COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -stage basicMxZup.usda -camera /FrontCamera -write basicMxZup.png" IMAGE_DIFF_COMPARE basicMxZup.png - FAIL 0.5 + FAIL 0.1 FAIL_PERCENT 0.005 WARN 0.05 WARN_PERCENT 0.0025 @@ -4662,7 +4674,7 @@ if (MaterialX_FOUND AND ${PXR_ENABLE_MATERIALX_SUPPORT}) COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -frameAll -stage mxDirectLights.usda -write mxDirectLights.png" IMAGE_DIFF_COMPARE mxDirectLights.png - FAIL 0.5 + FAIL 0.1 FAIL_PERCENT 0.005 WARN 0.05 WARN_PERCENT 0.0025 @@ -4674,7 +4686,7 @@ if (MaterialX_FOUND AND ${PXR_ENABLE_MATERIALX_SUPPORT}) COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -lighting -camlight -shading smooth -complexity 1.3 -offscreen -frameAll -stage mxDirectLights.usda -write mxDirectLightsCameraLight.png" IMAGE_DIFF_COMPARE mxDirectLightsCameraLight.png - FAIL 0.5 + FAIL 0.1 FAIL_PERCENT 0.005 WARN 0.05 WARN_PERCENT 0.0025 @@ -4686,7 +4698,7 @@ if (MaterialX_FOUND AND ${PXR_ENABLE_MATERIALX_SUPPORT}) COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -frameAll -stage mxLights.usda -write mxLights.png" IMAGE_DIFF_COMPARE mxLights.png - FAIL 0.5 + FAIL 0.1 FAIL_PERCENT 0.005 WARN 0.05 WARN_PERCENT 0.02 @@ -4698,7 +4710,7 @@ if (MaterialX_FOUND AND ${PXR_ENABLE_MATERIALX_SUPPORT}) COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -frameAll -stage mxColorspaces.usda -write mxColorspaces.png" IMAGE_DIFF_COMPARE mxColorspaces.png - FAIL 0.5 + FAIL 0.1 FAIL_PERCENT 0.005 WARN 0.05 WARN_PERCENT 0.02 @@ -4710,10 +4722,10 @@ if (MaterialX_FOUND AND ${PXR_ENABLE_MATERIALX_SUPPORT}) COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -frameAll -stage mxNormalMap.usda -write mxNormalMap.png" IMAGE_DIFF_COMPARE mxNormalMap.png - FAIL 0.5 + FAIL 0.1 FAIL_PERCENT 0.005 WARN 0.05 - WARN_PERCENT 0.02 + WARN_PERCENT 0.03 EXPECTED_RETURN_CODE 0 TESTENV testUsdImagingGLMaterialXBasic ) @@ -4729,7 +4741,7 @@ if (MaterialX_FOUND AND ${PXR_ENABLE_MATERIALX_SUPPORT}) COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -frameAll -stage mxTextured.usda -write mxTextured.png" IMAGE_DIFF_COMPARE mxTextured.png - FAIL 0.5 + FAIL 0.1 FAIL_PERCENT 0.005 WARN 0.05 WARN_PERCENT 0.05 @@ -4741,7 +4753,7 @@ if (MaterialX_FOUND AND ${PXR_ENABLE_MATERIALX_SUPPORT}) COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -frameAll -stage mxTextured2.usda -write mxTextured2.png" IMAGE_DIFF_COMPARE mxTextured2.png - FAIL 0.5 + FAIL 0.1 FAIL_PERCENT 0.005 WARN 0.05 WARN_PERCENT 0.0025 @@ -4753,7 +4765,7 @@ if (MaterialX_FOUND AND ${PXR_ENABLE_MATERIALX_SUPPORT}) COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -frameAll -stage mxGeomprop.usda -write mxGeomprop.png" IMAGE_DIFF_COMPARE mxGeomprop.png - FAIL 0.5 + FAIL 0.1 FAIL_PERCENT 0.005 WARN 0.05 WARN_PERCENT 0.02 @@ -4765,7 +4777,7 @@ if (MaterialX_FOUND AND ${PXR_ENABLE_MATERIALX_SUPPORT}) COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -frameAll -stage mxTexcoord.usda -write mxTexcoord.png" IMAGE_DIFF_COMPARE mxTexcoord.png - FAIL 0.5 + FAIL 0.1 FAIL_PERCENT 0.005 WARN 0.05 WARN_PERCENT 0.02 @@ -4801,7 +4813,7 @@ if (MaterialX_FOUND AND ${PXR_ENABLE_MATERIALX_SUPPORT}) COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -camera /Camera -stage mxDefaultGeompropVal.usda -write mxDefaultGeompropVal.png" IMAGE_DIFF_COMPARE mxDefaultGeompropVal.png - FAIL 0.5 + FAIL 0.1 FAIL_PERCENT 0.005 WARN 0.05 WARN_PERCENT 0.02 @@ -4825,7 +4837,7 @@ if (MaterialX_FOUND AND ${PXR_ENABLE_MATERIALX_SUPPORT}) COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -frameAll -stage mxTexColorspaces.usda -write mxTexColorspaces.png" IMAGE_DIFF_COMPARE mxTexColorspaces.png - FAIL 0.5 + FAIL 0.1 FAIL_PERCENT 0.005 WARN 0.05 WARN_PERCENT 0.02 @@ -5041,7 +5053,7 @@ if (MaterialX_FOUND AND ${PXR_ENABLE_MATERIALX_SUPPORT}) COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -camera /Camera -stage customMaterial.usda -write customMaterial.png" IMAGE_DIFF_COMPARE customMaterial.png - FAIL 0.5 + FAIL 0.1 FAIL_PERCENT 0.005 WARN 0.05 WARN_PERCENT 0.2 @@ -5055,7 +5067,7 @@ if (MaterialX_FOUND AND ${PXR_ENABLE_MATERIALX_SUPPORT}) COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -lighting -sceneLights -shading smooth -complexity 1.3 -offscreen -camera /Camera -stage customColor.usda -write customColor.png" IMAGE_DIFF_COMPARE customColor.png - FAIL 0.5 + FAIL 0.1 FAIL_PERCENT 0.005 WARN 0.05 WARN_PERCENT 0.2 diff --git a/pxr/usdImaging/usdImagingGL/__init__.py b/pxr/usdImaging/usdImagingGL/__init__.py index 71d85c6b0e..1fadb021f2 100644 --- a/pxr/usdImaging/usdImagingGL/__init__.py +++ b/pxr/usdImaging/usdImagingGL/__init__.py @@ -1,25 +1,8 @@ # # Copyright 2016 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # from pxr import Tf Tf.PreparePythonModule() diff --git a/pxr/usdImaging/usdImagingGL/api.h b/pxr/usdImaging/usdImagingGL/api.h index 3ba4bc3846..af56570b56 100644 --- a/pxr/usdImaging/usdImagingGL/api.h +++ b/pxr/usdImaging/usdImagingGL/api.h @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_GL_API_H #define PXR_USD_IMAGING_USD_IMAGING_GL_API_H diff --git a/pxr/usdImaging/usdImagingGL/engine.cpp b/pxr/usdImaging/usdImagingGL/engine.cpp index 7c6b2cd5dd..12b4bc6610 100644 --- a/pxr/usdImaging/usdImagingGL/engine.cpp +++ b/pxr/usdImaging/usdImagingGL/engine.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImagingGL/engine.h" @@ -301,6 +284,7 @@ UsdImagingGLEngine::PrepareBatch( _sceneDelegate->SetTime(params.frame); } + _SetSceneGlobalsCurrentFrame(params.frame); _PostSetTime(params); } } @@ -366,6 +350,10 @@ UsdImagingGLEngine::_SetActiveRenderSettingsPrimFromStageMetadata( void UsdImagingGLEngine::_UpdateDomeLightCameraVisibility() { + if (!_renderIndex->IsSprimTypeSupported(HdPrimTypeTokens->domeLight)) { + return; + } + // Check to see if the dome light camera visibility has changed, and mark // the dome light prim as dirty if it has. // @@ -762,6 +750,49 @@ UsdImagingGLEngine::TestIntersection( SdfPath *outHitInstancerPath, int *outHitInstanceIndex, HdInstancerContext *outInstancerContext) +{ + PickParams pickParams = { HdxPickTokens->resolveNearestToCenter }; + IntersectionResultVector results; + + if (TestIntersection(pickParams, viewMatrix, projectionMatrix, + root, params, &results)) { + if (results.size() != 1) { + // Since we are in nearest-hit mode, we expect allHits to have a + // single point in it. + return false; + } + IntersectionResult &result = results.front(); + if (outHitPoint) { + *outHitPoint = result.hitPoint; + } + if (outHitNormal) { + *outHitNormal = result.hitNormal; + } + if (outHitPrimPath) { + *outHitPrimPath = result.hitPrimPath; + } + if (outHitInstancerPath) { + *outHitInstancerPath = result.hitInstancerPath; + } + if (outHitInstanceIndex) { + *outHitInstanceIndex = result.hitInstanceIndex; + } + if (outInstancerContext) { + *outInstancerContext = result.instancerContext; + } + return true; + } + return false; +} + +bool +UsdImagingGLEngine::TestIntersection( + const PickParams& pickParams, + const GfMatrix4d& viewMatrix, + const GfMatrix4d& projectionMatrix, + const UsdPrim& root, + const UsdImagingGLRenderParams& params, + IntersectionResultVector* outResults) { if (ARCH_UNLIKELY(!_renderDelegate)) { return false; @@ -781,58 +812,50 @@ UsdImagingGLEngine::TestIntersection( _PrepareRender(params); HdxPickHitVector allHits; - HdxPickTaskContextParams pickParams; - pickParams.resolveMode = HdxPickTokens->resolveNearestToCenter; - pickParams.viewMatrix = viewMatrix; - pickParams.projectionMatrix = projectionMatrix; - pickParams.clipPlanes = params.clipPlanes; - pickParams.collection = _intersectCollection; - pickParams.outHits = &allHits; - const VtValue vtPickParams(pickParams); - - _engine->SetTaskContextData(HdxPickTokens->pickParams, vtPickParams); + HdxPickTaskContextParams pickCtxParams; + pickCtxParams.resolveMode = pickParams.resolveMode; + pickCtxParams.viewMatrix = viewMatrix; + pickCtxParams.projectionMatrix = projectionMatrix; + pickCtxParams.clipPlanes = params.clipPlanes; + pickCtxParams.collection = _intersectCollection; + pickCtxParams.outHits = &allHits; + const VtValue vtPickCtxParams(pickCtxParams); + + _engine->SetTaskContextData(HdxPickTokens->pickParams, vtPickCtxParams); _Execute(params, _taskController->GetPickingTasks()); - // Since we are in nearest-hit mode, we expect allHits to have - // a single point in it. - if (allHits.size() != 1) { + // return false if there were no hits + if (allHits.size() == 0) { return false; } - HdxPickHit &hit = allHits[0]; + for(HdxPickHit& hit : allHits) + { + IntersectionResult res; - if (outHitPoint) { - *outHitPoint = hit.worldSpaceHitPoint; - } + if (_sceneDelegate) { + res.hitPrimPath = _sceneDelegate->GetScenePrimPath( + hit.objectId, hit.instanceIndex, &(res.instancerContext)); + res.hitInstancerPath = _sceneDelegate->ConvertIndexPathToCachePath( + hit.instancerId).GetAbsoluteRootOrPrimPath(); + } else { + const HdxPrimOriginInfo info = HdxPrimOriginInfo::FromPickHit( + _renderIndex.get(), hit); + res.hitPrimPath = info.GetFullPath(); + res.hitInstancerPath = hit.instancerId.ReplacePrefix( + _sceneDelegateId, SdfPath::AbsoluteRootPath()); + res.instancerContext = info.ComputeInstancerContext(); + } - if (outHitNormal) { - *outHitNormal = hit.worldSpaceHitNormal; - } + res.hitPoint = hit.worldSpaceHitPoint; + res.hitNormal = hit.worldSpaceHitNormal; + res.hitInstanceIndex = hit.instanceIndex; - if (_sceneDelegate) { - hit.objectId = _sceneDelegate->GetScenePrimPath( - hit.objectId, hit.instanceIndex, outInstancerContext); - hit.instancerId = _sceneDelegate->ConvertIndexPathToCachePath( - hit.instancerId).GetAbsoluteRootOrPrimPath(); - } else { - const HdxPrimOriginInfo info = HdxPrimOriginInfo::FromPickHit( - _renderIndex.get(), hit); - const SdfPath usdPath = info.GetFullPath(); - if (!usdPath.IsEmpty()) { - hit.objectId = usdPath; + if (outResults) { + outResults->push_back(res); } } - if (outHitPrimPath) { - *outHitPrimPath = hit.objectId; - } - if (outHitInstancerPath) { - *outHitInstancerPath = hit.instancerId; - } - if (outHitInstanceIndex) { - *outHitInstanceIndex = hit.instanceIndex; - } - return true; } @@ -849,30 +872,39 @@ UsdImagingGLEngine::DecodeIntersection( return false; } - if (_GetUseSceneIndices()) { - // XXX(HYD-2299): picking - return false; - } - - TF_VERIFY(_sceneDelegate); - const int primId = HdxPickTask::DecodeIDRenderColor(primIdColor); const int instanceIdx = HdxPickTask::DecodeIDRenderColor(instanceIdColor); - SdfPath primPath = - _sceneDelegate->GetRenderIndex().GetRprimPathFromPrimId(primId); + SdfPath primPath = _renderIndex->GetRprimPathFromPrimId(primId); if (primPath.IsEmpty()) { return false; } SdfPath delegateId, instancerId; - _sceneDelegate->GetRenderIndex().GetSceneDelegateAndInstancerIds( + _renderIndex->GetSceneDelegateAndInstancerIds( primPath, &delegateId, &instancerId); - primPath = _sceneDelegate->GetScenePrimPath( - primPath, instanceIdx, outInstancerContext); - instancerId = _sceneDelegate->ConvertIndexPathToCachePath(instancerId) - .GetAbsoluteRootOrPrimPath(); + if (_sceneDelegate) { + primPath = _sceneDelegate->GetScenePrimPath( + primPath, instanceIdx, outInstancerContext); + instancerId = _sceneDelegate->ConvertIndexPathToCachePath(instancerId) + .GetAbsoluteRootOrPrimPath(); + } else { + HdxPickHit hit; + hit.delegateId = delegateId; + hit.objectId = primPath; + hit.instancerId = instancerId; + hit.instanceIndex = instanceIdx; + + const HdxPrimOriginInfo info = HdxPrimOriginInfo::FromPickHit( + _renderIndex.get(), hit); + primPath = info.GetFullPath(); + instancerId = instancerId.ReplacePrefix(_sceneDelegateId, + SdfPath::AbsoluteRootPath()); + if (outInstancerContext) { + *outInstancerContext = info.ComputeInstancerContext(); + } + } if (outHitPrimPath) { *outHitPrimPath = primPath; @@ -1354,6 +1386,20 @@ UsdImagingGLEngine::SetRendererSetting(TfToken const& id, VtValue const& value) _renderDelegate->SetRenderSetting(id, value); } +void +UsdImagingGLEngine::SetActiveRenderPassPrimPath(SdfPath const &path) +{ + if (ARCH_UNLIKELY(!_appSceneIndices)) { + return; + } + auto &sgsi = _appSceneIndices->sceneGlobalsSceneIndex; + if (ARCH_UNLIKELY(!sgsi)) { + return; + } + + sgsi->SetActiveRenderPassPrimPath(path); +} + void UsdImagingGLEngine::SetActiveRenderSettingsPrimPath(SdfPath const &path) { @@ -1368,6 +1414,19 @@ UsdImagingGLEngine::SetActiveRenderSettingsPrimPath(SdfPath const &path) sgsi->SetActiveRenderSettingsPrimPath(path); } +void UsdImagingGLEngine::_SetSceneGlobalsCurrentFrame(UsdTimeCode const &time) +{ + if (ARCH_UNLIKELY(!_appSceneIndices)) { + return; + } + auto &sgsi = _appSceneIndices->sceneGlobalsSceneIndex; + if (ARCH_UNLIKELY(!sgsi)) { + return; + } + + sgsi->SetCurrentFrame(time.GetValue()); +} + /* static */ SdfPathVector UsdImagingGLEngine::GetAvailableRenderSettingsPrimPaths(UsdPrim const& root) diff --git a/pxr/usdImaging/usdImagingGL/engine.h b/pxr/usdImaging/usdImagingGL/engine.h index 1ec895af5b..e90410f3cd 100644 --- a/pxr/usdImaging/usdImagingGL/engine.h +++ b/pxr/usdImaging/usdImagingGL/engine.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // /// \file usdImagingGL/engine.h @@ -333,6 +316,8 @@ class UsdImagingGLEngine /// of that gprim. For nested instancing, outHitInstancerPath points to /// the closest instancer. /// + /// \deprecated Please use the override of TestIntersection that takes + /// PickParams and returns an IntersectionResultVector instead! USDIMAGINGGL_API bool TestIntersection( const GfMatrix4d &viewMatrix, @@ -346,6 +331,53 @@ class UsdImagingGLEngine int *outHitInstanceIndex = NULL, HdInstancerContext *outInstancerContext = NULL); + // Pick result + struct IntersectionResult + { + GfVec3d hitPoint; + GfVec3d hitNormal; + SdfPath hitPrimPath; + SdfPath hitInstancerPath; + int hitInstanceIndex; + HdInstancerContext instancerContext; + }; + + typedef std::vector IntersectionResultVector; + + // Pick params + struct PickParams + { + TfToken resolveMode; + }; + + /// Perform picking by finding the intersection of objects in the scene with a renderered frustum. + /// Depending on the resolve mode it may find all objects intersecting the frustum or the closest + /// point of intersection within the frustum. + /// + /// If resolve mode is set to resolveDeep it uses Deep Selection to gather all paths within + /// the frustum even if obscured by other visible objects. + /// If resolve mode is set to resolveNearestToCenter it uses a PickRender and + /// a customized depth buffer to find all approximate points of intersection by rendering. + /// This is less accurate than implicit methods or rendering with GL_SELECT, but leverages any + /// data already cached in the renderer. + /// + /// Returns whether a hit occurred and if so, \p outResults will point to all the + /// gprims selected by the pick as determined by the resolve mode. + /// \p outHitPoint will contain the intersection point in world space + /// (i.e. \p projectionMatrix and \p viewMatrix factored back out of the result) + /// \p outHitNormal will contain the world space normal at that point. + /// \p hitPrimPath will point to the gprim selected by the pick. + /// \p hitInstancerPath will point to the point instancer (if applicable) of each gprim. + /// + USDIMAGINGGL_API + bool TestIntersection( + const PickParams& pickParams, + const GfMatrix4d& viewMatrix, + const GfMatrix4d& projectionMatrix, + const UsdPrim& root, + const UsdImagingGLRenderParams& params, + IntersectionResultVector* outResults); + /// Decodes a pick result given hydra prim ID/instance ID (like you'd get /// from an ID render). USDIMAGINGGL_API @@ -429,10 +461,14 @@ class UsdImagingGLEngine /// @} // --------------------------------------------------------------------- - /// \name Render Settings (Scene description driven) + /// \name Scene-defined Render Pass and Render Settings /// \note Support is WIP. /// @{ // --------------------------------------------------------------------- + + /// Set active render pass prim to use to drive rendering. + USDIMAGINGGL_API + void SetActiveRenderPassPrimPath(SdfPath const &); /// Set active render settings prim to use to drive rendering. USDIMAGINGGL_API @@ -629,6 +665,9 @@ class UsdImagingGLEngine USDIMAGINGGL_API void _SetActiveRenderSettingsPrimFromStageMetadata(UsdStageWeakPtr stage); + USDIMAGINGGL_API + void _SetSceneGlobalsCurrentFrame(UsdTimeCode const &time); + USDIMAGINGGL_API void _UpdateDomeLightCameraVisibility(); diff --git a/pxr/usdImaging/usdImagingGL/module.cpp b/pxr/usdImaging/usdImagingGL/module.cpp index e8e1d43aad..ac9c389211 100644 --- a/pxr/usdImaging/usdImagingGL/module.cpp +++ b/pxr/usdImaging/usdImagingGL/module.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/base/tf/pyModule.h" diff --git a/pxr/usdImaging/usdImagingGL/moduleDeps.cpp b/pxr/usdImaging/usdImagingGL/moduleDeps.cpp index 5b4fbb1f28..d5cb777e59 100644 --- a/pxr/usdImaging/usdImagingGL/moduleDeps.cpp +++ b/pxr/usdImaging/usdImagingGL/moduleDeps.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/pxr/usdImaging/usdImagingGL/pch.h b/pxr/usdImaging/usdImagingGL/pch.h index b9dfa7e416..c3eb9e0ade 100644 --- a/pxr/usdImaging/usdImagingGL/pch.h +++ b/pxr/usdImaging/usdImagingGL/pch.h @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // // WARNING: THIS FILE IS GENERATED. DO NOT EDIT. // @@ -31,6 +14,7 @@ #include #endif #if defined(ARCH_OS_LINUX) +#include #include #endif #if defined(ARCH_OS_WINDOWS) @@ -40,11 +24,10 @@ #include #include -#include -#include -#include #endif #include +#include +#include #include #include #include @@ -58,8 +41,10 @@ #include #include #include +#include #include #include +#include #include #include #include @@ -70,12 +55,16 @@ #include #include #include +#include +#include +#include #include #include #include #include #include #include +#include #include #include #include @@ -86,56 +75,8 @@ #include #include #include +#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #ifdef PXR_PYTHON_SUPPORT_ENABLED #include #include @@ -162,32 +103,9 @@ #undef toupper #endif #endif // PXR_PYTHON_SUPPORT_ENABLED -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include #include +#include #include #include #include @@ -196,7 +114,7 @@ #include #include #include -#include +#include #ifdef PXR_PYTHON_SUPPORT_ENABLED #include "pxr/base/tf/pySafePython.h" #endif // PXR_PYTHON_SUPPORT_ENABLED diff --git a/pxr/usdImaging/usdImagingGL/renderParams.cpp b/pxr/usdImaging/usdImagingGL/renderParams.cpp index 3af33c1214..0a45ed0fda 100644 --- a/pxr/usdImaging/usdImagingGL/renderParams.cpp +++ b/pxr/usdImaging/usdImagingGL/renderParams.cpp @@ -1,24 +1,7 @@ // // Copyright 2018 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImagingGL/renderParams.h" diff --git a/pxr/usdImaging/usdImagingGL/renderParams.h b/pxr/usdImaging/usdImagingGL/renderParams.h index d8ad4d0f65..48fac08f35 100644 --- a/pxr/usdImaging/usdImagingGL/renderParams.h +++ b/pxr/usdImaging/usdImagingGL/renderParams.h @@ -1,25 +1,8 @@ // // Copyright 2018 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // /// \file usdImagingGL/renderParams.h diff --git a/pxr/usdImaging/usdImagingGL/rendererSettings.h b/pxr/usdImaging/usdImagingGL/rendererSettings.h index e39bb64199..e9d66c2df1 100644 --- a/pxr/usdImaging/usdImagingGL/rendererSettings.h +++ b/pxr/usdImaging/usdImagingGL/rendererSettings.h @@ -1,25 +1,8 @@ // // Copyright 2018 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // /// \file usdImagingGL/renderSettings.h diff --git a/pxr/usdImaging/usdImagingGL/testenv/TestUsdImagingGLHdGpProcedurals.cpp b/pxr/usdImaging/usdImagingGL/testenv/TestUsdImagingGLHdGpProcedurals.cpp index a1dd20407b..53cb5c9bfb 100644 --- a/pxr/usdImaging/usdImagingGL/testenv/TestUsdImagingGLHdGpProcedurals.cpp +++ b/pxr/usdImaging/usdImagingGL/testenv/TestUsdImagingGLHdGpProcedurals.cpp @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/imaging/hdGp/generativeProceduralPlugin.h" #include "pxr/imaging/hdGp/generativeProceduralPluginRegistry.h" diff --git a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLBasicDrawing.cpp b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLBasicDrawing.cpp index 445ce8569e..8fb7b634fa 100644 --- a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLBasicDrawing.cpp +++ b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLBasicDrawing.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLBasicDrawing/basicDrawing/newInputShaderEncoding.glslfx b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLBasicDrawing/basicDrawing/newInputShaderEncoding.glslfx index 6ec4495bae..54e7227e88 100644 --- a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLBasicDrawing/basicDrawing/newInputShaderEncoding.glslfx +++ b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLBasicDrawing/basicDrawing/newInputShaderEncoding.glslfx @@ -1,5 +1,14 @@ -- glslfx version 0.1 + +// +// Copyright 2019 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// + -- configuration + { "parameters" : { "time": { diff --git a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLBasicDrawing/basicDrawing/shaders-surface.glslfx b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLBasicDrawing/basicDrawing/shaders-surface.glslfx index cec0a14257..9a4c2fcacc 100644 --- a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLBasicDrawing/basicDrawing/shaders-surface.glslfx +++ b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLBasicDrawing/basicDrawing/shaders-surface.glslfx @@ -1,5 +1,12 @@ -- glslfx version 0.1 +// +// Copyright 2019 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// + --- This is what an import might look like. --- #import $TOOLS/hd/shaders/fallbackSurface.glslfx diff --git a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLBasicDrawing/basicDrawing/textureChannels.glslfx b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLBasicDrawing/basicDrawing/textureChannels.glslfx index c1a70a6438..49a70507e9 100644 --- a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLBasicDrawing/basicDrawing/textureChannels.glslfx +++ b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLBasicDrawing/basicDrawing/textureChannels.glslfx @@ -1,5 +1,13 @@ -- glslfx version 0.1 +// +// Copyright 2020 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// + + -- configuration { "textures": { diff --git a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLBasicDrawingNonBindless/shader1.glslfx b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLBasicDrawingNonBindless/shader1.glslfx index 7d369b37c7..f686286819 100644 --- a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLBasicDrawingNonBindless/shader1.glslfx +++ b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLBasicDrawingNonBindless/shader1.glslfx @@ -3,25 +3,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // -- configuration diff --git a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLBasicDrawingNonBindless/shaders-surface.glslfx b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLBasicDrawingNonBindless/shaders-surface.glslfx index cec0a14257..9a4c2fcacc 100644 --- a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLBasicDrawingNonBindless/shaders-surface.glslfx +++ b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLBasicDrawingNonBindless/shaders-surface.glslfx @@ -1,5 +1,12 @@ -- glslfx version 0.1 +// +// Copyright 2019 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// + --- This is what an import might look like. --- #import $TOOLS/hd/shaders/fallbackSurface.glslfx diff --git a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLBatchedDrawing.cpp b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLBatchedDrawing.cpp index 1ba1b7b52f..e50e3e0cef 100644 --- a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLBatchedDrawing.cpp +++ b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLBatchedDrawing.cpp @@ -1,25 +1,8 @@ // // Copyright 2021 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImagingGL/unitTestGLDrawing.h" diff --git a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLDisplacement/baseline/testUsdImagingGLDisplacement_Adaptive_VeryHigh.png b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLDisplacement/baseline/testUsdImagingGLDisplacement_Adaptive_VeryHigh.png index 85fc549fdf..e307736369 100644 Binary files a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLDisplacement/baseline/testUsdImagingGLDisplacement_Adaptive_VeryHigh.png and b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLDisplacement/baseline/testUsdImagingGLDisplacement_Adaptive_VeryHigh.png differ diff --git a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLFaceVarying/baseline/testUsdImagingGLFaceVaryingLeftHanded_Adaptive_Low.png b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLFaceVarying/baseline/testUsdImagingGLFaceVaryingLeftHanded_Adaptive_Low.png index 1775bbf9c1..4b987852d4 100644 Binary files a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLFaceVarying/baseline/testUsdImagingGLFaceVaryingLeftHanded_Adaptive_Low.png and b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLFaceVarying/baseline/testUsdImagingGLFaceVaryingLeftHanded_Adaptive_Low.png differ diff --git a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLFaceVarying/baseline/testUsdImagingGLFaceVaryingLinearInterp_Adaptive_Low.png b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLFaceVarying/baseline/testUsdImagingGLFaceVaryingLinearInterp_Adaptive_Low.png index f1a9dda586..e6d7b60011 100644 Binary files a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLFaceVarying/baseline/testUsdImagingGLFaceVaryingLinearInterp_Adaptive_Low.png and b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLFaceVarying/baseline/testUsdImagingGLFaceVaryingLinearInterp_Adaptive_Low.png differ diff --git a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLFaceVarying/baseline/testUsdImagingGLFaceVaryingLinearInterp_Adaptive_Medium.png b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLFaceVarying/baseline/testUsdImagingGLFaceVaryingLinearInterp_Adaptive_Medium.png index a1dd35ff7b..3cbaeca685 100644 Binary files a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLFaceVarying/baseline/testUsdImagingGLFaceVaryingLinearInterp_Adaptive_Medium.png and b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLFaceVarying/baseline/testUsdImagingGLFaceVaryingLinearInterp_Adaptive_Medium.png differ diff --git a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLFaceVarying/baseline/testUsdImagingGLFaceVarying_Adaptive_Medium.png b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLFaceVarying/baseline/testUsdImagingGLFaceVarying_Adaptive_Medium.png index b270ee6f99..b291db01a8 100644 Binary files a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLFaceVarying/baseline/testUsdImagingGLFaceVarying_Adaptive_Medium.png and b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLFaceVarying/baseline/testUsdImagingGLFaceVarying_Adaptive_Medium.png differ diff --git a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLGeomSubsets/additive.glslfx b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLGeomSubsets/additive.glslfx index 858f4d6da1..51d42fe0bd 100644 --- a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLGeomSubsets/additive.glslfx +++ b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLGeomSubsets/additive.glslfx @@ -1,5 +1,12 @@ -- glslfx version 0.1 +// +// Copyright 2021 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// + -- configuration { "techniques": { diff --git a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLGeomSubsets/baseline/testUsdImagingGLGeomSubsets_Adaptive.png b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLGeomSubsets/baseline/testUsdImagingGLGeomSubsets_Adaptive.png index 6736d88e94..9057a52672 100644 Binary files a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLGeomSubsets/baseline/testUsdImagingGLGeomSubsets_Adaptive.png and b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLGeomSubsets/baseline/testUsdImagingGLGeomSubsets_Adaptive.png differ diff --git a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLGeomSubsets/default.glslfx b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLGeomSubsets/default.glslfx index 9076ba71d9..592f79e8a6 100644 --- a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLGeomSubsets/default.glslfx +++ b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLGeomSubsets/default.glslfx @@ -1,5 +1,12 @@ -- glslfx version 0.1 +// +// Copyright 2021 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// + -- configuration { "techniques": { diff --git a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLGeomSubsets/translucent.glslfx b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLGeomSubsets/translucent.glslfx index 4b330d4052..a2501a1ca2 100644 --- a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLGeomSubsets/translucent.glslfx +++ b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLGeomSubsets/translucent.glslfx @@ -1,5 +1,12 @@ -- glslfx version 0.1 +// +// Copyright 2021 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// + -- configuration { "techniques": { diff --git a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLHdGp.cpp b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLHdGp.cpp index 59ba224090..ad8ddbdd91 100644 --- a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLHdGp.cpp +++ b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLHdGp.cpp @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/base/gf/bbox3d.h" diff --git a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLHighlight.cpp b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLHighlight.cpp index 37ba9fee83..3b642b3766 100644 --- a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLHighlight.cpp +++ b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLHighlight.cpp @@ -1,25 +1,8 @@ // // Copyright 2021 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImagingGL/unitTestGLDrawing.h" diff --git a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLInstancing/shaders-surface.glslfx b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLInstancing/shaders-surface.glslfx index cec0a14257..9a4c2fcacc 100644 --- a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLInstancing/shaders-surface.glslfx +++ b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLInstancing/shaders-surface.glslfx @@ -1,5 +1,12 @@ -- glslfx version 0.1 +// +// Copyright 2019 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// + --- This is what an import might look like. --- #import $TOOLS/hd/shaders/fallbackSurface.glslfx diff --git a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLInstancing/volumeShaderParameter.glslfx b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLInstancing/volumeShaderParameter.glslfx index 1937abae83..9834477fb7 100644 --- a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLInstancing/volumeShaderParameter.glslfx +++ b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLInstancing/volumeShaderParameter.glslfx @@ -3,25 +3,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // -- configuration diff --git a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLInvalidInfoId/invalid_infoid.glslfx b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLInvalidInfoId/invalid_infoid.glslfx index 383cd87670..38f93f3ed3 100644 --- a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLInvalidInfoId/invalid_infoid.glslfx +++ b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLInvalidInfoId/invalid_infoid.glslfx @@ -3,25 +3,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // -- configuration diff --git a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLInvalidMaterial/buggyShader.glslfx b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLInvalidMaterial/buggyShader.glslfx index d6e52e8ca1..6d7b56df57 100644 --- a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLInvalidMaterial/buggyShader.glslfx +++ b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLInvalidMaterial/buggyShader.glslfx @@ -1,5 +1,12 @@ -- glslfx version 0.1 +// +// Copyright 2024 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// + -- configuration { "techniques": { diff --git a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLMaterialTag/shader1.glslfx b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLMaterialTag/shader1.glslfx index 49d43681c6..499d207591 100644 --- a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLMaterialTag/shader1.glslfx +++ b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLMaterialTag/shader1.glslfx @@ -3,25 +3,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // -- configuration diff --git a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLMaterialXBasic/baseline/basicMxYup.png b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLMaterialXBasic/baseline/basicMxYup.png index 215037df55..26cb389c02 100644 Binary files a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLMaterialXBasic/baseline/basicMxYup.png and b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLMaterialXBasic/baseline/basicMxYup.png differ diff --git a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLMaterialXBasic/baseline/basicMxZup.png b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLMaterialXBasic/baseline/basicMxZup.png index d6a8d51457..0cba5f8290 100644 Binary files a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLMaterialXBasic/baseline/basicMxZup.png and b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLMaterialXBasic/baseline/basicMxZup.png differ diff --git a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLMaterialXBasic/baseline/mxGlass.png b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLMaterialXBasic/baseline/mxGlass.png index 858cac0084..040dfa6e93 100644 Binary files a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLMaterialXBasic/baseline/mxGlass.png and b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLMaterialXBasic/baseline/mxGlass.png differ diff --git a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLMaterialXBasic/baseline/mxNormalMap.png b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLMaterialXBasic/baseline/mxNormalMap.png index ec9de9d684..f2d695551d 100644 Binary files a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLMaterialXBasic/baseline/mxNormalMap.png and b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLMaterialXBasic/baseline/mxNormalMap.png differ diff --git a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLMaterialXBasic/baseline/mxSimple.png b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLMaterialXBasic/baseline/mxSimple.png index c2f2685d20..8014931f03 100644 Binary files a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLMaterialXBasic/baseline/mxSimple.png and b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLMaterialXBasic/baseline/mxSimple.png differ diff --git a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLMaterialXBasic/baseline/standardSurface.png b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLMaterialXBasic/baseline/standardSurface.png index 74353a1adb..80feb42aa9 100644 Binary files a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLMaterialXBasic/baseline/standardSurface.png and b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLMaterialXBasic/baseline/standardSurface.png differ diff --git a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLMaterialXBasic/baseline/standardSurfaceMarble.png b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLMaterialXBasic/baseline/standardSurfaceMarble.png index 1f74864158..d4e4870852 100644 Binary files a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLMaterialXBasic/baseline/standardSurfaceMarble.png and b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLMaterialXBasic/baseline/standardSurfaceMarble.png differ diff --git a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLMaterialXBasic/baseline/usdPreviewSurface.png b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLMaterialXBasic/baseline/usdPreviewSurface.png index 55d1483da6..0c49c5021a 100644 Binary files a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLMaterialXBasic/baseline/usdPreviewSurface.png and b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLMaterialXBasic/baseline/usdPreviewSurface.png differ diff --git a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLMaterialXBasic/basicMxYup.usda b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLMaterialXBasic/basicMxYup.usda index c82f204e62..7c4554c2f1 100644 --- a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLMaterialXBasic/basicMxYup.usda +++ b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLMaterialXBasic/basicMxYup.usda @@ -25,6 +25,7 @@ def Xform "lights" { def DomeLight "DomeLight" { + float inputs:intensity = 2.0 asset inputs:texture:file = @./StinsonBeach.hdr@ } } diff --git a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLMaterialXBasic/basicMxZup.usda b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLMaterialXBasic/basicMxZup.usda index 0a8f8316ed..5ad7e471a4 100644 --- a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLMaterialXBasic/basicMxZup.usda +++ b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLMaterialXBasic/basicMxZup.usda @@ -25,6 +25,7 @@ def Xform "lights" { def DomeLight "DomeLight" { + float inputs:intensity = 2.0 asset inputs:texture:file = @./StinsonBeach.hdr@ float xformOp:rotateX:Zup = 90 uniform token[] xformOpOrder = ["xformOp:rotateX:Zup"] diff --git a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLMaterialXBasic/mxNormalMap.usda b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLMaterialXBasic/mxNormalMap.usda index 8a69fdfab7..b85f8df5f4 100644 --- a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLMaterialXBasic/mxNormalMap.usda +++ b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLMaterialXBasic/mxNormalMap.usda @@ -167,6 +167,7 @@ def Xform "NormalMapTest" { def DomeLight "DomeLight" { + float inputs:intensity = 2.0 asset inputs:texture:file = @./StinsonBeach.hdr@ } def DistantLight "DistantLight" diff --git a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLMaterialXTextured/baseline/mxCustomNodeDef.png b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLMaterialXTextured/baseline/mxCustomNodeDef.png index 5c4e4a0eb2..78d293c2bd 100644 Binary files a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLMaterialXTextured/baseline/mxCustomNodeDef.png and b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLMaterialXTextured/baseline/mxCustomNodeDef.png differ diff --git a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLPickAndHighlight.cpp b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLPickAndHighlight.cpp index fe6c930155..46f86a494a 100644 --- a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLPickAndHighlight.cpp +++ b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLPickAndHighlight.cpp @@ -1,25 +1,8 @@ // // Copyright 2021 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImagingGL/unitTestGLDrawing.h" @@ -38,6 +21,7 @@ #include "pxr/imaging/garch/glDebugWindow.h" #include "pxr/imaging/hd/mesh.h" #include "pxr/imaging/hd/renderIndex.h" +#include "pxr/imaging/hdx/pickTask.h" #include "pxr/usd/usd/stage.h" #include "pxr/usd/usdGeom/bboxCache.h" #include "pxr/usd/usdGeom/metrics.h" @@ -58,14 +42,7 @@ PXR_NAMESPACE_USING_DIRECTIVE using UsdImagingGLEngineSharedPtr = std::shared_ptr; -struct OutHit { - GfVec3d outHitPoint; - GfVec3d outHitNormal; - SdfPath outHitPrimPath; - SdfPath outHitInstancerPath; - int outHitInstanceIndex; -}; - +using OutHit = UsdImagingGLEngine::IntersectionResult; static bool _CompareOutHit(OutHit const & lhs, OutHit const & rhs) @@ -75,16 +52,54 @@ _CompareOutHit(OutHit const & lhs, OutHit const & rhs) false); double const epsilon = 1e-6; - return GfIsClose(lhs.outHitPoint[0], rhs.outHitPoint[0], epsilon) && - GfIsClose(lhs.outHitPoint[1], rhs.outHitPoint[1], epsilon) && - GfIsClose(lhs.outHitPoint[2], rhs.outHitPoint[2], epsilon) && - GfIsClose(lhs.outHitNormal[0], rhs.outHitNormal[0], epsilon) && - GfIsClose(lhs.outHitNormal[1], rhs.outHitNormal[1], epsilon) && - GfIsClose(lhs.outHitNormal[2], rhs.outHitNormal[2], epsilon) && - lhs.outHitPrimPath == rhs.outHitPrimPath && + bool compare = GfIsClose(lhs.hitPoint[0], rhs.hitPoint[0], epsilon) && + GfIsClose(lhs.hitPoint[1], rhs.hitPoint[1], epsilon) && + GfIsClose(lhs.hitPoint[2], rhs.hitPoint[2], epsilon) && + GfIsClose(lhs.hitNormal[0], rhs.hitNormal[0], epsilon) && + GfIsClose(lhs.hitNormal[1], rhs.hitNormal[1], epsilon) && + GfIsClose(lhs.hitNormal[2], rhs.hitNormal[2], epsilon) && + lhs.hitPrimPath == rhs.hitPrimPath && (skipInstancerDetails || - (lhs.outHitInstancerPath == rhs.outHitInstancerPath && - lhs.outHitInstanceIndex == rhs.outHitInstanceIndex)); + (lhs.hitInstancerPath == rhs.hitInstancerPath && + lhs.hitInstanceIndex == rhs.hitInstanceIndex)); + + return compare; +} + + +static bool +_CompareDeepSelectionResults( + UsdImagingGLEngine::IntersectionResultVector const& lhsVector, + UsdImagingGLEngine::IntersectionResultVector const& rhsVector) +{ + UsdImagingGLEngine::IntersectionResultVector lhs_sorted = lhsVector; + std::sort(lhs_sorted.begin(), lhs_sorted.end(), + [](const UsdImagingGLEngine::IntersectionResult &a, + const UsdImagingGLEngine::IntersectionResult &b) + { + return a.hitPrimPath < b.hitPrimPath; + }); + UsdImagingGLEngine::IntersectionResultVector rhs_sorted = rhsVector; + std::sort(rhs_sorted.begin(), rhs_sorted.end(), + [](const UsdImagingGLEngine::IntersectionResult &a, + const UsdImagingGLEngine::IntersectionResult &b) + { + return a.hitPrimPath < b.hitPrimPath; + }); + + if (lhs_sorted.size() != rhs_sorted.size()) { + return false; + } + + for (size_t i = 0; i < lhs_sorted.size(); ++i) { + // Note, hitInstancerId and hitInstanceIndex aren't guaranteed to be stable + // for native instances, so we don't check them here. + if (lhs_sorted[i].hitPrimPath != rhs_sorted[i].hitPrimPath) { + return false; + } + } + + return true; } class My_TestGLDrawing : public UsdImagingGL_UnitTestGLDrawing { @@ -108,6 +123,7 @@ class My_TestGLDrawing : public UsdImagingGL_UnitTestGLDrawing { void Draw(bool render=true); void Pick(GfVec2i const &startPos, GfVec2i const &endPos); void Pick(GfVec2i const &startPos, GfVec2i const &endPos, OutHit* out); + void DeepSelect(GfVec2i const& startPos, GfVec2i const& endPos, UsdImagingGLEngine::IntersectionResultVector& out); private: UsdStageRefPtr _stage; @@ -194,7 +210,8 @@ My_TestGLDrawing::DrawTest(bool offscreen) SdfPath("/Group/GI1/I1/Mesh1/Plane1"), _stage->GetPrimAtPath(SdfPath("/Group/GI1/I1")).GetPrototype(). GetPath().AppendPath(SdfPath("Mesh1")), - 2 } + 2, + {} } }, { TfToken("HdEmbreeRendererPlugin"), @@ -202,7 +219,65 @@ My_TestGLDrawing::DrawTest(bool offscreen) GfVec3d(0, 0, 0), SdfPath("/Instance/I1/Mesh1/Plane1"), SdfPath::EmptyPath(), - 0 } + 0, + {} } + } + }; + + const UsdImagingGLEngine::IntersectionResultVector expectedOutputVector = { + { + GfVec3d(0.0, 0.0, 0.0), + GfVec3d(0.0, 0.0, 0.0), + SdfPath("/Group/GI1/I1/Mesh1/Plane1"), + _stage->GetPrimAtPath(SdfPath("/Group/GI1/I1")).GetPrototype(). + GetPath().AppendPath(SdfPath("Mesh1")), + 2, + {} + }, + { + GfVec3d(0.0, 0.0, 0.0), + GfVec3d(0.0, 0.0, 0.0), + SdfPath("/Group/GI2/I1/Mesh1/Plane2"), + _stage->GetPrimAtPath(SdfPath("/Group/GI2/I1")).GetPrototype(). + GetPath().AppendPath(SdfPath("Mesh1")), + 3, + {} + }, + { + GfVec3d(0.0, 0.0, 0.0), + GfVec3d(0.0, 0.0, 0.0), + SdfPath("/Instance/I1/Mesh1/Plane1"), + _stage->GetPrimAtPath(SdfPath("/Instance/I1")).GetPrototype(). + GetPath().AppendPath(SdfPath("Mesh1")), + 0, + {} + }, + { + GfVec3d(0.0, 0.0, 0.0), + GfVec3d(0.0, 0.0, 0.0), + SdfPath("/Group/GI2/I1/Mesh1/Plane1"), + _stage->GetPrimAtPath(SdfPath("/Group/GI2/I1")).GetPrototype(). + GetPath().AppendPath(SdfPath("Mesh1")), + 3, + {} + }, + { + GfVec3d(0.0, 0.0, 0.0), + GfVec3d(0.0, 0.0, 0.0), + SdfPath("/Group/GI1/I1/Mesh1/Plane2"), + _stage->GetPrimAtPath(SdfPath("/Group/GI1/I1")).GetPrototype(). + GetPath().AppendPath(SdfPath("Mesh1")), + 2, + {} + }, + { + GfVec3d(0.0, 0.0, 0.0), + GfVec3d(0.0, 0.0, 0.0), + SdfPath("/Instance/I1/Mesh1/Plane2"), + _stage->GetPrimAtPath(SdfPath("/Instance/I1")).GetPrototype(). + GetPath().AppendPath(SdfPath("Mesh1")), + 0, + {} } }; @@ -225,6 +300,22 @@ My_TestGLDrawing::DrawTest(bool offscreen) } else { Draw(); } + + // currently only HdStorm supports deep selection + static const TfToken _stormRendererPluginName("HdStormRendererPlugin"); + if (_engine->GetCurrentRendererId() == _stormRendererPluginName) + { + // Test windowed deep selection + UsdImagingGLEngine::IntersectionResultVector testOutVector; + DeepSelect(GfVec2i(320, 130), GfVec2i(171, 131), testOutVector); + TF_VERIFY(_CompareDeepSelectionResults(testOutVector, expectedOutputVector)); + Draw(); + + // Single pick deep selection + testOutVector.clear(); + DeepSelect(GfVec2i(170, 130), GfVec2i(171, 131), testOutVector); + Draw(); + } } void @@ -344,6 +435,57 @@ My_TestGLDrawing::Pick(GfVec2i const &startPos, GfVec2i const &endPos) { Pick(startPos, endPos, nullptr); } +void +My_TestGLDrawing::DeepSelect(GfVec2i const& startPos, GfVec2i const& endPos, + UsdImagingGLEngine::IntersectionResultVector& outResults) +{ + GfFrustum frustum = _frustum; + float width = GetWidth(), height = GetHeight(); + + GfVec2d min(2 * startPos[0] / width - 1, 1 - 2 * startPos[1] / height); + GfVec2d max(2 * (endPos[0] + 1) / width - 1, 1 - 2 * (endPos[1] + 1) / height); + // scale window + GfVec2d origin = frustum.GetWindow().GetMin(); + GfVec2d scale = frustum.GetWindow().GetMax() - frustum.GetWindow().GetMin(); + min = origin + GfCompMult(scale, 0.5 * (GfVec2d(1.0, 1.0) + min)); + max = origin + GfCompMult(scale, 0.5 * (GfVec2d(1.0, 1.0) + max)); + + frustum.SetWindow(GfRange2d(min, max)); + + // XXX: For a timevarying test need to set timecode for frame param + UsdImagingGLRenderParams params; + params.enableIdRender = true; + + SdfPathVector selection; + + UsdImagingGLEngine::PickParams pickParams = { + HdxPickTokens->resolveDeep + }; + + if (_engine->TestIntersection( + pickParams, + _viewMatrix, + frustum.ComputeProjectionMatrix(), + _stage->GetPseudoRoot(), + params, + &outResults)) { + + for (size_t i = 0; i < outResults.size(); ++i) + { + UsdImagingGLEngine::IntersectionResult outHit = outResults[i]; + std::cout << "Hit " + << i << ": " + << outHit.hitPrimPath << ", " + << outHit.hitInstancerPath << ", " + << outHit.hitInstanceIndex << "\n"; + + selection.push_back(outHit.hitPrimPath); + } + } + + _engine->SetSelected(selection); +} + void My_TestGLDrawing::Pick(GfVec2i const &startPos, GfVec2i const &endPos, OutHit* out) @@ -365,36 +507,42 @@ My_TestGLDrawing::Pick(GfVec2i const &startPos, GfVec2i const &endPos, UsdImagingGLRenderParams params; params.enableIdRender = true; - OutHit outHit; + UsdImagingGLEngine::IntersectionResultVector outResults; SdfPathVector selection; + UsdImagingGLEngine::PickParams pickParams = { + HdxPickTokens->resolveNearestToCenter, + }; + if (_engine->TestIntersection( + pickParams, _viewMatrix, frustum.ComputeProjectionMatrix(), _stage->GetPseudoRoot(), params, - &outHit.outHitPoint, - &outHit.outHitNormal, - &outHit.outHitPrimPath, - &outHit.outHitInstancerPath, - &outHit.outHitInstanceIndex)) { - - std::cout << "Hit " - << outHit.outHitPoint << ", " - << outHit.outHitNormal << ", " - << outHit.outHitPrimPath << ", " - << outHit.outHitInstancerPath << ", " - << outHit.outHitInstanceIndex << "\n"; - - _engine->SetSelectionColor(GfVec4f(1, 1, 0, 1)); - selection.push_back(outHit.outHitPrimPath); - } + &outResults)) { - if (out) { - *out = outHit; - } else { - _engine->SetSelected(selection); + if (outResults.size() == 1) + { + std::cout << "Hit " + << outResults[0].hitPoint << ", " + << outResults[0].hitNormal << ", " + << outResults[0].hitPrimPath << ", " + << outResults[0].hitInstancerPath << ", " + << outResults[0].hitInstanceIndex << "\n"; + + _engine->SetSelectionColor(GfVec4f(1, 1, 0, 1)); + selection.push_back(outResults[0].hitPrimPath); + + if (out) { + *out = outResults[0]; + } + } + + if (!out) { + _engine->SetSelected(selection); + } } } diff --git a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLPickAndHighlight/baseline/testUsdImagingGLPickAndHighlight_005.png b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLPickAndHighlight/baseline/testUsdImagingGLPickAndHighlight_005.png new file mode 100644 index 0000000000..d1931d873d Binary files /dev/null and b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLPickAndHighlight/baseline/testUsdImagingGLPickAndHighlight_005.png differ diff --git a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLPickAndHighlight/baseline/testUsdImagingGLPickAndHighlight_006.png b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLPickAndHighlight/baseline/testUsdImagingGLPickAndHighlight_006.png new file mode 100644 index 0000000000..12524236f1 Binary files /dev/null and b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLPickAndHighlight/baseline/testUsdImagingGLPickAndHighlight_006.png differ diff --git a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLPopOut.cpp b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLPopOut.cpp index 9bb8c63d6b..1217ab3045 100644 --- a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLPopOut.cpp +++ b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLPopOut.cpp @@ -1,25 +1,8 @@ // // Copyright 2021 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/imaging/garch/glApi.h" diff --git a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLPrimvarRefinement/baseline/testUsdImagingGLPrimvarRefinement_Adaptive_Medium.png b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLPrimvarRefinement/baseline/testUsdImagingGLPrimvarRefinement_Adaptive_Medium.png index 062f738f76..d781511c54 100644 Binary files a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLPrimvarRefinement/baseline/testUsdImagingGLPrimvarRefinement_Adaptive_Medium.png and b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLPrimvarRefinement/baseline/testUsdImagingGLPrimvarRefinement_Adaptive_Medium.png differ diff --git a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLPurpose.cpp b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLPurpose.cpp index 455e60ab9f..41634e126b 100644 --- a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLPurpose.cpp +++ b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLPurpose.cpp @@ -1,25 +1,8 @@ // // Copyright 2021 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/base/gf/bbox3d.h" diff --git a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLResync.cpp b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLResync.cpp index 344618810f..171985df81 100644 --- a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLResync.cpp +++ b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLResync.cpp @@ -1,25 +1,8 @@ // // Copyright 2021 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/base/gf/bbox3d.h" diff --git a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLSdr/surface_texture.glslfx b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLSdr/surface_texture.glslfx index 4ca1605d75..aadc3eeb66 100644 --- a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLSdr/surface_texture.glslfx +++ b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLSdr/surface_texture.glslfx @@ -1,5 +1,12 @@ -- glslfx version 0.1 +// +// Copyright 2019 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// + -- configuration { "techniques" : { diff --git a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLShadeBadTexture/shaders-surface.glslfx b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLShadeBadTexture/shaders-surface.glslfx index 2c61fea9a7..8b32f09804 100644 --- a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLShadeBadTexture/shaders-surface.glslfx +++ b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLShadeBadTexture/shaders-surface.glslfx @@ -1,5 +1,12 @@ -- glslfx version 0.1 +// +// Copyright 2017 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// + -- configuration { "techniques": { diff --git a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLShadeBool/shadebool.glslfx b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLShadeBool/shadebool.glslfx index fd273bccd3..daff1b3de0 100644 --- a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLShadeBool/shadebool.glslfx +++ b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLShadeBool/shadebool.glslfx @@ -1,5 +1,12 @@ -- glslfx version 0.1 +// +// Copyright 2016 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// + -- configuration { "techniques" : { diff --git a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLSimpleVolumes/constantShader.glslfx b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLSimpleVolumes/constantShader.glslfx index 4ebc77b5e8..34008db9fa 100644 --- a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLSimpleVolumes/constantShader.glslfx +++ b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLSimpleVolumes/constantShader.glslfx @@ -3,25 +3,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // -- configuration diff --git a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLSimpleVolumes/ellipsoidalVolume.glslfx b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLSimpleVolumes/ellipsoidalVolume.glslfx index a611d92f22..01c1e7796c 100644 --- a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLSimpleVolumes/ellipsoidalVolume.glslfx +++ b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLSimpleVolumes/ellipsoidalVolume.glslfx @@ -3,25 +3,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // -- configuration diff --git a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLSurfaceShader.cpp b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLSurfaceShader.cpp index 5d5f1e71fe..669ec6dd6c 100644 --- a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLSurfaceShader.cpp +++ b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLSurfaceShader.cpp @@ -1,25 +1,8 @@ // // Copyright 2021 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImagingGL/unitTestGLDrawing.h" diff --git a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLSurfaceShader/shaders-surface.glslfx b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLSurfaceShader/shaders-surface.glslfx index 2c61fea9a7..47137e6063 100644 --- a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLSurfaceShader/shaders-surface.glslfx +++ b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLSurfaceShader/shaders-surface.glslfx @@ -1,5 +1,12 @@ -- glslfx version 0.1 +// +// Copyright 2016 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// + -- configuration { "techniques": { diff --git a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLTaskController.cpp b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLTaskController.cpp index 26b72236f9..34247994b6 100644 --- a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLTaskController.cpp +++ b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLTaskController.cpp @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdImagingGL/unitTestGLDrawing.h" diff --git a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLTetMesh/tetMesh.usda b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLTetMesh/tetMesh.usda index 00dbe9d1eb..3d497a6625 100644 --- a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLTetMesh/tetMesh.usda +++ b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLTetMesh/tetMesh.usda @@ -13,6 +13,10 @@ def Scope "RightHanded" { 0: [(0, 0, 0), (2, 0, 0), (0, 2, 0), (0, 0, 2), (0, 0, -2)], 10: [(0, 0, 3), (2, 0, 3), (0, 2, 3), (0, 0, 5), (0, 0, -3), (2, 0, -3), (0, 2, -3), (0, 0, -5)], } + int3[] surfaceFaceVertexIndices.timeSamples = { + 0: [(0, 1, 3), (0, 2, 4), (0, 3, 2), (0, 4, 1), (1, 2, 3), (2, 1, 4)], + 10: [(0, 1, 3), (0, 2, 1), (0, 3, 2), (1, 2, 3), (4, 5, 6), (4, 6, 7), (4, 7, 5), (6, 5, 7)], + } int4[] tetVertexIndices.timeSamples = { 0: [(0, 1, 2, 3), (0, 2, 1, 4)], 10: [(0, 1, 2, 3), (4, 6, 5, 7)], @@ -27,6 +31,7 @@ def Scope "RightHanded" { { color3f[] primvars:displayColor = [(0, 0, 1)] point3f[] points = [(0, 0, 0), (2, 0, 0), (0, 2, 0), (0, 0, 2), (0, 0, -2)] + int3[] surfaceFaceVertexIndices = [(0, 1, 3), (0, 2, 4), (0, 3, 2), (0, 4, 1), (1, 2, 3), (2, 1, 4)] int4[] tetVertexIndices = [(0, 1, 2, 3), (0, 2, 1, 4)] double3 xformOp:translate = (-2.5, 0, 0) @@ -66,6 +71,10 @@ def Scope "LeftHanded" 0: [(0, 0, 0), (-2, 0, 0), (0, 2, 0), (0, 0, 2), (0, 0, -2)], 10: [(0, 0, 3), (-2, 0, 3), (0, 2, 3), (0, 0, 5), (0, 0, -3), (-2, 0, -3), (0, 2, -3), (0, 0, -5)], } + int3[] surfaceFaceVertexIndices.timeSamples = { + 0: [(0, 1, 3), (0, 2, 4), (0, 3, 2), (0, 4, 1), (1, 2, 3), (2, 1, 4)], + 10: [(0, 1, 3), (0, 2, 1), (0, 3, 2), (1, 2, 3), (4, 5, 6), (4, 6, 7), (4, 7, 5), (6, 5, 7)], + } int4[] tetVertexIndices.timeSamples = { 0: [(0, 1, 2, 3), (0, 2, 1, 4)], 10: [(0, 1, 2, 3), (4, 6, 5, 7)], diff --git a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLTextureWrap/surface_shader.glslfx b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLTextureWrap/surface_shader.glslfx index 93e90d4979..db520a477b 100644 --- a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLTextureWrap/surface_shader.glslfx +++ b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLTextureWrap/surface_shader.glslfx @@ -1,5 +1,12 @@ -- glslfx version 0.1 +// +// Copyright 2018 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// + -- configuration { "techniques": { diff --git a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLUsdUdims/create_symlinks.py b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLUsdUdims/create_symlinks.py index 00b682212c..1f212d7dcf 100644 --- a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLUsdUdims/create_symlinks.py +++ b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLUsdUdims/create_symlinks.py @@ -2,25 +2,8 @@ # # Copyright 2021 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # Script to create the symlinks for the usdUdimsSymlinked.usda test case diff --git a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLVdbVolume/checkerboardShader.glslfx b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLVdbVolume/checkerboardShader.glslfx index 33a4a151b2..191a787b69 100644 --- a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLVdbVolume/checkerboardShader.glslfx +++ b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLVdbVolume/checkerboardShader.glslfx @@ -3,25 +3,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // -- configuration diff --git a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLVdbVolume/volumeShaderDensity.glslfx b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLVdbVolume/volumeShaderDensity.glslfx index 0c0c21c313..259687a42d 100644 --- a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLVdbVolume/volumeShaderDensity.glslfx +++ b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLVdbVolume/volumeShaderDensity.glslfx @@ -3,25 +3,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // -- configuration diff --git a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLVdbVolume/volumeShaderTwoFields.glslfx b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLVdbVolume/volumeShaderTwoFields.glslfx index 6b9040ae7d..983f5bd7e9 100644 --- a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLVdbVolume/volumeShaderTwoFields.glslfx +++ b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLVdbVolume/volumeShaderTwoFields.glslfx @@ -3,25 +3,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // -- configuration diff --git a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLVelocityMotion/baseline/testUsdImagingGLVelocityMotion_001.png b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLVelocityMotion/baseline/testUsdImagingGLVelocityMotion_001.png new file mode 100644 index 0000000000..275afcc2ba Binary files /dev/null and b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLVelocityMotion/baseline/testUsdImagingGLVelocityMotion_001.png differ diff --git a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLVelocityMotion/baseline/testUsdImagingGLVelocityMotion_004.png b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLVelocityMotion/baseline/testUsdImagingGLVelocityMotion_004.png new file mode 100644 index 0000000000..5369c65cc6 Binary files /dev/null and b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLVelocityMotion/baseline/testUsdImagingGLVelocityMotion_004.png differ diff --git a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLVelocityMotion/baseline/testUsdImagingGLVelocityMotion_2.5.png b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLVelocityMotion/baseline/testUsdImagingGLVelocityMotion_2.5.png new file mode 100644 index 0000000000..124eddb2f8 Binary files /dev/null and b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLVelocityMotion/baseline/testUsdImagingGLVelocityMotion_2.5.png differ diff --git a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLVelocityMotion/scene.usda b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLVelocityMotion/scene.usda new file mode 100644 index 0000000000..ac448cab47 --- /dev/null +++ b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLVelocityMotion/scene.usda @@ -0,0 +1,482 @@ +#usda 1.0 +( + startTimeCode = 0 + endTimeCode = 5 + framesPerSecond = 24 + upAxis = "Y" +) + +class "_Reference" +{ + float3[] extent = [(-0.5, -0.5, 0), (0.5, 0.5, 0.25)] + point3f[] points = [ + (0, 0, 0.25), + (0.5, 0.5, 0), + (-0.5, 0.5, 0), + (-0.5, -0.5, 0), + (0.5, -0.5, 0), + (0, 0, 0) + ] + int[] faceVertexCounts = [3, 3, 3, 3, 3, 3, 3, 3] + int[] faceVertexIndices = [ + 5,3,2, + 4,3,5, + 1,4,5, + 1,0,4, + 4,0,3, + 3,0,2, + 0,1,5, + 5,2,0 + ] + uniform token orientation = "leftHanded" + uniform token subdivisionScheme = "none" + color3f[] primvars:displayColor = [(0, 0, 1)] +} + + +class "_Pointer" +{ + float3[] extent = [(-0.5, 0, 0), (0.5, 0.5, 0.25)] + point3f[] points = [ + (0, 0, 0.25), + (0.5, 0.5, 0), + (-0.5, 0.5, 0), + (0, 0, 0) + ] + int[] faceVertexCounts = [3, 3, 3, 3] + int[] faceVertexIndices = [ + 3, 2, 1, + 0, 1, 2, + 1, 0, 3, + 2, 3, 0] + uniform token orientation = "leftHanded" + uniform token subdivisionScheme = "none" + color3f[] primvars:displayColor = [(0, 1, 1)] +} + + +def Xform "World" +{ + def Camera "main_cam" + { + float focalLength = 24 + vector3f xformOp:translate = (2.5, 2.5, 20) + uniform token[] xformOpOrder = ["xformOp:translate"] + } + + # def Xform "Prototypes" + # { + # token visibility = "invisible" + + # def Mesh "Reference" + # { + # float3[] extent = [(-0.5, -0.5, 0), (0.5, 0.5, 0.25)] + # point3f[] points = [ + # (0, 0, 0.25), + # (0.5, 0.5, 0), + # (-0.5, 0.5, 0), + # (-0.5, -0.5, 0), + # (0.5, -0.5, 0), + # (0, 0, 0) + # ] + # int[] faceVertexCounts = [3, 3, 3, 3, 3, 3, 3, 3] + # int[] faceVertexIndices = [ + # 5,3,2, + # 4,3,5, + # 1,4,5, + # 1,0,4, + # 4,0,3, + # 3,0,2, + # 0,1,5, + # 5,2,0 + # ] + # uniform token orientation = "leftHanded" + # uniform token subdivisionScheme = "none" + # color3f[] primvars:displayColor = [(0, 0, 1)] + # } + + # def Mesh "Pointer" + # { + # float3[] extent = [(-0.5, 0, 0), (0.5, 0.5, 0.25)] + # point3f[] points = [ + # (0, 0, 0.25), + # (0.5, 0.5, 0), + # (-0.5, 0.5, 0), + # (0, 0, 0) + # ] + # int[] faceVertexCounts = [3, 3, 3, 3] + # int[] faceVertexIndices = [ + # 3, 2, 1, + # 0, 1, 2, + # 1, 0, 3, + # 2, 3, 0] + # uniform token orientation = "leftHanded" + # uniform token subdivisionScheme = "none" + # color3f[] primvars:displayColor = [(0, 1, 1)] + # } + # } + + def Xform "OrientationsVelocity" + { + def PointInstancer "Reference" + { + point3f[] positions = [(0, 0, 0)] + quath[] orientations.timeSamples = { + 0: [(1, 0, 0, 0)], + 1: [(0.809, 0, 0, 0.588)], + 2: [(0.309, 0, 0, 0.951)], + 3: [(-0.309, 0, 0, 0.951)], + 4: [(-0.809, 0, 0, 0.588)], + 5: [(-1, 0, 0, 0)] + } + int[] protoIndices = [0] + rel prototypes = [] + + def Xform "Prototypes" + { + def Mesh "Reference" ( + inherits = + ) + { } + } + } + + def PointInstancer "Pointer" + { + point3f[] positions = [(0, 0, 0)] + quath[] orientations.timeSamples = { + 0: [(1, 0, 0, 0)], + 5: [(-1, 0, 0, 0)] + } + vector3f[] angularVelocities.timeSamples = { + 0: [(0, 0, 1728)], + 5: [(0, 0, 0)] + } + int[] protoIndices = [0] + rel prototypes = [] + + def Xform "Prototypes" + { + def Mesh "Pointer" ( + inherits = + ) + { } + } + } + + vector3f xformOp:translate = (2.5, 8, 0) + uniform token[] xformOpOrder = ["xformOp:translate"] + } + + def Xform "PointsAcceleration" + { + def Mesh "Reference" + { + float3[] extent = [(-0.5, -0.5, 0),(5.5, 0.5, 0.25)] + point3f[] points.timeSamples = { + 0.0: [(0.000, 0, 0), (0.000, 0, 0.25), (-0.5, 0.5, 0), (-0.5, -0.5, 0), (5.5, -0.5, 0), (5.5, 0.5, 0)], + 0.1: [(0.198, 0, 0), (0.198, 0, 0.25), (-0.5, 0.5, 0), (-0.5, -0.5, 0), (5.5, -0.5, 0), (5.5, 0.5, 0)], + 0.2: [(0.392, 0, 0), (0.392, 0, 0.25), (-0.5, 0.5, 0), (-0.5, -0.5, 0), (5.5, -0.5, 0), (5.5, 0.5, 0)], + 0.3: [(0.582, 0, 0), (0.582, 0, 0.25), (-0.5, 0.5, 0), (-0.5, -0.5, 0), (5.5, -0.5, 0), (5.5, 0.5, 0)], + 0.4: [(0.768, 0, 0), (0.768, 0, 0.25), (-0.5, 0.5, 0), (-0.5, -0.5, 0), (5.5, -0.5, 0), (5.5, 0.5, 0)], + 0.5: [(0.950, 0, 0), (0.950, 0, 0.25), (-0.5, 0.5, 0), (-0.5, -0.5, 0), (5.5, -0.5, 0), (5.5, 0.5, 0)], + 0.6: [(1.128, 0, 0), (1.128, 0, 0.25), (-0.5, 0.5, 0), (-0.5, -0.5, 0), (5.5, -0.5, 0), (5.5, 0.5, 0)], + 0.7: [(1.302, 0, 0), (1.302, 0, 0.25), (-0.5, 0.5, 0), (-0.5, -0.5, 0), (5.5, -0.5, 0), (5.5, 0.5, 0)], + 0.8: [(1.472, 0, 0), (1.472, 0, 0.25), (-0.5, 0.5, 0), (-0.5, -0.5, 0), (5.5, -0.5, 0), (5.5, 0.5, 0)], + 0.9: [(1.638, 0, 0), (1.638, 0, 0.25), (-0.5, 0.5, 0), (-0.5, -0.5, 0), (5.5, -0.5, 0), (5.5, 0.5, 0)], + 1.0: [(1.800, 0, 0), (1.800, 0, 0.25), (-0.5, 0.5, 0), (-0.5, -0.5, 0), (5.5, -0.5, 0), (5.5, 0.5, 0)], + 1.1: [(1.958, 0, 0), (1.958, 0, 0.25), (-0.5, 0.5, 0), (-0.5, -0.5, 0), (5.5, -0.5, 0), (5.5, 0.5, 0)], + 1.2: [(2.112, 0, 0), (2.112, 0, 0.25), (-0.5, 0.5, 0), (-0.5, -0.5, 0), (5.5, -0.5, 0), (5.5, 0.5, 0)], + 1.3: [(2.262, 0, 0), (2.262, 0, 0.25), (-0.5, 0.5, 0), (-0.5, -0.5, 0), (5.5, -0.5, 0), (5.5, 0.5, 0)], + 1.4: [(2.408, 0, 0), (2.408, 0, 0.25), (-0.5, 0.5, 0), (-0.5, -0.5, 0), (5.5, -0.5, 0), (5.5, 0.5, 0)], + 1.5: [(2.550, 0, 0), (2.550, 0, 0.25), (-0.5, 0.5, 0), (-0.5, -0.5, 0), (5.5, -0.5, 0), (5.5, 0.5, 0)], + 1.6: [(2.688, 0, 0), (2.688, 0, 0.25), (-0.5, 0.5, 0), (-0.5, -0.5, 0), (5.5, -0.5, 0), (5.5, 0.5, 0)], + 1.7: [(2.822, 0, 0), (2.822, 0, 0.25), (-0.5, 0.5, 0), (-0.5, -0.5, 0), (5.5, -0.5, 0), (5.5, 0.5, 0)], + 1.8: [(2.952, 0, 0), (2.952, 0, 0.25), (-0.5, 0.5, 0), (-0.5, -0.5, 0), (5.5, -0.5, 0), (5.5, 0.5, 0)], + 1.9: [(3.078, 0, 0), (3.078, 0, 0.25), (-0.5, 0.5, 0), (-0.5, -0.5, 0), (5.5, -0.5, 0), (5.5, 0.5, 0)], + 2.0: [(3.200, 0, 0), (3.200, 0, 0.25), (-0.5, 0.5, 0), (-0.5, -0.5, 0), (5.5, -0.5, 0), (5.5, 0.5, 0)], + 2.1: [(3.318, 0, 0), (3.318, 0, 0.25), (-0.5, 0.5, 0), (-0.5, -0.5, 0), (5.5, -0.5, 0), (5.5, 0.5, 0)], + 2.2: [(3.432, 0, 0), (3.432, 0, 0.25), (-0.5, 0.5, 0), (-0.5, -0.5, 0), (5.5, -0.5, 0), (5.5, 0.5, 0)], + 2.3: [(3.542, 0, 0), (3.542, 0, 0.25), (-0.5, 0.5, 0), (-0.5, -0.5, 0), (5.5, -0.5, 0), (5.5, 0.5, 0)], + 2.4: [(3.648, 0, 0), (3.648, 0, 0.25), (-0.5, 0.5, 0), (-0.5, -0.5, 0), (5.5, -0.5, 0), (5.5, 0.5, 0)], + 2.5: [(3.750, 0, 0), (3.750, 0, 0.25), (-0.5, 0.5, 0), (-0.5, -0.5, 0), (5.5, -0.5, 0), (5.5, 0.5, 0)], + 2.6: [(3.848, 0, 0), (3.848, 0, 0.25), (-0.5, 0.5, 0), (-0.5, -0.5, 0), (5.5, -0.5, 0), (5.5, 0.5, 0)], + 2.7: [(3.942, 0, 0), (3.942, 0, 0.25), (-0.5, 0.5, 0), (-0.5, -0.5, 0), (5.5, -0.5, 0), (5.5, 0.5, 0)], + 2.8: [(4.032, 0, 0), (4.032, 0, 0.25), (-0.5, 0.5, 0), (-0.5, -0.5, 0), (5.5, -0.5, 0), (5.5, 0.5, 0)], + 2.9: [(4.118, 0, 0), (4.118, 0, 0.25), (-0.5, 0.5, 0), (-0.5, -0.5, 0), (5.5, -0.5, 0), (5.5, 0.5, 0)], + 3.0: [(4.200, 0, 0), (4.200, 0, 0.25), (-0.5, 0.5, 0), (-0.5, -0.5, 0), (5.5, -0.5, 0), (5.5, 0.5, 0)], + 3.1: [(4.278, 0, 0), (4.278, 0, 0.25), (-0.5, 0.5, 0), (-0.5, -0.5, 0), (5.5, -0.5, 0), (5.5, 0.5, 0)], + 3.2: [(4.352, 0, 0), (4.352, 0, 0.25), (-0.5, 0.5, 0), (-0.5, -0.5, 0), (5.5, -0.5, 0), (5.5, 0.5, 0)], + 3.3: [(4.422, 0, 0), (4.422, 0, 0.25), (-0.5, 0.5, 0), (-0.5, -0.5, 0), (5.5, -0.5, 0), (5.5, 0.5, 0)], + 3.4: [(4.488, 0, 0), (4.488, 0, 0.25), (-0.5, 0.5, 0), (-0.5, -0.5, 0), (5.5, -0.5, 0), (5.5, 0.5, 0)], + 3.5: [(4.550, 0, 0), (4.550, 0, 0.25), (-0.5, 0.5, 0), (-0.5, -0.5, 0), (5.5, -0.5, 0), (5.5, 0.5, 0)], + 3.6: [(4.608, 0, 0), (4.608, 0, 0.25), (-0.5, 0.5, 0), (-0.5, -0.5, 0), (5.5, -0.5, 0), (5.5, 0.5, 0)], + 3.7: [(4.662, 0, 0), (4.662, 0, 0.25), (-0.5, 0.5, 0), (-0.5, -0.5, 0), (5.5, -0.5, 0), (5.5, 0.5, 0)], + 3.8: [(4.712, 0, 0), (4.712, 0, 0.25), (-0.5, 0.5, 0), (-0.5, -0.5, 0), (5.5, -0.5, 0), (5.5, 0.5, 0)], + 3.9: [(4.758, 0, 0), (4.758, 0, 0.25), (-0.5, 0.5, 0), (-0.5, -0.5, 0), (5.5, -0.5, 0), (5.5, 0.5, 0)], + 4.0: [(4.800, 0, 0), (4.800, 0, 0.25), (-0.5, 0.5, 0), (-0.5, -0.5, 0), (5.5, -0.5, 0), (5.5, 0.5, 0)], + 4.1: [(4.838, 0, 0), (4.838, 0, 0.25), (-0.5, 0.5, 0), (-0.5, -0.5, 0), (5.5, -0.5, 0), (5.5, 0.5, 0)], + 4.2: [(4.872, 0, 0), (4.872, 0, 0.25), (-0.5, 0.5, 0), (-0.5, -0.5, 0), (5.5, -0.5, 0), (5.5, 0.5, 0)], + 4.3: [(4.902, 0, 0), (4.902, 0, 0.25), (-0.5, 0.5, 0), (-0.5, -0.5, 0), (5.5, -0.5, 0), (5.5, 0.5, 0)], + 4.4: [(4.928, 0, 0), (4.928, 0, 0.25), (-0.5, 0.5, 0), (-0.5, -0.5, 0), (5.5, -0.5, 0), (5.5, 0.5, 0)], + 4.5: [(4.950, 0, 0), (4.950, 0, 0.25), (-0.5, 0.5, 0), (-0.5, -0.5, 0), (5.5, -0.5, 0), (5.5, 0.5, 0)], + 4.6: [(4.968, 0, 0), (4.968, 0, 0.25), (-0.5, 0.5, 0), (-0.5, -0.5, 0), (5.5, -0.5, 0), (5.5, 0.5, 0)], + 4.7: [(4.982, 0, 0), (4.982, 0, 0.25), (-0.5, 0.5, 0), (-0.5, -0.5, 0), (5.5, -0.5, 0), (5.5, 0.5, 0)], + 4.8: [(4.992, 0, 0), (4.992, 0, 0.25), (-0.5, 0.5, 0), (-0.5, -0.5, 0), (5.5, -0.5, 0), (5.5, 0.5, 0)], + 4.9: [(4.998, 0, 0), (4.998, 0, 0.25), (-0.5, 0.5, 0), (-0.5, -0.5, 0), (5.5, -0.5, 0), (5.5, 0.5, 0)], + 5.0: [(5.000, 0, 0), (5.000, 0, 0.25), (-0.5, 0.5, 0), (-0.5, -0.5, 0), (5.5, -0.5, 0), (5.5, 0.5, 0)] + } + int[] faceVertexCounts = [3, 3, 3, 3, 3, 3, 3, 3] + int[] faceVertexIndices = [ + 0, 4, 3, + 2, 0, 3, + 5, 0, 2, + 1, 5, 2, + 3, 4, 1, + 2, 3, 1, + 1, 0, 5, + 4, 0, 1 + ] + uniform token orientation = "leftHanded" + uniform token subdivisionScheme = "none" + color3f[] primvars:displayColor = [(0, 0, 1)] + } + + def Mesh "Pointer" + { + float3[] extent = [(0, -0.5, 0), (5.5, 0.5, 0.25)] + point3f[] points.timeSamples = { + 0: [(0, 0, 0), (0, 0, 0.25), (5.5, -0.5, 0), (5.5, 0.5, 0)], + 5: [(0, 0, 0), (0, 0, 0.25), (5.5, -0.5, 0), (5.5, 0.5, 0)], + } + vector3f[] velocities.timeSamples = { + 0: [(48, 0, 0), (48, 0, 0), (0, 0, 0), (0, 0, 0)], + 5: [(0, 0, 0), (0, 0, 0), (0, 0, 0), (0, 0, 0)] + } + vector3f[] accelerations.timeSamples = { + 0: [(-230.4, 0, 0), (-230.4, 0, 0), (0, 0, 0), (0, 0, 0)], + 5: [(0, 0, 0), (0, 0, 0), (0, 0, 0), (0, 0, 0)] + } + int[] faceVertexCounts = [3, 3, 3, 3] + int[] faceVertexIndices = [ + 0, 3, 2, + 3, 1, 2, + 3, 0, 1, + 2, 1, 0 + ] + uniform token orientation = "leftHanded" + uniform token subdivisionScheme = "none" + color3f[] primvars:displayColor = [(0, 1, 1)] + } + vector3f xformOp:translate = (0, 6, 0) + uniform token[] xformOpOrder = ["xformOp:translate"] + } + + def Xform "PositionsAcceleration" + { + + def PointInstancer "Reference" + { + float3[] extent = [(-0.5, -0.5, -0.5), (5.5, 0.5, 0.5)] + point3f[] positions.timeSamples = { + 0.0: [(0.000, 0, 0)], + 0.1: [(0.198, 0, 0)], + 0.2: [(0.392, 0, 0)], + 0.3: [(0.582, 0, 0)], + 0.4: [(0.768, 0, 0)], + 0.5: [(0.950, 0, 0)], + 0.6: [(1.128, 0, 0)], + 0.7: [(1.302, 0, 0)], + 0.8: [(1.472, 0, 0)], + 0.9: [(1.638, 0, 0)], + 1.0: [(1.800, 0, 0)], + 1.1: [(1.958, 0, 0)], + 1.2: [(2.112, 0, 0)], + 1.3: [(2.262, 0, 0)], + 1.4: [(2.408, 0, 0)], + 1.5: [(2.550, 0, 0)], + 1.6: [(2.688, 0, 0)], + 1.7: [(2.822, 0, 0)], + 1.8: [(2.952, 0, 0)], + 1.9: [(3.078, 0, 0)], + 2.0: [(3.200, 0, 0)], + 2.1: [(3.318, 0, 0)], + 2.2: [(3.432, 0, 0)], + 2.3: [(3.542, 0, 0)], + 2.4: [(3.648, 0, 0)], + 2.5: [(3.750, 0, 0)], + 2.6: [(3.848, 0, 0)], + 2.7: [(3.942, 0, 0)], + 2.8: [(4.032, 0, 0)], + 2.9: [(4.118, 0, 0)], + 3.0: [(4.200, 0, 0)], + 3.1: [(4.278, 0, 0)], + 3.2: [(4.352, 0, 0)], + 3.3: [(4.422, 0, 0)], + 3.4: [(4.488, 0, 0)], + 3.5: [(4.550, 0, 0)], + 3.6: [(4.608, 0, 0)], + 3.7: [(4.662, 0, 0)], + 3.8: [(4.712, 0, 0)], + 3.9: [(4.758, 0, 0)], + 4.0: [(4.800, 0, 0)], + 4.1: [(4.838, 0, 0)], + 4.2: [(4.872, 0, 0)], + 4.3: [(4.902, 0, 0)], + 4.4: [(4.928, 0, 0)], + 4.5: [(4.950, 0, 0)], + 4.6: [(4.968, 0, 0)], + 4.7: [(4.982, 0, 0)], + 4.8: [(4.992, 0, 0)], + 4.9: [(4.998, 0, 0)], + 5.0: [(5.000, 0, 0)] + } + int[] protoIndices = [0] + rel prototypes = [] + + def Xform "Prototypes" + { + def Mesh "Reference" ( + inherits = + ) + { } + } + } + + def PointInstancer "Pointer" + { + float3[] extent = [(-0.5, -0.5, -0.5), (5.5, 0.5, 0.5)] + point3f[] positions.timeSamples = { + 0: [(0, 0, 0)], + 5: [(0, 0, 0)] + } + vector3f[] velocities.timeSamples = { + 0: [(48, 0, 0)], + 5: [(0, 0, 0)] + } + vector3f[] accelerations.timeSamples = { + 0: [(-230.4, 0, 0)], + 5: [(0, 0, 0)] + } + int[] protoIndices = [0] + rel prototypes = [] + + def Xform "Prototypes" + { + def Mesh "Pointer" ( + inherits = + ) + { } + } + } + + vector3f xformOp:translate = (0, 4, 0) + uniform token[] xformOpOrder = ["xformOp:translate"] + } + + def Xform "PositionsVelocity" + { + def PointInstancer "Reference" + { + float3[] extent = [(-0.5, -0.5, -0.5), (5.5, 0.5, 0.5)] + point3f[] positions.timeSamples = { + 0: [(0, 0, 0)], + 1: [(1, 0, 0)], + 2: [(2, 0, 0)], + 3: [(3, 0, 0)], + 4: [(4, 0, 0)], + 5: [(5, 0, 0)] + } + int[] protoIndices = [0] + rel prototypes = [] + + def Xform "Prototypes" + { + def Mesh "Reference" ( + inherits = + ) + { } + } + } + + def PointInstancer "Pointer" + { + float3[] extent = [(-0.5, -0.5, -0.5), (5.5, 0.5, 0.5)] + point3f[] positions.timeSamples = { + 0: [(0, 0, 0)], + 5: [(0, 0, 0)] + } + vector3f[] velocities.timeSamples = { + 0: [(24, 0, 0)], + 5: [(0, 0, 0)] + } + int[] protoIndices = [0] + rel prototypes = [] + + def Xform "Prototypes" + { + def Mesh "Pointer" ( + inherits = + ) + { } + } + } + + vector3f xformOp:translate = (0, 2, 0) + uniform token[] xformOpOrder = ["xformOp:translate"] + } + + def Xform "PointsVelocity" + { + def Mesh "Reference" + { + float3[] extent = [(-0.5, -0.5, 0),(5.5, 0.5, 0.25)] + point3f[] points.timeSamples = { + 0: [(0, 0, 0), (0, 0, 0.25), (-0.5, 0.5, 0), (-0.5, -0.5, 0), (5.5, -0.5, 0), (5.5, 0.5, 0)], + 1: [(1, 0, 0), (1, 0, 0.25), (-0.5, 0.5, 0), (-0.5, -0.5, 0), (5.5, -0.5, 0), (5.5, 0.5, 0)], + 2: [(2, 0, 0), (2, 0, 0.25), (-0.5, 0.5, 0), (-0.5, -0.5, 0), (5.5, -0.5, 0), (5.5, 0.5, 0)], + 3: [(3, 0, 0), (3, 0, 0.25), (-0.5, 0.5, 0), (-0.5, -0.5, 0), (5.5, -0.5, 0), (5.5, 0.5, 0)], + 4: [(4, 0, 0), (4, 0, 0.25), (-0.5, 0.5, 0), (-0.5, -0.5, 0), (5.5, -0.5, 0), (5.5, 0.5, 0)], + 5: [(5, 0, 0), (5, 0, 0.25), (-0.5, 0.5, 0), (-0.5, -0.5, 0), (5.5, -0.5, 0), (5.5, 0.5, 0)], + } + int[] faceVertexCounts = [3, 3, 3, 3, 3, 3, 3, 3] + int[] faceVertexIndices = [ + 0, 4, 3, + 2, 0, 3, + 5, 0, 2, + 1, 5, 2, + 3, 4, 1, + 2, 3, 1, + 1, 0, 5, + 4, 0, 1 + ] + uniform token orientation = "leftHanded" + uniform token subdivisionScheme = "none" + color3f[] primvars:displayColor = [(0, 0, 1)] + } + + def Mesh "Pointer" + { + float3[] extent = [(0, -0.5, 0), (5.5, 0.5, 0.25)] + point3f[] points.timeSamples = { + 0: [(0, 0, 0), (0, 0, 0.25), (5.5, -0.5, 0), (5.5, 0.5, 0)], + 5: [(0, 0, 0), (0, 0, 0.25), (5.5, -0.5, 0), (5.5, 0.5, 0)], + } + vector3f[] velocities.timeSamples = { + 0: [(24, 0, 0), (24, 0, 0), (0, 0, 0), (0, 0, 0)], + 5: [(0, 0, 0), (0, 0, 0), (0, 0, 0), (0, 0, 0)] + } + int[] faceVertexCounts = [3, 3, 3, 3] + int[] faceVertexIndices = [ + 0, 3, 2, + 3, 1, 2, + 3, 0, 1, + 2, 1, 0 + ] + uniform token orientation = "leftHanded" + uniform token subdivisionScheme = "none" + color3f[] primvars:displayColor = [(0, 1, 1)] + } + } + +} diff --git a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLVolumeMaterial/checkerboardShader.glslfx b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLVolumeMaterial/checkerboardShader.glslfx index 97a5fca6c3..f75a1323fc 100644 --- a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLVolumeMaterial/checkerboardShader.glslfx +++ b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLVolumeMaterial/checkerboardShader.glslfx @@ -3,25 +3,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // -- configuration diff --git a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLVolumeMaterial/volumeShaderParameter.glslfx b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLVolumeMaterial/volumeShaderParameter.glslfx index a4a7ae99a0..452329f0b5 100644 --- a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLVolumeMaterial/volumeShaderParameter.glslfx +++ b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLVolumeMaterial/volumeShaderParameter.glslfx @@ -3,25 +3,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // -- configuration diff --git a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLVolumeMaterial/volumeShaderShape.glslfx b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLVolumeMaterial/volumeShaderShape.glslfx index 326d0eefc7..a74632fcc5 100644 --- a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLVolumeMaterial/volumeShaderShape.glslfx +++ b/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLVolumeMaterial/volumeShaderShape.glslfx @@ -3,25 +3,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // -- configuration diff --git a/pxr/usdImaging/usdImagingGL/unitTestGLDrawing.cpp b/pxr/usdImaging/usdImagingGL/unitTestGLDrawing.cpp index 1db86cffaa..f6d4a7c70a 100644 --- a/pxr/usdImaging/usdImagingGL/unitTestGLDrawing.cpp +++ b/pxr/usdImaging/usdImagingGL/unitTestGLDrawing.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/pxr/usdImaging/usdImagingGL/unitTestGLDrawing.h b/pxr/usdImaging/usdImagingGL/unitTestGLDrawing.h index f627e7c779..b45d80a19f 100644 --- a/pxr/usdImaging/usdImagingGL/unitTestGLDrawing.h +++ b/pxr/usdImaging/usdImagingGL/unitTestGLDrawing.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_GL_UNIT_TEST_GLDRAWING_H #define PXR_USD_IMAGING_USD_IMAGING_GL_UNIT_TEST_GLDRAWING_H diff --git a/pxr/usdImaging/usdImagingGL/version.h b/pxr/usdImaging/usdImagingGL/version.h index 87f82f7e01..9bdc954a6f 100644 --- a/pxr/usdImaging/usdImagingGL/version.h +++ b/pxr/usdImaging/usdImagingGL/version.h @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_IMAGING_GL_VERSION_H #define PXR_USD_IMAGING_USD_IMAGING_GL_VERSION_H @@ -33,7 +16,8 @@ // 6 -> 7: Added UsdImagingGLEngine::_GetTaskController() and _IsUsingLegacyImpl() // 7 -> 8: Added outHitNormal parameter to UsdImagingGLEngine::TestIntersection() // 8 -> 9: Removed the "HydraDisabled" renderer (i.e. LegacyEngine). -#define USDIMAGINGGL_API_VERSION 9 +// 9 -> 10: Added new UsdImagingGLEngine::TestIntersection() method with resolve mode +#define USDIMAGINGGL_API_VERSION 10 #endif // PXR_USD_IMAGING_USD_IMAGING_GL_VERSION_H diff --git a/pxr/usdImaging/usdImagingGL/wrapEngine.cpp b/pxr/usdImaging/usdImagingGL/wrapEngine.cpp index 6d84e236ab..e4ad0cb7a4 100644 --- a/pxr/usdImaging/usdImagingGL/wrapEngine.cpp +++ b/pxr/usdImaging/usdImagingGL/wrapEngine.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include #include @@ -147,6 +130,8 @@ void wrapEngine() return_value_policy< TfPySequenceToList >()) .def("GetRendererSetting", &UsdImagingGLEngine::GetRendererSetting) .def("SetRendererSetting", &UsdImagingGLEngine::SetRendererSetting) + .def("SetActiveRenderPassPrimPath", + &UsdImagingGLEngine::SetActiveRenderPassPrimPath) .def("SetActiveRenderSettingsPrimPath", &UsdImagingGLEngine::SetActiveRenderSettingsPrimPath) .def("GetAvailableRenderSettingsPrimPaths", @@ -191,6 +176,8 @@ void wrapEngine() .def_readwrite("driver", &Parameters::driver) .def_readwrite("rendererPluginId", &Parameters::rendererPluginId) .def_readwrite("gpuEnabled", &Parameters::gpuEnabled) + .def_readwrite("displayUnloadedPrimsWithBounds", + &Parameters::displayUnloadedPrimsWithBounds) .def_readwrite("allowAsynchronousSceneProcessing", &Parameters::allowAsynchronousSceneProcessing) diff --git a/pxr/usdImaging/usdImagingGL/wrapRenderParams.cpp b/pxr/usdImaging/usdImagingGL/wrapRenderParams.cpp index daa28193e2..54b3cacdd9 100644 --- a/pxr/usdImaging/usdImagingGL/wrapRenderParams.cpp +++ b/pxr/usdImaging/usdImagingGL/wrapRenderParams.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include #include diff --git a/pxr/usdImaging/usdImagingGL/wrapRendererCommands.cpp b/pxr/usdImaging/usdImagingGL/wrapRendererCommands.cpp index 8fdc54e520..0c64914178 100644 --- a/pxr/usdImaging/usdImagingGL/wrapRendererCommands.cpp +++ b/pxr/usdImaging/usdImagingGL/wrapRendererCommands.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include #include diff --git a/pxr/usdImaging/usdImagingGL/wrapRendererSettings.cpp b/pxr/usdImaging/usdImagingGL/wrapRendererSettings.cpp index 0bdc2083e8..ab46e91c05 100644 --- a/pxr/usdImaging/usdImagingGL/wrapRendererSettings.cpp +++ b/pxr/usdImaging/usdImagingGL/wrapRendererSettings.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include #include diff --git a/pxr/usdImaging/usdProcImaging/api.h b/pxr/usdImaging/usdProcImaging/api.h index ff9e80b016..d12c8761d1 100644 --- a/pxr/usdImaging/usdProcImaging/api.h +++ b/pxr/usdImaging/usdProcImaging/api.h @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_PROC_IMAGING_API_H #define PXR_USD_IMAGING_USD_PROC_IMAGING_API_H diff --git a/pxr/usdImaging/usdProcImaging/generativeProceduralAdapter.cpp b/pxr/usdImaging/usdProcImaging/generativeProceduralAdapter.cpp index 42647530ef..08a0bb2917 100644 --- a/pxr/usdImaging/usdProcImaging/generativeProceduralAdapter.cpp +++ b/pxr/usdImaging/usdProcImaging/generativeProceduralAdapter.cpp @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdProcImaging/generativeProceduralAdapter.h" #include "pxr/usdImaging/usdImaging/tokens.h" @@ -35,6 +18,8 @@ #include "pxr/imaging/hd/primvarsSchema.h" #include "pxr/imaging/hd/primvarSchema.h" +#include "pxr/usd/usd/prim.h" + #include "pxr/base/tf/type.h" @@ -129,8 +114,8 @@ UsdProcImagingGenerativeProceduralAdapter::Populate( { const SdfPath cachePath = ResolveCachePath( prim.GetPath(), instancerContext); - UsdPrim proxyPrim - = prim.GetStage()->GetPrimAtPath(cachePath.GetAbsoluteRootOrPrimPath()); + UsdPrim proxyPrim = _GetPrim(ResolveProxyPrimPath( + cachePath, instancerContext)); index->InsertRprim( _GetHydraPrimType(prim), cachePath, proxyPrim, diff --git a/pxr/usdImaging/usdProcImaging/generativeProceduralAdapter.h b/pxr/usdImaging/usdProcImaging/generativeProceduralAdapter.h index 4745ac2dce..b050a13f5f 100644 --- a/pxr/usdImaging/usdProcImaging/generativeProceduralAdapter.h +++ b/pxr/usdImaging/usdProcImaging/generativeProceduralAdapter.h @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_PROC_IMAGING_GENERATIVE_PROCEDURAL_ADAPTER_H #define PXR_USD_IMAGING_USD_PROC_IMAGING_GENERATIVE_PROCEDURAL_ADAPTER_H diff --git a/pxr/usdImaging/usdProcImaging/pch.h b/pxr/usdImaging/usdProcImaging/pch.h index 32358e284a..ae10fe25a5 100644 --- a/pxr/usdImaging/usdProcImaging/pch.h +++ b/pxr/usdImaging/usdProcImaging/pch.h @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // // WARNING: THIS FILE IS GENERATED. DO NOT EDIT. // @@ -31,6 +14,7 @@ #include #endif #if defined(ARCH_OS_LINUX) +#include #include #endif #if defined(ARCH_OS_WINDOWS) @@ -38,9 +22,11 @@ #define WIN32_LEAN_AND_MEAN #endif - +#include +#include #endif #include +#include #include #include #include @@ -57,7 +43,6 @@ #include #include #include -#include #include #include #include @@ -69,6 +54,7 @@ #include #include #include +#include #include #include #include @@ -78,59 +64,15 @@ #include #include #include +#include #include #include #include #include #include #include +#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #ifdef PXR_PYTHON_SUPPORT_ENABLED #include #include @@ -144,24 +86,7 @@ #undef toupper #endif #endif // PXR_PYTHON_SUPPORT_ENABLED -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include #include #include #include @@ -172,6 +97,7 @@ #include #include #include +#include #ifdef PXR_PYTHON_SUPPORT_ENABLED #include "pxr/base/tf/pySafePython.h" #endif // PXR_PYTHON_SUPPORT_ENABLED diff --git a/pxr/usdImaging/usdRiPxrImaging/CMakeLists.txt b/pxr/usdImaging/usdRiPxrImaging/CMakeLists.txt index e4046f5444..16478b37aa 100644 --- a/pxr/usdImaging/usdRiPxrImaging/CMakeLists.txt +++ b/pxr/usdImaging/usdRiPxrImaging/CMakeLists.txt @@ -25,6 +25,7 @@ pxr_library(usdRiPxrImaging ${TBB_INCLUDE_DIRS} PUBLIC_CLASSES + pxrCameraAPIAdapter pxrDisplayFilterAdapter pxrIntegratorAdapter pxrSampleFilterAdapter diff --git a/pxr/usdImaging/usdRiPxrImaging/api.h b/pxr/usdImaging/usdRiPxrImaging/api.h index 8c623a8e62..47df33c07d 100644 --- a/pxr/usdImaging/usdRiPxrImaging/api.h +++ b/pxr/usdImaging/usdRiPxrImaging/api.h @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_RI_PXR_IMAGING_API_H #define PXR_USD_IMAGING_USD_RI_PXR_IMAGING_API_H diff --git a/pxr/usdImaging/usdRiPxrImaging/dataSourcePxrRenderTerminalPrims.h b/pxr/usdImaging/usdRiPxrImaging/dataSourcePxrRenderTerminalPrims.h index a81713bc37..417cb459ca 100644 --- a/pxr/usdImaging/usdRiPxrImaging/dataSourcePxrRenderTerminalPrims.h +++ b/pxr/usdImaging/usdRiPxrImaging/dataSourcePxrRenderTerminalPrims.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_RI_PXR_IMAGING_DATA_SOURCE_RENDER_TERMINAL_PRIMS_H diff --git a/pxr/usdImaging/usdRiPxrImaging/pch.h b/pxr/usdImaging/usdRiPxrImaging/pch.h index 6ad2d403bb..ae10fe25a5 100644 --- a/pxr/usdImaging/usdRiPxrImaging/pch.h +++ b/pxr/usdImaging/usdRiPxrImaging/pch.h @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // // WARNING: THIS FILE IS GENERATED. DO NOT EDIT. // @@ -31,6 +14,7 @@ #include #endif #if defined(ARCH_OS_LINUX) +#include #include #endif #if defined(ARCH_OS_WINDOWS) @@ -38,12 +22,12 @@ #define WIN32_LEAN_AND_MEAN #endif +#include #include -#include -#include -#include #endif #include +#include +#include #include #include #include @@ -69,6 +53,9 @@ #include #include #include +#include +#include +#include #include #include #include @@ -77,62 +64,15 @@ #include #include #include +#include #include #include #include #include #include #include +#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #ifdef PXR_PYTHON_SUPPORT_ENABLED #include #include @@ -146,31 +86,9 @@ #undef toupper #endif #endif // PXR_PYTHON_SUPPORT_ENABLED -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include #include +#include #include #include #include @@ -179,7 +97,7 @@ #include #include #include -#include +#include #ifdef PXR_PYTHON_SUPPORT_ENABLED #include "pxr/base/tf/pySafePython.h" #endif // PXR_PYTHON_SUPPORT_ENABLED diff --git a/pxr/usdImaging/usdRiPxrImaging/plugInfo.json b/pxr/usdImaging/usdRiPxrImaging/plugInfo.json index 49ebc43448..fa0cb5d88f 100644 --- a/pxr/usdImaging/usdRiPxrImaging/plugInfo.json +++ b/pxr/usdImaging/usdRiPxrImaging/plugInfo.json @@ -26,6 +26,13 @@ "isInternal": true, "primTypeName": "PxrSampleFilterPluginBase", "includeDerivedPrimTypes" : true + }, + "UsdRiPxrImagingCameraAPIAdapter": { + "bases": [ + "UsdImagingAPISchemaAdapter" + ], + "isInternal": true, + "apiSchemaName": "PxrCameraAPI" } } }, diff --git a/pxr/usdImaging/usdRiPxrImaging/pxrCameraAPIAdapter.cpp b/pxr/usdImaging/usdRiPxrImaging/pxrCameraAPIAdapter.cpp new file mode 100644 index 0000000000..f942944210 --- /dev/null +++ b/pxr/usdImaging/usdRiPxrImaging/pxrCameraAPIAdapter.cpp @@ -0,0 +1,154 @@ +// +// Copyright 2024 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// + +#include "pxr/usdImaging/usdRiPxrImaging/pxrCameraAPIAdapter.h" + +#include "pxr/usdImaging/usdImaging/dataSourceMapped.h" + +#include "pxr/imaging/hd/cameraSchema.h" +#include "pxr/imaging/hd/retainedDataSource.h" + +#include "pxr/usd/usd/primDefinition.h" +#include "pxr/usd/usd/schemaRegistry.h" + +PXR_NAMESPACE_OPEN_SCOPE + +namespace +{ + +static const char * const _appliedSchemaName = "PxrCameraAPI"; + +std::pair +_SplitNamespace(const TfToken &name) +{ + static const char namespaceDelimiter = + SdfPathTokens->namespaceDelimiter.GetText()[0]; + + const std::string &str = name.GetString(); + const size_t i = str.find(namespaceDelimiter); + if (i == std::string::npos) { + return { TfToken(), TfToken() }; + } + + return { TfToken(str.substr(0, i)), + TfToken(str.substr(i + 1)) }; +} + +HdSampledDataSourceHandle +_DataSourceAuthoredAttributeNew( + const UsdAttribute &usdAttr, + const UsdImagingDataSourceStageGlobals &stageGlobals, + const SdfPath &sceneIndexPath, + const HdDataSourceLocator &timeVaryingFlagLocator) +{ + UsdAttributeQuery query(usdAttr); + if (!query.HasAuthoredValue()) { + return nullptr; + } + return UsdImagingDataSourceAttributeNew( + query, stageGlobals, sceneIndexPath, timeVaryingFlagLocator); +} + +// +// This method or a generalization of this method might be useful for other +// adapters. Consider moving it to a more central place such as UsdImaging. +// +std::vector +_GetNamespacedAttributeMappingsForAppliedSchema( + const TfToken &appliedSchemaName) +{ + std::vector result; + + const UsdPrimDefinition * const primDef = + UsdSchemaRegistry::GetInstance().FindAppliedAPIPrimDefinition( + appliedSchemaName); + if (!primDef) { + TF_CODING_ERROR( + "Could not find definition for applied schema '%s'.", + appliedSchemaName.GetText()); + return result; + } + + for (const TfToken &usdName : primDef->GetPropertyNames()) { + const std::pair namespaceAndName = + _SplitNamespace(usdName); + if (namespaceAndName.second.IsEmpty()) { + TF_CODING_ERROR( + "Expected all attributes on applied schema " + "'%s' to be namespaced but attribute '%s' " + "schema has no namespace.", + appliedSchemaName.GetText(), + usdName.GetText()); + continue; + } + + result.push_back( + { usdName, + HdDataSourceLocator(namespaceAndName.first, + namespaceAndName.second), + _DataSourceAuthoredAttributeNew}); + } + + return result; +} + +const UsdImagingDataSourceMapped::AttributeMappings & +_GetMappings() { + static const UsdImagingDataSourceMapped::AttributeMappings result( + _GetNamespacedAttributeMappingsForAppliedSchema( + TfToken(_appliedSchemaName)), + HdCameraSchema::GetNamespacedPropertiesLocator()); + return result; +} + +} + +TF_REGISTRY_FUNCTION(TfType) +{ + using Adapter = UsdRiPxrImagingCameraAPIAdapter; + TfType t = TfType::Define>(); + t.SetFactory>(); +} + +HdContainerDataSourceHandle +UsdRiPxrImagingCameraAPIAdapter::GetImagingSubprimData( + UsdPrim const& prim, + TfToken const& subprim, + TfToken const &appliedInstanceName, + const UsdImagingDataSourceStageGlobals &stageGlobals) +{ + if (!subprim.IsEmpty() || !appliedInstanceName.IsEmpty()) { + return nullptr; + } + + return + HdRetainedContainerDataSource::New( + HdCameraSchema::GetSchemaToken(), + HdCameraSchema::Builder() + .SetNamespacedProperties( + UsdImagingDataSourceMapped::New( + prim, prim.GetPath(), _GetMappings(), stageGlobals)) + .Build()); +} + +HdDataSourceLocatorSet +UsdRiPxrImagingCameraAPIAdapter::InvalidateImagingSubprim( + UsdPrim const& prim, + TfToken const& subprim, + TfToken const &appliedInstanceName, + TfTokenVector const& properties, + UsdImagingPropertyInvalidationType invalidationType) +{ + if (!subprim.IsEmpty() || !appliedInstanceName.IsEmpty()) { + return HdDataSourceLocatorSet(); + } + + return UsdImagingDataSourceMapped::Invalidate( + properties, _GetMappings()); +} + +PXR_NAMESPACE_CLOSE_SCOPE diff --git a/pxr/usdImaging/usdRiPxrImaging/pxrCameraAPIAdapter.h b/pxr/usdImaging/usdRiPxrImaging/pxrCameraAPIAdapter.h new file mode 100644 index 0000000000..f275ffb00d --- /dev/null +++ b/pxr/usdImaging/usdRiPxrImaging/pxrCameraAPIAdapter.h @@ -0,0 +1,49 @@ +// +// Copyright 2024 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// +#ifndef PXR_USD_IMAGING_USD_RI_PXR_IMAGING_PXR_CAMERA_API_ADAPTER_H +#define PXR_USD_IMAGING_USD_RI_PXR_IMAGING_PXR_CAMERA_API_ADAPTER_H + +/// \file + +#include "pxr/pxr.h" +#include "pxr/usdImaging/usdRiPxrImaging/api.h" +#include "pxr/usdImaging/usdImaging/apiSchemaAdapter.h" + +PXR_NAMESPACE_OPEN_SCOPE + +/// \class UsdRiPxrImagingCameraAPIAdapter +/// +/// Scene index support for PxrCameraAPI applied USD schema. +/// +/// The attributes of the schema will be available under +/// HdCameraSchema::GetNamespacedProperties(). +/// +class UsdRiPxrImagingCameraAPIAdapter : public UsdImagingAPISchemaAdapter +{ +public: + + using BaseAdapter = UsdImagingAPISchemaAdapter; + + USDRIPXRIMAGING_API + HdContainerDataSourceHandle GetImagingSubprimData( + UsdPrim const& prim, + TfToken const& subprim, + TfToken const &appliedInstanceName, + const UsdImagingDataSourceStageGlobals &stageGlobals) override; + + USDRIPXRIMAGING_API + HdDataSourceLocatorSet InvalidateImagingSubprim( + UsdPrim const& prim, + TfToken const& subprim, + TfToken const &appliedInstanceName, + TfTokenVector const& properties, + UsdImagingPropertyInvalidationType invalidationType) override; +}; + +PXR_NAMESPACE_CLOSE_SCOPE + +#endif diff --git a/pxr/usdImaging/usdRiPxrImaging/pxrDisplayFilterAdapter.cpp b/pxr/usdImaging/usdRiPxrImaging/pxrDisplayFilterAdapter.cpp index e45cebfbc5..437f63dc30 100644 --- a/pxr/usdImaging/usdRiPxrImaging/pxrDisplayFilterAdapter.cpp +++ b/pxr/usdImaging/usdRiPxrImaging/pxrDisplayFilterAdapter.cpp @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdRiPxrImaging/pxrDisplayFilterAdapter.h" #include "pxr/usdImaging/usdRiPxrImaging/pxrRenderTerminalHelper.h" diff --git a/pxr/usdImaging/usdRiPxrImaging/pxrDisplayFilterAdapter.h b/pxr/usdImaging/usdRiPxrImaging/pxrDisplayFilterAdapter.h index 2e39a22a7a..461cb89e78 100644 --- a/pxr/usdImaging/usdRiPxrImaging/pxrDisplayFilterAdapter.h +++ b/pxr/usdImaging/usdRiPxrImaging/pxrDisplayFilterAdapter.h @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_RI_PXR_IMAGING_PXR_DISPLAY_FILTER_ADAPTER_H #define PXR_USD_IMAGING_USD_RI_PXR_IMAGING_PXR_DISPLAY_FILTER_ADAPTER_H diff --git a/pxr/usdImaging/usdRiPxrImaging/pxrIntegratorAdapter.cpp b/pxr/usdImaging/usdRiPxrImaging/pxrIntegratorAdapter.cpp index bb7fe3edef..ff30fa09d6 100644 --- a/pxr/usdImaging/usdRiPxrImaging/pxrIntegratorAdapter.cpp +++ b/pxr/usdImaging/usdRiPxrImaging/pxrIntegratorAdapter.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdRiPxrImaging/pxrIntegratorAdapter.h" #include "pxr/usdImaging/usdRiPxrImaging/pxrRenderTerminalHelper.h" diff --git a/pxr/usdImaging/usdRiPxrImaging/pxrIntegratorAdapter.h b/pxr/usdImaging/usdRiPxrImaging/pxrIntegratorAdapter.h index 41134ba302..8b13e5ac9a 100644 --- a/pxr/usdImaging/usdRiPxrImaging/pxrIntegratorAdapter.h +++ b/pxr/usdImaging/usdRiPxrImaging/pxrIntegratorAdapter.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_RI_PXR_IMAGING_PXR_INTEGRATOR_ADAPTER_H #define PXR_USD_IMAGING_USD_RI_PXR_IMAGING_PXR_INTEGRATOR_ADAPTER_H diff --git a/pxr/usdImaging/usdRiPxrImaging/pxrRenderTerminalHelper.cpp b/pxr/usdImaging/usdRiPxrImaging/pxrRenderTerminalHelper.cpp index 1d22b79527..37953a0c53 100644 --- a/pxr/usdImaging/usdRiPxrImaging/pxrRenderTerminalHelper.cpp +++ b/pxr/usdImaging/usdRiPxrImaging/pxrRenderTerminalHelper.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdRiPxrImaging/pxrRenderTerminalHelper.h" #include "pxr/usd/usd/attribute.h" diff --git a/pxr/usdImaging/usdRiPxrImaging/pxrRenderTerminalHelper.h b/pxr/usdImaging/usdRiPxrImaging/pxrRenderTerminalHelper.h index 7713977ba0..44034324d8 100644 --- a/pxr/usdImaging/usdRiPxrImaging/pxrRenderTerminalHelper.h +++ b/pxr/usdImaging/usdRiPxrImaging/pxrRenderTerminalHelper.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_RI_PXR_IMAGING_PXR_RENDER_TERMINAL_HELPER_H #define PXR_USD_IMAGING_USD_RI_PXR_IMAGING_PXR_RENDER_TERMINAL_HELPER_H diff --git a/pxr/usdImaging/usdRiPxrImaging/pxrSampleFilterAdapter.cpp b/pxr/usdImaging/usdRiPxrImaging/pxrSampleFilterAdapter.cpp index 695b30457e..934ca5ac64 100644 --- a/pxr/usdImaging/usdRiPxrImaging/pxrSampleFilterAdapter.cpp +++ b/pxr/usdImaging/usdRiPxrImaging/pxrSampleFilterAdapter.cpp @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdRiPxrImaging/pxrSampleFilterAdapter.h" #include "pxr/usdImaging/usdRiPxrImaging/pxrRenderTerminalHelper.h" diff --git a/pxr/usdImaging/usdRiPxrImaging/pxrSampleFilterAdapter.h b/pxr/usdImaging/usdRiPxrImaging/pxrSampleFilterAdapter.h index 84922c595e..3d7877156f 100644 --- a/pxr/usdImaging/usdRiPxrImaging/pxrSampleFilterAdapter.h +++ b/pxr/usdImaging/usdRiPxrImaging/pxrSampleFilterAdapter.h @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_RI_PXR_IMAGING_PXR_SAMPLE_FILTER_ADAPTER_H #define PXR_USD_IMAGING_USD_RI_PXR_IMAGING_PXR_SAMPLE_FILTER_ADAPTER_H diff --git a/pxr/usdImaging/usdRiPxrImaging/tokens.cpp b/pxr/usdImaging/usdRiPxrImaging/tokens.cpp index e2b44b2768..499975acc5 100644 --- a/pxr/usdImaging/usdRiPxrImaging/tokens.cpp +++ b/pxr/usdImaging/usdRiPxrImaging/tokens.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdRiPxrImaging/tokens.h" diff --git a/pxr/usdImaging/usdRiPxrImaging/tokens.h b/pxr/usdImaging/usdRiPxrImaging/tokens.h index 187c8f134d..0289d3a742 100644 --- a/pxr/usdImaging/usdRiPxrImaging/tokens.h +++ b/pxr/usdImaging/usdRiPxrImaging/tokens.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_RI_PXR_IMAGING_TOKENS_H #define PXR_USD_IMAGING_USD_RI_PXR_IMAGING_TOKENS_H diff --git a/pxr/usdImaging/usdRiPxrImaging/version.h b/pxr/usdImaging/usdRiPxrImaging/version.h index 4672729a09..bbe6649873 100644 --- a/pxr/usdImaging/usdRiPxrImaging/version.h +++ b/pxr/usdImaging/usdRiPxrImaging/version.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_RI_PXR_IMAGING_VERSION_H #define PXR_USD_IMAGING_USD_RI_PXR_IMAGING_VERSION_H diff --git a/pxr/usdImaging/usdSkelImaging/api.h b/pxr/usdImaging/usdSkelImaging/api.h index 31412c372e..108d61af8d 100644 --- a/pxr/usdImaging/usdSkelImaging/api.h +++ b/pxr/usdImaging/usdSkelImaging/api.h @@ -1,25 +1,8 @@ // // Copyright 2018 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_SKEL_IMAGING_API_H #define PXR_USD_IMAGING_USD_SKEL_IMAGING_API_H diff --git a/pxr/usdImaging/usdSkelImaging/package.cpp b/pxr/usdImaging/usdSkelImaging/package.cpp index e131c42fc9..3f624e974f 100644 --- a/pxr/usdImaging/usdSkelImaging/package.cpp +++ b/pxr/usdImaging/usdSkelImaging/package.cpp @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdSkelImaging/package.h" diff --git a/pxr/usdImaging/usdSkelImaging/package.h b/pxr/usdImaging/usdSkelImaging/package.h index 534850b4e1..da3ab5be46 100644 --- a/pxr/usdImaging/usdSkelImaging/package.h +++ b/pxr/usdImaging/usdSkelImaging/package.h @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_SKEL_IMAGING_PACKAGE_H #define PXR_USD_IMAGING_USD_SKEL_IMAGING_PACKAGE_H diff --git a/pxr/usdImaging/usdSkelImaging/pch.h b/pxr/usdImaging/usdSkelImaging/pch.h index 69caaac23b..beb4e316bb 100644 --- a/pxr/usdImaging/usdSkelImaging/pch.h +++ b/pxr/usdImaging/usdSkelImaging/pch.h @@ -1,25 +1,8 @@ // -// Copyright 2018 Pixar +// Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // // WARNING: THIS FILE IS GENERATED. DO NOT EDIT. // @@ -31,6 +14,7 @@ #include #endif #if defined(ARCH_OS_LINUX) +#include #include #endif #if defined(ARCH_OS_WINDOWS) @@ -38,12 +22,12 @@ #define WIN32_LEAN_AND_MEAN #endif +#include #include -#include -#include -#include #endif #include +#include +#include #include #include #include @@ -69,6 +53,9 @@ #include #include #include +#include +#include +#include #include #include #include @@ -77,62 +64,15 @@ #include #include #include +#include #include #include #include #include #include #include +#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #ifdef PXR_PYTHON_SUPPORT_ENABLED #include #include @@ -146,32 +86,9 @@ #undef toupper #endif #endif // PXR_PYTHON_SUPPORT_ENABLED -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include #include +#include #include #include #include @@ -182,7 +99,7 @@ #include #include #include -#include +#include #ifdef PXR_PYTHON_SUPPORT_ENABLED #include "pxr/base/tf/pySafePython.h" #endif // PXR_PYTHON_SUPPORT_ENABLED diff --git a/pxr/usdImaging/usdSkelImaging/shaders/skinning.glslfx b/pxr/usdImaging/usdSkelImaging/shaders/skinning.glslfx index de24a59d5e..3d0cdb240b 100644 --- a/pxr/usdImaging/usdSkelImaging/shaders/skinning.glslfx +++ b/pxr/usdImaging/usdSkelImaging/shaders/skinning.glslfx @@ -1,5 +1,12 @@ -- glslfx version 0.1 +// +// Copyright 2019 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// + -- configuration { "techniques": { @@ -23,9 +30,6 @@ const float EPS = 1e-5; void compute(int index) { - // model space -> bind space - mat4 geomBindXform = HdGet_geomBindXform(); - vec3 restP = HdGet_restPoints(index); // apply blend shapes @@ -39,11 +43,14 @@ void compute(int index) restP += offset.xyz * weight; } } - vec4 initP = geomBindXform * vec4(restP, 1); - + int numInfluencesPerComponent = HdGet_numInfluencesPerComponent(); vec3 p; if (numInfluencesPerComponent > 0) { + // model space -> bind space + mat4 geomBindXform = HdGet_geomBindXform(); + vec4 initP = geomBindXform * vec4(restP, 1); + p = vec3(0,0,0); bool constantPointInfluence = HdGet_hasConstantInfluences(); @@ -60,17 +67,17 @@ void compute(int index) p += ((skinningXform * initP) * jointWeight).xyz; } } + + // skel space -> world space -> model space + // XXX: Casts to mat4 below are necessary because the matrices passed + // down use doubles and not floats. + mat4 skelToPrimLocal = mat4( HdGet_primWorldToLocal() ) * + mat4( HdGet_skelLocalToWorld() ); + p = (skelToPrimLocal * vec4(p,1)).xyz; } else { - p = initP.xyz; + p = restP; } - // skel space -> world space -> model space - // XXX: Casts to mat4 below are necessary because the matrices passed - // down use doubles and not floats. - mat4 skelToPrimLocal = mat4( HdGet_primWorldToLocal() ) * - mat4( HdGet_skelLocalToWorld() ); - p = (skelToPrimLocal * vec4(p,1)).xyz; - HdSet_skinnedPoints(index, p); } @@ -135,9 +142,6 @@ vec3 GetDualQuaternionTranslation(vec4 real, vec4 dual) void compute(int index) { - // model space -> bind space - mat4 geomBindXform = HdGet_geomBindXform(); - vec3 restP = HdGet_restPoints(index); // apply blend shapes @@ -151,11 +155,13 @@ void compute(int index) restP += offset.xyz * weight; } } - vec3 initP = (geomBindXform * vec4(restP, 1)).xyz; int numInfluencesPerComponent = HdGet_numInfluencesPerComponent(); vec3 p; if (numInfluencesPerComponent > 0) { + // model space -> bind space + mat4 geomBindXform = HdGet_geomBindXform(); + vec3 initP = (geomBindXform * vec4(restP, 1)).xyz; #ifdef HD_HAS_skinningScaleXforms vec3 scaledP = vec3(0, 0, 0); @@ -220,17 +226,17 @@ void compute(int index) p = TransformByQuaternion(weightedSumDQReal, initP) + GetDualQuaternionTranslation(weightedSumDQReal, weightedSumDQDual); #endif + + // skel space -> world space -> model space + // XXX: Casts to mat4 below are necessary because the matrices passed + // down use doubles and not floats. + mat4 skelToPrimLocal = mat4(HdGet_primWorldToLocal()) * + mat4(HdGet_skelLocalToWorld()); + p = (skelToPrimLocal * vec4(p,1)).xyz; } else { - p = initP; + p = restP; } - // skel space -> world space -> model space - // XXX: Casts to mat4 below are necessary because the matrices passed - // down use doubles and not floats. - mat4 skelToPrimLocal = mat4(HdGet_primWorldToLocal()) * - mat4(HdGet_skelLocalToWorld()); - p = (skelToPrimLocal * vec4(p,1)).xyz; - HdSet_skinnedPoints(index, p); } diff --git a/pxr/usdImaging/usdSkelImaging/skelRootAdapter.cpp b/pxr/usdImaging/usdSkelImaging/skelRootAdapter.cpp index 28eab6981c..584adfcc3b 100644 --- a/pxr/usdImaging/usdSkelImaging/skelRootAdapter.cpp +++ b/pxr/usdImaging/usdSkelImaging/skelRootAdapter.cpp @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdSkelImaging/skelRootAdapter.h" #include "pxr/usdImaging/usdSkelImaging/skeletonAdapter.h" diff --git a/pxr/usdImaging/usdSkelImaging/skelRootAdapter.h b/pxr/usdImaging/usdSkelImaging/skelRootAdapter.h index bbb95f1a31..e77ce489b5 100644 --- a/pxr/usdImaging/usdSkelImaging/skelRootAdapter.h +++ b/pxr/usdImaging/usdSkelImaging/skelRootAdapter.h @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_SKEL_IMAGING_SKEL_ROOT_ADAPTER_H #define PXR_USD_IMAGING_USD_SKEL_IMAGING_SKEL_ROOT_ADAPTER_H diff --git a/pxr/usdImaging/usdSkelImaging/skeletonAdapter.cpp b/pxr/usdImaging/usdSkelImaging/skeletonAdapter.cpp index c02c56a93f..675ab7407c 100644 --- a/pxr/usdImaging/usdSkelImaging/skeletonAdapter.cpp +++ b/pxr/usdImaging/usdSkelImaging/skeletonAdapter.cpp @@ -1,25 +1,8 @@ // // Copyright 2018 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdSkelImaging/skeletonAdapter.h" #include "pxr/usdImaging/usdSkelImaging/package.h" diff --git a/pxr/usdImaging/usdSkelImaging/skeletonAdapter.h b/pxr/usdImaging/usdSkelImaging/skeletonAdapter.h index 3ff7554cf0..c963c42641 100644 --- a/pxr/usdImaging/usdSkelImaging/skeletonAdapter.h +++ b/pxr/usdImaging/usdSkelImaging/skeletonAdapter.h @@ -1,25 +1,8 @@ // // Copyright 2018 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_SKEL_IMAGING_SKELETON_ADAPTER_H #define PXR_USD_IMAGING_USD_SKEL_IMAGING_SKELETON_ADAPTER_H @@ -209,12 +192,14 @@ class UsdSkelImagingSkeletonAdapter : public UsdImagingInstanceablePrimAdapter const UsdImagingInstancerContext *instancerContext) const override; + USDSKELIMAGING_API HdExtComputationOutputDescriptorVector GetExtComputationOutputs(UsdPrim const& prim, SdfPath const& cachePath, const UsdImagingInstancerContext* instancerContext) const override; + USDSKELIMAGING_API HdExtComputationPrimvarDescriptorVector GetExtComputationPrimvars( UsdPrim const& prim, @@ -222,7 +207,7 @@ class UsdSkelImagingSkeletonAdapter : public UsdImagingInstanceablePrimAdapter HdInterpolation interpolation, const UsdImagingInstancerContext* instancerContext) const override; - USDIMAGING_API + USDSKELIMAGING_API VtValue GetExtComputationInput( UsdPrim const& prim, @@ -231,7 +216,7 @@ class UsdSkelImagingSkeletonAdapter : public UsdImagingInstanceablePrimAdapter UsdTimeCode time, const UsdImagingInstancerContext* instancerContext) const override; - USDIMAGING_API + USDSKELIMAGING_API size_t SampleExtComputationInput( UsdPrim const& prim, @@ -243,7 +228,7 @@ class UsdSkelImagingSkeletonAdapter : public UsdImagingInstanceablePrimAdapter float *sampleTimes, VtValue *sampleValues) override; - USDIMAGING_API + USDSKELIMAGING_API std::string GetExtComputationKernel( UsdPrim const& prim, diff --git a/pxr/usdImaging/usdSkelImaging/utils.cpp b/pxr/usdImaging/usdSkelImaging/utils.cpp index e51c4f37f7..54666a7624 100644 --- a/pxr/usdImaging/usdSkelImaging/utils.cpp +++ b/pxr/usdImaging/usdSkelImaging/utils.cpp @@ -1,25 +1,8 @@ // // Copyright 2018 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdSkelImaging/utils.h" diff --git a/pxr/usdImaging/usdSkelImaging/utils.h b/pxr/usdImaging/usdSkelImaging/utils.h index 4e9f2cd3c6..648857722f 100644 --- a/pxr/usdImaging/usdSkelImaging/utils.h +++ b/pxr/usdImaging/usdSkelImaging/utils.h @@ -1,25 +1,8 @@ // // Copyright 2018 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_SKEL_IMAGING_UTILS_H #define PXR_USD_IMAGING_USD_SKEL_IMAGING_UTILS_H diff --git a/pxr/usdImaging/usdVolImaging/api.h b/pxr/usdImaging/usdVolImaging/api.h index 1f79625eb8..cb001fa7c1 100644 --- a/pxr/usdImaging/usdVolImaging/api.h +++ b/pxr/usdImaging/usdVolImaging/api.h @@ -1,25 +1,8 @@ // // Copyright 2018 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_VOL_IMAGING_API_H #define PXR_USD_IMAGING_USD_VOL_IMAGING_API_H diff --git a/pxr/usdImaging/usdVolImaging/dataSourceFieldAsset.cpp b/pxr/usdImaging/usdVolImaging/dataSourceFieldAsset.cpp index 8efdb042ce..4550672acb 100644 --- a/pxr/usdImaging/usdVolImaging/dataSourceFieldAsset.cpp +++ b/pxr/usdImaging/usdVolImaging/dataSourceFieldAsset.cpp @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdVolImaging/dataSourceFieldAsset.h" #include "pxr/usdImaging/usdImaging/dataSourceAttribute.h" @@ -141,5 +124,38 @@ UsdImagingDataSourceFieldAssetPrim::Get(const TfToken & name) return UsdImagingDataSourcePrim::Get(name); } +HdDataSourceLocatorSet +UsdImagingDataSourceFieldAssetPrim::Invalidate( + UsdPrim const& prim, + const TfToken &subprim, + const TfTokenVector &properties, + const UsdImagingPropertyInvalidationType invalidationType) +{ + HdDataSourceLocatorSet locators = + UsdImagingDataSourcePrim::Invalidate( + prim, subprim, properties, invalidationType); + + TfTokenVector fieldNames; + if (prim.IsA()) { + fieldNames = + _GetStaticUsdAttributeNames(); + } else if (prim.IsA()) { + fieldNames = + _GetStaticUsdAttributeNames(); + } else { + TF_CODING_ERROR("Unsupported field type."); + return locators; + } + + for (const TfToken &propertyName : properties) { + if (std::find(fieldNames.begin(), fieldNames.end(), propertyName) + != fieldNames.end()) { + locators.insert(HdVolumeFieldSchema::GetDefaultLocator()); + break; + } + } + + return locators; +} PXR_NAMESPACE_CLOSE_SCOPE diff --git a/pxr/usdImaging/usdVolImaging/dataSourceFieldAsset.h b/pxr/usdImaging/usdVolImaging/dataSourceFieldAsset.h index 0a45d9fec7..c9ff19568e 100644 --- a/pxr/usdImaging/usdVolImaging/dataSourceFieldAsset.h +++ b/pxr/usdImaging/usdVolImaging/dataSourceFieldAsset.h @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_VOL_IMAGING_DATA_SOURCE_FIELD_ASSET_H @@ -80,6 +63,14 @@ class UsdImagingDataSourceFieldAssetPrim : public UsdImagingDataSourcePrim TfTokenVector GetNames() override; HdDataSourceBaseHandle Get(const TfToken &name) override; + static + HdDataSourceLocatorSet + Invalidate( + UsdPrim const& prim, + const TfToken &subprim, + const TfTokenVector &properties, + UsdImagingPropertyInvalidationType invalidationType); + private: // Private constructor, use static New() instead. diff --git a/pxr/usdImaging/usdVolImaging/field3dAssetAdapter.cpp b/pxr/usdImaging/usdVolImaging/field3dAssetAdapter.cpp index ff2e5fe8bd..37c91f4055 100644 --- a/pxr/usdImaging/usdVolImaging/field3dAssetAdapter.cpp +++ b/pxr/usdImaging/usdVolImaging/field3dAssetAdapter.cpp @@ -1,25 +1,8 @@ // // Copyright 2018 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdVolImaging/field3dAssetAdapter.h" @@ -73,6 +56,21 @@ UsdImagingField3DAssetAdapter::GetImagingSubprimData( return nullptr; } +HdDataSourceLocatorSet +UsdImagingField3DAssetAdapter::InvalidateImagingSubprim( + UsdPrim const& prim, + TfToken const& subprim, + TfTokenVector const& properties, + const UsdImagingPropertyInvalidationType invalidationType) +{ + if (subprim.IsEmpty()) { + return UsdImagingDataSourceFieldAssetPrim::Invalidate( + prim, subprim, properties, invalidationType); + } + + return HdDataSourceLocatorSet(); +} + VtValue UsdImagingField3DAssetAdapter::Get( UsdPrim const& prim, diff --git a/pxr/usdImaging/usdVolImaging/field3dAssetAdapter.h b/pxr/usdImaging/usdVolImaging/field3dAssetAdapter.h index 1592a7a558..eb70fcc773 100644 --- a/pxr/usdImaging/usdVolImaging/field3dAssetAdapter.h +++ b/pxr/usdImaging/usdVolImaging/field3dAssetAdapter.h @@ -1,25 +1,8 @@ // // Copyright 2018 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_VOL_IMAGING_FIELD3D_ASSET_ADAPTER_H #define PXR_USD_IMAGING_USD_VOL_IMAGING_FIELD3D_ASSET_ADAPTER_H @@ -54,19 +37,26 @@ class UsdImagingField3DAssetAdapter : public UsdImagingFieldAdapter { /// \name Scene Index Support // ---------------------------------------------------------------------- // - USDIMAGING_API + USDVOLIMAGING_API TfTokenVector GetImagingSubprims(UsdPrim const& prim) override; - USDIMAGING_API + USDVOLIMAGING_API TfToken GetImagingSubprimType(UsdPrim const& prim, TfToken const& subprim) override; - USDIMAGING_API + USDVOLIMAGING_API HdContainerDataSourceHandle GetImagingSubprimData( UsdPrim const& prim, TfToken const& subprim, const UsdImagingDataSourceStageGlobals &stageGlobals) override; + USDIMAGING_API + HdDataSourceLocatorSet InvalidateImagingSubprim( + UsdPrim const& prim, + TfToken const& subprim, + TfTokenVector const& properties, + UsdImagingPropertyInvalidationType invalidationType) override; + // ---------------------------------------------------------------------- // /// \name Data access // ---------------------------------------------------------------------- // diff --git a/pxr/usdImaging/usdVolImaging/openvdbAssetAdapter.cpp b/pxr/usdImaging/usdVolImaging/openvdbAssetAdapter.cpp index 1b395169ac..956c9b4cff 100644 --- a/pxr/usdImaging/usdVolImaging/openvdbAssetAdapter.cpp +++ b/pxr/usdImaging/usdVolImaging/openvdbAssetAdapter.cpp @@ -1,25 +1,8 @@ // // Copyright 2018 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdVolImaging/openvdbAssetAdapter.h" @@ -73,6 +56,21 @@ UsdImagingOpenVDBAssetAdapter::GetImagingSubprimData( return nullptr; } +HdDataSourceLocatorSet +UsdImagingOpenVDBAssetAdapter::InvalidateImagingSubprim( + UsdPrim const& prim, + TfToken const& subprim, + TfTokenVector const& properties, + const UsdImagingPropertyInvalidationType invalidationType) +{ + if (subprim.IsEmpty()) { + return UsdImagingDataSourceFieldAssetPrim::Invalidate( + prim, subprim, properties, invalidationType); + } + + return HdDataSourceLocatorSet(); +} + VtValue UsdImagingOpenVDBAssetAdapter::Get( UsdPrim const& prim, diff --git a/pxr/usdImaging/usdVolImaging/openvdbAssetAdapter.h b/pxr/usdImaging/usdVolImaging/openvdbAssetAdapter.h index daaf153f8a..5aae588b3c 100644 --- a/pxr/usdImaging/usdVolImaging/openvdbAssetAdapter.h +++ b/pxr/usdImaging/usdVolImaging/openvdbAssetAdapter.h @@ -1,25 +1,8 @@ // // Copyright 2018 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_VOL_IMAGING_OPENVDB_ASSET_ADAPTER_H #define PXR_USD_IMAGING_USD_VOL_IMAGING_OPENVDB_ASSET_ADAPTER_H @@ -54,19 +37,26 @@ class UsdImagingOpenVDBAssetAdapter : public UsdImagingFieldAdapter { /// \name Scene Index Support // ---------------------------------------------------------------------- // - USDIMAGING_API + USDVOLIMAGING_API TfTokenVector GetImagingSubprims(UsdPrim const& prim) override; - USDIMAGING_API + USDVOLIMAGING_API TfToken GetImagingSubprimType(UsdPrim const& prim, TfToken const& subprim) override; - USDIMAGING_API + USDVOLIMAGING_API HdContainerDataSourceHandle GetImagingSubprimData( UsdPrim const& prim, TfToken const& subprim, const UsdImagingDataSourceStageGlobals &stageGlobals) override; + USDIMAGING_API + HdDataSourceLocatorSet InvalidateImagingSubprim( + UsdPrim const& prim, + TfToken const& subprim, + TfTokenVector const& properties, + UsdImagingPropertyInvalidationType invalidationType) override; + // ---------------------------------------------------------------------- // /// \name Data access // ---------------------------------------------------------------------- // diff --git a/pxr/usdImaging/usdVolImaging/pch.h b/pxr/usdImaging/usdVolImaging/pch.h index 0fd54d571b..ae10fe25a5 100644 --- a/pxr/usdImaging/usdVolImaging/pch.h +++ b/pxr/usdImaging/usdVolImaging/pch.h @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // // WARNING: THIS FILE IS GENERATED. DO NOT EDIT. // @@ -31,6 +14,7 @@ #include #endif #if defined(ARCH_OS_LINUX) +#include #include #endif #if defined(ARCH_OS_WINDOWS) @@ -38,12 +22,12 @@ #define WIN32_LEAN_AND_MEAN #endif +#include #include -#include -#include -#include #endif #include +#include +#include #include #include #include @@ -69,6 +53,9 @@ #include #include #include +#include +#include +#include #include #include #include @@ -77,61 +64,15 @@ #include #include #include +#include #include #include #include #include #include #include +#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #ifdef PXR_PYTHON_SUPPORT_ENABLED #include #include @@ -145,30 +86,9 @@ #undef toupper #endif #endif // PXR_PYTHON_SUPPORT_ENABLED -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include #include +#include #include #include #include @@ -177,7 +97,7 @@ #include #include #include -#include +#include #ifdef PXR_PYTHON_SUPPORT_ENABLED #include "pxr/base/tf/pySafePython.h" #endif // PXR_PYTHON_SUPPORT_ENABLED diff --git a/pxr/usdImaging/usdVolImaging/tokens.cpp b/pxr/usdImaging/usdVolImaging/tokens.cpp index 9ee7d27c81..ef293dab5b 100644 --- a/pxr/usdImaging/usdVolImaging/tokens.cpp +++ b/pxr/usdImaging/usdVolImaging/tokens.cpp @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdVolImaging/tokens.h" diff --git a/pxr/usdImaging/usdVolImaging/tokens.h b/pxr/usdImaging/usdVolImaging/tokens.h index 342dd4415e..aa576f315f 100644 --- a/pxr/usdImaging/usdVolImaging/tokens.h +++ b/pxr/usdImaging/usdVolImaging/tokens.h @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USD_VOL_IMAGING_TOKENS_H #define PXR_USD_IMAGING_USD_VOL_IMAGING_TOKENS_H diff --git a/pxr/usdImaging/usdviewq/README.md b/pxr/usdImaging/usdviewq/README.md index 0fe1e881f9..4a30847b61 100644 --- a/pxr/usdImaging/usdviewq/README.md +++ b/pxr/usdImaging/usdviewq/README.md @@ -2,7 +2,7 @@ ## Modifying GUI - **Please do not hand edit .ui files, as qt's xml formt is fragile and its + **Please do not hand edit .ui files, as qt's xml format is fragile and its tools are inconsistent across platforms on tolerance to bad constructs.** Instead prefer qdesigner5 to make edits to the .ui documents. If you are diff --git a/pxr/usdImaging/usdviewq/__init__.py b/pxr/usdImaging/usdviewq/__init__.py index 525e21f6c9..3f50d47830 100644 --- a/pxr/usdImaging/usdviewq/__init__.py +++ b/pxr/usdImaging/usdviewq/__init__.py @@ -1,25 +1,8 @@ # # Copyright 2016 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # from __future__ import print_function @@ -83,7 +66,8 @@ def Run(self): traceCollector.enabled = True - self.__LaunchProcess(arg_parse_result) + app, appController = self.LaunchPreamble(arg_parse_result) + self.LaunchProcess(arg_parse_result, app, appController) if traceCollector: traceCollector.enabled = False @@ -180,6 +164,10 @@ def RegisterOptions(self, parser): dest='unloaded', help='Do not load payloads') + parser.add_argument('--bboxStandin', action='store_true', + dest='bboxstandin', + help='Display unloaded prims with bounding boxes') + parser.add_argument('--timing', action='store_true', dest='timing', help='Echo timing stats to console. NOTE: timings will be unreliable when the --memstats option is also in use') @@ -368,8 +356,12 @@ def GetResolverContext(self, usdFile): return r.CreateDefaultContextForAsset(usdFile) + def OverrideMaxSamples(self): + # Return True if HdPrman's default max samples should be overridden, + # False otherwise. + return True - def LaunchPreamble(self, arg_parse_result, overrideMaxSamples = True): + def LaunchPreamble(self, arg_parse_result): # Initialize concurrency limit as early as possible so that it is # respected by subsequent imports. from pxr import Work @@ -378,7 +370,7 @@ def LaunchPreamble(self, arg_parse_result, overrideMaxSamples = True): # XXX Override HdPrman's defaults using the env var. In the # future we expect there may be more formal ways to represent # per-app settings for particular Hydra plugins. - if overrideMaxSamples: + if self.OverrideMaxSamples(): os.environ.setdefault('HD_PRMAN_MAX_SAMPLES', '1024') if arg_parse_result.clearSettings: @@ -392,13 +384,10 @@ def LaunchPreamble(self, arg_parse_result, overrideMaxSamples = True): return (app, appController) - def __LaunchProcess(self, arg_parse_result): + def LaunchProcess(self, arg_parse_result, app, appController): ''' after the arguments have been parsed, launch the UI in a forked process ''' - # Initialize concurrency limit as early as possible so that it is - # respected by subsequent imports. - (app, appController) = self.LaunchPreamble(arg_parse_result) if arg_parse_result.quitAfterStartup: # Enqueue event to shutdown application. We don't use quit() because diff --git a/pxr/usdImaging/usdviewq/adjustDefaultMaterial.py b/pxr/usdImaging/usdviewq/adjustDefaultMaterial.py index a7989e5688..410fe11715 100644 --- a/pxr/usdImaging/usdviewq/adjustDefaultMaterial.py +++ b/pxr/usdImaging/usdviewq/adjustDefaultMaterial.py @@ -1,25 +1,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # from .qt import QtCore, QtWidgets from .adjustDefaultMaterialUI import Ui_AdjustDefaultMaterial diff --git a/pxr/usdImaging/usdviewq/adjustDefaultMaterialUI.ui b/pxr/usdImaging/usdviewq/adjustDefaultMaterialUI.ui index 2cce0a6052..b043435cfc 100644 --- a/pxr/usdImaging/usdviewq/adjustDefaultMaterialUI.ui +++ b/pxr/usdImaging/usdviewq/adjustDefaultMaterialUI.ui @@ -23,25 +23,8 @@ Copyright 2017 Pixar - Licensed under the Apache License, Version 2.0 (the "Apache License") - with the following modification; you may not use this file except in - compliance with the Apache License and the following modification to it: - Section 6. Trademarks. is deleted and replaced with: - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor - and its affiliates, except as required to comply with Section 4(c) of - the License and to reproduce the content of the NOTICE file. - - You may obtain a copy of the Apache License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the Apache License with the above modification is - distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the Apache License for the specific - language governing permissions and limitations under the Apache License. + Licensed under the terms set forth in the LICENSE.txt file available at + https://openusd.org/license. diff --git a/pxr/usdImaging/usdviewq/adjustFreeCamera.py b/pxr/usdImaging/usdviewq/adjustFreeCamera.py index 5ea14a5f9d..44a367aaf9 100644 --- a/pxr/usdImaging/usdviewq/adjustFreeCamera.py +++ b/pxr/usdImaging/usdviewq/adjustFreeCamera.py @@ -1,25 +1,8 @@ # # Copyright 2021 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # from .qt import QtCore, QtGui, QtWidgets from .adjustFreeCameraUI import Ui_AdjustFreeCamera diff --git a/pxr/usdImaging/usdviewq/adjustFreeCameraUI.ui b/pxr/usdImaging/usdviewq/adjustFreeCameraUI.ui index 9be6d77871..69d35c6680 100644 --- a/pxr/usdImaging/usdviewq/adjustFreeCameraUI.ui +++ b/pxr/usdImaging/usdviewq/adjustFreeCameraUI.ui @@ -17,25 +17,8 @@ Copyright 2016 Pixar - Licensed under the Apache License, Version 2.0 (the "Apache License") - with the following modification; you may not use this file except in - compliance with the Apache License and the following modification to it: - Section 6. Trademarks. is deleted and replaced with: - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor - and its affiliates, except as required to comply with Section 4(c) of - the License and to reproduce the content of the NOTICE file. - - You may obtain a copy of the Apache License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the Apache License with the above modification is - distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the Apache License for the specific - language governing permissions and limitations under the Apache License. + Licensed under the terms set forth in the LICENSE.txt file available at + https://openusd.org/license. diff --git a/pxr/usdImaging/usdviewq/api.h b/pxr/usdImaging/usdviewq/api.h index 876e9c02eb..45607880d8 100644 --- a/pxr/usdImaging/usdviewq/api.h +++ b/pxr/usdImaging/usdviewq/api.h @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USDVIEWQ_API_H #define PXR_USD_IMAGING_USDVIEWQ_API_H diff --git a/pxr/usdImaging/usdviewq/appController.py b/pxr/usdImaging/usdviewq/appController.py index e607e7f8ed..1cc99bcafe 100644 --- a/pxr/usdImaging/usdviewq/appController.py +++ b/pxr/usdImaging/usdviewq/appController.py @@ -1,25 +1,8 @@ # # Copyright 2016 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # # pylint: disable=round-builtin @@ -394,6 +377,7 @@ def __init__(self, parserData, resolverContextFn): self._allowViewUpdates = True self._allowAsync = parserData.allowAsync + self._bboxstandin = parserData.bboxstandin # When viewer mode is active, the panel sizes are cached so they can # be restored later. @@ -1753,23 +1737,17 @@ def addAction(menu, name): action.setCheckable(True) return action - def setColorSpace(action): + def setOcioColorSpace(action): self._dataModel.viewSettings.setOcioSettings(\ colorSpace = str(action.text())) self._dataModel.viewSettings.colorCorrectionMode =\ ColorCorrectionModes.OPENCOLORIO - def setOcioConfig(action): + def setOcioDisplayView(action): display = str(action.parent().title()) view = str(action.text()) - if hasattr(config, 'getDisplayViewColorSpaceName'): - # OCIO version 2 - colorSpace = config.getDisplayViewColorSpaceName(display, view) - else: - # OCIO version 1 - colorSpace = config.getDisplayColorSpaceName(display, view) - self._dataModel.viewSettings.setOcioSettings(colorSpace,\ - display, view) + self._dataModel.viewSettings.setOcioSettings(\ + display=display, view=view) self._dataModel.viewSettings.colorCorrectionMode =\ ColorCorrectionModes.OPENCOLORIO @@ -1794,7 +1772,7 @@ def addLabelSeparator(text, parent): for v in config.getViews(d): a = addAction(displayMenu, v) group.addAction(a) - group.triggered.connect(setOcioConfig) + group.triggered.connect(setOcioDisplayView) ocioMenu.addMenu(displayMenu) self._ui.ocioDisplayMenus.append(displayMenu) @@ -1809,7 +1787,7 @@ def addLabelSeparator(text, parent): colorSpace = cs.getName() a = addAction(ocioMenu, colorSpace) group.addAction(a) - group.triggered.connect(setColorSpace) + group.triggered.connect(setOcioColorSpace) self._ui.ocioColorSpacesActionGroup = group # TODO Populate looks menu (config.getLooks()) @@ -1853,6 +1831,7 @@ def _reloadVaryingUI(self): makeTimer=self._makeTimer) self._stageView.allowAsync = self._allowAsync + self._stageView.bboxstandin = self._bboxstandin self._stageView.fpsHUDInfo = self._fpsHUDInfo self._stageView.fpsHUDKeys = self._fpsHUDKeys diff --git a/pxr/usdImaging/usdviewq/appEventFilter.py b/pxr/usdImaging/usdviewq/appEventFilter.py index 9698476688..89a5cb78a9 100644 --- a/pxr/usdImaging/usdviewq/appEventFilter.py +++ b/pxr/usdImaging/usdviewq/appEventFilter.py @@ -1,25 +1,8 @@ # # Copyright 2016 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # # Qt Components from .qt import QtCore, QtGui, QtWidgets diff --git a/pxr/usdImaging/usdviewq/arrayAttributeView.py b/pxr/usdImaging/usdviewq/arrayAttributeView.py index c5f48f1b0d..452cff5864 100644 --- a/pxr/usdImaging/usdviewq/arrayAttributeView.py +++ b/pxr/usdImaging/usdviewq/arrayAttributeView.py @@ -1,25 +1,8 @@ # # Copyright 2016 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # # pylint: disable=map-builtin-not-iterating diff --git a/pxr/usdImaging/usdviewq/attributeValueEditor.py b/pxr/usdImaging/usdviewq/attributeValueEditor.py index dd9555795c..4c61edb388 100644 --- a/pxr/usdImaging/usdviewq/attributeValueEditor.py +++ b/pxr/usdImaging/usdviewq/attributeValueEditor.py @@ -1,25 +1,8 @@ # # Copyright 2016 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # from pxr import Usd from .qt import QtCore, QtWidgets diff --git a/pxr/usdImaging/usdviewq/attributeValueEditorUI.ui b/pxr/usdImaging/usdviewq/attributeValueEditorUI.ui index dd59a7cac7..e301a294dc 100644 --- a/pxr/usdImaging/usdviewq/attributeValueEditorUI.ui +++ b/pxr/usdImaging/usdviewq/attributeValueEditorUI.ui @@ -17,25 +17,8 @@ Copyright 2016 Pixar - Licensed under the Apache License, Version 2.0 (the "Apache License") - with the following modification; you may not use this file except in - compliance with the Apache License and the following modification to it: - Section 6. Trademarks. is deleted and replaced with: - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor - and its affiliates, except as required to comply with Section 4(c) of - the License and to reproduce the content of the NOTICE file. - - You may obtain a copy of the Apache License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the Apache License with the above modification is - distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the Apache License for the specific - language governing permissions and limitations under the Apache License. + Licensed under the terms set forth in the LICENSE.txt file available at + https://openusd.org/license. diff --git a/pxr/usdImaging/usdviewq/attributeViewContextMenu.py b/pxr/usdImaging/usdviewq/attributeViewContextMenu.py index c21bb4aeb4..40f4cb9add 100644 --- a/pxr/usdImaging/usdviewq/attributeViewContextMenu.py +++ b/pxr/usdImaging/usdviewq/attributeViewContextMenu.py @@ -1,25 +1,8 @@ # # Copyright 2016 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # from .qt import QtGui, QtWidgets, QtCore diff --git a/pxr/usdImaging/usdviewq/common.py b/pxr/usdImaging/usdviewq/common.py index 15734a87bd..af71123b00 100644 --- a/pxr/usdImaging/usdviewq/common.py +++ b/pxr/usdImaging/usdviewq/common.py @@ -1,25 +1,8 @@ # # Copyright 2016 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # # pylint: disable=round-builtin @@ -376,9 +359,7 @@ def FromMutedLayerIdentifier(cls, identifier, parentLayer, stage, depth=0): realPath = '' try: resolver = Ar.GetResolver() - with Ar.ResolverContextBinder(stage.GetPathResolverContext()): - realPath = resolver.Resolve(resolver.CreateIdentifier( - identifier, parentLayer.resolvedPath)).GetPathString() + realPath = resolver.Resolve(identifier).GetPathString() except Exception as e: PrintWarning('Failed to resolve identifier {} ' .format(identifier), e) @@ -434,13 +415,6 @@ def GetHierarchicalDisplayString(self): Sdf.Layer.GetDisplayNameFromIdentifier(self._identifier)) def _AddLayerTree(stage, layerTree, depth=0): - layers = [LayerInfo.FromLayer( - layerTree.layer, stage, layerTree.offset, depth)] - for child in layerTree.childTrees: - layers.extend(_AddLayerTree(stage, child, depth=depth + 1)) - return layers - -def _AddLayerTreeWithMutedSubLayers(stage, layerTree, depth=0): layers = [LayerInfo.FromLayer( layerTree.layer, stage, layerTree.offset, depth)] @@ -452,31 +426,38 @@ def _AddLayerTreeWithMutedSubLayers(stage, layerTree, depth=0): # layers in the correct sublayer position, we go through the sublayer paths # parsing either the muted layer or a layer stack tree subtree. # - # XXX: It would be nice if we could get this whole layer stack tree with - # muted layers and composed offsets without having to cross reference two - # different APIs. + # The layer tree will also not have any entries for layers that failed to + # load. We need to handle this case as well. childTrees = layerTree.childTrees subLayerPaths = layerTree.layer.subLayerPaths childTreeIter = iter(layerTree.childTrees) - numMutedLayers = 0 + numMissingLayers = 0 for subLayerPath in subLayerPaths: - if stage.IsLayerMuted(subLayerPath): + anchoredSubLayerPath = Sdf.ComputeAssetPathRelativeToLayer( + layerTree.layer, subLayerPath) + if stage.IsLayerMuted(anchoredSubLayerPath): # The sublayer path is muted so add muted layer by path. We don't # recurse on sublayers for muted layers. layers.append(LayerInfo.FromMutedLayerIdentifier( - subLayerPath, layerTree.layer, stage, depth=depth+1)) - numMutedLayers = numMutedLayers + 1 + anchoredSubLayerPath, layerTree.layer, stage, depth=depth+1)) + numMissingLayers = numMissingLayers + 1 + elif not Sdf.Layer.Find(anchoredSubLayerPath): + # Otherwise, the sublayer failed to load for some other reason. + # Just skip it to maintain current behavior; in the future, we + # may want to show an entry with some annotation to tell the + # user about this sublayer. + numMissingLayers = numMissingLayers + 1 else: # Otherwise we expect the unmuted sublayer to be the next child # tree in the layer stack tree so we recursively add it. - layers.extend(_AddLayerTreeWithMutedSubLayers( + layers.extend(_AddLayerTree( stage, next(childTreeIter), depth=depth + 1)) # Since we're relying on the correspondence between the unmuted sublayer # paths and the child layer stack trees, report an error if the total number # of muted layers and child trees don't match up so we can track if it # becomes an issue. - if numMutedLayers + len(childTrees) != len(subLayerPaths): + if numMissingLayers + len(childTrees) != len(subLayerPaths): print("CODING ERROR: Encountered an unexpected number of muted " "sublayers of layer {}. The root layer stack may be " "incorrect in the layer stack view".format( @@ -488,9 +469,7 @@ def GetRootLayerStackInfo(stage): primIndex = stage.GetPseudoRoot().GetPrimIndex() layerStack = primIndex.rootNode.layerStack - if layerStack.mutedLayers: - return _AddLayerTreeWithMutedSubLayers(stage, layerStack.layerTree) - else: + with Ar.ResolverContextBinder(stage.GetPathResolverContext()): return _AddLayerTree(stage, layerStack.layerTree) def PrettyFormatSize(sz): diff --git a/pxr/usdImaging/usdviewq/configController.py b/pxr/usdImaging/usdviewq/configController.py index e6286e19a3..908ded1768 100644 --- a/pxr/usdImaging/usdviewq/configController.py +++ b/pxr/usdImaging/usdviewq/configController.py @@ -1,25 +1,8 @@ # # Copyright 2022 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # from __future__ import print_function diff --git a/pxr/usdImaging/usdviewq/customAttributes.py b/pxr/usdImaging/usdviewq/customAttributes.py index e214d323ff..b29ab1cd5a 100644 --- a/pxr/usdImaging/usdviewq/customAttributes.py +++ b/pxr/usdImaging/usdviewq/customAttributes.py @@ -1,25 +1,8 @@ # # Copyright 2016 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # from pxr import Usd, UsdGeom, UsdShade diff --git a/pxr/usdImaging/usdviewq/debugCodes.cpp b/pxr/usdImaging/usdviewq/debugCodes.cpp index cbbb4cb7cf..ef56362e6b 100644 --- a/pxr/usdImaging/usdviewq/debugCodes.cpp +++ b/pxr/usdImaging/usdviewq/debugCodes.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdviewq/debugCodes.h" diff --git a/pxr/usdImaging/usdviewq/debugCodes.h b/pxr/usdImaging/usdviewq/debugCodes.h index 9930049072..fbb99e6fdc 100644 --- a/pxr/usdImaging/usdviewq/debugCodes.h +++ b/pxr/usdImaging/usdviewq/debugCodes.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USDVIEWQ_DEBUG_CODES_H #define PXR_USD_IMAGING_USDVIEWQ_DEBUG_CODES_H diff --git a/pxr/usdImaging/usdviewq/debugFlagsWidget.py b/pxr/usdImaging/usdviewq/debugFlagsWidget.py index ba8e96734d..c604ed8716 100644 --- a/pxr/usdImaging/usdviewq/debugFlagsWidget.py +++ b/pxr/usdImaging/usdviewq/debugFlagsWidget.py @@ -1,25 +1,8 @@ # # Copyright 2019 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # from .qt import QtCore, QtGui, QtWidgets diff --git a/pxr/usdImaging/usdviewq/frameSlider.py b/pxr/usdImaging/usdviewq/frameSlider.py index c552bc83ca..c2b55e6908 100644 --- a/pxr/usdImaging/usdviewq/frameSlider.py +++ b/pxr/usdImaging/usdviewq/frameSlider.py @@ -1,25 +1,8 @@ # # Copyright 2018 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # from .qt import QtCore, QtWidgets, QtGui diff --git a/pxr/usdImaging/usdviewq/freeCamera.py b/pxr/usdImaging/usdviewq/freeCamera.py index fb7f26e517..7362b7479a 100644 --- a/pxr/usdImaging/usdviewq/freeCamera.py +++ b/pxr/usdImaging/usdviewq/freeCamera.py @@ -1,25 +1,8 @@ # # Copyright 2018 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # from __future__ import division diff --git a/pxr/usdImaging/usdviewq/headerContextMenu.py b/pxr/usdImaging/usdviewq/headerContextMenu.py index 36f511ace8..a145227b50 100644 --- a/pxr/usdImaging/usdviewq/headerContextMenu.py +++ b/pxr/usdImaging/usdviewq/headerContextMenu.py @@ -1,25 +1,8 @@ # # Copyright 2016 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # from .qt import QtCore, QtWidgets from .usdviewContextMenuItem import UsdviewContextMenuItem diff --git a/pxr/usdImaging/usdviewq/hydraObserver.cpp b/pxr/usdImaging/usdviewq/hydraObserver.cpp index e3705543e5..e04a7c809b 100644 --- a/pxr/usdImaging/usdviewq/hydraObserver.cpp +++ b/pxr/usdImaging/usdviewq/hydraObserver.cpp @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdviewq/hydraObserver.h" #include "pxr/imaging/hd/filteringSceneIndex.h" diff --git a/pxr/usdImaging/usdviewq/hydraObserver.h b/pxr/usdImaging/usdviewq/hydraObserver.h index 0b37ed8ab4..a7175be9fb 100644 --- a/pxr/usdImaging/usdviewq/hydraObserver.h +++ b/pxr/usdImaging/usdviewq/hydraObserver.h @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USDVIEWQ_HYDRA_OBSERVER_H #define PXR_USD_IMAGING_USDVIEWQ_HYDRA_OBSERVER_H diff --git a/pxr/usdImaging/usdviewq/hydraSceneBrowser.py b/pxr/usdImaging/usdviewq/hydraSceneBrowser.py index d17275b00d..e450b63184 100644 --- a/pxr/usdImaging/usdviewq/hydraSceneBrowser.py +++ b/pxr/usdImaging/usdviewq/hydraSceneBrowser.py @@ -1,25 +1,8 @@ # # Copyright 2022 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # ''' diff --git a/pxr/usdImaging/usdviewq/layerStackContextMenu.py b/pxr/usdImaging/usdviewq/layerStackContextMenu.py index e45e69a1cf..a972ccf91b 100644 --- a/pxr/usdImaging/usdviewq/layerStackContextMenu.py +++ b/pxr/usdImaging/usdviewq/layerStackContextMenu.py @@ -1,25 +1,8 @@ # # Copyright 2016 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # from __future__ import print_function diff --git a/pxr/usdImaging/usdviewq/legendUtil.py b/pxr/usdImaging/usdviewq/legendUtil.py index c8fe1dd373..7289d25fd7 100644 --- a/pxr/usdImaging/usdviewq/legendUtil.py +++ b/pxr/usdImaging/usdviewq/legendUtil.py @@ -1,25 +1,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # # Functionality for expanding and collapsing legend components in usdview diff --git a/pxr/usdImaging/usdviewq/mainWindowUI.ui b/pxr/usdImaging/usdviewq/mainWindowUI.ui index 012dff3651..94c7a01586 100644 --- a/pxr/usdImaging/usdviewq/mainWindowUI.ui +++ b/pxr/usdImaging/usdviewq/mainWindowUI.ui @@ -29,25 +29,8 @@ Copyright 2016 Pixar - Licensed under the Apache License, Version 2.0 (the "Apache License") - with the following modification; you may not use this file except in - compliance with the Apache License and the following modification to it: - Section 6. Trademarks. is deleted and replaced with: - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor - and its affiliates, except as required to comply with Section 4(c) of - the License and to reproduce the content of the NOTICE file. - - You may obtain a copy of the Apache License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the Apache License with the above modification is - distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the Apache License for the specific - language governing permissions and limitations under the Apache License. + Licensed under the terms set forth in the LICENSE.txt file available at + https://openusd.org/license. @@ -1652,7 +1635,7 @@ 0 0 1145 - 21 + 20 @@ -1830,6 +1813,9 @@ Reopen Stage + + Ctrl+Shift+R + diff --git a/pxr/usdImaging/usdviewq/module.cpp b/pxr/usdImaging/usdviewq/module.cpp index 12600aa8cc..2ae041f902 100644 --- a/pxr/usdImaging/usdviewq/module.cpp +++ b/pxr/usdImaging/usdviewq/module.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/base/tf/pyModule.h" diff --git a/pxr/usdImaging/usdviewq/moduleDeps.cpp b/pxr/usdImaging/usdviewq/moduleDeps.cpp index c2ed4afbaf..afa7a37ea4 100644 --- a/pxr/usdImaging/usdviewq/moduleDeps.cpp +++ b/pxr/usdImaging/usdviewq/moduleDeps.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/pxr/usdImaging/usdviewq/overridableLineEdit.py b/pxr/usdImaging/usdviewq/overridableLineEdit.py index 074f314143..6f2c9f056b 100644 --- a/pxr/usdImaging/usdviewq/overridableLineEdit.py +++ b/pxr/usdImaging/usdviewq/overridableLineEdit.py @@ -1,25 +1,8 @@ # # Copyright 2016 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # from __future__ import division diff --git a/pxr/usdImaging/usdviewq/pch.h b/pxr/usdImaging/usdviewq/pch.h index 2b6f4d7826..37157ec09f 100644 --- a/pxr/usdImaging/usdviewq/pch.h +++ b/pxr/usdImaging/usdviewq/pch.h @@ -1,25 +1,8 @@ // // Copyright 2017 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // // WARNING: THIS FILE IS GENERATED. DO NOT EDIT. // @@ -31,6 +14,7 @@ #include #endif #if defined(ARCH_OS_LINUX) +#include #include #endif #if defined(ARCH_OS_WINDOWS) @@ -38,9 +22,11 @@ #define WIN32_LEAN_AND_MEAN #endif - +#include +#include #endif #include +#include #include #include #include @@ -56,7 +42,6 @@ #include #include #include -#include #include #include #include @@ -68,6 +53,7 @@ #include #include #include +#include #include #include #include @@ -76,58 +62,15 @@ #include #include #include +#include #include #include #include #include #include #include +#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #ifdef PXR_PYTHON_SUPPORT_ENABLED #include #include @@ -149,22 +92,7 @@ #undef toupper #endif #endif // PXR_PYTHON_SUPPORT_ENABLED -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include #include #include #include @@ -174,6 +102,7 @@ #include #include #include +#include #ifdef PXR_PYTHON_SUPPORT_ENABLED #include "pxr/base/tf/pySafePython.h" #endif // PXR_PYTHON_SUPPORT_ENABLED diff --git a/pxr/usdImaging/usdviewq/plugin.py b/pxr/usdImaging/usdviewq/plugin.py index a1451300ee..09df753b51 100644 --- a/pxr/usdImaging/usdviewq/plugin.py +++ b/pxr/usdImaging/usdviewq/plugin.py @@ -1,25 +1,8 @@ # # Copyright 2018 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # from __future__ import print_function diff --git a/pxr/usdImaging/usdviewq/preferences.py b/pxr/usdImaging/usdviewq/preferences.py index 5ccdcbef04..eac4186578 100644 --- a/pxr/usdImaging/usdviewq/preferences.py +++ b/pxr/usdImaging/usdviewq/preferences.py @@ -1,25 +1,8 @@ # # Copyright 2016 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # from .qt import QtCore, QtGui, QtWidgets from .preferencesUI import Ui_Preferences diff --git a/pxr/usdImaging/usdviewq/preferencesUI.ui b/pxr/usdImaging/usdviewq/preferencesUI.ui index 8bbe89e0bd..849e588600 100644 --- a/pxr/usdImaging/usdviewq/preferencesUI.ui +++ b/pxr/usdImaging/usdviewq/preferencesUI.ui @@ -17,25 +17,8 @@ Copyright 2020 Pixar - Licensed under the Apache License, Version 2.0 (the "Apache License") - with the following modification; you may not use this file except in - compliance with the Apache License and the following modification to it: - Section 6. Trademarks. is deleted and replaced with: - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor - and its affiliates, except as required to comply with Section 4(c) of - the License and to reproduce the content of the NOTICE file. - - You may obtain a copy of the Apache License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the Apache License with the above modification is - distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the Apache License for the specific - language governing permissions and limitations under the Apache License. + Licensed under the terms set forth in the LICENSE.txt file available at + https://openusd.org/license. diff --git a/pxr/usdImaging/usdviewq/prettyPrint.py b/pxr/usdImaging/usdviewq/prettyPrint.py index 3c2d59ac72..b397151540 100644 --- a/pxr/usdImaging/usdviewq/prettyPrint.py +++ b/pxr/usdImaging/usdviewq/prettyPrint.py @@ -1,25 +1,8 @@ # # Copyright 2016 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # ''' Hopefully we can deprecate this since most of the array stuff is handled by the diff --git a/pxr/usdImaging/usdviewq/primContextMenu.py b/pxr/usdImaging/usdviewq/primContextMenu.py index e7173c31e4..f3c43bd3d2 100644 --- a/pxr/usdImaging/usdviewq/primContextMenu.py +++ b/pxr/usdImaging/usdviewq/primContextMenu.py @@ -1,25 +1,8 @@ # # Copyright 2016 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # from .qt import QtWidgets from .primContextMenuItems import _GetContextMenuItems diff --git a/pxr/usdImaging/usdviewq/primContextMenuItems.py b/pxr/usdImaging/usdviewq/primContextMenuItems.py index de5560a3a7..c571ff5e07 100644 --- a/pxr/usdImaging/usdviewq/primContextMenuItems.py +++ b/pxr/usdImaging/usdviewq/primContextMenuItems.py @@ -1,25 +1,8 @@ # # Copyright 2016 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # from __future__ import print_function diff --git a/pxr/usdImaging/usdviewq/primLegend.py b/pxr/usdImaging/usdviewq/primLegend.py index 3c293f6247..2943fda2a8 100644 --- a/pxr/usdImaging/usdviewq/primLegend.py +++ b/pxr/usdImaging/usdviewq/primLegend.py @@ -1,25 +1,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # from .qt import QtWidgets diff --git a/pxr/usdImaging/usdviewq/primLegendUI.ui b/pxr/usdImaging/usdviewq/primLegendUI.ui index c439f840ed..f8572e87ef 100644 --- a/pxr/usdImaging/usdviewq/primLegendUI.ui +++ b/pxr/usdImaging/usdviewq/primLegendUI.ui @@ -20,25 +20,8 @@ Copyright 2017 Pixar - Licensed under the Apache License, Version 2.0 (the "Apache License") - with the following modification; you may not use this file except in - compliance with the Apache License and the following modification to it: - Section 6. Trademarks. is deleted and replaced with: - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor - and its affiliates, except as required to comply with Section 4(c) of - the License and to reproduce the content of the NOTICE file. - - You may obtain a copy of the Apache License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the Apache License with the above modification is - distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the Apache License for the specific - language governing permissions and limitations under the Apache License. + Licensed under the terms set forth in the LICENSE.txt file available at + https://openusd.org/license. diff --git a/pxr/usdImaging/usdviewq/primTreeWidget.py b/pxr/usdImaging/usdviewq/primTreeWidget.py index 8e1b466496..578196fc27 100644 --- a/pxr/usdImaging/usdviewq/primTreeWidget.py +++ b/pxr/usdImaging/usdviewq/primTreeWidget.py @@ -1,25 +1,8 @@ # # Copyright 2018 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # from .qt import QtCore, QtGui, QtWidgets from pxr.UsdUtils.constantsGroup import ConstantsGroup diff --git a/pxr/usdImaging/usdviewq/primViewItem.py b/pxr/usdImaging/usdviewq/primViewItem.py index aa85b0a5f2..cb2a6e5bc5 100644 --- a/pxr/usdImaging/usdviewq/primViewItem.py +++ b/pxr/usdImaging/usdviewq/primViewItem.py @@ -1,25 +1,8 @@ # # Copyright 2016 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # from __future__ import print_function diff --git a/pxr/usdImaging/usdviewq/propertyLegend.py b/pxr/usdImaging/usdviewq/propertyLegend.py index 900f04437e..e2a94840ef 100644 --- a/pxr/usdImaging/usdviewq/propertyLegend.py +++ b/pxr/usdImaging/usdviewq/propertyLegend.py @@ -1,25 +1,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # """ This module provides the help dialog(also known as the property legend) in Usdview's MainWindow. This provides a key describing the items displayed diff --git a/pxr/usdImaging/usdviewq/propertyLegendUI.ui b/pxr/usdImaging/usdviewq/propertyLegendUI.ui index ceda6eb77d..f61afe83f5 100644 --- a/pxr/usdImaging/usdviewq/propertyLegendUI.ui +++ b/pxr/usdImaging/usdviewq/propertyLegendUI.ui @@ -23,25 +23,8 @@ Copyright 2017 Pixar - Licensed under the Apache License, Version 2.0 (the "Apache License") - with the following modification; you may not use this file except in - compliance with the Apache License and the following modification to it: - Section 6. Trademarks. is deleted and replaced with: - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor - and its affiliates, except as required to comply with Section 4(c) of - the License and to reproduce the content of the NOTICE file. - - You may obtain a copy of the Apache License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the Apache License with the above modification is - distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the Apache License for the specific - language governing permissions and limitations under the Apache License. + Licensed under the terms set forth in the LICENSE.txt file available at + https://openusd.org/license. diff --git a/pxr/usdImaging/usdviewq/pythonInterpreter.py b/pxr/usdImaging/usdviewq/pythonInterpreter.py index e2205f897f..bdf7869397 100644 --- a/pxr/usdImaging/usdviewq/pythonInterpreter.py +++ b/pxr/usdImaging/usdviewq/pythonInterpreter.py @@ -1,25 +1,8 @@ # # Copyright 2016 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # # pylint: disable=dict-keys-not-iterating diff --git a/pxr/usdImaging/usdviewq/qt.py b/pxr/usdImaging/usdviewq/qt.py index ee963144b3..220cf5602a 100644 --- a/pxr/usdImaging/usdviewq/qt.py +++ b/pxr/usdImaging/usdviewq/qt.py @@ -1,25 +1,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # def GetPySideModule(): """Returns name of PySide module used by usdview, diff --git a/pxr/usdImaging/usdviewq/rootDataModel.py b/pxr/usdImaging/usdviewq/rootDataModel.py index 9e9d0c28eb..911caa098b 100644 --- a/pxr/usdImaging/usdviewq/rootDataModel.py +++ b/pxr/usdImaging/usdviewq/rootDataModel.py @@ -1,25 +1,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # from pxr import Usd, UsdGeom, UsdShade diff --git a/pxr/usdImaging/usdviewq/scalarTypes.py b/pxr/usdImaging/usdviewq/scalarTypes.py index db09af644f..d776847bd2 100644 --- a/pxr/usdImaging/usdviewq/scalarTypes.py +++ b/pxr/usdImaging/usdviewq/scalarTypes.py @@ -1,25 +1,8 @@ # # Copyright 2016 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # def GetScalarTypeFromAttr(attr): ''' diff --git a/pxr/usdImaging/usdviewq/selectionDataModel.py b/pxr/usdImaging/usdviewq/selectionDataModel.py index 9f7ba7d5f0..8828241947 100644 --- a/pxr/usdImaging/usdviewq/selectionDataModel.py +++ b/pxr/usdImaging/usdviewq/selectionDataModel.py @@ -1,25 +1,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # from collections import OrderedDict diff --git a/pxr/usdImaging/usdviewq/settings.py b/pxr/usdImaging/usdviewq/settings.py index c851998cf7..efaf55f4ff 100644 --- a/pxr/usdImaging/usdviewq/settings.py +++ b/pxr/usdImaging/usdviewq/settings.py @@ -1,25 +1,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # # pylint: disable=unicode-builtin diff --git a/pxr/usdImaging/usdviewq/stageView.py b/pxr/usdImaging/usdviewq/stageView.py index 8798997304..e34b1cafef 100644 --- a/pxr/usdImaging/usdviewq/stageView.py +++ b/pxr/usdImaging/usdviewq/stageView.py @@ -1,25 +1,8 @@ # # Copyright 2016 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # # pylint: disable=dict-keys-not-iterating @@ -824,6 +807,13 @@ def rendererDisplayName(self): def rendererAovName(self): return self._rendererAovName + @property + def bboxstandin(self): + return self._bboxstandin + + @bboxstandin.setter + def bboxstandin(self, value): + self._bboxstandin = bool(value) @property def allowAsync(self): @@ -943,6 +933,7 @@ def __init__(self, parent=None, dataModel=None, makeTimer=Timer): self._vao = 0 self._allowAsync = False + self._bboxstandin = False # Update all properties for the current stage. self._stageReplaced() @@ -956,6 +947,7 @@ def _getRenderer(self): if self.isContextInitialised(): params = UsdImagingGL.Engine.Parameters() params.allowAsynchronousSceneProcessing = self._allowAsync + params.displayUnloadedPrimsWithBounds = self._bboxstandin self._renderer = UsdImagingGL.Engine(params) self._handleRendererChanged(self.GetCurrentRendererId()) elif not self._reportedContextError: @@ -1710,6 +1702,9 @@ def paintGL(self): viewProjectionMatrix = Gf.Matrix4f(frustum.ComputeViewMatrix() * frustum.ComputeProjectionMatrix()) + # Workaround an apparent bug in some recent versions of PySide6 + GL.glDepthMask(GL.GL_TRUE) + GL.glClear(GL.GL_COLOR_BUFFER_BIT|GL.GL_DEPTH_BUFFER_BIT) # ensure viewport is right for the camera framing @@ -1732,6 +1727,7 @@ def paintGL(self): l = Glf.SimpleLight() l.ambient = (0, 0, 0, 0) l.position = (cam_pos[0], cam_pos[1], cam_pos[2], 1) + l.transform = frustum.ComputeViewInverse() lights.append(l) # Default Dome Light @@ -2182,6 +2178,9 @@ def pick(self, pickFrustum): # Need a correct OpenGL Rendering context for FBOs self.makeCurrent() + # Workaround an apparent bug in some recent versions of PySide6 + GL.glDepthMask(GL.GL_TRUE) + # update rendering parameters self._renderParams.frame = self._dataModel.currentFrame self._renderParams.complexity = self._dataModel.viewSettings.complexity.value diff --git a/pxr/usdImaging/usdviewq/testenv/testUsdviewqLauncher.py b/pxr/usdImaging/usdviewq/testenv/testUsdviewqLauncher.py index e6270a8cb9..b1af5f32d0 100644 --- a/pxr/usdImaging/usdviewq/testenv/testUsdviewqLauncher.py +++ b/pxr/usdImaging/usdviewq/testenv/testUsdviewqLauncher.py @@ -2,25 +2,8 @@ # # Copyright 2018 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # import unittest @@ -53,7 +36,12 @@ def ParseOptions(self, parser): return parser.parse_args(self._args) - def _Launcher__LaunchProcess(self, arg_parse_result): + def LaunchPreamble(self, arg_parse_result): + """Do nothing. We don't want to launch the main application.""" + + return (None, None) + + def LaunchProcess(self, arg_parse_result, app, appController): """Do nothing. We don't want to launch the main application.""" return diff --git a/pxr/usdImaging/usdviewq/testenv/testUsdviewqRootDataModel.py b/pxr/usdImaging/usdviewq/testenv/testUsdviewqRootDataModel.py index d96c789d08..483c0dbe24 100644 --- a/pxr/usdImaging/usdviewq/testenv/testUsdviewqRootDataModel.py +++ b/pxr/usdImaging/usdviewq/testenv/testUsdviewqRootDataModel.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # import unittest diff --git a/pxr/usdImaging/usdviewq/testenv/testUsdviewqSelectionDataModel.py b/pxr/usdImaging/usdviewq/testenv/testUsdviewqSelectionDataModel.py index 0dcffea821..b4b3cd26f4 100644 --- a/pxr/usdImaging/usdviewq/testenv/testUsdviewqSelectionDataModel.py +++ b/pxr/usdImaging/usdviewq/testenv/testUsdviewqSelectionDataModel.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # import unittest diff --git a/pxr/usdImaging/usdviewq/testenv/testUsdviewqSettings.py b/pxr/usdImaging/usdviewq/testenv/testUsdviewqSettings.py index 7a8fddf96f..72f61b2cf1 100644 --- a/pxr/usdImaging/usdviewq/testenv/testUsdviewqSettings.py +++ b/pxr/usdImaging/usdviewq/testenv/testUsdviewqSettings.py @@ -2,25 +2,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # import unittest diff --git a/pxr/usdImaging/usdviewq/testenv/testUsdviewqViewSettingsDataModel.py b/pxr/usdImaging/usdviewq/testenv/testUsdviewqViewSettingsDataModel.py index 040b9c3032..8a68facf35 100644 --- a/pxr/usdImaging/usdviewq/testenv/testUsdviewqViewSettingsDataModel.py +++ b/pxr/usdImaging/usdviewq/testenv/testUsdviewqViewSettingsDataModel.py @@ -2,25 +2,8 @@ # # Copyright 2018 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # import unittest diff --git a/pxr/usdImaging/usdviewq/usdviewApi.py b/pxr/usdImaging/usdviewq/usdviewApi.py index fcc696491e..bd8f019fd4 100644 --- a/pxr/usdImaging/usdviewq/usdviewApi.py +++ b/pxr/usdImaging/usdviewq/usdviewApi.py @@ -2,25 +2,8 @@ # # Copyright 2016 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to # it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) # of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF # ANY -# KIND, either express or implied. See the Apache License for the # specific -# language governing permissions and limitations under the Apache # License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. import types diff --git a/pxr/usdImaging/usdviewq/usdviewContextMenuItem.py b/pxr/usdImaging/usdviewq/usdviewContextMenuItem.py index 3bd9c55d3e..6d19e83ee9 100644 --- a/pxr/usdImaging/usdviewq/usdviewContextMenuItem.py +++ b/pxr/usdImaging/usdviewq/usdviewContextMenuItem.py @@ -1,25 +1,8 @@ # # Copyright 2016 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # # # A base class for all context menu items. diff --git a/pxr/usdImaging/usdviewq/utils.cpp b/pxr/usdImaging/usdviewq/utils.cpp index 11b07a9691..aed6f7164c 100644 --- a/pxr/usdImaging/usdviewq/utils.cpp +++ b/pxr/usdImaging/usdviewq/utils.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdviewq/utils.h" #include "pxr/base/plug/registry.h" diff --git a/pxr/usdImaging/usdviewq/utils.h b/pxr/usdImaging/usdviewq/utils.h index 5f515bf7ee..086e803874 100644 --- a/pxr/usdImaging/usdviewq/utils.h +++ b/pxr/usdImaging/usdviewq/utils.h @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef PXR_USD_IMAGING_USDVIEWQ_UTILS_H #define PXR_USD_IMAGING_USDVIEWQ_UTILS_H diff --git a/pxr/usdImaging/usdviewq/variantComboBox.py b/pxr/usdImaging/usdviewq/variantComboBox.py index 77ed95230e..123fdb769b 100644 --- a/pxr/usdImaging/usdviewq/variantComboBox.py +++ b/pxr/usdImaging/usdviewq/variantComboBox.py @@ -1,25 +1,8 @@ # # Copyright 2017 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # from .qt import QtCore, QtGui, QtWidgets diff --git a/pxr/usdImaging/usdviewq/viewSettingsDataModel.py b/pxr/usdImaging/usdviewq/viewSettingsDataModel.py index 1d67852cdc..f7db5d6c01 100644 --- a/pxr/usdImaging/usdviewq/viewSettingsDataModel.py +++ b/pxr/usdImaging/usdviewq/viewSettingsDataModel.py @@ -1,25 +1,8 @@ # # Copyright 2018 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # from .qt import QtCore diff --git a/pxr/usdImaging/usdviewq/wrapHydraObserver.cpp b/pxr/usdImaging/usdviewq/wrapHydraObserver.cpp index 99aa8889bb..327aa88eae 100644 --- a/pxr/usdImaging/usdviewq/wrapHydraObserver.cpp +++ b/pxr/usdImaging/usdviewq/wrapHydraObserver.cpp @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/usdImaging/usdviewq/hydraObserver.h" diff --git a/pxr/usdImaging/usdviewq/wrapUtils.cpp b/pxr/usdImaging/usdviewq/wrapUtils.cpp index 954c961a06..122f1c3b61 100644 --- a/pxr/usdImaging/usdviewq/wrapUtils.cpp +++ b/pxr/usdImaging/usdviewq/wrapUtils.cpp @@ -1,25 +1,8 @@ // // Copyright 2016 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/usdImaging/usdviewq/utils.h" diff --git a/third_party/renderman-25/plugin/CMakeLists.txt b/third_party/renderman-25/plugin/CMakeLists.txt index 403e537358..a5e87dbdfd 100644 --- a/third_party/renderman-25/plugin/CMakeLists.txt +++ b/third_party/renderman-25/plugin/CMakeLists.txt @@ -1,7 +1,7 @@ add_subdirectory(rmanArgsParser) add_subdirectory(rmanDiscovery) add_subdirectory(hdPrman) -add_subdirectory(rtx_glfImage) +add_subdirectory(rtx_hioImage) add_subdirectory(usdRiPxr) # Only build rmanOslParser when sdrOsl is disabled # This allows hdPrman to render OSL files without OSL pre-installed diff --git a/third_party/renderman-25/plugin/hdPrman/CMakeLists.txt b/third_party/renderman-25/plugin/hdPrman/CMakeLists.txt index bf87efa5d2..262062aa7d 100644 --- a/third_party/renderman-25/plugin/hdPrman/CMakeLists.txt +++ b/third_party/renderman-25/plugin/hdPrman/CMakeLists.txt @@ -115,6 +115,7 @@ pxr_plugin(${PXR_PACKAGE} rileyFallbackMaterialSceneIndexPlugin rileyGeometryInstanceSchema rileyGeometryPrototypeSchema + rileyGlobalsSchema rileyIntegratorSchema rileyLightInstanceSchema rileyLightShaderSchema @@ -150,6 +151,8 @@ pxr_plugin(${PXR_PACKAGE} renderBuffer renderParam renderPass + renderPassSceneIndex + renderPassSceneIndexPlugin renderSettingsFilteringSceneIndexPlugin renderViewContext resourceRegistry @@ -161,6 +164,7 @@ pxr_plugin(${PXR_PACKAGE} rileyDisplayPrim rileyGeometryInstancePrim rileyGeometryPrototypePrim + rileyGlobalsPrim rileyIntegratorPrim rileyLightInstancePrim rileyLightShaderPrim @@ -191,6 +195,7 @@ pxr_plugin(${PXR_PACKAGE} virtualStructConditionalGrammar.tab.h CPPFILES + lightLinkingSceneIndexPlugin.cpp rendererPlugin.cpp virtualStructConditionalGrammar.lex.cpp virtualStructConditionalGrammar.tab.cpp diff --git a/third_party/renderman-25/plugin/hdPrman/api.h b/third_party/renderman-25/plugin/hdPrman/api.h index 2a1fc69fd7..c0b72141c7 100644 --- a/third_party/renderman-25/plugin/hdPrman/api.h +++ b/third_party/renderman-25/plugin/hdPrman/api.h @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_API_H #define EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_API_H diff --git a/third_party/renderman-25/plugin/hdPrman/basisCurves.cpp b/third_party/renderman-25/plugin/hdPrman/basisCurves.cpp index 62e5bbb570..c30d05a65e 100644 --- a/third_party/renderman-25/plugin/hdPrman/basisCurves.cpp +++ b/third_party/renderman-25/plugin/hdPrman/basisCurves.cpp @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include // for std::iota #include "hdPrman/basisCurves.h" diff --git a/third_party/renderman-25/plugin/hdPrman/basisCurves.h b/third_party/renderman-25/plugin/hdPrman/basisCurves.h index 1b7f358458..25f8702bb0 100644 --- a/third_party/renderman-25/plugin/hdPrman/basisCurves.h +++ b/third_party/renderman-25/plugin/hdPrman/basisCurves.h @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_BASIS_CURVES_H #define EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_BASIS_CURVES_H diff --git a/third_party/renderman-25/plugin/hdPrman/camera.cpp b/third_party/renderman-25/plugin/hdPrman/camera.cpp index c66b288606..7ce89f71db 100644 --- a/third_party/renderman-25/plugin/hdPrman/camera.cpp +++ b/third_party/renderman-25/plugin/hdPrman/camera.cpp @@ -1,31 +1,16 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "hdPrman/camera.h" #include "hdPrman/cameraContext.h" #include "pxr/imaging/hd/sceneDelegate.h" +#include + PXR_NAMESPACE_OPEN_SCOPE #if HD_API_VERSION < 52 @@ -51,37 +36,24 @@ TF_DEFINE_PRIVATE_TOKENS( ((apertureRoundness, "ri:apertureRoundness")) ); -namespace { - -const HdPrmanCamera::ShutterCurve& -_GetFallbackShutterCurve( - bool interactive) +static +std::optional> +_ToOptionalFloat8(const VtValue &value) { - if (interactive) { - // Open instantaneously, remain fully open for the duration of the - // shutter interval (set via the param RixStr.k_Ri_Shutter) and close - // instantaneously. - static const HdPrmanCamera::ShutterCurve interactiveFallback = { - 0.0, - 1.0, - { 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f }}; - - return interactiveFallback; + if (!value.IsHolding>()) { + return std::nullopt; } - - // Open instantaneously and start closing immediately, rapidly at first - // decelerating until the end of the interval. - static const HdPrmanCamera::ShutterCurve batchFallback = { - 0.0, - 0.0, - { 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.3f, 0.0f }}; - - return batchFallback; + const VtArray array = value.UncheckedGet>(); + if (array.size() != 8) { + return std::nullopt; + } + std::array result; + for (size_t i = 0; i < 8; i++) { + result[i] = array[i]; + } + return result; } -} // anon - - HdPrmanCamera::HdPrmanCamera(SdfPath const& id) : HdCamera(id) #if HD_API_VERSION < 52 @@ -92,7 +64,6 @@ HdPrmanCamera::HdPrmanCamera(SdfPath const& id) , _lensDistortionAsym(0.0f) , _lensDistortionScale(1.0f) #endif - , _shutterCurve(_GetFallbackShutterCurve(/*isInteractive = */true)) , _apertureAngle(0.0f) , _apertureDensity(0.0f) , _apertureNSides(0) @@ -162,24 +133,23 @@ HdPrmanCamera::Sync(HdSceneDelegate *sceneDelegate, const VtValue vShutterOpenTime = sceneDelegate->GetCameraParamValue(id, _tokens->shutterOpenTime); + if (vShutterOpenTime.IsHolding()) { + _shutterCurve.shutterOpenTime = + vShutterOpenTime.UncheckedGet(); + } else { + _shutterCurve.shutterOpenTime = std::nullopt; + } const VtValue vShutterCloseTime = sceneDelegate->GetCameraParamValue(id, _tokens->shutterCloseTime); - const VtValue vShutteropening = - sceneDelegate->GetCameraParamValue(id, _tokens->shutteropening); - - if (vShutterOpenTime.IsHolding() && - vShutterCloseTime.IsHolding() && - vShutteropening.IsHolding>()) { - - _shutterCurve = { - vShutterOpenTime.UncheckedGet(), - vShutterCloseTime.UncheckedGet(), - vShutteropening.UncheckedGet>() - }; - + if (vShutterCloseTime.IsHolding()) { + _shutterCurve.shutterCloseTime = + vShutterCloseTime.UncheckedGet(); } else { - _shutterCurve = _GetFallbackShutterCurve(param->IsInteractive()); + _shutterCurve.shutterCloseTime = std::nullopt; } + const VtValue vShutteropening = + sceneDelegate->GetCameraParamValue(id, _tokens->shutteropening); + _shutterCurve.shutteropening = _ToOptionalFloat8(vShutteropening); _apertureAngle = sceneDelegate->GetCameraParamValue(id, _tokens->apertureAngle) diff --git a/third_party/renderman-25/plugin/hdPrman/camera.h b/third_party/renderman-25/plugin/hdPrman/camera.h index ca8d898772..dee7304338 100644 --- a/third_party/renderman-25/plugin/hdPrman/camera.h +++ b/third_party/renderman-25/plugin/hdPrman/camera.h @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_CAMERA_H #define EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_CAMERA_H @@ -32,6 +15,8 @@ #include "pxr/base/vt/array.h" +#include + PXR_NAMESPACE_OPEN_SCOPE class HdSceneDelegate; @@ -52,9 +37,9 @@ class HdPrmanCamera final : public HdCamera /// struct ShutterCurve { - float shutterOpenTime; - float shutterCloseTime; - VtArray shutteropening; + std::optional shutterOpenTime; + std::optional shutterCloseTime; + std::optional> shutteropening; }; HDPRMAN_API diff --git a/third_party/renderman-25/plugin/hdPrman/cameraContext.cpp b/third_party/renderman-25/plugin/hdPrman/cameraContext.cpp index 4dcfec0656..8ea28e1a10 100644 --- a/third_party/renderman-25/plugin/hdPrman/cameraContext.cpp +++ b/third_party/renderman-25/plugin/hdPrman/cameraContext.cpp @@ -1,25 +1,8 @@ // // Copyright 2021 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "hdPrman/cameraContext.h" @@ -389,13 +372,21 @@ HdPrman_CameraContext::_ComputeCameraParams( dynamic_cast(camera); const HdPrmanCamera::ShutterCurve &shutterCurve = hdPrmanCamera->GetShutterCurve(); - - result.SetFloat(RixStr.k_shutterOpenTime, shutterCurve.shutterOpenTime); - result.SetFloat(RixStr.k_shutterCloseTime, shutterCurve.shutterCloseTime); - result.SetFloatArray( - RixStr.k_shutteropening, - shutterCurve.shutteropening.data(), - shutterCurve.shutteropening.size()); + + if (shutterCurve.shutterOpenTime) { + result.SetFloat( + RixStr.k_shutterOpenTime, *shutterCurve.shutterOpenTime); + } + if (shutterCurve.shutterCloseTime) { + result.SetFloat( + RixStr.k_shutterCloseTime, *shutterCurve.shutterCloseTime); + } + if (shutterCurve.shutteropening) { + result.SetFloatArray( + RixStr.k_shutteropening, + shutterCurve.shutteropening->data(), + shutterCurve.shutteropening->size()); + } result.SetFloat(RixStr.k_apertureAngle, hdPrmanCamera->GetApertureAngle()); diff --git a/third_party/renderman-25/plugin/hdPrman/cameraContext.h b/third_party/renderman-25/plugin/hdPrman/cameraContext.h index 0170a7203f..8517826f64 100644 --- a/third_party/renderman-25/plugin/hdPrman/cameraContext.h +++ b/third_party/renderman-25/plugin/hdPrman/cameraContext.h @@ -1,25 +1,8 @@ // // Copyright 2021 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_CAMERA_CONTEXT_H #define EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_CAMERA_CONTEXT_H diff --git a/third_party/renderman-25/plugin/hdPrman/codegenTemplates/rileyPrim.cpp b/third_party/renderman-25/plugin/hdPrman/codegenTemplates/rileyPrim.cpp index 14803f74f4..50f155cf75 100644 --- a/third_party/renderman-25/plugin/hdPrman/codegenTemplates/rileyPrim.cpp +++ b/third_party/renderman-25/plugin/hdPrman/codegenTemplates/rileyPrim.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/third_party/renderman-25/plugin/hdPrman/codegenTemplates/rileyPrim.h b/third_party/renderman-25/plugin/hdPrman/codegenTemplates/rileyPrim.h index 8377f0083f..2db6a73851 100644 --- a/third_party/renderman-25/plugin/hdPrman/codegenTemplates/rileyPrim.h +++ b/third_party/renderman-25/plugin/hdPrman/codegenTemplates/rileyPrim.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/third_party/renderman-25/plugin/hdPrman/cone.cpp b/third_party/renderman-25/plugin/hdPrman/cone.cpp index 47e21a3335..3e2493f381 100644 --- a/third_party/renderman-25/plugin/hdPrman/cone.cpp +++ b/third_party/renderman-25/plugin/hdPrman/cone.cpp @@ -3,25 +3,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "hdPrman/cone.h" diff --git a/third_party/renderman-25/plugin/hdPrman/cone.h b/third_party/renderman-25/plugin/hdPrman/cone.h index 3b7b49bf79..2ab400ff05 100644 --- a/third_party/renderman-25/plugin/hdPrman/cone.h +++ b/third_party/renderman-25/plugin/hdPrman/cone.h @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_CONE_H #define EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_CONE_H diff --git a/third_party/renderman-25/plugin/hdPrman/coordSys.cpp b/third_party/renderman-25/plugin/hdPrman/coordSys.cpp index d7d007a4d8..2882979709 100644 --- a/third_party/renderman-25/plugin/hdPrman/coordSys.cpp +++ b/third_party/renderman-25/plugin/hdPrman/coordSys.cpp @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "hdPrman/coordSys.h" #include "hdPrman/renderParam.h" diff --git a/third_party/renderman-25/plugin/hdPrman/coordSys.h b/third_party/renderman-25/plugin/hdPrman/coordSys.h index ba05f81ea7..5b86390d31 100644 --- a/third_party/renderman-25/plugin/hdPrman/coordSys.h +++ b/third_party/renderman-25/plugin/hdPrman/coordSys.h @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_COORD_SYS_H #define EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_COORD_SYS_H diff --git a/third_party/renderman-25/plugin/hdPrman/coordSysPrimSceneIndexPlugin.cpp b/third_party/renderman-25/plugin/hdPrman/coordSysPrimSceneIndexPlugin.cpp index 896ce7d5df..e64ea31731 100644 --- a/third_party/renderman-25/plugin/hdPrman/coordSysPrimSceneIndexPlugin.cpp +++ b/third_party/renderman-25/plugin/hdPrman/coordSysPrimSceneIndexPlugin.cpp @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. #include "hdPrman/coordSysPrimSceneIndexPlugin.h" diff --git a/third_party/renderman-25/plugin/hdPrman/coordSysPrimSceneIndexPlugin.h b/third_party/renderman-25/plugin/hdPrman/coordSysPrimSceneIndexPlugin.h index 398480ae3b..e52f12f9b3 100644 --- a/third_party/renderman-25/plugin/hdPrman/coordSysPrimSceneIndexPlugin.h +++ b/third_party/renderman-25/plugin/hdPrman/coordSysPrimSceneIndexPlugin.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. #ifndef PXR_IMAGING_HDPRMAN_COORD_SYS_PRIM_SCENE_INDEX_PLUGIN_H #define PXR_IMAGING_HDPRMAN_COORD_SYS_PRIM_SCENE_INDEX_PLUGIN_H diff --git a/third_party/renderman-25/plugin/hdPrman/cylinder.cpp b/third_party/renderman-25/plugin/hdPrman/cylinder.cpp index 3b9b95761b..d07f34977e 100644 --- a/third_party/renderman-25/plugin/hdPrman/cylinder.cpp +++ b/third_party/renderman-25/plugin/hdPrman/cylinder.cpp @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "hdPrman/cylinder.h" diff --git a/third_party/renderman-25/plugin/hdPrman/cylinder.h b/third_party/renderman-25/plugin/hdPrman/cylinder.h index 09cdbd867f..9c46935555 100644 --- a/third_party/renderman-25/plugin/hdPrman/cylinder.h +++ b/third_party/renderman-25/plugin/hdPrman/cylinder.h @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_CYLINDER_H #define EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_CYLINDER_H diff --git a/third_party/renderman-25/plugin/hdPrman/debugCodes.cpp b/third_party/renderman-25/plugin/hdPrman/debugCodes.cpp index 013966389a..03211fa400 100644 --- a/third_party/renderman-25/plugin/hdPrman/debugCodes.cpp +++ b/third_party/renderman-25/plugin/hdPrman/debugCodes.cpp @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "hdPrman/debugCodes.h" diff --git a/third_party/renderman-25/plugin/hdPrman/debugCodes.h b/third_party/renderman-25/plugin/hdPrman/debugCodes.h index efdafcc7d8..058f007196 100644 --- a/third_party/renderman-25/plugin/hdPrman/debugCodes.h +++ b/third_party/renderman-25/plugin/hdPrman/debugCodes.h @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_DEBUG_CODES_H #define EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_DEBUG_CODES_H diff --git a/third_party/renderman-25/plugin/hdPrman/debugUtil.cpp b/third_party/renderman-25/plugin/hdPrman/debugUtil.cpp index 20bdfa41c3..0c2862fa14 100644 --- a/third_party/renderman-25/plugin/hdPrman/debugUtil.cpp +++ b/third_party/renderman-25/plugin/hdPrman/debugUtil.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "hdPrman/debugUtil.h" diff --git a/third_party/renderman-25/plugin/hdPrman/debugUtil.h b/third_party/renderman-25/plugin/hdPrman/debugUtil.h index a5373c13b3..0411ff2169 100644 --- a/third_party/renderman-25/plugin/hdPrman/debugUtil.h +++ b/third_party/renderman-25/plugin/hdPrman/debugUtil.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_DEBUG_UTIL_H #define EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_DEBUG_UTIL_H diff --git a/third_party/renderman-25/plugin/hdPrman/dependencyForwardingSceneIndexPlugin.cpp b/third_party/renderman-25/plugin/hdPrman/dependencyForwardingSceneIndexPlugin.cpp index 86c34f79c5..dd3433f1f7 100644 --- a/third_party/renderman-25/plugin/hdPrman/dependencyForwardingSceneIndexPlugin.cpp +++ b/third_party/renderman-25/plugin/hdPrman/dependencyForwardingSceneIndexPlugin.cpp @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. #include "hdPrman/dependencyForwardingSceneIndexPlugin.h" diff --git a/third_party/renderman-25/plugin/hdPrman/dependencyForwardingSceneIndexPlugin.h b/third_party/renderman-25/plugin/hdPrman/dependencyForwardingSceneIndexPlugin.h index 64f00faaed..22efb671f7 100644 --- a/third_party/renderman-25/plugin/hdPrman/dependencyForwardingSceneIndexPlugin.h +++ b/third_party/renderman-25/plugin/hdPrman/dependencyForwardingSceneIndexPlugin.h @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. #ifndef PXR_IMAGING_HDPRMAN_DEPENDENCY_FORWARDING_SCENE_INDEX_PLUGIN_H #define PXR_IMAGING_HDPRMAN_DEPENDENCY_FORWARDING_SCENE_INDEX_PLUGIN_H diff --git a/third_party/renderman-25/plugin/hdPrman/displayFilter.cpp b/third_party/renderman-25/plugin/hdPrman/displayFilter.cpp index 8b7eefcb13..28e7f54279 100644 --- a/third_party/renderman-25/plugin/hdPrman/displayFilter.cpp +++ b/third_party/renderman-25/plugin/hdPrman/displayFilter.cpp @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "hdPrman/displayFilter.h" diff --git a/third_party/renderman-25/plugin/hdPrman/displayFilter.h b/third_party/renderman-25/plugin/hdPrman/displayFilter.h index f17ef6bd92..0a6f111ddb 100644 --- a/third_party/renderman-25/plugin/hdPrman/displayFilter.h +++ b/third_party/renderman-25/plugin/hdPrman/displayFilter.h @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_DISPLAY_FILTER_H #define EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_DISPLAY_FILTER_H diff --git a/third_party/renderman-25/plugin/hdPrman/extComputationPrimvarPruningSceneIndexPlugin.cpp b/third_party/renderman-25/plugin/hdPrman/extComputationPrimvarPruningSceneIndexPlugin.cpp index 6f089660fb..42e0759070 100644 --- a/third_party/renderman-25/plugin/hdPrman/extComputationPrimvarPruningSceneIndexPlugin.cpp +++ b/third_party/renderman-25/plugin/hdPrman/extComputationPrimvarPruningSceneIndexPlugin.cpp @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "hdPrman/extComputationPrimvarPruningSceneIndexPlugin.h" diff --git a/third_party/renderman-25/plugin/hdPrman/extComputationPrimvarPruningSceneIndexPlugin.h b/third_party/renderman-25/plugin/hdPrman/extComputationPrimvarPruningSceneIndexPlugin.h index 9123278784..686ac5e6c9 100644 --- a/third_party/renderman-25/plugin/hdPrman/extComputationPrimvarPruningSceneIndexPlugin.h +++ b/third_party/renderman-25/plugin/hdPrman/extComputationPrimvarPruningSceneIndexPlugin.h @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_EXT_COMPUTATION_PRIMVAR_PRUNING_SCENE_INDEX_PLUGIN_H #define EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_EXT_COMPUTATION_PRIMVAR_PRUNING_SCENE_INDEX_PLUGIN_H diff --git a/third_party/renderman-25/plugin/hdPrman/framebuffer.cpp b/third_party/renderman-25/plugin/hdPrman/framebuffer.cpp index 154de99bf4..8454743785 100644 --- a/third_party/renderman-25/plugin/hdPrman/framebuffer.cpp +++ b/third_party/renderman-25/plugin/hdPrman/framebuffer.cpp @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "framebuffer.h" @@ -567,7 +550,9 @@ class DisplayHydra final : public display::Display m_height(0), m_surface(nullptr), m_alphaOffset(k_invalidOffset), +#if !defined(DISPLAY_INTERFACE_VERSION) || DISPLAY_INTERFACE_VERSION < 2 m_weightsOffset(k_invalidOffset), +#endif m_buf(nullptr) { int bufferID = 0; @@ -578,25 +563,31 @@ class DisplayHydra final : public display::Display ~DisplayHydra() override = default; // Display interface - bool Rebind(const uint32_t width, const uint32_t height, - const char* /*srfaddrhandle*/, const void* srfaddr, - const size_t /*srfsizebytes*/, const size_t weightsoffset, - const size_t* offsets, const display::RenderOutput* outputs, + bool Rebind(const uint32_t width, const uint32_t height, const char* /*srfaddrhandle*/, +#if !defined(DISPLAY_INTERFACE_VERSION) || DISPLAY_INTERFACE_VERSION < 2 + const void* srfaddr, const size_t /*srfsizebytes*/, const size_t weightsoffset, + const size_t* srfoffsets, const display::RenderOutput* outputs, +#else + const void* srfaddr, const size_t /*srfsizebytes*/, const size_t* srfoffsets, + const size_t* /*sampleoffsets*/, const display::RenderOutput* outputs, +#endif const size_t noutputs) override { m_surface = static_cast(srfaddr); m_width = width; m_height = height; +#if !defined(DISPLAY_INTERFACE_VERSION) || DISPLAY_INTERFACE_VERSION < 2 m_weightsOffset = weightsoffset; +#endif m_offsets.clear(); m_offsets.reserve(noutputs); for (size_t i = 0; i < noutputs; i++) { - m_offsets.push_back(offsets[i]); + m_offsets.push_back(srfoffsets[i]); if(outputs[i].name == RixStr.k_a) { - m_alphaOffset = offsets[i]; + m_alphaOffset = srfoffsets[i]; } } @@ -642,10 +633,11 @@ class DisplayHydra final : public display::Display const HdPrmanFramebuffer::AovDesc &aovDesc = aovBuffer.desc; +#if !defined(DISPLAY_INTERFACE_VERSION) || DISPLAY_INTERFACE_VERSION < 2 const float* const srcWeights = m_weightsOffset != k_invalidOffset ? reinterpret_cast(m_surface+m_weightsOffset) : nullptr; +#endif const bool shouldNormalize = aovDesc.ShouldNormalizeBySampleCount(); - const int cc = HdGetComponentCount(aovDesc.format); const size_t srcOffset = m_offsets[offsetIdx]; if (aovDesc.format == HdFormatInt32) { @@ -779,12 +771,17 @@ class DisplayHydra final : public display::Display } else if( cc == 4 ) { WorkParallelForN(m_height, +#if !defined(DISPLAY_INTERFACE_VERSION) || DISPLAY_INTERFACE_VERSION < 2 [this, &aovBuffer, &srcWeights, &srcOffset, shouldNormalize] +#else + [this, &aovBuffer, &srcOffset, shouldNormalize] +#endif (size_t begin, size_t end) { +#if !defined(DISPLAY_INTERFACE_VERSION) || DISPLAY_INTERFACE_VERSION < 2 const float* weights = srcWeights ? srcWeights + begin * m_width : nullptr; - +#endif const float* srcColorR = reinterpret_cast( m_surface + srcOffset) @@ -806,9 +803,10 @@ class DisplayHydra final : public display::Display for (uint32_t x = 0; x < m_width; x++) { float isc = 1.f; +#if !defined(DISPLAY_INTERFACE_VERSION) || DISPLAY_INTERFACE_VERSION < 2 if(weights && shouldNormalize && *weights > 0.f) isc = 1.f / *weights; - +#endif const float* const srcColorG = srcColorR + (m_height * m_width); const float* const srcColorB = @@ -828,7 +826,9 @@ class DisplayHydra final : public display::Display aovData += 4; srcColorR++; srcColorA++; +#if !defined(DISPLAY_INTERFACE_VERSION) || DISPLAY_INTERFACE_VERSION < 2 if (weights) weights++; +#endif } } }); @@ -840,12 +840,17 @@ class DisplayHydra final : public display::Display } else if (cc == 1) { WorkParallelForN(m_height, +#if !defined(DISPLAY_INTERFACE_VERSION) || DISPLAY_INTERFACE_VERSION < 2 [this, &aovBuffer, &srcWeights, &srcOffset, shouldNormalize] +#else + [this, &aovBuffer, &srcOffset, shouldNormalize] +#endif (size_t begin, size_t end) { - +#if !defined(DISPLAY_INTERFACE_VERSION) || DISPLAY_INTERFACE_VERSION < 2 const float* weights = srcWeights ? srcWeights + begin * m_width : nullptr; +#endif const float* srcColorR = reinterpret_cast( m_surface + srcOffset) @@ -861,14 +866,18 @@ class DisplayHydra final : public display::Display for (uint32_t x = 0; x < m_width; x++) { float isc = 1.f; +#if !defined(DISPLAY_INTERFACE_VERSION) || DISPLAY_INTERFACE_VERSION < 2 if(weights && shouldNormalize && *weights > 0.f) isc = 1.f / *weights; +#endif *aovData = *srcColorR * isc; aovData++; srcColorR++; +#if !defined(DISPLAY_INTERFACE_VERSION) || DISPLAY_INTERFACE_VERSION < 2 if (weights) weights++; +#endif } } }); @@ -876,11 +885,17 @@ class DisplayHydra final : public display::Display else { assert(cc == 3); WorkParallelForN(m_height, +#if !defined(DISPLAY_INTERFACE_VERSION) || DISPLAY_INTERFACE_VERSION < 2 [this, &aovBuffer, &srcWeights, &srcOffset, shouldNormalize] +#else + [this, &aovBuffer, &srcOffset, shouldNormalize] +#endif (size_t begin, size_t end) { +#if !defined(DISPLAY_INTERFACE_VERSION) || DISPLAY_INTERFACE_VERSION < 2 const float* weights = srcWeights ? srcWeights + begin * m_width : nullptr; +#endif const float* srcColorR = reinterpret_cast( m_surface + srcOffset) @@ -894,8 +909,10 @@ class DisplayHydra final : public display::Display for (uint32_t x = 0; x < m_width; x++) { float isc = 1.f; +#if !defined(DISPLAY_INTERFACE_VERSION) || DISPLAY_INTERFACE_VERSION < 2 if(weights && shouldNormalize && *weights > 0.f) isc = 1.f / *weights; +#endif const float* const srcColorG = srcColorR + (m_height * m_width); @@ -908,7 +925,9 @@ class DisplayHydra final : public display::Display aovData += 3; srcColorR++; +#if !defined(DISPLAY_INTERFACE_VERSION) || DISPLAY_INTERFACE_VERSION < 2 if (weights) weights++; +#endif } } }); @@ -917,19 +936,33 @@ class DisplayHydra final : public display::Display } } +#if DISPLAY_INTERFACE_VERSION >= 2 + uint64_t GetRequirements() const override + { + return display::Display::k_reqFrameBuffer; + } +#endif private: uint32_t m_width; uint32_t m_height; const uint8_t* m_surface; size_t m_alphaOffset; std::vector m_offsets; +#if !defined(DISPLAY_INTERFACE_VERSION) || DISPLAY_INTERFACE_VERSION < 2 size_t m_weightsOffset; +#endif HdPrmanFramebuffer* m_buf; }; } +// Export the current version of the Display API, necessary for binary compatibility with the +// renderer +#if DISPLAY_INTERFACE_VERSION >= 1 +DISPLAYEXPORTVERSION +#endif + extern "C" DISPLAYEXPORT display::Display* CreateDisplay(const pxrcore::UString& name, const pxrcore::ParamList& params, diff --git a/third_party/renderman-25/plugin/hdPrman/framebuffer.h b/third_party/renderman-25/plugin/hdPrman/framebuffer.h index 9f4e2fee68..4b85d9970c 100644 --- a/third_party/renderman-25/plugin/hdPrman/framebuffer.h +++ b/third_party/renderman-25/plugin/hdPrman/framebuffer.h @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_FRAMEBUFFER_H #define EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_FRAMEBUFFER_H diff --git a/third_party/renderman-25/plugin/hdPrman/gprim.cpp b/third_party/renderman-25/plugin/hdPrman/gprim.cpp index 4f4192cbfb..8909822cec 100644 --- a/third_party/renderman-25/plugin/hdPrman/gprim.cpp +++ b/third_party/renderman-25/plugin/hdPrman/gprim.cpp @@ -1,24 +1,7 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "hdPrman/gprim.h" diff --git a/third_party/renderman-25/plugin/hdPrman/gprim.h b/third_party/renderman-25/plugin/hdPrman/gprim.h index bed1bd5417..dded31efc0 100644 --- a/third_party/renderman-25/plugin/hdPrman/gprim.h +++ b/third_party/renderman-25/plugin/hdPrman/gprim.h @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_GPRIM_H #define EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_GPRIM_H @@ -153,6 +136,23 @@ HdPrman_Gprim::Sync(HdSceneDelegate* sceneDelegate, HF_MALLOC_TAG_FUNCTION(); TF_UNUSED(reprToken); + // Check if there are any relevant dirtyBits. + // (See the HdChangeTracker::MarkRprimDirty() note regarding + // internalDirtyBits used for internal signaling in Hydra.) + static const HdDirtyBits internalDirtyBits = + HdChangeTracker::InitRepr | + HdChangeTracker::Varying | + HdChangeTracker::NewRepr | + HdChangeTracker::CustomBitsMask; + // HdPrman does not make use of the repr concept or customBits. + *dirtyBits &= ~(HdChangeTracker::NewRepr | HdChangeTracker::CustomBitsMask); + // If no relevant dirtyBits remain, return early to avoid acquiring write + // access to Riley, which requires a pause and restart of rendering. + if (((*dirtyBits & ~internalDirtyBits) + & HdChangeTracker::AllSceneDirtyBits) == 0) { + return; + } + HdPrman_RenderParam *param = static_cast(renderParam); @@ -208,7 +208,7 @@ HdPrman_Gprim::Sync(HdSceneDelegate* sceneDelegate, // Hydra dirty bits corresponding to PRMan prototype attributes (also called // "primitive variables" but not synonymous with USD primvars). See prman // docs at https://rmanwiki.pixar.com/display/REN24/Primitive+Variables. - static const int prmanProtoAttrBits = + static const HdDirtyBits prmanProtoAttrBits = HdChangeTracker::DirtyPoints | HdChangeTracker::DirtyNormals | HdChangeTracker::DirtyWidths | @@ -216,7 +216,7 @@ HdPrman_Gprim::Sync(HdSceneDelegate* sceneDelegate, // Hydra dirty bits corresponding to prman instance attributes. See prman // docs at https://rmanwiki.pixar.com/display/REN24/Instance+Attributes. - static const int prmanInstAttrBits = + static const HdDirtyBits prmanInstAttrBits = HdChangeTracker::DirtyMaterialId | HdChangeTracker::DirtyTransform | HdChangeTracker::DirtyVisibility | @@ -338,10 +338,7 @@ HdPrman_Gprim::Sync(HdSceneDelegate* sceneDelegate, // // Resolve attributes. - bool sceneVisibility = true; - RtParamList attrs = param->ConvertAttributes(sceneDelegate, id, true, - &sceneVisibility); - _sceneVisibility = sceneVisibility; + RtParamList attrs = param->ConvertAttributes(sceneDelegate, id, true); // Add "identifier:id" with the prim id. attrs.SetInteger(RixStr.k_identifier_id, primId); @@ -400,6 +397,10 @@ HdPrman_Gprim::Sync(HdSceneDelegate* sceneDelegate, TF_VERIFY(j < subsetMaterialIds.size()); instanceMaterialId = subsetMaterialIds[j]; } + + // Very last thing: prepend renderTag to grouping:membership + param->AddRenderTagToGroupingMembership( + sceneDelegate->GetRenderTag(id), finalAttrs); if (instanceId == riley::GeometryInstanceId::InvalidId()) { TRACE_SCOPE("riley::CreateGeometryInstance"); diff --git a/third_party/renderman-25/plugin/hdPrman/gprimbase.cpp b/third_party/renderman-25/plugin/hdPrman/gprimbase.cpp index 3fbffd7e35..3cc15c1acf 100644 --- a/third_party/renderman-25/plugin/hdPrman/gprimbase.cpp +++ b/third_party/renderman-25/plugin/hdPrman/gprimbase.cpp @@ -1,66 +1,16 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "hdPrman/gprimbase.h" -#include "hdPrman/rixStrings.h" PXR_NAMESPACE_OPEN_SCOPE HdPrman_GprimBase::~HdPrman_GprimBase() = default; -void -HdPrman_GprimBase::UpdateInstanceVisibility(bool renderPassVisibility, - riley::Riley *riley ) const -{ - if (_renderPassVisibility == renderPassVisibility) { - return; - } - _renderPassVisibility = renderPassVisibility; - if (!_sceneVisibility) { - // If the prim is not visible in the scene it cannot be - // further affected by render pass state. - return; - } - for(auto instid : _instanceIds) { - RtParamList attrs; - attrs.SetInteger(RixStr.k_visibility_camera, - static_cast(_renderPassVisibility)); - attrs.SetInteger(RixStr.k_visibility_indirect, - static_cast(_renderPassVisibility)); - attrs.SetInteger(RixStr.k_visibility_transmission, - static_cast(_renderPassVisibility)); - // XXX: HYD-2973: This approach has the unfortunate side-effect - // of clearing any other attributes that had been previously set - // on this geometry instance. This can break features that rely - // on those attributes, such as subsurface and light-linking. - riley->ModifyGeometryInstance( - riley::GeometryPrototypeId::InvalidId(), - instid, nullptr, nullptr, - nullptr, &attrs); - } -} - std::vector HdPrman_GprimBase::GetPrototypeIds() const { diff --git a/third_party/renderman-25/plugin/hdPrman/gprimbase.h b/third_party/renderman-25/plugin/hdPrman/gprimbase.h index b03ed6ba2e..9477bb8031 100644 --- a/third_party/renderman-25/plugin/hdPrman/gprimbase.h +++ b/third_party/renderman-25/plugin/hdPrman/gprimbase.h @@ -1,33 +1,16 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_GPRIMBASE_H #define EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_GPRIMBASE_H #include "pxr/pxr.h" -#include "pxr/imaging/hd/rprim.h" -#include "Riley.h" +#include +#include #include @@ -40,20 +23,11 @@ class HdPrman_GprimBase HdPrman_GprimBase() = default; virtual ~HdPrman_GprimBase() = 0; - /// Update the visibilty of this prim for a render pass. - void UpdateInstanceVisibility(bool renderPassVisibility, - riley::Riley *riley ) const; - std::vector GetPrototypeIds() const; protected: std::vector _prototypeIds; std::vector _instanceIds; - - // Visibility state defined by the scene delegate. - bool _sceneVisibility:1; - // Visibility state defined by the render pass. - mutable bool _renderPassVisibility:1; }; PXR_NAMESPACE_CLOSE_SCOPE diff --git a/third_party/renderman-25/plugin/hdPrman/hdPrmanGenParsers.py b/third_party/renderman-25/plugin/hdPrman/hdPrmanGenParsers.py index 3ac73ec36f..8d4730bdcb 100644 --- a/third_party/renderman-25/plugin/hdPrman/hdPrmanGenParsers.py +++ b/third_party/renderman-25/plugin/hdPrman/hdPrmanGenParsers.py @@ -2,25 +2,8 @@ # # Copyright 2019 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # from __future__ import print_function diff --git a/third_party/renderman-25/plugin/hdPrman/hdSchemaDefs.py b/third_party/renderman-25/plugin/hdPrman/hdSchemaDefs.py index 78f08e6cc0..ff1efedfe4 100644 --- a/third_party/renderman-25/plugin/hdPrman/hdSchemaDefs.py +++ b/third_party/renderman-25/plugin/hdPrman/hdSchemaDefs.py @@ -1,30 +1,13 @@ # # Copyright 2023 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http:#www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # [ dict( SCHEMA_NAME = 'ALL_SCHEMAS', - LIBRARY_PATH = 'ext/rmanpkg/25.0/plugin/renderman/plugin/hdPrman', + LIBRARY_PATH = 'ext/rmanpkg/plugin/renderman/plugin/hdPrman', INCLUDE_PATH = 'hdPrman', VERSION_GUARD_CONST_GETTER = True ), @@ -158,6 +141,25 @@ ], ), + #-------------------------------------------------------------------------- + # + # + # Schema's corresponding to riley globals. + # + # + # hdPrman/rileyGlobals + dict( + SCHEMA_NAME = 'RileyGlobals', + SCHEMA_TOKEN = 'rileyGlobals', + ADD_DEFAULT_LOCATOR = True, + SCHEMA_INCLUDES = ['hdPrman/rileyParamListSchema'], + + MEMBERS = [ + ('ALL_MEMBERS', '', dict(ADD_LOCATOR=True)), + ('options', 'HdPrmanRileyParamListSchema', {}) + ], + ), + #-------------------------------------------------------------------------- # # diff --git a/third_party/renderman-25/plugin/hdPrman/implicitSurfaceSceneIndexPlugin.cpp b/third_party/renderman-25/plugin/hdPrman/implicitSurfaceSceneIndexPlugin.cpp index 4a4a8b1b13..662e33a173 100644 --- a/third_party/renderman-25/plugin/hdPrman/implicitSurfaceSceneIndexPlugin.cpp +++ b/third_party/renderman-25/plugin/hdPrman/implicitSurfaceSceneIndexPlugin.cpp @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. #include "hdPrman/implicitSurfaceSceneIndexPlugin.h" @@ -28,8 +11,14 @@ #include "pxr/imaging/hd/tokens.h" #include "pxr/imaging/hdsi/implicitSurfaceSceneIndex.h" +#include "pxr/base/tf/envSetting.h" + PXR_NAMESPACE_OPEN_SCOPE +TF_DEFINE_ENV_SETTING(HDPRMAN_TESSELLATE_IMPLICIT_SURFACES, false, + "Tessellate implicit surfaces into meshes, " + "instead of using Renderman implicits"); + TF_DEFINE_PRIVATE_TOKENS( _tokens, ((sceneIndexPluginName, "HdPrman_ImplicitSurfaceSceneIndexPlugin")) @@ -60,13 +49,29 @@ TF_REGISTRY_FUNCTION(HdSceneIndexPlugin) HdRetainedTypedSampledDataSource::New( HdsiImplicitSurfaceSceneIndexTokens->toMesh); - HdContainerDataSourceHandle const inputArgs = - HdRetainedContainerDataSource::New( - HdPrimTypeTokens->cone, axisToTransformSrc, - HdPrimTypeTokens->cylinder, axisToTransformSrc, - // HdSphereSchema doesn't specify an axis, so it can be omitted. - HdPrimTypeTokens->cube, toMeshSrc, - HdPrimTypeTokens->capsule, toMeshSrc); + static bool tessellate = + (TfGetEnvSetting(HDPRMAN_TESSELLATE_IMPLICIT_SURFACES) == true); + + HdContainerDataSourceHandle inputArgs; + if (tessellate) { + // Tessellate everything (legacy behavior). + inputArgs = + HdRetainedContainerDataSource::New( + HdPrimTypeTokens->sphere, toMeshSrc, + HdPrimTypeTokens->cube, toMeshSrc, + HdPrimTypeTokens->cone, toMeshSrc, + HdPrimTypeTokens->cylinder, toMeshSrc, + HdPrimTypeTokens->capsule, toMeshSrc); + } else { + // Cone and cylinder need transforms updated, and cube and capsule still + // need to be tessellated. + inputArgs = + HdRetainedContainerDataSource::New( + HdPrimTypeTokens->cone, axisToTransformSrc, + HdPrimTypeTokens->cylinder, axisToTransformSrc, + HdPrimTypeTokens->cube, toMeshSrc, + HdPrimTypeTokens->capsule, toMeshSrc); + } HdSceneIndexPluginRegistry::GetInstance().RegisterSceneIndexForRenderer( _pluginDisplayName, diff --git a/third_party/renderman-25/plugin/hdPrman/implicitSurfaceSceneIndexPlugin.h b/third_party/renderman-25/plugin/hdPrman/implicitSurfaceSceneIndexPlugin.h index ff84b432a2..41361094bf 100644 --- a/third_party/renderman-25/plugin/hdPrman/implicitSurfaceSceneIndexPlugin.h +++ b/third_party/renderman-25/plugin/hdPrman/implicitSurfaceSceneIndexPlugin.h @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. #ifndef PXR_IMAGING_HDPRMAN_IMPLICIT_SURFACE_SCENE_INDEX_PLUGIN_H #define PXR_IMAGING_HDPRMAN_IMPLICIT_SURFACE_SCENE_INDEX_PLUGIN_H diff --git a/third_party/renderman-25/plugin/hdPrman/instancer.cpp b/third_party/renderman-25/plugin/hdPrman/instancer.cpp index cd31b82202..588dfb17f5 100644 --- a/third_party/renderman-25/plugin/hdPrman/instancer.cpp +++ b/third_party/renderman-25/plugin/hdPrman/instancer.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "hdPrman/instancer.h" @@ -1055,6 +1038,7 @@ HdPrmanInstancer::_PopulateInstances( // Finalize the prototype-derived params & flats std::vector protoParams; std::vector<_FlattenData> protoFlats; + std::vector protoRenderTags; _ComposePrototypeData( prototypePrimPath, @@ -1064,8 +1048,9 @@ HdPrmanInstancer::_PopulateInstances( prototypePaths, prototypeFlats, protoParams, - protoFlats); - + protoFlats, + protoRenderTags); + // Prepare each instance to be sent to riley _ParallelFor(instances.size(), [&](size_t i) { const _InstanceData& instance = instances[i]; @@ -1225,6 +1210,9 @@ HdPrmanInstancer::_PopulateInstances( ¶ms); } } else { + // Very last thing: prepend renderTag to grouping:membership + param->AddRenderTagToGroupingMembership( + protoRenderTags[j], params); if (instId.geoInstanceId == riley::GeometryInstanceId::InvalidId()) { TRACE_SCOPE("riley::CreateGeometryInstance"); instId.geoInstanceId = riley->CreateGeometryInstance( @@ -1450,7 +1438,8 @@ HdPrmanInstancer::_ComposePrototypeData( const SdfPathVector& subProtoPaths, const std::vector<_FlattenData>& subProtoFlats, std::vector& protoParams, - std::vector<_FlattenData>& protoFlats) + std::vector<_FlattenData>& protoFlats, + std::vector& protoRenderTags) { HD_TRACE_FUNCTION(); HdSceneDelegate* delegate = GetDelegate(); @@ -1494,15 +1483,21 @@ HdPrmanInstancer::_ComposePrototypeData( protoParams.resize(count); protoFlats.resize(count); + protoRenderTags.resize(count); for (size_t i = 0; i < count; ++i) { SetProtoParams(protoPath, protoParams[i], protoFlats[i]); + if (!isLight) { + protoRenderTags[i] = delegate->GetRenderTag(protoPath); + } // If prototype is a subset, also get the subset params. While geom // subsets should not have USD primvars on them, they may be the targets // of light linking and thus have categories to deal with. They may also // receive visibility params as part of Hydra's handling of invisible // faces, even though visibility cannot be authored on them in USD. + // XXX: All that is changing in hydra 2, where subsets will be able to + // have primvars, visibility, and purpose! if (i < subProtoPaths.size() && subProtoPaths[i] != protoPath) { RtParamList subsetParams; _FlattenData subsetFlats; diff --git a/third_party/renderman-25/plugin/hdPrman/instancer.h b/third_party/renderman-25/plugin/hdPrman/instancer.h index efb7e932ce..e9b3c34f6f 100644 --- a/third_party/renderman-25/plugin/hdPrman/instancer.h +++ b/third_party/renderman-25/plugin/hdPrman/instancer.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_INSTANCER_H #define EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_INSTANCER_H @@ -524,7 +507,8 @@ class HdPrmanInstancer : public HdInstancer const SdfPathVector& subProtoPaths, const std::vector<_FlattenData>& subProtoFlats, std::vector& protoParams, - std::vector<_FlattenData>& protoFlats); + std::vector<_FlattenData>& protoFlats, + std::vector& protoRenderTags); // Deletes riley instances owned by this instancer that are of riley // geometry prototypes that are no longer associated with the given diff --git a/third_party/renderman-25/plugin/hdPrman/integrator.cpp b/third_party/renderman-25/plugin/hdPrman/integrator.cpp index 02bbc82635..136fc886f7 100644 --- a/third_party/renderman-25/plugin/hdPrman/integrator.cpp +++ b/third_party/renderman-25/plugin/hdPrman/integrator.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "hdPrman/integrator.h" diff --git a/third_party/renderman-25/plugin/hdPrman/integrator.h b/third_party/renderman-25/plugin/hdPrman/integrator.h index 6e51ed72c1..e13d66c3d3 100644 --- a/third_party/renderman-25/plugin/hdPrman/integrator.h +++ b/third_party/renderman-25/plugin/hdPrman/integrator.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_INTEGRATOR_H #define EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_INTEGRATOR_H diff --git a/third_party/renderman-25/plugin/hdPrman/legacyMeshLightAdapter.cpp b/third_party/renderman-25/plugin/hdPrman/legacyMeshLightAdapter.cpp index c7fbac11cc..d4b21e3e50 100644 --- a/third_party/renderman-25/plugin/hdPrman/legacyMeshLightAdapter.cpp +++ b/third_party/renderman-25/plugin/hdPrman/legacyMeshLightAdapter.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. #include "hdPrman/legacyMeshLightAdapter.h" #include "pxr/usd/usdLux/lightAPI.h" diff --git a/third_party/renderman-25/plugin/hdPrman/legacyMeshLightAdapter.h b/third_party/renderman-25/plugin/hdPrman/legacyMeshLightAdapter.h index 349eadc05f..a73e2ab4a4 100644 --- a/third_party/renderman-25/plugin/hdPrman/legacyMeshLightAdapter.h +++ b/third_party/renderman-25/plugin/hdPrman/legacyMeshLightAdapter.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. #ifndef EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_LEGACY_MESHLIGHT_ADAPTER_H #define EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_LEGACY_MESHLIGHT_ADAPTER_H diff --git a/third_party/renderman-25/plugin/hdPrman/light.cpp b/third_party/renderman-25/plugin/hdPrman/light.cpp index bb888915d4..5cacba22b5 100644 --- a/third_party/renderman-25/plugin/hdPrman/light.cpp +++ b/third_party/renderman-25/plugin/hdPrman/light.cpp @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "hdPrman/light.h" diff --git a/third_party/renderman-25/plugin/hdPrman/light.h b/third_party/renderman-25/plugin/hdPrman/light.h index f5301943a6..7db6b1030a 100644 --- a/third_party/renderman-25/plugin/hdPrman/light.h +++ b/third_party/renderman-25/plugin/hdPrman/light.h @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_LIGHT_H #define EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_LIGHT_H diff --git a/third_party/renderman-25/plugin/hdPrman/lightFilter.cpp b/third_party/renderman-25/plugin/hdPrman/lightFilter.cpp index 7aac373d9f..ad8d0ca59b 100644 --- a/third_party/renderman-25/plugin/hdPrman/lightFilter.cpp +++ b/third_party/renderman-25/plugin/hdPrman/lightFilter.cpp @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "hdPrman/lightFilter.h" #include "hdPrman/renderParam.h" @@ -28,7 +11,9 @@ #include "hdPrman/utils.h" #include "pxr/usd/sdf/types.h" #include "pxr/base/tf/staticTokens.h" +#include "pxr/imaging/hd/light.h" #include "pxr/imaging/hd/sceneDelegate.h" +#include "pxr/imaging/hd/version.h" #include "pxr/imaging/hf/diagnostic.h" PXR_NAMESPACE_OPEN_SCOPE @@ -71,11 +56,15 @@ void HdPrmanLightFilter::Sync(HdSceneDelegate *sceneDelegate, HdRenderParam *renderParam, HdDirtyBits *dirtyBits) -{ +{ HdPrman_RenderParam *param = static_cast(renderParam); +#if HD_API_VERSION >= 70 + if (*dirtyBits & HdLight::DirtyTransform) { +#else if (*dirtyBits & HdChangeTracker::DirtyTransform) { +#endif std::lock_guard lock(_syncToRileyMutex); _rileyIsInSync = false; _SyncToRileyWithLock(sceneDelegate, param->AcquireRiley()); diff --git a/third_party/renderman-25/plugin/hdPrman/lightFilter.h b/third_party/renderman-25/plugin/hdPrman/lightFilter.h index 1a5a88bd70..d331ac4960 100644 --- a/third_party/renderman-25/plugin/hdPrman/lightFilter.h +++ b/third_party/renderman-25/plugin/hdPrman/lightFilter.h @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef EXT_RMANPKG_22_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_LIGHT_FILTER_H #define EXT_RMANPKG_22_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_LIGHT_FILTER_H diff --git a/third_party/renderman-25/plugin/hdPrman/lightLinkingSceneIndexPlugin.cpp b/third_party/renderman-25/plugin/hdPrman/lightLinkingSceneIndexPlugin.cpp new file mode 100644 index 0000000000..2e60c2445a --- /dev/null +++ b/third_party/renderman-25/plugin/hdPrman/lightLinkingSceneIndexPlugin.cpp @@ -0,0 +1,93 @@ +// +// Copyright 2022 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// + +#include "pxr/imaging/hd/version.h" + +// There was no hdsi/version.h before this HD_API_VERSION. +#if HD_API_VERSION >= 58 + +#include "pxr/imaging/hdsi/version.h" + +#if HDSI_API_VERSION >= 13 +#define HDPRMAN_USE_LIGHT_LINKING_SCENE_INDEX +#endif + +#endif // #if HD_API_VERSION >= 58 + +#ifdef HDPRMAN_USE_LIGHT_LINKING_SCENE_INDEX + +#include "pxr/imaging/hd/sceneIndexPlugin.h" +#include "pxr/imaging/hd/sceneIndexPluginRegistry.h" +#include "pxr/imaging/hdsi/lightLinkingSceneIndex.h" + +#include "pxr/base/tf/envSetting.h" + +PXR_NAMESPACE_OPEN_SCOPE + +TF_DEFINE_PRIVATE_TOKENS( + _tokens, + ((sceneIndexPluginName, "HdPrman_LightLinkingSceneIndexPlugin")) +); + +TF_DEFINE_ENV_SETTING(HDPRMAN_ENABLE_LIGHT_LINKING_SCENE_INDEX, true, + "Enable registration for the light linking scene index."); + +//////////////////////////////////////////////////////////////////////////////// +// Plugin registration +//////////////////////////////////////////////////////////////////////////////// + +static const char * const _rendererDisplayName = "Prman"; +class HdPrman_LightLinkingSceneIndexPlugin; + +TF_REGISTRY_FUNCTION(TfType) +{ + HdSceneIndexPluginRegistry::Define(); +} + +TF_REGISTRY_FUNCTION(HdSceneIndexPlugin) +{ + if (TfGetEnvSetting(HDPRMAN_ENABLE_LIGHT_LINKING_SCENE_INDEX)) { + + // XXX Picking an arbitrary phase for now. If a procedural were to + // generate light prims, we'd want this to be after it. + // HdGpSceneIndexPlugin::GetInsertionPhase() currently returns 2. + // + const HdSceneIndexPluginRegistry::InsertionPhase insertionPhase = 4; + + HdSceneIndexPluginRegistry::GetInstance().RegisterSceneIndexForRenderer( + _rendererDisplayName, + _tokens->sceneIndexPluginName, + // XXX Update inputArgs to provide the list of geometry types + // supported by hdPrman. + nullptr, + insertionPhase, + HdSceneIndexPluginRegistry::InsertionOrderAtStart); + } +} + +//////////////////////////////////////////////////////////////////////////////// +// Scene Index Implementation +//////////////////////////////////////////////////////////////////////////////// + +class HdPrman_LightLinkingSceneIndexPlugin : + public HdSceneIndexPlugin +{ +public: + HdPrman_LightLinkingSceneIndexPlugin() = default; + +protected: + HdSceneIndexBaseRefPtr _AppendSceneIndex( + const HdSceneIndexBaseRefPtr &inputScene, + const HdContainerDataSourceHandle &inputArgs) override + { + return HdsiLightLinkingSceneIndex::New(inputScene, inputArgs); + } +}; + +PXR_NAMESPACE_CLOSE_SCOPE + +#endif // HDPRMAN_USE_LIGHT_LINKING_SCENE_INDEX \ No newline at end of file diff --git a/third_party/renderman-25/plugin/hdPrman/material.cpp b/third_party/renderman-25/plugin/hdPrman/material.cpp index 7cc5441f94..92e7b86ba2 100644 --- a/third_party/renderman-25/plugin/hdPrman/material.cpp +++ b/third_party/renderman-25/plugin/hdPrman/material.cpp @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "hdPrman/material.h" #include "hdPrman/debugCodes.h" @@ -443,6 +426,9 @@ _ConvertNodes( if (propType == SdrPropertyTypes->Color) { sn.params.SetColor(name, RtColorRGB(v[0], v[1], v[2])); ok = true; + } else if (propType == SdrPropertyTypes->Point) { + sn.params.SetPoint(name, RtPoint3(v[0], v[1], v[2])); + ok = true; } } else if (param.second.IsHolding>()) { if (propType == SdrPropertyTypes->Color) { @@ -454,6 +440,15 @@ _ConvertNodes( reinterpret_cast(v.cdata()), v.size()); ok = true; + } else if (propType == SdrPropertyTypes->Point) { + const VtArray& vd = + param.second.UncheckedGet>(); + VtArray v = _ConvertToVec3fArray(vd); + sn.params.SetPointArray( + name, + reinterpret_cast(v.cdata()), + v.size()); + ok = true; } } else if (param.second.IsHolding()) { float v = param.second.UncheckedGet(); diff --git a/third_party/renderman-25/plugin/hdPrman/material.h b/third_party/renderman-25/plugin/hdPrman/material.h index 454201eb65..df58857fd1 100644 --- a/third_party/renderman-25/plugin/hdPrman/material.h +++ b/third_party/renderman-25/plugin/hdPrman/material.h @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_MATERIAL_H #define EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_MATERIAL_H diff --git a/third_party/renderman-25/plugin/hdPrman/materialPrimvarTransferSceneIndexPlugin.cpp b/third_party/renderman-25/plugin/hdPrman/materialPrimvarTransferSceneIndexPlugin.cpp index 78092b4b94..60d003e11d 100644 --- a/third_party/renderman-25/plugin/hdPrman/materialPrimvarTransferSceneIndexPlugin.cpp +++ b/third_party/renderman-25/plugin/hdPrman/materialPrimvarTransferSceneIndexPlugin.cpp @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "hdPrman/materialPrimvarTransferSceneIndexPlugin.h" diff --git a/third_party/renderman-25/plugin/hdPrman/materialPrimvarTransferSceneIndexPlugin.h b/third_party/renderman-25/plugin/hdPrman/materialPrimvarTransferSceneIndexPlugin.h index 5712f5bae6..19de2f05f5 100644 --- a/third_party/renderman-25/plugin/hdPrman/materialPrimvarTransferSceneIndexPlugin.h +++ b/third_party/renderman-25/plugin/hdPrman/materialPrimvarTransferSceneIndexPlugin.h @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_MATERIAL_PRIMVAR_TRANSFER_SCENE_INDEX_PLUGIN_H #define EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_MATERIAL_PRIMVAR_TRANSFER_SCENE_INDEX_PLUGIN_H diff --git a/third_party/renderman-25/plugin/hdPrman/matfiltConvertPreviewMaterial.cpp b/third_party/renderman-25/plugin/hdPrman/matfiltConvertPreviewMaterial.cpp index 47887f93a0..9be573c89f 100644 --- a/third_party/renderman-25/plugin/hdPrman/matfiltConvertPreviewMaterial.cpp +++ b/third_party/renderman-25/plugin/hdPrman/matfiltConvertPreviewMaterial.cpp @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "hdPrman/matfiltConvertPreviewMaterial.h" #include "hdPrman/debugCodes.h" diff --git a/third_party/renderman-25/plugin/hdPrman/matfiltConvertPreviewMaterial.h b/third_party/renderman-25/plugin/hdPrman/matfiltConvertPreviewMaterial.h index c8fefa44ee..6c1d5b940d 100644 --- a/third_party/renderman-25/plugin/hdPrman/matfiltConvertPreviewMaterial.h +++ b/third_party/renderman-25/plugin/hdPrman/matfiltConvertPreviewMaterial.h @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_MATFILT_CONVERT_PREVIEW_MATERIAL_H #define EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_MATFILT_CONVERT_PREVIEW_MATERIAL_H diff --git a/third_party/renderman-25/plugin/hdPrman/matfiltMaterialX.cpp b/third_party/renderman-25/plugin/hdPrman/matfiltMaterialX.cpp index 7f0b075401..7438a781ba 100644 --- a/third_party/renderman-25/plugin/hdPrman/matfiltMaterialX.cpp +++ b/third_party/renderman-25/plugin/hdPrman/matfiltMaterialX.cpp @@ -1,25 +1,8 @@ // // Copyright 2021 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "hdPrman/matfiltMaterialX.h" #include "hdPrman/debugCodes.h" diff --git a/third_party/renderman-25/plugin/hdPrman/matfiltMaterialX.h b/third_party/renderman-25/plugin/hdPrman/matfiltMaterialX.h index 3e8ac611c2..617d827d9a 100644 --- a/third_party/renderman-25/plugin/hdPrman/matfiltMaterialX.h +++ b/third_party/renderman-25/plugin/hdPrman/matfiltMaterialX.h @@ -1,25 +1,8 @@ // // Copyright 2021 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_MATFILT_MATERIALX_H #define EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_MATFILT_MATERIALX_H diff --git a/third_party/renderman-25/plugin/hdPrman/matfiltResolveVstructs.cpp b/third_party/renderman-25/plugin/hdPrman/matfiltResolveVstructs.cpp index f4a3d9989f..64f142a268 100644 --- a/third_party/renderman-25/plugin/hdPrman/matfiltResolveVstructs.cpp +++ b/third_party/renderman-25/plugin/hdPrman/matfiltResolveVstructs.cpp @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "hdPrman/matfiltResolveVstructs.h" #include "hdPrman/debugCodes.h" diff --git a/third_party/renderman-25/plugin/hdPrman/matfiltResolveVstructs.h b/third_party/renderman-25/plugin/hdPrman/matfiltResolveVstructs.h index 37b449576b..a334da092d 100644 --- a/third_party/renderman-25/plugin/hdPrman/matfiltResolveVstructs.h +++ b/third_party/renderman-25/plugin/hdPrman/matfiltResolveVstructs.h @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_MATFILT_RESOLVE_VSTRUCTS_H #define EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_MATFILT_RESOLVE_VSTRUCTS_H diff --git a/third_party/renderman-25/plugin/hdPrman/matfiltSceneIndexPlugins.cpp b/third_party/renderman-25/plugin/hdPrman/matfiltSceneIndexPlugins.cpp index 9453717aac..8694f62e64 100644 --- a/third_party/renderman-25/plugin/hdPrman/matfiltSceneIndexPlugins.cpp +++ b/third_party/renderman-25/plugin/hdPrman/matfiltSceneIndexPlugins.cpp @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "hdPrman/matfiltSceneIndexPlugins.h" #include "hdPrman/material.h" diff --git a/third_party/renderman-25/plugin/hdPrman/matfiltSceneIndexPlugins.h b/third_party/renderman-25/plugin/hdPrman/matfiltSceneIndexPlugins.h index 1da8facaff..2a33cf782d 100644 --- a/third_party/renderman-25/plugin/hdPrman/matfiltSceneIndexPlugins.h +++ b/third_party/renderman-25/plugin/hdPrman/matfiltSceneIndexPlugins.h @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_MAT_FILT_SCENE_INDEX_PLUGINS_H #define EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_MAT_FILT_SCENE_INDEX_PLUGINS_H diff --git a/third_party/renderman-25/plugin/hdPrman/mesh.cpp b/third_party/renderman-25/plugin/hdPrman/mesh.cpp index 009cde302c..74748b20be 100644 --- a/third_party/renderman-25/plugin/hdPrman/mesh.cpp +++ b/third_party/renderman-25/plugin/hdPrman/mesh.cpp @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include // for std::iota #include "hdPrman/mesh.h" diff --git a/third_party/renderman-25/plugin/hdPrman/mesh.h b/third_party/renderman-25/plugin/hdPrman/mesh.h index 2114dcc38e..a2bba554a9 100644 --- a/third_party/renderman-25/plugin/hdPrman/mesh.h +++ b/third_party/renderman-25/plugin/hdPrman/mesh.h @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_MESH_H #define EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_MESH_H diff --git a/third_party/renderman-25/plugin/hdPrman/meshLightResolvingSceneIndex.cpp b/third_party/renderman-25/plugin/hdPrman/meshLightResolvingSceneIndex.cpp index b25bd7cf5a..e5f026f022 100644 --- a/third_party/renderman-25/plugin/hdPrman/meshLightResolvingSceneIndex.cpp +++ b/third_party/renderman-25/plugin/hdPrman/meshLightResolvingSceneIndex.cpp @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. #include "hdPrman/meshLightResolvingSceneIndex.h" diff --git a/third_party/renderman-25/plugin/hdPrman/meshLightResolvingSceneIndex.h b/third_party/renderman-25/plugin/hdPrman/meshLightResolvingSceneIndex.h index e5f05bcbce..33b13c5cd2 100644 --- a/third_party/renderman-25/plugin/hdPrman/meshLightResolvingSceneIndex.h +++ b/third_party/renderman-25/plugin/hdPrman/meshLightResolvingSceneIndex.h @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. #ifndef EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_MESHLIGHT_RESOLVING_SCENE_INDEX_H #define EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_MESHLIGHT_RESOLVING_SCENE_INDEX_H diff --git a/third_party/renderman-25/plugin/hdPrman/meshLightResolvingSceneIndexPlugin.cpp b/third_party/renderman-25/plugin/hdPrman/meshLightResolvingSceneIndexPlugin.cpp index b2fa4cc4fb..3eb64b8c73 100644 --- a/third_party/renderman-25/plugin/hdPrman/meshLightResolvingSceneIndexPlugin.cpp +++ b/third_party/renderman-25/plugin/hdPrman/meshLightResolvingSceneIndexPlugin.cpp @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. #include "hdPrman/meshLightResolvingSceneIndexPlugin.h" diff --git a/third_party/renderman-25/plugin/hdPrman/meshLightResolvingSceneIndexPlugin.h b/third_party/renderman-25/plugin/hdPrman/meshLightResolvingSceneIndexPlugin.h index af31c7d9ff..41e9da15dc 100644 --- a/third_party/renderman-25/plugin/hdPrman/meshLightResolvingSceneIndexPlugin.h +++ b/third_party/renderman-25/plugin/hdPrman/meshLightResolvingSceneIndexPlugin.h @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. #ifndef EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_MESHLIGHT_RESOLVING_SCENE_INDEX_PLUGIN_H #define EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_MESHLIGHT_RESOLVING_SCENE_INDEX_PLUGIN_H diff --git a/third_party/renderman-25/plugin/hdPrman/motionBlurSceneIndexPlugin.cpp b/third_party/renderman-25/plugin/hdPrman/motionBlurSceneIndexPlugin.cpp index e4bf123fb7..9c7b7cb924 100644 --- a/third_party/renderman-25/plugin/hdPrman/motionBlurSceneIndexPlugin.cpp +++ b/third_party/renderman-25/plugin/hdPrman/motionBlurSceneIndexPlugin.cpp @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "hdPrman/motionBlurSceneIndexPlugin.h" diff --git a/third_party/renderman-25/plugin/hdPrman/motionBlurSceneIndexPlugin.h b/third_party/renderman-25/plugin/hdPrman/motionBlurSceneIndexPlugin.h index 7fd5f32c4b..018fdd738e 100644 --- a/third_party/renderman-25/plugin/hdPrman/motionBlurSceneIndexPlugin.h +++ b/third_party/renderman-25/plugin/hdPrman/motionBlurSceneIndexPlugin.h @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_MOTION_BLUR_SCENE_INDEX_PLUGIN_H #define EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_MOTION_BLUR_SCENE_INDEX_PLUGIN_H diff --git a/third_party/renderman-25/plugin/hdPrman/pinnedCurveExpandingSceneIndexPlugin.cpp b/third_party/renderman-25/plugin/hdPrman/pinnedCurveExpandingSceneIndexPlugin.cpp index 9fb9ec4f4c..c5e5be8e02 100644 --- a/third_party/renderman-25/plugin/hdPrman/pinnedCurveExpandingSceneIndexPlugin.cpp +++ b/third_party/renderman-25/plugin/hdPrman/pinnedCurveExpandingSceneIndexPlugin.cpp @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "hdPrman/pinnedCurveExpandingSceneIndexPlugin.h" diff --git a/third_party/renderman-25/plugin/hdPrman/pinnedCurveExpandingSceneIndexPlugin.h b/third_party/renderman-25/plugin/hdPrman/pinnedCurveExpandingSceneIndexPlugin.h index ea92954755..029db6a238 100644 --- a/third_party/renderman-25/plugin/hdPrman/pinnedCurveExpandingSceneIndexPlugin.h +++ b/third_party/renderman-25/plugin/hdPrman/pinnedCurveExpandingSceneIndexPlugin.h @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_PINNED_CURVE_EXPANDING_SCENE_INDEX_PLUGIN_H #define EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_PINNED_CURVE_EXPANDING_SCENE_INDEX_PLUGIN_H diff --git a/third_party/renderman-25/plugin/hdPrman/plugInfo.json b/third_party/renderman-25/plugin/hdPrman/plugInfo.json index 1dee1f497a..0fceca244a 100644 --- a/third_party/renderman-25/plugin/hdPrman/plugInfo.json +++ b/third_party/renderman-25/plugin/hdPrman/plugInfo.json @@ -63,6 +63,12 @@ "priority": 0, "displayName": "Prman ExtComputation Primvar Pruning Scene Index" }, + "HdPrman_RenderPassSceneIndexPlugin" : { + "bases": ["HdSceneIndexPlugin"], + "loadWithRenderer": "Prman", + "priority": 0, + "displayName": "Prman Render Pass Scene Index" + }, "HdPrman_RenderSettingsFilteringSceneIndexPlugin" : { "bases": ["HdSceneIndexPlugin"], "loadWithRenderer": "Prman", @@ -98,6 +104,12 @@ "loadWithRenderer" : "Prman", "priority": 0, "displayName": "Converts Hydra prims to Riley prims." + }, + "HdPrman_LightLinkingSceneIndexPlugin" : { + "bases": ["HdSceneIndexPlugin"], + "loadWithRenderer" : "Prman", + "priority": 0, + "displayName": "Scene index that implements light linking." } } }, diff --git a/third_party/renderman-25/plugin/hdPrman/points.cpp b/third_party/renderman-25/plugin/hdPrman/points.cpp index 0f52d94a48..36b33cf137 100644 --- a/third_party/renderman-25/plugin/hdPrman/points.cpp +++ b/third_party/renderman-25/plugin/hdPrman/points.cpp @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "hdPrman/points.h" diff --git a/third_party/renderman-25/plugin/hdPrman/points.h b/third_party/renderman-25/plugin/hdPrman/points.h index a03266249d..c4be901e0f 100644 --- a/third_party/renderman-25/plugin/hdPrman/points.h +++ b/third_party/renderman-25/plugin/hdPrman/points.h @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_POINTS_H #define EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_POINTS_H diff --git a/third_party/renderman-25/plugin/hdPrman/portalLightResolvingSceneIndexPlugin.cpp b/third_party/renderman-25/plugin/hdPrman/portalLightResolvingSceneIndexPlugin.cpp index bda1ade3db..8753940cc3 100644 --- a/third_party/renderman-25/plugin/hdPrman/portalLightResolvingSceneIndexPlugin.cpp +++ b/third_party/renderman-25/plugin/hdPrman/portalLightResolvingSceneIndexPlugin.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "hdPrman/portalLightResolvingSceneIndexPlugin.h" diff --git a/third_party/renderman-25/plugin/hdPrman/portalLightResolvingSceneIndexPlugin.h b/third_party/renderman-25/plugin/hdPrman/portalLightResolvingSceneIndexPlugin.h index a91ab9c7a3..c1de45add0 100644 --- a/third_party/renderman-25/plugin/hdPrman/portalLightResolvingSceneIndexPlugin.h +++ b/third_party/renderman-25/plugin/hdPrman/portalLightResolvingSceneIndexPlugin.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_PORTAL_LIGHT_RESOLVING_SCENE_INDEX_PLUGIN_H #define EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_PORTAL_LIGHT_RESOLVING_SCENE_INDEX_PLUGIN_H diff --git a/third_party/renderman-25/plugin/hdPrman/prmanArchDefs.h b/third_party/renderman-25/plugin/hdPrman/prmanArchDefs.h index 2b132452a2..bf37567e16 100644 --- a/third_party/renderman-25/plugin/hdPrman/prmanArchDefs.h +++ b/third_party/renderman-25/plugin/hdPrman/prmanArchDefs.h @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_ARCH_DEFS_H diff --git a/third_party/renderman-25/plugin/hdPrman/pxr/base/vt/typeHeaders.h b/third_party/renderman-25/plugin/hdPrman/pxr/base/vt/typeHeaders.h index 250a5fbf75..7dc9cf99d5 100644 --- a/third_party/renderman-25/plugin/hdPrman/pxr/base/vt/typeHeaders.h +++ b/third_party/renderman-25/plugin/hdPrman/pxr/base/vt/typeHeaders.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_PXR_BASE_VT_TYPE_HEADERS_H #define EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_PXR_BASE_VT_TYPE_HEADERS_H diff --git a/third_party/renderman-25/plugin/hdPrman/pxr/base/vt/visitValue.h b/third_party/renderman-25/plugin/hdPrman/pxr/base/vt/visitValue.h index 72a9ee60f0..3b90b61b5c 100644 --- a/third_party/renderman-25/plugin/hdPrman/pxr/base/vt/visitValue.h +++ b/third_party/renderman-25/plugin/hdPrman/pxr/base/vt/visitValue.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_PXR_BASE_VT_VISIT_VALUE_H #define EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_PXR_BASE_VT_VISIT_VALUE_H diff --git a/third_party/renderman-25/plugin/hdPrman/renderBuffer.cpp b/third_party/renderman-25/plugin/hdPrman/renderBuffer.cpp index a3ab08bd39..6ecc762bce 100644 --- a/third_party/renderman-25/plugin/hdPrman/renderBuffer.cpp +++ b/third_party/renderman-25/plugin/hdPrman/renderBuffer.cpp @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "renderBuffer.h" #include "pxr/base/gf/half.h" diff --git a/third_party/renderman-25/plugin/hdPrman/renderBuffer.h b/third_party/renderman-25/plugin/hdPrman/renderBuffer.h index b659b896f0..1e25491ebb 100644 --- a/third_party/renderman-25/plugin/hdPrman/renderBuffer.h +++ b/third_party/renderman-25/plugin/hdPrman/renderBuffer.h @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_RENDER_BUFFER_H #define EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_RENDER_BUFFER_H diff --git a/third_party/renderman-25/plugin/hdPrman/renderDelegate.cpp b/third_party/renderman-25/plugin/hdPrman/renderDelegate.cpp index e886dae36f..3f3eb71306 100644 --- a/third_party/renderman-25/plugin/hdPrman/renderDelegate.cpp +++ b/third_party/renderman-25/plugin/hdPrman/renderDelegate.cpp @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "hdPrman/renderDelegate.h" #include "hdPrman/basisCurves.h" @@ -732,10 +715,12 @@ HdPrmanRenderDelegate::SetRenderSetting(TfToken const &key, _renderParam->GetCameraContext().MarkCameraInvalid(camPath); HdRenderIndex *renderIndex = GetRenderIndex(); if(renderIndex) { + // Needed to trigger call to + // param->SetRileyShutterIntervalFromCameraContextCameraPath + // from HdPrmanCamera::Sync. + renderIndex->GetChangeTracker().MarkSprimDirty( camPath, HdChangeTracker::DirtyParams); - renderIndex->GetChangeTracker().MarkAllRprimsDirty( - HdChangeTracker::DirtyPoints); } } } diff --git a/third_party/renderman-25/plugin/hdPrman/renderDelegate.h b/third_party/renderman-25/plugin/hdPrman/renderDelegate.h index 14dda5cafc..08b183b6f8 100644 --- a/third_party/renderman-25/plugin/hdPrman/renderDelegate.h +++ b/third_party/renderman-25/plugin/hdPrman/renderDelegate.h @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_RENDER_DELEGATE_H #define EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_RENDER_DELEGATE_H diff --git a/third_party/renderman-25/plugin/hdPrman/renderParam.cpp b/third_party/renderman-25/plugin/hdPrman/renderParam.cpp index 809be12718..8c47ff5773 100644 --- a/third_party/renderman-25/plugin/hdPrman/renderParam.cpp +++ b/third_party/renderman-25/plugin/hdPrman/renderParam.cpp @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "hdPrman/renderParam.h" @@ -39,6 +22,15 @@ #include "hdPrman/tokens.h" #include "hdPrman/utils.h" +#include "pxr/imaging/hd/extComputationUtils.h" +#include "pxr/imaging/hd/renderBuffer.h" +#include "pxr/imaging/hd/renderThread.h" +#include "pxr/imaging/hd/rprim.h" +#include "pxr/imaging/hd/sceneDelegate.h" +#include "pxr/imaging/hd/sceneIndexPluginRegistry.h" + +#include "pxr/usd/sdf/path.h" + #include "pxr/base/arch/library.h" #include "pxr/base/plug/plugin.h" #include "pxr/base/plug/registry.h" @@ -46,18 +38,14 @@ #include "pxr/base/tf/envSetting.h" #include "pxr/base/tf/pathUtils.h" // Extract extension from tf token #include "pxr/base/tf/scopeDescription.h" -#include "pxr/imaging/hd/extComputationUtils.h" -#include "pxr/imaging/hd/renderBuffer.h" -#include "pxr/imaging/hd/renderThread.h" -#include "pxr/imaging/hd/sceneDelegate.h" -#include "pxr/imaging/hd/sceneIndexPluginRegistry.h" -#include "pxr/usd/sdf/path.h" +#include "pxr/base/tf/stringUtils.h" -#include "Riley.h" -#include "RiTypesHelper.h" -#include "RixRiCtl.h" -#include "stats/Session.h" +#include +#include +#include +#include +#include #include PXR_NAMESPACE_OPEN_SCOPE @@ -71,10 +59,18 @@ TF_DEFINE_PRIVATE_TOKENS( (sourceType) (lpe) + // Product/driver tokens + (deepRaster) + (deepexr) + (openexr) + ((riProductType, "ri:productType")) + // See PxrDisplayChannelAPI ((riDisplayChannelNamespace, "ri:displayChannel:")) // See PxrDisplayDriverAPI ((riDisplayDriverNamespace, "ri:displayDriver:")) + + ((renderTagPrefix, "rendertag_")) ); TF_DEFINE_PRIVATE_TOKENS( @@ -644,7 +640,10 @@ _Convert(HdSceneDelegate *sceneDelegate, SdfPath const& id, continue; } - if (val.IsArrayValued() && + // For non-constant primvars, check array size to make sure it + // matches the expected topology size. + if (hdInterp != HdInterpolationConstant && + val.IsArrayValued() && val.GetArraySize() != static_cast(expectedSize)) { TF_WARN("<%s> %s '%s' size (%zu) did not match " "expected (%d)", id.GetText(), label.c_str(), @@ -732,8 +731,7 @@ HdPrman_TransferMaterialPrimvarOpinions(HdSceneDelegate *sceneDelegate, RtParamList HdPrman_RenderParam::ConvertAttributes(HdSceneDelegate *sceneDelegate, - SdfPath const& id, bool isGeometry, - bool *visible) + SdfPath const& id, bool isGeometry) { RtParamList attrs; @@ -750,21 +748,19 @@ HdPrman_RenderParam::ConvertAttributes(HdSceneDelegate *sceneDelegate, attrs.SetString(RixStr.k_identifier_name, RtUString(id.GetText())); // Hydra visibility -> Riley Rix::k_visibility - bool vis = sceneDelegate->GetVisible(id); - if (visible) { - *visible = vis; - } - if (!vis) { + if (!sceneDelegate->GetVisible(id)) { attrs.SetInteger(RixStr.k_visibility_camera, 0); attrs.SetInteger(RixStr.k_visibility_indirect, 0); attrs.SetInteger(RixStr.k_visibility_transmission, 0); } - // Hydra categories -> Riley k_grouping_membership - VtArray categories = sceneDelegate->GetCategories(id); - ConvertCategoriesToAttributes(id, categories, attrs); + if (isGeometry) { + // Hydra categories -> Riley k_grouping_membership + // Note that lights and light filters also have a grouping membership, + // but that comes from the light (linking) params. + VtArray categories = sceneDelegate->GetCategories(id); + ConvertCategoriesToAttributes(id, categories, attrs); - if (isGeometry) { // Hydra cullStyle & doubleSided -> Riley k_Ri_Sides // Ri:Sides is most analogous to GL culling style. When Ri:Sides = 1, // prman will skip intersections on the back, with "back" determined by @@ -829,10 +825,16 @@ HdPrman_RenderParam::ConvertCategoriesToAttributes( RtParamList& attrs) { if (categories.empty()) { + if (!attrs.HasParam( RixStr.k_grouping_membership)) { + // Clear any categories that may have been previously tacked on by + // explicitly adding an empty string valued attribute. + attrs.SetString( RixStr.k_grouping_membership, RtUString("") ); + } attrs.SetString( RixStr.k_lightfilter_subset, RtUString("") ); attrs.SetString( RixStr.k_lighting_subset, RtUString("default") ); TF_DEBUG(HDPRMAN_LIGHT_LINKING) - .Msg("HdPrman: <%s> no categories; lighting:subset = \"default\"\n", + .Msg("HdPrman: <%s> no categories; grouping:membership = \"\"; " + "lighting:subset = \"default\"; lightFilter:subset = \"\"\n", id.GetText()); return; } @@ -1470,13 +1472,10 @@ _ToRtParamList(VtDictionary const& dict, TfToken prefix=TfToken()) return params; } -// TODO this is not a robust solution static RtUString -_GetOutputDisplayDriverType(const TfToken &name) +_GetOutputDisplayDriverType(const std::string &extension) { - // get output display driver type - // TODO this is not a robust solution static const std::map extToDisplayDriver{ { std::string("exr"), TfToken("openexr") }, { std::string("tif"), TfToken("tiff") }, @@ -1484,9 +1483,57 @@ _GetOutputDisplayDriverType(const TfToken &name) { std::string("png"), TfToken("png") } }; + const auto it = extToDisplayDriver.find(extension); + if (it != extToDisplayDriver.end()) { + return RtUString(it->second.GetText()); + } + + TF_WARN( + "Could not determine display driver for product filename extension %s." + "Falling back to openexr.", extension.c_str()); + + return RtUString(_tokens->openexr.GetText()); +} + +// Overload used when creating the render view from a renderSpec dict. +static +RtUString +_GetOutputDisplayDriverType(const TfToken &name) +{ const std::string outputExt = TfGetExtension(name.GetString()); - const TfToken displayFormat = extToDisplayDriver.at(outputExt); - return RtUString(displayFormat.GetText()); + return _GetOutputDisplayDriverType(outputExt); +} + +// Overload used when creating the render view from a render settings' product. +static +RtUString +_GetOutputDisplayDriverType( + const VtDictionary &productSettings, + const TfToken &productName, + const TfToken &productType) +{ + // Use "ri:productType" from the product's namespaced settings if + // available. + const TfToken driverName = + VtDictionaryGet( + productSettings, + _tokens->riProductType.GetText(), + VtDefault = TfToken()); + + if (!driverName.IsEmpty()) { + return RtUString(driverName.GetText()); + } + + // Otherwise, use the extension from the product name and product type + // to determine the driver. + // + const std::string outputExt = TfGetExtension(productName.GetString()); + + if (productType == _tokens->deepRaster && outputExt == std::string("exr")) { + return RtUString(_tokens->deepexr.GetText()); + } + + return _GetOutputDisplayDriverType(outputExt); } // Temporary workaround for RMAN-21883: @@ -1656,7 +1703,8 @@ _ComputeRenderViewDesc( displayDesc.name = RtUString(product.name.GetText()); displayDesc.params = _ToRtParamList(product.namespacedSettings, _tokens->riDisplayDriverNamespace); - displayDesc.driver = _GetOutputDisplayDriverType(product.name); + displayDesc.driver = _GetOutputDisplayDriverType( + product.namespacedSettings, product.name, product.type); // XXX Temporary; see RMAN-21883 _ApplyOpenexrDriverWorkaround(&displayDesc); @@ -1920,6 +1968,12 @@ HdPrman_RenderParam::_ComputeIntegratorNode( integratorNodeType.GetString(), rileyIntegratorNode.params); } + + // TODO: Adjust when PxrPathTracer adds support for excludeSubset + if (integratorNodeType == HdPrmanIntegratorTokens->PbsPathTracer) { + _SetExcludeSubset(_lastExcludedRenderTags, + rileyIntegratorNode.params); + } return rileyIntegratorNode; } @@ -1949,6 +2003,12 @@ HdPrman_RenderParam::_ComputeIntegratorNode( integratorName, _integratorParams); } + + // TODO: Adjust when PxrPathTracer adds support for excludeSubset + if (integratorName == HdPrmanIntegratorTokens->PbsPathTracer.GetString()) { + _SetExcludeSubset(_lastExcludedRenderTags, + _integratorParams); + } return riley::ShadingNode{ riley::ShadingNode::Type::k_Integrator, @@ -1977,6 +2037,84 @@ HdPrman_RenderParam::_CreateIntegrator(HdRenderDelegate * const renderDelegate) _activeIntegratorId = _integratorId; } +void +HdPrman_RenderParam::SetActiveRenderTags( + const TfTokenVector& activeRenderTags, + HdRenderIndex* renderIndex) +{ + // sort the active tags for set_difference + TfTokenVector sortedTags(activeRenderTags); + std::sort(sortedTags.begin(), sortedTags.end()); + + // set for uniqueness, ordered for set_difference + std::set rprimTags; + for (const SdfPath& id : renderIndex->GetRprimIds()) { + const HdRprim* rprim = renderIndex->GetRprim(id); + rprimTags.insert(rprim->GetRenderTag()); + } + + // fast set for comparison with cached + TfToken::Set excludedTags; + + // All rprim tags not in activeTags should be excluded (rprim - active) + std::set_difference( + rprimTags.begin(), rprimTags.end(), + sortedTags.begin(), sortedTags.end(), + std::inserter(excludedTags, excludedTags.begin())); + if (excludedTags != _lastExcludedRenderTags) { + _lastExcludedRenderTags = excludedTags; + UpdateIntegrator(renderIndex); + } +} + +void +HdPrman_RenderParam::AddRenderTagToGroupingMembership( + const TfToken& renderTag, + RtParamList& params) +{ + // XXX: UStrings cannot be concatenated, and the only way to initialize a + // UString is with a char*. So things can get a little baroque here. The + // temporary variables hopefully help make it readable. + if (!renderTag.IsEmpty()) { + const std::string renderTagString = TfStringPrintf("%s%s", + _tokens->renderTagPrefix.GetText(), renderTag.GetText()); + + RtUString membership; + params.GetString(RixStr.k_grouping_membership, membership); + + if (membership.Empty()) { + membership = RtUString(renderTagString.c_str()); + } else { + const std::string membershipString = TfStringPrintf("%s %s", + renderTagString.c_str(), membership.CStr()); + membership = RtUString(membershipString.c_str()); + } + params.SetString(RixStr.k_grouping_membership, membership); + } +} + +/* static */ +void +HdPrman_RenderParam::_SetExcludeSubset( + const TfToken::Set& excludedTags, + RtParamList& params) { + // XXX: excludeSubset is not in RixStr. + // (excludesubset is, but we need a capital S.) + static const RtUString k_excludeSubset("excludeSubset"); + std::string exclude; + for (const TfToken& tag : excludedTags) { + if (tag.IsEmpty()) { + continue; + } + if (!exclude.empty()) { + exclude += " "; + } + exclude += _tokens->renderTagPrefix.GetString() + tag.GetString(); + } + // XXX: This should be the only place anyone sets excludeSubset + params.SetString(k_excludeSubset, RtUString(exclude.c_str())); +} + void HdPrman_RenderParam::UpdateIntegrator(const HdRenderIndex * const renderIndex) { @@ -2010,30 +2148,13 @@ HdPrman_RenderParam::_RenderThreadCallback() RixStr.k_dice_referencecamera, defaultReferenceCamera); - bool renderComplete = false; - while (!renderComplete) { - while (_renderThread->IsPauseRequested()) { - if (_renderThread->IsStopRequested()) { - break; - } - std::this_thread::sleep_for(std::chrono::milliseconds(10)); - } - if (_renderThread->IsStopRequested()) { - break; - } - - HdPrman_RenderViewContext &ctx = GetRenderViewContext(); - - const riley::RenderViewId renderViewIds[] = { ctx.GetRenderViewId() }; + HdPrman_RenderViewContext &ctx = GetRenderViewContext(); + const riley::RenderViewId renderViewIds[] = { ctx.GetRenderViewId() }; - _riley->Render( - { static_cast(TfArraySize(renderViewIds)), - renderViewIds }, - renderOptions); - - // If a pause was requested, we may have stopped early - renderComplete = !_renderThread->IsPauseDirty(); - } + _riley->Render( + { static_cast(TfArraySize(renderViewIds)), + renderViewIds }, + renderOptions); } void @@ -2329,19 +2450,19 @@ HdPrman_RenderParam::StopRender(bool blocking) // is a no-op and we need to call it again after we call into Riley. // 2. We've occassionally seen cases where Stop() returns successfully, // but the riley threadpools don't shut down right away. + + // Only let one thread try to stop things at once. + std::lock_guard lock(_stopMutex); + while (_renderThread->IsRendering()) { { TRACE_SCOPE("riley::Stop"); _riley->Stop(); } using namespace std::chrono_literals; - std::this_thread::sleep_for(100us); - } - - // Clear out old stats values. TODO: should we be calling this here? - if (_statsSession) - { - _statsSession->RemoveOldMetricData(); + if (_renderThread->IsRendering()) { + std::this_thread::sleep_for(1ms); + } } } @@ -2354,7 +2475,7 @@ HdPrman_RenderParam::IsRendering() bool HdPrman_RenderParam::IsPauseRequested() { - return _renderThread && _renderThread->IsPauseRequested(); + return false; } void @@ -2538,7 +2659,9 @@ _GetOutputParamsAndUpdateRmanNames( settingName.GetText(), "driver:parameters:aov:")) { RtUString name(TfStringGetSuffix(settingName, ':').c_str()); if (name == RixStr.k_name) { - hdAovName = settingVal.UncheckedGet(); + hdAovName = settingVal.IsHolding() ? + TfToken(settingVal.Get().c_str()) : + settingVal.Get(); } else { HdPrman_Utils::SetParamFromVtValue(name, settingVal, TfToken(), ¶ms); diff --git a/third_party/renderman-25/plugin/hdPrman/renderParam.h b/third_party/renderman-25/plugin/hdPrman/renderParam.h index 330d67bc76..3a79b9685e 100644 --- a/third_party/renderman-25/plugin/hdPrman/renderParam.h +++ b/third_party/renderman-25/plugin/hdPrman/renderParam.h @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_RENDER_PARAM_H #define EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_RENDER_PARAM_H @@ -92,7 +75,7 @@ class HdPrman_RenderParam : public HdRenderParam HDPRMAN_API RtParamList ConvertAttributes(HdSceneDelegate *sceneDelegate, - SdfPath const& id, bool isGeometry, bool *visible=nullptr); + SdfPath const& id, bool isGeometry); // A vector of Riley coordinate system id's. using RileyCoordSysIdVec = std::vector; @@ -115,6 +98,12 @@ class HdPrman_RenderParam : public HdRenderParam SdfPath const& id, VtArray const& categories, RtParamList& attrs); + + /// Prepends the given \p renderTag to grouping:membership in \p params. + HDPRMAN_API + static void AddRenderTagToGroupingMembership( + const TfToken& renderTag, + RtParamList& params); /// Release any coordinate system bindings cached for the given /// rprim id. @@ -215,6 +204,15 @@ class HdPrman_RenderParam : public HdRenderParam // Invalidate texture at path. void InvalidateTexture(const std::string &path); + + /// Call this from RenderPass to set which render tags should be enabled. + /// Calling will always trigger a render index traversal, and may trigger an + /// intergrator update, so only call it if you strongly suspect that either + /// the set of active render tags or the set of rprim render tags in the + /// scene has changed. + void SetActiveRenderTags( + const TfTokenVector& activeRenderTags, + HdRenderIndex* renderIndex); void UpdateIntegrator(const HdRenderIndex * renderIndex); @@ -416,6 +414,11 @@ class HdPrman_RenderParam : public HdRenderParam RtParamList& displayParams, bool isXpu); void _UpdateShutterInterval(const RtParamList &composedParams); + + static + void _SetExcludeSubset( + const TfToken::Set& excludedTags, + RtParamList& params); private: // Top-level entrypoint to PRMan. @@ -437,6 +440,8 @@ class HdPrman_RenderParam : public HdRenderParam // Riley instance. riley::Riley *_riley; + // Mutex around riley->Stop(), so as to be well-behaved callers. + std::mutex _stopMutex; std::unique_ptr _renderThread; std::unique_ptr _framebuffer; @@ -470,6 +475,8 @@ class HdPrman_RenderParam : public HdRenderParam // Fallback material for volumes that don't have materials. riley::MaterialId _fallbackVolumeMaterialId; + + TfToken::Set _lastExcludedRenderTags; riley::IntegratorId _quickIntegratorId; RtParamList _quickIntegratorParams; diff --git a/third_party/renderman-25/plugin/hdPrman/renderPass.cpp b/third_party/renderman-25/plugin/hdPrman/renderPass.cpp index b360f40221..ec6f456ca9 100644 --- a/third_party/renderman-25/plugin/hdPrman/renderPass.cpp +++ b/third_party/renderman-25/plugin/hdPrman/renderPass.cpp @@ -1,51 +1,31 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. -// -#include "hdPrman/renderPass.h" +#include "hdPrman/renderPass.h" + #include "hdPrman/camera.h" #include "hdPrman/debugCodes.h" #include "hdPrman/debugUtil.h" -#include "hdPrman/gprimbase.h" #include "hdPrman/framebuffer.h" -#include "hdPrman/renderParam.h" #include "hdPrman/renderBuffer.h" #include "hdPrman/renderDelegate.h" +#include "hdPrman/renderParam.h" #include "hdPrman/renderSettings.h" #include "hdPrman/rixStrings.h" #include "hdPrman/utils.h" #include "pxr/imaging/hd/perfLog.h" #include "pxr/imaging/hd/renderPassState.h" +#include "pxr/imaging/hd/rprim.h" #include "pxr/imaging/hd/utils.h" -#include "pxr/base/gf/vec2f.h" -#include "pxr/base/gf/rotation.h" -#include "pxr/base/tf/getenv.h" #include "pxr/base/tf/envSetting.h" +#include "pxr/base/tf/token.h" -#include "Riley.h" -#include "RixShadingUtils.h" -#include "RixPredefinedStrings.hpp" +#include PXR_NAMESPACE_OPEN_SCOPE @@ -245,40 +225,6 @@ _HasLegacyRenderSpec( return false; } -// Update visibility settings of riley instances for the active render tags. -// -// The render pass's _Execute method takes a list of renderTags, -// and only rprims with those tags should be visible, -// so we need to figure out the corresponding riley instance ids -// and update the visibility settings in riley. -// It might seem like the rprims would receive a Sync call -// to deal with this, but they only do when they first become visible. -// After that tag based visibility is a per-pass problem. - -void -_UpdateRprimVisibilityForPass( - TfTokenVector const & renderTags, - HdRenderIndex *index, - riley::Riley *riley ) -{ - for (auto id : index->GetRprimIds()) { - HdRprim const *rprim = index->GetRprim(id); - const TfToken tag = rprim->GetRenderTag(); - - // If the rprim's render tag is not in the pass's list of tags it's - // definitely not visible, but if it is, look at the rprim's visibility. - const bool vis = - std::count(renderTags.begin(), renderTags.end(), tag) && - rprim->IsVisible(); - - HdPrman_GprimBase const * hdprman_rprim = - dynamic_cast(rprim); - if (hdprman_rprim) { - hdprman_rprim->UpdateInstanceVisibility( vis, riley); - } - } -} - } // end anonymous namespace @@ -374,8 +320,8 @@ HdPrman_RenderPass::_Execute( currentLegacySettingsVersion); } } - - _UpdateRprimVisibilityFromTaskRenderTags(renderTags); + + _UpdateActiveRenderTagsIfChanged(renderTags); // ------------------------------------------------------------------------ // Determine if we can drive the render pass using the render settings @@ -696,30 +642,18 @@ HdPrman_RenderPass::_RenderInMainThread() // XXX Data flow for purpose is currently using the task's render tags. // Update to factor render settings prim's opinion. void -HdPrman_RenderPass::_UpdateRprimVisibilityFromTaskRenderTags( - TfTokenVector const &renderTags) +HdPrman_RenderPass::_UpdateActiveRenderTagsIfChanged( + const TfTokenVector& taskRenderTags) { const int taskRenderTagsVersion = GetRenderIndex()->GetChangeTracker().GetTaskRenderTagsVersion(); const int rprimRenderTagVersion = GetRenderIndex()->GetChangeTracker().GetRenderTagVersion(); - - { - // Update visibility settings of riley instances for active render tags. - if (!_lastTaskRenderTagsVersion && !_lastRprimRenderTagVersion) { - // No need to update the first time, only when the tags change. - _lastTaskRenderTagsVersion = taskRenderTagsVersion; - _lastRprimRenderTagVersion = rprimRenderTagVersion; - - } else if((taskRenderTagsVersion != _lastTaskRenderTagsVersion) || - (rprimRenderTagVersion != _lastRprimRenderTagVersion)) { - // AcquireRiley will stop rendering and increase sceneVersion - // so that the render will be re-started below. - riley::Riley * const riley = _renderParam->AcquireRiley(); - _UpdateRprimVisibilityForPass( renderTags, GetRenderIndex(), riley); - _lastTaskRenderTagsVersion = taskRenderTagsVersion; - _lastRprimRenderTagVersion = rprimRenderTagVersion; - } + if ((taskRenderTagsVersion != _lastTaskRenderTagsVersion) || + (rprimRenderTagVersion != _lastRprimRenderTagVersion)) { + _renderParam->SetActiveRenderTags(taskRenderTags, GetRenderIndex()); + _lastTaskRenderTagsVersion = taskRenderTagsVersion; + _lastRprimRenderTagVersion = rprimRenderTagVersion; } } diff --git a/third_party/renderman-25/plugin/hdPrman/renderPass.h b/third_party/renderman-25/plugin/hdPrman/renderPass.h index c4de0ea53f..71e2aaecce 100644 --- a/third_party/renderman-25/plugin/hdPrman/renderPass.h +++ b/third_party/renderman-25/plugin/hdPrman/renderPass.h @@ -1,33 +1,17 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_RENDER_PASS_H #define EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_RENDER_PASS_H -#include "pxr/pxr.h" #include "pxr/imaging/hd/renderPass.h" -#include "Riley.h" +#include "pxr/base/tf/token.h" + +#include "pxr/pxr.h" #include @@ -65,8 +49,8 @@ class HdPrman_RenderPass final : public HdRenderPass const HdRenderPassStateSharedPtr &renderPassState, HdPrman_CameraContext *cameraContext); - void _UpdateRprimVisibilityFromTaskRenderTags( - TfTokenVector const &renderTags); + void _UpdateActiveRenderTagsIfChanged( + const TfTokenVector& taskRenderTags); HdPrman_RenderSettings* _GetDrivingRenderSettingsPrim() const; diff --git a/third_party/renderman-25/plugin/hdPrman/renderPassSceneIndex.cpp b/third_party/renderman-25/plugin/hdPrman/renderPassSceneIndex.cpp new file mode 100644 index 0000000000..b62ce89a10 --- /dev/null +++ b/third_party/renderman-25/plugin/hdPrman/renderPassSceneIndex.cpp @@ -0,0 +1,548 @@ +// Copyright 2024 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. + +#include "hdPrman/renderPassSceneIndex.h" +#include "hdPrman/tokens.h" + +#include "pxr/imaging/hd/version.h" + +#include "pxr/base/tf/smallVector.h" +#include "pxr/imaging/hd/collectionSchema.h" +#include "pxr/imaging/hd/collectionsSchema.h" +#include "pxr/imaging/hd/containerDataSourceEditor.h" +#include "pxr/imaging/hd/dataSourceLocator.h" +#include "pxr/imaging/hd/dataSourceTypeDefs.h" +#include "pxr/imaging/hd/dependenciesSchema.h" +#include "pxr/imaging/hd/filteringSceneIndex.h" +#include "pxr/imaging/hd/overlayContainerDataSource.h" +#include "pxr/imaging/hd/primvarsSchema.h" +#include "pxr/imaging/hd/renderPassSchema.h" +#include "pxr/imaging/hd/retainedDataSource.h" +#include "pxr/imaging/hd/sceneGlobalsSchema.h" +#include "pxr/imaging/hd/sceneIndexPrimView.h" +#include "pxr/imaging/hd/schema.h" +#include "pxr/imaging/hd/tokens.h" +#include "pxr/imaging/hd/visibilitySchema.h" +#include "pxr/imaging/hdsi/utils.h" +#include "pxr/base/trace/trace.h" + +PXR_NAMESPACE_OPEN_SCOPE + +TF_DEFINE_PRIVATE_TOKENS( + _tokens, + (renderVisibility) + (cameraVisibility) + (matte) + (prune) + ((riAttributesRiMatte, "ri:attributes:Ri:Matte")) + ((riAttributesVisibilityCamera, "ri:attributes:visibility:camera")) +); + +/* static */ +HdPrman_RenderPassSceneIndexRefPtr +HdPrman_RenderPassSceneIndex::New( + const HdSceneIndexBaseRefPtr& inputSceneIndex) +{ + return TfCreateRefPtr( + new HdPrman_RenderPassSceneIndex(inputSceneIndex)); +} + +HdPrman_RenderPassSceneIndex::HdPrman_RenderPassSceneIndex( + const HdSceneIndexBaseRefPtr &inputSceneIndex) +: HdSingleInputFilteringSceneIndexBase(inputSceneIndex) +{ +} + +static bool +_IsGeometryType(const TfToken &primType) +{ + // Additional gprim types supported by HdPrman, beyond those in + // HdPrimTypeIsGprim(). + static const TfTokenVector extraGeomTypes = { + HdPrimTypeTokens->cone, + HdPrimTypeTokens->cylinder, + HdPrimTypeTokens->sphere, + HdPrmanTokens->meshLightSourceMesh, + HdPrmanTokens->meshLightSourceVolume + }; + return HdPrimTypeIsGprim(primType) || + std::find(extraGeomTypes.begin(), extraGeomTypes.end(), primType) + != extraGeomTypes.end(); +} + +// Returns true if the renderVisibility rules apply to this prim type. +static bool +_ShouldApplyPassVisibility(const TfToken &primType) +{ + return _IsGeometryType(primType) || HdPrimTypeIsLight(primType) || + primType == HdPrimTypeTokens->lightFilter; +} + +static bool +_IsVisible(const HdContainerDataSourceHandle& primSource) +{ + if (const auto visSchema = HdVisibilitySchema::GetFromParent(primSource)) { + if (const HdBoolDataSourceHandle visDs = visSchema.GetVisibility()) { + return visDs->GetTypedValue(0.0f); + } + } + return true; +} + +static bool +_IsVisibleToCamera(const HdContainerDataSourceHandle& primSource) +{ + // XXX Primvar queries like this might be a good candidate for + // helper API in hdsi/utils.h. + if (const HdPrimvarsSchema primvarsSchema = + HdPrimvarsSchema::GetFromParent(primSource)) { + if (HdPrimvarSchema primvarSchema = + primvarsSchema.GetPrimvar(_tokens->riAttributesVisibilityCamera)) { + if (const auto sampledDataSource = + primvarSchema.GetPrimvarValue()) { + const VtValue value = sampledDataSource->GetValue(0); + if (!value.IsEmpty()) { + if (value.IsHolding>()) { + return value.UncheckedGet(); + } + } + } + } + } + return true; +} + +bool +HdPrman_RenderPassSceneIndex::_RenderPassState::DoesOverrideMatte( + SdfPath const& primPath, + HdSceneIndexPrim const& prim) const +{ + return matteEval + && _IsGeometryType(prim.primType) + && matteEval->Match(primPath); +} + +bool +HdPrman_RenderPassSceneIndex::_RenderPassState::DoesOverrideVis( + SdfPath const& primPath, + HdSceneIndexPrim const& prim) const +{ + return renderVisEval + && _ShouldApplyPassVisibility(prim.primType) + && !renderVisEval->Match(primPath) + && _IsVisible(prim.dataSource); +} + +bool +HdPrman_RenderPassSceneIndex::_RenderPassState::DoesOverrideCameraVis( + SdfPath const& primPath, + HdSceneIndexPrim const& prim) const +{ + return cameraVisEval + && _ShouldApplyPassVisibility(prim.primType) + && !cameraVisEval->Match(primPath) + && _IsVisibleToCamera(prim.dataSource); +} + +bool +HdPrman_RenderPassSceneIndex::_RenderPassState::DoesPrune( + SdfPath const& primPath) const +{ + return pruneEval && pruneEval->Match(primPath); +} + +HdSceneIndexPrim +HdPrman_RenderPassSceneIndex::GetPrim( + const SdfPath &primPath) const +{ + // Pruning + // + // Note that we also apply pruning in GetChildPrimPaths(), but + // this ensures that even if a downstream scene index asks + // for a pruned path, it will remain pruned. + if (_activeRenderPass.DoesPrune(primPath)) { + return HdSceneIndexPrim(); + } + + HdSceneIndexPrim prim = _GetInputSceneIndex()->GetPrim(primPath); + + // Temp storage for overriding primvars. + TfSmallVector primvarNames; + TfSmallVector primvarVals; + + // Render Visibility -> HdVisibilitySchema + // + // Renderable prims that are visible in the upstream scene index, + // but excluded from the pass renderVisibility collection, get their + // visibility overriden to 0. + // + if (_activeRenderPass.DoesOverrideVis(primPath, prim)) { + static const HdContainerDataSourceHandle invisDs = + HdRetainedContainerDataSource::New( + HdVisibilitySchema::GetSchemaToken(), + HdVisibilitySchema::Builder() + .SetVisibility( + HdRetainedTypedSampledDataSource::New(0)) + .Build()); + prim.dataSource = + HdOverlayContainerDataSource::New(invisDs, prim.dataSource); + } + + // Camera Visibility -> ri:visibility:camera + // + // Renderable prims that are camera-visible in the upstream scene index, + // but excluded from the pass cameraVisibility collection, get their + // riAttributesVisibilityCamera primvar overriden to 0. + // + if (_activeRenderPass.DoesOverrideCameraVis(primPath, prim)) { + static const HdContainerDataSourceHandle cameraInvisDs = + HdPrimvarSchema::Builder() + .SetPrimvarValue( + HdRetainedTypedSampledDataSource::New(0)) + .SetInterpolation( + HdPrimvarSchema::BuildInterpolationDataSource( + HdPrimvarSchemaTokens->constant)) + .Build(); + primvarNames.push_back(_tokens->riAttributesVisibilityCamera); + primvarVals.push_back(cameraInvisDs); + } + + // Matte -> ri:Matte + // + // If the matte pattern matches this prim, set ri:Matte=1. + // Matte only applies to geometry types. + // We do not bother to check if the upstream prim already + // has matte set since that is essentially never the case. + // + if (_activeRenderPass.DoesOverrideMatte(primPath, prim)) { + static const HdContainerDataSourceHandle matteDs = + HdPrimvarSchema::Builder() + .SetPrimvarValue( + HdRetainedTypedSampledDataSource::New(1)) + .SetInterpolation(HdPrimvarSchema:: + BuildInterpolationDataSource( + HdPrimvarSchemaTokens->constant)) + .Build(); + primvarNames.push_back(_tokens->riAttributesRiMatte); + primvarVals.push_back(matteDs); + } + + // Apply any accumulated primvar overrides. + if (!primvarNames.empty()) { + prim.dataSource = + HdOverlayContainerDataSource::New( + HdRetainedContainerDataSource::New( + HdPrimvarsSchema::GetSchemaToken(), + HdPrimvarsSchema::BuildRetained( + primvarNames.size(), + primvarNames.data(), + primvarVals.data())), + prim.dataSource); + } + + return prim; +} + +SdfPathVector +HdPrman_RenderPassSceneIndex::GetChildPrimPaths( + const SdfPath &primPath) const +{ + if (_activeRenderPass.pruneEval) { + SdfPathVector childPathVec = + _GetInputSceneIndex()->GetChildPrimPaths(primPath); + HdsiUtilsRemovePrunedChildren(primPath, *_activeRenderPass.pruneEval, + &childPathVec); + return childPathVec; + } else { + return _GetInputSceneIndex()->GetChildPrimPaths(primPath); + } +} + +/* + +General notes on change processing and invalidation: + +- Rather than lazily evaluate the active render pass state, + and be prepared to do so from multiple caller threads, we + instead greedily set up the active render pass state. + Though greedy, this is a small amount of computation, + and only triggered on changes to two specific scene locations: + the root scope where HdSceneGlobalsSchema lives, and the + scope where the designated active render pass lives. + +- The list of entries for prims added, dirtied, or removed + must be filtered against the active render pass prune collection. + +- The list of entries for prims added, dirtied, or removed + can imply changes to which render pass is active, or to the + contents of the active render pass. In either case, if the + effective render pass state changes, downstream observers + must be notified about the effects. + +*/ + +// Helper to scan an entry vector for an entry that +// could affect the active render pass. +template +inline static bool +_EntryCouldAffectPass( + const ENTRIES &entries, + SdfPath const& activeRenderPassPath) +{ + for (const auto& entry: entries) { + // The prim at the root path contains the HdSceneGlobalsSchema. + // The prim at the render pass path controls its behavior. + if (entry.primPath.IsAbsoluteRootPath() + || entry.primPath == activeRenderPassPath) { + return true; + } + } + return false; +} + +// Helper to apply pruning to an entry list. +// Returns true if any pruning was applied, putting surviving entries +// into *postPruneEntries. +template +inline static bool +_PruneEntries( + std::optional &pruneEval, + const ENTRIES &entries, ENTRIES *postPruneEntries) +{ + if (!pruneEval) { + // No pruning active. + return false; + } + // Pre-pass to see if any prune applies to the list. + bool foundEntryToPrune = false; + for (const auto& entry: entries) { + if (pruneEval->Match(entry.primPath)) { + foundEntryToPrune = true; + break; + } + } + if (!foundEntryToPrune) { + // No entries to prune. + return false; + } else { + // Prune matching entries. + for (const auto& entry: entries) { + if (!pruneEval->Match(entry.primPath)) { + // Accumulate survivors. + postPruneEntries->push_back(entry); + } + } + return true; + } +} + +void +HdPrman_RenderPassSceneIndex::_PrimsAdded( + const HdSceneIndexBase &sender, + const HdSceneIndexObserver::AddedPrimEntries &entries) +{ + HdSceneIndexObserver::AddedPrimEntries extraAddedEntries; + HdSceneIndexObserver::DirtiedPrimEntries extraDirtyEntries; + HdSceneIndexObserver::RemovedPrimEntries extraRemovedEntries; + + // Check if any entry could affect the active render pass. + if (_EntryCouldAffectPass(entries, _activeRenderPass.renderPassPath)) { + _UpdateActiveRenderPassState( + &extraAddedEntries, &extraDirtyEntries, &extraRemovedEntries); + } + + // Filter entries against any active render pass prune collection. + if (!_PruneEntries(_activeRenderPass.pruneEval, entries, + &extraAddedEntries)) { + _SendPrimsAdded(entries); + } + + _SendPrimsAdded(extraAddedEntries); + _SendPrimsRemoved(extraRemovedEntries); + _SendPrimsDirtied(extraDirtyEntries); +} + +void +HdPrman_RenderPassSceneIndex::_PrimsRemoved( + const HdSceneIndexBase &sender, + const HdSceneIndexObserver::RemovedPrimEntries &entries) +{ + HdSceneIndexObserver::AddedPrimEntries extraAddedEntries; + HdSceneIndexObserver::DirtiedPrimEntries extraDirtyEntries; + HdSceneIndexObserver::RemovedPrimEntries extraRemovedEntries; + + // Check if any entry could affect the active render pass. + if (_EntryCouldAffectPass(entries, _activeRenderPass.renderPassPath)) { + _UpdateActiveRenderPassState( + &extraAddedEntries, &extraDirtyEntries, &extraRemovedEntries); + } + + // Filter entries against any active render pass prune collection. + if (!_PruneEntries(_activeRenderPass.pruneEval, entries, + &extraRemovedEntries)) { + _SendPrimsRemoved(entries); + } + + _SendPrimsAdded(extraAddedEntries); + _SendPrimsRemoved(extraRemovedEntries); + _SendPrimsDirtied(extraDirtyEntries); +} + +void +HdPrman_RenderPassSceneIndex::_PrimsDirtied( + const HdSceneIndexBase &sender, + const HdSceneIndexObserver::DirtiedPrimEntries &entries) +{ + HdSceneIndexObserver::AddedPrimEntries extraAddedEntries; + HdSceneIndexObserver::DirtiedPrimEntries extraDirtyEntries; + HdSceneIndexObserver::RemovedPrimEntries extraRemovedEntries; + + // Check if any entry could affect the active render pass. + if (_EntryCouldAffectPass(entries, _activeRenderPass.renderPassPath)) { + _UpdateActiveRenderPassState( + &extraAddedEntries, &extraDirtyEntries, &extraRemovedEntries); + } + + // Filter entries against any active render pass prune collection. + if (!_PruneEntries(_activeRenderPass.pruneEval, entries, + &extraDirtyEntries)) { + _SendPrimsDirtied(entries); + } + + _SendPrimsAdded(extraAddedEntries); + _SendPrimsRemoved(extraRemovedEntries); + _SendPrimsDirtied(extraDirtyEntries); +} + +HdPrman_RenderPassSceneIndex::~HdPrman_RenderPassSceneIndex() = default; + +// Helper method to compile a collection evaluator. +static void +_CompileCollection( + HdCollectionsSchema &collections, + TfToken const& collectionName, + HdSceneIndexBaseRefPtr const& sceneIndex, + SdfPathExpression *expr, + std::optional *eval) +{ + if (HdCollectionSchema collection = + collections.GetCollection(collectionName)) { + if (HdPathExpressionDataSourceHandle pathExprDs = + collection.GetMembershipExpression()) { + *expr = pathExprDs->GetTypedValue(0.0); + if (!expr->IsEmpty()) { + *eval = HdCollectionExpressionEvaluator(sceneIndex, *expr); + } + } + } +} + +void +HdPrman_RenderPassSceneIndex::_UpdateActiveRenderPassState( + HdSceneIndexObserver::AddedPrimEntries *addedEntries, + HdSceneIndexObserver::DirtiedPrimEntries *dirtyEntries, + HdSceneIndexObserver::RemovedPrimEntries *removedEntries) +{ + TRACE_FUNCTION(); + + // Swap out the prior pass state to compare against. + _RenderPassState &state = _activeRenderPass; + _RenderPassState priorState; + std::swap(state, priorState); + + // Check upstream scene index for an active render pass. + HdSceneIndexBaseRefPtr inputSceneIndex = _GetInputSceneIndex(); + HdSceneGlobalsSchema globals = + HdSceneGlobalsSchema::GetFromSceneIndex(inputSceneIndex); + if (HdPathDataSourceHandle pathDs = globals.GetActiveRenderPassPrim()) { + state.renderPassPath = pathDs->GetTypedValue(0.0); + } + if (state.renderPassPath.IsEmpty() && priorState.renderPassPath.IsEmpty()) { + // Avoid further work if no render pass was or is active. + return; + } + if (!state.renderPassPath.IsEmpty()) { + const HdSceneIndexPrim passPrim = + inputSceneIndex->GetPrim(state.renderPassPath); + if (HdCollectionsSchema collections = + HdCollectionsSchema::GetFromParent(passPrim.dataSource)) { + // Prepare evaluators for render pass collections. + _CompileCollection(collections, _tokens->matte, + inputSceneIndex, + &state.matteExpr, + &state.matteEval); + _CompileCollection(collections, _tokens->renderVisibility, + inputSceneIndex, + &state.renderVisExpr, + &state.renderVisEval); + _CompileCollection(collections, _tokens->cameraVisibility, + inputSceneIndex, + &state.cameraVisExpr, + &state.cameraVisEval); + _CompileCollection(collections, _tokens->prune, + inputSceneIndex, + &state.pruneExpr, + &state.pruneEval); + } + } + + // Short-circuit the analysis below based on which patterns changed. + const bool visOrMatteExprDidChange = + state.matteExpr != priorState.matteExpr || + state.renderVisExpr != priorState.renderVisExpr || + state.cameraVisExpr != priorState.cameraVisExpr; + + if (state.pruneExpr == priorState.pruneExpr && !visOrMatteExprDidChange) { + // No patterns changed; nothing to invalidate. + return; + } + + // Generate change entries for affected prims. + // Consider all upstream prims. + // + // TODO: HdCollectionExpressionEvaluator::PopulateAllMatches() + // should be used here instead, since in the future it will handle + // instance matches as well as parallel traversal. + // + for (const SdfPath &path: HdSceneIndexPrimView(_GetInputSceneIndex())) { + if (priorState.DoesPrune(path)) { + // The prim had been pruned. + if (!state.DoesPrune(path)) { + // The prim is no longer pruned, so add it back. + HdSceneIndexPrim prim = _GetInputSceneIndex()->GetPrim(path); + addedEntries->push_back({path, prim.primType}); + } else { + // The prim is still pruned, so nothing to do. + } + } else if (state.DoesPrune(path)) { + // The prim is newly pruned, so remove it. + removedEntries->push_back({path}); + } else if (visOrMatteExprDidChange) { + // Determine which (if any) locators on the upstream prim + // are dirtied by the change in render pass state. + const HdSceneIndexPrim prim = _GetInputSceneIndex()->GetPrim(path); + const bool visibilityDidChange = + (priorState.DoesOverrideVis(path, prim) + != state.DoesOverrideVis(path, prim)); + const bool primvarsDidChange = + (priorState.DoesOverrideCameraVis(path, prim) + != state.DoesOverrideCameraVis(path, prim)) || + (priorState.DoesOverrideMatte(path, prim) + != state.DoesOverrideMatte(path, prim)); + if (primvarsDidChange || visibilityDidChange) { + HdDataSourceLocatorSet locators; + if (primvarsDidChange) { + locators.insert(HdPrimvarsSchema::GetDefaultLocator()); + } + if (visibilityDidChange) { + locators.insert(HdVisibilitySchema::GetDefaultLocator()); + } + dirtyEntries->push_back({path, locators}); + } + } + } +} + +PXR_NAMESPACE_CLOSE_SCOPE diff --git a/third_party/renderman-25/plugin/hdPrman/renderPassSceneIndex.h b/third_party/renderman-25/plugin/hdPrman/renderPassSceneIndex.h new file mode 100644 index 0000000000..23d80cdcb3 --- /dev/null +++ b/third_party/renderman-25/plugin/hdPrman/renderPassSceneIndex.h @@ -0,0 +1,93 @@ +// +// Copyright 2024 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +#ifndef EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_RENDER_PASS_SCENE_INDEX_H +#define EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_RENDER_PASS_SCENE_INDEX_H + +#include "pxr/pxr.h" +#include "pxr/imaging/hd/collectionExpressionEvaluator.h" +#include "pxr/imaging/hd/filteringSceneIndex.h" +#include + +PXR_NAMESPACE_OPEN_SCOPE + +TF_DECLARE_REF_PTRS(HdPrman_RenderPassSceneIndex); + +/// HdPrman_RenderPassSceneIndex applies the active render pass +/// specified in the HdSceneGlobalsSchema, modifying the scene +/// contents as needed. +/// +class HdPrman_RenderPassSceneIndex : + public HdSingleInputFilteringSceneIndexBase +{ +public: + static HdPrman_RenderPassSceneIndexRefPtr + New(const HdSceneIndexBaseRefPtr& inputSceneIndex); + + HdSceneIndexPrim GetPrim(const SdfPath &primPath) const override; + SdfPathVector GetChildPrimPaths(const SdfPath &primPath) const override; + +protected: + HdPrman_RenderPassSceneIndex( + const HdSceneIndexBaseRefPtr& inputSceneIndex); + ~HdPrman_RenderPassSceneIndex(); + + void _PrimsAdded( + const HdSceneIndexBase &sender, + const HdSceneIndexObserver::AddedPrimEntries &entries) override; + void _PrimsRemoved( + const HdSceneIndexBase &sender, + const HdSceneIndexObserver::RemovedPrimEntries &entries) override; + void _PrimsDirtied( + const HdSceneIndexBase &sender, + const HdSceneIndexObserver::DirtiedPrimEntries &entries) override; + +private: + // State specified by a render pass. + // If renderPassPath is the empty path, no render pass is active. + // Collection evaluators are set sparsely, corresponding to + // the presence of the collection in the render pass schema. + struct _RenderPassState { + SdfPath renderPassPath; + + // Retain the expressions so we can compare old vs. new state. + SdfPathExpression matteExpr; + SdfPathExpression renderVisExpr; + SdfPathExpression cameraVisExpr; + SdfPathExpression pruneExpr; + + // Evalulators for each pattern expression. + std::optional matteEval; + std::optional renderVisEval; + std::optional cameraVisEval; + std::optional pruneEval; + + bool DoesOverrideMatte( + const SdfPath &primPath, + HdSceneIndexPrim const& prim) const; + bool DoesOverrideVis( + const SdfPath &primPath, + HdSceneIndexPrim const& prim) const; + bool DoesOverrideCameraVis( + const SdfPath &primPath, + HdSceneIndexPrim const& prim) const; + bool DoesPrune( + const SdfPath &primPath) const; + }; + + // Pull on the scene globals schema for the active render pass, + // computing and caching its state in _activeRenderPass. + void _UpdateActiveRenderPassState( + HdSceneIndexObserver::AddedPrimEntries *addedEntries, + HdSceneIndexObserver::DirtiedPrimEntries *dirtyEntries, + HdSceneIndexObserver::RemovedPrimEntries *removedEntries); + + // State for the active render pass. + _RenderPassState _activeRenderPass; +}; + +PXR_NAMESPACE_CLOSE_SCOPE + +#endif diff --git a/third_party/renderman-25/plugin/hdPrman/renderPassSceneIndexPlugin.cpp b/third_party/renderman-25/plugin/hdPrman/renderPassSceneIndexPlugin.cpp new file mode 100644 index 0000000000..4a4d34ffaf --- /dev/null +++ b/third_party/renderman-25/plugin/hdPrman/renderPassSceneIndexPlugin.cpp @@ -0,0 +1,53 @@ +// +// Copyright 2024 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. + +#include "hdPrman/renderPassSceneIndexPlugin.h" + +#include "pxr/imaging/hd/retainedDataSource.h" +#include "pxr/imaging/hd/sceneIndexPluginRegistry.h" +#include "pxr/imaging/hd/tokens.h" +#include "hdPrman/renderPassSceneIndex.h" + +PXR_NAMESPACE_OPEN_SCOPE + +TF_DEFINE_PRIVATE_TOKENS( + _tokens, + ((sceneIndexPluginName, "HdPrman_RenderPassSceneIndexPlugin")) +); + +static const char * const _pluginDisplayName = "Prman"; + +TF_REGISTRY_FUNCTION(TfType) +{ + HdSceneIndexPluginRegistry + ::Define(); +} + +TF_REGISTRY_FUNCTION(HdSceneIndexPlugin) +{ + // We need an "insertion point" that's *after* general material resolve. + const HdSceneIndexPluginRegistry::InsertionPhase insertionPhase = 115; + + HdSceneIndexPluginRegistry::GetInstance().RegisterSceneIndexForRenderer( + _pluginDisplayName, + _tokens->sceneIndexPluginName, + nullptr, // No input args. + insertionPhase, + HdSceneIndexPluginRegistry::InsertionOrderAtStart); +} + +HdPrman_RenderPassSceneIndexPlugin:: +HdPrman_RenderPassSceneIndexPlugin() = default; + +HdSceneIndexBaseRefPtr +HdPrman_RenderPassSceneIndexPlugin::_AppendSceneIndex( + const HdSceneIndexBaseRefPtr &inputScene, + const HdContainerDataSourceHandle &inputArgs) +{ + return HdPrman_RenderPassSceneIndex::New(inputScene); +} + +PXR_NAMESPACE_CLOSE_SCOPE diff --git a/third_party/renderman-25/plugin/hdPrman/renderPassSceneIndexPlugin.h b/third_party/renderman-25/plugin/hdPrman/renderPassSceneIndexPlugin.h new file mode 100644 index 0000000000..5cee5b9ab8 --- /dev/null +++ b/third_party/renderman-25/plugin/hdPrman/renderPassSceneIndexPlugin.h @@ -0,0 +1,34 @@ +// +// Copyright 2024 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. + +#ifndef EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_RENDER_PASS_SCENE_INDEX_PLUGIN_H +#define EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_RENDER_PASS_SCENE_INDEX_PLUGIN_H + +#include "pxr/pxr.h" +#include "pxr/imaging/hd/sceneIndexPlugin.h" +#include "hdPrman/api.h" + +PXR_NAMESPACE_OPEN_SCOPE + +/// \class HdPrman_RenderPassSceneIndexPlugin +/// +/// Applies the active scene index in HdSceneGlobalsSchema +/// to the scene contents. +/// +class HdPrman_RenderPassSceneIndexPlugin : public HdSceneIndexPlugin +{ +public: + HdPrman_RenderPassSceneIndexPlugin(); + +protected: + HdSceneIndexBaseRefPtr _AppendSceneIndex( + const HdSceneIndexBaseRefPtr &inputScene, + const HdContainerDataSourceHandle &inputArgs) override; +}; + +PXR_NAMESPACE_CLOSE_SCOPE + +#endif diff --git a/third_party/renderman-25/plugin/hdPrman/renderSettings.cpp b/third_party/renderman-25/plugin/hdPrman/renderSettings.cpp index 37199a2b6c..0127d5ec72 100644 --- a/third_party/renderman-25/plugin/hdPrman/renderSettings.cpp +++ b/third_party/renderman-25/plugin/hdPrman/renderSettings.cpp @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "hdPrman/renderSettings.h" #include "hdPrman/debugCodes.h" @@ -192,6 +175,28 @@ _UpdateRileyCamera( } } +// Update the Frame number from the Stage Global Scene Index +void +_UpdateFrame( + const HdSceneIndexBaseRefPtr &terminalSi, + RtParamList *options) +{ + // Get the Frame from the Terminal Scene Index + double frame; + if (!HdUtils::GetCurrentFrame(terminalSi, &frame)) { + return; + } + + // k_Ri_Frame in Riley is an integer, not float. + // As an explicit policy choice, round down. + const int intFrame(floor(frame)); + + // Store on the options list to be used in a later Riley.SetOptions() call + HdPrman_Utils::SetParamFromVtValue( + RixStr.k_Ri_Frame, VtValue(intFrame), + /* role */ TfToken(), options); +} + // Create/update the render view and associated resources based on the // render product. void @@ -371,7 +376,7 @@ HdPrman_RenderSettings::UpdateAndRender( renderIndex, product.cameraPath, &cameraContext); - + const GfVec2f shutter = _ResolveShutterInterval(product, cameraContext, renderIndex); @@ -476,6 +481,11 @@ void HdPrman_RenderSettings::_Sync( } } + if (*dirtyBits & HdRenderSettings::DirtyFrameNumber || + *dirtyBits & HdRenderSettings::DirtyNamespacedSettings) { + _UpdateFrame(terminalSi, &_settingsOptions); + } + // XXX Preserve existing data flow for clients that don't populate the // sceneGlobals.activeRenderSettingsPrim locator at the root prim of the // scene index. In this scenario, scene options and render terminals @@ -495,7 +505,8 @@ void HdPrman_RenderSettings::_Sync( if (*dirtyBits & HdRenderSettings::DirtyNamespacedSettings || *dirtyBits & HdRenderSettings::DirtyActive || - *dirtyBits & HdRenderSettings::DirtyShutterInterval) { + *dirtyBits & HdRenderSettings::DirtyShutterInterval || + *dirtyBits & HdRenderSettings::DirtyFrameNumber) { // Handle attributes ... param->SetRenderSettingsPrimOptions(_settingsOptions); diff --git a/third_party/renderman-25/plugin/hdPrman/renderSettings.h b/third_party/renderman-25/plugin/hdPrman/renderSettings.h index 48c207db9d..763e1d10fb 100644 --- a/third_party/renderman-25/plugin/hdPrman/renderSettings.h +++ b/third_party/renderman-25/plugin/hdPrman/renderSettings.h @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_RENDER_SETTINGS_H #define EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_RENDER_SETTINGS_H diff --git a/third_party/renderman-25/plugin/hdPrman/renderSettingsFilteringSceneIndexPlugin.cpp b/third_party/renderman-25/plugin/hdPrman/renderSettingsFilteringSceneIndexPlugin.cpp index b25d972e31..8ee0ceb3b5 100644 --- a/third_party/renderman-25/plugin/hdPrman/renderSettingsFilteringSceneIndexPlugin.cpp +++ b/third_party/renderman-25/plugin/hdPrman/renderSettingsFilteringSceneIndexPlugin.cpp @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "hdPrman/renderSettingsFilteringSceneIndexPlugin.h" diff --git a/third_party/renderman-25/plugin/hdPrman/renderSettingsFilteringSceneIndexPlugin.h b/third_party/renderman-25/plugin/hdPrman/renderSettingsFilteringSceneIndexPlugin.h index 5f3090c1d9..a1b79145ad 100644 --- a/third_party/renderman-25/plugin/hdPrman/renderSettingsFilteringSceneIndexPlugin.h +++ b/third_party/renderman-25/plugin/hdPrman/renderSettingsFilteringSceneIndexPlugin.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_RENDER_SETTINGS_FILTERING_SCENE_INDEX_PLUGIN_H #define EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_RENDER_SETTINGS_FILTERING_SCENE_INDEX_PLUGIN_H diff --git a/third_party/renderman-25/plugin/hdPrman/renderTerminalOutputInvalidatingSceneIndexPlugin.cpp b/third_party/renderman-25/plugin/hdPrman/renderTerminalOutputInvalidatingSceneIndexPlugin.cpp index 5f7e64a9f9..7da73f24c6 100644 --- a/third_party/renderman-25/plugin/hdPrman/renderTerminalOutputInvalidatingSceneIndexPlugin.cpp +++ b/third_party/renderman-25/plugin/hdPrman/renderTerminalOutputInvalidatingSceneIndexPlugin.cpp @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. #include "hdPrman/renderTerminalOutputInvalidatingSceneIndexPlugin.h" diff --git a/third_party/renderman-25/plugin/hdPrman/renderTerminalOutputInvalidatingSceneIndexPlugin.h b/third_party/renderman-25/plugin/hdPrman/renderTerminalOutputInvalidatingSceneIndexPlugin.h index be7b8ed974..30aa155aa7 100644 --- a/third_party/renderman-25/plugin/hdPrman/renderTerminalOutputInvalidatingSceneIndexPlugin.h +++ b/third_party/renderman-25/plugin/hdPrman/renderTerminalOutputInvalidatingSceneIndexPlugin.h @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. #ifndef PXR_IMAGING_HDPRMAN_RENDER_TERMINAL_OUTPUT_INVALIDATING_SCENE_INDEX_PLUGIN_H #define PXR_IMAGING_HDPRMAN_RENDER_TERMINAL_OUTPUT_INVALIDATING_SCENE_INDEX_PLUGIN_H diff --git a/third_party/renderman-25/plugin/hdPrman/renderViewContext.cpp b/third_party/renderman-25/plugin/hdPrman/renderViewContext.cpp index 8f965427c6..4bead2c578 100644 --- a/third_party/renderman-25/plugin/hdPrman/renderViewContext.cpp +++ b/third_party/renderman-25/plugin/hdPrman/renderViewContext.cpp @@ -1,25 +1,8 @@ // // Copyright 2021 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "hdPrman/renderViewContext.h" #include "hdPrman/renderDelegate.h" diff --git a/third_party/renderman-25/plugin/hdPrman/renderViewContext.h b/third_party/renderman-25/plugin/hdPrman/renderViewContext.h index c9aab190a8..61fa572dc8 100644 --- a/third_party/renderman-25/plugin/hdPrman/renderViewContext.h +++ b/third_party/renderman-25/plugin/hdPrman/renderViewContext.h @@ -1,25 +1,8 @@ // // Copyright 2021 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_RENDER_VIEW_CONTEXT_H #define EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_RENDER_VIEW_CONTEXT_H diff --git a/third_party/renderman-25/plugin/hdPrman/rendererPlugin.cpp b/third_party/renderman-25/plugin/hdPrman/rendererPlugin.cpp index 43a8f1185e..c5bd745470 100644 --- a/third_party/renderman-25/plugin/hdPrman/rendererPlugin.cpp +++ b/third_party/renderman-25/plugin/hdPrman/rendererPlugin.cpp @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "hdPrman/renderDelegate.h" #include "pxr/imaging/plugin/hdPrmanLoader/rendererPlugin.h" diff --git a/third_party/renderman-25/plugin/hdPrman/resourceRegistry.cpp b/third_party/renderman-25/plugin/hdPrman/resourceRegistry.cpp index aa2afd5f49..c559404b0b 100644 --- a/third_party/renderman-25/plugin/hdPrman/resourceRegistry.cpp +++ b/third_party/renderman-25/plugin/hdPrman/resourceRegistry.cpp @@ -1,25 +1,8 @@ // // Copyright 2020 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "hdPrman/resourceRegistry.h" #include "hdPrman/renderParam.h" diff --git a/third_party/renderman-25/plugin/hdPrman/resourceRegistry.h b/third_party/renderman-25/plugin/hdPrman/resourceRegistry.h index 8357f9b1b9..671545f4c7 100644 --- a/third_party/renderman-25/plugin/hdPrman/resourceRegistry.h +++ b/third_party/renderman-25/plugin/hdPrman/resourceRegistry.h @@ -1,25 +1,8 @@ // // Copyright 2020 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_RESOURCE_REGISTRY_H #define EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_RESOURCE_REGISTRY_H diff --git a/third_party/renderman-25/plugin/hdPrman/rileyCameraPrim.cpp b/third_party/renderman-25/plugin/hdPrman/rileyCameraPrim.cpp index 38f4583802..e17d65cf38 100644 --- a/third_party/renderman-25/plugin/hdPrman/rileyCameraPrim.cpp +++ b/third_party/renderman-25/plugin/hdPrman/rileyCameraPrim.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/third_party/renderman-25/plugin/hdPrman/rileyCameraPrim.h b/third_party/renderman-25/plugin/hdPrman/rileyCameraPrim.h index 2f7513d53b..1ab86d6109 100644 --- a/third_party/renderman-25/plugin/hdPrman/rileyCameraPrim.h +++ b/third_party/renderman-25/plugin/hdPrman/rileyCameraPrim.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/third_party/renderman-25/plugin/hdPrman/rileyCameraSchema.cpp b/third_party/renderman-25/plugin/hdPrman/rileyCameraSchema.cpp index b4f5659ee7..e26c1dec44 100644 --- a/third_party/renderman-25/plugin/hdPrman/rileyCameraSchema.cpp +++ b/third_party/renderman-25/plugin/hdPrman/rileyCameraSchema.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/third_party/renderman-25/plugin/hdPrman/rileyCameraSchema.h b/third_party/renderman-25/plugin/hdPrman/rileyCameraSchema.h index 7a0690e8d3..37bfffefdb 100644 --- a/third_party/renderman-25/plugin/hdPrman/rileyCameraSchema.h +++ b/third_party/renderman-25/plugin/hdPrman/rileyCameraSchema.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/third_party/renderman-25/plugin/hdPrman/rileyClippingPlanePrim.cpp b/third_party/renderman-25/plugin/hdPrman/rileyClippingPlanePrim.cpp index 297dc2e42a..826a380276 100644 --- a/third_party/renderman-25/plugin/hdPrman/rileyClippingPlanePrim.cpp +++ b/third_party/renderman-25/plugin/hdPrman/rileyClippingPlanePrim.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/third_party/renderman-25/plugin/hdPrman/rileyClippingPlanePrim.h b/third_party/renderman-25/plugin/hdPrman/rileyClippingPlanePrim.h index 60d074eee6..b9091c357b 100644 --- a/third_party/renderman-25/plugin/hdPrman/rileyClippingPlanePrim.h +++ b/third_party/renderman-25/plugin/hdPrman/rileyClippingPlanePrim.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/third_party/renderman-25/plugin/hdPrman/rileyClippingPlaneSchema.cpp b/third_party/renderman-25/plugin/hdPrman/rileyClippingPlaneSchema.cpp index 7a55c9d2e6..108a5f4a3b 100644 --- a/third_party/renderman-25/plugin/hdPrman/rileyClippingPlaneSchema.cpp +++ b/third_party/renderman-25/plugin/hdPrman/rileyClippingPlaneSchema.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/third_party/renderman-25/plugin/hdPrman/rileyClippingPlaneSchema.h b/third_party/renderman-25/plugin/hdPrman/rileyClippingPlaneSchema.h index cd2fe8c5ea..511420d487 100644 --- a/third_party/renderman-25/plugin/hdPrman/rileyClippingPlaneSchema.h +++ b/third_party/renderman-25/plugin/hdPrman/rileyClippingPlaneSchema.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/third_party/renderman-25/plugin/hdPrman/rileyConversionSceneIndexPlugin.cpp b/third_party/renderman-25/plugin/hdPrman/rileyConversionSceneIndexPlugin.cpp index 84cdde8b1f..503fadcd65 100644 --- a/third_party/renderman-25/plugin/hdPrman/rileyConversionSceneIndexPlugin.cpp +++ b/third_party/renderman-25/plugin/hdPrman/rileyConversionSceneIndexPlugin.cpp @@ -1,25 +1,8 @@ // // Copyright 2024 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "hdPrman/rileyConversionSceneIndexPlugin.h" diff --git a/third_party/renderman-25/plugin/hdPrman/rileyConversionSceneIndexPlugin.h b/third_party/renderman-25/plugin/hdPrman/rileyConversionSceneIndexPlugin.h index 2dccdbd907..8f7974b108 100644 --- a/third_party/renderman-25/plugin/hdPrman/rileyConversionSceneIndexPlugin.h +++ b/third_party/renderman-25/plugin/hdPrman/rileyConversionSceneIndexPlugin.h @@ -1,25 +1,8 @@ // // Copyright 2024 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/third_party/renderman-25/plugin/hdPrman/rileyCoordinateSystemPrim.cpp b/third_party/renderman-25/plugin/hdPrman/rileyCoordinateSystemPrim.cpp index 943f585a32..4d21b61d4a 100644 --- a/third_party/renderman-25/plugin/hdPrman/rileyCoordinateSystemPrim.cpp +++ b/third_party/renderman-25/plugin/hdPrman/rileyCoordinateSystemPrim.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/third_party/renderman-25/plugin/hdPrman/rileyCoordinateSystemPrim.h b/third_party/renderman-25/plugin/hdPrman/rileyCoordinateSystemPrim.h index 709ba8fa36..8919ff49fd 100644 --- a/third_party/renderman-25/plugin/hdPrman/rileyCoordinateSystemPrim.h +++ b/third_party/renderman-25/plugin/hdPrman/rileyCoordinateSystemPrim.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/third_party/renderman-25/plugin/hdPrman/rileyCoordinateSystemSchema.cpp b/third_party/renderman-25/plugin/hdPrman/rileyCoordinateSystemSchema.cpp index f7e3b34052..c65b3e05cb 100644 --- a/third_party/renderman-25/plugin/hdPrman/rileyCoordinateSystemSchema.cpp +++ b/third_party/renderman-25/plugin/hdPrman/rileyCoordinateSystemSchema.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/third_party/renderman-25/plugin/hdPrman/rileyCoordinateSystemSchema.h b/third_party/renderman-25/plugin/hdPrman/rileyCoordinateSystemSchema.h index f04e8ef88b..707084e1da 100644 --- a/third_party/renderman-25/plugin/hdPrman/rileyCoordinateSystemSchema.h +++ b/third_party/renderman-25/plugin/hdPrman/rileyCoordinateSystemSchema.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/third_party/renderman-25/plugin/hdPrman/rileyDisplacementPrim.cpp b/third_party/renderman-25/plugin/hdPrman/rileyDisplacementPrim.cpp index b73308ea8c..d354d2a88a 100644 --- a/third_party/renderman-25/plugin/hdPrman/rileyDisplacementPrim.cpp +++ b/third_party/renderman-25/plugin/hdPrman/rileyDisplacementPrim.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/third_party/renderman-25/plugin/hdPrman/rileyDisplacementPrim.h b/third_party/renderman-25/plugin/hdPrman/rileyDisplacementPrim.h index 9fd7fc98a7..dad8339e83 100644 --- a/third_party/renderman-25/plugin/hdPrman/rileyDisplacementPrim.h +++ b/third_party/renderman-25/plugin/hdPrman/rileyDisplacementPrim.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/third_party/renderman-25/plugin/hdPrman/rileyDisplacementSchema.cpp b/third_party/renderman-25/plugin/hdPrman/rileyDisplacementSchema.cpp index 8042e6b350..cce793cf53 100644 --- a/third_party/renderman-25/plugin/hdPrman/rileyDisplacementSchema.cpp +++ b/third_party/renderman-25/plugin/hdPrman/rileyDisplacementSchema.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/third_party/renderman-25/plugin/hdPrman/rileyDisplacementSchema.h b/third_party/renderman-25/plugin/hdPrman/rileyDisplacementSchema.h index 9fced3f5f6..fb6238a181 100644 --- a/third_party/renderman-25/plugin/hdPrman/rileyDisplacementSchema.h +++ b/third_party/renderman-25/plugin/hdPrman/rileyDisplacementSchema.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/third_party/renderman-25/plugin/hdPrman/rileyDisplayFilterPrim.cpp b/third_party/renderman-25/plugin/hdPrman/rileyDisplayFilterPrim.cpp index be036e4b00..f3ba15aa68 100644 --- a/third_party/renderman-25/plugin/hdPrman/rileyDisplayFilterPrim.cpp +++ b/third_party/renderman-25/plugin/hdPrman/rileyDisplayFilterPrim.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/third_party/renderman-25/plugin/hdPrman/rileyDisplayFilterPrim.h b/third_party/renderman-25/plugin/hdPrman/rileyDisplayFilterPrim.h index 7e640b9a25..eb20dc4ff4 100644 --- a/third_party/renderman-25/plugin/hdPrman/rileyDisplayFilterPrim.h +++ b/third_party/renderman-25/plugin/hdPrman/rileyDisplayFilterPrim.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/third_party/renderman-25/plugin/hdPrman/rileyDisplayFilterSchema.cpp b/third_party/renderman-25/plugin/hdPrman/rileyDisplayFilterSchema.cpp index 7d68e38cc4..45953add5e 100644 --- a/third_party/renderman-25/plugin/hdPrman/rileyDisplayFilterSchema.cpp +++ b/third_party/renderman-25/plugin/hdPrman/rileyDisplayFilterSchema.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/third_party/renderman-25/plugin/hdPrman/rileyDisplayFilterSchema.h b/third_party/renderman-25/plugin/hdPrman/rileyDisplayFilterSchema.h index d4949292ba..efa0fe4b58 100644 --- a/third_party/renderman-25/plugin/hdPrman/rileyDisplayFilterSchema.h +++ b/third_party/renderman-25/plugin/hdPrman/rileyDisplayFilterSchema.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/third_party/renderman-25/plugin/hdPrman/rileyDisplayPrim.cpp b/third_party/renderman-25/plugin/hdPrman/rileyDisplayPrim.cpp index df1e4c88f8..a0f0caaedd 100644 --- a/third_party/renderman-25/plugin/hdPrman/rileyDisplayPrim.cpp +++ b/third_party/renderman-25/plugin/hdPrman/rileyDisplayPrim.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/third_party/renderman-25/plugin/hdPrman/rileyDisplayPrim.h b/third_party/renderman-25/plugin/hdPrman/rileyDisplayPrim.h index 82768c8d2d..408546a8f6 100644 --- a/third_party/renderman-25/plugin/hdPrman/rileyDisplayPrim.h +++ b/third_party/renderman-25/plugin/hdPrman/rileyDisplayPrim.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/third_party/renderman-25/plugin/hdPrman/rileyDisplaySchema.cpp b/third_party/renderman-25/plugin/hdPrman/rileyDisplaySchema.cpp index 35c1147b9f..80d9750ea7 100644 --- a/third_party/renderman-25/plugin/hdPrman/rileyDisplaySchema.cpp +++ b/third_party/renderman-25/plugin/hdPrman/rileyDisplaySchema.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/third_party/renderman-25/plugin/hdPrman/rileyDisplaySchema.h b/third_party/renderman-25/plugin/hdPrman/rileyDisplaySchema.h index e732e0325c..c14d4450fe 100644 --- a/third_party/renderman-25/plugin/hdPrman/rileyDisplaySchema.h +++ b/third_party/renderman-25/plugin/hdPrman/rileyDisplaySchema.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/third_party/renderman-25/plugin/hdPrman/rileyFallbackMaterialSceneIndexPlugin.cpp b/third_party/renderman-25/plugin/hdPrman/rileyFallbackMaterialSceneIndexPlugin.cpp index 892b1a623b..605d19e8b1 100644 --- a/third_party/renderman-25/plugin/hdPrman/rileyFallbackMaterialSceneIndexPlugin.cpp +++ b/third_party/renderman-25/plugin/hdPrman/rileyFallbackMaterialSceneIndexPlugin.cpp @@ -1,25 +1,8 @@ // // Copyright 2024 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "hdPrman/rileyFallbackMaterialSceneIndexPlugin.h" diff --git a/third_party/renderman-25/plugin/hdPrman/rileyFallbackMaterialSceneIndexPlugin.h b/third_party/renderman-25/plugin/hdPrman/rileyFallbackMaterialSceneIndexPlugin.h index 04a1f7648a..1708bb1a9a 100644 --- a/third_party/renderman-25/plugin/hdPrman/rileyFallbackMaterialSceneIndexPlugin.h +++ b/third_party/renderman-25/plugin/hdPrman/rileyFallbackMaterialSceneIndexPlugin.h @@ -1,25 +1,8 @@ // // Copyright 2024 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/third_party/renderman-25/plugin/hdPrman/rileyGenPrim.py b/third_party/renderman-25/plugin/hdPrman/rileyGenPrim.py index 6c585a2418..6c18c13de9 100644 --- a/third_party/renderman-25/plugin/hdPrman/rileyGenPrim.py +++ b/third_party/renderman-25/plugin/hdPrman/rileyGenPrim.py @@ -3,25 +3,8 @@ # # Copyright 2023 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http:#www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # from jinja2 import Environment, FileSystemLoader, Template, pass_context diff --git a/third_party/renderman-25/plugin/hdPrman/rileyGeometryInstancePrim.cpp b/third_party/renderman-25/plugin/hdPrman/rileyGeometryInstancePrim.cpp index b9517131b9..80173ce1b5 100644 --- a/third_party/renderman-25/plugin/hdPrman/rileyGeometryInstancePrim.cpp +++ b/third_party/renderman-25/plugin/hdPrman/rileyGeometryInstancePrim.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/third_party/renderman-25/plugin/hdPrman/rileyGeometryInstancePrim.h b/third_party/renderman-25/plugin/hdPrman/rileyGeometryInstancePrim.h index f4d5d72338..c4a50edf4f 100644 --- a/third_party/renderman-25/plugin/hdPrman/rileyGeometryInstancePrim.h +++ b/third_party/renderman-25/plugin/hdPrman/rileyGeometryInstancePrim.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/third_party/renderman-25/plugin/hdPrman/rileyGeometryInstanceSchema.cpp b/third_party/renderman-25/plugin/hdPrman/rileyGeometryInstanceSchema.cpp index b852f87196..ee6a761d50 100644 --- a/third_party/renderman-25/plugin/hdPrman/rileyGeometryInstanceSchema.cpp +++ b/third_party/renderman-25/plugin/hdPrman/rileyGeometryInstanceSchema.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/third_party/renderman-25/plugin/hdPrman/rileyGeometryInstanceSchema.h b/third_party/renderman-25/plugin/hdPrman/rileyGeometryInstanceSchema.h index 8f9b3b18b2..e2fed02f90 100644 --- a/third_party/renderman-25/plugin/hdPrman/rileyGeometryInstanceSchema.h +++ b/third_party/renderman-25/plugin/hdPrman/rileyGeometryInstanceSchema.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/third_party/renderman-25/plugin/hdPrman/rileyGeometryPrototypePrim.cpp b/third_party/renderman-25/plugin/hdPrman/rileyGeometryPrototypePrim.cpp index 13b76a3f9d..e4f07a7325 100644 --- a/third_party/renderman-25/plugin/hdPrman/rileyGeometryPrototypePrim.cpp +++ b/third_party/renderman-25/plugin/hdPrman/rileyGeometryPrototypePrim.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/third_party/renderman-25/plugin/hdPrman/rileyGeometryPrototypePrim.h b/third_party/renderman-25/plugin/hdPrman/rileyGeometryPrototypePrim.h index f32e135689..6dd81229b5 100644 --- a/third_party/renderman-25/plugin/hdPrman/rileyGeometryPrototypePrim.h +++ b/third_party/renderman-25/plugin/hdPrman/rileyGeometryPrototypePrim.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/third_party/renderman-25/plugin/hdPrman/rileyGeometryPrototypeSchema.cpp b/third_party/renderman-25/plugin/hdPrman/rileyGeometryPrototypeSchema.cpp index 740a242d73..4b9b05d4b4 100644 --- a/third_party/renderman-25/plugin/hdPrman/rileyGeometryPrototypeSchema.cpp +++ b/third_party/renderman-25/plugin/hdPrman/rileyGeometryPrototypeSchema.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/third_party/renderman-25/plugin/hdPrman/rileyGeometryPrototypeSchema.h b/third_party/renderman-25/plugin/hdPrman/rileyGeometryPrototypeSchema.h index 2c37faf0e6..8f690342d1 100644 --- a/third_party/renderman-25/plugin/hdPrman/rileyGeometryPrototypeSchema.h +++ b/third_party/renderman-25/plugin/hdPrman/rileyGeometryPrototypeSchema.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/third_party/renderman-25/plugin/hdPrman/rileyGlobalsPrim.cpp b/third_party/renderman-25/plugin/hdPrman/rileyGlobalsPrim.cpp new file mode 100644 index 0000000000..ca11ec3fa6 --- /dev/null +++ b/third_party/renderman-25/plugin/hdPrman/rileyGlobalsPrim.cpp @@ -0,0 +1,63 @@ +// +// Copyright 2023 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// +//////////////////////////////////////////////////////////////////////// + +#include "hdPrman/rileyGlobalsPrim.h" + +#ifdef HDPRMAN_USE_SCENE_INDEX_OBSERVER + +#include "hdPrman/rileyTypes.h" + +#include "hdPrman/rileyGlobalsSchema.h" + +#include "pxr/imaging/hd/sceneIndex.h" + +PXR_NAMESPACE_OPEN_SCOPE + +HdPrman_RileyGlobalsPrim::HdPrman_RileyGlobalsPrim( + HdContainerDataSourceHandle const &primSource, + const HdsiPrimManagingSceneIndexObserver * const observer, + HdPrman_RenderParam * const renderParam) + : HdPrman_RileyPrimBase(renderParam) +{ + HdPrmanRileyGlobalsSchema schema = + HdPrmanRileyGlobalsSchema::GetFromParent(primSource); + + _SetOptions(schema); +} + +void +HdPrman_RileyGlobalsPrim::_Dirty( + const HdSceneIndexObserver::DirtiedPrimEntry &entry, + const HdsiPrimManagingSceneIndexObserver * const observer) +{ + HdPrmanRileyGlobalsSchema schema = + HdPrmanRileyGlobalsSchema::GetFromParent( + observer->GetSceneIndex()->GetPrim(entry.primPath).dataSource); + + if (entry.dirtyLocators.Intersects( + HdPrmanRileyGlobalsSchema::GetOptionsLocator())) { + _SetOptions(schema); + } +} + +void +HdPrman_RileyGlobalsPrim::_SetOptions( + HdPrmanRileyGlobalsSchema globalsSchema) +{ + if (HdPrmanRileyParamListSchema schema = globalsSchema.GetOptions()) { + HdPrman_RileyParamList options = HdPrman_RileyParamList(schema); + _AcquireRiley()->SetOptions( + options.rileyObject); + } +} + +HdPrman_RileyGlobalsPrim::~HdPrman_RileyGlobalsPrim() = default; + +PXR_NAMESPACE_CLOSE_SCOPE + +#endif // #ifdef HDPRMAN_USE_SCENE_INDEX_OBSERVER diff --git a/third_party/renderman-25/plugin/hdPrman/rileyGlobalsPrim.h b/third_party/renderman-25/plugin/hdPrman/rileyGlobalsPrim.h new file mode 100644 index 0000000000..974ea6fdbf --- /dev/null +++ b/third_party/renderman-25/plugin/hdPrman/rileyGlobalsPrim.h @@ -0,0 +1,54 @@ +// +// Copyright 2023 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// +//////////////////////////////////////////////////////////////////////// + +#ifndef EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_RILEY_GLOBALS_PRIM_H +#define EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_RILEY_GLOBALS_PRIM_H + +#include "pxr/pxr.h" +#include "hdPrman/api.h" +#include "hdPrman/sceneIndexObserverApi.h" + +#ifdef HDPRMAN_USE_SCENE_INDEX_OBSERVER + +#include "hdPrman/rileyPrimBase.h" + +PXR_NAMESPACE_OPEN_SCOPE + +class HdPrmanRileyGlobalsSchema; +using HdPrman_RileyGlobalsPrimHandle = + std::shared_ptr; + +/// \class HdPrman_RileyGlobalsPrim +/// +/// Set riley global parameters such as options using the +/// HdPrmanRileyGlobalsSchema. +/// +class HdPrman_RileyGlobalsPrim : public HdPrman_RileyPrimBase +{ +public: + HdPrman_RileyGlobalsPrim( + HdContainerDataSourceHandle const &primSource, + const HdsiPrimManagingSceneIndexObserver *observer, + HdPrman_RenderParam * renderParam); + + ~HdPrman_RileyGlobalsPrim() override; + +protected: + void _Dirty( + const HdSceneIndexObserver::DirtiedPrimEntry &entry, + const HdsiPrimManagingSceneIndexObserver * observer) override; + +private: + void _SetOptions(HdPrmanRileyGlobalsSchema); +}; + +PXR_NAMESPACE_CLOSE_SCOPE + +#endif // #ifdef HDPRMAN_USE_SCENE_INDEX_OBSERVER + +#endif diff --git a/third_party/renderman-25/plugin/hdPrman/rileyGlobalsSchema.cpp b/third_party/renderman-25/plugin/hdPrman/rileyGlobalsSchema.cpp new file mode 100644 index 0000000000..7bc7fa5ce9 --- /dev/null +++ b/third_party/renderman-25/plugin/hdPrman/rileyGlobalsSchema.cpp @@ -0,0 +1,118 @@ +// +// Copyright 2023 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// +//////////////////////////////////////////////////////////////////////// + +/* ************************************************************************** */ +/* ** ** */ +/* ** This file is generated by a script. ** */ +/* ** ** */ +/* ** Do not edit it directly (unless it is within a CUSTOM CODE section)! ** */ +/* ** Edit hdSchemaDefs.py instead to make changes. ** */ +/* ** ** */ +/* ************************************************************************** */ + +#include "hdPrman/rileyGlobalsSchema.h" + +#include "pxr/imaging/hd/retainedDataSource.h" + +#include "pxr/base/trace/trace.h" + +// --(BEGIN CUSTOM CODE: Includes)-- +// --(END CUSTOM CODE: Includes)-- + +PXR_NAMESPACE_OPEN_SCOPE + +TF_DEFINE_PUBLIC_TOKENS(HdPrmanRileyGlobalsSchemaTokens, + HD_PRMAN_RILEY_GLOBALS_SCHEMA_TOKENS); + +// --(BEGIN CUSTOM CODE: Schema Methods)-- +// --(END CUSTOM CODE: Schema Methods)-- + +HdPrmanRileyParamListSchema +HdPrmanRileyGlobalsSchema::GetOptions() +#if HD_API_VERSION >= 66 + const +#else + +#endif +{ + return HdPrmanRileyParamListSchema(_GetTypedDataSource( + HdPrmanRileyGlobalsSchemaTokens->options)); +} + +/*static*/ +HdContainerDataSourceHandle +HdPrmanRileyGlobalsSchema::BuildRetained( + const HdContainerDataSourceHandle &options +) +{ + TfToken _names[1]; + HdDataSourceBaseHandle _values[1]; + + size_t _count = 0; + + if (options) { + _names[_count] = HdPrmanRileyGlobalsSchemaTokens->options; + _values[_count++] = options; + } + return HdRetainedContainerDataSource::New(_count, _names, _values); +} + +HdPrmanRileyGlobalsSchema::Builder & +HdPrmanRileyGlobalsSchema::Builder::SetOptions( + const HdContainerDataSourceHandle &options) +{ + _options = options; + return *this; +} + +HdContainerDataSourceHandle +HdPrmanRileyGlobalsSchema::Builder::Build() +{ + return HdPrmanRileyGlobalsSchema::BuildRetained( + _options + ); +} + +/*static*/ +HdPrmanRileyGlobalsSchema +HdPrmanRileyGlobalsSchema::GetFromParent( + const HdContainerDataSourceHandle &fromParentContainer) +{ + return HdPrmanRileyGlobalsSchema( + fromParentContainer + ? HdContainerDataSource::Cast(fromParentContainer->Get( + HdPrmanRileyGlobalsSchemaTokens->rileyGlobals)) + : nullptr); +} + +/*static*/ +const TfToken & +HdPrmanRileyGlobalsSchema::GetSchemaToken() +{ + return HdPrmanRileyGlobalsSchemaTokens->rileyGlobals; +} + +/*static*/ +const HdDataSourceLocator & +HdPrmanRileyGlobalsSchema::GetDefaultLocator() +{ + static const HdDataSourceLocator locator(GetSchemaToken()); + return locator; +} + +/* static */ +const HdDataSourceLocator & +HdPrmanRileyGlobalsSchema::GetOptionsLocator() +{ + static const HdDataSourceLocator locator = + GetDefaultLocator().Append( + HdPrmanRileyGlobalsSchemaTokens->options); + return locator; +} + +PXR_NAMESPACE_CLOSE_SCOPE \ No newline at end of file diff --git a/third_party/renderman-25/plugin/hdPrman/rileyGlobalsSchema.h b/third_party/renderman-25/plugin/hdPrman/rileyGlobalsSchema.h new file mode 100644 index 0000000000..b7a7eca2ef --- /dev/null +++ b/third_party/renderman-25/plugin/hdPrman/rileyGlobalsSchema.h @@ -0,0 +1,156 @@ +// +// Copyright 2023 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// +//////////////////////////////////////////////////////////////////////// + +/* ************************************************************************** */ +/* ** ** */ +/* ** This file is generated by a script. ** */ +/* ** ** */ +/* ** Do not edit it directly (unless it is within a CUSTOM CODE section)! ** */ +/* ** Edit hdSchemaDefs.py instead to make changes. ** */ +/* ** ** */ +/* ************************************************************************** */ + +#ifndef EXT_RMANPKG_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_RILEY_GLOBALS_SCHEMA_H +#define EXT_RMANPKG_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_RILEY_GLOBALS_SCHEMA_H + +/// \file + +#include "hdPrman/api.h" +#include "hdPrman/rileyParamListSchema.h" + +#include "pxr/imaging/hd/schema.h" +#include "pxr/imaging/hd/version.h" + +// --(BEGIN CUSTOM CODE: Includes)-- +// --(END CUSTOM CODE: Includes)-- + +PXR_NAMESPACE_OPEN_SCOPE + +// --(BEGIN CUSTOM CODE: Declares)-- +// --(END CUSTOM CODE: Declares)-- + +#define HD_PRMAN_RILEY_GLOBALS_SCHEMA_TOKENS \ + (rileyGlobals) \ + (options) \ + +TF_DECLARE_PUBLIC_TOKENS(HdPrmanRileyGlobalsSchemaTokens, HDPRMAN_API, + HD_PRMAN_RILEY_GLOBALS_SCHEMA_TOKENS); + +//----------------------------------------------------------------------------- + + +class HdPrmanRileyGlobalsSchema : public HdSchema +{ +public: + /// \name Schema retrieval + /// @{ + + HdPrmanRileyGlobalsSchema(HdContainerDataSourceHandle container) + : HdSchema(container) {} + + /// Retrieves a container data source with the schema's default name token + /// "rileyGlobals" from the parent container and constructs a + /// HdPrmanRileyGlobalsSchema instance. + /// Because the requested container data source may not exist, the result + /// should be checked with IsDefined() or a bool comparison before use. + HDPRMAN_API + static HdPrmanRileyGlobalsSchema GetFromParent( + const HdContainerDataSourceHandle &fromParentContainer); + + /// @} + +// --(BEGIN CUSTOM CODE: Schema Methods)-- +// --(END CUSTOM CODE: Schema Methods)-- + + /// \name Member accessor + /// @{ + + HDPRMAN_API + HdPrmanRileyParamListSchema GetOptions() +#if HD_API_VERSION >= 66 + const; +#else + ; +#endif + + + /// @} + + /// \name Schema location + /// @{ + + /// Returns a token where the container representing this schema is found in + /// a container by default. + HDPRMAN_API + static const TfToken &GetSchemaToken(); + + /// Returns an HdDataSourceLocator (relative to the prim-level data source) + /// where the container representing this schema is found by default. + HDPRMAN_API + static const HdDataSourceLocator &GetDefaultLocator(); + + /// @} + + /// \name Data source locators for members + /// + /// The following methods return an HdDataSourceLocator (relative to the + /// prim-level data source) where the data source for a member can be found. + /// + /// This is often useful for checking intersection against the + /// HdDataSourceLocatorSet sent with HdDataSourceObserver::PrimsDirtied. + /// @{ + + /// Prim-level relative data source locator to locate options. + HDPRMAN_API + static const HdDataSourceLocator &GetOptionsLocator(); + /// @} + + /// \name Schema construction + /// @{ + + /// \deprecated Use Builder instead. + /// + /// Builds a container data source which includes the provided child data + /// sources. Parameters with nullptr values are excluded. This is a + /// low-level interface. For cases in which it's desired to define + /// the container with a sparse set of child fields, the Builder class + /// is often more convenient and readable. + HDPRMAN_API + static HdContainerDataSourceHandle + BuildRetained( + const HdContainerDataSourceHandle &options + ); + + /// \class HdPrmanRileyGlobalsSchema::Builder + /// + /// Utility class for setting sparse sets of child data source fields to be + /// filled as arguments into BuildRetained. Because all setter methods + /// return a reference to the instance, this can be used in the "builder + /// pattern" form. + class Builder + { + public: + HDPRMAN_API + Builder &SetOptions( + const HdContainerDataSourceHandle &options); + + /// Returns a container data source containing the members set thus far. + HDPRMAN_API + HdContainerDataSourceHandle Build(); + + private: + HdContainerDataSourceHandle _options; + + }; + + /// @} +}; + +PXR_NAMESPACE_CLOSE_SCOPE + +#endif \ No newline at end of file diff --git a/third_party/renderman-25/plugin/hdPrman/rileyIds.h b/third_party/renderman-25/plugin/hdPrman/rileyIds.h index 3bc0972cb8..1b29981dfa 100644 --- a/third_party/renderman-25/plugin/hdPrman/rileyIds.h +++ b/third_party/renderman-25/plugin/hdPrman/rileyIds.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_RILEY_PRIM_UTIL_H #define EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_RILEY_PRIM_UTIL_H diff --git a/third_party/renderman-25/plugin/hdPrman/rileyIntegratorPrim.cpp b/third_party/renderman-25/plugin/hdPrman/rileyIntegratorPrim.cpp index 14e673b741..e03004183c 100644 --- a/third_party/renderman-25/plugin/hdPrman/rileyIntegratorPrim.cpp +++ b/third_party/renderman-25/plugin/hdPrman/rileyIntegratorPrim.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/third_party/renderman-25/plugin/hdPrman/rileyIntegratorPrim.h b/third_party/renderman-25/plugin/hdPrman/rileyIntegratorPrim.h index 46e6124fa5..6be3b73a51 100644 --- a/third_party/renderman-25/plugin/hdPrman/rileyIntegratorPrim.h +++ b/third_party/renderman-25/plugin/hdPrman/rileyIntegratorPrim.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/third_party/renderman-25/plugin/hdPrman/rileyIntegratorSchema.cpp b/third_party/renderman-25/plugin/hdPrman/rileyIntegratorSchema.cpp index 976ef90545..109adb463e 100644 --- a/third_party/renderman-25/plugin/hdPrman/rileyIntegratorSchema.cpp +++ b/third_party/renderman-25/plugin/hdPrman/rileyIntegratorSchema.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/third_party/renderman-25/plugin/hdPrman/rileyIntegratorSchema.h b/third_party/renderman-25/plugin/hdPrman/rileyIntegratorSchema.h index 5f3373bbd7..77c098d820 100644 --- a/third_party/renderman-25/plugin/hdPrman/rileyIntegratorSchema.h +++ b/third_party/renderman-25/plugin/hdPrman/rileyIntegratorSchema.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/third_party/renderman-25/plugin/hdPrman/rileyLightInstancePrim.cpp b/third_party/renderman-25/plugin/hdPrman/rileyLightInstancePrim.cpp index 485e126d87..9ccb837fa7 100644 --- a/third_party/renderman-25/plugin/hdPrman/rileyLightInstancePrim.cpp +++ b/third_party/renderman-25/plugin/hdPrman/rileyLightInstancePrim.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/third_party/renderman-25/plugin/hdPrman/rileyLightInstancePrim.h b/third_party/renderman-25/plugin/hdPrman/rileyLightInstancePrim.h index 91e7c91d3a..401effb2b7 100644 --- a/third_party/renderman-25/plugin/hdPrman/rileyLightInstancePrim.h +++ b/third_party/renderman-25/plugin/hdPrman/rileyLightInstancePrim.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/third_party/renderman-25/plugin/hdPrman/rileyLightInstanceSchema.cpp b/third_party/renderman-25/plugin/hdPrman/rileyLightInstanceSchema.cpp index a4dd184afe..83b19d590b 100644 --- a/third_party/renderman-25/plugin/hdPrman/rileyLightInstanceSchema.cpp +++ b/third_party/renderman-25/plugin/hdPrman/rileyLightInstanceSchema.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/third_party/renderman-25/plugin/hdPrman/rileyLightInstanceSchema.h b/third_party/renderman-25/plugin/hdPrman/rileyLightInstanceSchema.h index 9c2a1b0499..1de0958e01 100644 --- a/third_party/renderman-25/plugin/hdPrman/rileyLightInstanceSchema.h +++ b/third_party/renderman-25/plugin/hdPrman/rileyLightInstanceSchema.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/third_party/renderman-25/plugin/hdPrman/rileyLightShaderPrim.cpp b/third_party/renderman-25/plugin/hdPrman/rileyLightShaderPrim.cpp index 1270db2c90..060f5effb7 100644 --- a/third_party/renderman-25/plugin/hdPrman/rileyLightShaderPrim.cpp +++ b/third_party/renderman-25/plugin/hdPrman/rileyLightShaderPrim.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/third_party/renderman-25/plugin/hdPrman/rileyLightShaderPrim.h b/third_party/renderman-25/plugin/hdPrman/rileyLightShaderPrim.h index 251b216326..b40d51dca4 100644 --- a/third_party/renderman-25/plugin/hdPrman/rileyLightShaderPrim.h +++ b/third_party/renderman-25/plugin/hdPrman/rileyLightShaderPrim.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/third_party/renderman-25/plugin/hdPrman/rileyLightShaderSchema.cpp b/third_party/renderman-25/plugin/hdPrman/rileyLightShaderSchema.cpp index 09026e05c8..0102d2c61e 100644 --- a/third_party/renderman-25/plugin/hdPrman/rileyLightShaderSchema.cpp +++ b/third_party/renderman-25/plugin/hdPrman/rileyLightShaderSchema.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/third_party/renderman-25/plugin/hdPrman/rileyLightShaderSchema.h b/third_party/renderman-25/plugin/hdPrman/rileyLightShaderSchema.h index c6cd817d2d..3e5e295a85 100644 --- a/third_party/renderman-25/plugin/hdPrman/rileyLightShaderSchema.h +++ b/third_party/renderman-25/plugin/hdPrman/rileyLightShaderSchema.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/third_party/renderman-25/plugin/hdPrman/rileyMaterialPrim.cpp b/third_party/renderman-25/plugin/hdPrman/rileyMaterialPrim.cpp index ab536a6c78..d5afd91d59 100644 --- a/third_party/renderman-25/plugin/hdPrman/rileyMaterialPrim.cpp +++ b/third_party/renderman-25/plugin/hdPrman/rileyMaterialPrim.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/third_party/renderman-25/plugin/hdPrman/rileyMaterialPrim.h b/third_party/renderman-25/plugin/hdPrman/rileyMaterialPrim.h index ed54254e16..69bab059de 100644 --- a/third_party/renderman-25/plugin/hdPrman/rileyMaterialPrim.h +++ b/third_party/renderman-25/plugin/hdPrman/rileyMaterialPrim.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/third_party/renderman-25/plugin/hdPrman/rileyMaterialSchema.cpp b/third_party/renderman-25/plugin/hdPrman/rileyMaterialSchema.cpp index 9089ef78f2..e29f9f8e02 100644 --- a/third_party/renderman-25/plugin/hdPrman/rileyMaterialSchema.cpp +++ b/third_party/renderman-25/plugin/hdPrman/rileyMaterialSchema.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/third_party/renderman-25/plugin/hdPrman/rileyMaterialSchema.h b/third_party/renderman-25/plugin/hdPrman/rileyMaterialSchema.h index 8e71f8529a..a18e256de5 100644 --- a/third_party/renderman-25/plugin/hdPrman/rileyMaterialSchema.h +++ b/third_party/renderman-25/plugin/hdPrman/rileyMaterialSchema.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/third_party/renderman-25/plugin/hdPrman/rileyParamListSchema.cpp b/third_party/renderman-25/plugin/hdPrman/rileyParamListSchema.cpp index a50fd21303..442c05fa1b 100644 --- a/third_party/renderman-25/plugin/hdPrman/rileyParamListSchema.cpp +++ b/third_party/renderman-25/plugin/hdPrman/rileyParamListSchema.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/third_party/renderman-25/plugin/hdPrman/rileyParamListSchema.h b/third_party/renderman-25/plugin/hdPrman/rileyParamListSchema.h index f2c2f677e2..d167fcb76b 100644 --- a/third_party/renderman-25/plugin/hdPrman/rileyParamListSchema.h +++ b/third_party/renderman-25/plugin/hdPrman/rileyParamListSchema.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/third_party/renderman-25/plugin/hdPrman/rileyParamSchema.cpp b/third_party/renderman-25/plugin/hdPrman/rileyParamSchema.cpp index 1f98aeab1d..9c9e559ee0 100644 --- a/third_party/renderman-25/plugin/hdPrman/rileyParamSchema.cpp +++ b/third_party/renderman-25/plugin/hdPrman/rileyParamSchema.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/third_party/renderman-25/plugin/hdPrman/rileyParamSchema.h b/third_party/renderman-25/plugin/hdPrman/rileyParamSchema.h index 64ae010ca0..6e6cf5b124 100644 --- a/third_party/renderman-25/plugin/hdPrman/rileyParamSchema.h +++ b/third_party/renderman-25/plugin/hdPrman/rileyParamSchema.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/third_party/renderman-25/plugin/hdPrman/rileyPrimBase.cpp b/third_party/renderman-25/plugin/hdPrman/rileyPrimBase.cpp index 27aff75326..2664441ae6 100644 --- a/third_party/renderman-25/plugin/hdPrman/rileyPrimBase.cpp +++ b/third_party/renderman-25/plugin/hdPrman/rileyPrimBase.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "hdPrman/rileyPrimBase.h" diff --git a/third_party/renderman-25/plugin/hdPrman/rileyPrimBase.h b/third_party/renderman-25/plugin/hdPrman/rileyPrimBase.h index 18ca6ba14b..0ae3ed81ee 100644 --- a/third_party/renderman-25/plugin/hdPrman/rileyPrimBase.h +++ b/third_party/renderman-25/plugin/hdPrman/rileyPrimBase.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_RILEY_PRIM_BASE_H #define EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_RILEY_PRIM_BASE_H diff --git a/third_party/renderman-25/plugin/hdPrman/rileyPrimFactory.cpp b/third_party/renderman-25/plugin/hdPrman/rileyPrimFactory.cpp index 1508cb5e2d..79cf597480 100644 --- a/third_party/renderman-25/plugin/hdPrman/rileyPrimFactory.cpp +++ b/third_party/renderman-25/plugin/hdPrman/rileyPrimFactory.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "hdPrman/rileyPrimFactory.h" @@ -34,6 +17,7 @@ #include "hdPrman/rileyDisplayFilterPrim.h" #include "hdPrman/rileyGeometryInstancePrim.h" #include "hdPrman/rileyGeometryPrototypePrim.h" +#include "hdPrman/rileyGlobalsPrim.h" #include "hdPrman/rileyIntegratorPrim.h" #include "hdPrman/rileyLightInstancePrim.h" #include "hdPrman/rileyLightShaderPrim.h" @@ -71,6 +55,8 @@ class _RileyPrimTypePriorityFunctor { /// Dependencies are as follows: /// + /// Riley::SetOptions needs to be before anything else! + /// /// lightShader <----------------------------< lightInstance /// / /// material <------------------------------*---< geometryInstance @@ -92,6 +78,10 @@ class _RileyPrimTypePriorityFunctor /// sampleFilter <---------------------* /// / /// camera <------------------------* + if (primType == HdPrmanRileyPrimTypeTokens->globals) { + return 0; + } + if (primType == HdPrmanRileyPrimTypeTokens->lightShader || primType == HdPrmanRileyPrimTypeTokens->material || primType == HdPrmanRileyPrimTypeTokens->coordinateSystem || @@ -102,27 +92,27 @@ class _RileyPrimTypePriorityFunctor primType == HdPrmanRileyPrimTypeTokens->displayFilter|| primType == HdPrmanRileyPrimTypeTokens->sampleFilter|| primType == HdPrmanRileyPrimTypeTokens->camera) { - return 0; + return 1; } if (primType == HdPrmanRileyPrimTypeTokens->geometryPrototype || primType == HdPrmanRileyPrimTypeTokens->renderTarget) { - return 1; + return 2; } if (primType == HdPrmanRileyPrimTypeTokens->lightInstance || primType == HdPrmanRileyPrimTypeTokens->geometryInstance || primType == HdPrmanRileyPrimTypeTokens->display || primType == HdPrmanRileyPrimTypeTokens->renderView) { - return 2; + return 3; } - return 3; + return 4; } size_t GetNumPriorities() const override { - return 4; + return 5; } }; @@ -195,6 +185,13 @@ HdPrman_RileyPrimFactory::CreatePrim( _renderParam); } + if (entry.primType == HdPrmanRileyPrimTypeTokens->globals) { + return std::make_shared( + _GetPrimSource(observer, entry.primPath), + observer, + _renderParam); + } + if (entry.primType == HdPrmanRileyPrimTypeTokens->integrator) { return std::make_shared( _GetPrimSource(observer, entry.primPath), diff --git a/third_party/renderman-25/plugin/hdPrman/rileyPrimFactory.h b/third_party/renderman-25/plugin/hdPrman/rileyPrimFactory.h index a0e0496447..09cb21616f 100644 --- a/third_party/renderman-25/plugin/hdPrman/rileyPrimFactory.h +++ b/third_party/renderman-25/plugin/hdPrman/rileyPrimFactory.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_RILEY_PRIM_FACTORY_H #define EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_RILEY_PRIM_FACTORY_H diff --git a/third_party/renderman-25/plugin/hdPrman/rileyPrimvarListSchema.cpp b/third_party/renderman-25/plugin/hdPrman/rileyPrimvarListSchema.cpp index a8bf7e8707..6b69137c33 100644 --- a/third_party/renderman-25/plugin/hdPrman/rileyPrimvarListSchema.cpp +++ b/third_party/renderman-25/plugin/hdPrman/rileyPrimvarListSchema.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/third_party/renderman-25/plugin/hdPrman/rileyPrimvarListSchema.h b/third_party/renderman-25/plugin/hdPrman/rileyPrimvarListSchema.h index f9045a7b55..156859cefd 100644 --- a/third_party/renderman-25/plugin/hdPrman/rileyPrimvarListSchema.h +++ b/third_party/renderman-25/plugin/hdPrman/rileyPrimvarListSchema.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/third_party/renderman-25/plugin/hdPrman/rileyPrimvarSchema.cpp b/third_party/renderman-25/plugin/hdPrman/rileyPrimvarSchema.cpp index 4e062d5ef1..70f3b38e8e 100644 --- a/third_party/renderman-25/plugin/hdPrman/rileyPrimvarSchema.cpp +++ b/third_party/renderman-25/plugin/hdPrman/rileyPrimvarSchema.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/third_party/renderman-25/plugin/hdPrman/rileyPrimvarSchema.h b/third_party/renderman-25/plugin/hdPrman/rileyPrimvarSchema.h index 9992ef6f61..92bf80c892 100644 --- a/third_party/renderman-25/plugin/hdPrman/rileyPrimvarSchema.h +++ b/third_party/renderman-25/plugin/hdPrman/rileyPrimvarSchema.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/third_party/renderman-25/plugin/hdPrman/rileyRenderOutputPrim.cpp b/third_party/renderman-25/plugin/hdPrman/rileyRenderOutputPrim.cpp index 745e3b9056..747960225e 100644 --- a/third_party/renderman-25/plugin/hdPrman/rileyRenderOutputPrim.cpp +++ b/third_party/renderman-25/plugin/hdPrman/rileyRenderOutputPrim.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/third_party/renderman-25/plugin/hdPrman/rileyRenderOutputPrim.h b/third_party/renderman-25/plugin/hdPrman/rileyRenderOutputPrim.h index 2df82a663a..7a66bddd08 100644 --- a/third_party/renderman-25/plugin/hdPrman/rileyRenderOutputPrim.h +++ b/third_party/renderman-25/plugin/hdPrman/rileyRenderOutputPrim.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/third_party/renderman-25/plugin/hdPrman/rileyRenderOutputSchema.cpp b/third_party/renderman-25/plugin/hdPrman/rileyRenderOutputSchema.cpp index 4f8d2ae2cf..924699cc15 100644 --- a/third_party/renderman-25/plugin/hdPrman/rileyRenderOutputSchema.cpp +++ b/third_party/renderman-25/plugin/hdPrman/rileyRenderOutputSchema.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/third_party/renderman-25/plugin/hdPrman/rileyRenderOutputSchema.h b/third_party/renderman-25/plugin/hdPrman/rileyRenderOutputSchema.h index 707a93fe34..73316521b7 100644 --- a/third_party/renderman-25/plugin/hdPrman/rileyRenderOutputSchema.h +++ b/third_party/renderman-25/plugin/hdPrman/rileyRenderOutputSchema.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/third_party/renderman-25/plugin/hdPrman/rileyRenderTargetPrim.cpp b/third_party/renderman-25/plugin/hdPrman/rileyRenderTargetPrim.cpp index 582d343698..4f9188d596 100644 --- a/third_party/renderman-25/plugin/hdPrman/rileyRenderTargetPrim.cpp +++ b/third_party/renderman-25/plugin/hdPrman/rileyRenderTargetPrim.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/third_party/renderman-25/plugin/hdPrman/rileyRenderTargetPrim.h b/third_party/renderman-25/plugin/hdPrman/rileyRenderTargetPrim.h index 7c4e3264d7..155fca9393 100644 --- a/third_party/renderman-25/plugin/hdPrman/rileyRenderTargetPrim.h +++ b/third_party/renderman-25/plugin/hdPrman/rileyRenderTargetPrim.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/third_party/renderman-25/plugin/hdPrman/rileyRenderTargetSchema.cpp b/third_party/renderman-25/plugin/hdPrman/rileyRenderTargetSchema.cpp index 9f87c25908..92b931e199 100644 --- a/third_party/renderman-25/plugin/hdPrman/rileyRenderTargetSchema.cpp +++ b/third_party/renderman-25/plugin/hdPrman/rileyRenderTargetSchema.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/third_party/renderman-25/plugin/hdPrman/rileyRenderTargetSchema.h b/third_party/renderman-25/plugin/hdPrman/rileyRenderTargetSchema.h index 4cb2d24d20..1b11a77b27 100644 --- a/third_party/renderman-25/plugin/hdPrman/rileyRenderTargetSchema.h +++ b/third_party/renderman-25/plugin/hdPrman/rileyRenderTargetSchema.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/third_party/renderman-25/plugin/hdPrman/rileyRenderViewPrim.cpp b/third_party/renderman-25/plugin/hdPrman/rileyRenderViewPrim.cpp index 2e9affd8e9..00e650a1a3 100644 --- a/third_party/renderman-25/plugin/hdPrman/rileyRenderViewPrim.cpp +++ b/third_party/renderman-25/plugin/hdPrman/rileyRenderViewPrim.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/third_party/renderman-25/plugin/hdPrman/rileyRenderViewPrim.h b/third_party/renderman-25/plugin/hdPrman/rileyRenderViewPrim.h index a2f1ae48ef..820216617b 100644 --- a/third_party/renderman-25/plugin/hdPrman/rileyRenderViewPrim.h +++ b/third_party/renderman-25/plugin/hdPrman/rileyRenderViewPrim.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/third_party/renderman-25/plugin/hdPrman/rileyRenderViewSchema.cpp b/third_party/renderman-25/plugin/hdPrman/rileyRenderViewSchema.cpp index dba6f1a840..fba8397bef 100644 --- a/third_party/renderman-25/plugin/hdPrman/rileyRenderViewSchema.cpp +++ b/third_party/renderman-25/plugin/hdPrman/rileyRenderViewSchema.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/third_party/renderman-25/plugin/hdPrman/rileyRenderViewSchema.h b/third_party/renderman-25/plugin/hdPrman/rileyRenderViewSchema.h index dacc57abce..6d330fbbb8 100644 --- a/third_party/renderman-25/plugin/hdPrman/rileyRenderViewSchema.h +++ b/third_party/renderman-25/plugin/hdPrman/rileyRenderViewSchema.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/third_party/renderman-25/plugin/hdPrman/rileySampleFilterPrim.cpp b/third_party/renderman-25/plugin/hdPrman/rileySampleFilterPrim.cpp index 3f09f436e7..6aac7d0abb 100644 --- a/third_party/renderman-25/plugin/hdPrman/rileySampleFilterPrim.cpp +++ b/third_party/renderman-25/plugin/hdPrman/rileySampleFilterPrim.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/third_party/renderman-25/plugin/hdPrman/rileySampleFilterPrim.h b/third_party/renderman-25/plugin/hdPrman/rileySampleFilterPrim.h index a10b7d5ae8..72e55b55f8 100644 --- a/third_party/renderman-25/plugin/hdPrman/rileySampleFilterPrim.h +++ b/third_party/renderman-25/plugin/hdPrman/rileySampleFilterPrim.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/third_party/renderman-25/plugin/hdPrman/rileySampleFilterSchema.cpp b/third_party/renderman-25/plugin/hdPrman/rileySampleFilterSchema.cpp index a3aec19103..79cd31b763 100644 --- a/third_party/renderman-25/plugin/hdPrman/rileySampleFilterSchema.cpp +++ b/third_party/renderman-25/plugin/hdPrman/rileySampleFilterSchema.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/third_party/renderman-25/plugin/hdPrman/rileySampleFilterSchema.h b/third_party/renderman-25/plugin/hdPrman/rileySampleFilterSchema.h index 0210de71df..e7379b7dec 100644 --- a/third_party/renderman-25/plugin/hdPrman/rileySampleFilterSchema.h +++ b/third_party/renderman-25/plugin/hdPrman/rileySampleFilterSchema.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/third_party/renderman-25/plugin/hdPrman/rileySchemaTypeDefs.h b/third_party/renderman-25/plugin/hdPrman/rileySchemaTypeDefs.h index 8883b5ed81..fcb0690cab 100644 --- a/third_party/renderman-25/plugin/hdPrman/rileySchemaTypeDefs.h +++ b/third_party/renderman-25/plugin/hdPrman/rileySchemaTypeDefs.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/third_party/renderman-25/plugin/hdPrman/rileyShadingNodeSchema.cpp b/third_party/renderman-25/plugin/hdPrman/rileyShadingNodeSchema.cpp index b8ae1af1c7..1b2267f068 100644 --- a/third_party/renderman-25/plugin/hdPrman/rileyShadingNodeSchema.cpp +++ b/third_party/renderman-25/plugin/hdPrman/rileyShadingNodeSchema.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/third_party/renderman-25/plugin/hdPrman/rileyShadingNodeSchema.h b/third_party/renderman-25/plugin/hdPrman/rileyShadingNodeSchema.h index ab6896d20c..7e6eb0e55e 100644 --- a/third_party/renderman-25/plugin/hdPrman/rileyShadingNodeSchema.h +++ b/third_party/renderman-25/plugin/hdPrman/rileyShadingNodeSchema.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // //////////////////////////////////////////////////////////////////////// diff --git a/third_party/renderman-25/plugin/hdPrman/rileyTypes.cpp b/third_party/renderman-25/plugin/hdPrman/rileyTypes.cpp index f13dc523dc..6c7040625a 100644 --- a/third_party/renderman-25/plugin/hdPrman/rileyTypes.cpp +++ b/third_party/renderman-25/plugin/hdPrman/rileyTypes.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "hdPrman/rileyTypes.h" diff --git a/third_party/renderman-25/plugin/hdPrman/rileyTypes.h b/third_party/renderman-25/plugin/hdPrman/rileyTypes.h index 5d2d6cbddc..e562dbe97a 100644 --- a/third_party/renderman-25/plugin/hdPrman/rileyTypes.h +++ b/third_party/renderman-25/plugin/hdPrman/rileyTypes.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_RILEY_OBJECT_UTIL_H #define EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_RILEY_OBJECT_UTIL_H diff --git a/third_party/renderman-25/plugin/hdPrman/rixStrings.cpp b/third_party/renderman-25/plugin/hdPrman/rixStrings.cpp index 462c0bf239..6e2bd18741 100644 --- a/third_party/renderman-25/plugin/hdPrman/rixStrings.cpp +++ b/third_party/renderman-25/plugin/hdPrman/rixStrings.cpp @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "hdPrman/rixStrings.h" diff --git a/third_party/renderman-25/plugin/hdPrman/rixStrings.h b/third_party/renderman-25/plugin/hdPrman/rixStrings.h index 02262b2614..773f3d2306 100644 --- a/third_party/renderman-25/plugin/hdPrman/rixStrings.h +++ b/third_party/renderman-25/plugin/hdPrman/rixStrings.h @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_RIX_STRINGS_H #define EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_RIX_STRINGS_H diff --git a/third_party/renderman-25/plugin/hdPrman/sampleFilter.cpp b/third_party/renderman-25/plugin/hdPrman/sampleFilter.cpp index c38d805df9..66fa027c34 100644 --- a/third_party/renderman-25/plugin/hdPrman/sampleFilter.cpp +++ b/third_party/renderman-25/plugin/hdPrman/sampleFilter.cpp @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "hdPrman/sampleFilter.h" diff --git a/third_party/renderman-25/plugin/hdPrman/sampleFilter.h b/third_party/renderman-25/plugin/hdPrman/sampleFilter.h index 3a58066213..0c1baa67e3 100644 --- a/third_party/renderman-25/plugin/hdPrman/sampleFilter.h +++ b/third_party/renderman-25/plugin/hdPrman/sampleFilter.h @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_SAMPLE_FILTER_H #define EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_SAMPLE_FILTER_H diff --git a/third_party/renderman-25/plugin/hdPrman/sceneIndexObserverApi.h b/third_party/renderman-25/plugin/hdPrman/sceneIndexObserverApi.h index 148ad7f169..e308830e4c 100644 --- a/third_party/renderman-25/plugin/hdPrman/sceneIndexObserverApi.h +++ b/third_party/renderman-25/plugin/hdPrman/sceneIndexObserverApi.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_SCENE_INDEX_OBSERVER_API_H #define EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_SCENE_INDEX_OBSERVER_API_H diff --git a/third_party/renderman-25/plugin/hdPrman/sphere.cpp b/third_party/renderman-25/plugin/hdPrman/sphere.cpp index fda4cf8c01..f935877446 100644 --- a/third_party/renderman-25/plugin/hdPrman/sphere.cpp +++ b/third_party/renderman-25/plugin/hdPrman/sphere.cpp @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "hdPrman/sphere.h" diff --git a/third_party/renderman-25/plugin/hdPrman/sphere.h b/third_party/renderman-25/plugin/hdPrman/sphere.h index b6014d34e1..9421b2f9ad 100644 --- a/third_party/renderman-25/plugin/hdPrman/sphere.h +++ b/third_party/renderman-25/plugin/hdPrman/sphere.h @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_SPHERE_H #define EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_SPHERE_H diff --git a/third_party/renderman-25/plugin/hdPrman/terminalSceneIndexObserver.cpp b/third_party/renderman-25/plugin/hdPrman/terminalSceneIndexObserver.cpp index 4338dfec49..0f5d2992aa 100644 --- a/third_party/renderman-25/plugin/hdPrman/terminalSceneIndexObserver.cpp +++ b/third_party/renderman-25/plugin/hdPrman/terminalSceneIndexObserver.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "hdPrman/terminalSceneIndexObserver.h" diff --git a/third_party/renderman-25/plugin/hdPrman/terminalSceneIndexObserver.h b/third_party/renderman-25/plugin/hdPrman/terminalSceneIndexObserver.h index d59648bfea..731f40b145 100644 --- a/third_party/renderman-25/plugin/hdPrman/terminalSceneIndexObserver.h +++ b/third_party/renderman-25/plugin/hdPrman/terminalSceneIndexObserver.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_TERMINAL_SCENE_INDEX_OBSERVER_H #define EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_TERMINAL_SCENE_INDEX_OBSERVER_H diff --git a/third_party/renderman-25/plugin/hdPrman/testenv/testHdPrman.cpp b/third_party/renderman-25/plugin/hdPrman/testenv/testHdPrman.cpp index 758b36c28b..5b6f5876c5 100644 --- a/third_party/renderman-25/plugin/hdPrman/testenv/testHdPrman.cpp +++ b/third_party/renderman-25/plugin/hdPrman/testenv/testHdPrman.cpp @@ -1,77 +1,61 @@ // // Copyright 2018 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. -// -#include "pxr/pxr.h" +#include "hdPrman/renderDelegate.h" -#include "pxr/imaging/hd/renderIndex.h" +#include "pxr/imaging/hd/camera.h" +#include "pxr/imaging/hd/dataSourceMaterialNetworkInterface.h" #include "pxr/imaging/hd/engine.h" -#include "pxr/imaging/hd/flatteningSceneIndex.h" -#include "pxr/imaging/hd/rprimCollection.h" -#include "pxr/imaging/hd/task.h" +#include "pxr/imaging/hd/lightSchema.h" +#include "pxr/imaging/hd/materialNetworkSchema.h" +#include "pxr/imaging/hd/materialSchema.h" +#include "pxr/imaging/hd/overlayContainerDataSource.h" +#include "pxr/imaging/hd/pluginRenderDelegateUniqueHandle.h" +#include "pxr/imaging/hd/rendererPluginRegistry.h" +#include "pxr/imaging/hd/renderIndex.h" #include "pxr/imaging/hd/renderPass.h" #include "pxr/imaging/hd/renderPassState.h" -#include "pxr/imaging/hd/rendererPluginRegistry.h" -#include "pxr/imaging/hd/pluginRenderDelegateUniqueHandle.h" +#include "pxr/imaging/hd/retainedDataSource.h" +#include "pxr/imaging/hd/rprimCollection.h" #include "pxr/imaging/hd/sceneIndexPluginRegistry.h" -#include "pxr/imaging/hd/camera.h" +#include "pxr/imaging/hd/task.h" +#include "pxr/imaging/hd/tokens.h" #include "pxr/imaging/hd/utils.h" -#include "pxr/imaging/hd/overlayContainerDataSource.h" -#include "pxr/imaging/hd/retainedDataSource.h" -#include "pxr/imaging/hd/materialNetworkSchema.h" -#include "pxr/imaging/hd/materialSchema.h" -#include "pxr/imaging/hd/lightSchema.h" -#include "pxr/imaging/hd/dataSourceMaterialNetworkInterface.h" #include "pxr/imaging/hd/version.h" -#include "pxr/imaging/hdsi/legacyDisplayStyleOverrideSceneIndex.h" #include "pxr/imaging/hdsi/sceneGlobalsSceneIndex.h" -#include "pxr/usd/usd/stage.h" +#include "pxr/usdImaging/usdImaging/delegate.h" +#include "pxr/usdImaging/usdImaging/sceneIndices.h" +#include "pxr/usdImaging/usdImaging/stageSceneIndex.h" + #include "pxr/usd/usd/prim.h" +#include "pxr/usd/usd/stage.h" #include "pxr/usd/usdGeom/camera.h" +#include "pxr/usd/usdGeom/tokens.h" #include "pxr/usd/usdRender/product.h" #include "pxr/usd/usdRender/settings.h" #include "pxr/usd/usdRender/spec.h" #include "pxr/usd/usdRender/var.h" -#include "pxr/usdImaging/usdImaging/delegate.h" -#include "pxr/usdImaging/usdImaging/sceneIndices.h" -#include "pxr/usdImaging/usdImaging/stageSceneIndex.h" - +#include "pxr/base/arch/env.h" +#include "pxr/base/tf/diagnostic.h" #include "pxr/base/tf/envSetting.h" -#include "pxr/base/tf/pathUtils.h" #include "pxr/base/tf/stopwatch.h" -#include "pxr/base/arch/env.h" +#include "pxr/base/tf/token.h" #include "pxr/base/trace/reporter.h" +#include "pxr/base/vt/types.h" #include "pxr/base/work/threadLimits.h" -#include "hdPrman/renderDelegate.h" +#include "pxr/pxr.h" +#include #include -#include #include -#include #include PXR_NAMESPACE_USING_DIRECTIVE @@ -909,12 +893,9 @@ HydraSetupAndRender( // XXX // The data flow below needs to be updated to be scene description driven. // Specifically: - // - "render tags" should be replaced with "includedPurposes" on the - // RenderSettings prim. // - "rprim collection" should be replaced with the Usd Collection opinion // on the driving RenderPass prim. - const TfTokenVector renderTags{HdRenderTagTokens->geometry}; // The collection of scene contents to render HdRprimCollection hdCollection( _tokens->testCollection, @@ -950,12 +931,34 @@ HydraSetupAndRender( cameraInfo->aspectRatioConformPolicy) }); #endif } - - auto sgsi = appSceneIndices->sceneGlobalsSceneIndex; - TF_VERIFY(sgsi); - fprintf(stdout, "Setting the active render settings prim path to <%s>.\n", - renderSettingsPrimPath.GetText()); - sgsi->SetActiveRenderSettingsPrimPath(renderSettingsPrimPath); + + TfTokenVector renderTags; + if (!renderSettingsPrimPath.IsEmpty()) { + const UsdRenderSettings& settings = UsdRenderSettings( + stage->GetPrimAtPath(renderSettingsPrimPath)); + VtTokenArray purposes; + settings.GetIncludedPurposesAttr().Get(&purposes); + for (const TfToken& purpose : purposes) { + if (purpose == UsdGeomTokens->default_) { + renderTags.push_back(HdRenderTagTokens->geometry); + } else if (purpose == UsdGeomTokens->guide) { + renderTags.push_back(HdRenderTagTokens->guide); + } else if (purpose == UsdGeomTokens->render) { + renderTags.push_back(HdRenderTagTokens->render); + } else if (purpose == UsdGeomTokens->proxy) { + renderTags.push_back(HdRenderTagTokens->proxy); + } else { + TF_CODING_ERROR("Unrecognized purpose: %s", purpose.GetText()); + } + } + auto sgsi = appSceneIndices->sceneGlobalsSceneIndex; + TF_VERIFY(sgsi); + fprintf(stdout, "Setting the active render settings prim path to <%s>.\n", + renderSettingsPrimPath.GetText()); + sgsi->SetActiveRenderSettingsPrimPath(renderSettingsPrimPath); + } else { + renderTags.push_back(HdRenderTagTokens->geometry); + } // The task execution graph and engine configuration is also simple. HdTaskSharedPtrVector tasks = { @@ -1160,6 +1163,15 @@ int main(int argc, char *argv[]) // hydra's first-class support for render settings scene description. fprintf(stdout, "Rendering using the experimentalRenderSpec dictionary...\n"); for (auto product: renderSpec.products) { + + if (product.type != TfToken("raster")) { + TF_WARN( + "Skipping product %s because product type %s is not" + "supported in the renderSpec path.", + product.name.GetText(), product.type.GetText()); + + continue; + } printf("Rendering product %s...\n", product.name.GetText()); HydraSetupCameraInfo camInfo = ApplyCommandLineArgsToProduct( @@ -1172,9 +1184,6 @@ int main(int argc, char *argv[]) settingsMap[HdPrmanRenderSettingsTokens->experimentalRenderSpec] = CreateRenderSpecDict(renderSpec, product); - // Only allow "raster" for now. - TF_VERIFY(product.type == TfToken("raster")); - AddVisualizerStyle(visualizerStyle, &settingsMap); AddNamespacedSettings(product.namespacedSettings, &settingsMap); settingsMap[HdRenderSettingsTokens->enableInteractive] = false; diff --git a/third_party/renderman-25/plugin/hdPrman/tetMeshConversionSceneIndexPlugin.cpp b/third_party/renderman-25/plugin/hdPrman/tetMeshConversionSceneIndexPlugin.cpp index 64e4103571..e76f0ec1da 100644 --- a/third_party/renderman-25/plugin/hdPrman/tetMeshConversionSceneIndexPlugin.cpp +++ b/third_party/renderman-25/plugin/hdPrman/tetMeshConversionSceneIndexPlugin.cpp @@ -1,25 +1,8 @@ // // Copyright 2024 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. #include "hdPrman/tetMeshConversionSceneIndexPlugin.h" diff --git a/third_party/renderman-25/plugin/hdPrman/tetMeshConversionSceneIndexPlugin.h b/third_party/renderman-25/plugin/hdPrman/tetMeshConversionSceneIndexPlugin.h index be39609ca6..aa632befa3 100644 --- a/third_party/renderman-25/plugin/hdPrman/tetMeshConversionSceneIndexPlugin.h +++ b/third_party/renderman-25/plugin/hdPrman/tetMeshConversionSceneIndexPlugin.h @@ -1,25 +1,8 @@ // // Copyright 2024 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. #ifndef EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_TET_MESH_CONVERSION_SCENE_INDEX_PLUGIN_H #define EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_TET_MESH_CONVERSION_SCENE_INDEX_PLUGIN_H diff --git a/third_party/renderman-25/plugin/hdPrman/tokens.cpp b/third_party/renderman-25/plugin/hdPrman/tokens.cpp index 02e978ad61..1750e9fc2d 100644 --- a/third_party/renderman-25/plugin/hdPrman/tokens.cpp +++ b/third_party/renderman-25/plugin/hdPrman/tokens.cpp @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "hdPrman/tokens.h" diff --git a/third_party/renderman-25/plugin/hdPrman/tokens.h b/third_party/renderman-25/plugin/hdPrman/tokens.h index a52e705ef0..f26752308f 100644 --- a/third_party/renderman-25/plugin/hdPrman/tokens.h +++ b/third_party/renderman-25/plugin/hdPrman/tokens.h @@ -1,25 +1,8 @@ // // Copyright 2022 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_TOKENS_H #define EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_TOKENS_H @@ -50,6 +33,7 @@ TF_DECLARE_PUBLIC_TOKENS(HdPrmanTokens, HDPRMAN_API, HD_PRMAN_TOKENS); ((displayFilter, "riley:displayFilter")) \ ((geometryInstance, "riley:geometryInstance")) \ ((geometryPrototype, "riley:geometryPrototype")) \ + ((globals, "riley:globals")) \ ((integrator, "riley:integrator")) \ ((lightInstance, "riley:lightInstance")) \ ((lightShader, "riley:lightShader")) \ diff --git a/third_party/renderman-25/plugin/hdPrman/updateObjectSettingsSceneIndex.cpp b/third_party/renderman-25/plugin/hdPrman/updateObjectSettingsSceneIndex.cpp index 07e50ee34d..0ce8b0dc47 100644 --- a/third_party/renderman-25/plugin/hdPrman/updateObjectSettingsSceneIndex.cpp +++ b/third_party/renderman-25/plugin/hdPrman/updateObjectSettingsSceneIndex.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. #include "hdPrman/updateObjectSettingsSceneIndex.h" diff --git a/third_party/renderman-25/plugin/hdPrman/updateObjectSettingsSceneIndex.h b/third_party/renderman-25/plugin/hdPrman/updateObjectSettingsSceneIndex.h index 1783cb6b15..d28fcd29f3 100644 --- a/third_party/renderman-25/plugin/hdPrman/updateObjectSettingsSceneIndex.h +++ b/third_party/renderman-25/plugin/hdPrman/updateObjectSettingsSceneIndex.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. #ifndef EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_UPDATE_OBJECT_SETTINGS_SCENE_INDEX_H #define EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_UPDATE_OBJECT_SETTINGS_SCENE_INDEX_H diff --git a/third_party/renderman-25/plugin/hdPrman/updateObjectSettingsSceneIndexPlugin.cpp b/third_party/renderman-25/plugin/hdPrman/updateObjectSettingsSceneIndexPlugin.cpp index e8ed9c11fd..2f6bbd81b8 100644 --- a/third_party/renderman-25/plugin/hdPrman/updateObjectSettingsSceneIndexPlugin.cpp +++ b/third_party/renderman-25/plugin/hdPrman/updateObjectSettingsSceneIndexPlugin.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. #include "hdPrman/updateObjectSettingsSceneIndexPlugin.h" diff --git a/third_party/renderman-25/plugin/hdPrman/updateObjectSettingsSceneIndexPlugin.h b/third_party/renderman-25/plugin/hdPrman/updateObjectSettingsSceneIndexPlugin.h index 0135f39e63..e923e6cc25 100644 --- a/third_party/renderman-25/plugin/hdPrman/updateObjectSettingsSceneIndexPlugin.h +++ b/third_party/renderman-25/plugin/hdPrman/updateObjectSettingsSceneIndexPlugin.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. #ifndef EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_UPDATE_OBJECT_SETTINGS_SCENE_INDEX_PLUGIN_H #define EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_UPDATE_OBJECT_SETTINGS_SCENE_INDEX_PLUGIN_H diff --git a/third_party/renderman-25/plugin/hdPrman/utils.cpp b/third_party/renderman-25/plugin/hdPrman/utils.cpp index 81f4048bdb..a2f8cf5e25 100644 --- a/third_party/renderman-25/plugin/hdPrman/utils.cpp +++ b/third_party/renderman-25/plugin/hdPrman/utils.cpp @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "hdPrman/utils.h" @@ -515,6 +498,7 @@ _IsNativeRenderManFormat(std::string const &path) /// - RMAN_TEXTUREPATH /// - RMAN_RIXPLUGINPATH /// - RMAN_PROCEDURALPATH +/// - RMAN_DISPLAYPATH /// void _UpdateSearchPathsFromEnvironment(RtParamList& options) @@ -623,6 +607,27 @@ _UpdateSearchPathsFromEnvironment(RtParamList& options) options.SetString( RixStr.k_searchpath_procedural, RtUString(proceduralpath.c_str()) ); } + + { + std::string displaypath = TfGetenv("RMAN_DISPLAYPATH"); + NdrStringVec paths; + if (!displaypath.empty()) { + // RenderMan expects ':' as path separator, regardless of platform + for (std::string const& path : TfStringSplit(displaypath, + ARCH_PATH_LIST_SEP)) + { + paths.push_back(path); + } + } + + // Default RenderMan installation under '$RMANTREE/lib/plugins' + if (!rmantree.empty()) { + paths.push_back(TfStringCatPaths(rmantree, "lib/plugins")); + } + displaypath = TfStringJoin(paths, ":"); + options.SetString( RixStr.k_searchpath_display, + RtUString(displaypath.c_str()) ); + } } } diff --git a/third_party/renderman-25/plugin/hdPrman/utils.h b/third_party/renderman-25/plugin/hdPrman/utils.h index 067f91c4c3..42a445ba01 100644 --- a/third_party/renderman-25/plugin/hdPrman/utils.h +++ b/third_party/renderman-25/plugin/hdPrman/utils.h @@ -1,25 +1,8 @@ // // Copyright 2023 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_UTILS_H #define EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_UTILS_H diff --git a/third_party/renderman-25/plugin/hdPrman/virtualStructConditionalGrammar.lex.cpp b/third_party/renderman-25/plugin/hdPrman/virtualStructConditionalGrammar.lex.cpp index 5243ae18b7..b820fad695 100644 --- a/third_party/renderman-25/plugin/hdPrman/virtualStructConditionalGrammar.lex.cpp +++ b/third_party/renderman-25/plugin/hdPrman/virtualStructConditionalGrammar.lex.cpp @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #line 3 "" @@ -522,7 +505,6 @@ static yyconst flex_int16_t yy_chk[200] = // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") // with the following modification; you may not use this file except in // compliance with the Apache License and the following modification to it: // Section 6. Trademarks. is deleted and replaced with: @@ -540,7 +522,8 @@ static yyconst flex_int16_t yy_chk[200] = // distributed under the Apache License with the above modification is // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY // KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/base/arch/fileSystem.h" diff --git a/third_party/renderman-25/plugin/hdPrman/virtualStructConditionalGrammar.ll b/third_party/renderman-25/plugin/hdPrman/virtualStructConditionalGrammar.ll index 9c1b6c8398..567a733544 100644 --- a/third_party/renderman-25/plugin/hdPrman/virtualStructConditionalGrammar.ll +++ b/third_party/renderman-25/plugin/hdPrman/virtualStructConditionalGrammar.ll @@ -2,25 +2,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" #include "pxr/base/arch/fileSystem.h" diff --git a/third_party/renderman-25/plugin/hdPrman/virtualStructConditionalGrammar.tab.cpp b/third_party/renderman-25/plugin/hdPrman/virtualStructConditionalGrammar.tab.cpp index 3bb4987178..2be51903bd 100644 --- a/third_party/renderman-25/plugin/hdPrman/virtualStructConditionalGrammar.tab.cpp +++ b/third_party/renderman-25/plugin/hdPrman/virtualStructConditionalGrammar.tab.cpp @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // /* A Bison parser, made by GNU Bison 2.4.1. */ diff --git a/third_party/renderman-25/plugin/hdPrman/virtualStructConditionalGrammar.tab.h b/third_party/renderman-25/plugin/hdPrman/virtualStructConditionalGrammar.tab.h index e478e84af7..b73e486683 100644 --- a/third_party/renderman-25/plugin/hdPrman/virtualStructConditionalGrammar.tab.h +++ b/third_party/renderman-25/plugin/hdPrman/virtualStructConditionalGrammar.tab.h @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // /* A Bison parser, made by GNU Bison 2.4.1. */ diff --git a/third_party/renderman-25/plugin/hdPrman/virtualStructConditionalGrammar.yy b/third_party/renderman-25/plugin/hdPrman/virtualStructConditionalGrammar.yy index 8861870f32..386a6b71bc 100644 --- a/third_party/renderman-25/plugin/hdPrman/virtualStructConditionalGrammar.yy +++ b/third_party/renderman-25/plugin/hdPrman/virtualStructConditionalGrammar.yy @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // %define api.pure %error-verbose diff --git a/third_party/renderman-25/plugin/hdPrman/virtualStructResolvingSceneIndex.cpp b/third_party/renderman-25/plugin/hdPrman/virtualStructResolvingSceneIndex.cpp index 376589e323..9f9caa7a12 100644 --- a/third_party/renderman-25/plugin/hdPrman/virtualStructResolvingSceneIndex.cpp +++ b/third_party/renderman-25/plugin/hdPrman/virtualStructResolvingSceneIndex.cpp @@ -1,25 +1,8 @@ // // Copyright 2021 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "hdPrman/virtualStructResolvingSceneIndex.h" #include "hdPrman/matfiltResolveVstructs.h" diff --git a/third_party/renderman-25/plugin/hdPrman/virtualStructResolvingSceneIndex.h b/third_party/renderman-25/plugin/hdPrman/virtualStructResolvingSceneIndex.h index 72ea05c8aa..ccebf0d76d 100644 --- a/third_party/renderman-25/plugin/hdPrman/virtualStructResolvingSceneIndex.h +++ b/third_party/renderman-25/plugin/hdPrman/virtualStructResolvingSceneIndex.h @@ -1,25 +1,8 @@ // // Copyright 2021 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_VIRTUAL_STRUCT_RESOLVING_SCENE_INDEX_H #define EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_VIRTUAL_STRUCT_RESOLVING_SCENE_INDEX_H diff --git a/third_party/renderman-25/plugin/hdPrman/volume.cpp b/third_party/renderman-25/plugin/hdPrman/volume.cpp index 926995ad81..09ed44bb21 100644 --- a/third_party/renderman-25/plugin/hdPrman/volume.cpp +++ b/third_party/renderman-25/plugin/hdPrman/volume.cpp @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "hdPrman/volume.h" @@ -476,43 +459,50 @@ HdPrman_Volume::_ConvertGeometry(HdPrman_RenderParam *renderParam, RtUString *primType, std::vector *geomSubsets) { - HdVolumeFieldDescriptorVector fields = - sceneDelegate->GetVolumeFieldDescriptors(id); - - if (fields.empty()) { - return RtPrimVarList(); - } - - TfToken fieldPrimType = _DetermineConsistentFieldPrimType(fields); - if (fieldPrimType.IsEmpty()) { - TF_WARN("The fields on volume %s have inconsistent types and can't be " - "emitted as a single volume", id.GetText()); - return RtPrimVarList(); - } - - // Based on the field type we determine the function to emit the volume to - // Prman - _VolumeEmitterMap const& volumeEmitters = _GetVolumeEmitterMap(); - auto const iter = volumeEmitters.find(fieldPrimType); - if (iter == volumeEmitters.end()) { - TF_WARN("No volume emitter registered for field type '%s' " - "on prim %s", fieldPrimType.GetText(), id.GetText()); - return RtPrimVarList(); - } + *primType = RixStr.k_Ri_Volume; + // Dimensions int32_t const dims[] = { 0, 0, 0 }; uint64_t const dim = dims[0] * dims[1] * dims[2]; - RtPrimVarList primvars(1, dim, dim, dim); primvars.SetIntegerArray(RixStr.k_Ri_dimensions, dims, 3); - *primType = RixStr.k_Ri_Volume; + HdPrman_ConvertPrimvars( + sceneDelegate, id, primvars, + /* numUniform = */ 1, + /* numVertex = */ 0, + /* numVarying = */ 0, + /* numFaceVarying = */ 0); // Setup the volume for Prman with the appropriate DSO and its parameters - HdPrman_VolumeTypeEmitter emitterFunc = iter->second; - emitterFunc(sceneDelegate, id, fields, &primvars); + HdVolumeFieldDescriptorVector fields = + sceneDelegate->GetVolumeFieldDescriptors(id); + if (!fields.empty()) { + TfToken fieldPrimType = _DetermineConsistentFieldPrimType(fields); + if (fieldPrimType.IsEmpty()) { + TF_WARN("The fields on volume %s have inconsistent types and " + "cannot be emitted as a single volume", id.GetText()); + return RtPrimVarList(); + } + + // Based on the field type we determine the function to emit the + // volume to Prman + _VolumeEmitterMap const& volumeEmitters = _GetVolumeEmitterMap(); + auto const iter = volumeEmitters.find(fieldPrimType); + if (iter == volumeEmitters.end()) { + TF_WARN("No volume emitter registered for field type '%s' " + "on prim %s", fieldPrimType.GetText(), id.GetText()); + return RtPrimVarList(); + } - HdPrman_ConvertPrimvars(sceneDelegate, id, primvars, 1, dim, dim, dim); + HdPrman_VolumeTypeEmitter emitterFunc = iter->second; + emitterFunc(sceneDelegate, id, fields, &primvars); + } else { + // If no fields are found, the volume will be required to + // specify Ri:type (ex: "box") and Ri:Bounds. We do not + // check this here because RenderMan will already issue + // an appropriate warning. + } return primvars; } diff --git a/third_party/renderman-25/plugin/hdPrman/volume.h b/third_party/renderman-25/plugin/hdPrman/volume.h index a2370b9bb5..65235fc322 100644 --- a/third_party/renderman-25/plugin/hdPrman/volume.h +++ b/third_party/renderman-25/plugin/hdPrman/volume.h @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_VOLUME_H #define EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_VOLUME_H diff --git a/third_party/renderman-25/plugin/hdPrman/xcpt.cpp b/third_party/renderman-25/plugin/hdPrman/xcpt.cpp index e23ebcfbdc..47a97e84a2 100644 --- a/third_party/renderman-25/plugin/hdPrman/xcpt.cpp +++ b/third_party/renderman-25/plugin/hdPrman/xcpt.cpp @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "hdPrman/xcpt.h" diff --git a/third_party/renderman-25/plugin/hdPrman/xcpt.h b/third_party/renderman-25/plugin/hdPrman/xcpt.h index 5b6423bc62..a4b2c36956 100644 --- a/third_party/renderman-25/plugin/hdPrman/xcpt.h +++ b/third_party/renderman-25/plugin/hdPrman/xcpt.h @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef HDPRMAN_XCPT_H #define HDPRMAN_XCPT_H diff --git a/third_party/renderman-25/plugin/rmanArgsParser/__init__.py b/third_party/renderman-25/plugin/rmanArgsParser/__init__.py index 362927c080..9e37da7762 100644 --- a/third_party/renderman-25/plugin/rmanArgsParser/__init__.py +++ b/third_party/renderman-25/plugin/rmanArgsParser/__init__.py @@ -1,25 +1,8 @@ # # Copyright 2019 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. # from pxr import Tf Tf.PreparePythonModule() diff --git a/third_party/renderman-25/plugin/rmanArgsParser/api.h b/third_party/renderman-25/plugin/rmanArgsParser/api.h index 31d41ac6ac..ce2d7a7689 100644 --- a/third_party/renderman-25/plugin/rmanArgsParser/api.h +++ b/third_party/renderman-25/plugin/rmanArgsParser/api.h @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_RMAN_ARGS_PARSER_API_H #define EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_RMAN_ARGS_PARSER_API_H diff --git a/third_party/renderman-25/plugin/rmanArgsParser/module.cpp b/third_party/renderman-25/plugin/rmanArgsParser/module.cpp index d1a0dc1f73..79661e7bf8 100644 --- a/third_party/renderman-25/plugin/rmanArgsParser/module.cpp +++ b/third_party/renderman-25/plugin/rmanArgsParser/module.cpp @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/third_party/renderman-25/plugin/rmanArgsParser/pch.h b/third_party/renderman-25/plugin/rmanArgsParser/pch.h index 63c182eb75..056e5a3107 100644 --- a/third_party/renderman-25/plugin/rmanArgsParser/pch.h +++ b/third_party/renderman-25/plugin/rmanArgsParser/pch.h @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // // WARNING: THIS FILE IS GENERATED. DO NOT EDIT. // diff --git a/third_party/renderman-25/plugin/rmanArgsParser/rmanArgsParser.cpp b/third_party/renderman-25/plugin/rmanArgsParser/rmanArgsParser.cpp index 981214b1df..8134422ac5 100644 --- a/third_party/renderman-25/plugin/rmanArgsParser/rmanArgsParser.cpp +++ b/third_party/renderman-25/plugin/rmanArgsParser/rmanArgsParser.cpp @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/third_party/renderman-25/plugin/rmanArgsParser/rmanArgsParser.h b/third_party/renderman-25/plugin/rmanArgsParser/rmanArgsParser.h index 76d1f745b4..be4b749f9e 100644 --- a/third_party/renderman-25/plugin/rmanArgsParser/rmanArgsParser.h +++ b/third_party/renderman-25/plugin/rmanArgsParser/rmanArgsParser.h @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_RMAN_ARGS_PARSER_RMAN_ARGS_PARSER_H diff --git a/third_party/renderman-25/plugin/rmanArgsParser/wrapRmanArgsParser.cpp b/third_party/renderman-25/plugin/rmanArgsParser/wrapRmanArgsParser.cpp index 77996d744f..8e6744034b 100644 --- a/third_party/renderman-25/plugin/rmanArgsParser/wrapRmanArgsParser.cpp +++ b/third_party/renderman-25/plugin/rmanArgsParser/wrapRmanArgsParser.cpp @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/pxr.h" diff --git a/third_party/renderman-25/plugin/rmanDiscovery/rmanDiscovery.cpp b/third_party/renderman-25/plugin/rmanDiscovery/rmanDiscovery.cpp index e89de74797..7ba9cbfb5f 100644 --- a/third_party/renderman-25/plugin/rmanDiscovery/rmanDiscovery.cpp +++ b/third_party/renderman-25/plugin/rmanDiscovery/rmanDiscovery.cpp @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/base/arch/fileSystem.h" diff --git a/third_party/renderman-25/plugin/rmanDiscovery/rmanDiscovery.h b/third_party/renderman-25/plugin/rmanDiscovery/rmanDiscovery.h index 8805a397cf..7a52aef2a2 100644 --- a/third_party/renderman-25/plugin/rmanDiscovery/rmanDiscovery.h +++ b/third_party/renderman-25/plugin/rmanDiscovery/rmanDiscovery.h @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_RMAN_DISCOVERY_RMAN_DISCOVERY_H diff --git a/third_party/renderman-25/plugin/rmanOslParser/rmanOslParser.cpp b/third_party/renderman-25/plugin/rmanOslParser/rmanOslParser.cpp index d56c4bdda7..9766226dc8 100644 --- a/third_party/renderman-25/plugin/rmanOslParser/rmanOslParser.cpp +++ b/third_party/renderman-25/plugin/rmanOslParser/rmanOslParser.cpp @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "pxr/base/arch/fileSystem.h" diff --git a/third_party/renderman-25/plugin/rmanOslParser/rmanOslParser.h b/third_party/renderman-25/plugin/rmanOslParser/rmanOslParser.h index 19ea502b23..50e586cfb8 100644 --- a/third_party/renderman-25/plugin/rmanOslParser/rmanOslParser.h +++ b/third_party/renderman-25/plugin/rmanOslParser/rmanOslParser.h @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #ifndef EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_RMAN_OSL_PARSER_RMAN_OSL_PARSER_H diff --git a/third_party/renderman-25/plugin/rmanOslParser/testenv/testRmanOslParser.py b/third_party/renderman-25/plugin/rmanOslParser/testenv/testRmanOslParser.py index 5af340ae8f..a3e363de84 100644 --- a/third_party/renderman-25/plugin/rmanOslParser/testenv/testRmanOslParser.py +++ b/third_party/renderman-25/plugin/rmanOslParser/testenv/testRmanOslParser.py @@ -2,25 +2,8 @@ # # Copyright 2020 Pixar # -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. import unittest diff --git a/third_party/renderman-25/plugin/rtx_glfImage/CMakeLists.txt b/third_party/renderman-25/plugin/rtx_hioImage/CMakeLists.txt similarity index 100% rename from third_party/renderman-25/plugin/rtx_glfImage/CMakeLists.txt rename to third_party/renderman-25/plugin/rtx_hioImage/CMakeLists.txt diff --git a/third_party/renderman-25/plugin/rtx_glfImage/main.cpp b/third_party/renderman-25/plugin/rtx_hioImage/main.cpp similarity index 93% rename from third_party/renderman-25/plugin/rtx_glfImage/main.cpp rename to third_party/renderman-25/plugin/rtx_hioImage/main.cpp index a06a6b5a26..bda9f83c68 100644 --- a/third_party/renderman-25/plugin/rtx_glfImage/main.cpp +++ b/third_party/renderman-25/plugin/rtx_hioImage/main.cpp @@ -1,25 +1,8 @@ // // Copyright 2019 Pixar // -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. // #include "RtxPlugin.h" diff --git a/third_party/renderman-26/CMakeLists.txt b/third_party/renderman-26/CMakeLists.txt new file mode 100644 index 0000000000..c99aeee22e --- /dev/null +++ b/third_party/renderman-26/CMakeLists.txt @@ -0,0 +1,2 @@ +add_subdirectory(plugin) +add_subdirectory(shaders) diff --git a/third_party/renderman-26/README.md b/third_party/renderman-26/README.md new file mode 100644 index 0000000000..74d216a17e --- /dev/null +++ b/third_party/renderman-26/README.md @@ -0,0 +1,6 @@ +RenderMan 26 Plugins +==================== + +This section contains libraries and plugins for RenderMan 26. + +See the [online documentation](http://openusd.org/docs/RenderMan-USD-Imaging-Plugin.html) for more details. diff --git a/third_party/renderman-26/plugin/CMakeLists.txt b/third_party/renderman-26/plugin/CMakeLists.txt new file mode 100644 index 0000000000..a5e87dbdfd --- /dev/null +++ b/third_party/renderman-26/plugin/CMakeLists.txt @@ -0,0 +1,10 @@ +add_subdirectory(rmanArgsParser) +add_subdirectory(rmanDiscovery) +add_subdirectory(hdPrman) +add_subdirectory(rtx_hioImage) +add_subdirectory(usdRiPxr) +# Only build rmanOslParser when sdrOsl is disabled +# This allows hdPrman to render OSL files without OSL pre-installed +if (NOT PXR_ENABLE_OSL_SUPPORT) + add_subdirectory(rmanOslParser) +endif() diff --git a/third_party/renderman-26/plugin/hdPrman/CMakeLists.txt b/third_party/renderman-26/plugin/hdPrman/CMakeLists.txt new file mode 100644 index 0000000000..262062aa7d --- /dev/null +++ b/third_party/renderman-26/plugin/hdPrman/CMakeLists.txt @@ -0,0 +1,238 @@ +# To be sure our VtVisitValue polyfill works correctly, the preprocessor must +# resolve the #include in our identically-named +# polyfill to the real one in libpxr. But CMAKE_INCLUDE_CURRENT_DIR injects the +# cpp source directory as the first include search path. The preprocessor +# therefore finds only our polyfill and stops looking, never getting the chance +# to find the libpxr one. Setting this to OFF allows the preprocessor to resolve +# the angle-include to libpxr instead, and does not affect any other part of the +# hdPrman build. The polyfill will be removed once hdPrman drops support for +# USD versions older than 22.11. +set(CMAKE_INCLUDE_CURRENT_DIR OFF) + +# Install hdPrman's headers in pxr/imaging alongside other shared +# libraries for Hydra backends, like hdSt. +set(PXR_PREFIX pxr/imaging) +set(PXR_PACKAGE hdPrman) + +# RiEntryPoints.h incorrectly makes libloadprman symbols DLL import +# This is only temporary and will be removed shortly +add_definitions(-DPRMANBUILDINGAPI) + +# TODO The pxr cmake macros don't provide a good way to link prman with link_directories +# on Linux/OSX without resorting to absolute rpath. For now, simply avoid linking +# libprman on Linux/OSX. +set(optionalLibs "") +if(WIN32) + set( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /NODEFAULTLIB:libmmd.lib /NODEFAULTLIB:libirc.lib /NODEFAULTLIB:svml_dispmd.lib /NODEFAULTLIB:libdecimal.lib" ) + list(APPEND optionalLibs ${PXRCORE_LIBRARY}) + list(APPEND optionalLibs ${PRMAN_LIBRARY}) + list(APPEND optionalLibs ${PRMAN_STATS_LIBRARY}) +elseif(APPLE) + set( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -undefined dynamic_lookup -headerpad_max_install_names" ) +endif() + +set(optionalIncludeDirs "") +set(optionalPublicClasses "") +if (${PXR_ENABLE_MATERIALX_SUPPORT}) + list(APPEND optionalLibs + MaterialXCore + MaterialXFormat + MaterialXGenShader + MaterialXGenOsl + MaterialXRender + hdMtlx + ) + list(APPEND optionalPublicClasses matfiltMaterialX) + + if (${PXR_ENABLE_OSL_SUPPORT}) + if (DEFINED OSL_SHADER_INSTALL_DIR) + add_compile_definitions( + OSL_SHADER_INSTALL_DIR=\"${OSL_SHADER_INSTALL_DIR}\" + ) + endif() + + list(APPEND optionalLibs ${OSL_COMP_LIBRARY}) + list(APPEND optionalIncludeDirs ${OSL_INCLUDE_DIR}) + endif() +endif() + +if (${PXR_ENABLE_OPENVDB_SUPPORT}) + list(APPEND optionalLibs hioOpenVDB) +endif() + +pxr_plugin(${PXR_PACKAGE} + LIBRARIES + ar + arch + js + plug + tf + vt + gf + hd + hdsi + hio + usdRi + usdVol + usdVolImaging + ${optionalLibs} + + INCLUDE_DIRS + ${RENDERMAN_INCLUDE_DIR} + ${optionalIncludeDirs} + + PUBLIC_CLASSES + basisCurves + camera + cone + coordSys + coordSysPrimSceneIndexPlugin + cylinder + debugCodes + dependencyForwardingSceneIndexPlugin + displayFilter + gprim + gprimbase + instancer + integrator + light + lightFilter + material + matfiltConvertPreviewMaterial + matfiltResolveVstructs + mesh + renderTerminalOutputInvalidatingSceneIndexPlugin + points + renderDelegate + renderSettings + rileyCameraSchema + rileyClippingPlaneSchema + rileyConversionSceneIndexPlugin + rileyCoordinateSystemSchema + rileyDisplacementSchema + rileyDisplayFilterSchema + rileyDisplaySchema + rileyFallbackMaterialSceneIndexPlugin + rileyGeometryInstanceSchema + rileyGeometryPrototypeSchema + rileyGlobalsSchema + rileyIntegratorSchema + rileyLightInstanceSchema + rileyLightShaderSchema + rileyMaterialSchema + rileyParamSchema + rileyParamListSchema + rileyPrimvarSchema + rileyPrimvarListSchema + rileyRenderOutputSchema + rileyRenderTargetSchema + rileyRenderViewSchema + rileySampleFilterSchema + rileyShadingNodeSchema + rixStrings + sampleFilter + sphere + tetMeshConversionSceneIndexPlugin + tokens + volume + xcpt + ${optionalPublicClasses} + + PRIVATE_CLASSES + cameraContext + debugUtil + extComputationPrimvarPruningSceneIndexPlugin + framebuffer + implicitSurfaceSceneIndexPlugin + materialPrimvarTransferSceneIndexPlugin + matfiltSceneIndexPlugins + motionBlurSceneIndexPlugin + pinnedCurveExpandingSceneIndexPlugin + renderBuffer + renderParam + renderPass + renderPassSceneIndex + renderPassSceneIndexPlugin + renderSettingsFilteringSceneIndexPlugin + renderViewContext + resourceRegistry + rileyCameraPrim + rileyCoordinateSystemPrim + rileyClippingPlanePrim + rileyDisplacementPrim + rileyDisplayFilterPrim + rileyDisplayPrim + rileyGeometryInstancePrim + rileyGeometryPrototypePrim + rileyGlobalsPrim + rileyIntegratorPrim + rileyLightInstancePrim + rileyLightShaderPrim + rileyMaterialPrim + rileyPrimBase + rileyPrimFactory + rileyRenderOutputPrim + rileyRenderTargetPrim + rileyRenderViewPrim + rileySampleFilterPrim + rileyTypes + terminalSceneIndexObserver + updateObjectSettingsSceneIndex + updateObjectSettingsSceneIndexPlugin + utils + virtualStructResolvingSceneIndex + + PUBLIC_HEADERS + api.h + rileySchemaTypeDefs.h + + PRIVATE_HEADERS + prmanArchDefs.h + pxr/base/vt/typeHeaders.h # polyfill until USD 22.08 + pxr/base/vt/visitValue.h # polyfill until USD 22.11 + rileyIds.h + sceneIndexObserverApi.h + virtualStructConditionalGrammar.tab.h + + CPPFILES + lightLinkingSceneIndexPlugin.cpp + rendererPlugin.cpp + virtualStructConditionalGrammar.lex.cpp + virtualStructConditionalGrammar.tab.cpp + + RESOURCE_FILES + plugInfo.json + + DISABLE_PRECOMPILED_HEADERS +) + +# Include paths to hdPrman headers within hdPrman itself look like +# #include "hdPrman/...", so we need to add include/pxr/imaging +# to the include paths for this library. We use PROJECT_BINARY_DIR +# to include headers out of the build directory, which is what +# normally happens in the USD build. +if(TARGET hdPrman) + target_include_directories(${PXR_PACKAGE} + PRIVATE + "${PROJECT_BINARY_DIR}/include/pxr/imaging" + ) +endif() + +if(WIN32 AND NOT BUILD_SHARED_LIBS) + # XXX: Temporarily disable this test on static Windows builds + # due to symbol visibility issues. +else() + pxr_build_test(testHdPrman + LIBRARIES + cameraUtil + hdPrman + hd + usd + usdImaging + usdRender + ${PXRCORE_LIBRARY} + ${PRMAN_LIBRARY} + CPPFILES + testenv/testHdPrman.cpp + ) +endif() diff --git a/third_party/renderman-26/plugin/hdPrman/api.h b/third_party/renderman-26/plugin/hdPrman/api.h new file mode 100644 index 0000000000..c0b72141c7 --- /dev/null +++ b/third_party/renderman-26/plugin/hdPrman/api.h @@ -0,0 +1,30 @@ +// +// Copyright 2019 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// +#ifndef EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_API_H +#define EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_API_H + +#include "pxr/base/arch/export.h" + +#if defined(PXR_STATIC) +# define HDPRMAN_API +# define HDPRMAN_API_TEMPLATE_CLASS(...) +# define HDPRMAN_API_TEMPLATE_STRUCT(...) +# define HDPRMAN_LOCAL +#else +# if defined(HDPRMAN_EXPORTS) +# define HDPRMAN_API ARCH_EXPORT +# define HDPRMAN_API_TEMPLATE_CLASS(...) ARCH_EXPORT_TEMPLATE(class, __VA_ARGS__) +# define HDPRMAN_API_TEMPLATE_STRUCT(...) ARCH_EXPORT_TEMPLATE(struct, __VA_ARGS__) +# else +# define HDPRMAN_API ARCH_IMPORT +# define HDPRMAN_API_TEMPLATE_CLASS(...) ARCH_IMPORT_TEMPLATE(class, __VA_ARGS__) +# define HDPRMAN_API_TEMPLATE_STRUCT(...) ARCH_IMPORT_TEMPLATE(struct, __VA_ARGS__) +# endif +# define HDPRMAN_LOCAL ARCH_HIDDEN +#endif + +#endif diff --git a/third_party/renderman-26/plugin/hdPrman/basisCurves.cpp b/third_party/renderman-26/plugin/hdPrman/basisCurves.cpp new file mode 100644 index 0000000000..c30d05a65e --- /dev/null +++ b/third_party/renderman-26/plugin/hdPrman/basisCurves.cpp @@ -0,0 +1,150 @@ +// +// Copyright 2019 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// +#include // for std::iota +#include "hdPrman/basisCurves.h" + +#include "hdPrman/renderParam.h" +#include "hdPrman/material.h" +#include "hdPrman/rixStrings.h" +#include "pxr/imaging/hd/basisCurvesTopology.h" + +#include "RiTypesHelper.h" + +PXR_NAMESPACE_OPEN_SCOPE + +#if PXR_VERSION > 2011 +HdPrman_BasisCurves::HdPrman_BasisCurves(SdfPath const& id) + : BASE(id) +#else +HdPrman_BasisCurves::HdPrman_BasisCurves(SdfPath const& id, + SdfPath const& instancerId) + : BASE(id, instancerId) +#endif +{ +} + +HdDirtyBits +HdPrman_BasisCurves::GetInitialDirtyBitsMask() const +{ + // The initial dirty bits control what data is available on the first + // run through _PopulateRtBasisCurves(), so it should list every data item + // that _PopluateRtBasisCurves requests. + int mask = HdChangeTracker::Clean + | HdChangeTracker::DirtyPoints + | HdChangeTracker::DirtyTopology + | HdChangeTracker::DirtyTransform + | HdChangeTracker::DirtyVisibility + | HdChangeTracker::DirtyPrimvar + | HdChangeTracker::DirtyNormals + | HdChangeTracker::DirtyWidths + | HdChangeTracker::DirtyInstancer + | HdChangeTracker::DirtyMaterialId + ; + + return (HdDirtyBits)mask; +} + +RtPrimVarList +HdPrman_BasisCurves::_ConvertGeometry(HdPrman_RenderParam *renderParam, + HdSceneDelegate *sceneDelegate, + const SdfPath &id, + RtUString *primType, + std::vector *geomSubsets) +{ + HdBasisCurvesTopology topology = + GetBasisCurvesTopology(sceneDelegate); + VtIntArray curveVertexCounts = topology.GetCurveVertexCounts(); + VtIntArray curveIndices = topology.GetCurveIndices(); + TfToken curveType = topology.GetCurveType(); + TfToken curveBasis = topology.GetCurveBasis(); + TfToken curveWrap = topology.GetCurveWrap(); + + *primType = RixStr.k_Ri_Curves; + + // Note: 'nowrap' and 'nsegs' terminology below is to match + // prman primvar docs, for ease of validation. + const int numCurves = curveVertexCounts.size(); + const int nowrap = (curveWrap == HdTokens->periodic) ? 0 : 1; + size_t vertexPrimvarCount = 0; + size_t varyingPrimvarCount = 0; + size_t facevaryingPrimvarCount = 0; + if (curveType == HdTokens->cubic) { + const int vstep = (curveBasis == HdTokens->bezier) ? 3 : 1; + for (const int &nvertices: curveVertexCounts) { + const int nsegs = (curveWrap == HdTokens->periodic) ? + nvertices / vstep : (nvertices - 4) / vstep + 1; + varyingPrimvarCount += nsegs + nowrap; + vertexPrimvarCount += nvertices; + facevaryingPrimvarCount += nsegs + nowrap; + } + } else if (curveType == HdTokens->linear) { + for (const int &nvertices: curveVertexCounts) { + varyingPrimvarCount += nvertices; + vertexPrimvarCount += nvertices; + facevaryingPrimvarCount += nvertices; + } + } else { + TF_CODING_ERROR("Unknown curveType %s\n", curveType.GetText()); + } + + RtPrimVarList primvars( + numCurves, /* uniform */ + vertexPrimvarCount, /* vertex */ + varyingPrimvarCount, /* varying */ + facevaryingPrimvarCount /* facevarying */); + + if (curveType == HdTokens->cubic) { + primvars.SetString(RixStr.k_Ri_type, RixStr.k_cubic); + if (curveBasis == HdTokens->cubic) { + primvars.SetString(RixStr.k_Ri_Basis, RixStr.k_cubic); + } else if (curveBasis == HdTokens->bSpline) { + primvars.SetString(RixStr.k_Ri_Basis, RixStr.k_bspline); + } else if (curveBasis == HdTokens->bezier) { + primvars.SetString(RixStr.k_Ri_Basis, RixStr.k_bezier); + } else if (curveBasis == HdTokens->catmullRom) { + primvars.SetString(RixStr.k_Ri_Basis, RixStr.k_catmullrom); + } else { + TF_CODING_ERROR("Unknown curveBasis %s\n", curveBasis.GetText()); + } + } else if (curveType == HdTokens->linear) { + primvars.SetString(RixStr.k_Ri_type, RixStr.k_linear); + } else { + TF_CODING_ERROR("Unknown curveType %s\n", curveType.GetText()); + } + if (curveWrap == HdTokens->periodic) { + primvars.SetString(RixStr.k_Ri_wrap, RixStr.k_periodic); + } else { + primvars.SetString(RixStr.k_Ri_wrap, RixStr.k_nonperiodic); + } + + // Index data + int const *nverticesData = (int const *)(&curveVertexCounts[0]); + primvars.SetIntegerDetail(RixStr.k_Ri_nvertices, nverticesData, + RtDetailType::k_uniform); + + // Points + HdPrman_ConvertPointsPrimvar( + sceneDelegate, + id, + renderParam->GetShutterInterval(), + primvars, + vertexPrimvarCount); + + // Set element ID. Overloaded use of "__faceIndex" to support picking... + std::vector elementId(numCurves); + std::iota(elementId.begin(), elementId.end(), 0); + primvars.SetIntegerDetail(RixStr.k_faceindex, elementId.data(), + RtDetailType::k_uniform); + + HdPrman_ConvertPrimvars( + sceneDelegate, id, primvars, numCurves, vertexPrimvarCount, + varyingPrimvarCount, facevaryingPrimvarCount); + + return primvars; +} + +PXR_NAMESPACE_CLOSE_SCOPE diff --git a/third_party/renderman-26/plugin/hdPrman/basisCurves.h b/third_party/renderman-26/plugin/hdPrman/basisCurves.h new file mode 100644 index 0000000000..25f8702bb0 --- /dev/null +++ b/third_party/renderman-26/plugin/hdPrman/basisCurves.h @@ -0,0 +1,39 @@ +// +// Copyright 2019 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// +#ifndef EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_BASIS_CURVES_H +#define EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_BASIS_CURVES_H + +#include "pxr/pxr.h" +#include "hdPrman/gprim.h" +#include "pxr/imaging/hd/basisCurves.h" + +#include "Riley.h" + +PXR_NAMESPACE_OPEN_SCOPE + +class HdPrman_BasisCurves final : public HdPrman_Gprim +{ +public: + using BASE = HdPrman_Gprim; + + HF_MALLOC_TAG_NEW("new HdPrman_BasisCurves"); + + HdPrman_BasisCurves(SdfPath const& id); + + HdDirtyBits GetInitialDirtyBitsMask() const override; +protected: + RtPrimVarList + _ConvertGeometry(HdPrman_RenderParam *renderParam, + HdSceneDelegate *sceneDelegate, + const SdfPath &id, + RtUString *primType, + std::vector *geomSubsets) override; +}; + +PXR_NAMESPACE_CLOSE_SCOPE + +#endif // EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_BASIS_CURVES_H diff --git a/third_party/renderman-26/plugin/hdPrman/camera.cpp b/third_party/renderman-26/plugin/hdPrman/camera.cpp new file mode 100644 index 0000000000..7ce89f71db --- /dev/null +++ b/third_party/renderman-26/plugin/hdPrman/camera.cpp @@ -0,0 +1,187 @@ +// +// Copyright 2019 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// +#include "hdPrman/camera.h" +#include "hdPrman/cameraContext.h" + +#include "pxr/imaging/hd/sceneDelegate.h" + +#include + +PXR_NAMESPACE_OPEN_SCOPE + +#if HD_API_VERSION < 52 +TF_DEFINE_PRIVATE_TOKENS( + _lensDistortionTokens, + ((k1, "lensDistortion:k1")) + ((k2, "lensDistortion:k2")) + ((center, "lensDistortion:center")) + ((anaSq, "lensDistortion:anaSq")) + ((asym, "lensDistortion:asym")) + ((scale, "lensDistortion:scale")) +); +#endif + +TF_DEFINE_PRIVATE_TOKENS( + _tokens, + ((shutterOpenTime, "ri:shutterOpenTime")) + ((shutterCloseTime, "ri:shutterCloseTime")) + ((shutteropening, "ri:shutteropening")) + ((apertureAngle, "ri:apertureAngle")) + ((apertureDensity, "ri:apertureDensity")) + ((apertureNSides, "ri:apertureNSides")) + ((apertureRoundness, "ri:apertureRoundness")) +); + +static +std::optional> +_ToOptionalFloat8(const VtValue &value) +{ + if (!value.IsHolding>()) { + return std::nullopt; + } + const VtArray array = value.UncheckedGet>(); + if (array.size() != 8) { + return std::nullopt; + } + std::array result; + for (size_t i = 0; i < 8; i++) { + result[i] = array[i]; + } + return result; +} + +HdPrmanCamera::HdPrmanCamera(SdfPath const& id) + : HdCamera(id) +#if HD_API_VERSION < 52 + , _lensDistortionK1(0.0f) + , _lensDistortionK2(0.0f) + , _lensDistortionCenter(0.0f) + , _lensDistortionAnaSq(1.0f) + , _lensDistortionAsym(0.0f) + , _lensDistortionScale(1.0f) +#endif + , _apertureAngle(0.0f) + , _apertureDensity(0.0f) + , _apertureNSides(0) + , _apertureRoundness(1.0f) +{ +} + +HdPrmanCamera::~HdPrmanCamera() = default; + +/* virtual */ +void +HdPrmanCamera::Sync(HdSceneDelegate *sceneDelegate, + HdRenderParam *renderParam, + HdDirtyBits *dirtyBits) +{ + HD_TRACE_FUNCTION(); + HF_MALLOC_TAG_FUNCTION(); + + if (!TF_VERIFY(sceneDelegate)) { + return; + } + + HdPrman_RenderParam * const param = + static_cast(renderParam); + + SdfPath const &id = GetId(); + // Save state of dirtyBits before HdCamera::Sync clears them. + const HdDirtyBits bits = *dirtyBits; + + if (bits & DirtyTransform) { + sceneDelegate->SampleTransform(id, &_sampleXforms); + } + + if (bits & AllDirty) { + param->GetCameraContext().MarkCameraInvalid(id); + } + + HdCamera::Sync(sceneDelegate, renderParam, dirtyBits); + + if (bits & DirtyParams) { +#if HD_API_VERSION < 52 + _lensDistortionK1 = + sceneDelegate + ->GetCameraParamValue(id, _lensDistortionTokens->k1) + .GetWithDefault(0.0f); + _lensDistortionK2 = + sceneDelegate + ->GetCameraParamValue(id, _lensDistortionTokens->k2) + .GetWithDefault(0.0f); + _lensDistortionCenter = + sceneDelegate + ->GetCameraParamValue(id, _lensDistortionTokens->center) + .GetWithDefault(GfVec2f(0.0f)); + _lensDistortionAnaSq = + sceneDelegate + ->GetCameraParamValue(id, _lensDistortionTokens->anaSq) + .GetWithDefault(1.0f); + _lensDistortionAsym = + sceneDelegate + ->GetCameraParamValue(id, _lensDistortionTokens->asym) + .GetWithDefault(GfVec2f(0.0f)); + _lensDistortionScale = + sceneDelegate + ->GetCameraParamValue(id, _lensDistortionTokens->scale) + .GetWithDefault(1.0f); +#endif + + const VtValue vShutterOpenTime = + sceneDelegate->GetCameraParamValue(id, _tokens->shutterOpenTime); + if (vShutterOpenTime.IsHolding()) { + _shutterCurve.shutterOpenTime = + vShutterOpenTime.UncheckedGet(); + } else { + _shutterCurve.shutterOpenTime = std::nullopt; + } + const VtValue vShutterCloseTime = + sceneDelegate->GetCameraParamValue(id, _tokens->shutterCloseTime); + if (vShutterCloseTime.IsHolding()) { + _shutterCurve.shutterCloseTime = + vShutterCloseTime.UncheckedGet(); + } else { + _shutterCurve.shutterCloseTime = std::nullopt; + } + const VtValue vShutteropening = + sceneDelegate->GetCameraParamValue(id, _tokens->shutteropening); + _shutterCurve.shutteropening = _ToOptionalFloat8(vShutteropening); + + _apertureAngle = + sceneDelegate->GetCameraParamValue(id, _tokens->apertureAngle) + .GetWithDefault(0.0f); + _apertureDensity = + sceneDelegate->GetCameraParamValue(id, _tokens->apertureDensity) + .GetWithDefault(0.0f); + _apertureNSides = + sceneDelegate->GetCameraParamValue(id, _tokens->apertureNSides) + .GetWithDefault(0); + _apertureRoundness = + sceneDelegate->GetCameraParamValue(id, _tokens->apertureRoundness) + .GetWithDefault(1.0f); + + if (id == param->GetCameraContext().GetCameraPath()) { + // Motion blur in Riley only works correctly if the + // shutter interval is set before any rprims are synced + // (and the transform of the riley camera is updated). + // + // See SetRileyShutterIntervalFromCameraContextCameraPath + // for additional context. + // + param->SetRileyShutterIntervalFromCameraContextCameraPath( + &sceneDelegate->GetRenderIndex()); + } + } + + // XXX: Should we flip the proj matrix (RHS vs LHS) as well here? + + // We don't need to clear the dirty bits since HdCamera::Sync always clears + // all the dirty bits. +} + +PXR_NAMESPACE_CLOSE_SCOPE + diff --git a/third_party/renderman-26/plugin/hdPrman/camera.h b/third_party/renderman-26/plugin/hdPrman/camera.h new file mode 100644 index 0000000000..dee7304338 --- /dev/null +++ b/third_party/renderman-26/plugin/hdPrman/camera.h @@ -0,0 +1,176 @@ +// +// Copyright 2019 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// +#ifndef EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_CAMERA_H +#define EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_CAMERA_H + +#include "pxr/pxr.h" +#include "hdPrman/api.h" +#include "hdPrman/renderParam.h" +#include "pxr/imaging/hd/camera.h" +#include "pxr/imaging/hd/timeSampleArray.h" + +#include "pxr/base/vt/array.h" + +#include + +PXR_NAMESPACE_OPEN_SCOPE + +class HdSceneDelegate; + +/// \class HdPrmanCamera +/// +/// A representation for cameras that pulls on camera parameters used by Riley +/// cameras. +/// Note: We do not create a Riley camera per HdCamera because in PRman 22, +/// it'd require a render target to be created and bound (per camera), which +/// would be prohibitively expensive in Prman 22. +/// +class HdPrmanCamera final : public HdCamera +{ +public: + /// See GetShutterCurve() below for a description of what these + /// values represent. + /// + struct ShutterCurve + { + std::optional shutterOpenTime; + std::optional shutterCloseTime; + std::optional> shutteropening; + }; + + HDPRMAN_API + HdPrmanCamera(SdfPath const& id); + + HDPRMAN_API + ~HdPrmanCamera() override; + + /// Synchronizes state from the delegate to this object. + HDPRMAN_API + void Sync(HdSceneDelegate *sceneDelegate, + HdRenderParam *renderParam, + HdDirtyBits *dirtyBits) override; + + /// Returns the time sampled xforms that were queried during Sync. + HDPRMAN_API + HdTimeSampleArray const& + GetTimeSampleXforms() const { + return _sampleXforms; + } + +#if HD_API_VERSION < 52 + float GetLensDistortionK1() const { + return _lensDistortionK1; + } + + float GetLensDistortionK2() const { + return _lensDistortionK2; + } + + const GfVec2f &GetLensDistortionCenter() const { + return _lensDistortionCenter; + } + + float GetLensDistortionAnaSq() const { + return _lensDistortionAnaSq; + } + + const GfVec2f &GetLensDistortionAsym() const { + return _lensDistortionAsym; + } + + float GetLensDistortionScale() const { + return _lensDistortionScale; + } +#endif + + /// Get the shutter curve of the camera. This curve determines the + /// transparency of the shutter as a function of (normalized) + /// time. + /// + /// Note that the times returned here are relative to the shutter + /// interval. + /// + /// Some more explanation: + /// + /// The values given here are passed to the Riley camera as options + /// RixStr.k_shutterOpenTime, k_shutterCloseTime and k_shutteropening. + /// + /// (where as the shutter interval is set through the global Riley options + /// using Ri:Shutter). + /// + /// RenderMan computes the shutter curve using constant pieces and + /// cubic Bezier interpolation between the following points + /// + /// (0, 0), (t1, y1), (t2,y2), (t3, 1), (t4, 1), (t5, y5), (t6, y6), (1, 0) + /// + /// which are encoded as: + /// t3 is the shutterOpenTime + /// t4 is the shutterCloseTime + /// [t1, y1, t2, y2, t5, y5, t6, y6] is the shutteropening array. + /// + /// \note The shutter:open and shutter:close attributes of UsdGeomCamera + /// represent the (frame-relative) time the shutter *begins to open* + /// and is *fully closed* respectively. + /// + /// The Riley shutterOpenTime and shutterCloseTime represent the + /// (riley shutter-interval relative) time the shutter is *fully + /// open* and *begins to close* respectively. + /// + const ShutterCurve& GetShutterCurve() const { + return _shutterCurve; + } + + float GetApertureAngle() const { + return _apertureAngle; + } + + float GetApertureDensity() const { + return _apertureAngle; + } + + float GetApertureNSides() const { + return _apertureNSides; + } + + float GetApertureRoundness() const { + return _apertureRoundness; + } + +private: + HdTimeSampleArray _sampleXforms; + +#if HD_API_VERSION < 52 + float _lensDistortionK1; + float _lensDistortionK2; + GfVec2f _lensDistortionCenter; + float _lensDistortionAnaSq; + GfVec2f _lensDistortionAsym; + float _lensDistortionScale; +#endif + + /// RenderMan computes the shutter curve using constant pieces and + /// cubic Bezier interpolation between the following points + /// + /// (0, 0), (t1, y1), (t2,y2), (t3, 1), (t4, 1), (t5, y5), (t6, y6), (1, 0) + /// + /// which are encoded as: + /// t3 is the shutterOpenTime + /// t4 is the shutterCloseTime + /// [t1, y1, t2, y2, t5, y5, t6, y6] is shutteropeningPoints array. + /// + ShutterCurve _shutterCurve; + + float _apertureAngle; + float _apertureDensity; + int _apertureNSides; + float _apertureRoundness; +}; + + +PXR_NAMESPACE_CLOSE_SCOPE + +#endif // EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_CAMERA_H diff --git a/third_party/renderman-26/plugin/hdPrman/cameraContext.cpp b/third_party/renderman-26/plugin/hdPrman/cameraContext.cpp new file mode 100644 index 0000000000..8ea28e1a10 --- /dev/null +++ b/third_party/renderman-26/plugin/hdPrman/cameraContext.cpp @@ -0,0 +1,833 @@ +// +// Copyright 2021 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// +#include "hdPrman/cameraContext.h" + +#include "hdPrman/camera.h" +#include "hdPrman/rixStrings.h" +#include "hdPrman/utils.h" + +#include "Riley.h" +#include "RixShadingUtils.h" + +#include "pxr/base/gf/math.h" +#include "pxr/base/tf/envSetting.h" + +#include + +PXR_NAMESPACE_OPEN_SCOPE + +static const RtUString s_projectionNodeName("cam_projection"); + +HdPrman_CameraContext::HdPrman_CameraContext() + : _policy(CameraUtilFit) + , _disableDepthOfField(false) + , _invalid(false) +{ +} + +void +HdPrman_CameraContext::MarkCameraInvalid(const SdfPath &path) +{ + // No need to invalidate if camera that is not the active camera + // changed. + if (path == _cameraPath) { + _invalid = true; + } +} + +void +HdPrman_CameraContext::SetCameraPath(const SdfPath &path) +{ + if (_cameraPath != path) { + _invalid = true; + _cameraPath = path; + } +} + +void +HdPrman_CameraContext::SetFraming(const CameraUtilFraming &framing) +{ + if (_framing != framing) { + _framing = framing; + _invalid = true; + } +} + +void +HdPrman_CameraContext::SetWindowPolicy( + const CameraUtilConformWindowPolicy policy) +{ + if (_policy != policy) { + _policy = policy; + _invalid = true; + } +} + +void +HdPrman_CameraContext::SetDisableDepthOfField(bool disableDepthOfField) +{ + if (_disableDepthOfField != disableDepthOfField) { + _disableDepthOfField = disableDepthOfField; + _invalid = true; + } +} + +bool +HdPrman_CameraContext::IsInvalid() const +{ + return _invalid; +} + +/////////////////////////////////////////////////////////////////////////////// +// +// Screen window space: imagine a plane at in front of the camera (and parallel +// to the camera) with coordinates such that the square [-1,1]^2 spans a pyramid +// with angle being the (horizontal) FOV. This is the screen window space and is +// used to parametrize the rays from the camera. +// +// Image space: coordinates of the pixels in the rendered image with the top +// left pixel having coordinate (0,0), i.e., y-down. +// The display window from the camera framing is in image space as well +// as the width and height of the render buffer. +// +// We want to map the screen window space to the image space such that the +// conformed camera frustum from the scene delegate maps to the display window +// of the CameraUtilFraming. This is achieved by the following code. +// +// Compute screen window for given camera. +// +static +GfRange2d +_GetScreenWindow(const HdCamera * const cam) +{ + const GfVec2d size( + cam->GetHorizontalAperture(), cam->GetVerticalAperture()); + const GfVec2d offset( + cam->GetHorizontalApertureOffset(), cam->GetVerticalApertureOffset()); + + const GfRange2d filmbackPlane(-0.5 * size + offset, +0.5 * size + offset); + + if (cam->GetProjection() == HdCamera::Orthographic) { + return filmbackPlane; + } + + if (cam->GetFocalLength() == 0.0f || cam->GetHorizontalAperture() == 0.0f) { + return filmbackPlane; + } + + // Note that for perspective projection and with no horizontal aperture, + // our screen widndow's x-coordinate are in [-1, 1]. + // Divide by appropriate factor to get to this. + return filmbackPlane / double(0.5 * cam->GetHorizontalAperture()); +} + +// Compute the screen window we need to give to RenderMan. This screen +// window is mapped to the entire render buffer (in image space) by +// RenderMan. +// +// The input is the screenWindowForDisplayWindow: the screen window +// corresponding to the camera from the scene delegate conformed to match +// the aspect ratio of the display window. +// +// Together with the displayWindow, this input establishes how screen +// window space is mapped to image space. We know need to take the +// render buffer rect in image space and convert it to screen window +// space. +// +static +GfRange2d +_ConvertScreenWindowForDisplayWindowToRenderBuffer( + const GfRange2d &screenWindowForDisplayWindow, + const GfRange2f &displayWindow, + const GfVec2i &renderBufferSize) +{ + // Scaling factors to go from image space to screen window space. + const double screenWindowWidthPerPixel = + screenWindowForDisplayWindow.GetSize()[0] / + displayWindow.GetSize()[0]; + + const double screenWindowHeightPerPixel = + screenWindowForDisplayWindow.GetSize()[1] / + displayWindow.GetSize()[1]; + + // Assuming an affine mapping between screen window space + // and image space, compute what (0,0) corresponds to in + // screen window space. + const GfVec2d screenWindowMin( + screenWindowForDisplayWindow.GetMin()[0] + - screenWindowWidthPerPixel * displayWindow.GetMin()[0], + // Note that image space is y-Down and screen window + // space is y-Up, so this is a bit tricky... + screenWindowForDisplayWindow.GetMax()[1] + + screenWindowHeightPerPixel * ( + displayWindow.GetMin()[1] - renderBufferSize[1])); + + const GfVec2d screenWindowSize( + screenWindowWidthPerPixel * renderBufferSize[0], + screenWindowHeightPerPixel * renderBufferSize[1]); + + return GfRange2d(screenWindowMin, screenWindowMin + screenWindowSize); +} + +static +double +_SafeDiv(const double a, const double b) +{ + if (b == 0) { + TF_CODING_ERROR( + "Invalid display window in render pass state for hdPrman"); + return 1.0; + } + return a / b; +} + +// Compute the aspect ratio of the display window taking the +// pixel aspect ratio into account. +static +double +_GetDisplayWindowAspect(const CameraUtilFraming &framing) +{ + const GfVec2f &size = framing.displayWindow.GetSize(); + return framing.pixelAspectRatio * _SafeDiv(size[0], size[1]); +} + +// Convert a window into the format expected by RenderMan +// (xmin, xmax, ymin, ymax). +static +GfVec4f +_ToVec4f(const GfRange2d &window) +{ + return { float(window.GetMin()[0]), float(window.GetMax()[0]), + float(window.GetMin()[1]), float(window.GetMax()[1]) }; +} + +// Get respective projection shader name for projection. +static +const RtUString& +_ComputeProjectionShader(const HdCamera::Projection projection) +{ + static const RtUString us_PxrCamera("PxrCamera"); + static const RtUString us_PxrOrthographic("PxrOrthographic"); + + switch (projection) { + case HdCamera::Perspective: + return us_PxrCamera; + case HdCamera::Orthographic: + return us_PxrOrthographic; + } + + // Make compiler happy. + return us_PxrCamera; +} + +// Compute parameters for the camera riley::ShadingNode for perspective camera +RtParamList +_ComputePerspectiveNodeParams( + const HdPrmanCamera * const camera, bool disableDepthOfField) +{ + RtParamList result; + + static const RtUString us_lensType("lensType"); + // lensType values in PxrProjection. + constexpr int lensTypeLensWarp = 2; + + // Pick a PxrProjection lens type that supports depth of field + // and lens distortion. + result.SetInteger(us_lensType, lensTypeLensWarp); + + // FOV settings. + const float focalLength = camera->GetFocalLength(); + if (focalLength > 0) { + result.SetFloat(RixStr.k_focalLength, focalLength); + const float r = camera->GetHorizontalAperture() / focalLength; + const float fov = 2.0f * GfRadiansToDegrees(std::atan(0.5f * r)); + result.SetFloat(RixStr.k_fov, fov); + } else { + // If focal length is bogus, don't set it. + // Fallback to sane FOV. + result.SetFloat(RixStr.k_fov, 90.0f); + } + + // Depth of field settings. + const float focusDistance = camera->GetFocusDistance(); + if (focusDistance > 0.0f) { + result.SetFloat(RixStr.k_focalDistance, focusDistance); + } else { + // If value is bogus, set to sane value. + result.SetFloat(RixStr.k_focalDistance, 1000.0f); + } + + const float fStop = camera->GetFStop(); + if (disableDepthOfField || fStop <= 0.0f || focusDistance <= 0.0f) { + // If depth of field is disabled or the values are bogus, + // disable depth of field by setting f-Stop to infinity, + // and a sane value for focalDistance. + result.SetFloat(RixStr.k_fStop, RI_INFINITY); + } else { + result.SetFloat(RixStr.k_fStop, fStop); + } + + // Not setting fov frame begin/end - thus we do not support motion blur + // due to changing FOV. + + // Some of these names might need to change when switching to PxrCamera. + static const RtUString us_radial1("radial1"); + static const RtUString us_radial2("radial2"); + static const RtUString us_distortionCtr("distortionCtr"); + static const RtUString us_lensSqueeze("lensSqueeze"); + static const RtUString us_lensAsymmetryX("lensAsymmetryX"); + static const RtUString us_lensAsymmetryY("lensAsymmetryY"); + static const RtUString us_lensScale("lensScale"); + + result.SetFloat( + us_radial1, + camera->GetLensDistortionK1()); + result.SetFloat( + us_radial2, + camera->GetLensDistortionK2()); + result.SetFloatArray( + us_distortionCtr, + camera->GetLensDistortionCenter().data(), + 2); + result.SetFloat( + us_lensSqueeze, + camera->GetLensDistortionAnaSq()); + result.SetFloat( + us_lensAsymmetryX, + camera->GetLensDistortionAsym()[0]); + result.SetFloat( + us_lensAsymmetryY, + camera->GetLensDistortionAsym()[1]); + result.SetFloat( + us_lensScale, + camera->GetLensDistortionScale()); + + return result; +} + +// Compute parameters for the camera riley::ShadingNode for orthographic camera +RtParamList +_ComputeOrthographicNodeParams(const HdPrmanCamera * const camera) +{ + return {}; +} + +// Compute parameters for the camera riley::ShadingNode +static +RtParamList +_ComputeNodeParams(const HdPrmanCamera * const camera, bool disableDepthOfField) +{ + switch(camera->GetProjection()) { + case HdCamera::Perspective: + return _ComputePerspectiveNodeParams(camera, disableDepthOfField); + case HdCamera::Orthographic: + return _ComputeOrthographicNodeParams(camera); + } + + // Make compiler happy + return _ComputePerspectiveNodeParams(camera, disableDepthOfField); +} + +// Compute params given to Riley::ModifyCamera +RtParamList +HdPrman_CameraContext::_ComputeCameraParams( + const GfRange2d &screenWindow, + const HdCamera * const camera) const +{ + RtParamList result; + + // Following parameters are currently set on the Riley camera: + // 'nearClip' (float): near clipping distance + // 'farClip' (float): near clipping distance + // 'shutterOpenTime' (float): beginning of normalized shutter interval + // 'shutterCloseTime' (float): end of normalized shutter interval + + // Parameters that are not handled (and use their defaults): + // 'focusregion' (float): + // 'dofaspect' (float): dof aspect ratio + // 'apertureNSides' (int): + // 'apertureAngle' (float): + // 'apertureRoundness' (float): + // 'apertureDensity' (float): + + // Parameter that is handled during Riley camera creation: + // Rix::k_shutteropening (float[8] [c1 c2 d1 d2 e1 e2 f1 f2): additional + // control points + + // Do not use clipping range if scene delegate did not provide one. + // Note that we do a sanity check slightly stronger than + // GfRange1f::IsEmpty() in that we do not allow the range to contain + // only exactly one point. + const GfRange1f &clippingRange = camera->GetClippingRange(); + if (clippingRange.GetMin() < clippingRange.GetMax()) { + result.SetFloat(RixStr.k_nearClip, clippingRange.GetMin()); + result.SetFloat(RixStr.k_farClip, clippingRange.GetMax()); + } + + const HdPrmanCamera * const hdPrmanCamera = + dynamic_cast(camera); + const HdPrmanCamera::ShutterCurve &shutterCurve + = hdPrmanCamera->GetShutterCurve(); + + if (shutterCurve.shutterOpenTime) { + result.SetFloat( + RixStr.k_shutterOpenTime, *shutterCurve.shutterOpenTime); + } + if (shutterCurve.shutterCloseTime) { + result.SetFloat( + RixStr.k_shutterCloseTime, *shutterCurve.shutterCloseTime); + } + if (shutterCurve.shutteropening) { + result.SetFloatArray( + RixStr.k_shutteropening, + shutterCurve.shutteropening->data(), + shutterCurve.shutteropening->size()); + } + + result.SetFloat(RixStr.k_apertureAngle, + hdPrmanCamera->GetApertureAngle()); + result.SetFloat(RixStr.k_apertureDensity, + hdPrmanCamera->GetApertureDensity()); + result.SetInteger(RixStr.k_apertureNSides, + hdPrmanCamera->GetApertureNSides()); + result.SetFloat(RixStr.k_apertureRoundness, + hdPrmanCamera->GetApertureRoundness()); + + + const GfVec4f s = _ToVec4f(screenWindow); + result.SetFloatArray(RixStr.k_Ri_ScreenWindow, s.data(), 4); + + return result; +} + +// Convert Hydra time sampled matrices to renderman matrices. +// Optionally flip z-direction. +static +TfSmallVector +_ToRtMatrices( + const HdTimeSampleArray &samples, + const bool flipZ = false) +{ + using _RtMatrices = TfSmallVector; + _RtMatrices matrices(samples.count); + + static const GfMatrix4d flipZMatrix(GfVec4d(1.0, 1.0, -1.0, 1.0)); + + for (size_t i = 0; i < samples.count; ++i) { + matrices[i] = HdPrman_Utils::GfMatrixToRtMatrix( + flipZ + ? flipZMatrix * samples.values[i] + : samples.values[i]); + } + + return matrices; +} + +GfRange2d +HdPrman_CameraContext::_ComputeConformedScreenWindow( + const HdCamera * const camera) const +{ + return + CameraUtilConformedWindow( + _GetScreenWindow(camera), + _policy, + _GetDisplayWindowAspect(_framing)); +} + +void +HdPrman_CameraContext::UpdateRileyCameraAndClipPlanes( + riley::Riley * const riley, + const HdRenderIndex * const renderIndex) +{ + const HdPrmanCamera * const camera = + GetCamera(renderIndex); + if (!camera) { + // Bail if no camera. + return; + } + + const GfRange2d conformedScreenWindow = + _ComputeConformedScreenWindow(camera); + + _UpdateRileyCamera( + riley, + conformedScreenWindow, + camera); + _UpdateClipPlanes( + riley, + camera); +} + +void +HdPrman_CameraContext::UpdateRileyCameraAndClipPlanesInteractive( + riley::Riley * const riley, + const HdRenderIndex * const renderIndex, + const GfVec2i &renderBufferSize) +{ + const HdPrmanCamera * const camera = + GetCamera(renderIndex); + if (!camera) { + // Bail if no camera. + return; + } + + // The screen window we would need to use if we were targeting + // the display window. + const GfRange2d conformedScreenWindow = + _ComputeConformedScreenWindow(camera); + + // But instead, we target the rect of pixels in the render + // buffer baking the AOVs, so we need to convert the + // screen window. + _UpdateRileyCamera( + riley, + _ConvertScreenWindowForDisplayWindowToRenderBuffer( + conformedScreenWindow, + _framing.displayWindow, + renderBufferSize), + camera); + _UpdateClipPlanes( + riley, + camera); +} + +void +HdPrman_CameraContext::_UpdateRileyCamera( + riley::Riley * const riley, + const GfRange2d &screenWindow, + const HdPrmanCamera * const camera) +{ + // The riley camera should have been created before we get here. + if (!TF_VERIFY(_cameraId != riley::CameraId::InvalidId())) { + return; + } + + const riley::ShadingNode node = riley::ShadingNode { + riley::ShadingNode::Type::k_Projection, + _ComputeProjectionShader(camera->GetProjection()), + s_projectionNodeName, + _ComputeNodeParams(camera, _disableDepthOfField) + }; + + const RtParamList params = _ComputeCameraParams(screenWindow, camera); + + // Coordinate system notes. + // + // # Hydra & USD are right-handed + // - Camera space is always Y-up, looking along -Z. + // - World space may be either Y-up or Z-up, based on stage metadata. + // - Individual prims may be marked to be left-handed, which + // does not affect spatial coordinates, it only flips the + // winding order of polygons. + // + // # Prman is left-handed + // - World is Y-up + // - Camera looks along +Z. + + using _HdTimeSamples = + HdTimeSampleArray; + using _RtMatrices = + TfSmallVector; + + // Use time sampled transforms authored on the scene camera. + const _HdTimeSamples &sampleXforms = camera->GetTimeSampleXforms(); + + // Riley camera xform is "move the camera", aka viewToWorld. + // Convert right-handed Y-up camera space (USD, Hydra) to + // left-handed Y-up (Prman) coordinates. This just amounts to + // flipping the Z axis. + const _RtMatrices rtMatrices = + _ToRtMatrices(sampleXforms, /* flipZ = */ true); + + const riley::Transform transform{ + unsigned(sampleXforms.count), + rtMatrices.data(), + sampleXforms.times.data() }; + + // Commit camera. + riley->ModifyCamera( + _cameraId, + &node, + &transform, + ¶ms); +} + +// Hydra expresses clipping planes as a plane equation +// in the camera object space. +// Riley API expresses clipping planes in terms of a +// time-sampled transform, a normal, and a point. +static +bool +_ToClipPlaneParams(const GfVec4d &plane, RtParamList * const params) +{ + static const RtUString us_planeNormal("planeNormal"); + static const RtUString us_planeOrigin("planeOrigin"); + + const GfVec3f direction(plane[0], plane[1], plane[2]); + const float directionLength = direction.GetLength(); + if (directionLength == 0.0f) { + return false; + } + // Riley API expects a unit-length normal. + const GfVec3f norm = direction / directionLength; + params->SetNormal(us_planeNormal, + RtNormal3(norm[0], norm[1], norm[2])); + // Determine the distance along the normal + // to the plane. + const float distance = -plane[3] / directionLength; + // The origin can be any point on the plane. + const RtPoint3 origin(norm[0] * distance, + norm[1] * distance, + norm[2] * distance); + params->SetPoint(us_planeOrigin, origin); + + return true; +} + +void +HdPrman_CameraContext::_UpdateClipPlanes( + riley::Riley * const riley, + const HdPrmanCamera * const camera) +{ + _DeleteClipPlanes(riley); + + // Create clipping planes + const std::vector &clipPlanes = camera->GetClipPlanes(); + if (clipPlanes.empty()) { + return; + } + + using _HdTimeSamples = + HdTimeSampleArray; + using _RtMatrices = + TfSmallVector; + + // Use time sampled transforms authored on the scene camera. + const _HdTimeSamples &sampleXforms = camera->GetTimeSampleXforms(); + const _RtMatrices rtMatrices = _ToRtMatrices(sampleXforms); + + const riley::Transform transform { + unsigned(sampleXforms.count), + rtMatrices.data(), + sampleXforms.times.data() }; + + for (const GfVec4d &plane: clipPlanes) { + RtParamList params; + if (_ToClipPlaneParams(plane, ¶ms)) { + _clipPlaneIds.push_back( + riley->CreateClippingPlane(transform, params)); + } + } +} + +void +HdPrman_CameraContext::_DeleteClipPlanes( + riley::Riley * const riley) +{ + for (riley::ClippingPlaneId const& id: _clipPlaneIds) { + riley->DeleteClippingPlane(id); + } + _clipPlaneIds.clear(); +} + +// The crop window for RenderMan. +// +// Computed from data window and render buffer size. +// +// Recall from the RenderMan API: +// Only the pixels within the crop window are rendered. Has no +// affect on how pixels in the image map into the filmback plane. +// The crop window is relative to the render buffer size, e.g., +// the crop window of (0,0,1,1) corresponds to the entire render +// buffer. The coordinates of the crop window are y-down. +// Format is (xmin, xmax, ymin, ymax). +// +// The limits for the integer locations corresponding to the above crop +// window are: +// +// rxmin = clamp(ceil( renderbufferwidth*xmin ), 0, renderbufferwidth - 1) +// rxmax = clamp(ceil( renderbufferwidth*xmax - 1), 0, renderbufferwidth - 1) +// similar for y +// +static +float +_DivRoundDown(const float a, const int b) +{ + // Note that if the division (performed here) + // float(a) / b + // rounds up, then the result (by RenderMan) of + // ceil(b * (float(a) / b)) + // might be a+1 instead of a. + // + // We add a slight negative bias to a to avoid this (we could also + // set the floating point rounding mode but: how to do this in a + // portable way - and on x86 switching the rounding is slow). + + return GfClamp((a - 0.0078125f) / b, 0.0f, 1.0f); +} + +// Compute how the dataWindow sets in a window with upper left corner +// at camWindowMin and size camWindowSize. +static +GfVec4f +_ComputeCropWindow( + const GfRect2i &dataWindow, + const GfVec2f &camWindowMin, + const GfVec2i &camWindowSize) +{ + return GfVec4f( + _DivRoundDown(dataWindow.GetMinX() - camWindowMin[0] , + camWindowSize[0]), + _DivRoundDown(dataWindow.GetMaxX() - camWindowMin[0] + 1.0f, + camWindowSize[0]), + _DivRoundDown(dataWindow.GetMinY() - camWindowMin[1] , + camWindowSize[1]), + _DivRoundDown(dataWindow.GetMaxY() - camWindowMin[1] + 1.0f, + camWindowSize[1])); +} + +GfVec2i +HdPrman_CameraContext::GetResolutionFromDisplayWindow() const +{ + const GfVec2f size = _framing.displayWindow.GetSize(); + + return GfVec2i(std::ceil(size[0]), std::ceil(size[1])); +} + +void +HdPrman_CameraContext::SetRileyOptions( + RtParamList * const options) const +{ + const GfVec2i res = GetResolutionFromDisplayWindow(); + + // Compute how the data window sits in the display window. + const GfVec4f cropWindow = + _ComputeCropWindow( + _framing.dataWindow, + _framing.displayWindow.GetMin(), + res); + + options->SetFloatArray( + RixStr.k_Ri_CropWindow, + cropWindow.data(), 4); + + options->SetIntegerArray( + RixStr.k_Ri_FormatResolution, + res.data(), 2); + + options->SetFloat( + RixStr.k_Ri_FormatPixelAspectRatio, + _framing.pixelAspectRatio); +} + +void +HdPrman_CameraContext::SetRileyOptionsInteractive( + RtParamList * const options, + const GfVec2i &renderBufferSize) const +{ + // Compute how the data window sits in the rect of the render + // buffer baking the AOVs. + + const GfVec4f cropWindow = + _ComputeCropWindow( + _framing.dataWindow, + GfVec2f(0.0f), + renderBufferSize); + + options->SetFloatArray( + RixStr.k_Ri_CropWindow, + cropWindow.data(), 4); + + options->SetFloat( + RixStr.k_Ri_FormatPixelAspectRatio, + _framing.pixelAspectRatio); +} + +void +HdPrman_CameraContext::MarkValid() +{ + _invalid = false; +} + +void +HdPrman_CameraContext::CreateRileyCamera( + riley::Riley * const riley, + const RtUString &cameraName) +{ + _cameraName = cameraName; + + RtParamList nodeParams; + nodeParams.SetFloat(RixStr.k_fov, 60.0f); + + // Projection + const riley::ShadingNode node = riley::ShadingNode { + riley::ShadingNode::Type::k_Projection, + _ComputeProjectionShader(HdCamera::Perspective), + s_projectionNodeName, + nodeParams + }; + + // Camera params + RtParamList params; + + // Transform + float const zerotime[] = { 0.0f }; + RtMatrix4x4 matrix[] = {RixConstants::k_IdentityMatrix}; + matrix[0].Translate(0.f, 0.f, -10.0f); + const riley::Transform transform = { 1, matrix, zerotime }; + + _cameraId = riley->CreateCamera( + riley::UserId( + stats::AddDataLocation(_cameraName.CStr()).GetValue()), + _cameraName, + node, + transform, + params); + + // Dicing Camera + // XXX This should be moved out if/when we support multiple camera contexts. + riley->SetDefaultDicingCamera(_cameraId); +} + +void +HdPrman_CameraContext::DeleteRileyCameraAndClipPlanes( + riley::Riley * const riley) +{ + if (_cameraId != riley::CameraId::InvalidId()) { + riley->DeleteCamera(_cameraId); + _cameraId = riley::CameraId::InvalidId(); + } + + _DeleteClipPlanes(riley); +} + +const HdPrmanCamera * +HdPrman_CameraContext::GetCamera( + const HdRenderIndex * const renderIndex) const +{ + return + static_cast( + renderIndex->GetSprim( + HdPrimTypeTokens->camera, + _cameraPath)); +} + +const CameraUtilFraming & +HdPrman_CameraContext::GetFraming() const +{ + return _framing; +} + +/* static */ +RtUString +HdPrman_CameraContext::GetDefaultReferenceCameraName() +{ + const static RtUString name("main_cam"); + return name; +} + +PXR_NAMESPACE_CLOSE_SCOPE diff --git a/third_party/renderman-26/plugin/hdPrman/cameraContext.h b/third_party/renderman-26/plugin/hdPrman/cameraContext.h new file mode 100644 index 0000000000..8517826f64 --- /dev/null +++ b/third_party/renderman-26/plugin/hdPrman/cameraContext.h @@ -0,0 +1,156 @@ +// +// Copyright 2021 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// +#ifndef EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_CAMERA_CONTEXT_H +#define EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_CAMERA_CONTEXT_H + +#include "pxr/pxr.h" +#include "hdPrman/api.h" +#include "pxr/usd/sdf/path.h" +#include "pxr/imaging/cameraUtil/conformWindow.h" +#include "pxr/imaging/cameraUtil/framing.h" + +#include "Riley.h" + +#include + +PXR_NAMESPACE_OPEN_SCOPE + +class HdRenderIndex; +class HdCamera; +class HdPrmanCamera; + +/// HdPrman_CameraContext holds all the data necessary to populate the +/// riley camera and other camera-related riley options. It also keeps +/// track whether the camera or camera-related settings such as the +/// framing have changed so that updating riley is necessary. +/// +class HdPrman_CameraContext final +{ +public: + HdPrman_CameraContext(); + + /// Call when hydra changed the transform or parameters of a camera. + void MarkCameraInvalid(const SdfPath &path); + + /// Set the active camera. If camera is the same as it used to be, + /// context is not marked invalid. + void SetCameraPath(const SdfPath &path); + + /// Set the camera framing. Context is only marked invalid if framing + /// is different from what it used to be. + void SetFraming(const CameraUtilFraming &framing); + + /// Set window policy. Same comments as for SetFraming apply. + void SetWindowPolicy(CameraUtilConformWindowPolicy policy); + + /// If true, some aspect of the camera or related state has changed + /// and the riley camera or options need to be updated. + bool IsInvalid() const; + + /// Create riley camera (with default settings). + void CreateRileyCamera( + riley::Riley * riley, + const RtUString &cameraName); + + void DeleteRileyCameraAndClipPlanes(riley::Riley * riley); + + /// Get id of riley camera - valid only after Begin. + const riley::CameraId &GetCameraId() const { return _cameraId; } + + /// Update the given riley options for offline rendering + /// to an image file. + /// + /// Sets the crop window, format resolution and pixel aspect ratio. + void SetRileyOptions( + RtParamList * options) const; + + /// Update the given riley options for rendering to AOVs backed by + /// render buffers of the given size. + /// + /// Sets the crop window and pixel aspect ratio. + void SetRileyOptionsInteractive( + RtParamList * options, + const GfVec2i &renderBufferSize) const; + + /// Update riley camera and clipping planes for offline rendering + /// to an image file. + void UpdateRileyCameraAndClipPlanes( + riley::Riley * riley, + const HdRenderIndex * renderIndex); + + /// Update riley camera and clipping planes for rendering to AOVs + /// baked by render buffers of the given size. + void UpdateRileyCameraAndClipPlanesInteractive( + riley::Riley * riley, + const HdRenderIndex * renderIndex, + const GfVec2i &renderBufferSize); + + /// Mark that riley camera and options are up to date. + void MarkValid(); + + /// Get resolution for offline rendering. + GfVec2i GetResolutionFromDisplayWindow() const; + + /// When depth of field is disabled the fstop is set to infinity. + void SetDisableDepthOfField(bool disableDepthOfField); + + /// Path of current camera in render index. + const SdfPath &GetCameraPath() const { return _cameraPath; } + + /// Camera name used when creating the riley camera object. + const RtUString& GetCameraName() const { return _cameraName; } + + /// For convenience, get camera at camera path from render index. + const HdPrmanCamera * GetCamera(const HdRenderIndex *renderIndex) const; + + /// Get the camera framing. + const CameraUtilFraming &GetFraming() const; + + static RtUString GetDefaultReferenceCameraName(); + +private: + /// Computes the screen window for the camera and conforms + /// it to have the display window's aspect ratio using the + /// current conform policy. + GfRange2d _ComputeConformedScreenWindow(const HdCamera * camera) const; + + // Compute parameters for Riley::ModifyCamera + RtParamList _ComputeCameraParams( + const GfRange2d &screenWindow, + const HdCamera * camera) const; + + void _UpdateRileyCamera( + riley::Riley * const riley, + const GfRange2d &screenWindow, + const HdPrmanCamera * camera); + + void _UpdateClipPlanes( + riley::Riley * riley, + const HdPrmanCamera * camera); + + void _DeleteClipPlanes(riley::Riley * riley); + + // Hydra Sprim path in the render index. + SdfPath _cameraPath; + CameraUtilFraming _framing; + CameraUtilConformWindowPolicy _policy; + bool _disableDepthOfField; + + // Save ids of riley clip planes so that we can delete them before + // re-creating them to update the clip planes. + std::vector _clipPlaneIds; + riley::CameraId _cameraId; + // Riley camera name provided as an argument to CreateRileyCamera. + // This needs to be unique across all cameras. + RtUString _cameraName; + + std::atomic_bool _invalid; +}; + +PXR_NAMESPACE_CLOSE_SCOPE + +#endif // EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_CAMERA_CONTEXT_H diff --git a/third_party/renderman-26/plugin/hdPrman/codegenTemplates/rileyPrim.cpp b/third_party/renderman-26/plugin/hdPrman/codegenTemplates/rileyPrim.cpp new file mode 100644 index 0000000000..50f155cf75 --- /dev/null +++ b/third_party/renderman-26/plugin/hdPrman/codegenTemplates/rileyPrim.cpp @@ -0,0 +1,177 @@ +// +// Copyright 2023 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// +//////////////////////////////////////////////////////////////////////// + +/* ************************************************************************** */ +/* ** ** */ +/* ** This file is generated by a script. ** */ +/* ** ** */ +/* ** Do not edit it directly (unless it is within a CUSTOM CODE section)! ** */ +/* ** Edit hdSchemaDefs.py instead to make changes. ** */ +/* ** ** */ +/* ************************************************************************** */ + +#include "hdPrman/{{SCHEMA_NAME | uncapitalizeFirst}}Prim.h" + +#ifdef HDPRMAN_USE_SCENE_INDEX_OBSERVER + +#include "hdPrman/rileyIds.h" +#include "hdPrman/rileyTypes.h" + +#include "hdPrman/{{SCHEMA_NAME | uncapitalizeFirst}}Schema.h" +{%- for t in FORWARD_DECLS %} +#include "hdPrman/{{t | uncapitalizeFirst}}Prim.h" +{%- endfor %} +#include "hdPrman/utils.h" + +#include "pxr/imaging/hd/sceneIndex.h" + +PXR_NAMESPACE_OPEN_SCOPE + +HdPrman_{{SCHEMA_NAME}}Prim::HdPrman_{{SCHEMA_NAME}}Prim( + HdContainerDataSourceHandle const &primSource, + const HdsiPrimManagingSceneIndexObserver * const observer, + HdPrman_RenderParam * const renderParam) + : HdPrman_RileyPrimBase(renderParam) +{ + {{SCHEMA_CLASS_NAME}} schema = + {{SCHEMA_CLASS_NAME}}::GetFromParent(primSource); + +{% for name, type_name, opt_dict in MEMBERS %} + {{ opt_dict['RILEY_CONVERTER'] }} {{ name }} = + {{ opt_dict['RILEY_CONVERTER'] }}( +{%- if 'RILEY_NEEDS_OBSERVER' in opt_dict %} + observer, +{%- endif %} + schema.Get{{name | capitalizeFirst}}() +{%- if 'FALLBACK_VALUE' in opt_dict %}, + /* fallbackValue = */ {{ opt_dict['FALLBACK_VALUE'] }} +{%- endif -%} +{%- if 'RILEY_NEEDS_SHUTTER_INTERVAL' in opt_dict %}, + _GetShutterInterval() +{%- endif -%} + ); +{% endfor %} + + _rileyId = _AcquireRiley()->Create{{RILEY_TYPE}}( +{%- if not NO_RILEY_USER_ID %} + riley::UserId(), +{% endif -%} +{%- for name, type_name, opt_dict in MEMBERS %} + {{name}}.rileyObject{% if not loop.last %},{% endif %} +{%- endfor -%} + ); +{% for name, type_name, opt_dict in MEMBERS -%} +{%- if 'RILEY_RELATIONSHIP_TARGET' in opt_dict %} +{%- if type_name == 'HdPathArrayDataSource' %} + _{{name}}Prims = std::move({{name}}.prims); +{% else %} + _{{name}}Prim = std::move({{name}}.prim); +{% endif -%} +{%- endif -%} +{%- endfor %} +// --(BEGIN CUSTOM CODE: Constructor)-- +{%- if 'Constructor' in CUSTOM_CODE_IMPL %} +{{ CUSTOM_CODE_IMPL['Constructor'] }} +{%- endif %} +// --(END CUSTOM CODE: Constructor)-- +} + +void +HdPrman_{{SCHEMA_NAME}}Prim::_Dirty( + const HdSceneIndexObserver::DirtiedPrimEntry &entry, + const HdsiPrimManagingSceneIndexObserver * const observer) +{ + {{SCHEMA_CLASS_NAME}} schema = + {{SCHEMA_CLASS_NAME}}::GetFromParent( + observer->GetSceneIndex()->GetPrim(entry.primPath).dataSource); + +{% for name, type_name, opt_dict in MEMBERS -%} +{%- if not 'RILEY_NO_MODIFY' in opt_dict %} + std::optional<{{ opt_dict['RILEY_CONVERTER'] }}> {{ name }}; + if (entry.dirtyLocators.Intersects( + {{SCHEMA_CLASS_NAME}}::Get{{name | capitalizeFirst}}Locator())) { + {{ name }} = + {{ opt_dict['RILEY_CONVERTER'] }}( +{%- if 'RILEY_NEEDS_OBSERVER' in opt_dict %} + observer, +{%- endif %} + schema.Get{{name | capitalizeFirst}}() +{%- if 'FALLBACK_VALUE' in opt_dict %}, + {{ opt_dict['FALLBACK_VALUE'] }} +{%- endif -%} +{%- if 'RILEY_NEEDS_SHUTTER_INTERVAL' in opt_dict %}, + _GetShutterInterval() +{%- endif -%} + ); + }; +{% endif -%} +{%- endfor %} + + _AcquireRiley()->Modify{{RILEY_TYPE}}( +{%- if not 'Modify' in CUSTOM_CODE_IMPL -%} + _rileyId, +{%- for name, type_name, opt_dict in MEMBERS -%} +{%- if not 'RILEY_NO_MODIFY' in opt_dict %} + HdPrman_GetRileyObjectPtr({{name}}){% if not loop.last %},{% endif %} +{%- endif -%} +{%- endfor -%} +{%- endif %} +// --(BEGIN CUSTOM CODE: Modify)-- +{%- if 'Modify' in CUSTOM_CODE_IMPL %} +{{ CUSTOM_CODE_IMPL['Modify'] }} +{%- endif %} +// --(END CUSTOM CODE: Modify)-- + ); + +{% for name, type_name, opt_dict in MEMBERS -%} +{%- if 'RILEY_RELATIONSHIP_TARGET' in opt_dict and not 'RILEY_NO_MODIFY' in opt_dict %} +{%- if type_name == 'HdPathArrayDataSource' %} + // Now that the {{RILEY_TYPE}} is using the new + // {{opt_dict['RILEY_RELATIONSHIP_TARGET']}}, we can realease the handles + // to the old {{opt_dict['RILEY_RELATIONSHIP_TARGET']}}. + if ({{name}}) { + _{{name}}Prims = std::move({{name}}->prims); + } +{% else %} + if ({{name}}) { + _{{name}}Prim = std::move({{name}}->prim); + } +{% endif -%} +{%- endif -%} +{%- endfor %} +} + +HdPrman_{{SCHEMA_NAME}}Prim::~HdPrman_{{SCHEMA_NAME}}Prim() +{ + _AcquireRiley()->Delete{{RILEY_TYPE}}( +{%- if not 'Delete' in CUSTOM_CODE_IMPL -%} +_rileyId +{%- endif %} +// --(BEGIN CUSTOM CODE: Delete)-- +{%- if 'Delete' in CUSTOM_CODE_IMPL %} +{{ CUSTOM_CODE_IMPL['Delete'] }} +{%- endif %} +// --(END CUSTOM CODE: Delete)-- + ); + +{% for name, type_name, opt_dict in MEMBERS -%} +{%- if 'RILEY_RELATIONSHIP_TARGET' in opt_dict %} +{%- if type_name == 'HdPathArrayDataSource' %} + // _{{name}}Prims gets dropped after the {{RILEY_TYPE}} was + // deleted. +{% else %} + // _{{name}}Prim gets dropped after the {{RILEY_TYPE}} was + // deleted. +{% endif -%} +{%- endif -%} +{%- endfor -%} +} + +PXR_NAMESPACE_CLOSE_SCOPE + +#endif // #ifdef HDPRMAN_USE_SCENE_INDEX_OBSERVER diff --git a/third_party/renderman-26/plugin/hdPrman/codegenTemplates/rileyPrim.h b/third_party/renderman-26/plugin/hdPrman/codegenTemplates/rileyPrim.h new file mode 100644 index 0000000000..2db6a73851 --- /dev/null +++ b/third_party/renderman-26/plugin/hdPrman/codegenTemplates/rileyPrim.h @@ -0,0 +1,97 @@ +// +// Copyright 2023 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// +//////////////////////////////////////////////////////////////////////// + +/* ************************************************************************** */ +/* ** ** */ +/* ** This file is generated by a script. ** */ +/* ** ** */ +/* ** Do not edit it directly (unless it is within a CUSTOM CODE section)! ** */ +/* ** Edit hdSchemaDefs.py instead to make changes. ** */ +/* ** ** */ +/* ************************************************************************** */ + +#ifndef {{ HEADER_GUARD|snake }}_{{ FILE_NAME|snake }}_H +#define {{ HEADER_GUARD|snake }}_{{ FILE_NAME|snake }}_H + +#include "pxr/pxr.h" +#include "hdPrman/api.h" +#include "hdPrman/sceneIndexObserverApi.h" + +#ifdef HDPRMAN_USE_SCENE_INDEX_OBSERVER + +#include "hdPrman/rileyPrimBase.h" + +PXR_NAMESPACE_OPEN_SCOPE + +{% for t in FORWARD_DECLS -%} +using HdPrman_{{t}}PrimHandle = + std::shared_ptr; +{% endfor %} +using HdPrman_{{ SCHEMA_NAME }}PrimHandle = + std::shared_ptr; + +/// \class HdPrman_{{SCHEMA_NAME}}Prim +/// +/// Wraps a riley {{RILEY_TYPE}} object, initializing or updating it +/// using the {{SCHEMA_CLASS_NAME}}. +/// +class HdPrman_{{SCHEMA_NAME}}Prim : public HdPrman_RileyPrimBase +{ +public: + HdPrman_{{SCHEMA_NAME}}Prim( + HdContainerDataSourceHandle const &primSource, + const HdsiPrimManagingSceneIndexObserver *observer, + HdPrman_RenderParam * renderParam); + + ~HdPrman_{{SCHEMA_NAME}}Prim() override; + + using RileyId = riley::{{RILEY_TYPE}}Id; +{%- if ADD_RILEY_ID_LIST %} + using RileyIdList = riley::{{RILEY_TYPE}}List; +{% endif %} + + const RileyId &GetRileyId() const { return _rileyId; } + +protected: + void _Dirty( + const HdSceneIndexObserver::DirtiedPrimEntry &entry, + const HdsiPrimManagingSceneIndexObserver * observer) override; + +private: +{%- for name, type_name, opt_dict in MEMBERS -%} +{%- if 'RILEY_RELATIONSHIP_TARGET' in opt_dict %} + // If there is a riley render target constructed from a riley render + // output, the render target needs to be deleted before the render + // output is deleted. +{%- if type_name == 'HdPathArrayDataSource' %} + // To ensure this, we keep handles to the prims wrapping the render + // outputs here. + std::vector _{{name}}Prims; +{% else %} + // To ensure this, we keep handles to the prims wrapping the render + // outputs here. + HdPrman_{{opt_dict['RILEY_RELATIONSHIP_TARGET']}}PrimHandle _{{name}}Prim; +{%- endif -%} +{%- endif -%} +{%- endfor %} + +// --(BEGIN CUSTOM CODE: Fields)-- +{%- if 'Fields' in CUSTOM_CODE_HEADER %} +{{ CUSTOM_CODE_HEADER['Fields'] }} +{%- endif %} +// --(END CUSTOM CODE: Fields)-- + + RileyId _rileyId; +}; + +PXR_NAMESPACE_CLOSE_SCOPE + +#endif // #ifdef HDPRMAN_USE_SCENE_INDEX_OBSERVER + +#endif + diff --git a/third_party/renderman-26/plugin/hdPrman/cone.cpp b/third_party/renderman-26/plugin/hdPrman/cone.cpp new file mode 100644 index 0000000000..3e2493f381 --- /dev/null +++ b/third_party/renderman-26/plugin/hdPrman/cone.cpp @@ -0,0 +1,79 @@ +#include + +// +// Copyright 2022 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// +#include "hdPrman/cone.h" + +#include "hdPrman/renderParam.h" +#include "hdPrman/instancer.h" +#include "hdPrman/material.h" +#include "hdPrman/rixStrings.h" +#include "pxr/imaging/hd/coneSchema.h" +#include "pxr/base/gf/matrix4f.h" +#include "pxr/base/gf/matrix4d.h" + +#include "Riley.h" +#include "RiTypesHelper.h" +#include "RixShadingUtils.h" +#include "RixPredefinedStrings.hpp" + +PXR_NAMESPACE_OPEN_SCOPE + +HdPrman_Cone::HdPrman_Cone(SdfPath const& id) + : BASE(id) +{ +} + +HdDirtyBits +HdPrman_Cone::GetInitialDirtyBitsMask() const +{ + constexpr int mask = HdChangeTracker::Clean + | HdChangeTracker::DirtyTransform + | HdChangeTracker::DirtyVisibility + | HdChangeTracker::DirtyPrimvar + | HdChangeTracker::DirtyMaterialId + | HdChangeTracker::DirtyInstancer + ; + + return (HdDirtyBits)mask; +} + +TfTokenVector const & +HdPrman_Cone::GetBuiltinPrimvarNames() const +{ + static TfTokenVector result{ + HdConeSchemaTokens->height, + HdConeSchemaTokens->radius }; + return result; +} + +RtPrimVarList +HdPrman_Cone::_ConvertGeometry(HdPrman_RenderParam *renderParam, + HdSceneDelegate *sceneDelegate, + const SdfPath &id, + RtUString *primType, + std::vector *geomSubsets) +{ + RtPrimVarList primvars; + + *primType = RixStr.k_Ri_Cone; + + const float radius = + sceneDelegate->Get(id, HdConeSchemaTokens->radius) + .GetWithDefault(0.0); + const float height = + sceneDelegate->Get(id, HdConeSchemaTokens->height) + .GetWithDefault(0.0); + + primvars.SetFloat(RixStr.k_Ri_radius, radius); + primvars.SetFloat(RixStr.k_Ri_height, height); + + HdPrman_ConvertPrimvars(sceneDelegate, id, primvars, 1, 0, 0, 0); + return primvars; +} + +PXR_NAMESPACE_CLOSE_SCOPE diff --git a/third_party/renderman-26/plugin/hdPrman/cone.h b/third_party/renderman-26/plugin/hdPrman/cone.h new file mode 100644 index 0000000000..2ab400ff05 --- /dev/null +++ b/third_party/renderman-26/plugin/hdPrman/cone.h @@ -0,0 +1,42 @@ +// +// Copyright 2022 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// +#ifndef EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_CONE_H +#define EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_CONE_H + +#include "pxr/pxr.h" +#include "hdPrman/gprim.h" +#include "pxr/imaging/hd/rprim.h" + +#include "Riley.h" + +PXR_NAMESPACE_OPEN_SCOPE + +class HdPrman_Cone final : public HdPrman_Gprim +{ +public: + using BASE = HdPrman_Gprim; + + HF_MALLOC_TAG_NEW("new HdPrman_Cone"); + + HdPrman_Cone(SdfPath const& id); + + HdDirtyBits GetInitialDirtyBitsMask() const override; + + TfTokenVector const &GetBuiltinPrimvarNames() const override; + +protected: + RtPrimVarList + _ConvertGeometry(HdPrman_RenderParam *renderParam, + HdSceneDelegate *sceneDelegate, + const SdfPath &id, + RtUString *primType, + std::vector *geomSubsets) override; +}; + +PXR_NAMESPACE_CLOSE_SCOPE + +#endif // EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_CONE_H diff --git a/third_party/renderman-26/plugin/hdPrman/coordSys.cpp b/third_party/renderman-26/plugin/hdPrman/coordSys.cpp new file mode 100644 index 0000000000..2882979709 --- /dev/null +++ b/third_party/renderman-26/plugin/hdPrman/coordSys.cpp @@ -0,0 +1,110 @@ +// +// Copyright 2019 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// +#include "hdPrman/coordSys.h" +#include "hdPrman/renderParam.h" +#include "hdPrman/debugCodes.h" +#include "hdPrman/rixStrings.h" +#include "hdPrman/utils.h" + +#include "pxr/usd/sdf/types.h" +#include "pxr/base/tf/staticTokens.h" +#include "pxr/imaging/hd/sceneDelegate.h" +#include "pxr/imaging/hf/diagnostic.h" +#include "RiTypesHelper.h" + +PXR_NAMESPACE_OPEN_SCOPE + +HdPrmanCoordSys::HdPrmanCoordSys(SdfPath const& id) + : HdCoordSys(id) + , _coordSysId(riley::CoordinateSystemId::InvalidId()) +{ + /* NOTHING */ +} + +HdPrmanCoordSys::~HdPrmanCoordSys() = default; + +void +HdPrmanCoordSys::Finalize(HdRenderParam *renderParam) +{ + HdPrman_RenderParam *param = + static_cast(renderParam); + _ResetCoordSys(param); +} + +void +HdPrmanCoordSys::_ResetCoordSys(HdPrman_RenderParam *param) +{ + riley::Riley *riley = param->AcquireRiley(); + if (_coordSysId != riley::CoordinateSystemId::InvalidId()) { + riley->DeleteCoordinateSystem(_coordSysId); + _coordSysId = riley::CoordinateSystemId::InvalidId(); + } +} + +/* virtual */ +void +HdPrmanCoordSys::Sync(HdSceneDelegate *sceneDelegate, + HdRenderParam *renderParam, + HdDirtyBits *dirtyBits) +{ + HdPrman_RenderParam *param = + static_cast(renderParam); + + SdfPath id = GetId(); + // Save state of dirtyBits before HdCoordSys::Sync clears them. + const HdDirtyBits bits = *dirtyBits; + + riley::Riley *riley = param->AcquireRiley(); + + HdCoordSys::Sync(sceneDelegate, renderParam, dirtyBits); + + if (bits & AllDirty) { + // Sample transform + HdTimeSampleArray xf; + sceneDelegate->SampleTransform(id, &xf); + TfSmallVector + xf_rt_values(xf.count); + for (size_t i=0; i < xf.count; ++i) { + xf_rt_values[i] = HdPrman_Utils::GfMatrixToRtMatrix(xf.values[i]); + } + const riley::Transform xform = { + unsigned(xf.count), xf_rt_values.data(), xf.times.data()}; + + RtParamList attrs; + // The coordSys name is the final component of the id, + // after stripping namespaces. + RtUString coordSysName(GetName().GetText()); + attrs.SetString(RixStr.k_name, coordSysName); + if (_coordSysId != riley::CoordinateSystemId::InvalidId()) { + riley->ModifyCoordinateSystem(_coordSysId, &xform, &attrs); + } else { + _coordSysId = riley->CreateCoordinateSystem( + riley::UserId( + stats::AddDataLocation(id.GetText()).GetValue()), + xform, attrs); + } + } + + *dirtyBits = HdChangeTracker::Clean; +} + +#if HD_API_VERSION < 53 +/* virtual */ +HdDirtyBits +HdPrmanCoordSys::GetInitialDirtyBitsMask() const +{ + return HdChangeTracker::AllDirty; +} +#endif + +bool +HdPrmanCoordSys::IsValid() const +{ + return _coordSysId != riley::CoordinateSystemId::InvalidId(); +} + +PXR_NAMESPACE_CLOSE_SCOPE diff --git a/third_party/renderman-26/plugin/hdPrman/coordSys.h b/third_party/renderman-26/plugin/hdPrman/coordSys.h new file mode 100644 index 0000000000..5b86390d31 --- /dev/null +++ b/third_party/renderman-26/plugin/hdPrman/coordSys.h @@ -0,0 +1,58 @@ +// +// Copyright 2019 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// +#ifndef EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_COORD_SYS_H +#define EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_COORD_SYS_H + +#include "pxr/pxr.h" +#include "pxr/imaging/hd/coordSys.h" +#include "pxr/imaging/hd/version.h" +#include "Riley.h" + +PXR_NAMESPACE_OPEN_SCOPE + +class HdSceneDelegate; +class HdPrman_RenderParam; + +/// \class HdPrmanCoordSys +/// +/// A representation for coordinate systems. +/// +class HdPrmanCoordSys final : public HdCoordSys +{ +public: + HdPrmanCoordSys(SdfPath const& id); + ~HdPrmanCoordSys() override; + + /// Synchronizes state from the delegate to this object. + void Sync(HdSceneDelegate *sceneDelegate, + HdRenderParam *renderParam, + HdDirtyBits *dirtyBits) override; + +#if HD_API_VERSION < 53 + /// Returns the minimal set of dirty bits to place in the + /// change tracker for use in the first sync of this prim. + /// Typically this would be all dirty bits. + HdDirtyBits GetInitialDirtyBitsMask() const override; +#endif + + riley::CoordinateSystemId GetCoordSysId() const { return _coordSysId; } + + /// Return true if this material is valid. + bool IsValid() const; + + void Finalize(HdRenderParam *renderParam) override; + +private: + void _ResetCoordSys(HdPrman_RenderParam *renderParam); + + riley::CoordinateSystemId _coordSysId; +}; + + +PXR_NAMESPACE_CLOSE_SCOPE + +#endif // EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_COORD_SYS_H diff --git a/third_party/renderman-26/plugin/hdPrman/coordSysPrimSceneIndexPlugin.cpp b/third_party/renderman-26/plugin/hdPrman/coordSysPrimSceneIndexPlugin.cpp new file mode 100644 index 0000000000..e64ea31731 --- /dev/null +++ b/third_party/renderman-26/plugin/hdPrman/coordSysPrimSceneIndexPlugin.cpp @@ -0,0 +1,52 @@ +// +// Copyright 2022 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. + +#include "hdPrman/coordSysPrimSceneIndexPlugin.h" + +#include "pxr/imaging/hdsi/coordSysPrimSceneIndex.h" +#include "pxr/imaging/hd/sceneIndexPluginRegistry.h" + +#include "pxr/base/tf/envSetting.h" + +PXR_NAMESPACE_OPEN_SCOPE + +TF_DEFINE_PRIVATE_TOKENS( + _tokens, + ((sceneIndexPluginName, "HdPrman_CoordSysPrimSceneIndexPlugin")) +); + +static const char * const _pluginDisplayName = "Prman"; + +TF_REGISTRY_FUNCTION(TfType) +{ + HdSceneIndexPluginRegistry::Define< + HdPrman_CoordSysPrimSceneIndexPlugin>(); +} + +TF_REGISTRY_FUNCTION(HdSceneIndexPlugin) +{ + const HdSceneIndexPluginRegistry::InsertionPhase insertionPhase = 1000; + + HdSceneIndexPluginRegistry::GetInstance().RegisterSceneIndexForRenderer( + _pluginDisplayName, + _tokens->sceneIndexPluginName, + nullptr, + insertionPhase, + HdSceneIndexPluginRegistry::InsertionOrderAtEnd); +} + +HdPrman_CoordSysPrimSceneIndexPlugin:: +HdPrman_CoordSysPrimSceneIndexPlugin() = default; + +HdSceneIndexBaseRefPtr +HdPrman_CoordSysPrimSceneIndexPlugin::_AppendSceneIndex( + const HdSceneIndexBaseRefPtr &inputScene, + const HdContainerDataSourceHandle &inputArgs) +{ + return HdsiCoordSysPrimSceneIndex::New(inputScene); +} + +PXR_NAMESPACE_CLOSE_SCOPE diff --git a/third_party/renderman-26/plugin/hdPrman/coordSysPrimSceneIndexPlugin.h b/third_party/renderman-26/plugin/hdPrman/coordSysPrimSceneIndexPlugin.h new file mode 100644 index 0000000000..e52f12f9b3 --- /dev/null +++ b/third_party/renderman-26/plugin/hdPrman/coordSysPrimSceneIndexPlugin.h @@ -0,0 +1,33 @@ +// +// Copyright 2023 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. + +#ifndef PXR_IMAGING_HDPRMAN_COORD_SYS_PRIM_SCENE_INDEX_PLUGIN_H +#define PXR_IMAGING_HDPRMAN_COORD_SYS_PRIM_SCENE_INDEX_PLUGIN_H + +#include "pxr/pxr.h" +#include "pxr/imaging/hd/sceneIndexPlugin.h" +#include "hdPrman/api.h" + +PXR_NAMESPACE_OPEN_SCOPE + +/// \class HdPrman_CoordSysPrimSceneIndexPlugin +/// +/// Plugin adds a scene index that adds coord system prims. +/// +class HdPrman_CoordSysPrimSceneIndexPlugin : public HdSceneIndexPlugin +{ +public: + HdPrman_CoordSysPrimSceneIndexPlugin(); + +protected: + HdSceneIndexBaseRefPtr _AppendSceneIndex( + const HdSceneIndexBaseRefPtr &inputScene, + const HdContainerDataSourceHandle &inputArgs) override; +}; + +PXR_NAMESPACE_CLOSE_SCOPE + +#endif // PXR_IMAGING_HDPRMAN_COORD_SYS_PRIM_SCENE_INDEX_PLUGIN_H diff --git a/third_party/renderman-26/plugin/hdPrman/cylinder.cpp b/third_party/renderman-26/plugin/hdPrman/cylinder.cpp new file mode 100644 index 0000000000..d07f34977e --- /dev/null +++ b/third_party/renderman-26/plugin/hdPrman/cylinder.cpp @@ -0,0 +1,78 @@ +// +// Copyright 2022 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// +#include "hdPrman/cylinder.h" + +#include "hdPrman/renderParam.h" +#include "hdPrman/instancer.h" +#include "hdPrman/material.h" +#include "hdPrman/rixStrings.h" +#include "pxr/imaging/hd/cylinderSchema.h" +#include "pxr/base/gf/matrix4f.h" +#include "pxr/base/gf/matrix4d.h" + +#include "Riley.h" +#include "RiTypesHelper.h" +#include "RixShadingUtils.h" +#include "RixPredefinedStrings.hpp" + +PXR_NAMESPACE_OPEN_SCOPE + +HdPrman_Cylinder::HdPrman_Cylinder(SdfPath const& id) + : BASE(id) +{ +} + +HdDirtyBits +HdPrman_Cylinder::GetInitialDirtyBitsMask() const +{ + constexpr int mask = HdChangeTracker::Clean + | HdChangeTracker::DirtyTransform + | HdChangeTracker::DirtyVisibility + | HdChangeTracker::DirtyPrimvar + | HdChangeTracker::DirtyMaterialId + | HdChangeTracker::DirtyInstancer + ; + + return (HdDirtyBits)mask; +} + +TfTokenVector const & +HdPrman_Cylinder::GetBuiltinPrimvarNames() const +{ + static TfTokenVector result{ + HdCylinderSchemaTokens->height, + HdCylinderSchemaTokens->radius }; + return result; +} + +RtPrimVarList +HdPrman_Cylinder::_ConvertGeometry(HdPrman_RenderParam *renderParam, + HdSceneDelegate *sceneDelegate, + const SdfPath &id, + RtUString *primType, + std::vector *geomSubsets) +{ + RtPrimVarList primvars; + + *primType = RixStr.k_Ri_Cylinder; + + const float radius = + sceneDelegate->Get(id, HdCylinderSchemaTokens->radius) + .GetWithDefault(0.0); + const float height = + sceneDelegate->Get(id, HdCylinderSchemaTokens->height) + .GetWithDefault(0.0); + + primvars.SetFloat(RixStr.k_Ri_radius, radius); + primvars.SetFloat(RixStr.k_Ri_zmin, -0.5f * height); + primvars.SetFloat(RixStr.k_Ri_zmax, 0.5f * height); + + HdPrman_ConvertPrimvars(sceneDelegate, id, primvars, 1, 0, 0, 0); + return primvars; +} + +PXR_NAMESPACE_CLOSE_SCOPE diff --git a/third_party/renderman-26/plugin/hdPrman/cylinder.h b/third_party/renderman-26/plugin/hdPrman/cylinder.h new file mode 100644 index 0000000000..9c46935555 --- /dev/null +++ b/third_party/renderman-26/plugin/hdPrman/cylinder.h @@ -0,0 +1,42 @@ +// +// Copyright 2022 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// +#ifndef EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_CYLINDER_H +#define EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_CYLINDER_H + +#include "pxr/pxr.h" +#include "hdPrman/gprim.h" +#include "pxr/imaging/hd/rprim.h" + +#include "Riley.h" + +PXR_NAMESPACE_OPEN_SCOPE + +class HdPrman_Cylinder final : public HdPrman_Gprim +{ +public: + using BASE = HdPrman_Gprim; + + HF_MALLOC_TAG_NEW("new HdPrman_Cylinder"); + + HdPrman_Cylinder(SdfPath const& id); + + HdDirtyBits GetInitialDirtyBitsMask() const override; + + TfTokenVector const &GetBuiltinPrimvarNames() const override; + +protected: + RtPrimVarList + _ConvertGeometry(HdPrman_RenderParam *renderParam, + HdSceneDelegate *sceneDelegate, + const SdfPath &id, + RtUString *primType, + std::vector *geomSubsets) override; +}; + +PXR_NAMESPACE_CLOSE_SCOPE + +#endif // EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_CYLINDER_H diff --git a/third_party/renderman-26/plugin/hdPrman/debugCodes.cpp b/third_party/renderman-26/plugin/hdPrman/debugCodes.cpp new file mode 100644 index 0000000000..03211fa400 --- /dev/null +++ b/third_party/renderman-26/plugin/hdPrman/debugCodes.cpp @@ -0,0 +1,39 @@ +// +// Copyright 2019 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// +#include "hdPrman/debugCodes.h" + +#include "pxr/base/tf/registryManager.h" + +PXR_NAMESPACE_OPEN_SCOPE + +TF_REGISTRY_FUNCTION(TfDebug) +{ + TF_DEBUG_ENVIRONMENT_SYMBOL(HDPRMAN_PRIMVARS, "Primvars"); + TF_DEBUG_ENVIRONMENT_SYMBOL(HDPRMAN_MATERIALS, "Materials"); + TF_DEBUG_ENVIRONMENT_SYMBOL(HDPRMAN_DUMP_MATERIALX_OSL_SHADER, + "Print MaterialX Generated Osl Shaders"); + TF_DEBUG_ENVIRONMENT_SYMBOL(HDPRMAN_LIGHT_LINKING, "Light linking"); + TF_DEBUG_ENVIRONMENT_SYMBOL(HDPRMAN_LIGHT_LIST, "Light list"); + TF_DEBUG_ENVIRONMENT_SYMBOL(HDPRMAN_VSTRUCTS, "Vstruct expansion"); + TF_DEBUG_ENVIRONMENT_SYMBOL(HDPRMAN_LIGHT_FILTER_LINKING, + "Light filter linking"); + TF_DEBUG_ENVIRONMENT_SYMBOL(HDPRMAN_IMAGE_ASSET_RESOLVE, + "Resolved image asset paths"); + TF_DEBUG_ENVIRONMENT_SYMBOL(HDPRMAN_INSTANCERS, "Instancers"); + TF_DEBUG_ENVIRONMENT_SYMBOL(HDPRMAN_MESHLIGHT, "Mesh lights"); + TF_DEBUG_ENVIRONMENT_SYMBOL(HDPRMAN_RENDER_SETTINGS, + "Debug logging for all things render settings."); + TF_DEBUG_ENVIRONMENT_SYMBOL(HDPRMAN_RENDER_PASS, + "Debug logging for HdPrman RenderPass dataflow and related Riley " + "computations."); + TF_DEBUG_ENVIRONMENT_SYMBOL(HDPRMAN_TERMINAL_SCENE_INDEX_OBSERVER, + "Debug logging for HdPrman terminal scene index observer."); + TF_DEBUG_ENVIRONMENT_SYMBOL(HDPRMAN_MOTION_BLUR, "Motion blur"); +} + +PXR_NAMESPACE_CLOSE_SCOPE + diff --git a/third_party/renderman-26/plugin/hdPrman/debugCodes.h b/third_party/renderman-26/plugin/hdPrman/debugCodes.h new file mode 100644 index 0000000000..058f007196 --- /dev/null +++ b/third_party/renderman-26/plugin/hdPrman/debugCodes.h @@ -0,0 +1,34 @@ +// +// Copyright 2019 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// +#ifndef EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_DEBUG_CODES_H +#define EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_DEBUG_CODES_H + +#include "pxr/pxr.h" +#include "pxr/base/tf/debug.h" + +PXR_NAMESPACE_OPEN_SCOPE + +TF_DEBUG_CODES( + HDPRMAN_PRIMVARS, + HDPRMAN_MATERIALS, + HDPRMAN_DUMP_MATERIALX_OSL_SHADER, + HDPRMAN_LIGHT_LINKING, + HDPRMAN_LIGHT_LIST, + HDPRMAN_VSTRUCTS, + HDPRMAN_LIGHT_FILTER_LINKING, + HDPRMAN_IMAGE_ASSET_RESOLVE, + HDPRMAN_INSTANCERS, + HDPRMAN_MESHLIGHT, + HDPRMAN_RENDER_SETTINGS, + HDPRMAN_RENDER_PASS, + HDPRMAN_TERMINAL_SCENE_INDEX_OBSERVER, + HDPRMAN_MOTION_BLUR +); + +PXR_NAMESPACE_CLOSE_SCOPE + +#endif // EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_DEBUG_CODES_H diff --git a/third_party/renderman-26/plugin/hdPrman/debugUtil.cpp b/third_party/renderman-26/plugin/hdPrman/debugUtil.cpp new file mode 100644 index 0000000000..0c2862fa14 --- /dev/null +++ b/third_party/renderman-26/plugin/hdPrman/debugUtil.cpp @@ -0,0 +1,632 @@ +// +// Copyright 2023 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// +#include "hdPrman/debugUtil.h" + +#include "pxr/base/arch/stackTrace.h" +#include "pxr/base/tf/callContext.h" +#include "pxr/base/tf/stringUtils.h" +#include "pxr/usd/sdf/path.h" + +PXR_NAMESPACE_OPEN_SCOPE + +namespace HdPrmanDebugUtil { + +static const int cw = 3; // length of "─" +static const char empty[] = ""; +static const char line[] = "────────────────────"; +static const char fmt[] = + "%01$+*20$.*17$f %02$+*21$.*17$f %03$+*22$.*17$f │ %04$+*23$.*17$f\n" + "%19$*18$s%05$+*20$.*17$f %06$+*21$.*17$f %07$+*22$.*17$f │ %08$+*23$.*17$f\n" + "%19$*18$s%09$+*20$.*17$f %10$+*21$.*17$f %11$+*22$.*17$f │ %12$+*23$.*17$f\n" + "%19$*18$s%28$.*24$s" "──%28$.*25$s" "──%28$.*26$s" "─┼─%28$.*27$s" "\n" + "%19$*18$s%13$+*20$.*17$f %14$+*21$.*17$f %15$+*22$.*17$f │ %16$+*23$.*17$f"; + +std::string +MatrixToString(const GfMatrix4d& mat, const int indent, const int precision) +{ + int width[4] = {0, 0, 0, 0}; + for (int i = 0; i < 4; ++i) { + for (int j = 0; j < 4; ++j) { + width[i] = std::max(width[i], + 3 + precision + (int)log10(abs(mat[i][j]))); + } + } + + return TfStringPrintf(fmt, + mat[0][0], mat[1][0], mat[2][0], mat[3][0], + mat[0][1], mat[1][1], mat[2][1], mat[3][1], + mat[0][2], mat[1][2], mat[2][2], mat[3][2], + mat[0][3], mat[1][3], mat[2][3], mat[3][3], + precision, indent, empty, + width[0], width[1], width[2], width[3], + cw * width[0], cw * width[1], cw * width[2], cw * width[3], + line); +} + +std::string +MatrixToString(const RtMatrix4x4& mat, const int indent, const int precision) +{ + int width[4] = {0, 0, 0, 0}; + for (int i = 0; i < 4; ++i) { + for (int j = 0; j < 4; ++j) { + width[i] = std::max(width[i], + 3 + precision + (int)log10(abs(mat.m[i][j]))); + } + } + + return TfStringPrintf(fmt, + mat.m[0][0], mat.m[1][0], mat.m[2][0], mat.m[3][0], + mat.m[0][1], mat.m[1][1], mat.m[2][1], mat.m[3][1], + mat.m[0][2], mat.m[1][2], mat.m[2][2], mat.m[3][2], + mat.m[0][3], mat.m[1][3], mat.m[2][3], mat.m[3][3], + precision, indent, empty, + width[0], width[1], width[2], width[3], + cw * width[0], cw * width[1], cw * width[2], cw * width[3], + line); +} + +std::string +_GetParamPrefix(const RtParamList::ParamInfo& info) +{ + std::string out; + switch (info.detail) { + case RtDetailType::k_constant: out += "constant "; break; + case RtDetailType::k_uniform: out += "uniform "; break; + case RtDetailType::k_vertex: out += "vertex "; break; + case RtDetailType::k_varying: out += "varying "; break; + case RtDetailType::k_facevarying: out += "facevarying "; break; + case RtDetailType::k_reference: out += "reference "; break; + case RtDetailType::k_invalid: out += "invalid "; break; + } + switch (info.type) { + case RtDataType::k_integer: out += "integer"; break; + case RtDataType::k_float: out += "float"; break; + case RtDataType::k_color: out += "color"; break; + case RtDataType::k_point: out += "point"; break; + case RtDataType::k_vector: out += "vector"; break; + case RtDataType::k_normal: out += "normal"; break; + case RtDataType::k_hpoint: out += "hpoint"; break; + case RtDataType::k_mpoint: out += "mpoint"; break; + case RtDataType::k_matrix: out += "matrix"; break; + case RtDataType::k_string: out += "string"; break; + case RtDataType::k_bxdf: out += "bxdf"; break; + case RtDataType::k_lightfilter: out += "lightfilter"; break; + case RtDataType::k_samplefilter: out += "samplefilter"; break; + case RtDataType::k_displayfilter: out += "displayfilter"; break; + case RtDataType::k_struct: out += "struct"; break; + } + if (info.array) { + out += TfStringPrintf("[%u]", info.length); + } + out += TfStringPrintf(" %s", info.name.CStr()); + if (info.detail == RtDetailType::k_reference) { + out += ".connect"; + } + if (info.motion) { + out += ".timesamples"; + } + out += " = "; + return out; +} + +std::string +_FormatParam( + const RtParamList::ParamInfo& info, + const RtParamList& _params, + const int indent = 0) { + + static const char* Vec3Fmt = "(%f, %f, %f)"; + static const char* Vec4Fmt = "(%f, %f, %f, %f)"; + + const std::string prefix = _GetParamPrefix(info); + const int fullIndent = indent + (int)prefix.size(); + RtParamList& params = const_cast(_params); + std::string val; + switch (info.type) { + case RtDataType::k_integer: { + if (info.array && info.detail == RtDetailType::k_reference) { + const RtUString* value = params.GetIntegerReferenceArray( + info.name, info.length); + for (uint32_t i = 0; i < info.length; ++i) { + if (!val.empty()) { + val += ", "; + } else { + val += "["; + } + val += TfStringPrintf("<%s>", (*(value+i)).CStr()); + } + val += "]"; + } else if (info.detail == RtDetailType::k_reference) { + RtUString value; + if (params.GetIntegerReference(info.name, value)) { + val = TfStringPrintf("<%s>", value.CStr()); + } + } else if (info.array) { + const int32_t* value = params.GetIntegerArray( + info.name, info.length); + for (uint32_t i = 0; i < info.length; ++i) { + if (!val.empty()) { + val += ", "; + } else { + val += "("; + } + val += TfStringPrintf("%i", *(value+i)); + } + val += ")"; + } else { + int32_t value; + if (params.GetInteger(info.name, value)) { + val = TfStringPrintf("%i", value); + } + } + break; + } + case RtDataType::k_float: { + if (info.array && info.detail == RtDetailType::k_reference) { + const RtUString* value = params.GetFloatReferenceArray( + info.name, info.length); + for (uint32_t i = 0; i < info.length; ++i) { + if (!val.empty()) { + val += ", "; + } else { + val += "["; + } + val += TfStringPrintf("<%s>", (*(value+i)).CStr()); + } + val += "]"; + } else if (info.detail == RtDetailType::k_reference) { + RtUString value; + if (params.GetFloatReference(info.name, value)) { + val = TfStringPrintf("<%s>", value.CStr()); + } + } else if (info.array) { + const float* value = params.GetFloatArray( + info.name, info.length); + for (uint32_t i = 0; i < info.length; ++i) { + if (!val.empty()) { + val += ", "; + } else { + val += "("; + } + val += TfStringPrintf("%f", *(value+i)); + } + val += ")"; + } else { + float value; + if (params.GetFloat(info.name, value)) { + val = TfStringPrintf("%f", value); + } + } + break; + } + case RtDataType::k_color: { + if (info.array && info.detail == RtDetailType::k_reference) { + const RtUString* value = params.GetColorReferenceArray( + info.name, info.length); + for (uint32_t i = 0; i < info.length; ++i) { + if (!val.empty()) { + val += ", "; + } else { + val += "["; + } + val += TfStringPrintf("<%s>", (*(value+i)).CStr()); + } + val += "]"; + } else if (info.detail == RtDetailType::k_reference) { + RtUString value; + if (params.GetColorReference(info.name, value)) { + val = TfStringPrintf("<%s>", value.CStr()); + } + } else if (info.array) { + const RtColorRGB* value = params.GetColorArray( + info.name, info.length); + for (uint32_t i = 0; i < info.length; ++i) { + if (!val.empty()) { + val += ", "; + } else { + val += "("; + } + RtColorRGB color = *(value+i); + val += TfStringPrintf(Vec3Fmt, color.r, color.g, color.b); + } + val += ")"; + } else { + RtColorRGB value; + if (params.GetColor(info.name, value)) { + val = TfStringPrintf(Vec3Fmt, value.r, value.g, value.b); + } + } + break; + } + case RtDataType::k_point: { + if (info.array && info.detail == RtDetailType::k_reference) { + const RtUString* value = params.GetPointReferenceArray( + info.name, info.length); + for (uint32_t i = 0; i < info.length; ++i) { + if (!val.empty()) { + val += ", "; + } else { + val += "["; + } + val += TfStringPrintf("<%s>", (*(value+i)).CStr()); + } + val += "]"; + } else if (info.detail == RtDetailType::k_reference) { + RtUString value; + if (params.GetPointReference(info.name, value)) { + val = TfStringPrintf("<%s>", value.CStr()); + } + } else if (info.array) { + const RtPoint3* value = params.GetPointArray( + info.name, info.length); + for (uint32_t i = 0; i < info.length; ++i) { + if (!val.empty()) { + val += ", "; + } else { + val += "("; + } + RtPoint3 point = *(value+i); + val += TfStringPrintf(Vec3Fmt, point.x, point.y, point.z); + } + val += ")"; + } else { + RtPoint3 value; + if (params.GetPoint(info.name, value)) { + val = TfStringPrintf(Vec3Fmt, value.x, value.y, value.z); + } + } + break; + } + case RtDataType::k_vector: { + if (info.array && info.detail == RtDetailType::k_reference) { + const RtUString* value = params.GetVectorReferenceArray( + info.name, info.length); + for (uint32_t i = 0; i < info.length; ++i) { + if (!val.empty()) { + val += ", "; + } else { + val += "["; + } + val += TfStringPrintf("<%s>", (*(value+i)).CStr()); + } + val += "]"; + } else if (info.detail == RtDetailType::k_reference) { + RtUString value; + if (params.GetVectorReference(info.name, value)) { + val = TfStringPrintf("<%s>", value.CStr()); + } + } else if (info.array) { + const RtVector3* value = params.GetVectorArray( + info.name, info.length); + for (uint32_t i = 0; i < info.length; ++i) { + if (!val.empty()) { + val += ", "; + } else { + val += "("; + } + RtPoint3 vector = *(value+i); + val += TfStringPrintf(Vec3Fmt, vector.x, vector.y, vector.z); + } + val += ")"; + } else { + RtVector3 value; + if (params.GetVector(info.name, value)) { + val = TfStringPrintf(Vec3Fmt, value.x, value.y, value.z); + } + } + break; + } + case RtDataType::k_normal: { + if (info.array && info.detail == RtDetailType::k_reference) { + const RtUString* value = params.GetNormalReferenceArray( + info.name, info.length); + for (uint32_t i = 0; i < info.length; ++i) { + if (!val.empty()) { + val += ", "; + } else { + val += "["; + } + val += TfStringPrintf("<%s>", (*(value+i)).CStr()); + } + val += "]"; + } else if (info.detail == RtDetailType::k_reference) { + RtUString value; + if (params.GetNormalReference(info.name, value)) { + val = TfStringPrintf("<%s>", value.CStr()); + } + } else if (info.array) { + const RtNormal3* value = params.GetNormalArray( + info.name, info.length); + for (uint32_t i = 0; i < info.length; ++i) { + if (!val.empty()) { + val += ", "; + } else { + val += "("; + } + RtNormal3 normal = *(value+i); + val += TfStringPrintf(Vec3Fmt, normal.x, normal.y, normal.z); + } + val += ")"; + } else { + RtNormal3 value; + if (params.GetNormal(info.name, value)) { + val = TfStringPrintf(Vec3Fmt, value.x, value.y, value.z); + } + } + break; + } + case RtDataType::k_hpoint: { + if (info.array) { + const RtPoint4* value = params.GetHpointArray( + info.name, info.length); + for (uint32_t i = 0; i < info.length; ++i) { + if (!val.empty()) { + val += ", "; + } else { + val += "("; + } + RtPoint4 point = *(value+i); + val += TfStringPrintf( + Vec4Fmt, point.x, point.y, point.z, point.w); + } + val += ")"; + } else { + RtPoint4 value; + if (params.GetHpoint(info.name, value)) { + val = TfStringPrintf( + Vec4Fmt, value.x, value.y, value.z, value.w); + } + } + break; + } + case RtDataType::k_mpoint: { + if (info.array) { + const RtMatrix4x4* value = params.GetMpointArray( + info.name, info.length); + for (uint32_t i = 0; i < info.length; ++i) { + if (!val.empty()) { + val += TfStringPrintf(",\n%*s", fullIndent, ""); + } + RtMatrix4x4 mpoint = *(value+i); + val += MatrixToString(mpoint, fullIndent); + } + } else { + RtMatrix4x4 value; + if (params.GetMpoint(info.name, value)) { + val += MatrixToString(value, fullIndent); + } + } + break; + } + case RtDataType::k_matrix: { + if (info.array && info.detail == RtDetailType::k_reference) { + const RtUString* value = params.GetMatrixReferenceArray( + info.name, info.length); + for (uint32_t i = 0; i < info.length; ++i) { + if (!val.empty()) { + val += ", "; + } else { + val += "["; + } + val += TfStringPrintf("<%s>", (*(value+i)).CStr()); + } + val += "]"; + } else if (info.detail == RtDetailType::k_reference) { + RtUString value; + if (params.GetMatrixReference(info.name, value)) { + val = TfStringPrintf("<%s>", value.CStr()); + } + } else if (info.array) { + const RtMatrix4x4* value = params.GetMatrixArray( + info.name, info.length); + for (uint32_t i = 0; i < info.length; ++i) { + if (!val.empty()) { + val += TfStringPrintf(",\n%*s", fullIndent, ""); + } + RtMatrix4x4 matrix = *(value+i); + val += MatrixToString(matrix, fullIndent); + } + } else { + RtMatrix4x4 value; + if (params.GetMatrix(info.name, value)) { + val += MatrixToString(value, fullIndent); + } + } + break; + } + case RtDataType::k_string: { + if (info.array && info.detail == RtDetailType::k_reference) { + const RtUString* value = params.GetStringReferenceArray( + info.name, info.length); + for (uint32_t i = 0; i < info.length; ++i) { + if (!val.empty()) { + val += ", "; + } else { + val += "["; + } + val += TfStringPrintf("<%s>", (*(value+i)).CStr()); + } + val += "]"; + } else if (info.detail == RtDetailType::k_reference) { + RtUString value; + if (params.GetStringReference(info.name, value)) { + val = TfStringPrintf("<%s>", value.CStr()); + } + } else if (info.array) { + const RtUString* value = params.GetStringArray( + info.name, info.length); + for (uint32_t i = 0; i < info.length; ++i) { + if (!val.empty()) { + val += ", "; + } else { + val += "("; + } + val += TfStringPrintf("%s", (*(value+i)).CStr()); + } + val += ")"; + } else { + RtUString value; + if (params.GetString(info.name, value)) { + val = TfStringPrintf("%s", value.CStr()); + } + } + break; + } + case RtDataType::k_bxdf: { + if (info.array && info.detail == RtDetailType::k_reference) { + const RtUString* value = params.GetBxdfReferenceArray( + info.name, info.length); + for (uint32_t i = 0; i < info.length; ++i) { + if (!val.empty()) { + val += ", "; + } else { + val += "["; + } + val += TfStringPrintf("<%s>", (*(value+i)).CStr()); + } + val += "]"; + } else if (info.detail == RtDetailType::k_reference) { + RtUString value; + if (params.GetBxdfReference(info.name, value)) { + val = TfStringPrintf("<%s>", value.CStr()); + } + } + break; + } + case RtDataType::k_lightfilter: { + if (info.array && info.detail == RtDetailType::k_reference) { + const RtUString* value = params.GetLightFilterReferenceArray( + info.name, info.length); + for (uint32_t i = 0; i < info.length; ++i) { + if (!val.empty()) { + val += ", "; + } else { + val += "["; + } + val += TfStringPrintf("<%s>", (*(value+i)).CStr()); + } + val += "]"; + } else if (info.detail == RtDetailType::k_reference) { + RtUString value; + if (params.GetLightFilterReference(info.name, value)) { + val = TfStringPrintf("<%s>", value.CStr()); + } + } + break; + } + case RtDataType::k_samplefilter: { + if (info.array && info.detail == RtDetailType::k_reference) { + const RtUString* value = params.GetSampleFilterReferenceArray( + info.name, info.length); + for (uint32_t i = 0; i < info.length; ++i) { + if (!val.empty()) { + val += ", "; + } else { + val += "["; + } + val += TfStringPrintf("<%s>", (*(value+i)).CStr()); + } + val += "]"; + } else if (info.detail == RtDetailType::k_reference) { + RtUString value; + if (params.GetSampleFilterReference(info.name, value)) { + val = TfStringPrintf("<%s>", value.CStr()); + } + } + break; + } + case RtDataType::k_displayfilter: { + if (info.array && info.detail == RtDetailType::k_reference) { + const RtUString* value = params.GetDisplayFilterReferenceArray( + info.name, info.length); + for (uint32_t i = 0; i < info.length; ++i) { + if (!val.empty()) { + val += ", "; + } else { + val += "["; + } + val += TfStringPrintf("<%s>", (*(value+i)).CStr()); + } + val += "]"; + } else if (info.detail == RtDetailType::k_reference) { + RtUString value; + if (params.GetDisplayFilterReference(info.name, value)) { + val = TfStringPrintf("<%s>", value.CStr()); + } + } + break; + } + case RtDataType::k_struct: + { + if (info.detail == RtDetailType::k_reference) { + RtUString value; + if (params.GetStructReference(info.name, value)) { + val = TfStringPrintf("<%s>", value.CStr()); + } + } + break; + } + } + return prefix + val; +} + +std::string +RtParamListToString(const RtParamList& params, const int indent) +{ + unsigned numParams = params.GetNumParams(); + if (numParams == 0) { + return ""; + } + + std::string out; + RtParamList::ParamInfo info; + for (unsigned pi = 0; pi < numParams; ++pi) { + if (params.GetParamInfo(pi, info)) { + if (!out.empty()) { + out += "\n"; + } + out += TfStringPrintf( + "%*s%s", (pi == 0 ? 0 : indent), "", + _FormatParam(info, params, indent).c_str()); + } + } + return out; +} + +std::string +GetCallerAsString(const TfCallContext& ctx) +{ + const std::string locator = TfStringPrintf("%s:%lu", + ctx.GetFile(), ctx.GetLine()); + const std::vector& lines = ArchGetStackTrace(10); + size_t i = 0; + while (i < 9 && lines[i].find(locator) == lines[i].npos) { + i++; + } + if (i < 9) { + const std::string& line = lines[i+1]; + return line.substr(28, line.find_first_of("(") - 28) + " at " + + line.substr(line.find_last_of("/") + 1); + } + return "*** couldn't find caller ***"; +} + +std::string +SdfPathVecToString(const std::vector& vec) +{ + std::string out; + for (const SdfPath& path : vec) { + if (!out.empty()) { + out += ", "; + } + out += TfStringPrintf("<%s>", path.GetText()); + } + return out; +} + +} +PXR_NAMESPACE_CLOSE_SCOPE diff --git a/third_party/renderman-26/plugin/hdPrman/debugUtil.h b/third_party/renderman-26/plugin/hdPrman/debugUtil.h new file mode 100644 index 0000000000..0411ff2169 --- /dev/null +++ b/third_party/renderman-26/plugin/hdPrman/debugUtil.h @@ -0,0 +1,65 @@ +// +// Copyright 2023 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// +#ifndef EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_DEBUG_UTIL_H +#define EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_DEBUG_UTIL_H + +#include "pxr/pxr.h" + +#include "pxr/base/gf/matrix4d.h" + +#include "RiTypesHelper.h" + +#include +#include + +PXR_NAMESPACE_OPEN_SCOPE + +class SdfPath; +class TfCallContext; + +namespace HdPrmanDebugUtil { + +std::string +MatrixToString( + const GfMatrix4d& mat, + const int indent = 0, + const int precision = 0); + +std::string +MatrixToString( + const RtMatrix4x4& mat, + const int indent = 0, + const int precision = 0); + +std::string +RtParamListToString(const RtParamList& params, const int indent = 0); + +std::string +GetCallerAsString(const TfCallContext& ctx); + +template +std::string +RileyIdVecToString(const std::vector& vec) +{ + std::string out; + for (const T& val : vec) { + if (!out.empty()) { + out += ", "; + } + out += std::to_string(val.AsUInt32()); + } + return out; +} + +std::string +SdfPathVecToString(const std::vector& vec); + +} + +PXR_NAMESPACE_CLOSE_SCOPE + +#endif // EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_DEBUG_UTIL_H diff --git a/third_party/renderman-26/plugin/hdPrman/dependencyForwardingSceneIndexPlugin.cpp b/third_party/renderman-26/plugin/hdPrman/dependencyForwardingSceneIndexPlugin.cpp new file mode 100644 index 0000000000..dd3433f1f7 --- /dev/null +++ b/third_party/renderman-26/plugin/hdPrman/dependencyForwardingSceneIndexPlugin.cpp @@ -0,0 +1,50 @@ +// +// Copyright 2022 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. + +#include "hdPrman/dependencyForwardingSceneIndexPlugin.h" + +#include "pxr/imaging/hd/dependencyForwardingSceneIndex.h" +#include "pxr/imaging/hd/sceneIndexPluginRegistry.h" + +PXR_NAMESPACE_OPEN_SCOPE + +TF_DEFINE_PRIVATE_TOKENS( + _tokens, + ((sceneIndexPluginName, "HdPrman_DependencyForwardingSceneIndexPlugin")) +); + +static const char * const _pluginDisplayName = "Prman"; + +TF_REGISTRY_FUNCTION(TfType) +{ + HdSceneIndexPluginRegistry::Define< + HdPrman_DependencyForwardingSceneIndexPlugin>(); +} + +TF_REGISTRY_FUNCTION(HdSceneIndexPlugin) +{ + const HdSceneIndexPluginRegistry::InsertionPhase insertionPhase = 1000; + + HdSceneIndexPluginRegistry::GetInstance().RegisterSceneIndexForRenderer( + _pluginDisplayName, + _tokens->sceneIndexPluginName, + nullptr, + insertionPhase, + HdSceneIndexPluginRegistry::InsertionOrderAtEnd); +} + +HdPrman_DependencyForwardingSceneIndexPlugin:: +HdPrman_DependencyForwardingSceneIndexPlugin() = default; + +HdSceneIndexBaseRefPtr +HdPrman_DependencyForwardingSceneIndexPlugin::_AppendSceneIndex( + const HdSceneIndexBaseRefPtr &inputScene, + const HdContainerDataSourceHandle &inputArgs) +{ + return HdDependencyForwardingSceneIndex::New(inputScene); +} + +PXR_NAMESPACE_CLOSE_SCOPE diff --git a/third_party/renderman-26/plugin/hdPrman/dependencyForwardingSceneIndexPlugin.h b/third_party/renderman-26/plugin/hdPrman/dependencyForwardingSceneIndexPlugin.h new file mode 100644 index 0000000000..22efb671f7 --- /dev/null +++ b/third_party/renderman-26/plugin/hdPrman/dependencyForwardingSceneIndexPlugin.h @@ -0,0 +1,34 @@ +// +// Copyright 2022 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. + +#ifndef PXR_IMAGING_HDPRMAN_DEPENDENCY_FORWARDING_SCENE_INDEX_PLUGIN_H +#define PXR_IMAGING_HDPRMAN_DEPENDENCY_FORWARDING_SCENE_INDEX_PLUGIN_H + +#include "pxr/pxr.h" +#include "pxr/imaging/hd/sceneIndexPlugin.h" +#include "hdPrman/api.h" + +PXR_NAMESPACE_OPEN_SCOPE + +/// \class HdPrman_DependencyForwardingSceneIndexPlugin +/// +/// Plugin adds a dependency forwarding scene index to the Prman render +/// delegate to resolve any dependencies introduced by other scene indices. +/// +class HdPrman_DependencyForwardingSceneIndexPlugin : public HdSceneIndexPlugin +{ +public: + HdPrman_DependencyForwardingSceneIndexPlugin(); + +protected: + HdSceneIndexBaseRefPtr _AppendSceneIndex( + const HdSceneIndexBaseRefPtr &inputScene, + const HdContainerDataSourceHandle &inputArgs) override; +}; + +PXR_NAMESPACE_CLOSE_SCOPE + +#endif // PXR_IMAGING_HDPRMAN_DEPENDENCY_FORWARDING_SCENE_INDEX_PLUGIN_H diff --git a/third_party/renderman-26/plugin/hdPrman/displayFilter.cpp b/third_party/renderman-26/plugin/hdPrman/displayFilter.cpp new file mode 100644 index 0000000000..28e7f54279 --- /dev/null +++ b/third_party/renderman-26/plugin/hdPrman/displayFilter.cpp @@ -0,0 +1,135 @@ +// +// Copyright 2022 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// +#include "hdPrman/displayFilter.h" + +#include "hdPrman/renderDelegate.h" +#include "hdPrman/renderParam.h" +#include "hdPrman/utils.h" + +#include "pxr/usd/sdr/shaderProperty.h" +#include "pxr/usd/sdr/registry.h" + +#include "Riley.h" + +PXR_NAMESPACE_OPEN_SCOPE + +TF_DEFINE_PRIVATE_TOKENS( + _tokens, + (resource) +); + +TF_MAKE_STATIC_DATA(NdrTokenVec, _sourceTypes) { + *_sourceTypes = { TfToken("OSL"), + TfToken("RmanCpp"), }; } + +HdPrman_DisplayFilter::HdPrman_DisplayFilter( + SdfPath const& id) + : HdSprim(id) +{ +} + +void +HdPrman_DisplayFilter::Finalize(HdRenderParam *renderParam) +{ +} + +void +HdPrman_DisplayFilter::_CreateRmanDisplayFilter( + HdSceneDelegate *sceneDelegate, + HdPrman_RenderParam *renderParam, + SdfPath const& filterPrimPath, + HdMaterialNode2 const& displayFilterNode) +{ + // Create Display Filter Riley Node + riley::ShadingNode rileyNode; + rileyNode.type = riley::ShadingNode::Type::k_DisplayFilter; + rileyNode.handle = RtUString(filterPrimPath.GetText()); + + // Get the Display Filter ShaderPath from the ShaderRegister + SdrRegistry &sdrRegistry = SdrRegistry::GetInstance(); + SdrShaderNodeConstPtr sdrEntry = sdrRegistry.GetShaderNodeByIdentifier( + displayFilterNode.nodeTypeId, *_sourceTypes); + if (!sdrEntry) { + TF_WARN("Unknown shader ID '%s' for node <%s>\n", + displayFilterNode.nodeTypeId.GetText(), filterPrimPath.GetText()); + return; + } + std::string shaderPath = sdrEntry->GetResolvedImplementationURI(); + if (shaderPath.empty()) { + TF_WARN("Shader '%s' did not provide a valid implementation path.", + sdrEntry->GetName().c_str()); + return; + } + rileyNode.name = RtUString(shaderPath.c_str()); + + // Initialize the Display Filter parameters + for (const auto ¶m : displayFilterNode.parameters) { + const SdrShaderProperty* prop = sdrEntry->GetShaderInput(param.first); + if (!prop) { + TF_WARN("Unknown shaderProperty '%s' for the '%s' " + "shader at '%s', ignoring.\n", + param.first.GetText(), + displayFilterNode.nodeTypeId.GetText(), + filterPrimPath.GetText()); + continue; + } + HdPrman_Utils::SetParamFromVtValue( + RtUString(prop->GetImplementationName().c_str()), + param.second, prop->GetType(), &rileyNode.params); + } + renderParam->AddDisplayFilter(sceneDelegate, filterPrimPath, rileyNode); + return; +} + +void +HdPrman_DisplayFilter::Sync( + HdSceneDelegate *sceneDelegate, + HdRenderParam *renderParam, + HdDirtyBits *dirtyBits) +{ + const SdfPath &id = GetId(); + HdPrman_RenderParam *param = static_cast(renderParam); + + if (*dirtyBits & HdChangeTracker::DirtyParams) { + // Only Create the DisplayFilter if connected to the RenderSettings + // Note that this works because the RenderSettings, being a Bprim, + // always gets synced before the DisplayFilter Sprim. + const SdfPathVector& connectedFilters = + param->GetConnectedDisplayFilterPaths(); + if (std::find(connectedFilters.begin(), connectedFilters.end(), id) + != connectedFilters.end()) { + const VtValue displayFilterResourceValue = + sceneDelegate->Get(id, _tokens->resource); + + if (displayFilterResourceValue.IsHolding()) { + HdMaterialNode2 displayFilterNode = + displayFilterResourceValue.UncheckedGet(); + _CreateRmanDisplayFilter( + sceneDelegate, param, id, displayFilterNode); + } + } + } + // the _CreateRmanDisplayFilter() call above regenerates the filter network, + // so if DirtyParams was set there's nothing left to do for DirtyVisibility. + else if (*dirtyBits & HdChangeTracker::DirtyVisibility) { + param->CreateDisplayFilterNetwork(sceneDelegate); + } + + *dirtyBits = HdChangeTracker::Clean; +} + + +HdDirtyBits HdPrman_DisplayFilter::GetInitialDirtyBitsMask() const +{ + int mask = + HdChangeTracker::Clean | + HdChangeTracker::DirtyParams | + HdChangeTracker::DirtyVisibility; + return (HdDirtyBits)mask; +} + +PXR_NAMESPACE_CLOSE_SCOPE diff --git a/third_party/renderman-26/plugin/hdPrman/displayFilter.h b/third_party/renderman-26/plugin/hdPrman/displayFilter.h new file mode 100644 index 0000000000..0a6f111ddb --- /dev/null +++ b/third_party/renderman-26/plugin/hdPrman/displayFilter.h @@ -0,0 +1,44 @@ +// +// Copyright 2022 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// +#ifndef EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_DISPLAY_FILTER_H +#define EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_DISPLAY_FILTER_H + +#include "pxr/pxr.h" +#include "pxr/imaging/hd/sprim.h" +#include "pxr/imaging/hd/material.h" + +#include "Riley.h" + +PXR_NAMESPACE_OPEN_SCOPE + +class HdPrman_RenderParam; + +class HdPrman_DisplayFilter : public HdSprim +{ +public: + HdPrman_DisplayFilter(SdfPath const& id); + + void Sync(HdSceneDelegate *sceneDelegate, + HdRenderParam *renderParam, + HdDirtyBits *dirtyBits) override; + + void Finalize(HdRenderParam *renderParam) override; + + HdDirtyBits GetInitialDirtyBitsMask() const override; + +private: + void _CreateRmanDisplayFilter(HdSceneDelegate *sceneDelegate, + HdPrman_RenderParam *renderParam, + SdfPath const& filterPrimPath, + HdMaterialNode2 const& displayFilterNode); + +}; + + +PXR_NAMESPACE_CLOSE_SCOPE + +#endif // EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_DISPLAY_FILTER_H diff --git a/third_party/renderman-26/plugin/hdPrman/extComputationPrimvarPruningSceneIndexPlugin.cpp b/third_party/renderman-26/plugin/hdPrman/extComputationPrimvarPruningSceneIndexPlugin.cpp new file mode 100644 index 0000000000..42e0759070 --- /dev/null +++ b/third_party/renderman-26/plugin/hdPrman/extComputationPrimvarPruningSceneIndexPlugin.cpp @@ -0,0 +1,74 @@ +// +// Copyright 2022 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// +#include "hdPrman/extComputationPrimvarPruningSceneIndexPlugin.h" + +#include "hdPrman/tokens.h" + +#include "pxr/imaging/hd/sceneIndexPluginRegistry.h" + +#include "pxr/pxr.h" +#if PXR_VERSION >= 2402 +#include "pxr/imaging/hdsi/extComputationPrimvarPruningSceneIndex.h" +#endif + +PXR_NAMESPACE_OPEN_SCOPE + +TF_DEFINE_PRIVATE_TOKENS( + _tokens, + ((sceneIndexPluginName, "HdPrman_ExtComputationPrimvarPruningSceneIndexPlugin")) +); + +//////////////////////////////////////////////////////////////////////////////// +// Plugin registrations +//////////////////////////////////////////////////////////////////////////////// + +TF_REGISTRY_FUNCTION(TfType) +{ + HdSceneIndexPluginRegistry::Define< + HdPrman_ExtComputationPrimvarPruningSceneIndexPlugin>(); +} + +TF_REGISTRY_FUNCTION(HdSceneIndexPlugin) +{ + // Needs to be inserted earlier to allow plugins that follow to transform + // primvar data without having to concern themselves about computed + // primvars. + const HdSceneIndexPluginRegistry::InsertionPhase insertionPhase = 0; + + // Register the plugins conditionally. + for(const auto& rendererDisplayName : HdPrman_GetPluginDisplayNames()) { + // Register the plugins conditionally. + HdSceneIndexPluginRegistry::GetInstance().RegisterSceneIndexForRenderer( + rendererDisplayName, + _tokens->sceneIndexPluginName, + nullptr, // no argument data necessary + insertionPhase, + HdSceneIndexPluginRegistry::InsertionOrderAtStart); + } +} + +//////////////////////////////////////////////////////////////////////////////// +// Scene Index Implementations +//////////////////////////////////////////////////////////////////////////////// + +HdPrman_ExtComputationPrimvarPruningSceneIndexPlugin:: +HdPrman_ExtComputationPrimvarPruningSceneIndexPlugin() = default; + +HdSceneIndexBaseRefPtr +HdPrman_ExtComputationPrimvarPruningSceneIndexPlugin::_AppendSceneIndex( + const HdSceneIndexBaseRefPtr &inputScene, + const HdContainerDataSourceHandle &inputArgs) +{ + TF_UNUSED(inputArgs); +#if PXR_VERSION >= 2402 + return HdSiExtComputationPrimvarPruningSceneIndex::New(inputScene); +#else + return inputScene; +#endif +} + +PXR_NAMESPACE_CLOSE_SCOPE diff --git a/third_party/renderman-26/plugin/hdPrman/extComputationPrimvarPruningSceneIndexPlugin.h b/third_party/renderman-26/plugin/hdPrman/extComputationPrimvarPruningSceneIndexPlugin.h new file mode 100644 index 0000000000..686ac5e6c9 --- /dev/null +++ b/third_party/renderman-26/plugin/hdPrman/extComputationPrimvarPruningSceneIndexPlugin.h @@ -0,0 +1,35 @@ +// +// Copyright 2022 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// +#ifndef EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_EXT_COMPUTATION_PRIMVAR_PRUNING_SCENE_INDEX_PLUGIN_H +#define EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_EXT_COMPUTATION_PRIMVAR_PRUNING_SCENE_INDEX_PLUGIN_H + +#include "pxr/pxr.h" +#include "pxr/imaging/hd/sceneIndexPlugin.h" +#include "hdPrman/api.h" + +PXR_NAMESPACE_OPEN_SCOPE + +/// \class HdPrman_ExtComputationPrimvarPruningSceneIndexPlugin +/// +/// Prman scene index plugin that filters out computed primvars and presents +/// them as authored primvars. +/// +class HdPrman_ExtComputationPrimvarPruningSceneIndexPlugin : + public HdSceneIndexPlugin +{ +public: + HdPrman_ExtComputationPrimvarPruningSceneIndexPlugin(); + +protected: + HdSceneIndexBaseRefPtr _AppendSceneIndex( + const HdSceneIndexBaseRefPtr &inputScene, + const HdContainerDataSourceHandle &inputArgs) override; +}; + +PXR_NAMESPACE_CLOSE_SCOPE + +#endif //EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_EXT_COMPUTATION_PRIMVAR_PRUNING_SCENE_INDEX_PLUGIN_H diff --git a/third_party/renderman-26/plugin/hdPrman/framebuffer.cpp b/third_party/renderman-26/plugin/hdPrman/framebuffer.cpp new file mode 100644 index 0000000000..8454743785 --- /dev/null +++ b/third_party/renderman-26/plugin/hdPrman/framebuffer.cpp @@ -0,0 +1,981 @@ +// +// Copyright 2019 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// + +#include "framebuffer.h" +#include "pxr/imaging/hd/tokens.h" +#include "pxr/base/tf/diagnostic.h" +#include "pxr/base/tf/staticData.h" +#include "pxr/base/tf/tf.h" +#include "pxr/base/work/loops.h" +#include "RixDspy.h" +#include "hdPrman/rixStrings.h" +#include "display/display.h" +#include "display/renderoutput.h" +#include +#include + + +PXR_NAMESPACE_OPEN_SCOPE + +// Note: RixDspy is a singleton API so it's safe to use a static variable +// We need to use the virtual API because we don't link to libprman +static RixDspy* s_dspy = nullptr; + +//////////////////////////////////////////////////////////////////////// +// PRMan Display Driver API entrypoints +//////////////////////////////////otify////////////////////////////////////// + +static PtDspyError HydraDspyImageOpen( + PtDspyImageHandle* handle_p, + const char* drivername, + const char* filename, + int width, int height, + int paramCount, + const UserParameter* parameters, + int formatCount, + PtDspyDevFormat* format, + PtFlagStuff* flagstuff) +{ + TF_UNUSED(drivername); + TF_UNUSED(filename); + if ((0 == width)||(0 == height)||(0 == formatCount)) { + return PkDspyErrorBadParams; + } + + // Request all pixels as F32. Requesting ID as integer seems to break + // things? But if it's "integer" in the display channel setup, interpreting + // it as integer seems to work. + for (int formatIndex = 0; formatIndex < formatCount; ++formatIndex) { + format[formatIndex].type = PkDspyFloat32; + } + flagstuff->flags |= PkDspyFlagsWantsEmptyBuckets; + + // Find the buffer. + int bufferID = 0; + s_dspy->FindIntInParamList("bufferID", &bufferID, paramCount, parameters); + HdPrmanFramebuffer *buf = HdPrmanFramebuffer::GetByID(bufferID); + if (!buf) { + return PkDspyErrorBadParams; + } + std::lock_guard lock(buf->mutex); + int count = 2; + int origin[2]; + int originalSize[2]; + originalSize[0] = 0; + originalSize[1] = 0; + + s_dspy->FindIntsInParamList("origin", &count, + origin, paramCount, parameters); + s_dspy->FindIntsInParamList("OriginalSize", &count, + originalSize, paramCount, parameters); + buf->Resize(originalSize[0], originalSize[1], + origin[0], origin[1], + width, height); + + *handle_p = buf; + return PkDspyErrorNone; +} + +static PtDspyError HydraDspyImageActiveRegion( + PtDspyImageHandle handle, + int xmin, + int xmax_plus_one, + int ymin, + int ymax_plus_one +) +{ + HdPrmanFramebuffer* buf = reinterpret_cast(handle); + // weirdly, no longer need offset once an edit (and this callback) happens + buf->cropOrigin[0] = 0; + buf->cropOrigin[1] = 0; + return PkDspyErrorNone; +} + +// Transform NDC space (-1, 1) depth to window space (0, 1). +static float _ConvertAovDepth(const GfMatrix4d &m, const float depth) { + if (std::isfinite(depth)) { + return GfClamp( + (m.Transform(GfVec3f(0, 0, -depth))[2] * 0.5) + 0.5, 0, 1); + } else { + return 0.f; + } +} + +static PtDspyError HydraDspyImageData( + PtDspyImageHandle handle, + int xmin, + int xmax_plusone, + int ymin, + int ymax_plusone, + int entrysize, + const unsigned char* data) +{ + // XXX: This assumes the AOV list matches what was declared to riley + // in hdPrman/renderParam.cpp CreateDisplays + int nComponents = entrysize / sizeof(float); + + HdPrmanFramebuffer* buf = reinterpret_cast(handle); + + if (buf->w == 0 || buf->h == 0) { + return PkDspyErrorBadParams; + } + + if (buf->pendingClear) { + buf->pendingClear = false; + buf->Clear(); + } + + int xmin_plusorigin = xmin + buf->cropOrigin[0]; + int xmax_plusorigin = xmax_plusone + buf->cropOrigin[0]; + int ymin_plusorigin = ymin + buf->cropOrigin[1]; + int ymax_plusorigin = ymax_plusone + buf->cropOrigin[1]; + + // Looping over aov buffers first (rather than data) reduces + // branching and gives more consistant memory access. + int dataOffset = 0; + HdPrmanFramebuffer::AovBuffer* primAovBuffer = nullptr; + for (HdPrmanFramebuffer::AovBuffer& aovBuffer : buf->aovBuffers) { + const HdPrmanFramebuffer::AovDesc& aovDesc = aovBuffer.desc; + const int cc = HdGetComponentCount(aovDesc.format); + + if (aovDesc.format == HdFormatInt32) { + int32_t* data_i32 = (int32_t*)data + dataOffset; + + if (aovDesc.name == HdAovTokens->primId) { + primAovBuffer = &aovBuffer; + + for (int y = ymin_plusorigin; y < ymax_plusorigin; y++) { + // Flip y-axis + int offset = (buf->h - 1 - y) * buf->w + xmin_plusorigin; + int32_t* aovData = reinterpret_cast( + &aovBuffer.pixels[offset * cc]); + for (int x = xmin_plusorigin; x < xmax_plusorigin; x++) { + *aovData = (*data_i32 - 1); + aovData++; + data_i32 += nComponents; + } + } + } + + else if ( + (aovDesc.name == HdAovTokens->instanceId + || aovDesc.name == HdAovTokens->elementId) + && primAovBuffer) { + // There is a dependency on primId being declared before + // instance/element Id. + for (int y = ymin_plusorigin; y < ymax_plusorigin; y++) { + // Flip y-axis + int offset = (buf->h - 1 - y) * buf->w + xmin_plusorigin; + int32_t* primIdAovData = reinterpret_cast( + &primAovBuffer->pixels[offset * cc]); + int32_t* aovData = reinterpret_cast( + &aovBuffer.pixels[offset * cc]); + for (int x = xmin_plusorigin; x < xmax_plusorigin; x++) { + *aovData = (*primIdAovData == -1) ? -1 : *data_i32; + primIdAovData++; + aovData++; + data_i32 += nComponents; + } + } + } + + else { + for (int y = ymin_plusorigin; y < ymax_plusorigin; y++) { + // Flip y-axis + int offset = (buf->h - 1 - y) * buf->w + xmin_plusorigin; + int32_t* aovData = reinterpret_cast( + &aovBuffer.pixels[offset * cc]); + for (int x = xmin_plusorigin; x < xmax_plusorigin; x++) { + *aovData = *data_i32; + aovData++; + data_i32 += nComponents; + } + } + } + } + else { + float* data_f32 = (float*)data + dataOffset; + + if (aovDesc.name == HdAovTokens->depth) { + for (int y = ymin_plusorigin; y < ymax_plusorigin; y++) { + // Flip y-axis + int offset = (buf->h - 1 - y) * buf->w + xmin_plusorigin; + float* aovData = reinterpret_cast( + &aovBuffer.pixels[offset * cc]); + for (int x = xmin_plusorigin; x < xmax_plusorigin; x++) { + *aovData = _ConvertAovDepth( + buf->proj, *data_f32); + aovData += cc; + data_f32 += nComponents; + } + } + } + + else if (cc == 4) { + for (int y = ymin_plusorigin; y < ymax_plusorigin; y++) { + // Flip y-axis + int offset = (buf->h - 1 - y) * buf->w + xmin_plusorigin; + float* aovData = reinterpret_cast( + &aovBuffer.pixels[offset * cc]); + for (int x = xmin_plusorigin; x < xmax_plusorigin; x++) { + // Premultiply color with alpha to blend pixels with + // background. + const float alphaInv = 1.f - data_f32[3]; + GfVec4f const& clear + = aovDesc.clearValue.Get(); + for (int i = 0; i < 3; i++) // RGB + aovData[i] = data_f32[i] + (alphaInv)*clear[i]; + aovData[3] = data_f32[3]; // A + aovData += 4; + data_f32 += nComponents; + } + } + } + + else if (cc == 3) { + for (int y = ymin_plusorigin; y < ymax_plusorigin; y++) { + // Flip y-axis + int offset = (buf->h - 1 - y) * buf->w + xmin_plusorigin; + float* aovData = reinterpret_cast( + &aovBuffer.pixels[offset * cc]); + for (int x = xmin_plusorigin; x < xmax_plusorigin; x++) { + for (int i = 0; i < 3; i++) + aovData[i] = data_f32[i]; + aovData += 3; + data_f32 += nComponents; + } + } + } + + else if (cc == 1) { + for (int y = ymin_plusorigin; y < ymax_plusorigin; y++) { + // Flip y-axis + int offset = (buf->h - 1 - y) * buf->w + xmin_plusorigin; + float* aovData = reinterpret_cast( + &aovBuffer.pixels[offset * cc]); + for (int x = xmin_plusorigin; x < xmax_plusorigin; x++) { + *aovData = *data_f32; + aovData++; + data_f32 += nComponents; + } + } + } + } + + dataOffset += cc; + } + + buf->newData = true; + + return PkDspyErrorNone; +} + +static PtDspyError HydraDspyImageClose ( + PtDspyImageHandle handle) +{ + TF_UNUSED(handle); + return PkDspyErrorNone; +} + +static PtDspyError HydraDspyImageQuery ( + PtDspyImageHandle handle, + PtDspyQueryType querytype, + int datalen, + void* data) +{ + TF_UNUSED(handle); + if (!datalen || !data) { + return PkDspyErrorBadParams; + } + switch (querytype) { + case PkSizeQuery: + { + PtDspySizeInfo sizeInfo; + if (size_t(datalen) > sizeof(sizeInfo)) + datalen = sizeof(sizeInfo); + sizeInfo.width = 0; + sizeInfo.height = 0; + sizeInfo.aspectRatio = 1.0f; + memcpy(data, &sizeInfo, datalen); + return PkDspyErrorNone;; + } + case PkOverwriteQuery: + { + PtDspyOverwriteInfo overwriteInfo; + if (size_t(datalen) > sizeof(overwriteInfo)) + datalen = sizeof(overwriteInfo); + overwriteInfo.overwrite = 1; + // https://renderman.pixar.com/resources/RenderMan_20/dspyNote.html + // say this is not used + overwriteInfo.interactive = 1; + memcpy(data, &overwriteInfo, datalen); + return PkDspyErrorNone; + } + case PkRedrawQuery: + { + PtDspyRedrawInfo redrawInfo; + if (size_t(datalen) > sizeof(redrawInfo)) + datalen = sizeof(redrawInfo); + redrawInfo.redraw = 1; + memcpy(data, &redrawInfo, datalen); + return PkDspyErrorNone; + } + default: + return PkDspyErrorUnsupported; + } +} + +//////////////////////////////////////////////////////////////////////// +// hdPrman framebuffer utility +//////////////////////////////////////////////////////////////////////// + +struct _BufferRegistry +{ + // Map of ID's to buffers + using IDMap = std::map; + + std::mutex mutex; + IDMap buffers; + int32_t nextID = 0; +}; +static TfStaticData<_BufferRegistry> _bufferRegistry; + +HdPrmanFramebuffer::HdPrmanFramebuffer() + : w(0) + , h(0) + , cropOrigin{0,0} + , cropRes{0,0} + , pendingClear(true) + , newData(false) +{ + // Add this buffer to the registry, assigning an id. + _BufferRegistry& registry = *_bufferRegistry; + { + std::lock_guard lock(registry.mutex); + std::pair<_BufferRegistry::IDMap::iterator, bool> entry; + do { + id = registry.nextID++; + entry = registry.buffers.insert( std::make_pair(id, this) ); + } while(!entry.second); + } +} + +HdPrmanFramebuffer::~HdPrmanFramebuffer() +{ + _BufferRegistry& registry = *_bufferRegistry; + { + std::lock_guard lock(registry.mutex); + registry.buffers.erase(id); + registry.nextID = 0; + } +} + +HdPrmanFramebuffer* +HdPrmanFramebuffer::GetByID(int32_t id) +{ + _BufferRegistry& registry = *_bufferRegistry; + { + std::lock_guard lock(registry.mutex); + _BufferRegistry::IDMap::const_iterator i = registry.buffers.find(id); + if (i == registry.buffers.end()) { + TF_CODING_ERROR("HdPrmanFramebuffer: Unknown buffer ID %i\n", id); + return nullptr; + } + return i->second; + } +} + +void +HdPrmanFramebuffer::CreateAovBuffers(const AovDescVector &aovDescs) +{ + aovBuffers.clear(); + aovBuffers.reserve(aovDescs.size()); + + for (const AovDesc &aovDesc : aovDescs) { + aovBuffers.push_back({aovDesc, {}}); + } + + // Reset w and h so that pixels will be allocated on the next resize + w = 0; + h = 0; +} + +void +HdPrmanFramebuffer::Resize(int width, int height, + int cropXMin, int cropYMin, + int cropWidth, int cropHeight) +{ + if (w != width || h != height || + cropOrigin[0] != cropXMin || cropOrigin[1] != cropYMin || + cropRes[0] != cropWidth || cropRes[1] != cropHeight) { + w = width; + h = height; + cropRes[0] = cropWidth; + cropRes[1] = cropHeight; + cropOrigin[0] = cropXMin; + cropOrigin[1] = cropYMin; + pendingClear = true; + newData = true; + + for(HdPrmanFramebuffer::AovBuffer &aovBuffer : aovBuffers) { + const int cc = HdGetComponentCount(aovBuffer.desc.format); + aovBuffer.pixels.resize(w*h*cc); + } + } +} + +void +HdPrmanFramebuffer::Clear() +{ + const int size = w * h; + + for(AovBuffer &aovBuffer : aovBuffers) { + const AovDesc &aovDesc = aovBuffer.desc; + if(aovDesc.format == HdFormatInt32) + { + const int32_t clear = aovDesc.clearValue.Get(); + int32_t * const data = reinterpret_cast( + aovBuffer.pixels.data()); + for(int i = 0; i < size; i++ ) + { + data[i] = clear; + } + } + else + { + float * const data = reinterpret_cast(aovBuffer.pixels.data()); + const int cc = HdGetComponentCount(aovDesc.format); + if(cc == 1) + { + const float clear = aovDesc.clearValue.Get(); + for(int i=0; i < size; i++) + { + data[i] = clear; + } + } + else if(cc == 3) + { + GfVec3f const& clear = aovDesc.clearValue.Get(); + for(int i=0; i < size; i++) + { + data[i*cc+0] = clear[0]; + data[i*cc+1] = clear[1]; + data[i*cc+2] = clear[2]; + } + } + else if(cc == 4) + { + GfVec4f const& clear = aovDesc.clearValue.Get(); + for(int i=0; i < size; i++) + { + data[i*cc+0] = clear[0]; + data[i*cc+1] = clear[1]; + data[i*cc+2] = clear[2]; + data[i*cc+3] = clear[3]; + } + } + } + } +} + +void +HdPrmanFramebuffer::Register(RixContext* ctx) +{ + assert(ctx); + s_dspy = (RixDspy*)ctx->GetRixInterface(k_RixDspy); + assert(s_dspy); + PtDspyDriverFunctionTable dt; + dt.Version = k_PtDriverCurrentVersion; + dt.pOpen = HydraDspyImageOpen; + dt.pWrite = HydraDspyImageData; + dt.pClose = HydraDspyImageClose; + dt.pQuery = HydraDspyImageQuery; + dt.pActiveRegion = HydraDspyImageActiveRegion; + dt.pMetadata = nullptr; + if (s_dspy->RegisterDriverTable("hydra", &dt)) + { + TF_CODING_ERROR("HdPrmanFramebuffer: Failed to register\n"); + } +} + +HdPrmanFramebuffer::HdPrmanAccumulationRule HdPrmanFramebuffer::ToAccumulationRule(RtUString name) +{ + if (name == RtUString("average")) + { + return k_accumulationRuleAverage; + } + else if (name == RtUString("min")) + { + return k_accumulationRuleMin; + } + else if (name == RtUString("max")) + { + return k_accumulationRuleMax; + } + else if (name == RtUString("zmin")) + { + return k_accumulationRuleZmin; + } + else if (name == RtUString("zmax")) + { + return k_accumulationRuleZmax; + } + else if (name == RtUString("sum")) + { + return k_accumulationRuleSum; + } + else + { + return k_accumulationRuleFilter; + } +} + +/////////////////////////////////////////////////////////////////////////////// +// XPU Display Driver API entrypoints +/////////////////////////////////////////////////////////////////////////////// + +constexpr size_t k_invalidOffset = size_t(-1); + +namespace { + +class DisplayHydra final : public display::Display +{ +public: + DisplayHydra(const RtUString /*name*/, const pxrcore::ParamList& params) : + m_width(0), + m_height(0), + m_surface(nullptr), + m_alphaOffset(k_invalidOffset), +#if !defined(DISPLAY_INTERFACE_VERSION) || DISPLAY_INTERFACE_VERSION < 2 + m_weightsOffset(k_invalidOffset), +#endif + m_buf(nullptr) + { + int bufferID = 0; + params.GetInteger(RtUString("bufferID"), bufferID); + m_buf = HdPrmanFramebuffer::GetByID(bufferID); + } + + ~DisplayHydra() override = default; + + // Display interface + bool Rebind(const uint32_t width, const uint32_t height, const char* /*srfaddrhandle*/, +#if !defined(DISPLAY_INTERFACE_VERSION) || DISPLAY_INTERFACE_VERSION < 2 + const void* srfaddr, const size_t /*srfsizebytes*/, const size_t weightsoffset, + const size_t* srfoffsets, const display::RenderOutput* outputs, +#else + const void* srfaddr, const size_t /*srfsizebytes*/, const size_t* srfoffsets, + const size_t* /*sampleoffsets*/, const display::RenderOutput* outputs, +#endif + const size_t noutputs) override + { + m_surface = static_cast(srfaddr); + m_width = width; + m_height = height; + +#if !defined(DISPLAY_INTERFACE_VERSION) || DISPLAY_INTERFACE_VERSION < 2 + m_weightsOffset = weightsoffset; +#endif + m_offsets.clear(); + m_offsets.reserve(noutputs); + for (size_t i = 0; i < noutputs; i++) + { + m_offsets.push_back(srfoffsets[i]); + if(outputs[i].name == RixStr.k_a) + { + m_alphaOffset = srfoffsets[i]; + } + } + + m_buf->Resize(width, height); + return true; + } + + void Close() override + { + } + + void Notify(const uint32_t /*iteration*/, + const uint32_t /*totaliterations*/, + const Display::NotifyFlags flags, + const pxrcore::ParamList& /*metadata*/) override + { + // We're only interested in displaying iterations. + // renderComplete indicates the last valid set of + // pixels and needs to be included + // Clear isn't interesting at all. + if (flags != k_notifyIteration && flags != k_notifyRender) + { + return; + } + // Copy planar data into buffer + std::lock_guard lock(m_buf->mutex); + + m_buf->newData = true; + + if (m_buf->pendingClear) { + m_buf->pendingClear = false; + m_buf->Clear(); + } + + int offsetIdx = 0; + int primIdIdx = -1; + for(size_t hydraAovIdx = 0; + hydraAovIdx < m_buf->aovBuffers.size(); + hydraAovIdx++, offsetIdx++) { + + HdPrmanFramebuffer::AovBuffer &aovBuffer = + m_buf->aovBuffers[hydraAovIdx]; + const HdPrmanFramebuffer::AovDesc &aovDesc = + aovBuffer.desc; + +#if !defined(DISPLAY_INTERFACE_VERSION) || DISPLAY_INTERFACE_VERSION < 2 + const float* const srcWeights = m_weightsOffset != k_invalidOffset ? + reinterpret_cast(m_surface+m_weightsOffset) : nullptr; +#endif + const bool shouldNormalize = aovDesc.ShouldNormalizeBySampleCount(); + const int cc = HdGetComponentCount(aovDesc.format); + const size_t srcOffset = m_offsets[offsetIdx]; + if (aovDesc.format == HdFormatInt32) { + const int32_t* srcInt = + reinterpret_cast( + m_surface + srcOffset); + + // This code manipulates primId, elementId, and + // instanceId values to match similar code in the RIS + // version of the dspy driver, further up in this file. + // The intention is to subtract one from the primId aov + // (which maps to 'id' in prman), + // and then when the value is -1, also set the values of + // elementId and instanceId to -1 + // (those are faceindex and id2 in prman). + // The primId, elementId, and instanceId names are used + // by flow and usdview, and those apps expect the prman + // id values to have been manipulated in this way. + // NB: There's an assumption here that the primId + // aov is processed before elementId and instanceId aovs + if (aovDesc.name == HdAovTokens->primId) { + primIdIdx = hydraAovIdx; + + WorkParallelForN(m_height, + [this, &srcInt, &aovBuffer] + (size_t begin, size_t end) { + + const int32_t* src = srcInt + begin * m_width; + for (size_t y=begin; y(aovBuffer.pixels.data()) + + ((m_buf->h-1-y)*m_width); + + for (uint32_t x = 0; x < m_width; x++) { + *aovData = (*src) - 1; + src++; + aovData++; + } + } + }); + + srcInt += m_width * m_height; + } + else if (aovDesc.name == HdAovTokens->instanceId || + aovDesc.name == HdAovTokens->elementId) { + WorkParallelForN(m_height, + [this, &srcInt, &aovBuffer, &primIdIdx] + (size_t begin, size_t end) { + + + const int32_t* src = srcInt + begin * m_width; + for (size_t y=begin; y( + aovBuffer.pixels.data()) + + ((m_buf->h-1-y)*m_width); + + int32_t* primIdData = + reinterpret_cast( + m_buf->aovBuffers[primIdIdx].pixels.data()) + + ((m_buf->h-1-y)*m_buf->w); + + for (uint32_t x = 0; x < m_width; x++) + { + if(*primIdData == -1) { + *aovData = -1; + } + else { + *aovData = *src; + } + src++; + aovData++; + primIdData++; + } + } + }); + + srcInt += m_width * m_height; + } + else { + WorkParallelForN(m_height, + [this, &srcInt, &aovBuffer] + (size_t begin, size_t end) { + + const int32_t* src = srcInt + begin * m_width; + for (size_t y=begin; y( + aovBuffer.pixels.data()) + + ((m_buf->h-1-y)*m_width); + memcpy(aovData, src, sizeof(int32_t) * m_width); + src += m_width; + } + }); + } + + srcInt += m_width * m_height; + } + + else { + if(aovDesc.name == HdAovTokens->depth) { + + WorkParallelForN(m_height, + [this, &aovBuffer, &srcOffset] + (size_t begin, size_t end) { + + const float* srcScalar = + reinterpret_cast( + m_surface + srcOffset) + + begin * m_width; + + for (size_t y=begin; y( + aovBuffer.pixels.data()) + + ((m_buf->h-1-y)*m_buf->w); + + for (uint32_t x = 0; x < m_width; x++) + { + float value = *srcScalar; + value = _ConvertAovDepth(m_buf->proj, value); + *aovData = value; + + aovData++; + srcScalar++; + } + } + }); + } + else if( cc == 4 ) { + WorkParallelForN(m_height, +#if !defined(DISPLAY_INTERFACE_VERSION) || DISPLAY_INTERFACE_VERSION < 2 + [this, &aovBuffer, &srcWeights, &srcOffset, shouldNormalize] +#else + [this, &aovBuffer, &srcOffset, shouldNormalize] +#endif + (size_t begin, size_t end) { + +#if !defined(DISPLAY_INTERFACE_VERSION) || DISPLAY_INTERFACE_VERSION < 2 + const float* weights = srcWeights ? + srcWeights + begin * m_width : nullptr; +#endif + const float* srcColorR = + reinterpret_cast( + m_surface + srcOffset) + + begin * m_width; + const float* srcColorA = + reinterpret_cast( + m_surface + m_alphaOffset) + + begin * m_width; + + const GfVec4f clear = + aovBuffer.desc.clearValue.Get(); + + for (size_t y=begin; y( + aovBuffer.pixels.data()) + + ((m_buf->h-1-y)*m_buf->w)*4; + + for (uint32_t x = 0; x < m_width; x++) { + float isc = 1.f; +#if !defined(DISPLAY_INTERFACE_VERSION) || DISPLAY_INTERFACE_VERSION < 2 + if(weights && shouldNormalize && *weights > 0.f) + isc = 1.f / *weights; +#endif + const float* const srcColorG = + srcColorR + (m_height * m_width); + const float* const srcColorB = + srcColorG + (m_height * m_width); + + // Premultiply color with alpha + // to blend pixels with background. + const float alphaInv = 1-(*srcColorA * isc); + aovData[0] = *srcColorR * isc + + (alphaInv) * clear[0]; // R + aovData[1] = *srcColorG * isc + + (alphaInv) * clear[1]; // G + aovData[2] = *srcColorB * isc + + (alphaInv) * clear[2]; // B + aovData[3] = *srcColorA * isc; // A + + aovData += 4; + srcColorR++; + srcColorA++; +#if !defined(DISPLAY_INTERFACE_VERSION) || DISPLAY_INTERFACE_VERSION < 2 + if (weights) weights++; +#endif + } + } + }); + + // When component count is 4 (rgba) in the hydra aov, + // xpu's aovs will have a rgb aov followed by an alpha, + // so need to do an extra increment to skip past the alpha + offsetIdx++; + } + else if (cc == 1) { + WorkParallelForN(m_height, +#if !defined(DISPLAY_INTERFACE_VERSION) || DISPLAY_INTERFACE_VERSION < 2 + [this, &aovBuffer, &srcWeights, &srcOffset, shouldNormalize] +#else + [this, &aovBuffer, &srcOffset, shouldNormalize] +#endif + (size_t begin, size_t end) { + +#if !defined(DISPLAY_INTERFACE_VERSION) || DISPLAY_INTERFACE_VERSION < 2 + const float* weights = srcWeights ? + srcWeights + begin * m_width : nullptr; +#endif + const float* srcColorR = + reinterpret_cast( + m_surface + srcOffset) + + begin * m_width; + for (size_t y=begin; y( + aovBuffer.pixels.data()) + + ((m_buf->h-1-y)*m_buf->w); + + for (uint32_t x = 0; x < m_width; x++) + { + float isc = 1.f; +#if !defined(DISPLAY_INTERFACE_VERSION) || DISPLAY_INTERFACE_VERSION < 2 + if(weights && shouldNormalize && *weights > 0.f) + isc = 1.f / *weights; +#endif + + *aovData = *srcColorR * isc; + + aovData++; + srcColorR++; +#if !defined(DISPLAY_INTERFACE_VERSION) || DISPLAY_INTERFACE_VERSION < 2 + if (weights) weights++; +#endif + } + } + }); + } + else { + assert(cc == 3); + WorkParallelForN(m_height, +#if !defined(DISPLAY_INTERFACE_VERSION) || DISPLAY_INTERFACE_VERSION < 2 + [this, &aovBuffer, &srcWeights, &srcOffset, shouldNormalize] +#else + [this, &aovBuffer, &srcOffset, shouldNormalize] +#endif + (size_t begin, size_t end) { + +#if !defined(DISPLAY_INTERFACE_VERSION) || DISPLAY_INTERFACE_VERSION < 2 + const float* weights = srcWeights ? + srcWeights + begin * m_width : nullptr; +#endif + const float* srcColorR = + reinterpret_cast( + m_surface + srcOffset) + + begin * m_width; + + for (size_t y=begin; y(aovBuffer.pixels.data()) + + ((m_buf->h-1-y)*m_buf->w)*3; + + for (uint32_t x = 0; x < m_width; x++) { + float isc = 1.f; +#if !defined(DISPLAY_INTERFACE_VERSION) || DISPLAY_INTERFACE_VERSION < 2 + if(weights && shouldNormalize && *weights > 0.f) + isc = 1.f / *weights; +#endif + + const float* const srcColorG = + srcColorR + (m_height * m_width); + const float* const srcColorB = + srcColorG + (m_height * m_width); + + aovData[0] = *srcColorR * isc; + aovData[1] = *srcColorG * isc; + aovData[2] = *srcColorB * isc; + + aovData += 3; + srcColorR++; +#if !defined(DISPLAY_INTERFACE_VERSION) || DISPLAY_INTERFACE_VERSION < 2 + if (weights) weights++; +#endif + } + } + }); + } + } + } + } + +#if DISPLAY_INTERFACE_VERSION >= 2 + uint64_t GetRequirements() const override + { + return display::Display::k_reqFrameBuffer; + } +#endif +private: + uint32_t m_width; + uint32_t m_height; + const uint8_t* m_surface; + size_t m_alphaOffset; + std::vector m_offsets; +#if !defined(DISPLAY_INTERFACE_VERSION) || DISPLAY_INTERFACE_VERSION < 2 + size_t m_weightsOffset; +#endif + + HdPrmanFramebuffer* m_buf; +}; + +} + +// Export the current version of the Display API, necessary for binary compatibility with the +// renderer +#if DISPLAY_INTERFACE_VERSION >= 1 +DISPLAYEXPORTVERSION +#endif + +extern "C" DISPLAYEXPORT +display::Display* CreateDisplay(const pxrcore::UString& name, + const pxrcore::ParamList& params, + const pxrcore::ParamList& /* metadata */) +{ + return new DisplayHydra(name, params); +} + +extern "C" DISPLAYEXPORT +void DestroyDisplay(const display::Display* p) +{ + delete p; +} + +PXR_NAMESPACE_CLOSE_SCOPE + diff --git a/third_party/renderman-26/plugin/hdPrman/framebuffer.h b/third_party/renderman-26/plugin/hdPrman/framebuffer.h new file mode 100644 index 0000000000..4b85d9970c --- /dev/null +++ b/third_party/renderman-26/plugin/hdPrman/framebuffer.h @@ -0,0 +1,107 @@ +// +// Copyright 2019 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// +#ifndef EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_FRAMEBUFFER_H +#define EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_FRAMEBUFFER_H + +#include "pxr/pxr.h" +#include "pxr/imaging/hd/types.h" + +#include "pxr/base/gf/matrix4d.h" + +#include "Riley.h" + +#include +#include + +class RixContext; + +PXR_NAMESPACE_OPEN_SCOPE + +/// A simple framebuffer used to receive display-driver output from PRMan. +/// This lives in a separate small library so it can be accessible to +/// both the hdPrman hydra plgin at the d_hydra display driver plugin, +/// without requiring either to know about the other. +class HdPrmanFramebuffer +{ +public: + enum HdPrmanAccumulationRule { + k_accumulationRuleFilter, + k_accumulationRuleAverage, + k_accumulationRuleMin, + k_accumulationRuleMax, + k_accumulationRuleZmin, + k_accumulationRuleZmax, + k_accumulationRuleSum + }; + + struct AovDesc + { + TfToken name; + HdFormat format; + VtValue clearValue; + HdPrmanAccumulationRule rule; + + bool ShouldNormalizeBySampleCount() const + { + return format != HdFormatInt32 && rule != k_accumulationRuleMin && + rule != k_accumulationRuleMax && rule != k_accumulationRuleZmin && + rule != k_accumulationRuleZmax; + } + }; + + struct AovBuffer + { + AovDesc desc; + std::vector pixels; + }; + + using AovDescVector = std::vector; + using AovBufferVector = std::vector; + + HdPrmanFramebuffer(); + ~HdPrmanFramebuffer(); + + /// Find a buffer instance with the given ID. + /// The expectation is that the buffer will exist, so + /// this raises a runtime error if the ID is not found. + static HdPrmanFramebuffer* GetByID(int32_t id); + static void Register(RixContext*); + + /// Convert the accumulation rule string to the HdPrmanAccumulationRule enum + static HdPrmanAccumulationRule ToAccumulationRule(RtUString name); + + /// (Re-)Creates Aov buffers without allocating pixel storage + /// (allocated through Resize). + void CreateAovBuffers(const AovDescVector &aovDescs); + + /// Resize the buffer. + void Resize(int width, int height, + int cropXMin=0, int cropYMin=0, + int cropWidth=0, int cropHeight=0); + + void Clear(); + + std::mutex mutex; + AovBufferVector aovBuffers; + + int w, h; + int cropOrigin[2]; + int cropRes[2]; + int32_t id; + + // Projection matrix (for the depth output). + GfMatrix4d proj; + + // Clear functionality. + bool pendingClear; + + std::atomic newData; +}; + +PXR_NAMESPACE_CLOSE_SCOPE + +#endif // EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_FRAMEBUFFER_H diff --git a/third_party/renderman-26/plugin/hdPrman/gprim.cpp b/third_party/renderman-26/plugin/hdPrman/gprim.cpp new file mode 100644 index 0000000000..8909822cec --- /dev/null +++ b/third_party/renderman-26/plugin/hdPrman/gprim.cpp @@ -0,0 +1,7 @@ +// +// Copyright 2019 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// +#include "hdPrman/gprim.h" diff --git a/third_party/renderman-26/plugin/hdPrman/gprim.h b/third_party/renderman-26/plugin/hdPrman/gprim.h new file mode 100644 index 0000000000..dded31efc0 --- /dev/null +++ b/third_party/renderman-26/plugin/hdPrman/gprim.h @@ -0,0 +1,471 @@ +// +// Copyright 2019 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// +#ifndef EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_GPRIM_H +#define EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_GPRIM_H + +#include "pxr/pxr.h" +#include "pxr/usd/sdf/types.h" +#include "pxr/base/gf/matrix4d.h" + +#include "hdPrman/gprimbase.h" +#include "hdPrman/renderParam.h" +#include "hdPrman/instancer.h" +#include "hdPrman/material.h" +#include "hdPrman/rixStrings.h" +#include "hdPrman/utils.h" + +#include "Riley.h" + +PXR_NAMESPACE_OPEN_SCOPE + +/// A mix-in template that adds shared gprim behavior to support +/// various HdRprim types. +template +class HdPrman_Gprim : public BASE, public HdPrman_GprimBase +{ +public: + using BaseType = BASE; + + HdPrman_Gprim(SdfPath const& id) + : BaseType(id) + { + } + + ~HdPrman_Gprim() override = default; + + void + Finalize(HdRenderParam *renderParam) override + { + HdPrman_RenderParam *param = + static_cast(renderParam); + const SdfPath& id = BASE::GetId(); + riley::Riley *riley = param->AcquireRiley(); + + // Release retained conversions of coordSys bindings. + param->ReleaseCoordSysBindings(id); + + // Delete instances before deleting the prototypes they use. + for (const auto &instId: _instanceIds) { + if (instId != riley::GeometryInstanceId::InvalidId()) { + riley->DeleteGeometryInstance( + riley::GeometryPrototypeId::InvalidId(), instId); + } + } + _instanceIds.clear(); + + // delete instances owned by the instancer. + if (HdPrmanInstancer* instancer = param->GetInstancer( + BASE::GetInstancerId())) { + instancer->Depopulate(renderParam, id); + } + + for (const auto &protoId: _prototypeIds) { + if (protoId != riley::GeometryPrototypeId::InvalidId()) { + riley->DeleteGeometryPrototype(protoId); + } + } + _prototypeIds.clear(); + } + + void Sync(HdSceneDelegate* sceneDelegate, + HdRenderParam* renderParam, + HdDirtyBits* dirtyBits, + TfToken const &reprToken) override; + +protected: + HdDirtyBits GetInitialDirtyBitsMask() const override = 0; + + HdDirtyBits + _PropagateDirtyBits(HdDirtyBits bits) const override + { + // By default, just return the same dirty bits we recieved. + return bits; + } + + void + _InitRepr(TfToken const &reprToken, + HdDirtyBits *dirtyBits) override + { + TF_UNUSED(reprToken); + TF_UNUSED(dirtyBits); + // No-op + } + + // We override this member function in mesh.cpp to support the creation + // of mesh light prototype geometry. + virtual bool + _PrototypeOnly() + { + return false; + } + + // Provide a fallback material. Default grabs _fallbackMaterial + // from the context. + virtual riley::MaterialId + _GetFallbackMaterial(HdPrman_RenderParam *renderParam) + { + return renderParam->GetFallbackMaterialId(); + } + + // Populate primType and primvars. + virtual RtPrimVarList + _ConvertGeometry(HdPrman_RenderParam *renderParam, + HdSceneDelegate *sceneDelegate, + const SdfPath &id, + RtUString *primType, + std::vector *geomSubsets) = 0; + + // This class does not support copying. + HdPrman_Gprim(const HdPrman_Gprim&) = delete; + HdPrman_Gprim &operator =(const HdPrman_Gprim&) = delete; + +}; + +template +void +HdPrman_Gprim::Sync(HdSceneDelegate* sceneDelegate, + HdRenderParam* renderParam, + HdDirtyBits* dirtyBits, + TfToken const &reprToken) +{ + HD_TRACE_FUNCTION(); + HF_MALLOC_TAG_FUNCTION(); + TF_UNUSED(reprToken); + + // Check if there are any relevant dirtyBits. + // (See the HdChangeTracker::MarkRprimDirty() note regarding + // internalDirtyBits used for internal signaling in Hydra.) + static const HdDirtyBits internalDirtyBits = + HdChangeTracker::InitRepr | + HdChangeTracker::Varying | + HdChangeTracker::NewRepr | + HdChangeTracker::CustomBitsMask; + // HdPrman does not make use of the repr concept or customBits. + *dirtyBits &= ~(HdChangeTracker::NewRepr | HdChangeTracker::CustomBitsMask); + // If no relevant dirtyBits remain, return early to avoid acquiring write + // access to Riley, which requires a pause and restart of rendering. + if (((*dirtyBits & ~internalDirtyBits) + & HdChangeTracker::AllSceneDirtyBits) == 0) { + return; + } + + HdPrman_RenderParam *param = + static_cast(renderParam); + + // Riley API. + riley::Riley *riley = param->AcquireRiley(); + + // Update instance bindings. + BASE::_UpdateInstancer(sceneDelegate, dirtyBits); + + // Prim id + SdfPath const& id = BASE::GetId(); + SdfPath const& instancerId = BASE::GetInstancerId(); + const bool isHdInstance = !instancerId.IsEmpty(); + SdfPath primPath = sceneDelegate->GetScenePrimPath(id, 0, nullptr); + + // Prman has a default value for identifier:id of 0 (in case of ray miss), + // while Hydra treats id -1 as the clear value. We map Prman primId as + // (Hydra primId + 1) to get around this, here and in + // hdPrman/framebuffer.cpp. + const int32_t primId = BASE::GetPrimId() + 1; + + // Sample transform + HdTimeSampleArray xf; + sceneDelegate->SampleTransform(id, &xf); + + // Update visibility so thet rprim->IsVisible() will work in render pass + if (HdChangeTracker::IsVisibilityDirty(*dirtyBits, id)) { + BASE::_UpdateVisibility(sceneDelegate, dirtyBits); + } + + // Resolve material binding. Default to fallbackGprimMaterial. + if (*dirtyBits & HdChangeTracker::DirtyMaterialId) { +#if HD_API_VERSION < 37 + BASE::_SetMaterialId(sceneDelegate->GetRenderIndex().GetChangeTracker(), + sceneDelegate->GetMaterialId(id)); +#else + BASE::SetMaterialId(sceneDelegate->GetMaterialId(id)); +#endif + } + riley::MaterialId materialId = _GetFallbackMaterial(param); + riley::DisplacementId dispId = riley::DisplacementId::InvalidId(); + const SdfPath & hdMaterialId = BASE::GetMaterialId(); + HdPrman_ResolveMaterial(sceneDelegate, hdMaterialId, riley, &materialId, &dispId); + + // Convert (and cache) coordinate systems. + riley::CoordinateSystemList coordSysList = {0, nullptr}; + if (HdPrman_RenderParam::RileyCoordSysIdVecRefPtr convertedCoordSys = + param->ConvertAndRetainCoordSysBindings(sceneDelegate, id)) { + coordSysList.count = convertedCoordSys->size(); + coordSysList.ids = convertedCoordSys->data(); + } + + // Hydra dirty bits corresponding to PRMan prototype attributes (also called + // "primitive variables" but not synonymous with USD primvars). See prman + // docs at https://rmanwiki.pixar.com/display/REN24/Primitive+Variables. + static const HdDirtyBits prmanProtoAttrBits = + HdChangeTracker::DirtyPoints | + HdChangeTracker::DirtyNormals | + HdChangeTracker::DirtyWidths | + HdChangeTracker::DirtyTopology; + + // Hydra dirty bits corresponding to prman instance attributes. See prman + // docs at https://rmanwiki.pixar.com/display/REN24/Instance+Attributes. + static const HdDirtyBits prmanInstAttrBits = + HdChangeTracker::DirtyMaterialId | + HdChangeTracker::DirtyTransform | + HdChangeTracker::DirtyVisibility | + HdChangeTracker::DirtyDoubleSided | + HdChangeTracker::DirtySubdivTags | + HdChangeTracker::DirtyVolumeField | + HdChangeTracker::DirtyCategories | + HdChangeTracker::DirtyPrimvar; + + // + // Create or modify Riley geometry prototype(s). + // + std::vector subsetMaterialIds; + std::vector subsetPaths; + { + RtUString primType; + HdGeomSubsets geomSubsets; + RtPrimVarList primvars = _ConvertGeometry(param, sceneDelegate, id, + &primType, &geomSubsets); + + // Transfer material opinions of primvars. + HdPrman_TransferMaterialPrimvarOpinions(sceneDelegate, hdMaterialId, + primvars); + + // Adjust _prototypeIds array. + const size_t oldCount = _prototypeIds.size(); + const size_t newCount = std::max((size_t) 1, geomSubsets.size()); + if (newCount != oldCount) { + for (const auto &oldPrototypeId: _prototypeIds) { + if (oldPrototypeId != riley::GeometryPrototypeId::InvalidId()) { + riley->DeleteGeometryPrototype(oldPrototypeId); + } + } + _prototypeIds.resize(newCount, + riley::GeometryPrototypeId::InvalidId()); + } + + // Update Riley geom prototypes. + if (geomSubsets.empty()) { + // Common case: no subsets. + TF_VERIFY(newCount == 1); + TF_VERIFY(_prototypeIds.size() == 1); + primvars.SetString(RixStr.k_stats_prototypeIdentifier, + RtUString(primPath.GetText())); + if (_prototypeIds[0] == riley::GeometryPrototypeId::InvalidId()) { + TRACE_SCOPE("riley::CreateGeometryPrototype"); + _prototypeIds[0] = riley->CreateGeometryPrototype( + riley::UserId( + stats::AddDataLocation(primPath.GetText()).GetValue()), + primType, dispId, primvars); + } else if (*dirtyBits & prmanProtoAttrBits) { + TRACE_SCOPE("riley::ModifyGeometryPrototype"); + riley->ModifyGeometryPrototype(primType, _prototypeIds[0], + &dispId, &primvars); + } + } else { + // Subsets case. + // We resolve materials here, and hold them in subsetMaterialIds: + // Displacement networks are passed to the geom prototype; + // material networks are passed to the instances. + subsetMaterialIds.reserve(geomSubsets.size()); + + // We also cache the subset paths for re-use when creating the instances + subsetPaths.reserve(geomSubsets.size()); + + for (size_t j=0; j < geomSubsets.size(); ++j) { + auto& prototypeId = _prototypeIds[j]; + HdGeomSubset &subset = geomSubsets[j]; + + // Convert indices to int32_t and set as k_shade_faceset. + std::vector int32Indices(subset.indices.cbegin(), + subset.indices.cend()); + primvars.SetIntegerArray(RixStr.k_shade_faceset, + int32Indices.data(), + int32Indices.size()); + // Look up material override for the subset (if any) + riley::MaterialId subsetMaterialId = materialId; + riley::DisplacementId subsetDispId = dispId; + if (subset.materialId.IsEmpty()) { + subset.materialId = hdMaterialId; + } + HdPrman_ResolveMaterial(sceneDelegate, subset.materialId, + riley, &subsetMaterialId, &subsetDispId); + subsetMaterialIds.push_back(subsetMaterialId); + + // Look up the path for the subset + SdfPath subsetPath = sceneDelegate->GetScenePrimPath(subset.id, 0, nullptr); + subsetPaths.push_back(subsetPath); + primvars.SetString(RixStr.k_stats_prototypeIdentifier, + RtUString(subsetPath.GetText())); + + if (prototypeId == riley::GeometryPrototypeId::InvalidId()) { + TRACE_SCOPE("riley::CreateGeometryPrototype"); + prototypeId = + riley->CreateGeometryPrototype( + riley::UserId( + stats::AddDataLocation(subsetPath.GetText()).GetValue()), + primType, dispId, primvars); + } else if (*dirtyBits & prmanProtoAttrBits) { + TRACE_SCOPE("riley::ModifyGeometryPrototype"); + riley->ModifyGeometryPrototype(primType, prototypeId, + &subsetDispId, &primvars); + } + } + } + *dirtyBits &= ~prmanProtoAttrBits; + } + + // + // Stop here, or also create geometry instances? + // + if (_PrototypeOnly()) { + *dirtyBits &= ~HdChangeTracker::AllSceneDirtyBits; + return; + } + + // + // Create or modify Riley geometry instances. + // + + // Resolve attributes. + RtParamList attrs = param->ConvertAttributes(sceneDelegate, id, true); + + // Add "identifier:id" with the prim id. + attrs.SetInteger(RixStr.k_identifier_id, primId); + + if (!isHdInstance) { + // Simple case: Singleton instance. + // Convert transform. + TfSmallVector xf_rt(xf.count); + for (size_t i=0; i < xf.count; ++i) { + xf_rt[i] = HdPrman_Utils::GfMatrixToRtMatrix(xf.values[i]); + } + const riley::Transform xform = { + unsigned(xf.count), + xf_rt.data(), + xf.times.data()}; + + // Add "identifier:id2" with the instance number. + // XXX Do we want to distinguish facesets here? + attrs.SetInteger(RixStr.k_identifier_id2, 0); + + // Adjust _instanceIds array. + const size_t oldCount = _instanceIds.size(); + const size_t newCount = _prototypeIds.size(); + if (newCount != oldCount) { + for (const auto &oldInstanceId: _instanceIds) { + if (oldInstanceId != riley::GeometryInstanceId::InvalidId()) { + riley->DeleteGeometryInstance( + riley::GeometryPrototypeId::InvalidId(), oldInstanceId); + } + } + _instanceIds.resize( + newCount, + riley::GeometryInstanceId::InvalidId()); + } + + // Create or modify Riley instances corresponding to a + // singleton Hydra instance. + TF_VERIFY(_instanceIds.size() == _prototypeIds.size()); + for (size_t j=0; j < _prototypeIds.size(); ++j) { + auto const& prototypeId = _prototypeIds[j]; + auto& instanceId = _instanceIds[j]; + auto instanceMaterialId = materialId; + RtParamList finalAttrs = attrs; // copy + + // If a subset path was cached, use it. If not, use the prim path. + SdfPath* subsetPath(&primPath); + if (!subsetPaths.empty()) { + subsetPath = &subsetPaths[j]; + } + + finalAttrs.SetString(RixStr.k_identifier_name, + RtUString(subsetPath->GetText())); + + // If a valid subset material was bound, use it. + if (!subsetMaterialIds.empty()) { + TF_VERIFY(j < subsetMaterialIds.size()); + instanceMaterialId = subsetMaterialIds[j]; + } + + // Very last thing: prepend renderTag to grouping:membership + param->AddRenderTagToGroupingMembership( + sceneDelegate->GetRenderTag(id), finalAttrs); + + if (instanceId == riley::GeometryInstanceId::InvalidId()) { + TRACE_SCOPE("riley::CreateGeometryInstance"); + instanceId = riley->CreateGeometryInstance( + riley::UserId( + stats::AddDataLocation(subsetPath->GetText()).GetValue()), + riley::GeometryPrototypeId::InvalidId(), prototypeId, + instanceMaterialId, coordSysList, xform, finalAttrs); + } else if (*dirtyBits & prmanInstAttrBits) { + TRACE_SCOPE("riley::ModifyGeometryInstance"); + riley->ModifyGeometryInstance( + riley::GeometryPrototypeId::InvalidId(), + instanceId, &instanceMaterialId, &coordSysList, &xform, + &finalAttrs); + } + } + *dirtyBits &= ~prmanInstAttrBits; + } else if ((*dirtyBits & prmanInstAttrBits) + || HdChangeTracker::IsInstancerDirty(*dirtyBits, instancerId)) { + // This gprim is a prototype of a hydra instancer. (It is not itself an + // instancer because it is a gprim.) The riley geometry prototypes have + // already been synced above, and those are owned by this gprim instance. + // We need to tell the hdprman instancer to sync its riley instances for + // these riley prototypes. + // + // We won't make any riley instances here. The hdprman instancer will + // own the riley instances instead. + // + // We only need to do this if dirtyBits says the instancer is dirty. + + HdRenderIndex &renderIndex = sceneDelegate->GetRenderIndex(); + + // first, sync the hydra instancer and its parents, from the bottom up. + // (note: this is transitional code, it should be done by the render index...) + HdInstancer::_SyncInstancerAndParents(renderIndex, instancerId); + + if (subsetMaterialIds.size() == 0) { + subsetMaterialIds.push_back(materialId); + } + if (subsetPaths.size() == 0) { + subsetPaths.push_back(primPath); + } + TF_VERIFY(_prototypeIds.size() == subsetMaterialIds.size() && + _prototypeIds.size() == subsetPaths.size(), + "size mismatch (%lu, %lu, %lu)\n", _prototypeIds.size(), + subsetMaterialIds.size(), subsetPaths.size()); + + // next, tell the hdprman instancer to sync the riley instances + HdPrmanInstancer *instancer = static_cast( + renderIndex.GetInstancer(instancerId)); + if (instancer) { + instancer->Populate( + renderParam, + dirtyBits, + id, + _prototypeIds, + coordSysList, + attrs, xf, + subsetMaterialIds, + subsetPaths); + } + } + *dirtyBits &= ~HdChangeTracker::AllSceneDirtyBits; +} + +PXR_NAMESPACE_CLOSE_SCOPE + +#endif // EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_GPRIM_H diff --git a/third_party/renderman-26/plugin/hdPrman/gprimbase.cpp b/third_party/renderman-26/plugin/hdPrman/gprimbase.cpp new file mode 100644 index 0000000000..3cc15c1acf --- /dev/null +++ b/third_party/renderman-26/plugin/hdPrman/gprimbase.cpp @@ -0,0 +1,22 @@ +// +// Copyright 2019 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// + +#include "hdPrman/gprimbase.h" + +PXR_NAMESPACE_OPEN_SCOPE + +HdPrman_GprimBase::~HdPrman_GprimBase() = default; + +std::vector +HdPrman_GprimBase::GetPrototypeIds() const +{ + const std::vector ret(_prototypeIds); + return ret; +} + + +PXR_NAMESPACE_CLOSE_SCOPE diff --git a/third_party/renderman-26/plugin/hdPrman/gprimbase.h b/third_party/renderman-26/plugin/hdPrman/gprimbase.h new file mode 100644 index 0000000000..9477bb8031 --- /dev/null +++ b/third_party/renderman-26/plugin/hdPrman/gprimbase.h @@ -0,0 +1,35 @@ +// +// Copyright 2019 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// +#ifndef EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_GPRIMBASE_H +#define EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_GPRIMBASE_H + +#include "pxr/pxr.h" + +#include +#include + +#include + +PXR_NAMESPACE_OPEN_SCOPE + +/// A common base class for HdPrman_Gprim types +class HdPrman_GprimBase +{ +public: + HdPrman_GprimBase() = default; + virtual ~HdPrman_GprimBase() = 0; + + std::vector GetPrototypeIds() const; + +protected: + std::vector _prototypeIds; + std::vector _instanceIds; +}; + +PXR_NAMESPACE_CLOSE_SCOPE + +#endif // EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_GPRIM_H diff --git a/third_party/renderman-26/plugin/hdPrman/hdPrmanGenParsers.py b/third_party/renderman-26/plugin/hdPrman/hdPrmanGenParsers.py new file mode 100644 index 0000000000..8d4730bdcb --- /dev/null +++ b/third_party/renderman-26/plugin/hdPrman/hdPrmanGenParsers.py @@ -0,0 +1,318 @@ +#!/usr/bin/env python +# +# Copyright 2019 Pixar +# +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. +# + +from __future__ import print_function + +from tempfile import mkdtemp +from argparse import ArgumentParser +from sys import exit, stdout +from os import listdir, mkdir, getcwd, chdir, rename, access, W_OK +from os.path import abspath, basename, join, splitext, isfile, dirname, exists +from subprocess import call +from shutil import rmtree, copyfile +from difflib import unified_diff + +# ----------------------------------------------------------------------------- +# Validation functions. +# This section contains code that will gather/report diffs between the generated +# code and the installed files as well as installing generating files which +# pass validation. +# ----------------------------------------------------------------------------- +def _compareFiles(installedFiles, generatedFiles, configuration): + failOnDiff = configuration[VALIDATE] + + if len(installedFiles) != len(generatedFiles): + installedNames = set(map(basename, installedFiles)) + generatedNames = set(map(basename, generatedFiles)) + + if (generatedNames - installedNames): + exit('*** Unknown files generated, please add them to the list of ' + 'base files names in hdPrmanGenParsers.py') + + exit('*** Missing files:\n' + '\n'.join(installedNames - generatedNames)) + + diffs = {} + for i in range(0, len(installedFiles)): + installedExists = isfile(installedFiles[i]) + generatedExists = isfile(generatedFiles[i]) + + if installedExists and not generatedExists: + diffs[basename(installedFile.name)] = "File not generated" + continue + + if not installedExists and generatedExists: + diffs[basename(installedFiles[i])] = "Installed file does not exist" + continue + + with open(installedFiles[i], 'r') as installedFile,\ + open(generatedFiles[i], 'r') as generatedFile: + + installedContent = installedFile.read() + generatedContent = generatedFile.read() + + if installedContent != generatedContent: + diff = '\n'.join(unified_diff(installedContent.split('\n'), + generatedContent.split('\n'), + 'Source ' + installedFile.name, + 'Generated ' + generatedFile.name)) + diffs[basename(installedFile.name)] = diff + + if diffs and failOnDiff: + exit('*** Differing Generated Files:\n' + '\n'.join(diffs.values())) + + return diffs + +def _copyGeneratedFiles(installedFiles, generatedFiles, diffs): + baseNames = [basename(installedFile) for installedFile in installedFiles] + for baseName, generatedFile, installedFile in zip(baseNames, + generatedFiles, + installedFiles): + if baseName in diffs: + print('Changed: ' + baseName) + print(diffs[baseName]) + if isfile(installedFile) and not access(installedFile, W_OK): + print('Cannot author ' + installedFile + ', (no write access).') + else: + copyfile(generatedFile, installedFile) + else: + print('Unchanged: ' + baseName) + +# ----------------------------------------------------------------------------- +# Code generation functions. +# This section contains the code that will actually generate the C++ source +# and headers from the yy/ll source files as well as the code which will +# curate the generated code. +# ----------------------------------------------------------------------------- +def _runBisonAndFlexCommands(configuration): + # build up collections of all relevant files, these include + # yy/ll source files, as well as the generated C++ header + # and source files. + srcDir = configuration[SRC_DIR] + destDir = configuration[DEST_DIR] + bases = configuration[BASES] + + bisonFiles = [join(srcDir, base + '.yy') for base in bases] + flexFiles = [join(srcDir, base + '.ll') for base in bases] + bisonGenSources = [join(destDir, base + '.tab.cpp') for base in bases] + bisonGenHeaders = [join(destDir, base + '.tab.hpp') for base in bases] + flexGenSources = [join(destDir, base + '.lex.cpp') for base in bases] + + sourceFiles = bisonFiles + flexFiles + generatedFiles = bisonGenHeaders + bisonGenSources + flexGenSources + + # generate all components of a flex/bison command, these + # include the desired executables, flag settings + bisonFlags = lambda base: ['-d', '-p', base + 'Yy', '-o'] + flexFlags = lambda base: ['-P'+ base + "Yy", '-t'] + + bisonExecutable = configuration[BISON_EXE] + flexExecutable = configuration[FLEX_EXE] + + bisonCommand = lambda index: ([bisonExecutable] + + bisonFlags(base) + + [bisonGenSources[index]] + + [bisonFiles[index]]) + + flexCommand = lambda index: ([flexExecutable] + + flexFlags(base) + + [flexFiles[index]]) + + for index, base in enumerate(bases): + print('Running bison on %s' % (base + '.yy')) + call(bisonCommand(index)) + + print('Running flex on %s' % (base + '.ll')) + with open(flexGenSources[index], 'w') as outputFile: + call(flexCommand(index), stdout=outputFile) + + # prepend license header to all generated files. + licenseText = '\n'.join([ + "//" + , "// Copyright 2019 Pixar" + , "//" + , "// Licensed under the Apache License, Version 2.0 (the \"Apache License\")" + , "// with the following modification; you may not use this file except in" + , "// compliance with the Apache License and the following modification to it:" + , "// Section 6. Trademarks. is deleted and replaced with:" + , "//" + , "// 6. Trademarks. This License does not grant permission to use the trade" + , "// names, trademarks, service marks, or product names of the Licensor" + , "// and its affiliates, except as required to comply with Section 4(c) of" + , "// the License and to reproduce the content of the NOTICE file." + , "//" + , "// You may obtain a copy of the Apache License at" + , "//" + , "// http://www.apache.org/licenses/LICENSE-2.0" + , "//" + , "// Unless required by applicable law or agreed to in writing, software" + , "// distributed under the Apache License with the above modification is" + , "// distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY" + , "// KIND, either express or implied. See the Apache License for the specific" + , "// language governing permissions and limitations under the Apache License." + , "//\n"]) + + for generatedFile in generatedFiles: + with open(generatedFile, 'r') as f: + lines = f.read() + with open(generatedFile, 'w') as f: + f.write(licenseText) + f.write(lines) + + return sourceFiles, generatedFiles + +def _canonicalizeFiles(sourceFiles, generatedFiles): + PXR_PREFIX_PATH = 'hdPrman' + + # by default, bison will output hpp header files, we don't want this + # as it goes against our convention of .h for headers. More recent + # versions of bison support this option directly. + # + # We also need to update the paths in the generated #line directives + # so we can easily diff the generated and installed files. + + # 'renamed' represents the renamed files on disk, whereas the identifiers + # are altered paths that will be used in #line directives in the source + renamed = list(generatedFiles) + identifiers = list(generatedFiles) + + # rename hpp files to h, also update our index of renamed files + # and identifiers(these will be used when scrubbing the files' contents) + for index, fileName in enumerate(generatedFiles): + if 'hpp' in fileName: + newName = fileName.replace('.hpp', '.h') + rename(fileName, newName) + renamed[index] = newName + identifiers[index] = newName + + # identifiers includes the sourceFiles(yy,ll files) because + # they are also referred to in line directives + identifiers += sourceFiles + for index, fileName in enumerate(list(renamed + sourceFiles)): + if '/' in fileName: + identifiers[index] = join(PXR_PREFIX_PATH, basename(fileName)) + + # create a list of pairs, representing the things to replace in our + # generated files + replacements = [] + for index, fileName in enumerate(list(generatedFiles+sourceFiles)): + oldFileName = fileName + newFileName = identifiers[index] + replacements.append((oldFileName, newFileName)) + + for renamedFile in renamed: + print('Canonicalizing ' + basename(renamedFile)) + + with open(renamedFile, 'r+') as inputFile: + data = inputFile.read() + + # find and replace all generated file names + print('... Fixing line directives') + for oldFileName, newFileName in replacements: + data = data.replace(oldFileName, newFileName) + + # flex versions older than 2.6 emit the register keyword + # which is no longer supported as of C++17. To support + # these versions, we manually strip 'register' from each + # .lex.cpp file. This is hacky, since it could affect + # hand-written parser code that uses the word "register". + # In practice, none of our parser code does this. + # + # XXX: Remove this when we stop supporting older flex versions + if renamedFile.endswith('.lex.cpp'): + print('... Removing register keyword') + data = data.replace("register ", "") + + # we seek to 0 and truncate as we intend + # to overwrite the existing data in the file + inputFile.seek(0) + inputFile.write(data) + inputFile.truncate() + + return renamed + +# ----------------------------------------------------------------------------- +# Configuration info. +# This section of code discerns all the necessary info the run the parser +# and lexical analyzer generators over the source files. +# ----------------------------------------------------------------------------- +def _parseArguments(): + parser = ArgumentParser(description='Generate Ascii File Parsers for HdPrman') + parser.add_argument('--srcDir', required=False, default=getcwd(), + help='The source directory.') + parser.add_argument('--bison', required=True, + help='The location of the bison executable to be used.') + parser.add_argument('--flex', required=True, + help='The location of the flex executable to be used.') + parser.add_argument('--validate', action='store_true', + help='Verify that the source files are unchanged.') + parser.add_argument('--bases', nargs='+', + help='Base file identifiers used for generation.') + return parser.parse_args() + +# Configuration constants +DEST_DIR = 0 +SRC_DIR = 1 +VALIDATE = 2 +BASES = 3 +BISON_EXE = 4 +FLEX_EXE = 5 + +def _getConfiguration(): + arguments = _parseArguments() + + config = { VALIDATE : arguments.validate, + SRC_DIR : arguments.srcDir, + DEST_DIR : mkdtemp(), + BISON_EXE : arguments.bison, + FLEX_EXE : arguments.flex, + BASES : arguments.bases } + + # Ensure all optional arguments get properly populated + if not arguments.bases: + allFiles = listdir(arguments.srcDir) + validExts = ['.yy', '.ll'] + relevantFiles = [f for f in allFiles if splitext(f)[1] in validExts] + bases = list(set(map(lambda f: splitext(f)[0], relevantFiles))) + + if not bases: + exit('*** Unable to find source files for parser. Ensure that they ' + 'are in the source directory(--srcDir). If unspecified, the ' + 'source directory is assumed to be the current directory.') + + config[BASES] = bases + + return config + +# ----------------------------------------------------------------------------- + +def _printSection(sectionInfo): + print('+-------------------------------------------------+') + print(sectionInfo) + print('+-------------------------------------------------+') + +if __name__ == '__main__': + configuration = _getConfiguration() + + _printSection('Running flex and bison on sources') + sourceFiles, generatedFiles = _runBisonAndFlexCommands(configuration) + + _printSection('Canonicalizing generated files') + generatedFiles = _canonicalizeFiles(sourceFiles, generatedFiles) + + diffSectionMsg = 'Checking for diffs' + if configuration[VALIDATE]: + diffSectionMsg = diffSectionMsg + '(validation on)' + + _printSection(diffSectionMsg) + installedFiles = [join(configuration[SRC_DIR], basename(f)) + for f in generatedFiles] + + diffs = _compareFiles(installedFiles, generatedFiles, configuration) + _copyGeneratedFiles(installedFiles, generatedFiles, diffs) + # If validation passed, clean up the generated files + rmtree(configuration[DEST_DIR]) diff --git a/third_party/renderman-26/plugin/hdPrman/hdSchemaDefs.py b/third_party/renderman-26/plugin/hdPrman/hdSchemaDefs.py new file mode 100644 index 0000000000..ff1efedfe4 --- /dev/null +++ b/third_party/renderman-26/plugin/hdPrman/hdSchemaDefs.py @@ -0,0 +1,499 @@ +# +# Copyright 2023 Pixar +# +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. +# +[ + dict( + SCHEMA_NAME = 'ALL_SCHEMAS', + LIBRARY_PATH = 'ext/rmanpkg/plugin/renderman/plugin/hdPrman', + INCLUDE_PATH = 'hdPrman', + VERSION_GUARD_CONST_GETTER = True + ), + + #-------------------------------------------------------------------------- + # hdPrman/rileyParam + dict( + SCHEMA_NAME = 'RileyParam', + MEMBERS = [ + ('value', T_SAMPLED, {}), + ('role', T_TOKEN, + dict(DOC = ''' + Disambiguates what call to RtParamList::SetFOO to use. + + Can take values from HdPrimvarRoleTokens and + HdPrmanRileyAdditionalRoleTokens.''')), + ], + ), + + #-------------------------------------------------------------------------- + # hdPrman/rileyParamList + dict( + DOC = ''' + Schema to describe RtParamList. + + To obtain an RtParamList from this schema, we call the appropriate + RtParamList::SetFOO(name, value) for each name in the container params. + + The schema {{LIBRARY_NAME}}RileyParamSchema determines what SetFOO + method is called with what value. To resolve what SetFOO method to use, + the type of the VtValue from the value data source is used as well as + the role token if necessary. The value is coming from the value data + source. + ''', + SCHEMA_NAME = 'RileyParamList', + SCHEMA_INCLUDES = ['hdPrman/rileySchemaTypeDefs'], + MEMBERS = [ + ('params', 'HdPrmanRileyParamContainerSchema', {}), + ], + ), + + #-------------------------------------------------------------------------- + # hdPrman/rileyPrimvar + dict( + SCHEMA_NAME = 'RileyPrimvar', + MEMBERS = [ + ('value', T_SAMPLED, {}), + ('detailType', T_TOKEN, {}), + ('role', T_TOKEN, + dict(DOC = ''' + Disambiguates what call to RtPrimvarList::SetFOO to use. + + Can take values from HdPrimvarRoleTokens and + HdPrmanRileyAdditionalRoleTokens.''')), + ], + + STATIC_TOKEN_DATASOURCE_BUILDERS = [ + ('detailType', ['constant', + 'uniform', + 'vertex', + 'varying', + 'facevarying', + 'reference']), + ], + ), + + #-------------------------------------------------------------------------- + # hdPrman/rileyPrimvarList + dict( + DOC = ''' + Schema to describe RtPrimvarList. + + To obtain an RtPrimvarList we pass numUniform, numVertex, + numVarying, numFaceVarying to the constructor, call + RtPrimvarList::SetTimes if "P" (for points) is among the params and has + samples and finally call the appropriate + RtPrimvarList::SetFOO[Detail]( + name, value[, detailType[, sampleTimeIndex]]). + + The {{LIBRARY_NAME}}RileyPrimvarSchema determines what SetFOO[Detail] + method is valled with what value, detailType or sampleTimeIndex. + + For many data types or when detailType is constant, the behavior is + the same as for the {{LIBRARY_NAME}}RileyParamSchema. + + Otherweise, we call SetFooDetail using {{LIBRARY_NAME}}RileyParamSchema + similar as we did for {{LIBRARY_NAME}}RileyParamSchema but consuming + the detailType data source as well. The value data source is only + sampled at time 0. + + The "P" param is treated specially. It is the only param for which take + time samples (from the sampled value data source) and always corresponds + to a call to RtPrimvarList::SetPointDetail with detailType = vertex. + ''', + SCHEMA_NAME = 'RileyPrimvarList', + SCHEMA_INCLUDES = ['hdPrman/rileySchemaTypeDefs'], + MEMBERS = [ + ('numUniform', T_SIZET, {}), + ('numVertex', T_SIZET, {}), + ('numVarying', T_SIZET, {}), + ('numFaceVarying', T_SIZET, {}), + ('params', 'HdPrmanRileyPrimvarContainerSchema', {}), + ], + + EXTRA_TOKENS = [ + 'P', + ], + ), + + #-------------------------------------------------------------------------- + # hdPrman/rileyShadingNode + dict( + SCHEMA_NAME = 'RileyShadingNode', + SCHEMA_INCLUDES = ['hdPrman/rileyParamListSchema'], + MEMBERS = [ + ('type', T_TOKEN, {}), + ('name', T_TOKEN, {}), + ('handle', T_TOKEN, {}), + ('params', 'HdPrmanRileyParamListSchema', {}), + ], + STATIC_TOKEN_DATASOURCE_BUILDERS = [ + ('type', ['pattern', + 'bxdf', + 'integrator', + 'light', + 'lightFilter', + 'projection', + 'displacement', + 'sampleFilter', + 'displayFilter']), + ], + ), + + #-------------------------------------------------------------------------- + # + # + # Schema's corresponding to riley globals. + # + # + # hdPrman/rileyGlobals + dict( + SCHEMA_NAME = 'RileyGlobals', + SCHEMA_TOKEN = 'rileyGlobals', + ADD_DEFAULT_LOCATOR = True, + SCHEMA_INCLUDES = ['hdPrman/rileyParamListSchema'], + + MEMBERS = [ + ('ALL_MEMBERS', '', dict(ADD_LOCATOR=True)), + ('options', 'HdPrmanRileyParamListSchema', {}) + ], + ), + + #-------------------------------------------------------------------------- + # + # + # Schema's corresponding to riley prims. + # + # + + #-------------------------------------------------------------------------- + # hdPrman/rileyCamera + dict( + SCHEMA_NAME = 'RileyCamera', + SCHEMA_TOKEN = 'rileyCamera', + ADD_DEFAULT_LOCATOR = True, + GENERATE_RILEY_PRIM = True, + SCHEMA_INCLUDES = ['hdPrman/rileyShadingNodeSchema', + 'hdPrman/rileyParamListSchema'], + MEMBERS = [ + ('ALL_MEMBERS', '', dict(ADD_LOCATOR=True)), + ('name', T_TOKEN, + dict(RILEY_CONVERTER='HdPrman_RileyUniqueString', + RILEY_NO_MODIFY=True)), + ('projection', 'HdPrmanRileyShadingNodeSchema', {}), + ('xform', T_MATRIX, {}), + ('properties', 'HdPrmanRileyParamListSchema', {}), + ], + EXTRA_TOKENS = [ + 'nearClip', + 'farClip', + 'focusregion', + 'dofaspect', + 'apertureNSides', + 'apertureAngle', + 'apertureRoundness', + 'apertureDensity', + 'shutterOpenTime', + 'shutterCloseTime', + 'shutteropening', + ], + ), + + #-------------------------------------------------------------------------- + # hdPrman/rileyClippingPlane + dict( + SCHEMA_NAME = 'RileyClippingPlane', + SCHEMA_TOKEN = 'rileyClippingPlane', + ADD_DEFAULT_LOCATOR = True, + GENERATE_RILEY_PRIM = True, + NO_RILEY_USER_ID = True, + SCHEMA_INCLUDES = ['hdPrman/rileyParamListSchema'], + MEMBERS = [ + ('ALL_MEMBERS', '', dict(ADD_LOCATOR=True)), + ('xform', T_MATRIX, {}), + ('params', 'HdPrmanRileyParamListSchema', {}), + ], + ), + + #-------------------------------------------------------------------------- + # hdPrman/rileyCoordinateSystem + dict( + SCHEMA_NAME = 'RileyCoordinateSystem', + SCHEMA_TOKEN = 'rileyCoordinateSystem', + ADD_DEFAULT_LOCATOR = True, + GENERATE_RILEY_PRIM = True, + ADD_RILEY_ID_LIST = True, + SCHEMA_INCLUDES = ['hdPrman/rileyParamListSchema'], + MEMBERS = [ + ('ALL_MEMBERS', '', dict(ADD_LOCATOR=True)), + ('xform', T_MATRIX, {}), + ('attributes', 'HdPrmanRileyParamListSchema', {}), + ], + ), + + #-------------------------------------------------------------------------- + # hdPrman/rileyDisplacement + dict( + SCHEMA_NAME = 'RileyDisplacement', + SCHEMA_TOKEN = 'rileyDisplacement', + ADD_DEFAULT_LOCATOR = True, + GENERATE_RILEY_PRIM = True, + SCHEMA_INCLUDES = ['hdPrman/rileySchemaTypeDefs', + 'hdPrman/rileyParamListSchema'], + MEMBERS = [ + ('ALL_MEMBERS', '', dict(ADD_LOCATOR=True)), + ('displacement', 'HdPrmanRileyShadingNodeVectorSchema', {}), + ('attributes', 'HdPrmanRileyParamListSchema', {}), + ], + ), + + #-------------------------------------------------------------------------- + # hdPrman/rileyDisplay + dict( + SCHEMA_NAME = 'RileyDisplay', + SCHEMA_TOKEN = 'rileyDisplay', + ADD_DEFAULT_LOCATOR = True, + GENERATE_RILEY_PRIM = True, + SCHEMA_INCLUDES = ['hdPrman/rileyParamListSchema'], + MEMBERS = [ + ('ALL_MEMBERS', '', dict(ADD_LOCATOR=True)), + ('renderTarget', T_PATH, + dict(RILEY_RELATIONSHIP_TARGET="RileyRenderTarget")), + ('name', T_TOKEN, {}), + ('driver', T_TOKEN, {}), + ('renderOutputs', T_PATHARRAY, + dict(RILEY_RELATIONSHIP_TARGET="RileyRenderOutput")), + ('driverParams', 'HdPrmanRileyParamListSchema', {}), + ], + ), + + + #-------------------------------------------------------------------------- + # hdPrman/rileyDisplayFilter + dict( + SCHEMA_NAME = 'RileyDisplayFilter', + SCHEMA_TOKEN = 'rileyDisplayFilter', + ADD_DEFAULT_LOCATOR = True, + GENERATE_RILEY_PRIM = True, + SCHEMA_INCLUDES = ['hdPrman/rileySchemaTypeDefs', + 'hdPrman/rileyParamListSchema'], + ADD_RILEY_ID_LIST = True, + MEMBERS = [ + ('ALL_MEMBERS', '', dict(ADD_LOCATOR=True)), + ('displayFilter', 'HdPrmanRileyShadingNodeVectorSchema', {}), + ('attributes', 'HdPrmanRileyParamListSchema', {}), + ], + ), + + #-------------------------------------------------------------------------- + # hdPrman/rileyGeometryInstance + dict( + SCHEMA_NAME = 'RileyGeometryInstance', + SCHEMA_TOKEN = 'RileyGeometryInstance', + ADD_DEFAULT_LOCATOR = True, + GENERATE_RILEY_PRIM = True, + SCHEMA_INCLUDES = ['hdPrman/rileyParamListSchema'], + MEMBERS = [ + ('ALL_MEMBERS', '', dict(ADD_LOCATOR=True)), + ('groupPrototype', T_PATH, + dict(RILEY_RELATIONSHIP_TARGET="RileyGeometryPrototype", + RILEY_NO_MODIFY=True)), + ('geoPrototype', T_PATH, + dict(RILEY_RELATIONSHIP_TARGET="RileyGeometryPrototype", + RILEY_NO_MODIFY=True)), + ('material', T_PATH, + dict(RILEY_RELATIONSHIP_TARGET="RileyMaterial")), + ('coordsys', T_PATHARRAY, + dict(RILEY_RELATIONSHIP_TARGET="RileyCoordinateSystem")), + ('xform', T_MATRIX, {}), + ('attributes', 'HdPrmanRileyParamListSchema', {}), + ], + ), + + #-------------------------------------------------------------------------- + # hdPrman/rileyGeometryPrototype + dict( + SCHEMA_NAME = 'RileyGeometryPrototype', + SCHEMA_TOKEN = 'RileyGeometryPrototype', + ADD_DEFAULT_LOCATOR = True, + GENERATE_RILEY_PRIM = True, + SCHEMA_INCLUDES = ['hdPrman/rileyPrimvarListSchema'], + MEMBERS = [ + ('ALL_MEMBERS', '', dict(ADD_LOCATOR=True)), + ('type', T_TOKEN, + dict(RILEY_NO_MODIFY=True)), + ('displacement', T_PATH, + dict(RILEY_RELATIONSHIP_TARGET="RileyDisplacement")), + ('primvars', 'HdPrmanRileyPrimvarListSchema', {}), + ], + ), + + #-------------------------------------------------------------------------- + # hdPrman/rileyIntegrator + dict( + SCHEMA_NAME = 'RileyIntegrator', + SCHEMA_TOKEN = 'rileyIntegrator', + ADD_DEFAULT_LOCATOR = True, + GENERATE_RILEY_PRIM = True, + SCHEMA_INCLUDES = ['hdPrman/rileyShadingNodeSchema'], + MEMBERS = [ + ('ALL_MEMBERS', '', dict(ADD_LOCATOR=True)), + ('integratorNode', 'HdPrmanRileyShadingNodeSchema', {}), + ], + ), + + #-------------------------------------------------------------------------- + # hdPrman/rileyLightInstance + dict( + SCHEMA_NAME = 'RileyLightInstance', + SCHEMA_TOKEN = 'RileyLightInstance', + ADD_DEFAULT_LOCATOR = True, + GENERATE_RILEY_PRIM = True, + SCHEMA_INCLUDES = ['hdPrman/rileyParamListSchema'], + MEMBERS = [ + ('ALL_MEMBERS', '', dict(ADD_LOCATOR=True)), + ('groupPrototype', T_PATH, + dict(RILEY_RELATIONSHIP_TARGET="RileyGeometryPrototype", + RILEY_NO_MODIFY=True)), + ('geoPrototype', T_PATH, + dict(RILEY_RELATIONSHIP_TARGET="RileyGeometryPrototype", + RILEY_NO_MODIFY=True)), + ('material', T_PATH, + dict(RILEY_RELATIONSHIP_TARGET="RileyMaterial")), + ('lightShader', T_PATH, + dict(RILEY_RELATIONSHIP_TARGET="RileyLightShader")), + ('coordsys', T_PATHARRAY, + dict(RILEY_RELATIONSHIP_TARGET="RileyCoordinateSystem")), + ('xform', T_MATRIX, {}), + ('attributes', 'HdPrmanRileyParamListSchema', {}), + ], + ), + + #-------------------------------------------------------------------------- + # hdPrman/rileyLightShader + dict( + SCHEMA_NAME = 'RileyLightShader', + SCHEMA_TOKEN = 'rileyLightShader', + ADD_DEFAULT_LOCATOR = True, + GENERATE_RILEY_PRIM = True, + SCHEMA_INCLUDES = ['hdPrman/rileySchemaTypeDefs'], + MEMBERS = [ + ('ALL_MEMBERS', '', dict(ADD_LOCATOR=True)), + ('light', 'HdPrmanRileyShadingNodeVectorSchema', {}), + ('lightFilter', 'HdPrmanRileyShadingNodeVectorSchema', {}), + ], + ), + + #-------------------------------------------------------------------------- + # hdPrman/rileyMaterial + dict( + SCHEMA_NAME = 'RileyMaterial', + SCHEMA_TOKEN = 'rileyMaterial', + ADD_DEFAULT_LOCATOR = True, + GENERATE_RILEY_PRIM = True, + SCHEMA_INCLUDES = ['hdPrman/rileySchemaTypeDefs', + 'hdPrman/rileyParamListSchema'], + MEMBERS = [ + ('ALL_MEMBERS', '', dict(ADD_LOCATOR=True)), + ('bxdf', 'HdPrmanRileyShadingNodeVectorSchema', {}), + ('attributes', 'HdPrmanRileyParamListSchema', {}), + ], + ), + + #-------------------------------------------------------------------------- + # hdPrman/rileyRenderOutput + dict( + SCHEMA_NAME = 'RileyRenderOutput', + SCHEMA_TOKEN = 'rileyRenderOutput', + ADD_DEFAULT_LOCATOR = True, + GENERATE_RILEY_PRIM = True, + ADD_RILEY_ID_LIST = True, + SCHEMA_INCLUDES = ['hdPrman/rileyParamListSchema'], + MEMBERS = [ + ('ALL_MEMBERS', '', dict(ADD_LOCATOR=True)), + ('name', T_TOKEN, {}), + ('type', T_TOKEN, + dict(RILEY_CONVERTER = "HdPrman_RileyRenderOutputType")), + ('source', T_TOKEN, {}), + ('accumulationRule', T_TOKEN, {}), + ('filter', T_TOKEN, {}), + ('filterSize', T_VEC2F, + dict(RILEY_CONVERTER = "HdPrman_RileyFilterSize")), + ('relativePixelVariance', T_FLOAT, + dict(FALLBACK_VALUE = "1.0f")), + ('params', 'HdPrmanRileyParamListSchema', {}), + ], + STATIC_TOKEN_DATASOURCE_BUILDERS = [ + ('type', ['(float_, "float")', 'integer', 'color', 'vector']), + ], + ), + + #-------------------------------------------------------------------------- + # hdPrman/rileyRenderTarget + dict( + SCHEMA_NAME = 'RileyRenderTarget', + SCHEMA_TOKEN = 'rileyRenderTarget', + ADD_DEFAULT_LOCATOR = True, + GENERATE_RILEY_PRIM = True, + SCHEMA_INCLUDES = ['hdPrman/rileyParamListSchema'], + MEMBERS = [ + ('ALL_MEMBERS', '', dict(ADD_LOCATOR=True)), + ('renderOutputs', T_PATHARRAY, + dict(RILEY_RELATIONSHIP_TARGET="RileyRenderOutput")), + ('extent', T_VEC3I, + dict(RILEY_CONVERTER = "HdPrman_RileyExtent")), + ('filterMode', T_TOKEN, {}), + ('pixelVariance', T_FLOAT, + dict(FALLBACK_VALUE = "1.0f")), + ('params', 'HdPrmanRileyParamListSchema', {}), + ], + STATIC_TOKEN_DATASOURCE_BUILDERS = [ + ('filterMode', ['importance', 'weighted']), + ], + ), + + #-------------------------------------------------------------------------- + # hdPrman/rileyRenderView + dict( + SCHEMA_NAME = 'RileyRenderView', + SCHEMA_TOKEN = 'rileyRenderView', + ADD_DEFAULT_LOCATOR = True, + GENERATE_RILEY_PRIM = True, + SCHEMA_INCLUDES = ['hdPrman/rileyParamListSchema'], + MEMBERS = [ + ('ALL_MEMBERS', '', dict(ADD_LOCATOR=True)), + ('renderTarget', T_PATH, + dict(RILEY_RELATIONSHIP_TARGET="RileyRenderTarget")), + ('camera', T_PATH, + dict(RILEY_RELATIONSHIP_TARGET="RileyCamera")), + ('integrator', T_PATH, + dict(RILEY_RELATIONSHIP_TARGET="RileyIntegrator")), + ('displayFilters', T_PATHARRAY, + dict(RILEY_RELATIONSHIP_TARGET="RileyDisplayFilter")), + ('sampleFilters', T_PATHARRAY, + dict(RILEY_RELATIONSHIP_TARGET="RileySampleFilter")), + ('params', 'HdPrmanRileyParamListSchema', {}), + ], + STATIC_TOKEN_DATASOURCE_BUILDERS = [ + ('filterMode', ['importance', 'weighted']), + ], + ), + + #-------------------------------------------------------------------------- + # hdPrman/rileySampleFilter + dict( + SCHEMA_NAME = 'RileySampleFilter', + SCHEMA_TOKEN = 'rileySampleFilter', + ADD_DEFAULT_LOCATOR = True, + GENERATE_RILEY_PRIM = True, + SCHEMA_INCLUDES = ['hdPrman/rileySchemaTypeDefs', + 'hdPrman/rileyParamListSchema'], + ADD_RILEY_ID_LIST = True, + MEMBERS = [ + ('ALL_MEMBERS', '', dict(ADD_LOCATOR=True)), + ('sampleFilter', 'HdPrmanRileyShadingNodeVectorSchema', {}), + ('attributes', 'HdPrmanRileyParamListSchema', {}), + ], + ), +] diff --git a/third_party/renderman-26/plugin/hdPrman/implicitSurfaceSceneIndexPlugin.cpp b/third_party/renderman-26/plugin/hdPrman/implicitSurfaceSceneIndexPlugin.cpp new file mode 100644 index 0000000000..662e33a173 --- /dev/null +++ b/third_party/renderman-26/plugin/hdPrman/implicitSurfaceSceneIndexPlugin.cpp @@ -0,0 +1,95 @@ +// +// Copyright 2022 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. + +#include "hdPrman/implicitSurfaceSceneIndexPlugin.h" + +#include "pxr/imaging/hd/retainedDataSource.h" +#include "pxr/imaging/hd/sceneIndexPluginRegistry.h" +#include "pxr/imaging/hd/tokens.h" +#include "pxr/imaging/hdsi/implicitSurfaceSceneIndex.h" + +#include "pxr/base/tf/envSetting.h" + +PXR_NAMESPACE_OPEN_SCOPE + +TF_DEFINE_ENV_SETTING(HDPRMAN_TESSELLATE_IMPLICIT_SURFACES, false, + "Tessellate implicit surfaces into meshes, " + "instead of using Renderman implicits"); + +TF_DEFINE_PRIVATE_TOKENS( + _tokens, + ((sceneIndexPluginName, "HdPrman_ImplicitSurfaceSceneIndexPlugin")) +); + +static const char * const _pluginDisplayName = "Prman"; + +TF_REGISTRY_FUNCTION(TfType) +{ + HdSceneIndexPluginRegistry::Define(); +} + +TF_REGISTRY_FUNCTION(HdSceneIndexPlugin) +{ + const HdSceneIndexPluginRegistry::InsertionPhase insertionPhase = 0; + + // Prman natively supports various quadric primitives (including cone, + // cylinder and sphere), generating them such that they are rotationally + // symmetric about the Z axis. To support other spine axes, configure the + // scene index to overload the transform to account for the change of basis. + // For unsupported primitives such as capsules and cubes, generate the + // mesh instead. + // + HdDataSourceBaseHandle const axisToTransformSrc = + HdRetainedTypedSampledDataSource::New( + HdsiImplicitSurfaceSceneIndexTokens->axisToTransform); + HdDataSourceBaseHandle const toMeshSrc = + HdRetainedTypedSampledDataSource::New( + HdsiImplicitSurfaceSceneIndexTokens->toMesh); + + static bool tessellate = + (TfGetEnvSetting(HDPRMAN_TESSELLATE_IMPLICIT_SURFACES) == true); + + HdContainerDataSourceHandle inputArgs; + if (tessellate) { + // Tessellate everything (legacy behavior). + inputArgs = + HdRetainedContainerDataSource::New( + HdPrimTypeTokens->sphere, toMeshSrc, + HdPrimTypeTokens->cube, toMeshSrc, + HdPrimTypeTokens->cone, toMeshSrc, + HdPrimTypeTokens->cylinder, toMeshSrc, + HdPrimTypeTokens->capsule, toMeshSrc); + } else { + // Cone and cylinder need transforms updated, and cube and capsule still + // need to be tessellated. + inputArgs = + HdRetainedContainerDataSource::New( + HdPrimTypeTokens->cone, axisToTransformSrc, + HdPrimTypeTokens->cylinder, axisToTransformSrc, + HdPrimTypeTokens->cube, toMeshSrc, + HdPrimTypeTokens->capsule, toMeshSrc); + } + + HdSceneIndexPluginRegistry::GetInstance().RegisterSceneIndexForRenderer( + _pluginDisplayName, + _tokens->sceneIndexPluginName, + inputArgs, + insertionPhase, + HdSceneIndexPluginRegistry::InsertionOrderAtStart); +} + +HdPrman_ImplicitSurfaceSceneIndexPlugin:: +HdPrman_ImplicitSurfaceSceneIndexPlugin() = default; + +HdSceneIndexBaseRefPtr +HdPrman_ImplicitSurfaceSceneIndexPlugin::_AppendSceneIndex( + const HdSceneIndexBaseRefPtr &inputScene, + const HdContainerDataSourceHandle &inputArgs) +{ + return HdsiImplicitSurfaceSceneIndex::New(inputScene, inputArgs); +} + +PXR_NAMESPACE_CLOSE_SCOPE diff --git a/third_party/renderman-26/plugin/hdPrman/implicitSurfaceSceneIndexPlugin.h b/third_party/renderman-26/plugin/hdPrman/implicitSurfaceSceneIndexPlugin.h new file mode 100644 index 0000000000..41361094bf --- /dev/null +++ b/third_party/renderman-26/plugin/hdPrman/implicitSurfaceSceneIndexPlugin.h @@ -0,0 +1,36 @@ +// +// Copyright 2022 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. + +#ifndef PXR_IMAGING_HDPRMAN_IMPLICIT_SURFACE_SCENE_INDEX_PLUGIN_H +#define PXR_IMAGING_HDPRMAN_IMPLICIT_SURFACE_SCENE_INDEX_PLUGIN_H + +#include "pxr/pxr.h" +#include "pxr/imaging/hd/sceneIndexPlugin.h" +#include "hdPrman/api.h" + +PXR_NAMESPACE_OPEN_SCOPE + +/// \class HdPrman_ImplicitSurfaceSceneIndexPlugin +/// +/// Prman scene index plugin that configures the implicit surface scene index to +/// generate meshes for implicit surfaces that aren't natively supported by +/// Prman, and overload the transform (to account for different spine axes) for +/// natively supported quadrics. +/// +class HdPrman_ImplicitSurfaceSceneIndexPlugin : public HdSceneIndexPlugin +{ +public: + HdPrman_ImplicitSurfaceSceneIndexPlugin(); + +protected: + HdSceneIndexBaseRefPtr _AppendSceneIndex( + const HdSceneIndexBaseRefPtr &inputScene, + const HdContainerDataSourceHandle &inputArgs) override; +}; + +PXR_NAMESPACE_CLOSE_SCOPE + +#endif // PXR_IMAGING_HDPRMAN_IMPLICIT_SURFACE_SCENE_INDEX_PLUGIN_H diff --git a/third_party/renderman-26/plugin/hdPrman/instancer.cpp b/third_party/renderman-26/plugin/hdPrman/instancer.cpp new file mode 100644 index 0000000000..588dfb17f5 --- /dev/null +++ b/third_party/renderman-26/plugin/hdPrman/instancer.cpp @@ -0,0 +1,1821 @@ +// +// Copyright 2023 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// +#include "hdPrman/instancer.h" + +#include "hdPrman/debugCodes.h" +#include "hdPrman/debugUtil.h" +#include "hdPrman/light.h" +#include "hdPrman/rixStrings.h" +#include "hdPrman/utils.h" + +#include "pxr/base/gf/matrix4d.h" +#include "pxr/base/tf/envSetting.h" +#include "pxr/base/tf/getenv.h" +#include "pxr/base/vt/typeHeaders.h" +#include "pxr/base/vt/visitValue.h" +#include "pxr/base/work/loops.h" +#include "pxr/imaging/hd/light.h" +#include "pxr/imaging/hd/sceneDelegate.h" +#include "pxr/imaging/hd/tokens.h" + +PXR_NAMESPACE_OPEN_SCOPE + +TF_DEFINE_ENV_SETTING(HD_PRMAN_DISABLE_NESTED_INSTANCING, false, + "disable riley nested instancing in hdprman"); + +const int HDPRMAN_MAX_SUPPORTED_NESTING_DEPTH = 4; + +// ********************************************** +// ** Internal helper functions ** +// ********************************************** +namespace { + +template +void _AccumulateSampleTimes( + const HdTimeSampleArray& in, + HdTimeSampleArray& out) +{ + // XXX: This is just a straight copy that works fine in situations where + // out's sample range is within in's. But if out's sample range begins + // before in's (out.times[0] < in.times[0]) or ends after in's + // (out.times[-1] > in.times[-1]), we're gonna lose part of the range. + if (in.count > out.count) { + out.Resize(in.count); + out.times = in.times; + } +} + +// Visitor for VtVisitValue; will retrieve the value at the specified +// index as a VtValue when the visited value is array-typed. Returns +// empty VtValue when the visited value is not array-typed, or when the +// index points beyond the end of the array. +struct _GetValueAtIndex { + _GetValueAtIndex(const size_t index) : _index(index) { } + template + const VtValue operator()(const VtArray& array) const + { + if (array.size() > _index) { + return VtValue(array[_index]); + } + return VtValue(); + } + const VtValue operator()(const VtValue& val) const + { + return VtValue(); + } +private: + size_t _index; +}; + +template +M _ConvertMatrix(GfMatrix4d&& src); + +template<> +GfMatrix4d _ConvertMatrix(GfMatrix4d&& src) { return src; } + +template<> +RtMatrix4x4 _ConvertMatrix(GfMatrix4d&& src) { + return HdPrman_Utils::GfMatrixToRtMatrix(src); +} + +template +HdTimeSampleArray _MultiplyTransforms( + const HdTimeSampleArray& lhs, + const HdTimeSampleArray& rhs) +{ + HdTimeSampleArray dest; + _AccumulateSampleTimes(lhs, dest); + _AccumulateSampleTimes(rhs, dest); + if (lhs.count == 0 || + (lhs.count == 1 && lhs.values[0] == GfMatrix4d(1))) { + for (size_t j = 0; j < dest.count; ++j) { + dest.values[j] = _ConvertMatrix(rhs.Resample(dest.times[j])); + } + } else if (rhs.count == 0 || + (rhs.count == 1 && rhs.values[0] == GfMatrix4d(1))) { + for (size_t j = 0; j < dest.count; ++j) { + dest.values[j] = _ConvertMatrix(lhs.Resample(dest.times[j])); + } + } else { + for (size_t j = 0; j < dest.count; ++j) { + dest.values[j] = _ConvertMatrix( + lhs.Resample(dest.times[j]) * rhs.Resample(dest.times[j])); + } + } + return dest; +} + +void _BuildStatsId( + const SdfPath& instancerId, + const int index, + const SdfPath& protoId, + RtParamList& params) +{ + // The stats id is a human readable unique identifier in the form: + // [instanceIndex]{prototypeName} + // It is used for diagnostic purposes to identify instances in a + // Disgust log. It is somewhat costly to construct, so we only do so + // when generating a Disgust log. + static const bool disabled = TfGetenv("RILEY_CAPTURE").empty(); + if (disabled) { return; } + RtUString val; + if (params.HasParam(RixStr.k_stats_identifier)) { + params.GetString(RixStr.k_stats_identifier, val); + std::string valStr(val.CStr()); + valStr = TfStringReplace( + valStr, + instancerId.GetString(), + TfStringPrintf("%s[%i]", instancerId.GetText(), index)); + val = RtUString(valStr.c_str()); + } else { + std::string valStr = TfStringPrintf( + "%s[%i]{%s}", + instancerId.GetText(), + index, + protoId.GetName().c_str()); + val = RtUString(valStr.c_str()); + } + params.SetString(RixStr.k_stats_identifier, val); +} + +RtUString +_FixupParamName(const TfToken& name) { + // Instance params with the "ri:attributes:" and "primvars:ri:attributes:" + // prefixes correspond to renderman-namespace attributes and have that + // prefix stripped. All other params are in the "user:" namespace, so if + // they don't have that prefix we need to add it. + static const std::string userPrefix("user:"); + static const std::string riAttrPrefix("ri:attributes:"); + static const std::string primvarsRiAttrPrefix("primvars:ri:attributes:"); + RtUString rtname; + if (TfStringStartsWith(name.GetString(), userPrefix)) { + rtname = RtUString(name.GetText()); + } else if (TfStringStartsWith(name.GetString(), riAttrPrefix)) { + rtname = RtUString(name.GetString() + .substr(riAttrPrefix.length()).c_str()); + } else if (TfStringStartsWith(name.GetString(), primvarsRiAttrPrefix)) { + rtname = RtUString(name.GetString() + .substr(primvarsRiAttrPrefix.length()).c_str()); + } else { + rtname = RtUString(TfStringPrintf("user:%s", name.GetText()).c_str()); + } + return rtname; +} + +// Save one code indentation level when we don't have anything to +// amortize across a batch. +template +void +_ParallelFor(size_t n, Fn &&cb, size_t grainSize = 1) { + return WorkParallelForN(n, [&cb](size_t begin, size_t end) { + for (size_t i = begin; i < end; ++i) { + std::forward(cb)(i); + } + }, grainSize); +} + +} // anonymous namespace + +// ********************************************** +// ** Public methods ** +// ********************************************** + +HdPrmanInstancer::HdPrmanInstancer( + HdSceneDelegate* delegate, + SdfPath const& id) + : HdInstancer(delegate, id) +{ } + +HdPrmanInstancer::~HdPrmanInstancer() = default; + +HdDirtyBits +HdPrmanInstancer::GetInitialDirtyBitsMask() const +{ + static const HdDirtyBits dirtyBits = + HdInstancer::GetInitialDirtyBitsMask() | + HdChangeTracker::DirtyVisibility | + HdChangeTracker::DirtyCategories; + return dirtyBits; +}; + +void +HdPrmanInstancer::Sync( + HdSceneDelegate* delegate, + HdRenderParam* renderParam, + HdDirtyBits* dirtyBits) +{ + HD_TRACE_FUNCTION(); + HF_MALLOC_TAG_FUNCTION(); + + const SdfPath& id = GetId(); + + if (TfDebug::IsEnabled(HDPRMAN_INSTANCERS)) { + using namespace HdPrmanDebugUtil; + + const std::string clr = GetCallerAsString(TF_CALL_CONTEXT); + const std::string dbs = HdChangeTracker::StringifyDirtyBits(*dirtyBits); + const std::string pro = SdfPathVecToString(delegate-> + GetInstancerPrototypes(id)); + std::string dps; + if (HdChangeTracker::IsAnyPrimvarDirty(*dirtyBits, id)) { + for (HdInterpolation i = HdInterpolationConstant; + i != HdInterpolationCount; i = HdInterpolation(i+1)){ + for (const HdPrimvarDescriptor& primvar : + delegate->GetPrimvarDescriptors(id, i)) { + if (HdChangeTracker::IsPrimvarDirty(*dirtyBits, id, + primvar.name)) { + if (dps.empty()) { + dps += " dirty primvars : "; + } else { + dps += " : "; + } + const VtValue& val = delegate->Get(id, primvar.name); + dps += TfStringPrintf("(%s) (%s) %s\n", + TfEnum::GetName(i).c_str(), + val.GetTypeName().c_str(), + primvar.name.GetText()); + } + } + } + } + + std::string msg; + msg += TfStringPrintf("*** Sync called on <%s>\n", id.GetText()); + msg += TfStringPrintf(" dirtyBits : %s\n", dbs.c_str()); + if (!dps.empty()) { + msg += dps; + } + msg += TfStringPrintf(" prototypes : [%s]\n", pro.c_str()); + msg += TfStringPrintf(" caller : %s\n", clr.c_str()); + TF_DEBUG(HDPRMAN_INSTANCERS).Msg("%s\n", msg.c_str()); + } + + _UpdateInstancer(delegate, dirtyBits); + + HdPrman_RenderParam *param = static_cast(renderParam); + + // Convert (and cache) instancer coordinate systems. + if (HdPrman_RenderParam::RileyCoordSysIdVecRefPtr convertedCoordSys = + param->ConvertAndRetainCoordSysBindings(delegate, id)) { + _coordSysList.count = convertedCoordSys->size(); + _coordSysList.ids = convertedCoordSys->data(); + } + + // cache instance primvars + _SyncPrimvars(dirtyBits); + + // cache the instancer and instance transforms + _SyncTransforms(dirtyBits); + + // cache the instancer and instance categories + _SyncCategories(dirtyBits); + + // cache the instancer visibility + _SyncVisibility(dirtyBits); + + // If anything has changed, internally flag all previously-populated + // instances as dirty. Since instances are grouped by prototype prim id + // and Populate gets called one prototype prim at a time, we set a dirty + // flag for each known prototype prim id. Each gets cleared once Populate + // has been called with the corresponding prototype prim. This helps avoid + // unnecessary updates to riley instances in Populate. + if (HdChangeTracker::IsAnyPrimvarDirty(*dirtyBits, id) || + HdChangeTracker::IsTransformDirty(*dirtyBits, id) || + *dirtyBits & HdChangeTracker::DirtyCategories || + HdChangeTracker::IsVisibilityDirty(*dirtyBits, id) || + HdChangeTracker::IsInstanceIndexDirty(*dirtyBits, id)) { + _SetPrototypesDirty(); + } +} + +void +HdPrmanInstancer::Finalize(HdRenderParam *renderParam) +{ + HD_TRACE_FUNCTION(); + TF_DEBUG(HDPRMAN_INSTANCERS).Msg("*** Finalize called on <%s>\n\n", + GetId().GetText()); + HdPrman_RenderParam *param = static_cast(renderParam); + riley::Riley *riley = param->AcquireRiley(); + + // Release retained conversions of coordSys bindings. + param->ReleaseCoordSysBindings(GetId()); + + // Delete all my riley instances + _protoMap.citerate([riley](const SdfPath& path, const _ProtoMapEntry& entry) { + for (const auto& rp : entry.map) { + const _InstanceIdVec& ids = rp.second; + _ParallelFor(ids.size(), [&](size_t i) { + const _RileyInstanceId& ri = ids[i]; + if (ri.lightInstanceId != riley::LightInstanceId::InvalidId()) { + riley->DeleteLightInstance(ri.groupId, ri.lightInstanceId); + } else if (ri.geoInstanceId != riley::GeometryInstanceId::InvalidId()) { + riley->DeleteGeometryInstance(ri.groupId, ri.geoInstanceId); + } + }); + } + }); + + // Clear my proto map + _protoMap.clear(); + + // Depopulate instances of my groups + HdPrmanInstancer* parent = _GetParentInstancer(); + if (parent) { + parent->Depopulate(renderParam, GetId()); + } + + // Delete my prototype groups + _groupMap.citerate([&](const _FlattenData fd, const riley::GeometryPrototypeId& gp) { + if (gp != riley::GeometryPrototypeId::InvalidId()) { + riley->DeleteGeometryPrototype(gp); + } + }); + + // Clear my group map + _groupMap.clear(); + _groupCounters.clear(); +} + +void HdPrmanInstancer::Populate( + HdRenderParam* renderParam, + HdDirtyBits* dirtyBits, + const SdfPath& hydraPrototypeId, + const std::vector& rileyPrototypeIds, + const riley::CoordinateSystemList& coordSysList, + const RtParamList protoParams, + const HdTimeSampleArray protoXform, + const std::vector& rileyMaterialIds, + const SdfPathVector& prototypePaths, + const riley::LightShaderId& lightShaderId) +{ + // This public Populate signature does not accept the last two arguments + // that the private _PopulateInstances does; those are only available to + // HdPrmanInstancer. This lets us keep their messy types private. + + _PopulateInstances( + renderParam, + dirtyBits, + hydraPrototypeId, + hydraPrototypeId, + rileyPrototypeIds, + coordSysList, + protoParams, + protoXform, + rileyMaterialIds, + prototypePaths, + lightShaderId, + { }, + { }); +} + +void HdPrmanInstancer::Depopulate( + HdRenderParam* renderParam, + const SdfPath& prototypePrimPath, + const std::vector& excludedPrototypeIds) +{ + HD_TRACE_FUNCTION(); + if (TfDebug::IsEnabled(HDPRMAN_INSTANCERS)) { + TF_DEBUG(HDPRMAN_INSTANCERS).Msg( + "*** Depopulate called on Instancer <%s>\n" + " prototypePrimPath : <%s>\n" + " excludedIds : [%s]\n" + " caller : %s\n\n", + GetId().GetText(), prototypePrimPath.GetText(), + HdPrmanDebugUtil::RileyIdVecToString(excludedPrototypeIds).c_str(), + HdPrmanDebugUtil::GetCallerAsString(TF_CALL_CONTEXT).c_str()); + } + HdPrman_RenderParam* param = static_cast(renderParam); + riley::Riley* riley = param->AcquireRiley(); + + _RemoveDeadInstances(riley, prototypePrimPath, excludedPrototypeIds); + _CleanDisusedGroupIds(param); +} + +// ********************************************** +// ** Private methods called during Sync ** +// ********************************************** + +void HdPrmanInstancer::_SyncPrimvars( + HdDirtyBits* dirtyBits) +{ + + // This method syncs USD primvars authored on the instancer into a cache. + // This cache will later be used to compose riley instance params from the + // USD primvars. Under Hydra 1.0, only instance-rate USD primvars are + // available, and any authored as "varying", "vertex", or "faceVarying" + // have already been converted to "instance". However, in Hydra 2.0, all + // interpolation types are available, and none have been converted from + // "varying", "vertex", or "faceVarying" to "instance". So we have to query + // for each interpolation type to be sure to capture all USD primvars that + // should be applied per-instance. + // + // The exclusion here of "constant" and "uniform" USD primvars is an open + // point of controversy insofar as point instancers are concerned. In + // theory, those should be inherited by prototypes that are descendants of + // the point instancer, and we make an explicit attempt to capture those + // elsewhere. But "constant" and "uniform" primvars on the point instancer + // cannot be inherited by prototypes that are not also descendants, and in + // that case we will not be able to apply them to instances. + // + // Some users have requested the ability to use constant primvars authored + // on the point instancer to control the renderer-specific behavior of the + // point instancer itself, e.g., by setting a ri-specific param on the + // point instancer hoping it will be applied to all riley instances the + // point instancer creates. But such an approach would violate assumptions + // about inheritance in USD. The issue remains in discussion both internally + // and in Github issues. + + // XXX: USD Primvars authored on native instances are currently missing + // under Hydra 2.0 and are not captured here or anywhere else. + + HdSceneDelegate* delegate = GetDelegate(); + SdfPath const& id = GetId(); + + // XXX: When finally removing these, eliminate the variables. Replace + // their usages with the appropriate HdInstancerTokens inline. +#if HD_API_VERSION < 56 // USD_VERSION < 23.05 + TfToken instanceTranslationsToken = HdInstancerTokens->translate; + TfToken instanceRotationsToken = HdInstancerTokens->rotate; + TfToken instanceScalesToken = HdInstancerTokens->scale; + TfToken instanceTransformsToken = HdInstancerTokens->instanceTransform; +#else + TfToken instanceTranslationsToken = HdInstancerTokens->instanceTranslations; + TfToken instanceRotationsToken = HdInstancerTokens->instanceRotations; + TfToken instanceScalesToken = HdInstancerTokens->instanceScales; + TfToken instanceTransformsToken = HdInstancerTokens->instanceTransforms; +#if HD_API_VERSION < 67 // USD_VERSION < 24.05 + if (TfGetEnvSetting(HD_USE_DEPRECATED_INSTANCER_PRIMVAR_NAMES)) { + instanceTranslationsToken = HdInstancerTokens->translate; + instanceRotationsToken = HdInstancerTokens->rotate; + instanceScalesToken = HdInstancerTokens->scale; + instanceTransformsToken = HdInstancerTokens->instanceTransform; + } +#endif +#endif + + if (HdChangeTracker::IsAnyPrimvarDirty(*dirtyBits, id)) { + // Get list of USD primvar names for each interp mode and cache each one + // Solaris allows constant primvars so we need to be able to access them. + for (HdInterpolation i = HdInterpolationConstant; + i != HdInterpolationCount; i = HdInterpolation(i+1)) { + for (const HdPrimvarDescriptor& primvar : + delegate->GetPrimvarDescriptors(id, i)) { + // Skip primvars that have special handling elsewhere. + // The transform primvars are all handled in + // _SyncTransforms. + if (primvar.name == instanceTransformsToken || + primvar.name == instanceRotationsToken || + primvar.name == instanceScalesToken || + primvar.name == instanceTranslationsToken) { + continue; + } + if (HdChangeTracker::IsPrimvarDirty(*dirtyBits, id, primvar.name)) { + VtValue value = delegate->Get(id, primvar.name); + if (!value.IsEmpty()) { + _PrimvarValue& entry = _primvarMap[primvar.name]; + entry.desc = primvar; + std::swap(entry.value, value); + } + } + } + } + } +} + +bool UnboxOrientations( + HdTimeSampleArray const& box, + HdTimeSampleArray *outRotates) +{ + HdTimeSampleArray rotates; + if (outRotates->UnboxFrom(box)) { + if (outRotates->count > 0 && outRotates->values[0].size() > 0){ + return true; + } + } + if (rotates.UnboxFrom(box)) { + // convert to quatf + outRotates->Resize(rotates.count); + outRotates->times = rotates.times; + for (size_t i=0; i < rotates.count; ++i) { + if (rotates.values[i].size() > 0) { + VtQuathArray halfs = rotates.values[i]; + VtQuatfArray floats(halfs.cbegin(), halfs.cend()); + outRotates->values[i] = floats; + } + } + return true; + } + return false; +} + +void +HdPrmanInstancer::_SyncTransforms( + HdDirtyBits* dirtyBits) +{ + HdSceneDelegate* delegate = GetDelegate(); + const SdfPath& id = GetId(); + + // XXX: When finally removing these, eliminate the variables. Replace + // their usages with the appropriate HdInstancerTokens inline. Don't forget + // to reformat the "not ... expected type" warning messages, too! +#if HD_API_VERSION < 56 // USD_VERSION < 23.05 + TfToken instanceTranslationsToken = HdInstancerTokens->translate; + TfToken instanceRotationsToken = HdInstancerTokens->rotate; + TfToken instanceScalesToken = HdInstancerTokens->scale; + TfToken instanceTransformsToken = HdInstancerTokens->instanceTransform; +#else + TfToken instanceTranslationsToken = HdInstancerTokens->instanceTranslations; + TfToken instanceRotationsToken = HdInstancerTokens->instanceRotations; + TfToken instanceScalesToken = HdInstancerTokens->instanceScales; + TfToken instanceTransformsToken = HdInstancerTokens->instanceTransforms; +#if HD_API_VERSION < 67 // USD_VERSION < 24.05 + if (TfGetEnvSetting(HD_USE_DEPRECATED_INSTANCER_PRIMVAR_NAMES)) { + instanceTranslationsToken = HdInstancerTokens->translate; + instanceRotationsToken = HdInstancerTokens->rotate; + instanceScalesToken = HdInstancerTokens->scale; + instanceTransformsToken = HdInstancerTokens->instanceTransform; + } +#endif +#endif + + // Only include this instancer's own transform if it has no parent. When + // there is a parent instancer, the parent instancer will apply this + // instancer's transform to the instances it creates of this instancer's + // prototype groups. + const bool includeInstancerXform = _Depth() == 0; + + if (HdChangeTracker::IsTransformDirty(*dirtyBits, id) || + HdChangeTracker::IsPrimvarDirty(*dirtyBits, id, + instanceTransformsToken) || + HdChangeTracker::IsPrimvarDirty(*dirtyBits, id, + instanceTranslationsToken) || + HdChangeTracker::IsPrimvarDirty(*dirtyBits, id, + instanceRotationsToken) || + HdChangeTracker::IsPrimvarDirty(*dirtyBits, id, + instanceScalesToken)) { + + HdTimeSampleArray instancerXform; + HdTimeSampleArray + boxedInstanceXforms; + HdTimeSampleArray boxedTranslates; + HdTimeSampleArray boxedRotates; + HdTimeSampleArray boxedScales; + if (includeInstancerXform) { + delegate->SampleInstancerTransform(id, &instancerXform); + } + delegate->SamplePrimvar(id, instanceTransformsToken, + &boxedInstanceXforms); + delegate->SamplePrimvar(id, instanceTranslationsToken, + &boxedTranslates); + delegate->SamplePrimvar(id, instanceScalesToken, + &boxedScales); + delegate->SamplePrimvar(id, instanceRotationsToken, + &boxedRotates); + + // Unbox samples held as VtValues + HdTimeSampleArray + instanceXforms; + HdTimeSampleArray translates; + HdTimeSampleArray rotates; + HdTimeSampleArray scales; + if (!instanceXforms.UnboxFrom(boxedInstanceXforms)) { + TF_WARN("<%s> %s did not have expected type matrix4d[]", + instanceTransformsToken.GetText(), id.GetText()); + } + if (!translates.UnboxFrom(boxedTranslates)) { + TF_WARN("<%s> %s did not have expected type vec3f[]", + instanceTranslationsToken.GetText(), id.GetText()); + } + if (!UnboxOrientations(boxedRotates, &rotates)) { + TF_WARN("<%s> %s did not have expected type quath[] or quatf[]", + instanceRotationsToken.GetText(), id.GetText()); + } + if (!scales.UnboxFrom(boxedScales)) { + TF_WARN("<%s> %s did not have expected type vec3f[]", + instanceScalesToken.GetText(), id.GetText()); + } + + // As a simple resampling strategy, find the input with the max # + // of samples and use its sample placement. In practice we expect + // them to all be the same, i.e. to not require resampling. + _sa.Resize(0); + _AccumulateSampleTimes(instancerXform, _sa); + _AccumulateSampleTimes(instanceXforms, _sa); + _AccumulateSampleTimes(translates, _sa); + _AccumulateSampleTimes(scales, _sa); + _AccumulateSampleTimes(rotates, _sa); + + // Resample inputs and concatenate transformations. + for (size_t i=0; i < _sa.count; ++i) { + const float t = _sa.times[i]; + GfMatrix4d xf(1); + if (instancerXform.count > 0) { + xf = instancerXform.Resample(t); + } + VtMatrix4dArray ixf; + if (instanceXforms.count > 0) { + ixf = instanceXforms.Resample(t); + } + VtVec3fArray trans; + if (translates.count > 0) { + trans = translates.Resample(t); + } + VtQuatfArray rot; + if (rotates.count > 0) { + rot = rotates.Resample(t); + } + VtVec3fArray scale; + if (scales.count > 0) { + scale = scales.Resample(t); + } + + size_t size = std::max({ + ixf.size(), + trans.size(), + rot.size(), + scale.size() + }); + + // Concatenate transformations. + VtMatrix4dArray &ma = _sa.values[i]; + ma.resize(size); + for (size_t j=0; j < size; ++j) { + ma[j] = xf; + if (trans.size() > j) { + GfMatrix4d t(1); + t.SetTranslate(GfVec3d(trans[j])); + ma[j] = t * ma[j]; + } + if (rot.size() > j) { + GfMatrix4d r(1); + r.SetRotate(GfQuatd(rot[j])); + ma[j] = r * ma[j]; + } + if (scale.size() > j) { + GfMatrix4d s(1); + s.SetScale(GfVec3d(scale[j])); + ma[j] = s * ma[j]; + } + if (ixf.size() > j) { + ma[j] = ixf[j] * ma[j]; + } + } + } + } +} + +void +HdPrmanInstancer::_SyncCategories(HdDirtyBits* dirtyBits) +{ + // XXX: Instance categories only exist under native instancing, because + // point instancer instances are not path-addressable. For point instancers, + // we want the instances to take the categories of the instancer itself. + // Ideally, this difference would have been smoothed over for us by the + // scene delegate, and we would get instance categories for either kind of + // instancing using GetInstanceCategories(). For point instancers, the + // delegate would give us an appropriately sized vector of identical + // category lists pulled from the instancer. + // + // Unfortunately, GetInstanceCategories() does not handle point instancing + // this way. It instead returns an empty vector, leaving it to us to notice + // and call GetCategories() for the instancer ourselves, something we + // wouldn't otherwise want to do. + // + // Under point instancing, once we've called GetCategories(), we don't + // bother copying those categories into _instanceCategories, since we don't + // really know at this point how many instances we will have; we store them + // separately in the instancer-level flatten data instead. + // + // Under point instancing, _instanceCategories will be an empty vector. + // Therefore, all indexing into _instanceCategories must be bounds-checked! + // + // When we *do* have instance categories (as under native instancing), we + // make a little optimization by finding any categories common to all + // instances and moving them to the instancer-level flatten data. + + HdSceneDelegate* delegate = GetDelegate(); + const SdfPath& id = GetId(); + + if (*dirtyBits & HdChangeTracker::DirtyCategories) { + _instancerFlat.categories.clear(); + _instanceCategories = delegate->GetInstanceCategories(id); + if (_instanceCategories.size() == 0) { + // Point instancing; use instancer's categories + const VtTokenArray cats = delegate->GetCategories(id); + _instancerFlat.categories.insert(cats.begin(), cats.end()); + } else { + // Native instancing; move common categories to instancer + VtTokenArray intersection; + for (size_t i = 0; i < _instanceCategories.size(); ++i) { + VtTokenArray& instCats = _instanceCategories[i]; + // if any instance has no categories there can be no intersection + if (instCats.size() == 0) { + intersection.clear(); + break; + } + std::sort(instCats.begin(), instCats.end()); + VtTokenArray newIntersection; + if (i == 0) { + newIntersection = instCats; + } else { + std::set_intersection( + intersection.cbegin(), intersection.cend(), + instCats.cbegin(), instCats.cend(), + std::back_inserter(newIntersection)); + } + if (newIntersection.size() == 0) { + intersection.clear(); + break; + } + intersection = newIntersection; + } + if (intersection.size() > 0) { + for (size_t i = 0; i < _instanceCategories.size(); ++i) { + VtTokenArray instCats = _instanceCategories[i]; + // already sorted above + VtTokenArray newCats; + std::set_difference( + instCats.cbegin(), instCats.cend(), + intersection.cbegin(), intersection.cend(), + std::back_inserter(newCats)); + instCats = newCats; + } + _instancerFlat.categories.insert(intersection.cbegin(), + intersection.cend()); + } + } + } +} + +void +HdPrmanInstancer::_SyncVisibility(HdDirtyBits* dirtyBits) +{ + HdSceneDelegate* delegate = GetDelegate(); + const SdfPath& id = GetId(); + + if (HdChangeTracker::IsVisibilityDirty(*dirtyBits, id)) { + _instancerFlat.SetVisibility(delegate->GetVisible(id)); + } +} + +void +HdPrmanInstancer::_SetPrototypesDirty() +{ + HdPrmanInstancer* parent = _GetParentInstancer(); + if (parent && _Depth() > HDPRMAN_MAX_SUPPORTED_NESTING_DEPTH) { + parent->_SetPrototypesDirty(); + } else { + _protoMap.iterate([&](const SdfPath& pp, _ProtoMapEntry& entry) { + entry.dirty = true; + }); + } +} + +// ********************************************** +// ** Private methods called during Populate ** +// ********************************************** + +void +HdPrmanInstancer::_PopulateInstancesFromChild( + HdRenderParam* renderParam, + HdDirtyBits* dirtyBits, + const SdfPath& hydraPrototypeId, + const SdfPath& prototypePrimPath, + const std::vector& rileyPrototypeIds, + const riley::CoordinateSystemList& coordSysList, + const RtParamList prototypeParams, + const HdTimeSampleArray prototypeXform, + const std::vector& rileyMaterialIds, + const SdfPathVector& prototypePaths, + const riley::LightShaderId& lightShaderId, + const std::vector<_InstanceData>& subInstances, + const std::vector<_FlattenData>& prototypeFlats) +{ + // When a child instancer has multiple prototype prims, that child instancer + // may call this method simultaneously from different threads. That can lead + // to duplicate calls from this instancer to create or delete instances of + // the child instancer's prototype groups. Both of those are problematic + // when done in parallel. We expect such calls to be identical, so while + // we are locked we can throw away any additional calls from the same + // child instancer (identified by prototypePrimPath). + tbb::spin_rw_mutex& mutex = _childPopulateLocks.get(prototypePrimPath); + if (mutex.try_lock()) { + _PopulateInstances(renderParam, dirtyBits, hydraPrototypeId, + prototypePrimPath, rileyPrototypeIds, coordSysList, prototypeParams, + prototypeXform, rileyMaterialIds, prototypePaths, lightShaderId, + subInstances, prototypeFlats); + _childPopulateLocks.erase(prototypePrimPath); + mutex.unlock(); + } +} + +void +HdPrmanInstancer::_PopulateInstances( + HdRenderParam* renderParam, + HdDirtyBits* dirtyBits, + const SdfPath& hydraPrototypeId, + const SdfPath& prototypePrimPath, + const std::vector& rileyPrototypeIds, + const riley::CoordinateSystemList& coordSysList, + const RtParamList prototypeParams, + const HdTimeSampleArray prototypeXform, + const std::vector& rileyMaterialIds, + const SdfPathVector& prototypePaths, + const riley::LightShaderId& lightShaderId, + const std::vector<_InstanceData>& subInstances, + const std::vector<_FlattenData>& prototypeFlats) +{ + HD_TRACE_FUNCTION(); + HF_MALLOC_TAG_FUNCTION(); + + // This is our main workhorse. This method instructs the instancer to + // generate riley instances of a given prototype. When coming from the + // public Populate method, that prototype is a hydra prototype whose riley + // prototypes have already been constructed (see gprim.h). When coming from + // a child instancer, that prototype will usually be the child instancer + // itself (along with its associated riley geometry prototype groups). + // However, if the child instancer is too deep for nested instancing, it + // will instead provide the same prototype it was given along with a list + // of InstanceData structures, which contain all the information about the + // instances the child would have made if it could have. This instancer must + // then multiply that list by its own instances, and either create them or + // pass them along to *its* parent if it is also too deep. + // + // Further complicating issues, this method may be called concurrently from + // multiple threads, so some actions must be gated behind mutex locks. + + HdPrman_RenderParam* param = static_cast(renderParam); + riley::Riley* riley = param->AcquireRiley(); + HdSceneDelegate* delegate = GetDelegate(); + HdRenderIndex& renderIndex = delegate->GetRenderIndex(); + const SdfPath& instancerId = GetId(); + HdPrmanInstancer* parentInstancer = _GetParentInstancer(); + const int depth = _Depth(); + bool instancesNeedUpdate = _protoMap.get(prototypePrimPath).dirty + || (*dirtyBits & HdChangeTracker::DirtyPrimvar) + || (*dirtyBits & HdChangeTracker::DirtyMaterialId) + || (*dirtyBits & HdChangeTracker::DirtyTransform) + || (*dirtyBits & HdChangeTracker::DirtyVisibility); + bool anyGroupIdChanged = false; + bool isLight = lightShaderId != riley::LightShaderId::InvalidId(); + + if (TfDebug::IsEnabled(HDPRMAN_INSTANCERS)) { + using namespace HdPrmanDebugUtil; + + std::string pid = " -none- "; + if (parentInstancer) { + pid = parentInstancer->GetId().GetAsString(); + } + + const VtIntArray instanceIndices = delegate->GetInstanceIndices( + instancerId, hydraPrototypeId); + + std::string ins = TfStringPrintf("%lu instances ", instanceIndices.size()); + size_t total = instanceIndices.size(); + if (subInstances.size() > 0) { + ins += TfStringPrintf("of %lu subInstances ", subInstances.size()); + total *= subInstances.size(); + } + ins += TfStringPrintf("of %lu prototypes ", rileyPrototypeIds.size()); + total *= rileyPrototypeIds.size(); + ins += TfStringPrintf("= %lu Riley instances", total); + + std::string lsi = "- none -"; + if (lightShaderId != riley::LightShaderId::InvalidId()) { + lsi = TfStringPrintf("(%u)", lightShaderId.AsUInt32()); + } + + const HdDirtyBits instDirtyBits = renderIndex.GetChangeTracker() + .GetInstancerDirtyBits(instancerId); + const std::string dbs = HdChangeTracker::StringifyDirtyBits(*dirtyBits); + const std::string idb = HdChangeTracker::StringifyDirtyBits(instDirtyBits); + const std::string pro = RileyIdVecToString(rileyPrototypeIds); + const std::string mid = RileyIdVecToString(rileyMaterialIds); + const std::string pps = SdfPathVecToString(prototypePaths); + const std::string clr = GetCallerAsString(TF_CALL_CONTEXT); + const std::string pat = RtParamListToString(prototypeParams, 24); + const std::string pxf = MatrixToString(prototypeXform.values[0], 24, 3); + + std::string str; + str += TfStringPrintf("*** Populate called on <%s>\n", instancerId.GetText()); + str += TfStringPrintf(" dirtyBits : %s\n", dbs.c_str()); + str += TfStringPrintf(" instDirtyBits : %s\n", idb.c_str()); + str += TfStringPrintf(" hydraPrototypeId : <%s>\n", hydraPrototypeId.GetText()); + str += TfStringPrintf(" prototypePrimPath : <%s>\n", prototypePrimPath.GetText()); + str += TfStringPrintf(" rileyPrototypeIds : (%s)\n", pro.c_str()); + str += TfStringPrintf(" rileyMaterialIds : (%s)\n", mid.c_str()); + str += TfStringPrintf(" prototypePaths : [%s]\n", pps.c_str()); + str += TfStringPrintf(" lightShaderId : %s\n", lsi.c_str()); + str += TfStringPrintf(" prototypeParams : %s\n", pat.c_str()); + str += TfStringPrintf(" prototypeXform : %s\n", pxf.c_str()); + str += TfStringPrintf(" instances : %lu\n", instanceIndices.size()); + str += TfStringPrintf(" subInstances : %lu\n", subInstances.size()); + str += TfStringPrintf(" total instances : %s\n", ins.c_str()); + str += TfStringPrintf(" parentInstancer : <%s>\n", pid.c_str()); + str += TfStringPrintf(" depth : %i\n", depth); + str += TfStringPrintf(" caller : %s\n", clr.c_str()); + TF_DEBUG(HDPRMAN_INSTANCERS).Msg("%s\n", str.c_str()); + } + + TF_VERIFY( + rileyMaterialIds.size() == rileyPrototypeIds.size(), + "rileyMaterialIds size mismatch: %lu != %lu", + rileyMaterialIds.size(), rileyPrototypeIds.size()); + TF_VERIFY( + prototypePaths.size() == rileyPrototypeIds.size(), + "prototypePaths size mismatch: %lu != %lu", + prototypePaths.size(), rileyPrototypeIds.size()); + TF_VERIFY( + prototypeFlats.size() == 0 || + prototypeFlats.size() == rileyPrototypeIds.size(), + "prototypeFlats size mismatch: %lu != %lu", + prototypeFlats.size(), rileyPrototypeIds.size()); + + // For analytic lights only, rileyPrototypeIds may have only a single, + // invalid id. In that case, lightData with a valid shader id is required. + if (rileyPrototypeIds.size() == 1 && + rileyPrototypeIds[0] == riley::GeometryPrototypeId::InvalidId()) { + TF_VERIFY(isLight, + "When called with a single invalid " + "prototype id, a light shader id is required"); + } + + instancesNeedUpdate = _RemoveDeadInstances(riley, prototypePrimPath, + rileyPrototypeIds) || instancesNeedUpdate; + + std::vector<_InstanceData> instances; + + // hydraPrototypeId corresponds to the hydra prototype, which might be a + // child instancer. prototypePrimPath corresponds to the prim represented by + // the rileyPrototypeIds, which could be a child instancer or prototype + // geometry. In most cases, they are equal: + // 1. Both paths are the same, and point to a geometry prim that is one of + // this instancer's prototypes and has already been represented in riley + // during GPrim::Sync(), resulting in the ids in rileyPrototypeIds which + // are all of a non-group primType; or + // 2. Both paths are the same, and point to a child instancer prim that is + // this instancer's prototype and has already been represented in riley + // by the child instancer, resulting in the ids in rileyPrototypeIds + // which are all of primType "Group". + // They differ only when the prototype is an instancer and that instancer + // was too deep to put its riley instances into a group. In that case, + // hydraPrototypeId will be the instancer below, while prototypePrimPath + // will be the prototype prim path originally given to Populate, because + // that's the prim represented by the rileyPrototypeIds we've been given. + // We need the former to retrieve instance indices, params, and + // transforms for the nested instancer prototype, while we use the latter to + // track our riley instances and their prototype ids in _protoMap and + // retrieve USD primvars affecting the prototype. + + // We might receive no instances from the too-deep nested instacer, because + // the nested instancer no longer has any instances of this prototype. In + // that case, we should not make any instances of this prototype here, and + // delete any we already have. + + if (hydraPrototypeId == prototypePrimPath || subInstances.size() > 0) { + _ComposeInstances(hydraPrototypeId, subInstances, instances); + } + + // TODO: if depth *decreases*, how will no-longer-too-deep-child signal its + // parent to release the flattened instances? + + // Check for flattening based on env setting or depth. When this instancer + // is too deeply nested for riley nesting support, or when riley nesting + // is disabled, we need to pass the bag of composed instances that this + // instancer would have pushed to riley up to the parent instancer instead. + // The parent instancer will then duplicate each instance in the bag once + // for each instance it's expected to generate, effectively multiplying this + // instancer's instances by its own. + if (parentInstancer && + (TfGetEnvSetting(HD_PRMAN_DISABLE_NESTED_INSTANCING) || + depth > HDPRMAN_MAX_SUPPORTED_NESTING_DEPTH)) { + + // TODO: Instancer params? + + // Ensure the protoMap is clear of instances (perhaps depth increased?) + _ResizeProtoMap(riley, prototypePrimPath, rileyPrototypeIds, 0); + + // Sample this instancer's transform. The instance transforms do not + // include it. We must multiply the instance transforms by this + // instancer's transform. + HdTimeSampleArray xf; + delegate->SampleInstancerTransform(instancerId, &xf); + for (_InstanceData& instance : instances) { + instance.transform = _MultiplyTransforms( + instance.transform, xf); + } + + // Send allInstances up to the parent to populate + parentInstancer->_PopulateInstancesFromChild( + renderParam, + dirtyBits, + instancerId, + prototypePrimPath, + rileyPrototypeIds, + coordSysList, + prototypeParams, + prototypeXform, + rileyMaterialIds, + prototypePaths, + lightShaderId, + instances, + { } + ); + return; + } + + if (instancesNeedUpdate) { + // Allocate the protoMap; this deletes instances if instances is empty + _ResizeProtoMap(riley, prototypePrimPath, rileyPrototypeIds, instances.size()); + } + + if (instancesNeedUpdate && instances.size() > 0) { + + // Finalize the prototype-derived params & flats + std::vector protoParams; + std::vector<_FlattenData> protoFlats; + std::vector protoRenderTags; + + _ComposePrototypeData( + prototypePrimPath, + prototypeParams, + isLight, + rileyPrototypeIds, + prototypePaths, + prototypeFlats, + protoParams, + protoFlats, + protoRenderTags); + + // Prepare each instance to be sent to riley + _ParallelFor(instances.size(), [&](size_t i) { + const _InstanceData& instance = instances[i]; + + // Multiply the prototype transform by the instance transform. If + // this is a top-level instancer with no parent, the instance + // transform already includes the instancer transform. If this + // instancer is nested, the instance transform does not include the + // instancer transform; it will be supplied to the parent + // instancer separately. + _RtMatrixSA xform = _MultiplyTransforms( + prototypeXform, instance.transform); + + // Convert the matrix array to riley's Transform type + const riley::Transform rileyXform = { + unsigned(xform.count), + xform.values.data(), + xform.times.data() + }; + + // If the hydra prototype prim consists of multiple riley + // prototypes (e.g., in the case of GeomSubsets), we must make + // one riley instance for each riley prototype + for (size_t j = 0; j < rileyPrototypeIds.size(); ++j) { + // This is expected to be InvalidId for analytic lights + const riley::GeometryPrototypeId& protoId = + rileyPrototypeIds[j]; + + riley::MaterialId matId = rileyMaterialIds[j]; + RtParamList params = instance.params; // a copy + // Merge in params derived from the hydra prototype prim, which + // are stronger than the instance-derived ones. We use Update + // so that the prototype-derived params will overwrite the + // instance-derived ones. + params.Update(protoParams[j]); + + // append subset name to stats:identifier + if (prototypePaths[j] != hydraPrototypeId) { + std::string protoName = TfStringPrintf( + "{%s}", prototypePaths[j].GetName().c_str()); + RtUString sid; + if (params.GetString(RixStr.k_stats_identifier, sid)) { + std::string sidStr(sid.CStr()); + if (sidStr.find(protoName) == sidStr.npos) { + sid = RtUString( + (std::string(sid.CStr()) + protoName).c_str()); + params.SetString(RixStr.k_stats_identifier, sid); + } + } + } + + // compose the final flats + _FlattenData flats = instance.flattenData; // a copy + + // Merge the visibility params derived from the hydra + // prototype prim. Because these are either present (and set to + // 0, indicating invisibility) or absent, we use Inherit to + // obtain the logical OR superset of present params. Inherit + // also merges the light linking categories. + flats.Inherit(protoFlats[j]); + + // Acquire the id of the prototype group that will house + // all instances that share this specific set of flatten data. + // This group id will be InvalidId when there is no parent + // instancer. + riley::GeometryPrototypeId groupId; + anyGroupIdChanged |= _AcquireGroupId(param, flats, groupId); + + if (!parentInstancer) { + // If there is no parent, we can safely set the params + // we've been tracking separately in the FlattenData + // structure on the instances we're about to make in riley. + // We use Update because these should not exist yet. + params.Update(flats.params); + // And set the appropriate params based on our collected + // light linking categories. + param->ConvertCategoriesToAttributes( + instancerId, + { flats.categories.cbegin(), flats.categories.cend() }, + params); + } + + // Retrieve the riley instance id + _RileyInstanceId& instId = _protoMap.get(prototypePrimPath) + .map[protoId][i]; + + // Check if the instance already exists, and if so, whether + // it was created in the right prototype group. We can reuse the + // riley instance id only if the group id and geometry prototype + // id have not changed. We only need to check the group id; + // protomap structure guarantees the prototype id is unchanged. + if (instId.geoInstanceId != riley::GeometryInstanceId::InvalidId() + && instId.groupId != groupId) { + // the instanceId is valid but the groupId is different + riley->DeleteGeometryInstance( + instId.groupId, instId.geoInstanceId); + _groupCounters.get(instId.groupId)--; + instId.geoInstanceId = riley::GeometryInstanceId::InvalidId(); + } + if (instId.lightInstanceId != riley::LightInstanceId::InvalidId() + && instId.groupId != groupId) { + // the instanceId is valid but the groupId is different + riley->DeleteLightInstance( + instId.groupId, instId.lightInstanceId); + _groupCounters.get(instId.groupId)--; + instId.lightInstanceId = riley::LightInstanceId::InvalidId(); + } + + instId.groupId = groupId; + _groupCounters.get(instId.groupId)++; + + // Now we branch based on whether we're dealing with lights + // or geometry + + // XXX: The stats userId will not be unique in the case of + // nested instancing, but this approach preserves prior + // behavior in the unnested case. + + const SdfPath instancePath = delegate->GetScenePrimPath( + prototypePaths[j], i, nullptr); + riley::UserId userId = riley::UserId( + stats::AddDataLocation(instancePath.GetText()).GetValue()); + + if (lightShaderId != riley::LightShaderId::InvalidId()) { + + // XXX: Temporary workaround for RMAN-20704 + // Destroy the light instance so it will be recreated instead + // of being updated, since ModifyLightInstance may crash. + + if (instId.lightInstanceId != riley::LightInstanceId::InvalidId()) { + riley->DeleteLightInstance( + instId.groupId, instId.lightInstanceId); + instId.lightInstanceId = riley::LightInstanceId::InvalidId(); + } + // XXX: End of RMAN-20704 workaround + + if (instId.lightInstanceId == riley::LightInstanceId::InvalidId()) { + TRACE_SCOPE("riley::CreateLightInstance"); + instId.lightInstanceId = riley->CreateLightInstance( + userId, + instId.groupId, + protoId, + matId, + lightShaderId, + coordSysList, + rileyXform, + params); + } else if (*dirtyBits) { + TRACE_SCOPE("riley::ModifyLightInstance"); + riley->ModifyLightInstance( + instId.groupId, + instId.lightInstanceId, + &matId, + &lightShaderId, + &coordSysList, + &rileyXform, + ¶ms); + } + } else { + // Very last thing: prepend renderTag to grouping:membership + param->AddRenderTagToGroupingMembership( + protoRenderTags[j], params); + if (instId.geoInstanceId == riley::GeometryInstanceId::InvalidId()) { + TRACE_SCOPE("riley::CreateGeometryInstance"); + instId.geoInstanceId = riley->CreateGeometryInstance( + userId, + instId.groupId, + protoId, + matId, + coordSysList, + rileyXform, + params); + } else if (*dirtyBits) { + TRACE_SCOPE("riley::ModifyGeometryInstance"); + riley->ModifyGeometryInstance( + instId.groupId, + instId.geoInstanceId, + &matId, + &coordSysList, + &rileyXform, + ¶ms); + } + } + } + }); + + // We have now fully processed all changes from the last time the + // instancer was synced down to the riley instances for this particular + // hydra prototype prim. + _protoMap.get(prototypePrimPath).dirty = false; + } + + // clean up disused prototype groups + anyGroupIdChanged |= _CleanDisusedGroupIds(param); + + if (parentInstancer && (anyGroupIdChanged || + HdChangeTracker::IsInstancerDirty(*dirtyBits, instancerId))) { + // Now we need to tell the parent instancer to make geometry instances + // of my groups (my groups, my groups, my lovely proto groups). + + // Sample this instancer's transform. The instance transforms did not + // include it. The parent instancer will instead include it on the + // instances it makes of this instancer's prototype groups. + HdTimeSampleArray xf; + delegate->SampleInstancerTransform(instancerId, &xf); + + // Get this instancer's params + const RtParamList instancerParams = param->ConvertAttributes( + delegate, instancerId, false); + + // Build the lists of flatten groups and prototype group ids, and + // prototype prim paths and material ids, these latter two all being + // the same for each group. + std::vector<_FlattenData> flats; + std::vector ids; + std::vector mats; + SdfPathVector paths; + _groupMap.citerate([&](const _FlattenData& fd, const riley::GeometryPrototypeId& gp) { + flats.push_back(fd); + ids.push_back(gp); + paths.push_back(instancerId); + mats.push_back(riley::MaterialId::InvalidId()); + }); + + // Populate the parent using _PopulateInstancesFromChild so that we can + // pass the flatten groups up to it. + parentInstancer->_PopulateInstancesFromChild( + renderParam, + dirtyBits, + instancerId, + instancerId, + ids, + coordSysList, + instancerParams, + xf, + mats, + paths, + // If this prototype was a light and we made light instances in a + // geometry prototype group, we want the parent instancer to make + // *geometry* instances of those geometry prototype groups. So we + // pass the invalid light shader id to it. + riley::LightShaderId::InvalidId(), + { }, + flats); + } +} + +void +HdPrmanInstancer::_ComposeInstances( + const SdfPath& protoId, + const std::vector<_InstanceData>& subInstances, + std::vector<_InstanceData>& instances) +{ + HD_TRACE_FUNCTION(); + // XXX: Using riley nested instancing breaks selection. Selection depends on + // enumerating every instance of a given hydra geometry prototype prim with + // a unique id and setting that id in riley as identifier:id2. When using + // riley prototype groups, there is no longer a 1:1 correspondence between + // hydra instances of a given prototype and riley instances. If instance + // picking and selection are required, users should disable riley nested + // instancing by setting HD_PRMAN_DISABLE_NESTED_INSTANCING=1. In future, + // we may consider adding an instancer id AOV to the picking and selection + // flow to support precise instance disambiguation. + + HdSceneDelegate* delegate = GetDelegate(); + const SdfPath& id = GetId(); + const VtIntArray indices = delegate->GetInstanceIndices(id, protoId); + instances.clear(); + if (subInstances.empty()) { + instances.resize(indices.size()); + _ParallelFor(indices.size(), [&](size_t i) { + const int index = indices[i]; + _InstanceData& instance = instances[i]; + _GetInstanceParams(index, instance.params); + instance.params.SetInteger(RixStr.k_identifier_id2, int(i)); + _BuildStatsId(id, index, protoId, instance.params); + _ComposeInstanceFlattenData(index, instance.params, instance.flattenData); + _GetInstanceTransform(index, instance.transform); + }); + } else { + instances.resize(indices.size() * subInstances.size()); + // Iteration order is critical to selection. identifier:id2 must + // increment in subInstance-major order. So we slow-iterate through + // this level's instances and fast-iterate through the subInstances. + // Note: Just to express things as clearly as possible, since this is + // a parallel loop as written now, it is actually the choice of index + // for the identifier:id2 parameter and the ordering of the *indexing* + // that is critical: the parallel for loop is free to set the values + // in whatever temporal order is most efficient/fastest, as long as the + // choice we make for the value of identifier:id2 is the same. + _ParallelFor(indices.size() * subInstances.size(), [&](size_t ii) { + const size_t i = ii / subInstances.size(); + const size_t index = indices[i]; + const size_t si = ii % subInstances.size(); + const _InstanceData& subInstance = subInstances[si]; + _InstanceData& instance = instances[ii]; + _GetInstanceParams(index, instance.params); + instance.params.Update(subInstance.params); + instance.params.SetInteger(RixStr.k_identifier_id2, int(ii)); + _BuildStatsId(id, index, protoId, instance.params); + _ComposeInstanceFlattenData( + index, + instance.params, + instance.flattenData, + subInstance.flattenData); + _GetInstanceTransform( + index, + instance.transform, + subInstance.transform); + }); + } +} + +void +HdPrmanInstancer::_ComposeInstanceFlattenData( + const size_t instanceId, + RtParamList& instanceParams, + _FlattenData& fd, + const _FlattenData& fromBelow) +{ + _FlattenData instance; + if (instanceId < _instanceCategories.size()) { + instance = _FlattenData(_instanceCategories[instanceId]); + } + + // Capture fine-grained visibility that may have been authored on the point + // instancer as instance-varying USD primvars or the native instance; remove + // these from instanceParams if they exist. + instance.UpdateVisAndFilterParamList(instanceParams); + + fd.Update(_instancerFlat); + fd.Update(instance); + fd.Update(fromBelow); +} + +bool +HdPrmanInstancer::_RemoveDeadInstances( + riley::Riley* riley, + const SdfPath& prototypePrimPath, + const std::vector& protoIds) +{ + HD_TRACE_FUNCTION(); + // Can't do anything with an empty path + if (prototypePrimPath.IsEmpty()) { return false; } + // Check if the protoMap has this path in it first; + // otherwise the call to get() will insert it. + if (!_protoMap.has(prototypePrimPath)) { return false; } + using ProtoMapPair = std::pair; + const _ProtoInstMap& protoMap = _protoMap.get(prototypePrimPath).map; + std::vector oldProtoIds; + std::transform( + protoMap.begin(), protoMap.end(), + std::back_inserter(oldProtoIds), + [](const ProtoMapPair& pair) { return pair.first; }); + std::vector newProtoIds( + protoIds.begin(), protoIds.end()); + + std::sort(oldProtoIds.begin(), oldProtoIds.end()); + std::sort(newProtoIds.begin(), newProtoIds.end()); + + std::vector toRemove; + std::set_difference( + oldProtoIds.cbegin(), oldProtoIds.cend(), + newProtoIds.cbegin(), newProtoIds.cend(), + std::back_inserter(toRemove)); + if (toRemove.size() > 0) { + _ResizeProtoMap(riley, prototypePrimPath, toRemove, 0); + } + + // returns true if there are new geometry prototype ids for this prototype + std::vector toAdd; + std::set_difference( + protoIds.cbegin(), protoIds.cend(), + oldProtoIds.cbegin(), oldProtoIds.cend(), + std::back_inserter(toAdd)); + return toAdd.size() > 0; +} + +void +HdPrmanInstancer::_ComposePrototypeData( + const SdfPath& protoPath, + const RtParamList& globalProtoParams, + const bool isLight, + const std::vector& protoIds, + const SdfPathVector& subProtoPaths, + const std::vector<_FlattenData>& subProtoFlats, + std::vector& protoParams, + std::vector<_FlattenData>& protoFlats, + std::vector& protoRenderTags) +{ + HD_TRACE_FUNCTION(); + HdSceneDelegate* delegate = GetDelegate(); + + auto SetProtoParams = [&]( + const SdfPath& protoPath, + RtParamList& params, + _FlattenData& flats) + { + params = globalProtoParams; // copy + _GetPrototypeParams(protoPath, params); + const VtTokenArray& cats = delegate->GetCategories(protoPath); + flats.categories.insert(cats.begin(), cats.end()); + flats.UpdateVisAndFilterParamList(params); // filters out flatten params + + // XXX: Temporary workaround form RMAN-20703 + if (isLight) { + // Due to limitations in Prman, we currently cannot put light + // instances and geometry instances in the same prototype group. To + // force the instancer to separate them, we will make use of + // _FlattenData::params, the RtParamList we ordinarily just use for + // flattening visibility params up the instancing hierarchy. For + // lights, we will set a marker param in the flatten group's + // param list that will distinguish the flatten group from an + // otherwise identical one for geometry. The name we use is not + // important, so long as it has no meaning to riley. + // + // We only set this marker param here, and it is never read + // except when computing the flatten group's hash, when it is + // picked up by the RtParamList hash functor. + // + // See https://jira.pixar.com/browse/RMAN-20703 + flats.params.SetInteger(RtUString("__light"), 1); + } + // XXX: End of RMAN-20703 workaround + }; + + // Make at least one set, even when there are no prototype ids, + // to cover analytic lights. + const size_t count = std::max(size_t(1), protoIds.size()); + + protoParams.resize(count); + protoFlats.resize(count); + protoRenderTags.resize(count); + + for (size_t i = 0; i < count; ++i) { + SetProtoParams(protoPath, protoParams[i], protoFlats[i]); + if (!isLight) { + protoRenderTags[i] = delegate->GetRenderTag(protoPath); + } + + // If prototype is a subset, also get the subset params. While geom + // subsets should not have USD primvars on them, they may be the targets + // of light linking and thus have categories to deal with. They may also + // receive visibility params as part of Hydra's handling of invisible + // faces, even though visibility cannot be authored on them in USD. + // XXX: All that is changing in hydra 2, where subsets will be able to + // have primvars, visibility, and purpose! + if (i < subProtoPaths.size() && subProtoPaths[i] != protoPath) { + RtParamList subsetParams; + _FlattenData subsetFlats; + SetProtoParams(subProtoPaths[i], subsetParams, subsetFlats); + protoParams[i].Update(subsetParams); + protoFlats[i].Update(subsetFlats); + } + + // Combine any flats received from below for this prototype. + if (i < subProtoFlats.size()) { + protoFlats[i].Update(subProtoFlats[i]); + } + } +} + +void +HdPrmanInstancer::_ResizeProtoMap( + riley::Riley* riley, + const SdfPath& prototypePrimPath, + const std::vector& rileyPrototypeIds, + const size_t newSize) +{ + HD_TRACE_FUNCTION(); + _ProtoInstMap& protoInstMap = _protoMap.get(prototypePrimPath).map; + for (riley::GeometryPrototypeId protoId : rileyPrototypeIds) { + _InstanceIdVec& instIdVec = protoInstMap[protoId]; + const size_t oldSize = instIdVec.size(); + if (newSize < oldSize) { + // XXX: We loop over the range [newSize, oldSize), for a total of + // (oldSize - newSize) elements. + _ParallelFor(oldSize - newSize, [&](size_t ii) { + size_t i = ii + newSize; // Offset the index by 'newSize' + const _RileyInstanceId& id = instIdVec[i]; + if (id.lightInstanceId != riley::LightInstanceId::InvalidId()) { + riley->DeleteLightInstance(id.groupId, id.lightInstanceId); + _groupCounters.get(id.groupId)--; + } + if (id.geoInstanceId != riley::GeometryInstanceId::InvalidId()) { + riley->DeleteGeometryInstance(id.groupId, id.geoInstanceId); + _groupCounters.get(id.groupId)--; + } + }); + } + if (oldSize != newSize) { + instIdVec.resize(newSize); + } + if (newSize == 0) { + protoInstMap.erase(protoId); + } + } + if (protoInstMap.size() == 0) { + _protoMap.erase(prototypePrimPath); + } +} + +bool +HdPrmanInstancer::_CleanDisusedGroupIds(HdPrman_RenderParam* param) +{ + HD_TRACE_FUNCTION(); + tbb::spin_rw_mutex::scoped_lock lock(_groupIdAcquisitionLock, true); + riley::Riley* riley = param->AcquireRiley(); + + // Gather active and disused + std::vector<_FlattenData> toDestroy; + std::unordered_set active; + _groupMap.citerate([&](const _FlattenData& fd, const riley::GeometryPrototypeId& gp){ + if (gp != riley::GeometryPrototypeId::InvalidId()) { + if (_groupCounters.get(gp).load() < 1) { + toDestroy.push_back(fd); + } else { + active.insert(gp); + } + } + }); + // If there are groups to remove and a parent instancer, depopulate the + // parent preserving the still-active groups + if (toDestroy.size() > 0) { + HdPrmanInstancer* parent = _GetParentInstancer(); + if (parent) { + parent->Depopulate(param, GetId(), + { active.cbegin(), active.cend() }); + } + } + // Destroy the disused prototype groups + for (const _FlattenData& fd : toDestroy) { + riley::GeometryPrototypeId& groupId = _groupMap.get(fd); + if (groupId != riley::GeometryPrototypeId::InvalidId()) { + riley->DeleteGeometryPrototype(groupId); + groupId = riley::GeometryPrototypeId::InvalidId(); + } + _groupMap.erase(fd); + _groupCounters.erase(groupId); + } + // Return true if any were destroyed + return toDestroy.size() > 0; +} + +bool +HdPrmanInstancer::_AcquireGroupId( + HdPrman_RenderParam* param, + const _FlattenData& flattenGroup, + riley::GeometryPrototypeId& groupId) +{ + HD_TRACE_FUNCTION(); + // Bail before locking if there's no parent instancer + if (_Depth() == 0) { + groupId = riley::GeometryPrototypeId::InvalidId(); + return false; + } + + // This lock prevents concurrent calls to Populate from creating separate + // riley groups for the same set of flatten data. + tbb::spin_rw_mutex::scoped_lock lock(_groupIdAcquisitionLock, false); + + // We use the flatten data to look up whether this instancer has + // a riley group that it will use for all instances across all + // prototypes that will share that flatten data. When this instancer + // tells its parent instancer to make instances of its riley prototype + // groups, it will also tell the parent to set the params that make up + // the flatten data on those instances (or pass them along to *its* + // parent if it is not the outermost instancer). Using the hashable + // FlattenData structure as the key to identify a group id allows us to + // take maximal advantage of prman's support for nested instancing while + // still preserving any incompatable params we may encounter. + // + // In short, If the instancer detects variability in the flatten data + // across its instances, it will put them into separate buckets. + + groupId = _groupMap.get(flattenGroup); + if (groupId == riley::GeometryPrototypeId::InvalidId()) { + + bool found = false; + if (!lock.upgrade_to_writer()) { + groupId = _groupMap.get(flattenGroup); + if (groupId != riley::GeometryPrototypeId::InvalidId()) + found = true; + } + + if (!found) { + RtPrimVarList groupPrimvars; + groupPrimvars.SetString(RixStr.k_stats_prototypeIdentifier, + RtUString(GetId().GetText())); + groupId = param->AcquireRiley()->CreateGeometryPrototype( + riley::UserId(stats::AddDataLocation(GetId().GetText()).GetValue()), + RixStr.k_Ri_Group, + riley::DisplacementId::InvalidId(), + groupPrimvars); + _groupMap.set(flattenGroup, groupId); + return true; + } + } + return false; +} + +HdPrmanInstancer* +HdPrmanInstancer::_GetParentInstancer() +{ + // XXX: There is no way of knowing at this stage whether a native instancer + // is part of a prototype of another instancer, and thus no way to access + // the parent instancer for a native instancing-backed HdInstancer. This + // will always return nullptr under native instancing, so native instancing + // always produces full flattening in riley and takes no advantage of + // nesting. + // + // Note that it is possible for instancers to have multiple parent + // instancers! UsdImaging currently hides this behind instancer id munging + // for point instancers, while native instancers do not propagate parent + // data to hydra at all, so for now we assume only a single parent. + + HdSceneDelegate* delegate = GetDelegate(); + HdRenderIndex& renderIndex = delegate->GetRenderIndex(); + SdfPath parentId = GetParentId(); + while (!parentId.IsEmpty() && !parentId.IsAbsoluteRootPath()) { + HdPrmanInstancer* instancer = static_cast( + renderIndex.GetInstancer(parentId)); + if (instancer) { + return instancer; + } else { + parentId = parentId.GetParentPath(); + } + } + return nullptr; +} + +int +HdPrmanInstancer::_Depth() +{ + // XXX: Since there is no way to tell if a native instancer has any parent + // instancers, this will always return depth 0 for native instancing. Also + // note that while it is technically possible for an instancer to have + // multiple parent instancers, and multple depths along various paths to + // its outermost ancestor instancers, assuming a single depth works for now + // thanks to limitations imposed by UsdImaging. + + int depth = 0; + HdPrmanInstancer* parent = _GetParentInstancer(); + while (parent) { + depth++; + parent = parent->_GetParentInstancer(); + } + return depth; +} + +void +HdPrmanInstancer::_GetInstanceParams( + const size_t instanceIndex, + RtParamList& params) +{ + for (auto entry: _primvarMap) { + const HdPrimvarDescriptor& primvar = entry.second.desc; + + // 'constant' and 'uniform' USD primvars are inherited in toto by + // instances, while 'varying', 'vertex', and 'faceVarying' USD primvars + // (and those marked as instance-rate by hydra) are inherited per + // instance by indexing into the value array. + // See https://tinyurl.com/hdxya2yk. + + bool isConstantRate = primvar.interpolation == HdInterpolationConstant + || primvar.interpolation == HdInterpolationUniform; + + // Confirm that instance-rate USD primvars are array-valued and have + // sufficient dimensions. + VtValue val = entry.second.value; // *not* a reference! + if ((!isConstantRate) && (instanceIndex >= val.GetArraySize())) { + TF_WARN("HdPrman: Instance-rate USD primvar has array size %zu; " + "cannot provide a value for instance index %zu\n", + val.GetArraySize(), instanceIndex); + continue; + } + + // If the interpolation is not constant or uniform and the value is + // an array, extract just the value of interest. + if ((!isConstantRate) && val.IsArrayValued()) { + val = VtVisitValue(val, _GetValueAtIndex(instanceIndex)); + } + + const RtUString name = _FixupParamName(entry.first); + + // USD primvars in the "ri:attributes" and "primvars:ri:attributes" + // namespaces end up having the same fixed-up param name, potentially + // causing collisions in the param list. When both "ri:attributes" and + // "primvar:ri:attributes" versions of the same USD primvar exist, the + // "primvar:ri:attributes" version should win out. + if (TfStringStartsWith(entry.first.GetString(), "ri:attributes:") && + params.HasParam(name)) { + continue; + } + if (!HdPrman_Utils::SetParamFromVtValue( + name, val, primvar.role, ¶ms)) { + TF_WARN("Unrecognized USD primvar value type at %s.%s", + GetId().GetText(), entry.first.GetText()); + } + } +} + +void +HdPrmanInstancer::_GetPrototypeParams( + const SdfPath& protoPath, + RtParamList& params) +{ + // XXX: With the scene index enabled (Hydra 2.0), this fails to find + // constant inherited USD primvars, but picks up displayColor and + // displayOpacity, even when those are not authored anywhere on or + // above the target prototype. + + HdSceneDelegate* delegate = GetDelegate(); + // Only get constant and uniform USD primvars + for (HdInterpolation i = HdInterpolationConstant; + i < HdInterpolationVarying; i = HdInterpolation(i+1)) { + for (const HdPrimvarDescriptor& primvar : + delegate->GetPrimvarDescriptors(protoPath, i)) { + const RtUString name = _FixupParamName(primvar.name); + + // USD primvars in the "ri:attributes" and "primvars:ri:attributes" + // namespaces end up having the same fixed-up param name, potentially + // causing collisions in the param list. When both "ri:attributes" and + // "primvar:ri:attributes" versions of the same USD primvar exist, the + // "primvar:ri:attributes" version should win out. + if (TfStringStartsWith(primvar.name.GetString(), "ri:attributes") && + params.HasParam(name)) { + continue; + } + const VtValue& val = delegate->Get(protoPath, primvar.name); + if (!HdPrman_Utils::SetParamFromVtValue( + name, val, primvar.role, ¶ms)) { + TF_WARN("Unrecognized USD primvar value type at %s.%s", + protoPath.GetText(), primvar.name.GetText()); + } + } + } +} + +void +HdPrmanInstancer::_GetInstanceTransform( + const size_t instanceIndex, + _GfMatrixSA& xform, + const _GfMatrixSA& left) +{ + if (_sa.count > 0 && instanceIndex < _sa.values[0].size()) { + if (left.count > 0) { + _GfMatrixSA right; + _AccumulateSampleTimes(_sa, right); + for (size_t i = 0; i < right.count; ++i) { + right.values[i] = _sa.values[i][instanceIndex]; + } + _AccumulateSampleTimes(left, xform); + _AccumulateSampleTimes(right, xform); + for (size_t i = 0; i < xform.count; ++i) { + const float t = xform.times[i]; + xform.values[i] = left.Resample(t) * right.Resample(t); + } + } else { + _AccumulateSampleTimes(_sa, xform); + for (size_t i = 0; i < xform.count; ++i) { + xform.values[i] = _sa.values[i][instanceIndex]; + } + } + } +} + +PXR_NAMESPACE_CLOSE_SCOPE diff --git a/third_party/renderman-26/plugin/hdPrman/instancer.h b/third_party/renderman-26/plugin/hdPrman/instancer.h new file mode 100644 index 0000000000..e9b3c34f6f --- /dev/null +++ b/third_party/renderman-26/plugin/hdPrman/instancer.h @@ -0,0 +1,675 @@ +// +// Copyright 2023 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// +#ifndef EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_INSTANCER_H +#define EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_INSTANCER_H + +#include "pxr/pxr.h" + +#include "hdPrman/renderParam.h" +#include "hdPrman/rixStrings.h" + +#include "pxr/imaging/hd/instancer.h" +#include "pxr/imaging/hd/sceneDelegate.h" +#include "pxr/imaging/hd/timeSampleArray.h" +#include "pxr/base/tf/hashmap.h" +#include "pxr/base/tf/token.h" +#include "pxr/base/vt/types.h" +#include "pxr/base/vt/value.h" + +#include "tbb/concurrent_unordered_map.h" +#include "tbb/spin_rw_mutex.h" + +PXR_NAMESPACE_OPEN_SCOPE + +class HdPrmanInstancer : public HdInstancer +{ + +public: + + HdPrmanInstancer(HdSceneDelegate* delegate, SdfPath const& id); + + /// Destructor. + ~HdPrmanInstancer(); + + void Sync(HdSceneDelegate *sceneDelegate, + HdRenderParam *renderParam, + HdDirtyBits *dirtyBits) override; + + void Finalize(HdRenderParam *renderParam) override; + + HdDirtyBits GetInitialDirtyBitsMask() const override; + + /** + * @brief Instructs the instancer to generate riley instances for the given + * prototypes. Caller is responsible for the lifecycle of the riley + * prototypes, while the instancer will own the riley instances. This should + * only be called with all of the riley prototypes associated with a given + * hydra prototype path. + * + * @param renderParam + * @param dirtyBits The hydra prototype's dirty bits. + * @param hydraPrototypeId The path of the hydra prototype prim. + * @param rileyPrototypeIds The riley geometry prototype ids associated with + * this hydra prototype prim. There may be more than one, in the case + * of geomSubsets, or when a child instancer has more than one + * prototype group. If this is empty, all previously-populated + * instances associated with this hydraPrototypeId will be destroyed. + * It should not contain invalid prototype ids unless the hydra + * prototype is an analytic light, in which case it must contain + * exactly one invalid geometry prototype id. + * @param coordSysList The coordinate system list for the hydra prototype. + * @param protoParams The riley instance params derived from the hydra + * prototype. These will be applied to every riley instance except + * where they are overridden by riley instance params derived from + * the instancer. This collection may include visibility params, but + * should not include params used for light linking. These latter + * params will be derived by direct query of the scene delegate + * using hydraPrototypeId (or the appropriate prototypePrimPath, see + * below), and will be ignored and overwritten if they are present + * here. For a full list, see _GetLightLinkParams + * @param protoXform The transform of the hydra prototype prim relative to + * the parent of the prototype root. This will be applied to the + * riley instances first, before the transform derived from the + * instancer's instancing mechanism or the instancer's own transform. + * @param rileyMaterialIds The riley material ids to be assigned to the + * instances of each of the supplied riley prototypes; this should + * match rileyPrototypeIds in length and indexing. + * @param prototypePaths The stage paths of the (sub)prims each riley + * prototype id represents, e.g., the stage paths to the geomSubsets; + * this should always match prototypeIds in length and indexing. + * These are used for identification purposes and, when they are + * different from hydraPrototypeId, for retrieving light-linking + * categories, so they should (ideally) not be proxy paths. + * @param lightShaderId (optional) The riley light shader id associated with + * this hydra prototype. When this is provided, we assume the hydra + * prototype prim is a light. When this is provided, + * rileyPrototypeIds must either have the geometry prototype id(s) + * for a mesh light or have a single invalid id for an analytic light. + */ + void Populate( + HdRenderParam* renderParam, + HdDirtyBits* dirtyBits, + const SdfPath& hydraPrototypeId, + const std::vector& rileyPrototypeIds, + const riley::CoordinateSystemList& coordSysList, + const RtParamList protoParams, + const HdTimeSampleArray protoXform, + const std::vector& rileyMaterialIds, + const SdfPathVector& prototypePaths, + const riley::LightShaderId& lightShaderId = riley::LightShaderId::InvalidId()); + + /** + * @brief Instructs the instancer to destroy any riley instances for the + * given hydra prototype prim path, optionally preserving those instances of + * a given list of prototype ids. + * + * @param renderParam + * @param prototypePrimPath The path of the hydra prototype. + * @param excludedPrototypeIds List of riley prototype ids whose instances + * should be preserved. When empty or not provided, all instances of + * all prototypes for the given prototypePrimPath will be destroyed. + * HdPrmanInstancer itself uses this list to preserve instances of + * its own prototype groups when depopulating some instances from a + * parent instancer. + */ + void Depopulate( + HdRenderParam* renderParam, + const SdfPath& prototypePrimPath, + const std::vector& excludedPrototypeIds = {}); + +private: + + // ********************************************** + // ** Private Types ** + // ********************************************** + + using _GfMatrixSA = HdTimeSampleArray; + using _RtMatrixSA = HdTimeSampleArray; + + struct _RtParamListHashFunctor + { + size_t operator()(const RtParamList& params) const noexcept + { + // Wow this sucks, but RtParamList::Hash() is not const! + RtParamList copy = params; + return std::hash()(copy.Hash()); + } + }; + + struct _RtParamListEqualToFunctor + { + bool operator()(const RtParamList& lhs, const RtParamList& rhs) const noexcept + { + return _RtParamListHashFunctor()(lhs) == _RtParamListHashFunctor()(rhs); + } + }; + + struct _PrimvarValue + { + HdPrimvarDescriptor desc; + VtValue value; + }; + + struct _FlattenData + { + + // The set of light linking categories + std::unordered_set categories; + + // We store visibility in an RtParamList to take advantage of that + // structure's Inherit and Update methods, and because simply storing + // a single boolean would clobber any renderer-specific params that might + // have been authored on a given (native) instance. + RtParamList params; + + _FlattenData() { } + _FlattenData(const VtTokenArray& cats) + : categories(cats.begin(), cats.end()) { } + _FlattenData(const VtTokenArray& cats, bool vis) + : categories(cats.begin(), cats.end()) + { + SetVisibility(vis); + } + // Copy constructor + _FlattenData(const _FlattenData& other) + : categories(other.categories.cbegin(), other.categories.cend()) + { + params.Update(other.params); + } + + // Params that already exist here will not be changed; + // categories will be merged + void Inherit(const _FlattenData& rhs) + { + categories.insert(rhs.categories.cbegin(), rhs.categories.cend()); + params.Inherit(rhs.params); + } + + // Params that already exist here will be changed; + // categories will be merged + void Update(const _FlattenData& rhs) + { + categories.insert(rhs.categories.cbegin(), rhs.categories.cend()); + params.Update(rhs.params); + } + + // Update this FlattenData's visibility from an RtParamList. Visibility + // params that already exist here will be changed; visibility and + // light linking params on the RtParamList will be removed from it. + void UpdateVisAndFilterParamList(RtParamList& other) { + // Move visibility params from the RtParamList to the FlattenData + for (const RtUString& param : _GetVisibilityParams()) { + int val; + if (other.GetInteger(param, val)) { + if (val == 1) { + params.Remove(param); + } else { + params.SetInteger(param, val); + } + other.Remove(param); + } + } + + // Copy any existing value for grouping:membership into the + // flatten data. For lights, this gets a value during light sync, + // and ConvertCategoriesToAttributes specifically handles preserving + // it. We need to capture the value from light sync here so we can + // and flatten against it. It won't be captured by the categories + // because the value set in light sync comes from a different + // source. It has to be handled separately from categories. + RtUString groupingMembership; + if (other.GetString(RixStr.k_grouping_membership, groupingMembership)) { + params.SetString(RixStr.k_grouping_membership, groupingMembership); + } + + // Remove the light linking params from the RtParamList. Not going + // to parse them back out to individual tokens to add to + // the FlattenData categories, as they will be captured elsewhere. + for (const RtUString& param : _GetLightLinkParams()) { + other.Remove(param); + } + } + + // Sets all visibility params, overwriting current values.) + void SetVisibility(bool visible) { + if (visible) { + for (const RtUString& param : _GetVisibilityParams()) { + params.Remove(param); + } + } else { + for (const RtUString& param : _GetVisibilityParams()) { + params.SetInteger(param, 0); + } + } + } + + // equals operator + bool operator==(const _FlattenData& rhs) const noexcept + { + return categories == rhs.categories && + _RtParamListEqualToFunctor()(params, rhs.params); + } + + struct HashFunctor { + size_t operator()(const _FlattenData& fd) const noexcept + { + size_t hash = 0ul; + + // simple order-independent XOR hash aggregation + for (const TfToken& tok : fd.categories) { + hash ^= tok.Hash(); + } + return hash ^ _RtParamListHashFunctor()(fd.params); + } + }; + + private: + static std::vector _GetLightLinkParams() + { + // List of riley instance params pertaining to light-linking that are + // not supported on instances inside geometry prototype groups + static const std::vector LightLinkParams = { + RixStr.k_lightfilter_subset, + RixStr.k_lighting_subset, + RixStr.k_grouping_membership, + RixStr.k_lighting_excludesubset + }; + return LightLinkParams; + } + + static std::vector _GetVisibilityParams() + { + // List of rile instance params pertaining to visibility that are + // not supported on instances inside geometry prototype groups + static const std::vector VisParams = { + RixStr.k_visibility_camera, + RixStr.k_visibility_indirect, + RixStr.k_visibility_transmission + }; + return VisParams; + } + + }; + + struct _InstanceData + { + _FlattenData flattenData; + RtParamList params; + _GfMatrixSA transform; + + _InstanceData() { } + _InstanceData( + const VtTokenArray& cats, + bool vis, + const RtParamList& p, + _GfMatrixSA& xform) + : transform(xform) + { + params.Inherit(p); + } + }; + + // A simple concurrent hashmap built from tbb::concurrent_unordered_map but + // with a simpler interface. Thread-safe operations (insertion, retrieval, + // const iteration) happen under a shared_lock, while unsafe operations + // (erase, clear, non-const iteration) use an exclusive lock. This way, the + // thread-safe operations can all run concurrently with one another, relying + // on tbb::concurrent_unordered_map's thread safety, but will never run + // while an unsafe operation is in progress, nor will the unsafe operations + // start while a safe one is running. + template< + typename Key, + typename T, + typename Hash = std::hash, + typename KeyEqual = std::equal_to> + class _LockingMap + { + public: + // Check whether the map contains the given key; check this call before + // calling get() if you want to avoid get's auto-insertion. + bool has(const Key& key) const + { + tbb::spin_rw_mutex::scoped_lock lock(_mutex, false); + if (_map.size() == 0) { return false; } + return _map.find(key) != _map.end(); + } + + // Retrieve the value for the given key. If the key is not present in + // the map, a default-constructed value will be inserted and returned. + // T must have default constructor + T& get(const Key& key) + { + static_assert(std::is_default_constructible::value, + "T must be default constructible"); + + tbb::spin_rw_mutex::scoped_lock lock(_mutex, false); + auto it = _map.find(key); + if (it == _map.end()) { + it = _map.emplace( + std::piecewise_construct, + std::forward_as_tuple(key), + std::tuple<>{}).first; + } + return it->second; + } + + // Set key to value, returns true if the key was newly inserted + // T must have copy assignment operator + bool set(const Key& key, T& val) + { + static_assert(std::is_copy_assignable::value, + "T must be copy-assignable"); + + tbb::spin_rw_mutex::scoped_lock lock(_mutex, false); + if (_map.size() > 0) { + auto it = _map.find(key); + if (it != _map.end()) { + it->second = val; + return false; + } + } + _map.insert({key, val}); + return true; + } + + // Iterate the map with a non-const value reference under exclusive lock + void iterate(std::function fn) + { + // exclusive lock + tbb::spin_rw_mutex::scoped_lock lock(_mutex, true); + for (std::pair& p : _map) { + fn(p.first, p.second); + } + } + + // Iterate the map with a const value reference under shared lock + void citerate(std::function fn) const + { + tbb::spin_rw_mutex::scoped_lock lock(_mutex, false); + for (const std::pair& p : _map) { + fn(p.first, p.second); + } + } + + // Gives the count of keys currently in the map + size_t size() const + { + tbb::spin_rw_mutex::scoped_lock lock(_mutex, false); + return _map.size(); + } + + // Erase the given key from the map under exclusive lock + void erase(const Key& key) + { + // exclusive lock + tbb::spin_rw_mutex::scoped_lock lock(_mutex, true); + _map.unsafe_erase(key); + } + + // Clear all map entries under exclusive lock + void clear() + { + // exclusive lock + tbb::spin_rw_mutex::scoped_lock lock(_mutex, true); + _map.clear(); + } + private: + tbb::concurrent_unordered_map _map; + mutable tbb::spin_rw_mutex _mutex; + }; + + using _LockingFlattenGroupMap = _LockingMap< + _FlattenData, + riley::GeometryPrototypeId, + _FlattenData::HashFunctor>; + + struct _RileyInstanceId + { + riley::GeometryPrototypeId groupId; + riley::GeometryInstanceId geoInstanceId; + riley::LightInstanceId lightInstanceId; + }; + + using _InstanceIdVec = std::vector<_RileyInstanceId>; + + struct _ProtoIdHash + { + size_t operator()(const riley::GeometryPrototypeId& id) const noexcept + { + return std::hash()(id.AsUInt32()); + } + }; + + using _ProtoInstMap = std::unordered_map< + riley::GeometryPrototypeId, + _InstanceIdVec, + _ProtoIdHash>; + + using _LockingProtoGroupCounterMap = _LockingMap< + riley::GeometryPrototypeId, + std::atomic, + _ProtoIdHash>; + + struct _ProtoMapEntry + { + _ProtoInstMap map; + bool dirty; + }; + + using _LockingProtoMap = _LockingMap; + + // ********************************************** + // ** Private Methods ** + // ********************************************** + + // Sync helper; caches instance-rate primvars + void _SyncPrimvars(HdDirtyBits* dirtyBits); + + // Sync helper; caches the instancer and instance transforms + void _SyncTransforms(HdDirtyBits* dirtyBits); + + // Sync helper; caches instance or instancer categories as appropriate + void _SyncCategories(HdDirtyBits* dirtyBits); + + // Sync helper; caches instancer visibility + void _SyncVisibility(HdDirtyBits* dirtyBits); + + // Generates InstanceData structures for this instancer's instances; + // will multiply those by any supplied subInstances + void _ComposeInstances( + const SdfPath& protoId, + const std::vector<_InstanceData>& subInstances, + std::vector<_InstanceData>& instances); + + // Generates FlattenData from a set of instance params by looking for + // incompatible params and moving them from the RtParamList to the + // FlattenData. Called by _ComposeInstances(). + void _ComposeInstanceFlattenData( + const size_t instanceId, + RtParamList& instanceParams, + _FlattenData& fd, + const _FlattenData& fromBelow = _FlattenData()); + + // Generates param sets and flatten data for the given prototype + // prim(s). Starts with copies of the prototype params provided to + // Populate, and additionally captures constant/uniform params inherited + // by the prototype, prototype- and subset-level light linking, and subset + // visibility. + void _ComposePrototypeData( + const SdfPath& protoPath, + const RtParamList& globalProtoParams, + const bool isLight, + const std::vector& protoIds, + const SdfPathVector& subProtoPaths, + const std::vector<_FlattenData>& subProtoFlats, + std::vector& protoParams, + std::vector<_FlattenData>& protoFlats, + std::vector& protoRenderTags); + + // Deletes riley instances owned by this instancer that are of riley + // geometry prototypes that are no longer associated with the given + // prototype prim. Returns true if there are any new riley geometry + // prototype ids to associate with this prototype prim path. + bool _RemoveDeadInstances( + riley::Riley* riley, + const SdfPath& prototypePrimPath, + const std::vector& protoIds); + + // Flags all previously seen prototype prim paths as needing their instances + // updated the next time they show up in a Populate call. + void _SetPrototypesDirty(); + + // Generates instances of the given prototypes according to the instancer's + // instancing configuration. If the instancer is too deep, they get passed + // up to this method on the parent instancer. The given prototypes may be + // prims (when called through the public Populate method) or may be + // child instancers represented by riley geometry prototype groups. In + // either case, the caller owns the riley prototypes. + void _PopulateInstances( + HdRenderParam* renderParam, + HdDirtyBits* dirtyBits, + const SdfPath& hydraPrototypeId, + const SdfPath& prototypePrimPath, + const std::vector& rileyPrototypeIds, + const riley::CoordinateSystemList& coordSysList, + const RtParamList protoParams, + const HdTimeSampleArray protoXform, + const std::vector& rileyMaterialIds, + const SdfPathVector& prototypePaths, + const riley::LightShaderId& lightShaderId, + const std::vector<_InstanceData>& subInstances, + const std::vector<_FlattenData>& prototypeFlats); + + // Locks before calling _PopulateInstances() to prevent duplicated Riley + // calls that may arise when Populate() has been called from multiple + // threads producing identical population requests from the same child + // instancer. Locks are segregated by prototypePrimPath to avoid + // over-locking. + void _PopulateInstancesFromChild( + HdRenderParam* renderParam, + HdDirtyBits* dirtyBits, + const SdfPath& hydraPrototypeId, + const SdfPath& prototypePrimPath, + const std::vector& rileyPrototypeIds, + const riley::CoordinateSystemList& coordSysList, + const RtParamList protoParams, + const HdTimeSampleArray protoXform, + const std::vector& rileyMaterialIds, + const SdfPathVector& prototypePaths, + const riley::LightShaderId& lightShaderId, + const std::vector<_InstanceData>& subInstances, + const std::vector<_FlattenData>& prototypeFlats); + + // Get pointer to parent instancer, if one exists + HdPrmanInstancer* _GetParentInstancer(); + + // Resize the instancer's interal state store for tracking riley instances. + // Shrinking the number of instances for a given prototype path and id will + // delete excess instances from riley. Call with newSize = 0 to kill 'em all. + void _ResizeProtoMap( + riley::Riley* riley, + const SdfPath& prototypePrimPath, + const std::vector& rileyPrototypeIds, + const size_t newSize); + + // Deletes any riley geometry prototype groups that are no longer needed. + // Returns true if any groups were deleted. + bool _CleanDisusedGroupIds(HdPrman_RenderParam* param); + + // Obtain the riley geometry prototype group id for a given FlattenData. + // Returns true if the group had to be created. Gives InvalidId when this + // instancer has no parent instancer. + bool _AcquireGroupId( + HdPrman_RenderParam* param, + const _FlattenData& flattenGroup, + riley::GeometryPrototypeId& groupId); + + // Retrieves instance-rate params for the given instance index from + // the instancer's cache. + void _GetInstanceParams( + const size_t instanceIndex, + RtParamList& params); + + // Gets constant and uniform params for the prototype + void _GetPrototypeParams( + const SdfPath& protoPath, + RtParamList& params + ); + + // Retrieves the instance transform for the given index from the + // instancer's cache. + void _GetInstanceTransform( + const size_t instanceIndex, + _GfMatrixSA& xform, + const _GfMatrixSA& left = _GfMatrixSA()); + + // Calculates this instancer's depth in the nested instancing hierarchy. + // An uninstanced instancer has depth 0. Instancers with depth > 4 cannot + // use riley nested instancing and must flatten their instances into their + // parents. + int _Depth(); + + + // ********************************************** + // ** Private Members ** + // ********************************************** + + // This instancer's cached instance transforms + HdTimeSampleArray _sa; + + // This instancer's cached coordinate system list + riley::CoordinateSystemList _coordSysList = { 0, nullptr }; + + // This instancer's cached instance categories; will be empty under point + // instancing, so all indexing must be bounds-checked! + std::vector _instanceCategories; + + // This instancer's cached visibility and categories + _FlattenData _instancerFlat; + + // This instancer's cached USD primvars + TfHashMap _primvarMap; + + // Map of FlattenData to GeometryProtoypeId + // We use this map to put instances that share values for instance params + // that are incompatible with riley nesting into shared prototype groups so + // that the incompatible params may be set on the outermost riley + // instances of those groups where they are supported. This map may be + // written to during Populate, so access must be gated behind a mutex + // lock (built into LockingMap). + _LockingFlattenGroupMap _groupMap; + + // Counters for tracking number of instances in each prototype group. Used + // to speed up empty prototype group removal. + _LockingProtoGroupCounterMap _groupCounters; + + // riley geometry prototype groups are created during Populate; these must + // be serialized to prevent creating two different groups for the same set + // of flatten data. + tbb::spin_rw_mutex _groupIdAcquisitionLock; + + // Main storage for tracking riley instances owned by this instancer. + // Instance ids are paired with their containing group id (RileyInstanceId), + // then grouped by their riley geometry prototype id (ProtoInstMap). These + // are then grouped by id of the prototype prim they represent (which may be + // the invalid id in the case of analytic lights). The top level of this + // nested structure may be written to during Populate, therefore access to + // the top level is gated behind a mutex lock (built into LockingMap). + // Deeper levels are only ever written to from within a single call to + // Populate, so they do not have gated access. + _LockingProtoMap _protoMap; + + // Locks used by _PopulateInstancesFromChild() to serialize (and dedupe) + // parallel calls from the same child instancer, which occur when the child + // has multiple prototype prims and would otherwise lead to duplicated + // Riley calls to Create or Remove instances, both of which are problematic. + _LockingMap _childPopulateLocks; +}; + +PXR_NAMESPACE_CLOSE_SCOPE + +#endif // EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_INSTANCER_H diff --git a/third_party/renderman-26/plugin/hdPrman/integrator.cpp b/third_party/renderman-26/plugin/hdPrman/integrator.cpp new file mode 100644 index 0000000000..136fc886f7 --- /dev/null +++ b/third_party/renderman-26/plugin/hdPrman/integrator.cpp @@ -0,0 +1,68 @@ +// +// Copyright 2023 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// +#include "hdPrman/integrator.h" + +#include "hdPrman/renderDelegate.h" +#include "hdPrman/renderParam.h" + +#include "Riley.h" + +PXR_NAMESPACE_OPEN_SCOPE + +TF_DEFINE_PRIVATE_TOKENS( + _tokens, + (resource) +); + +HdPrman_Integrator::HdPrman_Integrator( + SdfPath const& id) + : HdSprim(id) +{ +} + +void +HdPrman_Integrator::Finalize(HdRenderParam *renderParam) +{ +} + +void +HdPrman_Integrator::Sync( + HdSceneDelegate *sceneDelegate, + HdRenderParam *renderParam, + HdDirtyBits *dirtyBits) +{ + const SdfPath &id = GetId(); + HdPrman_RenderParam *param = static_cast(renderParam); + + if (*dirtyBits & HdChangeTracker::DirtyParams) { + // Only Create the Integrator if connected to the RenderSettings + // Note that this works because the RenderSettings, being a Bprim, + // always gets synced before the Integrator Sprim. + SdfPath integratorPath = param->GetRenderSettingsIntegratorPath(); + if (id == integratorPath) { + const VtValue integratorResourceValue = + sceneDelegate->Get(id, _tokens->resource); + if (integratorResourceValue.IsHolding()) { + HdMaterialNode2 integratorNode = + integratorResourceValue.UncheckedGet(); + param->SetRenderSettingsIntegratorNode( + &sceneDelegate->GetRenderIndex(), integratorNode); + } + } + } + + *dirtyBits = HdChangeTracker::Clean; +} + + +HdDirtyBits HdPrman_Integrator::GetInitialDirtyBitsMask() const +{ + int mask = HdChangeTracker::Clean | HdChangeTracker::DirtyParams; + return (HdDirtyBits)mask; +} + +PXR_NAMESPACE_CLOSE_SCOPE diff --git a/third_party/renderman-26/plugin/hdPrman/integrator.h b/third_party/renderman-26/plugin/hdPrman/integrator.h new file mode 100644 index 0000000000..e13d66c3d3 --- /dev/null +++ b/third_party/renderman-26/plugin/hdPrman/integrator.h @@ -0,0 +1,37 @@ +// +// Copyright 2023 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// +#ifndef EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_INTEGRATOR_H +#define EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_INTEGRATOR_H + +#include "pxr/pxr.h" +#include "pxr/imaging/hd/sprim.h" + +#include "Riley.h" +#include "pxr/imaging/hd/material.h" + +PXR_NAMESPACE_OPEN_SCOPE + +class HdPrman_RenderParam; + +class HdPrman_Integrator : public HdSprim +{ +public: + HdPrman_Integrator(SdfPath const& id); + + void Sync(HdSceneDelegate *sceneDelegate, + HdRenderParam *renderParam, + HdDirtyBits *dirtyBits) override; + + void Finalize(HdRenderParam *renderParam) override; + + HdDirtyBits GetInitialDirtyBitsMask() const override; +}; + + +PXR_NAMESPACE_CLOSE_SCOPE + +#endif // EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_INTEGRATOR_H diff --git a/third_party/renderman-26/plugin/hdPrman/legacyMeshLightAdapter.cpp b/third_party/renderman-26/plugin/hdPrman/legacyMeshLightAdapter.cpp new file mode 100644 index 0000000000..d4b21e3e50 --- /dev/null +++ b/third_party/renderman-26/plugin/hdPrman/legacyMeshLightAdapter.cpp @@ -0,0 +1,101 @@ +// +// Copyright 2023 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. + +#include "hdPrman/legacyMeshLightAdapter.h" +#include "pxr/usd/usdLux/lightAPI.h" +#include "pxr/usdImaging/usdImaging/indexProxy.h" +#include "pxr/usd/ar/resolverContextBinder.h" +#include "pxr/usd/ar/resolverScopedCache.h" +#include "pxr/imaging/hd/tokens.h" +#include "pxr/imaging/hd/overlayContainerDataSource.h" +#include "pxr/imaging/hd/retainedDataSource.h" +#include "pxr/imaging/hd/light.h" +#include "pxr/usdImaging/usdImaging/materialParamUtils.h" +#include "pxr/imaging/hd/material.h" +#include "pxr/imaging/hd/materialSchema.h" +#include "pxr/imaging/hd/materialNetworkSchema.h" + +PXR_NAMESPACE_OPEN_SCOPE + +TF_DEFINE_PRIVATE_TOKENS( + _tokens, + (isLight) +); + +TF_REGISTRY_FUNCTION(TfType) +{ + typedef HdPrman_LegacyMeshLightAdapter Adapter; + TfType t = TfType::Define >(); + t.SetFactory< UsdImagingPrimAdapterFactory >(); +} + +void +HdPrman_LegacyMeshLightAdapter::TrackVariability( + UsdPrim const& prim, + SdfPath const& cachePath, + HdDirtyBits* timeVaryingBits, + UsdImagingInstancerContext const* instancerContext) const +{ + BaseAdapter::TrackVariability( + prim, cachePath, timeVaryingBits, instancerContext); + + UsdLuxLightAPI light(prim); + if (TF_VERIFY(light)) { + UsdImaging_CollectionCache& collectionCache = _GetCollectionCache(); + collectionCache.UpdateCollection(light.GetLightLinkCollectionAPI()); + collectionCache.UpdateCollection(light.GetShadowLinkCollectionAPI()); + // TODO: When collections change we need to invalidate affected + // prims with the DirtyCollections flag. + } +} + +HdDirtyBits +HdPrman_LegacyMeshLightAdapter::ProcessPropertyChange( + UsdPrim const& prim, SdfPath const& cachePath, TfToken const& propertyName) +{ + HdDirtyBits dirtyBits = BaseAdapter::ProcessPropertyChange( + prim, cachePath, propertyName); + if (propertyName == _tokens->isLight) + dirtyBits |= HdChangeTracker::AllDirty; + else if (TfStringStartsWith(propertyName, "inputs:") + || TfStringStartsWith(propertyName, "light:") + || TfStringStartsWith(propertyName, "collection:")) + dirtyBits |= HdChangeTracker::DirtyMaterialId; + return dirtyBits; +} + + +VtValue +HdPrman_LegacyMeshLightAdapter::GetMaterialResource( + UsdPrim const& prim, SdfPath const& cachePath, UsdTimeCode time) const +{ + // std::cout << "HdPrman_LegacyMeshLightAdapter::GetMaterialResource" << std::endl; + if (!_GetSceneLightsEnabled()) { + return VtValue(); + } + + if (!prim.HasAPI()) { + TF_RUNTIME_ERROR( + "Expected light prim at <%s> to have an applied API " + "of type 'UsdLuxLightAPI'; ignoring", + prim.GetPath().GetText()); + return VtValue(); + } + + // Bind the usd stage's resolver context for correct asset resolution. + ArResolverContextBinder binder(prim.GetStage()->GetPathResolverContext()); + ArResolverScopedCache resolverCache; + + HdMaterialNetworkMap networkMap; + + UsdImagingBuildHdMaterialNetworkFromTerminal( + prim, HdMaterialTerminalTokens->light, _GetShaderSourceTypes(), + _GetMaterialRenderContexts(), &networkMap, time); + + return VtValue(networkMap); +} + +PXR_NAMESPACE_CLOSE_SCOPE \ No newline at end of file diff --git a/third_party/renderman-26/plugin/hdPrman/legacyMeshLightAdapter.h b/third_party/renderman-26/plugin/hdPrman/legacyMeshLightAdapter.h new file mode 100644 index 0000000000..a73e2ab4a4 --- /dev/null +++ b/third_party/renderman-26/plugin/hdPrman/legacyMeshLightAdapter.h @@ -0,0 +1,44 @@ +// +// Copyright 2023 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +#ifndef EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_LEGACY_MESHLIGHT_ADAPTER_H +#define EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_LEGACY_MESHLIGHT_ADAPTER_H + +#include "pxr/usdImaging/usdImaging/meshAdapter.h" +#include "pxr/imaging/hd/filteringSceneIndex.h" +#include + +PXR_NAMESPACE_OPEN_SCOPE + +// Until we transition to a full scene index plugin this adapter allows us to +// use a PxrMesh instead of a Mesh to gain access to the light data on a mesh +// inside of HdPrman. + +class HdPrman_LegacyMeshLightAdapter : public UsdImagingMeshAdapter +{ +public: + using BaseAdapter = UsdImagingMeshAdapter; + + void TrackVariability( + UsdPrim const& prim, + SdfPath const& cachePath, + HdDirtyBits* timeVaryingBits, + UsdImagingInstancerContext const* instancerContext + = nullptr) const override; + + HdDirtyBits ProcessPropertyChange( + UsdPrim const& prim, + SdfPath const& cachePath, + TfToken const& propertyName) override; + + VtValue GetMaterialResource( + UsdPrim const& prim, + SdfPath const& cachePath, + UsdTimeCode time) const override; +}; + +PXR_NAMESPACE_CLOSE_SCOPE + +#endif // EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_LEGACY_MESHLIGHT_ADAPTER_H diff --git a/third_party/renderman-26/plugin/hdPrman/light.cpp b/third_party/renderman-26/plugin/hdPrman/light.cpp new file mode 100644 index 0000000000..5cacba22b5 --- /dev/null +++ b/third_party/renderman-26/plugin/hdPrman/light.cpp @@ -0,0 +1,928 @@ +// +// Copyright 2019 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// +#include "hdPrman/light.h" + +#include "hdPrman/debugCodes.h" +#include "hdPrman/instancer.h" +#include "hdPrman/lightFilter.h" +#include "hdPrman/material.h" +#include "hdPrman/mesh.h" +#include "hdPrman/renderParam.h" +#include "hdPrman/rixStrings.h" +#include "hdPrman/tokens.h" +#include "hdPrman/utils.h" + +#include "pxr/base/arch/library.h" +#include "pxr/base/gf/vec3f.h" +#include "pxr/usd/ar/resolver.h" +#include "pxr/usd/sdf/types.h" +#include "pxr/base/tf/debug.h" +#include "pxr/base/tf/envSetting.h" +#include "pxr/base/tf/staticTokens.h" +#include "pxr/imaging/hd/material.h" +#include "pxr/imaging/hd/sceneDelegate.h" +#include "pxr/imaging/hd/tokens.h" +#include "pxr/imaging/hf/diagnostic.h" + +#include "RiTypesHelper.h" +#include "RixShadingUtils.h" + +PXR_NAMESPACE_OPEN_SCOPE + +HdPrmanLight::HdPrmanLight(SdfPath const& id, TfToken const& lightType) + : HdLight(id) + , _hdLightType(lightType) +{ + /* NOTHING */ +} + +HdPrmanLight::~HdPrmanLight() = default; + +void +HdPrmanLight::Finalize(HdRenderParam *renderParam) +{ + HdPrman_RenderParam *param = + static_cast(renderParam); + riley::Riley* riley = param->AcquireRiley(); + if (!_lightLink.IsEmpty()) { + param->DecrementLightLinkCount(_lightLink); + _lightLink = TfToken(); + } + if (!_lightFilterPaths.empty()) { + _lightFilterPaths.clear(); + } + if (!_lightFilterLinks.empty()) { + for (const TfToken& filterLink : _lightFilterLinks) { + param->DecrementLightFilterCount(filterLink); + } + _lightFilterLinks.clear(); + } + + // delete instances owned by the instancer. + if (HdPrmanInstancer* instancer = param->GetInstancer( + GetInstancerId())) { + instancer->Depopulate(renderParam, GetId()); + } + + if (_instanceId != riley::LightInstanceId::InvalidId()) { + TRACE_SCOPE("riley::DeleteLightInstance"); + riley->DeleteLightInstance(riley::GeometryPrototypeId::InvalidId(), + _instanceId); + _instanceId = riley::LightInstanceId::InvalidId(); + } + if (_shaderId != riley::LightShaderId::InvalidId()) { + TRACE_SCOPE("riley::DeleteLightShader"); + riley->DeleteLightShader(_shaderId); + _shaderId = riley::LightShaderId::InvalidId(); + } + _lightShaderType = RtUString(); + _geometryPrototypeId = riley::GeometryPrototypeId::InvalidId(); + _sourceGeomPath = SdfPath(); + _shadowLink = TfToken(); +} + +static bool +_PopulateNodesFromMaterialResource(HdSceneDelegate *sceneDelegate, + const SdfPath &id, + const TfToken &terminalName, + std::vector *result) +{ + VtValue hdMatVal = sceneDelegate->GetMaterialResource(id); + if (!hdMatVal.IsHolding()) { + TF_WARN("Could not get HdMaterialNetworkMap for '%s'", id.GetText()); + return false; + } + + // Convert HdMaterial to HdMaterialNetwork2 form. + const HdMaterialNetwork2 matNetwork2 = HdConvertToHdMaterialNetwork2( + hdMatVal.UncheckedGet()); + + SdfPath nodePath; + for (auto const& terminal: matNetwork2.terminals) { + if (terminal.first == terminalName) { + nodePath = terminal.second.upstreamNode; + break; + } + } + + if (nodePath.IsEmpty()) { + TF_WARN("Could not find terminal '%s' in HdMaterialNetworkMap for '%s'", + terminalName.GetText(), id.GetText()); + return false; + } + + result->reserve(matNetwork2.nodes.size()); + if (!HdPrman_ConvertHdMaterialNetwork2ToRmanNodes( + matNetwork2, nodePath, result)) { + TF_WARN("Failed to convert HdMaterialNetwork to Renderman shading " + "nodes for '%s'", id.GetText()); + return false; + } + + return true; +} + +static void +_AddLightFilterCombiner(std::vector* lightFilterNodes) +{ + static RtUString combineMode("combineMode"); + static RtUString mult("mult"); + static RtUString max("max"); + static RtUString min("min"); + static RtUString screen("screen"); + + riley::ShadingNode combiner = riley::ShadingNode { + riley::ShadingNode::Type::k_LightFilter, + RtUString("PxrCombinerLightFilter"), + RtUString("terminal.Lightfilter"), + RtParamList() + }; + + // Build a map of light filter handles grouped by mode. + std::unordered_map> modeMap; + + for (const auto& lightFilterNode : *lightFilterNodes) { + RtUString mode; + lightFilterNode.params.GetString(combineMode, mode); + if (mode.Empty()) { + modeMap[mult].push_back(lightFilterNode.handle); + } + else { + modeMap[mode].push_back(lightFilterNode.handle); + } + } + + // Set the combiner light filter reference array for each mode. + for (const auto& entry : modeMap) { + if (!entry.second.empty()) { + combiner.params.SetLightFilterReferenceArray( + entry.first, &entry.second[0], entry.second.size()); + } + } + + lightFilterNodes->push_back(combiner); +} + +static void +_PopulateLightFilterNodes( + const SdfPath &lightId, + const SdfPathVector &lightFilterPaths, + HdSceneDelegate *sceneDelegate, + HdRenderParam *renderParam, + riley::Riley *riley, + std::vector *lightFilterNodes, + std::vector *coordsysIds, + std::vector *lightFilterLinks) +{ + HdPrman_RenderParam * const param = + static_cast(renderParam); + + if (lightFilterPaths.empty()) { + return; + } + + int maxFilters = lightFilterPaths.size(); + if (maxFilters > 1) { + maxFilters += 1; // extra for the combiner filter + } + lightFilterNodes->reserve(maxFilters); + + for (const auto& filterPath : lightFilterPaths) { + TF_DEBUG(HDPRMAN_LIGHT_FILTER_LINKING) + .Msg("HdPrman: Light <%s> filter \"%s\" path \"%s\"\n", + lightId.GetText(), filterPath.GetName().c_str(), + filterPath.GetText()); + + if (!sceneDelegate->GetVisible(filterPath)) { + // XXX -- need to get a dependency analysis working here + // Invis of a filter works but does not cause the light + // to re-sync so one has to tweak the light to see the + // effect of the invised filter + TF_DEBUG(HDPRMAN_LIGHT_FILTER_LINKING) + .Msg(" filter invisible\n"); + continue; + } + + if (!_PopulateNodesFromMaterialResource( + sceneDelegate, filterPath, + HdMaterialTerminalTokens->lightFilter, + lightFilterNodes)) { + continue; + } + + riley::ShadingNode *filter = &lightFilterNodes->back(); + RtUString filterPathAsString = RtUString(filterPath.GetText()); + + // To ensure that multiple light filters within a light get + // unique names, use the full filter path for the handle. + filter->handle = filterPathAsString; + + // Only certain light filters require a coordsys, but we do not + // know which, here, so we provide it in all cases. + // + // TODO: We should be able to look up the SdrShaderNode entry + // and query it for the existence of this parameter. + filter->params.SetString(RtUString("coordsys"), filterPathAsString); + + // Light filter linking + VtValue val = sceneDelegate->GetLightParamValue(filterPath, + HdTokens->lightFilterLink); + TfToken lightFilterLink = TfToken(); + if (val.IsHolding()) { + lightFilterLink = val.UncheckedGet(); + } + if (!lightFilterLink.IsEmpty()) { + param->IncrementLightFilterCount(lightFilterLink); + lightFilterLinks->push_back(lightFilterLink); + // For light filters to link geometry, the light filters must + // be assigned a grouping membership, and the + // geometry must subscribe to that grouping. + filter->params.SetString(RtUString("linkingGroups"), + RtUString(lightFilterLink.GetText())); + TF_DEBUG(HDPRMAN_LIGHT_LINKING) + .Msg("HdPrman: Light filter <%s> linkingGroups \"%s\"\n", + filterPath.GetText(), lightFilterLink.GetText()); + } + + // Look up light filter ID + if (HdSprim *sprim = sceneDelegate->GetRenderIndex().GetSprim( + HdPrimTypeTokens->lightFilter, filterPath)) { + if (HdPrmanLightFilter *lightFilter = + dynamic_cast(sprim)) { + lightFilter->SyncToRiley(sceneDelegate, riley); + coordsysIds->push_back(lightFilter->GetCoordSysId()); + } + } else { + TF_WARN("Did not find expected light filter <%s>", + filterPath.GetText()); + } + } + + // Multiple filters requires a PxrCombinerLightFilter to combine results. + if (lightFilterNodes->size() > 1) { + _AddLightFilterCombiner(lightFilterNodes); + } +} + +/* virtual */ +void +HdPrmanLight::Sync(HdSceneDelegate *sceneDelegate, + HdRenderParam *renderParam, + HdDirtyBits *dirtyBits) +{ + HD_TRACE_FUNCTION(); + + static const RtUString us_PxrDomeLight("PxrDomeLight"); + static const RtUString us_PxrRectLight("PxrRectLight"); + static const RtUString us_PxrDiskLight("PxrDiskLight"); + static const RtUString us_PxrCylinderLight("PxrCylinderLight"); + static const RtUString us_PxrSphereLight("PxrSphereLight"); + static const RtUString us_PxrDistantLight("PxrDistantLight"); + static const RtUString us_PxrMeshLight("PxrMeshLight"); + static const RtUString us_PxrPortalLight("PxrPortalLight"); + static const RtUString us_shadowSubset("shadowSubset"); + static const riley::MaterialId invalidMaterial; + + const SdfPath& id = GetId(); + + HdPrman_RenderParam* param =static_cast(renderParam); + riley::Riley* riley = param->AcquireRiley(); + HdRenderIndex& renderIndex = sceneDelegate->GetRenderIndex(); + HdChangeTracker& changeTracker = renderIndex.GetChangeTracker(); + + // Light shader nodes will go here, whether we calculate them early during + // change tracking or later during shader update. + std::vector lightNodes; + // Any coordinate system ID's used will go here. + std::vector coordSysIds; + + // Update instance bindings + // XXX: This relies on DirtyInstancer having the same value for lights as + // it does for rprims. It is the only flag that _UpdateInstancer cares about + _UpdateInstancer(sceneDelegate, dirtyBits); + + const SdfPath& instancerId = GetInstancerId(); + const bool isHdInstance = !instancerId.IsEmpty(); + SdfPath primPath = sceneDelegate->GetScenePrimPath(id, 0, nullptr); + + // XXX: The following dirtiness detection, and all of the state we have to + // maintain to do it, is necessary so that we can use + // the riley api for updating existing light shaders/instances, which is + // in turn needed so we can split ownership of shaders and instances between + // HdPrmanLight and HdPrmanInstancer when lights are instanced. The existing + // DirtyBits mechanism for lights is inadequate for tracking changes to the + // light shader separately from changes to the light instance. + // Note that we do not update our saved state while checking for dirtiness. + // We'll do that later, when we're actually updating the light in Riley. + + // The source geom of a geom light has changed in a way that requires us to + // destroy and recreate the light instance rather than use + // riley->ModifyLightInstance(). Specifically, the riley geometry prototype + // id has changed. We don't expect this ever to happen, since a gprim never + // changes its prototype id, but it could happen if a scene index downstream + // of the mesh light resolving scene index were to alter the source geometry + // binding on the mesh light. + bool dirtySourceGeom = false; + + // Something changed that invalidates the riley light shader. This could be + // DirtyResource, dirty shadow params (which may not be accurately signalled + // by DirtyShadowParams), or dirty light filters. + bool dirtyLightShader = false; + + // Something changed that invalidates the riley light instance(s) in a way + // that we can update with ModifyLightInstance. This could be the transform, + // the coordinate system list, or certain attributes. + bool dirtyLightInstance = false; + + if (_hdLightType == HdSprimTypeTokens->meshLight) { + // Has source geom changed? Is the rprim still there? + const VtValue sourceGeom = sceneDelegate->GetLightParamValue(id, + HdPrmanTokens->sourceGeom); + if (sourceGeom.IsHolding()) { + const SdfPath sourceGeomPath = sourceGeom.UncheckedGet(); + if (sourceGeomPath != _sourceGeomPath) { + // source geom path has changed; assume new prototype id + dirtySourceGeom = true; + } + const HdRprim *rprim = + sceneDelegate->GetRenderIndex().GetRprim(sourceGeomPath); + if (rprim) { + + // XXX: Temporary workaround for RMAN-20136 + // Check if the source mesh is scheduled for a prototype + // update. If it is, we need to postpone sync in order to avoid + // an issue in Prman with simultaneous light shader and + // geometry prototype modifications on mesh lights. + // See https://jira.pixar.com/browse/RMAN-20136. Delaying here + // has the effect of adding an extra call to riley->Render() + // between the geometry prototype update and the light shader + // update, which has a noticeable effect on performance, so we + // will also check to see whether the light shader already + // exists. If it does not, it should be safe to make it even + // when we have a dirty source mesh geometry. + HdDirtyBits sourceDirtyBits = changeTracker + .GetRprimDirtyBits(sourceGeomPath); + if (_shaderId != riley::LightShaderId::InvalidId() && ( + sourceDirtyBits & ( + HdChangeTracker::DirtyPoints | + HdChangeTracker::DirtyNormals | + HdChangeTracker::DirtyWidths | + HdChangeTracker::DirtyTopology))) { + TF_DEBUG(HDPRMAN_MESHLIGHT).Msg("Source geom <%s> for geom " + "light <%s> has dirty geometry; postponing sync.\n", + sourceGeomPath.GetText(), id.GetText()); + // Note that we cannot just resync the source mesh here. + // We have to separate updates to the geometry protoype from + // updates to the light shader by a call to Render, and the + // only way to achieve that is to return while the light is + // still dirty. This will be a challenging bug to work + // around in HdPrman 2.0. + return; + } + // XXX: End of RMAN-20136 workaround + + // check if the prototype id exists, or has changed + auto gprim = dynamic_cast(rprim); + std::vector prototypeIds = + gprim->GetPrototypeIds(); + if (prototypeIds.empty()) { + // XXX: This is our least-ugly workaround for sync ordering. + // We do not expect the source geometry's prototype id to + // change under any normal circumstances, so this only needs + // to happen during the initial sync phase. We reach out to + // the unsynced source geometry and sync it. This is not a + // general solution to sync ordering. It should not be + // replicated elsewhere! + TF_DEBUG(HDPRMAN_MESHLIGHT).Msg("Attempting to sync source " + "geometry <%s> for geom light <%s>\n", + sourceGeomPath.GetText(), id.GetText()); + const_cast(rprim)->Sync( + sceneDelegate, renderParam, &sourceDirtyBits, TfToken()); + prototypeIds = gprim->GetPrototypeIds(); + } + if (prototypeIds.empty()) { + // sync failed to produce riley prototype ids; ignore light + TF_DEBUG(HDPRMAN_MESHLIGHT).Msg("Source geometry <%s> for " + "geom light <%s> still has not been created in riley; " + "the light will be ignored.\n", + sourceGeomPath.GetText(), id.GetText()); + *dirtyBits = DirtyBits::Clean; + return; + } else if (prototypeIds.size() > 1) { + // XXX: Geom subsets are not yet supported on geom lights; + // the mesh light resolving scene index should strip them + // out of the source geom. If we hit this, something odd + // is going on. + TF_DEBUG(HDPRMAN_MESHLIGHT).Msg("Source geom <%s> for " + "geom light <%s> has more than one geometry " + "prototype id; only one is expected, and only the " + "first will be used.\n", sourceGeomPath.GetText(), + id.GetText()); + } + if (prototypeIds[0] != _geometryPrototypeId) { + // source geom prototype id has changed + // XXX: Again, we do not expect this. The source geometry + // won't change its prototype id because of how gprim sync + // behaves, and a given geom light's source geometry path + // should never change because of how the mesh light + // resolving scene index behaves. The checks are here to + // protect against prman crashes in the event that a scene + // index between the mesh light resolving scene index and + // here messes with things. + dirtySourceGeom = true; + } + } else { + // cannot find the source geom in the render index; ignore light + TF_DEBUG(HDPRMAN_MESHLIGHT).Msg("Source geom <%s> for geom " + "light <%s> could not be found; the light will be " + "ignored.\n", sourceGeomPath.GetText(), id.GetText()); + *dirtyBits = DirtyBits::Clean; + return; + } + } else { + // light.sourceGeom was empty, which would indicate a breakdown in + // the mesh light resolving scene index. + TF_DEBUG(HDPRMAN_MESHLIGHT).Msg("Geom light <%s> has no source " + "geometry; this light will be ignored since source geometry is " + "required.", id.GetText()); + *dirtyBits = DirtyBits::Clean; + return; + } + } + + if ((*dirtyBits & DirtyResource) + || _shaderId == riley::LightShaderId::InvalidId()) { + // The light shader has changed + dirtyLightShader = true; + if (_hdLightType == HdSprimTypeTokens->pluginLight) { + // The material resource [light shader] of a plugin light will + // change when the id [name] of the specific shader the light uses + // has changed. Which shader the light is using can affect how + // input parameters are interpreted to affect the light's transform, + // which is instance-invalidating. We keep the name as state so we + // can detect when we must also invalidate the instance. But we also + // want to avoid calling _PopulateNodesFromMaterialResource more + // than necessary. + if (_lightShaderType.Empty()) { + // Empty state means we've never seen the shader at all, so the + // instance will also be dirty. + dirtyLightInstance = true; + } else { + // Early call to _PopulateNodesFromMaterialResource + _PopulateNodesFromMaterialResource( + sceneDelegate, id, + HdMaterialTerminalTokens->light, &lightNodes); + if ((!lightNodes.empty()) + && lightNodes.back().name != _lightShaderType) { + dirtyLightInstance = true; + } + } + } + } + + if (*dirtyBits & (DirtyTransform | DirtyInstancer)) { + // If the transform has changed or the instancer is dirty, the light + // instance (or instances, in the latter case) needs to be refreshed. + dirtyLightInstance = true; + } + + if (*dirtyBits & (DirtyParams | DirtyShadowParams | DirtyCollection)) { + // Light linking changes are subsumed under changes to the light api, + // which are in turn signalled as : + // (DirtyParams | DirtyShadowParams | DirtyCollection) + // We can store lightLink locally and compare against that to see if + // light links specifically have changed. Light links affect the light's + // instance attributes, and do not invalidate the shader! + VtValue val = sceneDelegate->GetLightParamValue(id, HdTokens->lightLink); + if (val.IsHolding()) { + TfToken lightLink = val.UncheckedGet(); + if (lightLink != _lightLink) { + // lightLink has changed + dirtyLightInstance = true; + } + } else if (!_lightLink.IsEmpty()) { + // lightLink was not empty before, but is now + dirtyLightInstance = true; + } + + // Light filter changes are also subsumed under changes to the light + // api and signalled the same as light filters. Again, compare against a + // local copy to see if they've really changed. Changes to light filters + // affect both the shader and the instance, the latter due to potential + // changes in the relevant coordinate systems. + val = sceneDelegate->GetLightParamValue(id, HdTokens->filters); + if (val.IsHolding()) { + SdfPathVector lightFilterPaths = val.UncheckedGet(); + if (lightFilterPaths != _lightFilterPaths) { + // light filter paths have changed + dirtyLightShader = true; + dirtyLightInstance = true; + } else { + // TODO: check if the filters themselves have changed? + } + } else if (!_lightFilterPaths.empty()) { + // light filter paths were not empty before, but are now + dirtyLightShader = true; + dirtyLightInstance = true; + } + + // DirtyShadowParams may be set even if the shadow params did not + // change, due to a lack of granularity in the dirty bits translator. + // So we will manually check the shadow params against a local copy + // to see if they really changed. Changes to the shadow params + // invalidate the light shader. + val = sceneDelegate->GetLightParamValue(id, HdTokens->shadowLink); + if (val.IsHolding()) { + TfToken shadowLink = val.UncheckedGet(); + if (shadowLink != _shadowLink) { + // shadowLink has changed + dirtyLightShader = true; + } + } else if (!_shadowLink.IsEmpty()) { + dirtyLightShader = true; + } + + // DirtyParams will always dirty the instance + if (*dirtyBits & DirtyParams) { + dirtyLightInstance = true; + } + } + + // finally, dirtySourceGeom implies dirtyLightInstance; + dirtyLightInstance |= dirtySourceGeom; + + // Now that we know what's actually dirty (the shader and/or the instance), + // we can proceed with a modify-aware approach. + + if (dirtyLightShader) { + // prepare and create or modify the light shader(s). + + // Only call _PopulateNodesFromMaterialResource if we did not call it + // above during dirty checking. + if (lightNodes.empty()) { + _PopulateNodesFromMaterialResource( + sceneDelegate, id, + HdMaterialTerminalTokens->light, &lightNodes); + } + + if (lightNodes.empty() || lightNodes.back().name.Empty()) { + TF_WARN("Could not populate shading nodes for light <%s>. " + "The light will be ignored.", id.GetText()); + *dirtyBits = DirtyBits::Clean; + return; + } + + _lightShaderType = lightNodes.back().name; + + TF_DEBUG(HDPRMAN_LIGHT_LIST).Msg("HdPrman: Light <%s> lightType '%s', " + "shader '%s'\n", + id.GetText(), _hdLightType.GetText(), _lightShaderType.CStr()); + // The terminal light node will be updated with other parameters that + // aren't direct inputs of the material resource. + riley::ShadingNode& lightNode = lightNodes.back(); + + // Shadow linking + VtValue shadowLinkVal = + sceneDelegate->GetLightParamValue(id, HdTokens->shadowLink); + if (shadowLinkVal.IsHolding()) { + _shadowLink = shadowLinkVal.UncheckedGet(); + if (!_shadowLink.IsEmpty()) { + lightNode.params.SetString(us_shadowSubset, + RtUString(_shadowLink.GetText())); + TF_DEBUG(HDPRMAN_LIGHT_LINKING).Msg("HdPrman: Light <%s> " + "shadowSubset '%s'\n", id.GetText(), + _shadowLink.GetText()); + } + } + + SdfPathVector filters; + VtValue filtersVal = sceneDelegate->GetLightParamValue( + id, HdTokens->filters); + if (filtersVal.IsHolding()) { + filters = filtersVal.UncheckedGet(); + } + if (filters != _lightFilterPaths) { + // clear and recreate dependencies + for (const SdfPath& filterPath : _lightFilterPaths) { + changeTracker.RemoveSprimSprimDependency(filterPath, id); + } + for (const SdfPath& filterPath : filters) { + changeTracker.AddSprimSprimDependency(filterPath, id); + } + _lightFilterPaths = filters; + } + // Light filter counts get incremented when we call + // _PopulateLightFilterNodes, so we don't get the opportunity + // to really compare them against state. State here exists so + // we can decrement the old filter counts before building + // the filter network. + for (const TfToken& filterLink : _lightFilterLinks) { + param->DecrementLightFilterCount(filterLink); + } + std::vector filterNodes; + + // _PopulateLightFilterNodes also gives us the coordinate systems. + // We store them so we can have them on later calls where only the + // light instance is dirty. Note above that dirty light filters mean + // dirty shader *and* dirty instance; the coordinate systems are why, + // and are the only piece of derived state that needs to be shared by + // both the shader and instance update branches. + _PopulateLightFilterNodes(id, filters, sceneDelegate, renderParam, + riley, &filterNodes, &coordSysIds, &_lightFilterLinks); + + const riley::ShadingNetwork light { + static_cast(lightNodes.size()), + lightNodes.data() + }; + + const riley::ShadingNetwork filter { + static_cast(filterNodes.size()), + filterNodes.data() + }; + + // TODO: portals + + if (_shaderId == riley::LightShaderId::InvalidId()) { + const riley::UserId userId( + stats::AddDataLocation(id.GetText()).GetValue()); + TRACE_SCOPE("riley::CreateLightShader"); + _shaderId = riley->CreateLightShader(userId, light, filter); + } else { + TRACE_SCOPE("riley::ModifyLightShader"); + riley->ModifyLightShader(_shaderId, &light, &filter); + } + } + + if (dirtyLightInstance) { + + riley::MaterialId materialId; + if (_hdLightType == HdSprimTypeTokens->meshLight) { + // Checks that these exist have already been done above! + + const SdfPath sourceGeomPath = sceneDelegate->GetLightParamValue( + id, HdPrmanTokens->sourceGeom).UncheckedGet(); + const HdRprim* rPrim = sceneDelegate->GetRenderIndex() + .GetRprim(sourceGeomPath); + const auto* gprim = dynamic_cast(rPrim); + + _geometryPrototypeId = gprim->GetPrototypeIds()[0]; + _sourceGeomPath = sourceGeomPath; + } + + RtParamList attrs = param->ConvertAttributes(sceneDelegate, id, false); + if (_lightShaderType == us_PxrDomeLight) { + const bool domeLightCamVis = sceneDelegate->GetRenderIndex() + .GetRenderDelegate()->GetRenderSetting( + HdRenderSettingsTokens->domeLightCameraVisibility, true); + if (!domeLightCamVis) { + attrs.SetInteger(RixStr.k_visibility_camera, 0); + } + } + + TfToken lightLink; + VtValue lightLinkVal = sceneDelegate->GetLightParamValue( + id, HdTokens->lightLink); + if (lightLinkVal.IsHolding()) { + lightLink = lightLinkVal.UncheckedGet(); + } + if (lightLink != _lightLink) { + if (!_lightLink.IsEmpty()) { + param->DecrementLightLinkCount(_lightLink); + } + if (!lightLink.IsEmpty()) { + param->IncrementLightLinkCount(lightLink); + } + _lightLink = lightLink; + } + if (!_lightLink.IsEmpty()) { + // For lights to link geometry, the lights must be assigned a + // grouping membership and the geometry must subscribe to that + // grouping. + attrs.SetString(RixStr.k_grouping_membership, + RtUString(_lightLink.GetText())); + TF_DEBUG(HDPRMAN_LIGHT_LINKING).Msg("HdPrman: Light <%s> grouping " + "membership '%s'\n", id.GetText(), _lightLink.GetText()); + } else { + // Default light group + attrs.SetString(RixStr.k_grouping_membership, RtUString("default")); + TF_DEBUG(HDPRMAN_LIGHT_LINKING).Msg("HdPrman: Light <%s> grouping " + "membership 'default'\n", id.GetText()); + } + + // Convert coordinate system ids to list + const riley::CoordinateSystemList coordSysList = { + unsigned(coordSysIds.size()), coordSysIds.data() + }; + + // Sample transform + HdTimeSampleArray xf; + sceneDelegate->SampleTransform(id, &xf); + + GfMatrix4d geomMat(1.0); + + // Some lights have parameters that scale the size of the light. + GfVec3d geomScale(1.0f); + + // Type-specific parameters + if (_lightShaderType == us_PxrRectLight || + _lightShaderType == us_PxrPortalLight) { + // width + VtValue width = sceneDelegate->GetLightParamValue(id, + HdLightTokens->width); + if (width.IsHolding()) { + geomScale[0] = width.UncheckedGet(); + } + // height + VtValue height = sceneDelegate->GetLightParamValue(id, + HdLightTokens->height); + if (height.IsHolding()) { + geomScale[1] = height.UncheckedGet(); + } + } else if (_lightShaderType == us_PxrDiskLight) { + // radius (XY only, default 0.5) + VtValue radius = sceneDelegate->GetLightParamValue(id, + HdLightTokens->radius); + if (radius.IsHolding()) { + geomScale[0] *= radius.UncheckedGet() / 0.5; + geomScale[1] *= radius.UncheckedGet() / 0.5; + } + } else if (_lightShaderType == us_PxrCylinderLight) { + // radius (YZ only, default 0.5) + VtValue radius = sceneDelegate->GetLightParamValue(id, + HdLightTokens->radius); + if (radius.IsHolding()) { + geomScale[1] *= radius.UncheckedGet() / 0.5; + geomScale[2] *= radius.UncheckedGet() / 0.5; + } + // length (X-axis) + VtValue length = sceneDelegate->GetLightParamValue(id, + HdLightTokens->length); + if (length.IsHolding()) { + geomScale[0] *= length.UncheckedGet(); + } + } else if (_lightShaderType == us_PxrSphereLight) { + // radius (XYZ, default 0.5) + VtValue radius = sceneDelegate->GetLightParamValue(id, + HdLightTokens->radius); + if (radius.IsHolding()) { + geomScale *= radius.UncheckedGet() / 0.5; + } + } else if (_lightShaderType == us_PxrMeshLight) { + // Our mesh light geom should not be visible, and should be one-sided, + // to match the existing Katana behavior. + // XXX: these may not be effective for volumes, either at all or + // for certain path tracers. Volume light support is still incomplete. + // XXX: These will overwrite and ignore what may be authored on the + // mesh light, which may not be desirable. + attrs.SetInteger(RixStr.k_visibility_camera, 0); + attrs.SetInteger(RixStr.k_visibility_transmission, 0); + attrs.SetInteger(RixStr.k_visibility_indirect, 0); + // XXX: In Xpu, this may be "sides", not "Sides". + attrs.SetInteger(RixStr.k_Sides, 1); + } + + geomMat.SetScale(geomScale); + + // Adjust orientation to make prman match the USD spec. + // TODO: Add another orientMat for PxrEnvDayLight when supported. + GfMatrix4d orientMat(1.0); + if (_lightShaderType == us_PxrDomeLight) { + // Transform Dome to match OpenEXR spec for environment maps + // Rotate -90 X, Rotate 90 Y + orientMat = GfMatrix4d(0.0, 0.0, -1.0, 0.0, + -1.0, 0.0, 0.0, 0.0, + 0.0, 1.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 1.0); + // Apply domeOffset if present + VtValue domeOffset = sceneDelegate->GetLightParamValue(id, + HdLightTokens->domeOffset); + if (domeOffset.IsHolding()) { + orientMat = orientMat * domeOffset.UncheckedGet(); + } + } else if (_lightShaderType != us_PxrMeshLight) { + // Transform lights to match correct orientation + // Scale -1 Z, Rotate 180 Z + orientMat = GfMatrix4d(-1.0, 0.0, 0.0, 0.0, + 0.0, -1.0, 0.0, 0.0, + 0.0, 0.0, -1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); + } + geomMat = orientMat * geomMat; + for (size_t i = 0; i < xf.count; ++i) { + xf.values[i] = geomMat * xf.values[i]; + } + + attrs.SetInteger(RixStr.k_lighting_mute, !sceneDelegate->GetVisible(id)); + + if (!isHdInstance) { + // Singleton case. Create the light instance. + + // convert xform for riley + TfSmallVector + xf_rt_values(xf.count); + for (size_t i = 0; i < xf.count; ++i) { + xf_rt_values[i] = HdPrman_Utils::GfMatrixToRtMatrix(xf.values[i]); + } + const riley::Transform xform = { + unsigned(xf.count), xf_rt_values.data(), xf.times.data() + }; + + if (dirtySourceGeom + && _instanceId != riley::LightInstanceId::InvalidId()) { + riley->DeleteLightInstance( + riley::GeometryPrototypeId::InvalidId(), + _instanceId); + _instanceId = riley::LightInstanceId::InvalidId(); + } + + // XXX: Temporary workaround for RMAN-20704 + // Destroy the light instance so it will be recreated instead + // of being updated, since ModifyLightInstance may crash. + if (_instanceId != riley::LightInstanceId::InvalidId()) { + riley->DeleteLightInstance( + riley::GeometryPrototypeId::InvalidId(), _instanceId); + _instanceId = riley::LightInstanceId::InvalidId(); + } + // XXX: End of RMAN-20704 workaround + + if (_instanceId == riley::LightInstanceId::InvalidId()) { + const riley::UserId userId(stats::AddDataLocation(id.GetText()) + .GetValue()); + TRACE_SCOPE("riley::CreateLightInstance"); + _instanceId = riley->CreateLightInstance( + userId, + riley::GeometryPrototypeId::InvalidId(), + _geometryPrototypeId, + invalidMaterial, + _shaderId, + coordSysList, + xform, + attrs); + } else { + TRACE_SCOPE("riley::ModifyLightInstance"); + riley->ModifyLightInstance( + riley::GeometryPrototypeId::InvalidId(), + _instanceId, + &invalidMaterial, + &_shaderId, + &coordSysList, + &xform, + &attrs); + } + } else { + // This light is a prototype of a hydra instancer. The light shader + // has already been synced above, and any riley geometry prototypes + // (if this is a mesh light) have already been synced as prototype- + // only by gprim.h. We need to tell the HdPrmanInstancer to sync + // riley light instances. + HdInstancer::_SyncInstancerAndParents(renderIndex, instancerId); + HdPrmanInstancer *instancer = static_cast( + renderIndex.GetInstancer(instancerId)); + if (instancer) { + + // if for some reason the source geometry id has changed, we + // first have to depopulate the old light instances from the + // parent instancer. + if (dirtySourceGeom) { + instancer->Depopulate(renderParam, id); + } + + // XXX: The dirtybits we have are not useful to the instancer. + // we should translate them, but to do so accurately would + // require a lot more state. So we will set DirtyTransform + // as a token value to signal to the instancer to update the + // instances. + HdDirtyBits instanceDirtyBits( + HdChangeTracker::DirtyTransform | + (*dirtyBits & HdChangeTracker::DirtyInstancer)); + instancer->Populate( + renderParam, + &instanceDirtyBits, + id, + { _geometryPrototypeId }, + coordSysList, + attrs, xf, + { invalidMaterial }, + { primPath }, + _shaderId); + } + } + } + + if (dirtyBits) { + *dirtyBits = HdChangeTracker::Clean; + } +} + +/* virtual */ +HdDirtyBits +HdPrmanLight::GetInitialDirtyBitsMask() const +{ + return HdLight::AllDirty; +} + +PXR_NAMESPACE_CLOSE_SCOPE diff --git a/third_party/renderman-26/plugin/hdPrman/light.h b/third_party/renderman-26/plugin/hdPrman/light.h new file mode 100644 index 0000000000..7db6b1030a --- /dev/null +++ b/third_party/renderman-26/plugin/hdPrman/light.h @@ -0,0 +1,60 @@ +// +// Copyright 2019 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// +#ifndef EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_LIGHT_H +#define EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_LIGHT_H + +#include "pxr/pxr.h" +#include "pxr/imaging/hd/light.h" +#include "Riley.h" + +PXR_NAMESPACE_OPEN_SCOPE + +class HdSceneDelegate; +class HdPrman_RenderParam; + +/// \class HdPrmanLight +/// +/// A representation for lights. +/// +class HdPrmanLight final : public HdLight +{ +public: + HdPrmanLight(SdfPath const& id, TfToken const& lightType); + ~HdPrmanLight() override; + + /// Synchronizes state from the delegate to this object. + void Sync(HdSceneDelegate *sceneDelegate, + HdRenderParam *renderParam, + HdDirtyBits *dirtyBits) override; + + /// Returns the minimal set of dirty bits to place in the + /// change tracker for use in the first sync of this prim. + /// Typically this would be all dirty bits. + HdDirtyBits GetInitialDirtyBitsMask() const override; + + void Finalize(HdRenderParam *renderParam) override; + +private: + + const TfToken _hdLightType; + riley::LightShaderId _shaderId; + riley::LightInstanceId _instanceId; + + // state for change tracking + riley::GeometryPrototypeId _geometryPrototypeId; + SdfPath _sourceGeomPath; + RtUString _lightShaderType; + TfToken _lightLink; + SdfPathVector _lightFilterPaths; + std::vector _lightFilterLinks; + TfToken _shadowLink; +}; + + +PXR_NAMESPACE_CLOSE_SCOPE + +#endif // EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_LIGHT_H diff --git a/third_party/renderman-26/plugin/hdPrman/lightFilter.cpp b/third_party/renderman-26/plugin/hdPrman/lightFilter.cpp new file mode 100644 index 0000000000..ad8d0ca59b --- /dev/null +++ b/third_party/renderman-26/plugin/hdPrman/lightFilter.cpp @@ -0,0 +1,139 @@ +// +// Copyright 2019 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// +#include "hdPrman/lightFilter.h" +#include "hdPrman/renderParam.h" +#include "hdPrman/debugCodes.h" +#include "hdPrman/rixStrings.h" +#include "hdPrman/utils.h" +#include "pxr/usd/sdf/types.h" +#include "pxr/base/tf/staticTokens.h" +#include "pxr/imaging/hd/light.h" +#include "pxr/imaging/hd/sceneDelegate.h" +#include "pxr/imaging/hd/version.h" +#include "pxr/imaging/hf/diagnostic.h" + +PXR_NAMESPACE_OPEN_SCOPE + +// For now, the procs in this file are boiler plate for when hdPrman needs to +// have light filters become prime citizens. This will probably happen when +// its time to implement shared light filters. For now, light filters are +// handled inside the lights in light.cpp. +// +// Also, for now base the HdPrmanLightFilter class on HdSprim as there +// currently is no HdLightFilter class. + +HdPrmanLightFilter::HdPrmanLightFilter(SdfPath const& id, + TfToken const& lightFilterType) + : HdSprim(id) + , _coordSysId(riley::CoordinateSystemId::InvalidId()) + , _rileyIsInSync(false) +{ + // XXX The lightFilterType parameter is always "lightFilter", so + // we ignore it. +} + +HdPrmanLightFilter::~HdPrmanLightFilter() = default; + +void +HdPrmanLightFilter::Finalize(HdRenderParam *renderParam) +{ + std::lock_guard lock(_syncToRileyMutex); + HdPrman_RenderParam *param = + static_cast(renderParam); + riley::Riley *riley = param->AcquireRiley(); + if (_coordSysId != riley::CoordinateSystemId::InvalidId()) { + riley->DeleteCoordinateSystem(_coordSysId); + _coordSysId = riley::CoordinateSystemId::InvalidId(); + } +} + +/* virtual */ +void +HdPrmanLightFilter::Sync(HdSceneDelegate *sceneDelegate, + HdRenderParam *renderParam, + HdDirtyBits *dirtyBits) +{ + HdPrman_RenderParam *param = + static_cast(renderParam); + +#if HD_API_VERSION >= 70 + if (*dirtyBits & HdLight::DirtyTransform) { +#else + if (*dirtyBits & HdChangeTracker::DirtyTransform) { +#endif + std::lock_guard lock(_syncToRileyMutex); + _rileyIsInSync = false; + _SyncToRileyWithLock(sceneDelegate, param->AcquireRiley()); + } + + *dirtyBits = HdChangeTracker::Clean; +} + +void +HdPrmanLightFilter::SyncToRiley( + HdSceneDelegate *sceneDelegate, + riley::Riley *riley) +{ + std::lock_guard lock(_syncToRileyMutex); + if (!_rileyIsInSync) { + _SyncToRileyWithLock(sceneDelegate, riley); + } +} + +void +HdPrmanLightFilter::_SyncToRileyWithLock( + HdSceneDelegate *sceneDelegate, + riley::Riley *riley) +{ + SdfPath const& id = GetId(); + + // Sample transform + HdTimeSampleArray xf; + sceneDelegate->SampleTransform(id, &xf); + TfSmallVector + xf_rt_values(xf.count); + for (size_t i=0; i < xf.count; ++i) { + xf_rt_values[i] = HdPrman_Utils::GfMatrixToRtMatrix(xf.values[i]); + } + const riley::Transform xform = { + unsigned(xf.count), xf_rt_values.data(), xf.times.data()}; + + RtParamList attrs; + + // Use the full path to identify this coordinate system, which + // is not user-named but implicitly part of the light filter. + RtUString coordSysName(id.GetText()); + attrs.SetString(RixStr.k_name, coordSysName); + + if (_coordSysId == riley::CoordinateSystemId::InvalidId()) { + _coordSysId = riley->CreateCoordinateSystem( + riley::UserId(stats::AddDataLocation(id.GetText()).GetValue()), + xform, attrs); + } else { + riley->ModifyCoordinateSystem(_coordSysId, &xform, &attrs); + } + + _rileyIsInSync = true; +} + +riley::CoordinateSystemId +HdPrmanLightFilter::GetCoordSysId() +{ + std::lock_guard lock(_syncToRileyMutex); + TF_VERIFY(_rileyIsInSync, "Must call SyncToRiley() first"); + return _coordSysId; +} + +/* virtual */ +HdDirtyBits +HdPrmanLightFilter::GetInitialDirtyBitsMask() const +{ + return HdChangeTracker::AllDirty; +} + +PXR_NAMESPACE_CLOSE_SCOPE + diff --git a/third_party/renderman-26/plugin/hdPrman/lightFilter.h b/third_party/renderman-26/plugin/hdPrman/lightFilter.h new file mode 100644 index 0000000000..d331ac4960 --- /dev/null +++ b/third_party/renderman-26/plugin/hdPrman/lightFilter.h @@ -0,0 +1,71 @@ +// +// Copyright 2019 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// +#ifndef EXT_RMANPKG_22_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_LIGHT_FILTER_H +#define EXT_RMANPKG_22_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_LIGHT_FILTER_H + +#include "pxr/pxr.h" +#include "pxr/imaging/hd/sprim.h" +#include "Riley.h" + +#include + +PXR_NAMESPACE_OPEN_SCOPE + +// For now, the procs in this file are boiler plate for when hdPrman needs to +// have light filters become prime citizens. This will probably happen when +// its time to implement shared light filters. For now, light filters are +// handled inside the lights in light.cpp. +// +// Also, for now base the HdPrmanLightFilter class on HdSprim as there +// currently is no HdLightFilter class. + +class HdSceneDelegate; +class HdPrman_RenderParam; + +/// \class HdPrmanLightFilter +/// +/// A representation for light filters. +/// +class HdPrmanLightFilter final : public HdSprim +{ +public: + HdPrmanLightFilter(SdfPath const& id, TfToken const& lightFilterType); + ~HdPrmanLightFilter() override; + + /// Synchronizes state from the delegate to this object. + void Sync(HdSceneDelegate *sceneDelegate, + HdRenderParam *renderParam, + HdDirtyBits *dirtyBits) override; + + /// Make sure this material has been updated in Riley. + void SyncToRiley( + HdSceneDelegate *sceneDelegate, + riley::Riley *riley); + + /// Returns the minimal set of dirty bits to place in the + /// change tracker for use in the first sync of this prim. + /// Typically this would be all dirty bits. + HdDirtyBits GetInitialDirtyBitsMask() const override; + + void Finalize(HdRenderParam *renderParam) override; + + riley::CoordinateSystemId GetCoordSysId(); + +private: + void _SyncToRileyWithLock( + HdSceneDelegate *sceneDelegate, + riley::Riley *riley); + + riley::CoordinateSystemId _coordSysId; + mutable std::mutex _syncToRileyMutex; + bool _rileyIsInSync; +}; + + +PXR_NAMESPACE_CLOSE_SCOPE + +#endif // EXT_RMANPKG_22_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_LIGHT_FILTER_H diff --git a/third_party/renderman-26/plugin/hdPrman/lightLinkingSceneIndexPlugin.cpp b/third_party/renderman-26/plugin/hdPrman/lightLinkingSceneIndexPlugin.cpp new file mode 100644 index 0000000000..2e60c2445a --- /dev/null +++ b/third_party/renderman-26/plugin/hdPrman/lightLinkingSceneIndexPlugin.cpp @@ -0,0 +1,93 @@ +// +// Copyright 2022 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// + +#include "pxr/imaging/hd/version.h" + +// There was no hdsi/version.h before this HD_API_VERSION. +#if HD_API_VERSION >= 58 + +#include "pxr/imaging/hdsi/version.h" + +#if HDSI_API_VERSION >= 13 +#define HDPRMAN_USE_LIGHT_LINKING_SCENE_INDEX +#endif + +#endif // #if HD_API_VERSION >= 58 + +#ifdef HDPRMAN_USE_LIGHT_LINKING_SCENE_INDEX + +#include "pxr/imaging/hd/sceneIndexPlugin.h" +#include "pxr/imaging/hd/sceneIndexPluginRegistry.h" +#include "pxr/imaging/hdsi/lightLinkingSceneIndex.h" + +#include "pxr/base/tf/envSetting.h" + +PXR_NAMESPACE_OPEN_SCOPE + +TF_DEFINE_PRIVATE_TOKENS( + _tokens, + ((sceneIndexPluginName, "HdPrman_LightLinkingSceneIndexPlugin")) +); + +TF_DEFINE_ENV_SETTING(HDPRMAN_ENABLE_LIGHT_LINKING_SCENE_INDEX, true, + "Enable registration for the light linking scene index."); + +//////////////////////////////////////////////////////////////////////////////// +// Plugin registration +//////////////////////////////////////////////////////////////////////////////// + +static const char * const _rendererDisplayName = "Prman"; +class HdPrman_LightLinkingSceneIndexPlugin; + +TF_REGISTRY_FUNCTION(TfType) +{ + HdSceneIndexPluginRegistry::Define(); +} + +TF_REGISTRY_FUNCTION(HdSceneIndexPlugin) +{ + if (TfGetEnvSetting(HDPRMAN_ENABLE_LIGHT_LINKING_SCENE_INDEX)) { + + // XXX Picking an arbitrary phase for now. If a procedural were to + // generate light prims, we'd want this to be after it. + // HdGpSceneIndexPlugin::GetInsertionPhase() currently returns 2. + // + const HdSceneIndexPluginRegistry::InsertionPhase insertionPhase = 4; + + HdSceneIndexPluginRegistry::GetInstance().RegisterSceneIndexForRenderer( + _rendererDisplayName, + _tokens->sceneIndexPluginName, + // XXX Update inputArgs to provide the list of geometry types + // supported by hdPrman. + nullptr, + insertionPhase, + HdSceneIndexPluginRegistry::InsertionOrderAtStart); + } +} + +//////////////////////////////////////////////////////////////////////////////// +// Scene Index Implementation +//////////////////////////////////////////////////////////////////////////////// + +class HdPrman_LightLinkingSceneIndexPlugin : + public HdSceneIndexPlugin +{ +public: + HdPrman_LightLinkingSceneIndexPlugin() = default; + +protected: + HdSceneIndexBaseRefPtr _AppendSceneIndex( + const HdSceneIndexBaseRefPtr &inputScene, + const HdContainerDataSourceHandle &inputArgs) override + { + return HdsiLightLinkingSceneIndex::New(inputScene, inputArgs); + } +}; + +PXR_NAMESPACE_CLOSE_SCOPE + +#endif // HDPRMAN_USE_LIGHT_LINKING_SCENE_INDEX \ No newline at end of file diff --git a/third_party/renderman-26/plugin/hdPrman/material.cpp b/third_party/renderman-26/plugin/hdPrman/material.cpp new file mode 100644 index 0000000000..92e7b86ba2 --- /dev/null +++ b/third_party/renderman-26/plugin/hdPrman/material.cpp @@ -0,0 +1,1132 @@ +// +// Copyright 2019 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// +#include "hdPrman/material.h" +#include "hdPrman/debugCodes.h" +#include "hdPrman/renderParam.h" +#include "hdPrman/utils.h" + +#include "pxr/base/gf/vec3f.h" +#include "pxr/usd/sdf/types.h" +#include "pxr/base/tf/getenv.h" +#include "pxr/base/tf/envSetting.h" +#include "pxr/base/tf/scopeDescription.h" +#include "pxr/base/tf/staticData.h" +#include "pxr/base/tf/staticTokens.h" +#include "pxr/imaging/hd/light.h" +#include "pxr/imaging/hd/rprim.h" +#include "pxr/imaging/hd/sceneDelegate.h" +#include "pxr/imaging/hf/diagnostic.h" +#include "RiTypesHelper.h" + +#include "pxr/usd/sdr/declare.h" +#include "pxr/usd/sdr/shaderNode.h" +#include "pxr/usd/sdr/shaderProperty.h" +#include "pxr/usd/sdr/registry.h" +#include + +PXR_NAMESPACE_OPEN_SCOPE + +TF_DEFINE_ENV_SETTING(HD_PRMAN_MATERIALID, true, + "Enable __materialid as hash of material network"); +static bool _enableMaterialID = + TfGetEnvSetting(HD_PRMAN_MATERIALID); + +TF_DEFINE_PRIVATE_TOKENS( + _tokens, + (PxrDisplace) + (bxdf) + (OSL) + (omitFromRender) + (material) + (surface) + ((materialid, "__materialid")) + (light) + (PrimvarPass) +); + +TF_MAKE_STATIC_DATA(NdrTokenVec, _sourceTypes) { + *_sourceTypes = { + TfToken("OSL"), + TfToken("RmanCpp"), +#ifdef PXR_MATERIALX_SUPPORT_ENABLED + TfToken("mtlx") +#endif + };} + +struct _HashMaterial { + size_t operator()(const HdMaterialNetwork2 &mat) const + { + size_t v=0; + for (TfToken const& primvarName: mat.primvars) { + boost::hash_combine(v, primvarName.Hash()); + } + for (auto const& node: mat.nodes) { + boost::hash_combine(v, node.first.GetHash()); + boost::hash_combine(v, node.second.nodeTypeId.Hash()); + for (auto const& param: node.second.parameters) { + boost::hash_combine(v, param.first.Hash()); + boost::hash_combine(v, param.second.GetHash()); + } + for (auto const& input: node.second.inputConnections) { + boost::hash_combine(v, input.first.Hash()); + for (auto const& conn: input.second) { + boost::hash_combine(v, conn.upstreamNode.GetHash()); + boost::hash_combine(v, conn.upstreamOutputName.Hash()); + } + } + } + for (auto const& term: mat.terminals) { + boost::hash_combine(v, term.first.Hash()); + boost::hash_combine(v, term.second.upstreamNode.GetHash()); + boost::hash_combine(v, term.second.upstreamOutputName.Hash()); + } + return v; + } +}; + +TfTokenVector const& +HdPrmanMaterial::GetShaderSourceTypes() +{ + return *_sourceTypes; +} + +HdMaterialNetwork2 const& +HdPrmanMaterial::GetMaterialNetwork() const +{ + // XXX We could make this API entry point do the sync as needed, + // if we passed in the necessary context. However, we should + // remove this and the retained _materialNetwork entirely, + // since it is solely used to allow UsdPreviewSurface materials + // to supply a PrimvarPass shader that in turn sets a disp bound. + // Now that scene indexes are handling UsdPreviewSurface + // conversion and material primvar attribute transfer, we should + // not need this whole affordance for that case. In the + // meantime, leave this here to guard against mis-usage. + std::lock_guard lock(_syncToRileyMutex); + TF_VERIFY(_rileyIsInSync, "Must call SyncToRiley() first"); + + return _materialNetwork; +} + +HdPrmanMaterial::HdPrmanMaterial(SdfPath const& id) + : HdMaterial(id) + , _materialId(riley::MaterialId::InvalidId()) + , _displacementId(riley::DisplacementId::InvalidId()) + , _rileyIsInSync(false) +{ + /* NOTHING */ +} + +HdPrmanMaterial::~HdPrmanMaterial() +{ +} + +void +HdPrmanMaterial::Finalize(HdRenderParam *renderParam) +{ + HdPrman_RenderParam *param = + static_cast(renderParam); + riley::Riley *riley = param->AcquireRiley(); + + std::lock_guard lock(_syncToRileyMutex); + _ResetMaterialWithLock(riley); +} + +void +HdPrmanMaterial::_ResetMaterialWithLock(riley::Riley *riley) +{ + if (_materialId != riley::MaterialId::InvalidId()) { + riley->DeleteMaterial(_materialId); + _materialId = riley::MaterialId::InvalidId(); + } + if (_displacementId != riley::DisplacementId::InvalidId()) { + riley->DeleteDisplacement(_displacementId); + _displacementId = riley::DisplacementId::InvalidId(); + } +} + +static VtArray +_ConvertToVec3fArray(const VtArray& v) +{ + VtArray out; + out.resize(v.size()); + for (size_t i=0; i(tokenPair.second, ok); + } + } + return 0; +} + +using _PathSet = std::unordered_set; + +// See also TfGetenvBool(). +static bool +_GetStringAsBool(std::string value, bool defaultValue) +{ + if (value.empty()) { + return defaultValue; + } else { + for (char& c: value) { + c = tolower(c); + } + return value == "true" || + value == "yes" || + value == "on" || + value == "1"; + } +} + +// Recursively convert a HdMaterialNode2 and its upstream dependencies +// to Riley equivalents. Avoids adding redundant nodes in the case +// of multi-path dependencies. +static bool +_ConvertNodes( + HdMaterialNetwork2 const& network, + SdfPath const& nodePath, + std::vector *result, + _PathSet* visitedNodes, + bool elideDefaults) +{ + // Check if we've processed this node before. If we have, we'll just return. + // This is not an error, since we often have multiple connection paths + // leading to the same upstream node. + if (visitedNodes->count(nodePath) > 0) { + return true; + } + visitedNodes->insert(nodePath); + + // Find HdMaterialNetwork2 node. + auto iter = network.nodes.find(nodePath); + if (iter == network.nodes.end()) { + // This could be caused by a bad connection to a non-existent node. + TF_WARN("Unknown material node '%s'", nodePath.GetText()); + return false; + } + HdMaterialNode2 const& node = iter->second; + // Riley expects nodes to be provided in topological dependency order. + // Pre-traverse upstream nodes. + for (auto const& connEntry: node.inputConnections) { + for (auto const& e: connEntry.second) { + // This method will just return if we've visited this upstream node + // before + _ConvertNodes(network, e.upstreamNode, result, visitedNodes, + elideDefaults); + } + } + + // Ignore nodes of id "PrimvarPass". This node is a workaround for + // UsdPreviewSurface materials and is not a registered shader node. + if (node.nodeTypeId == _tokens->PrimvarPass) { + return true; + } + + // Ignore nodes of id "PxrDisplace" that lack both parameters + // and connections. This can save render startup time by avoiding + // creating unnecessary Riley displacement networks. + if ((node.nodeTypeId == _tokens->PxrDisplace) + && node.parameters.empty() + && node.inputConnections.empty()) { + return true; + } + + // Find shader registry entry. + SdrRegistry &sdrRegistry = SdrRegistry::GetInstance(); + SdrShaderNodeConstPtr sdrEntry = + sdrRegistry.GetShaderNodeByIdentifier(node.nodeTypeId, *_sourceTypes); + if (!sdrEntry) { + TF_WARN("Unknown shader ID %s for node <%s>\n", + node.nodeTypeId.GetText(), nodePath.GetText()); + return false; + } + // Create equivalent Riley shading node. + riley::ShadingNode sn; + if (sdrEntry->GetContext() == _tokens->bxdf || + sdrEntry->GetContext() == SdrNodeContext->Surface || + sdrEntry->GetContext() == SdrNodeContext->Volume) { + sn.type = riley::ShadingNode::Type::k_Bxdf; + } + else if (sdrEntry->GetContext() == SdrNodeContext->Pattern || + sdrEntry->GetContext() == _tokens->OSL) + { + // In RMAN 24 all patterns are OSL shaders, that is, all patterns we have in Renderman + // are going to be flagged as k_Pattern for Riley. In the case of displacement Riley + // expects it to be flagged as k_Displacement and to be the last node of a network to + // create a specific displacement. So, we need to check if the OSL node that we receive + // is PxrDisplace to flag it as a displacement node instead of a general OSL node. + // If we don't do that, Riley will check that there is no displacement node in the network + // we are using and it will always return an invalid displacement handle to hdPrman. + if (node.nodeTypeId == _tokens->PxrDisplace) + sn.type = riley::ShadingNode::Type::k_Displacement; + else + sn.type = riley::ShadingNode::Type::k_Pattern; + } + else if (sdrEntry->GetContext() == SdrNodeContext->Displacement) + { + // We need to keep this for backwards compatibility with C++ patterns in case we + // use a version prior to RMAN 24. + sn.type = riley::ShadingNode::Type::k_Displacement; + } else if (sdrEntry->GetContext() == SdrNodeContext->Light) { + sn.type = riley::ShadingNode::Type::k_Light; + } else if (sdrEntry->GetContext() == SdrNodeContext->LightFilter) { + sn.type = riley::ShadingNode::Type::k_LightFilter; + } else { + TF_WARN("Unknown shader entry type '%s' for shader '%s'", + sdrEntry->GetContext().GetText(), sdrEntry->GetName().c_str()); + return false; + } + sn.handle = RtUString(nodePath.GetText()); + std::string shaderPath = sdrEntry->GetResolvedImplementationURI(); + if (shaderPath.empty()){ + TF_WARN("Shader '%s' did not provide a valid implementation path.", + sdrEntry->GetName().c_str()); + return false; + } + if (sn.type == riley::ShadingNode::Type::k_Displacement || + sn.type == riley::ShadingNode::Type::k_Light || + sn.type == riley::ShadingNode::Type::k_LightFilter) { + // Except for Displacement; + // in that case let the renderer choose, since RIS + // can only use a cpp Displacement shader and XPU + // can only use osl. + // Lights and light filters let the renderer choose by name too. + shaderPath = sdrEntry->GetImplementationName(); + } + + sn.name = RtUString(shaderPath.c_str()); + // Convert params + for (const auto& param: node.parameters) { + const SdrShaderProperty* prop = sdrEntry->GetShaderInput(param.first); + if (!prop) { + TF_DEBUG(HDPRMAN_MATERIALS) + .Msg("Unknown shader property '%s' for " + "shader '%s' at '%s'; ignoring.\n", + param.first.GetText(), + sdrEntry->GetName().c_str(), + nodePath.GetText()); + continue; + } + // Skip parameter values that match schema-defined defaults + if (elideDefaults && param.second == prop->GetDefaultValue()) { + continue; + } + // Filter by omitFromRender metadata to pre-empt warnings + // from RenderMan. + std::string omitFromRenderValStr; + if (TfMapLookup(prop->GetMetadata(), _tokens->omitFromRender, + &omitFromRenderValStr)) { + if (_GetStringAsBool(omitFromRenderValStr, false)) { + continue; + } + } + TfToken propType = prop->GetType(); + if (propType.IsEmpty()) { + // As a special case, silently ignore these on PxrDisplace. + // Automatically promoting the same network for this + // case causes a lot of errors. + if (node.nodeTypeId == _tokens->PxrDisplace) { + continue; + } + TF_DEBUG(HDPRMAN_MATERIALS) + .Msg("Unknown shader entry field type for " + "field '%s' on shader '%s' at '%s'; ignoring.\n", + param.first.GetText(), + sdrEntry->GetName().c_str(), + nodePath.GetText()); + continue; + } + + // Dispatch by propType and VtValue-held type. + // Cast value types to match where feasible. + bool ok = false; + RtUString name(prop->GetImplementationName().c_str()); + if (propType == SdrPropertyTypes->Struct || + propType == SdrPropertyTypes->Vstruct) { + // Ignore structs. They are only used as ways to + // pass data between shaders, not as a way to pass + // in parameters. + ok = true; + } else if (param.second.IsHolding()) { + GfVec2f v = param.second.UncheckedGet(); + if (propType == SdrPropertyTypes->Float) { + sn.params.SetFloatArray(name, v.data(), 2); + ok = true; + } + } else if (param.second.IsHolding()) { + GfVec3f v = param.second.UncheckedGet(); + if (propType == SdrPropertyTypes->Color) { + sn.params.SetColor(name, RtColorRGB(v[0], v[1], v[2])); + ok = true; + } else if (propType == SdrPropertyTypes->Vector) { + sn.params.SetVector(name, RtVector3(v[0], v[1], v[2])); + ok = true; + } else if (propType == SdrPropertyTypes->Point) { + sn.params.SetPoint(name, RtPoint3(v[0], v[1], v[2])); + ok = true; + } else if (propType == SdrPropertyTypes->Normal) { + sn.params.SetNormal(name, RtNormal3(v[0], v[1], v[2])); + ok = true; + } else if (propType == SdrPropertyTypes->Float) { + sn.params.SetFloatArray(name, v.data(), 3); + ok = true; + } + } else if (param.second.IsHolding()) { + GfVec4f v = param.second.UncheckedGet(); + if (propType == SdrPropertyTypes->Float) { + sn.params.SetFloatArray(name, v.data(), 4); + ok = true; + } + } else if (param.second.IsHolding>()) { + const VtArray& v = + param.second.UncheckedGet>(); + if (propType == SdrPropertyTypes->Color) { + sn.params.SetColorArray( + name, + reinterpret_cast(v.cdata()), + v.size()); + ok = true; + } else if (propType == SdrPropertyTypes->Vector) { + sn.params.SetVectorArray( + name, + reinterpret_cast(v.cdata()), + v.size()); + ok = true; + } else if (propType == SdrPropertyTypes->Point) { + sn.params.SetPointArray( + name, + reinterpret_cast(v.cdata()), + v.size()); + ok = true; + } else if (propType == SdrPropertyTypes->Normal) { + sn.params.SetNormalArray( + name, + reinterpret_cast(v.cdata()), + v.size()); + ok = true; + } + } else if (param.second.IsHolding()) { + const GfVec3d& v = param.second.UncheckedGet(); + if (propType == SdrPropertyTypes->Color) { + sn.params.SetColor(name, RtColorRGB(v[0], v[1], v[2])); + ok = true; + } else if (propType == SdrPropertyTypes->Point) { + sn.params.SetPoint(name, RtPoint3(v[0], v[1], v[2])); + ok = true; + } + } else if (param.second.IsHolding>()) { + if (propType == SdrPropertyTypes->Color) { + const VtArray& vd = + param.second.UncheckedGet>(); + VtArray v = _ConvertToVec3fArray(vd); + sn.params.SetColorArray( + name, + reinterpret_cast(v.cdata()), + v.size()); + ok = true; + } else if (propType == SdrPropertyTypes->Point) { + const VtArray& vd = + param.second.UncheckedGet>(); + VtArray v = _ConvertToVec3fArray(vd); + sn.params.SetPointArray( + name, + reinterpret_cast(v.cdata()), + v.size()); + ok = true; + } + } else if (param.second.IsHolding()) { + float v = param.second.UncheckedGet(); + if (propType == SdrPropertyTypes->Int) { + sn.params.SetInteger(name, int(v)); + ok = true; + } else if (propType == SdrPropertyTypes->Float) { + sn.params.SetFloat(name, v); + ok = true; + } + } else if (param.second.IsHolding>()) { + const VtArray& v = + param.second.UncheckedGet>(); + if (propType == SdrPropertyTypes->Float) { + sn.params.SetFloatArray(name, v.cdata(), v.size()); + ok = true; + } + } else if (param.second.IsHolding()) { + int v = param.second.UncheckedGet(); + if (propType == SdrPropertyTypes->Float) { + sn.params.SetFloat(name, v); + ok = true; + } else if (propType == SdrPropertyTypes->Int) { + sn.params.SetInteger(name, v); + ok = true; + } + } else if (param.second.IsHolding>()) { + if (propType == SdrPropertyTypes->Float) { + const VtArray& v = + param.second.UncheckedGet>(); + sn.params.SetFloatArray(name, v.cdata(), v.size()); + ok = true; + } else if (propType == SdrPropertyTypes->Int) { + const VtArray& v = + param.second.UncheckedGet>(); + sn.params.SetIntegerArray(name, v.cdata(), v.size()); + ok = true; + } + } else if (param.second.IsHolding()) { + TfToken v = param.second.UncheckedGet(); + // A token can represent and enum option for an Int property + if (propType == SdrPropertyTypes->Int) { + const int value = _ConvertOptionTokenToInt( + v, prop->GetOptions(), &ok); + if (ok) { + sn.params.SetInteger(name, value); + } + } else { + sn.params.SetString(name, RtUString(v.GetText())); + ok = true; + } + } else if (param.second.IsHolding()) { + std::string v = param.second.UncheckedGet(); + // A string can represent and enum option for an Int property + if (propType == SdrPropertyTypes->Int) { + const int value = _ConvertOptionTokenToInt( + TfToken(v), prop->GetOptions(), &ok); + if (ok) { + sn.params.SetInteger(name, value); + } + } else { + sn.params.SetString(name, RtUString(v.c_str())); + ok = true; + } + } else if (param.second.IsHolding()) { + // This code processes nodes for both surface materials + // and lights. RenderMan does not flip light textures + // as it does surface textures. + bool isLight = (sn.type == riley::ShadingNode::Type::k_Light && + param.first == HdLightTokens->textureFile); + + RtUString v = HdPrman_Utils::ResolveAssetToRtUString( + param.second.UncheckedGet(), + !isLight, // only flip if NOT a light + isLight ? _tokens->light.GetText() : + _tokens->material.GetText()); + + sn.params.SetString(name, v); + ok = true; + } else if (param.second.IsHolding()) { + // RixParamList (specifically, RixDataType) doesn't have + // a bool entry; we convert to integer instead. + int v = param.second.UncheckedGet(); + sn.params.SetInteger(name, v); + ok = true; + } else if (param.second.IsHolding()) { + if (propType == SdrPropertyTypes->Matrix) { + const RtMatrix4x4 v = HdPrman_Utils::GfMatrixToRtMatrix( + param.second.UncheckedGet()); + sn.params.SetMatrix(name, v); + ok = true; + } + } + if (!ok) { + TF_DEBUG(HDPRMAN_MATERIALS) + .Msg("Unknown shading parameter type '%s'; skipping " + "parameter '%s' on node '%s'; " + "expected type '%s'\n", + param.second.GetTypeName().c_str(), + param.first.GetText(), + nodePath.GetText(), + propType.GetText()); + } + } + // Convert connected inputs. + for (auto const& connEntry: node.inputConnections) { + // Find the shader properties, so that we can look up + // the property implementation names. + SdrShaderPropertyConstPtr downstreamProp = + sdrEntry->GetShaderInput(connEntry.first); + if (!downstreamProp) { + TF_WARN("Unknown downstream property %s", connEntry.first.data()); + continue; + } + RtUString name(downstreamProp->GetImplementationName().c_str()); + TfToken const propType = downstreamProp->GetType(); + + // Gather input (or inputs, for array-valued inputs) for shader + // property. + std::vector inputRefs; + + for (auto const& e: connEntry.second) { + // Find the output & input shader nodes of the connection. + HdMaterialNode2 const* upstreamNode = + TfMapLookupPtr(network.nodes, e.upstreamNode); + if (!upstreamNode) { + TF_WARN("Unknown upstream node %s", e.upstreamNode.GetText()); + continue; + } + // Ignore nodes of id "PrimvarPass". This node is a workaround for + // UsdPreviewSurface materials and is not a registered shader node. + if (upstreamNode->nodeTypeId == _tokens->PrimvarPass) { + continue; + } + + SdrShaderNodeConstPtr upstreamSdrEntry = + sdrRegistry.GetShaderNodeByIdentifier( + upstreamNode->nodeTypeId, *_sourceTypes); + if (!upstreamSdrEntry) { + TF_WARN("Unknown shader for upstream node %s", + e.upstreamNode.GetText()); + continue; + } + SdrShaderPropertyConstPtr upstreamProp = + upstreamSdrEntry->GetShaderOutput(e.upstreamOutputName); + // In the case of terminals there is no upstream output name + // since the whole node is referenced as a whole + if (!upstreamProp && propType != SdrPropertyTypes->Terminal) { + TF_WARN("Unknown upstream property %s", + e.upstreamOutputName.data()); + continue; + } + // Prman syntax for parameter references is "handle:param". + RtUString inputRef; + if (!upstreamProp) { + inputRef = RtUString(e.upstreamNode.GetString().c_str()); + } else { + inputRef = RtUString( + (e.upstreamNode.GetString()+":" + + upstreamProp->GetImplementationName().c_str()) + .c_str()); + } + inputRefs.push_back(inputRef); + } + + // Establish the Riley connection. + size_t const numInputRefs = inputRefs.size(); + if (numInputRefs > 0) { + if (propType == SdrPropertyTypes->Color) { + if (numInputRefs == 1) { + sn.params.SetColorReference(name, inputRefs[0]); + } else { + sn.params.SetColorReferenceArray( + name, inputRefs.data(), numInputRefs); + } + } else if (propType == SdrPropertyTypes->Vector) { + if (numInputRefs == 1) { + sn.params.SetVectorReference(name, inputRefs[0]); + } else { + sn.params.SetVectorReferenceArray( + name, inputRefs.data(), numInputRefs); + } + } else if (propType == SdrPropertyTypes->Point) { + if (numInputRefs == 1) { + sn.params.SetPointReference(name, inputRefs[0]); + } else { + sn.params.SetPointReferenceArray( + name, inputRefs.data(), numInputRefs); + } + } else if (propType == SdrPropertyTypes->Normal) { + if (numInputRefs == 1) { + sn.params.SetNormalReference(name, inputRefs[0]); + } else { + sn.params.SetNormalReferenceArray( + name, inputRefs.data(), numInputRefs); + } + } else if (propType == SdrPropertyTypes->Float) { + if (numInputRefs == 1) { + sn.params.SetFloatReference(name, inputRefs[0]); + } else { + sn.params.SetFloatReferenceArray( + name, inputRefs.data(), numInputRefs); + } + } else if (propType == SdrPropertyTypes->Int) { + if (numInputRefs == 1) { + sn.params.SetIntegerReference(name, inputRefs[0]); + } else { + sn.params.SetIntegerReferenceArray( + name, inputRefs.data(), numInputRefs); + } + } else if (propType == SdrPropertyTypes->String) { + if (numInputRefs == 1) { + sn.params.SetStringReference(name, inputRefs[0]); + } else { + sn.params.SetStringReferenceArray( + name, inputRefs.data(), numInputRefs); + } + } else if (propType == SdrPropertyTypes->Struct) { + if (numInputRefs == 1) { + sn.params.SetStructReference(name, inputRefs[0]); + } else { + TF_WARN("Unsupported type struct array for property '%s' " + "on shader '%s' at '%s'; ignoring.", + connEntry.first.data(), + sdrEntry->GetName().c_str(), + nodePath.GetText()); + } + } else if (propType == SdrPropertyTypes->Terminal) { + if (numInputRefs == 1) { + sn.params.SetBxdfReference(name, inputRefs[0]); + } else { + sn.params.SetBxdfReferenceArray( + name, inputRefs.data(), numInputRefs); + } + } else if (propType == SdrPropertyTypes->Matrix) { + if (numInputRefs == 1) { + sn.params.SetMatrixReference(name, inputRefs[0]); + } else { + sn.params.SetMatrixReferenceArray( + name, inputRefs.data(), numInputRefs); + } + } else { + TF_WARN("Unknown type '%s' for property '%s' " + "on shader '%s' at %s; ignoring.", + propType.GetText(), + connEntry.first.data(), + sdrEntry->GetName().c_str(), + nodePath.GetText()); + } + } + } + + result->emplace_back(std::move(sn)); + + return true; +} + +bool +HdPrman_ConvertHdMaterialNetwork2ToRmanNodes( + HdMaterialNetwork2 const& network, + SdfPath const& nodePath, + std::vector *result) +{ + // If XPU_INTERACTIVE_SHADER_EDITS is true, do not elide defaults. + // This makes it faster to edit parameter values later. + // Look this env var up here since it can be changed in-app. + bool elideDefaults = !TfGetenvBool("XPU_INTERACTIVE_SHADER_EDITS", false); + + _PathSet visitedNodes; + return _ConvertNodes( + network, nodePath, result, &visitedNodes, elideDefaults); +} + +// Debug helper +void +HdPrman_DumpNetwork(HdMaterialNetwork2 const& network, SdfPath const& id) +{ + printf("material network for %s:\n", id.GetText()); + for (auto const& nodeEntry: network.nodes) { + printf(" --Node--\n"); + printf(" path: %s\n", nodeEntry.first.GetText()); + printf(" type: %s\n", nodeEntry.second.nodeTypeId.GetText()); + for (auto const& paramEntry: nodeEntry.second.parameters) { + printf(" param: %s = %s\n", + paramEntry.first.GetText(), + TfStringify(paramEntry.second).c_str()); + } + for (auto const& connEntry: nodeEntry.second.inputConnections) { + for (auto const& e: connEntry.second) { + printf(" connection: %s <-> %s @ %s\n", + connEntry.first.GetText(), + e.upstreamOutputName.GetText(), + e.upstreamNode.GetText()); + } + } +} + printf(" --Terminals--\n"); + for (auto const& terminalEntry: network.terminals) { + printf(" %s (downstream) <-> %s @ %s (upstream)\n", + terminalEntry.first.GetText(), + terminalEntry.second.upstreamOutputName.GetText(), + terminalEntry.second.upstreamNode.GetText()); + } +} + +// Convert given HdMaterialNetwork2 to Riley material and displacement +// shader networks. If the Riley network exists, it will be modified; +// otherwise it will be created as needed. +static void +_ConvertHdMaterialNetwork2ToRman( + HdSceneDelegate *sceneDelegate, + riley::Riley *riley, + SdfPath const& id, + const HdMaterialNetwork2 &network, + riley::MaterialId *materialId, + riley::DisplacementId *displacementId) +{ + HD_TRACE_FUNCTION(); + std::vector nodes; + nodes.reserve(network.nodes.size()); + bool materialFound = false, displacementFound = false; + + for (auto const& terminal: network.terminals) { + if (HdPrman_ConvertHdMaterialNetwork2ToRmanNodes( + network, terminal.second.upstreamNode, &nodes)) { + if (nodes.empty()) { + // Already emitted a specific warning. + continue; + } + // Compute a hash of the material network, and pass it as + // __materialid on the terminal shader node. RenderMan uses + // this detect and re-use material netowrks, which is valuable + // in production scenes where upstream scene instancing did + // not already catch the reuse. + if (_enableMaterialID) { + static RtUString const materialid = RtUString("__materialid"); + const size_t networkHash = _HashMaterial()(network); + nodes.back().params.SetString( + materialid, + RtUString(TfStringify(networkHash).c_str())); + } + if (terminal.first == HdMaterialTerminalTokens->surface || + terminal.first == HdMaterialTerminalTokens->volume) { + // Create or modify Riley material. + materialFound = true; + TRACE_SCOPE("_ConvertHdMaterialNetwork2ToRman - Update Riley Material"); + if (*materialId == riley::MaterialId::InvalidId()) { + TRACE_SCOPE("riley::CreateMaterial"); + *materialId = riley->CreateMaterial( + riley::UserId(stats::AddDataLocation(id.GetText()).GetValue()), + {static_cast(nodes.size()), &nodes[0]}, + RtParamList()); + } else { + TRACE_SCOPE("riley::ModifyMaterial"); + riley::ShadingNetwork const material = { + static_cast(nodes.size()), &nodes[0]}; + riley->ModifyMaterial(*materialId, &material, nullptr); + } + if (*materialId == riley::MaterialId::InvalidId()) { + TF_WARN("Failed to create material %s\n", + id.GetText()); + } + } else if (terminal.first == + HdMaterialTerminalTokens->displacement) { + // Create or modify Riley displacement. + TRACE_SCOPE("_ConvertHdMaterialNetwork2ToRman - Update Riley Displacement"); + displacementFound = true; + if (*displacementId == riley::DisplacementId::InvalidId()) { + TRACE_SCOPE("riley::CreateDisplacement"); + *displacementId = riley->CreateDisplacement( + riley::UserId(stats::AddDataLocation(id.GetText()).GetValue()), + {static_cast(nodes.size()), &nodes[0]}, + RtParamList()); + } else { + TRACE_SCOPE("riley::ModifyDisplacement"); + riley::ShadingNetwork const displacement = { + static_cast(nodes.size()), &nodes[0]}; + riley::DisplacementResult const result = + riley->ModifyDisplacement(*displacementId, + &displacement, + nullptr); + if (result == riley::DisplacementResult::k_ResendPrimVars) { + // Mark prims dirty so they pick up new displacement. + HdRenderIndex& index = + sceneDelegate->GetRenderIndex(); + HdChangeTracker& changeTracker = + index.GetChangeTracker(); + for(auto rprimid : index.GetRprimIds()) { + HdRprim const *rprim = index.GetRprim(rprimid); + if(rprim->GetMaterialId() == id) { + changeTracker.MarkRprimDirty( + rprimid, HdChangeTracker::DirtyPrimvar); + } + } + } + } + if (*displacementId == riley::DisplacementId::InvalidId()) { + TF_WARN("Failed to create displacement %s\n", + id.GetText()); + } + } + } else { + TF_WARN("Failed to convert nodes for %s\n", id.GetText()); + } + nodes.clear(); + } + // Free dis-used networks. + if (!materialFound) { + riley->DeleteMaterial(*materialId); + *materialId = riley::MaterialId::InvalidId(); + } + if (!displacementFound) { + riley->DeleteDisplacement(*displacementId); + *displacementId = riley::DisplacementId::InvalidId(); + } +} + +/* virtual */ +void +HdPrmanMaterial::Sync(HdSceneDelegate *sceneDelegate, + HdRenderParam *renderParam, + HdDirtyBits *dirtyBits) +{ + HD_TRACE_FUNCTION(); + + HdPrman_RenderParam *param = + static_cast(renderParam); + + if ((*dirtyBits & HdMaterial::DirtyResource) || + (*dirtyBits & HdMaterial::DirtyParams)) { + + std::lock_guard lock(_syncToRileyMutex); + if (_rileyIsInSync) { + // Material was previously pushed to Riley, so sync + // immediately, because we cannot assume there will be + // a subsequent gprim update that would pull on this material + _rileyIsInSync = false; + _SyncToRileyWithLock(sceneDelegate, param->AcquireRiley()); + } else { + // Otherwise, wait until a gprim pulls on this material + // to sync it to Riley. This avoids doing any further + // work for unused materials, and moves remaining work + // from single-threaded Hydra sprim sync + // to multi-threaded Hydra rprim sync. + } + } + *dirtyBits = HdChangeTracker::Clean; +} + +void +HdPrmanMaterial::SyncToRiley( + HdSceneDelegate *sceneDelegate, + riley::Riley *riley) +{ + { + TRACE_SCOPE("HdPrmanMaterial::SyncToRiley - wait for lock"); + _syncToRileyMutex.lock(); + } + std::lock_guard lock(_syncToRileyMutex, std::adopt_lock); + if (!_rileyIsInSync) { + _SyncToRileyWithLock(sceneDelegate, riley); + } +} + +void +HdPrmanMaterial::_SyncToRileyWithLock( + HdSceneDelegate *sceneDelegate, + riley::Riley *riley) +{ + SdfPath const& id = GetId(); + VtValue hdMatVal = sceneDelegate->GetMaterialResource(id); + + if (hdMatVal.IsHolding()) { + TF_DESCRIBE_SCOPE("Processing material %s", id.GetName().c_str()); + // Convert HdMaterial to HdMaterialNetwork2 form. + _materialNetwork = HdConvertToHdMaterialNetwork2( + hdMatVal.UncheckedGet()); + if (TfDebug::IsEnabled(HDPRMAN_MATERIALS)) { + HdPrman_DumpNetwork(_materialNetwork, id); + } + _ConvertHdMaterialNetwork2ToRman(sceneDelegate, + riley, id, _materialNetwork, + &_materialId, &_displacementId); + } else { + TF_CODING_ERROR("HdPrmanMaterial: Expected material resource " + "for <%s> to contain material, but found %s instead.", + id.GetText(), hdMatVal.GetTypeName().c_str()); + _ResetMaterialWithLock(riley); + } + + _rileyIsInSync = true; +} + +/* virtual */ +HdDirtyBits +HdPrmanMaterial::GetInitialDirtyBitsMask() const +{ + return HdChangeTracker::AllDirty; +} + +bool +HdPrmanMaterial::IsValid() const +{ + return _materialId != riley::MaterialId::InvalidId(); +} + +HdMaterialNetwork2 +HdPrmanMaterial_GetFallbackSurfaceMaterialNetwork() +{ + // We expect this to be called once, at init time, but drop a trace + // scope in just in case that changes. Accordingly, we also don't + // bother creating static tokens for the single-use cases below. + HD_TRACE_FUNCTION(); + + const std::map nodes = { + { + // path + SdfPath("/Primvar_displayColor"), + // node info + HdMaterialNode2 { + // nodeTypeId + TfToken("PxrPrimvar"), + // parameters + { + { TfToken("varname"), + VtValue(TfToken("displayColor")) }, + { TfToken("defaultColor"), + VtValue(GfVec3f(0.5, 0.5, 0.5)) }, + { TfToken("type"), + VtValue(TfToken("color")) }, + }, + }, + }, + { + // path + SdfPath("/Primvar_displayRoughness"), + // node info + HdMaterialNode2 { + // nodeTypeId + TfToken("PxrPrimvar"), + // parameters + { + { TfToken("varname"), + VtValue(TfToken("displayRoughness")) }, + { TfToken("defaultFloat"), + VtValue(1.0f) }, + { TfToken("type"), + VtValue(TfToken("float")) }, + }, + }, + }, + { + // path + SdfPath("/Primvar_displayOpacity"), + // node info + HdMaterialNode2 { + // nodeTypeId + TfToken("PxrPrimvar"), + // parameters + { + { TfToken("varname"), + VtValue(TfToken("displayOpacity")) }, + { TfToken("defaultFloat"), + VtValue(1.0f) }, + { TfToken("type"), + VtValue(TfToken("float")) }, + }, + }, + }, + { + // path + SdfPath("/Primvar_displayMetallic"), + // node info + HdMaterialNode2 { + // nodeTypeId + TfToken("PxrPrimvar"), + // parameters + { + { TfToken("varname"), + VtValue(TfToken("displayMetallic")) }, + { TfToken("defaultFloat"), + VtValue(0.0f) }, + { TfToken("type"), + VtValue(TfToken("float")) }, + }, + }, + }, + + // UsdPreviewSurfaceParameters + { + // path + SdfPath("/UsdPreviewSurfaceParameters"), + // node info + HdMaterialNode2 { + // nodeTypeId + TfToken("UsdPreviewSurfaceParameters"), + // parameters + {}, + // connections + { + { TfToken("diffuseColor"), + { { SdfPath("/Primvar_displayColor"), + TfToken("resultRGB") } } }, + { TfToken("roughness"), + { { SdfPath("/Primvar_displayRoughness"), + TfToken("resultF") } } }, + { TfToken("metallic"), + { { SdfPath("/Primvar_displayMetallic"), + TfToken("resultF") } } }, + { TfToken("opacity"), + { { SdfPath("/Primvar_displayOpacity"), + TfToken("resultF") } } }, + }, + }, + }, + // PxrSurface (connected to UsdPreviewSurfaceParameters) + { + // path + SdfPath("/PxrSurface"), + // node info + HdMaterialNode2 { + // nodeTypeId + TfToken("PxrSurface"), + // parameters + { + { TfToken("specularModelType"), + VtValue(int(1)) }, + { TfToken("diffuseDoubleSided"), + VtValue(int(1)) }, + { TfToken("specularDoubleSided"), + VtValue(int(1)) }, + { TfToken("specularFaceColor"), + VtValue(GfVec3f(0.04)) }, + { TfToken("specularEdgeColor"), + VtValue(GfVec3f(1.0)) }, + }, + // connections + { + { TfToken("diffuseColor"), + {{ SdfPath("/UsdPreviewSurfaceParameters"), + TfToken("diffuseColorOut") }} }, + { TfToken("diffuseGain"), + {{ SdfPath("/UsdPreviewSurfaceParameters"), + TfToken("diffuseGainOut") }} }, + { TfToken("specularFaceColor"), + {{ SdfPath("/UsdPreviewSurfaceParameters"), + TfToken("specularFaceColorOut") }} }, + { TfToken("specularEdgeColor"), + {{ SdfPath("/UsdPreviewSurfaceParameters"), + TfToken("specularEdgeColorOut") }} }, + { TfToken("specularRoughness"), + {{ SdfPath("/UsdPreviewSurfaceParameters"), + TfToken("specularRoughnessOut") }} }, + { TfToken("presence"), + {{ SdfPath("/Primvar_displayOpacity"), + TfToken("resultF") }} }, + }, + }, + }, + }; + + const std::map terminals = { + { TfToken("surface"), + HdMaterialConnection2 { + SdfPath("/PxrSurface"), + TfToken("outputName") } + }, + }; + + const TfTokenVector primvars = { + TfToken("displayColor"), + TfToken("displayMetallic"), + TfToken("displayOpacity"), + TfToken("displayRoughness"), + }; + + return HdMaterialNetwork2{nodes, terminals, primvars}; +} + +PXR_NAMESPACE_CLOSE_SCOPE + diff --git a/third_party/renderman-26/plugin/hdPrman/material.h b/third_party/renderman-26/plugin/hdPrman/material.h new file mode 100644 index 0000000000..df58857fd1 --- /dev/null +++ b/third_party/renderman-26/plugin/hdPrman/material.h @@ -0,0 +1,92 @@ +// +// Copyright 2019 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// +#ifndef EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_MATERIAL_H +#define EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_MATERIAL_H + +#include "pxr/pxr.h" +#include "pxr/imaging/hd/material.h" +#include "Riley.h" +#include + +PXR_NAMESPACE_OPEN_SCOPE + +class HdSceneDelegate; +class HdPrman_RenderParam; + +/// \class HdPrmanMaterial +/// +/// A representation for materials (including displacement) in prman. +/// +class HdPrmanMaterial final : public HdMaterial +{ +public: + HdPrmanMaterial(SdfPath const& id); + ~HdPrmanMaterial() override; + + /// Synchronizes state from the delegate to this object. + void Sync(HdSceneDelegate *sceneDelegate, + HdRenderParam *renderParam, + HdDirtyBits *dirtyBits) override; + + /// Returns the minimal set of dirty bits to place in the + /// change tracker for use in the first sync of this prim. + /// Typically this would be all dirty bits. + HdDirtyBits GetInitialDirtyBitsMask() const override; + + riley::MaterialId GetMaterialId() const { return _materialId; } + riley::DisplacementId GetDisplacementId() const { return _displacementId; } + + /// Return true if this material is valid. + bool IsValid() const; + + void Finalize(HdRenderParam *renderParam) override; + + /// Return the static list of tokens supported. + static TfTokenVector const& GetShaderSourceTypes(); + + /// Return the material network after filtering. + HdMaterialNetwork2 const& GetMaterialNetwork() const; + + /// Make sure this material has been updated in Riley. + void SyncToRiley( + HdSceneDelegate *sceneDelegate, + riley::Riley *riley); + +private: + void _ResetMaterialWithLock(riley::Riley *riley); + void _SyncToRileyWithLock( + HdSceneDelegate *sceneDelegate, + riley::Riley *riley); + + riley::MaterialId _materialId; + riley::DisplacementId _displacementId; + + // XXX only used to set disp bound for UsdPreviewMaterial cases + HdMaterialNetwork2 _materialNetwork; + + mutable std::mutex _syncToRileyMutex; + bool _rileyIsInSync; +}; + +/// Helper function for converting an HdMaterialNetwork into Riley shading +/// nodes. Lights and light filters, in addition to materials, need to be able +/// to perform this conversion. +bool +HdPrman_ConvertHdMaterialNetwork2ToRmanNodes( + HdMaterialNetwork2 const& network, + SdfPath const& nodePath, + std::vector *result); + +/// Return the fallback surface material network description. This network +/// is meant to resemble Storm's fallback material. It uses displayColor, +/// displayRoughness, displayOpacity, and displayMetallic. +HdMaterialNetwork2 +HdPrmanMaterial_GetFallbackSurfaceMaterialNetwork(); + +PXR_NAMESPACE_CLOSE_SCOPE + +#endif // EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_MATERIAL_H diff --git a/third_party/renderman-26/plugin/hdPrman/materialPrimvarTransferSceneIndexPlugin.cpp b/third_party/renderman-26/plugin/hdPrman/materialPrimvarTransferSceneIndexPlugin.cpp new file mode 100644 index 0000000000..60d003e11d --- /dev/null +++ b/third_party/renderman-26/plugin/hdPrman/materialPrimvarTransferSceneIndexPlugin.cpp @@ -0,0 +1,66 @@ +// +// Copyright 2022 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// +#include "hdPrman/materialPrimvarTransferSceneIndexPlugin.h" + +#include "pxr/imaging/hd/sceneIndexPluginRegistry.h" +#include "pxr/imaging/hd/sceneIndexPluginRegistry.h" +#include "pxr/imaging/hdsi/materialPrimvarTransferSceneIndex.h" + +PXR_NAMESPACE_OPEN_SCOPE + +TF_DEFINE_PRIVATE_TOKENS( + _tokens, + ((sceneIndexPluginName, "HdPrman_MaterialPrimvarTransferSceneIndexPlugin")) +); + +//////////////////////////////////////////////////////////////////////////////// +// Plugin registrations +//////////////////////////////////////////////////////////////////////////////// + +static const char * const _rendererDisplayName = "Prman"; + +TF_REGISTRY_FUNCTION(TfType) +{ + HdSceneIndexPluginRegistry::Define< + HdPrman_MaterialPrimvarTransferSceneIndexPlugin>(); +} + +TF_REGISTRY_FUNCTION(HdSceneIndexPlugin) +{ + // Should be chained *after* the extComputationPrimvarPruningSceneIndex and + // procedural expansion. + // Avoiding an additional dependency on hdGp in hdPrman and hardcoding it + // for now. + const HdSceneIndexPluginRegistry::InsertionPhase + insertionPhase = 3; // HdGpSceneIndexPlugin()::GetInsertionPhase() + 1; + + // Register the plugins conditionally. + HdSceneIndexPluginRegistry::GetInstance().RegisterSceneIndexForRenderer( + _rendererDisplayName, + _tokens->sceneIndexPluginName, + nullptr, // no argument data necessary + insertionPhase, + HdSceneIndexPluginRegistry::InsertionOrderAtStart); +} + +//////////////////////////////////////////////////////////////////////////////// +// Scene Index Implementations +//////////////////////////////////////////////////////////////////////////////// + +HdPrman_MaterialPrimvarTransferSceneIndexPlugin:: +HdPrman_MaterialPrimvarTransferSceneIndexPlugin() = default; + +HdSceneIndexBaseRefPtr +HdPrman_MaterialPrimvarTransferSceneIndexPlugin::_AppendSceneIndex( + const HdSceneIndexBaseRefPtr &inputScene, + const HdContainerDataSourceHandle &inputArgs) +{ + TF_UNUSED(inputArgs); + return HdsiMaterialPrimvarTransferSceneIndex::New(inputScene); +} + +PXR_NAMESPACE_CLOSE_SCOPE diff --git a/third_party/renderman-26/plugin/hdPrman/materialPrimvarTransferSceneIndexPlugin.h b/third_party/renderman-26/plugin/hdPrman/materialPrimvarTransferSceneIndexPlugin.h new file mode 100644 index 0000000000..19de2f05f5 --- /dev/null +++ b/third_party/renderman-26/plugin/hdPrman/materialPrimvarTransferSceneIndexPlugin.h @@ -0,0 +1,35 @@ +// +// Copyright 2022 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// +#ifndef EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_MATERIAL_PRIMVAR_TRANSFER_SCENE_INDEX_PLUGIN_H +#define EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_MATERIAL_PRIMVAR_TRANSFER_SCENE_INDEX_PLUGIN_H + +#include "pxr/pxr.h" +#include "pxr/imaging/hd/sceneIndexPlugin.h" +#include "hdPrman/api.h" + +PXR_NAMESPACE_OPEN_SCOPE + +/// \class HdPrman_MaterialPrimvarTransferSceneIndexPlugin +/// +/// Prman scene index plugin that transfers primvars/attributes +/// from materials to the geometry that binds the material. +/// +class HdPrman_MaterialPrimvarTransferSceneIndexPlugin : + public HdSceneIndexPlugin +{ +public: + HdPrman_MaterialPrimvarTransferSceneIndexPlugin(); + +protected: + HdSceneIndexBaseRefPtr _AppendSceneIndex( + const HdSceneIndexBaseRefPtr &inputScene, + const HdContainerDataSourceHandle &inputArgs) override; +}; + +PXR_NAMESPACE_CLOSE_SCOPE + +#endif //EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_MATERIAL_PRIMVAR_TRANSFER_SCENE_INDEX_PLUGIN_H diff --git a/third_party/renderman-26/plugin/hdPrman/matfiltConvertPreviewMaterial.cpp b/third_party/renderman-26/plugin/hdPrman/matfiltConvertPreviewMaterial.cpp new file mode 100644 index 0000000000..9be573c89f --- /dev/null +++ b/third_party/renderman-26/plugin/hdPrman/matfiltConvertPreviewMaterial.cpp @@ -0,0 +1,468 @@ +// +// Copyright 2019 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// +#include "hdPrman/matfiltConvertPreviewMaterial.h" +#include "hdPrman/debugCodes.h" +#include "pxr/usd/sdf/types.h" +#include "pxr/base/arch/library.h" +#include "pxr/base/tf/staticTokens.h" +#include "pxr/imaging/hd/materialNetwork2Interface.h" +#include "pxr/imaging/hd/sceneDelegate.h" + +#include "pxr/usd/ar/resolver.h" + +PXR_NAMESPACE_OPEN_SCOPE + +// Tokens for converting UsdPreviewSurface +TF_DEFINE_PRIVATE_TOKENS( + _tokens, + + // Usd preview shading node types + (UsdPreviewSurface) + (UsdUVTexture) + (UsdTransform2d) + (UsdPrimvarReader_float) + (UsdPrimvarReader_float2) + (UsdPrimvarReader_float3) + + // UsdPreviewSurface tokens + (displacement) + (file) + (normal) + (opacityThreshold) + + // UsdPreviewSurface conversion to Pxr nodes + (PxrDisplace) + (PxrSurface) + + // Usd preview shading nodes osl tokens + (UsdPreviewSurfaceParameters) + (bumpNormal) + (bumpNormalOut) + (clearcoatEdgeColor) + (clearcoatEdgeColorOut) + (clearcoatFaceColor) + (clearcoatFaceColorOut) + (clearcoatRoughness) + (clearcoatRoughnessOut) + (diffuseGain) + (diffuseGainOut) + (diffuseColor) + (diffuseColorOut) + (dispAmount) + (dispAmountOut) + (dispScalar) + (dispScalarOut) + (glassIor) + (glassIorOut) + (glowGain) + (glowGainOut) + (glowColor) + (glowColorOut) + (normalIn) + (refractionGain) + (refractionGainOut) + (specularEdgeColor) + (specularEdgeColorOut) + (specularFaceColor) + (specularFaceColorOut) + (specularIor) + (specularIorOut) + (specularModelType) + (specularRoughness) + (specularRoughnessOut) + (presence) + (presenceOut) + + // UsdUVTexture parameters + (st) + (wrapS) + (wrapT) + (useMetadata) + (sourceColorSpace) + (sRGB) + (raw) + ((colorSpaceAuto, "auto")) + + // UsdTransform2d parameters + (in) + (scale) + (translation) + (result) + + // Dummy node used to express material primvar opinions + (PrimvarPass) + + // Primvars set by the material + ((displacementBoundSphere, "displacementbound:sphere")) + + // Doublesided PxrSurface parameters + (diffuseDoubleSided) + (specularDoubleSided) + (roughSpecularDoubleSided) + (clearcoatDoubleSided) +); + +// Returns a sibling path to nodeName. +// e.g.: /path/to/foo with suffix _bar would return /path/to/foo_bar +static TfToken +_GetSiblingNodeName(std::string const &nodeName, std::string const &suffix) +{ + SdfPath nodePath = SdfPath(nodeName); + std::string siblingName = nodePath.GetName() + suffix; + return + nodePath.GetParentPath().AppendChild(TfToken(siblingName)).GetAsToken(); +} + +static bool +_GetParameter( + HdMaterialNetworkInterface *netInterface, + TfToken const &nodeName, + TfToken const ¶mName, + VtValue *v) +{ + if (!TF_VERIFY(v)) { + return false; + } + *v = netInterface->GetNodeParameterValue(nodeName, paramName); + return !v->IsEmpty(); +} + +static bool +_GetInputConnection( + HdMaterialNetworkInterface *netInterface, + TfToken const &nodeName, + TfToken const &inputName, + HdMaterialNetworkInterface::InputConnectionVector *v) +{ + if (!TF_VERIFY(v)) { + return false; + } + *v = netInterface->GetNodeInputConnection(nodeName, inputName); + // Just check the length of the InputConnectionVector returned. + // This skips validation of the upstreamNodeName in each connection. + return !v->empty(); +} + + +void +_ProcessPreviewSurfaceNode( + HdMaterialNetworkInterface *netInterface, + const TfToken &nodeName, + std::vector *outputErrorMessages) +{ + TF_UNUSED(outputErrorMessages); + + // Modify the node to a UsdPreviewSurfaceParameters node, which + // translates the params to outputs that feed a PxrSurface node. + netInterface->SetNodeType(nodeName, _tokens->UsdPreviewSurfaceParameters); + + // Because UsdPreviewSurfaceParameters uses "normalIn" instead of + // UsdPreviewSurface's "normal", adjust that here. + { + VtValue vtNormal; + if (_GetParameter(netInterface, nodeName, _tokens->normal, &vtNormal)) { + netInterface->SetNodeParameterValue( + nodeName, _tokens->normalIn, vtNormal); + netInterface->DeleteNodeParameter(nodeName, _tokens->normal); + } + + HdMaterialNetworkInterface::InputConnectionVector cvNormal; + if (_GetInputConnection( + netInterface, nodeName, _tokens->normal, &cvNormal)) { + netInterface->SetNodeInputConnection( + nodeName, _tokens->normalIn, cvNormal); + netInterface->DeleteNodeInputConnection(nodeName, _tokens->normal); + } + } + + // Insert a PxrSurface and connect it to the above node. + TfToken pxrSurfaceNodeName = + _GetSiblingNodeName(nodeName.GetString(), "_PxrSurface"); + netInterface->SetNodeType(pxrSurfaceNodeName, _tokens->PxrSurface); + // parameters: + { + // UsdPreviewSurface uses GGX, not Beckmann + netInterface->SetNodeParameterValue( + pxrSurfaceNodeName, _tokens->specularModelType, VtValue(int(1))); + + // Set up for backfacing -- the PxrSurface will always expect to shade + // both front- and back-facing; UsdPreviewSurfaceParams will determine + // whether it's been called to shade a backface and whether it should. + // NB: These parameters are NOT CONNECTABLE, so cannot be switched via + // an output from the UsdPreviewSurfaceParameters shader! + netInterface->SetNodeParameterValue( + pxrSurfaceNodeName, _tokens->diffuseDoubleSided, VtValue(int(1)) + ); + netInterface->SetNodeParameterValue( + pxrSurfaceNodeName, _tokens->specularDoubleSided, VtValue(int(1)) + ); + netInterface->SetNodeParameterValue( + pxrSurfaceNodeName, _tokens->roughSpecularDoubleSided, VtValue(int(1)) + ); + netInterface->SetNodeParameterValue( + pxrSurfaceNodeName, _tokens->clearcoatDoubleSided, VtValue(int(1)) + ); + + } + // connections: + { + using TfTokenPair = std::pair; + static const std::vector mapping = { + {_tokens->bumpNormal, _tokens->bumpNormalOut}, + {_tokens->diffuseColor, _tokens->diffuseColorOut}, + {_tokens->diffuseGain, _tokens->diffuseGainOut}, + {_tokens->glassIor, _tokens->glassIorOut}, + {_tokens->glowColor, _tokens->glowColorOut}, + {_tokens->glowGain, _tokens->glowGainOut}, + {_tokens->specularFaceColor, _tokens->specularFaceColorOut}, + {_tokens->specularEdgeColor, _tokens->specularEdgeColorOut}, + {_tokens->specularRoughness, _tokens->specularRoughnessOut}, + {_tokens->specularIor, _tokens->specularIorOut}, + {_tokens->clearcoatFaceColor, _tokens->clearcoatFaceColorOut}, + {_tokens->clearcoatEdgeColor, _tokens->clearcoatEdgeColorOut}, + {_tokens->clearcoatRoughness, _tokens->clearcoatRoughnessOut}, + {_tokens->presence, _tokens->presenceOut} + }; + + for (const auto &inOutPair : mapping) { + netInterface->SetNodeInputConnection( + pxrSurfaceNodeName, inOutPair.first, + {{nodeName, inOutPair.second}}); + } + + // If opacityThreshold is > 0, do *not* use refraction. + VtValue vtOpThres; + if (_GetParameter( + netInterface, nodeName, _tokens->opacityThreshold, + &vtOpThres)) { + + if (vtOpThres.Get() <= 0.0f) { + netInterface->SetNodeInputConnection( + pxrSurfaceNodeName, _tokens->refractionGain, + {{nodeName, _tokens->refractionGainOut}}); + } + } + } + + // Check for non-zero displacement param or connection + TfToken pxrDispNodeName; + bool displacement = false; + { + VtValue vtDisp; + if (_GetParameter( + netInterface, nodeName, _tokens->displacement, &vtDisp)) { + if (vtDisp.Get() != 0.0f) { + displacement = true; + } + } + if (!displacement) { + const auto connections = netInterface->GetNodeInputConnection( + nodeName, _tokens->displacement); + // Note that we don't validate the connection entries themselves. + displacement = !connections.empty(); + } + } + // Need additional node, PxrDisplace, for displacement + if (displacement) { + pxrDispNodeName = + _GetSiblingNodeName(nodeName.GetString(), "_PxrDisplace"); + netInterface->SetNodeType(pxrDispNodeName, _tokens->PxrDisplace); + // No parameters, only connections + netInterface->SetNodeInputConnection( + pxrDispNodeName, _tokens->dispAmount, + {{nodeName, _tokens->dispAmountOut}}); + netInterface->SetNodeInputConnection( + pxrDispNodeName, _tokens->dispScalar, + {{nodeName, _tokens->dispScalarOut}}); + } + + // One additional "dummy" node to author primvar opinions on the + // material to be passed to the gprim. + TfToken primvarPassNodeName = + _GetSiblingNodeName(nodeName.GetString(), "_PrimvarPass"); + netInterface->SetNodeType(primvarPassNodeName, _tokens->PrimvarPass); + // Parameters (no connections): + // We wish to always set this primvar on meshes using + // UsdPreviewSurface, regardless of the material's displacement value. + // The primvar should have no effect if there is no displacement on the + // material, and we currently do not have the capabilities to efficiently + // resync the mesh if the value of its UsdPreviewSurface's + // displacement input changes. + netInterface->SetNodeParameterValue( + primvarPassNodeName, _tokens->displacementBoundSphere, VtValue(1.f)); + + // XXX Wire the primvarPass node so it isn't pruned during network traversal. + netInterface->SetNodeInputConnection( + pxrSurfaceNodeName, _tokens->displacementBoundSphere, + {{primvarPassNodeName, _tokens->displacementBoundSphere}}); + + // Update network terminals to point to the PxrSurface and PxrDisplacement + // nodes that were added. + netInterface->SetTerminalConnection(HdMaterialTerminalTokens->surface, + {pxrSurfaceNodeName, TfToken()}); + if (displacement) { + netInterface->SetTerminalConnection( + HdMaterialTerminalTokens->displacement, + {pxrDispNodeName, TfToken()}); + } else { + netInterface->DeleteTerminal(HdMaterialTerminalTokens->displacement); + } +} + +// Returns true if the given path is already a RtxPath meaning it is already +// of the form: +// "rtxplugin:<>?filename=<>&wrapS=<>&wrapT=<>&sourceColorSpace=<>s" +// This function checks if the path contains the "rtxPlugin:" prefix +static bool +_RtxPath(std::string path) +{ + const std::string pathPrefix = "rtxplugin:"; + return path.substr(0, pathPrefix.length()) == pathPrefix; +} + +// Update texture nodes that use non-native texture formats +// to read them via a Renderman texture plugin. +void +_ProcessUVTextureNode( + HdMaterialNetworkInterface * netInterface, + const TfToken &nodeName, + std::vector *outputErrorMessages) +{ + TF_UNUSED(outputErrorMessages); + + bool needInvertT = false; + VtValue vtFile; + if (_GetParameter(netInterface, nodeName, _tokens->file, &vtFile) && + (vtFile.IsHolding() || vtFile.IsHolding())) { + + std::string path = vtFile.IsHolding() + ? vtFile.Get().GetResolvedPath() + : vtFile.Get(); + std::string ext = ArGetResolver().GetExtension(path); + + if (!ext.empty() && ext != "tex" && ext != "dds" && !_RtxPath(path)) { + std::string pluginName = + std::string("RtxHioImage") + ARCH_LIBRARY_SUFFIX; + // Check for wrap mode. In Renderman, the + // texture asset specifies its wrap mode, so we + // must pass this from the shading node into the + // texture plugin parameters. + VtValue wrapSVal = + netInterface->GetNodeParameterValue(nodeName, _tokens->wrapS); + VtValue wrapTVal = + netInterface->GetNodeParameterValue(nodeName, _tokens->wrapT); + TfToken wrapS = + wrapSVal.GetWithDefault(_tokens->useMetadata); + TfToken wrapT = + wrapSVal.GetWithDefault(_tokens->useMetadata); + + // Check for source colorspace. + VtValue sourceColorSpaceVal = netInterface->GetNodeParameterValue( + nodeName, _tokens->sourceColorSpace); + // XXX: This is a workaround for Presto. If there's no + // colorspace token, check if there's a colorspace + // string. + TfToken sourceColorSpace = + sourceColorSpaceVal.GetWithDefault(TfToken()); + if (sourceColorSpace.IsEmpty()) { + const std::string sourceColorSpaceStr = + sourceColorSpaceVal.GetWithDefault( + _tokens->colorSpaceAuto.GetString()); + sourceColorSpace = TfToken(sourceColorSpaceStr); + } + path = + TfStringPrintf("rtxplugin:%s?filename=%s" + "&wrapS=%s&wrapT=%s&" + "sourceColorSpace=%s", + pluginName.c_str(), path.c_str(), + wrapS.GetText(), wrapT.GetText(), + sourceColorSpace.GetText()); + + netInterface->SetNodeParameterValue( + nodeName, _tokens->file, VtValue(path)); + + } else if (ext == "tex") { + // USD Preview Materials use a texture coordinate + // convention where (0,0) is in the bottom-left; + // RenderMan's texture system uses a convention + // where (0,0) is in the top-left. + needInvertT = true; + } + TF_DEBUG(HDPRMAN_IMAGE_ASSET_RESOLVE) + .Msg("Resolved preview material asset path: %s\n", + path.c_str()); + } // handle 'file' parameter + + HdMaterialNetworkInterface::InputConnectionVector cvSt; + if (needInvertT && + _GetInputConnection(netInterface, nodeName, _tokens->st, &cvSt)) { + + // Invert the T axis by splicing in a UsdTransform2d node. + TfToken transform2dNodeName = + _GetSiblingNodeName(nodeName.GetString(), "_InvertT"); + + // Add new node. + netInterface->SetNodeType( + transform2dNodeName, _tokens->UsdTransform2d); + + // parameters: + netInterface->SetNodeParameterValue(transform2dNodeName, + _tokens->scale, VtValue(GfVec2f(1.0f, -1.0f))); + netInterface->SetNodeParameterValue(transform2dNodeName, + _tokens->translation, VtValue(GfVec2f(0.0f, 1.0f))); + + // connections: + netInterface->SetNodeInputConnection( + transform2dNodeName, _tokens->in, cvSt); + + // Splice it into UsdUvTexture, replacing the existing + // connection. + netInterface->SetNodeInputConnection(nodeName, _tokens->st, + {{ transform2dNodeName, _tokens->result }}); + } +} + +void +MatfiltConvertPreviewMaterial( + HdMaterialNetworkInterface *netInterface, + std::vector *outputErrorMessages) +{ + if (!netInterface) { + return; + } + + TfTokenVector nodeNames = netInterface->GetNodeNames(); + if(nodeNames.size() > 1) { + std::unordered_set nameSet; + nameSet.insert(nodeNames.cbegin(), nodeNames.cend()); + nodeNames.clear(); + nodeNames.insert(nodeNames.end(), nameSet.cbegin(), nameSet.cend()); + } + + bool foundPreviewSurface = false; + + for (TfToken const &nodeName : nodeNames) { + const TfToken nodeType = netInterface->GetNodeType(nodeName); + + if (nodeType == _tokens->UsdPreviewSurface) { + if (foundPreviewSurface) { + outputErrorMessages->push_back(TfStringPrintf( + "Found multiple UsdPreviewSurface nodes in <%s>", + netInterface->GetMaterialPrimPath().GetText())); + continue; + } + foundPreviewSurface = true; + _ProcessPreviewSurfaceNode( + netInterface, nodeName, outputErrorMessages); + + } else if (nodeType == _tokens->UsdUVTexture) { + _ProcessUVTextureNode(netInterface, nodeName, outputErrorMessages); + } + } +} + +PXR_NAMESPACE_CLOSE_SCOPE diff --git a/third_party/renderman-26/plugin/hdPrman/matfiltConvertPreviewMaterial.h b/third_party/renderman-26/plugin/hdPrman/matfiltConvertPreviewMaterial.h new file mode 100644 index 0000000000..6c1d5b940d --- /dev/null +++ b/third_party/renderman-26/plugin/hdPrman/matfiltConvertPreviewMaterial.h @@ -0,0 +1,26 @@ +// +// Copyright 2019 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// +#ifndef EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_MATFILT_CONVERT_PREVIEW_MATERIAL_H +#define EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_MATFILT_CONVERT_PREVIEW_MATERIAL_H + +#include "pxr/pxr.h" +#include "pxr/imaging/hd/material.h" +#include "pxr/imaging/hd/materialNetworkInterface.h" + +PXR_NAMESPACE_OPEN_SCOPE + +class HdMaterialNetworkInterface; + +/// Converts USD preview shading nodes to Renderman equivalents. +void +MatfiltConvertPreviewMaterial( + HdMaterialNetworkInterface *networkInterface, + std::vector *outputErrorMessages); + +PXR_NAMESPACE_CLOSE_SCOPE + +#endif // EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_MATFILT_CONVERT_PREVIEW_MATERIAL_H diff --git a/third_party/renderman-26/plugin/hdPrman/matfiltMaterialX.cpp b/third_party/renderman-26/plugin/hdPrman/matfiltMaterialX.cpp new file mode 100644 index 0000000000..7438a781ba --- /dev/null +++ b/third_party/renderman-26/plugin/hdPrman/matfiltMaterialX.cpp @@ -0,0 +1,974 @@ +// +// Copyright 2021 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// +#include "hdPrman/matfiltMaterialX.h" +#include "hdPrman/debugCodes.h" + +#include "pxr/base/arch/hash.h" +#include "pxr/base/arch/library.h" +#include "pxr/base/arch/fileSystem.h" +#include "pxr/base/tf/staticTokens.h" +#include "pxr/base/gf/vec2f.h" +#include "pxr/base/gf/matrix3d.h" +#include "pxr/base/gf/matrix4d.h" + +#include "pxr/usd/ar/resolver.h" +#include "pxr/usd/sdr/shaderNode.h" +#include "pxr/usd/sdr/shaderProperty.h" +#include "pxr/usd/sdr/registry.h" + +#include "pxr/imaging/hd/tokens.h" +#include "pxr/imaging/hd/materialNetwork2Interface.h" +#include "pxr/imaging/hdMtlx/hdMtlx.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef PXR_OSL_SUPPORT_ENABLED +#include +#include +#include +#endif + +#include + +namespace mx = MaterialX; + +PXR_NAMESPACE_OPEN_SCOPE + +TF_DEFINE_PRIVATE_TOKENS( + _tokens, + (mtlx) + + // Hydra MaterialX Node Types + (ND_standard_surface_surfaceshader) + (ND_UsdPreviewSurface_surfaceshader) + (ND_displacement_float) + (ND_image_vector2) + (ND_image_vector3) + (ND_image_vector4) + + // MaterialX - OSL Adapter Node names + ((SS_Adapter, "StandardSurfaceParameters")) + ((USD_Adapter, "UsdPreviewSurfaceParameters")) + ((Displacement_Adapter, "DisplacementParameters")) + + // HdPrman Terminal Nodes + (PxrSurface) + (PxrDisplace) + + // Texture Coordinate Tokens + (ND_geompropvalue_vector2) + (ND_remap_vector2) + (texcoord) + (geomprop) + (geompropvalue) + (in) + (inhigh) + (inlow) + (remap) + (vector2) + (float2) + ((string_type, "string")) + + // Hydra SourceTypes + (OSL) // Adapter Node + (RmanCpp) // PxrSurface Node + + // MaterialX Texture Node input and type + (file) + (filename) + + // Wrap Modes + (black) + (clamp) + (repeat) + (uaddressmode) + (vaddressmode) + + // Color Space + ((cs_raw, "raw")) + ((cs_auto, "auto")) + ((cs_srgb, "sRGB")) + ((mtlx_srgb, "srgb_texture")) +); + +static bool +_FindGraphAndNodeByName( + mx::DocumentPtr const &mxDoc, + std::string const &mxNodeGraphName, + std::string const &mxNodeName, + mx::NodeGraphPtr * mxNodeGraph, + mx::NodePtr * mxNode) +{ + // Graph names are uniquified with mxDoc->createValidChildName in hdMtlx, + // so attempting to get the graph by the expected name may fail. + // Go to some extra effort to find the graph that contains the named node. + + *mxNodeGraph = mxDoc->getNodeGraph(mxNodeGraphName); + + if(*mxNodeGraph) { + *mxNode = (*mxNodeGraph)->getNode(mxNodeName); + } + if(!*mxNode) { + std::vector graphs = mxDoc->getNodeGraphs(); + // first try last graph + if(graphs.size()) { + *mxNode = + (*(graphs.rbegin()))->getNode(mxNodeName); + if(*mxNode) { + *mxNodeGraph = *graphs.rbegin(); + } + } + // Sometimes the above approach fails, so go looking + // through all the graph nodes for the texture + if(!*mxNode) { + for(auto graph : graphs) { + *mxNode = graph->getNode(mxNodeName); + if(*mxNode) { + *mxNodeGraph = graph; + break; + } + } + } + } + return (*mxNode != nullptr); +} + +// Use the given mxDocument to generate osl source code for the node from the +// nodeGraph with the given names. +static std::string +_GenMaterialXShaderCode( + mx::DocumentPtr const &mxDoc, + mx::FileSearchPath const &searchPath, + std::string const &shaderName, + std::string const &mxNodeName, + std::string const &mxNodeGraphName) +{ + // Initialize the Context for shaderGen + mx::GenContext mxContext = mx::OslShaderGenerator::create(); +#if MATERIALX_MAJOR_VERSION == 1 && MATERIALX_MINOR_VERSION == 38 && MATERIALX_BUILD_VERSION == 3 + mxContext.registerSourceCodeSearchPath(searchPath); +#else + // Starting from MaterialX 1.38.4 at PR 877, we must remove the "libraries" part: + mx::FileSearchPath libSearchPaths; + for (const mx::FilePath &path : searchPath) { + if (path.getBaseName() == "libraries") { + libSearchPaths.append(path.getParentPath()); + } + else { + libSearchPaths.append(path); + } + } + mxContext.registerSourceCodeSearchPath(libSearchPaths); +#endif + mxContext.getOptions().fileTextureVerticalFlip = false; + + // Get the Node from the Nodegraph/mxDoc + mx::NodeGraphPtr mxNodeGraph; + mx::NodePtr mxNode; + + _FindGraphAndNodeByName(mxDoc, + mxNodeGraphName, + mxNodeName, + &mxNodeGraph, + &mxNode); + + if(!mxNodeGraph) { + TF_WARN("NodeGraph '%s' not found in the mxDoc.", + mxNodeGraphName.c_str()); + return mx::EMPTY_STRING; + } + + if (!mxNode) { + TF_WARN("Node '%s' not found in '%s' nodeGraph.", + mxNodeName.c_str(), mxNodeGraphName.c_str()); + return mx::EMPTY_STRING; + } + + // Generate the OslShader for the Node + TF_DEBUG(HDPRMAN_MATERIALS) + .Msg("Generate a MaterialX Osl shader for '%s' node.\n", + mxNodeName.c_str()); + mx::ShaderPtr mxShader; + try { + mxShader = mx::createShader(shaderName, mxContext, mxNode); + } catch (mx::Exception& exception) { + TF_WARN("Unable to create Osl Shader for node '%s'.\nMxException: %s", + mxNodeName.c_str(), exception.what()); + return mx::EMPTY_STRING; + } + if (!mxShader) { + TF_WARN("Unable to create Osl Shader for node '%s'.", + mxNodeName.c_str()); + return mx::EMPTY_STRING; + } + return mxShader->getSourceCode(); +} + +//////////////////////////////////////////////////////////////////////////////// +// Helpers to update the material network for HdPrman + +// Convert the MaterialX SurfaceShader Token to the MaterialX Adapter Node Type +static TfToken +_GetAdapterNodeType(TfToken const &hdNodeType) +{ + if (hdNodeType == _tokens->ND_standard_surface_surfaceshader) { + return _tokens->SS_Adapter; + } + else if (hdNodeType == _tokens->ND_UsdPreviewSurface_surfaceshader) { + return _tokens->USD_Adapter; + } + else if (hdNodeType == _tokens->ND_displacement_float) { + return _tokens->Displacement_Adapter; + } + else { + TF_WARN("Unsupported Node Type '%s'", hdNodeType.GetText()); + return TfToken(); + } +} + +// Convert terminal MaterialX shader type to corresponding rman material type. +static TfToken +_GetTerminalShaderType(TfToken const &hdNodeType) +{ + return (hdNodeType == _tokens->ND_displacement_float) ? + _tokens->PxrDisplace : _tokens->PxrSurface; +} + +// Convert terminal MaterialX shader type to corresponding connection name +static TfToken +_GetTerminalConnectionName(TfToken const &hdNodeType) +{ + return (hdNodeType == _tokens->ND_displacement_float) ? + HdMaterialTerminalTokens->displacement : + HdMaterialTerminalTokens->surface; +} + +// Convert the TfToken associated with the input parameters to Adapter Nodes +// that conflict with OSL reserved words. +static TfToken +_GetUpdatedInputToken(TfToken const &currInputName) +{ + static const mx::StringMap conflicts = { + // { currInputNname , updatedInputName } + {"emission", "emission_value"}, + {"subsurface", "subsurface_value"}, + {"normal", "normalIn"}}; + auto it = conflicts.find(currInputName.GetString()); + if (it != conflicts.end()) { + return TfToken(it->second); + } + return TfToken(); +} + +static bool +_HasNode( + HdMaterialNetworkInterface *netInterface, + TfToken const &nodeName) +{ + return !netInterface->GetNodeType(nodeName).IsEmpty(); +} + +static void +_GatherNodeGraphNodes( + HdMaterialNetworkInterface *netInterface, + TfToken const &hdNodeName, + std::set *upstreamNodeNames, + std::set *visitedNodeNames) +{ + TfTokenVector cNames = + netInterface->GetNodeInputConnectionNames(hdNodeName); + + // Traverse the upsteam connections to gather the nodeGraph nodes + for (TfToken const &cName : cNames) { + auto inputConnections = + netInterface->GetNodeInputConnection(hdNodeName, cName); + + for (auto const &currConnection : inputConnections) { + TfToken const &upstreamNodeName = currConnection.upstreamNodeName; + + if (!_HasNode(netInterface, upstreamNodeName)) { + TF_WARN("Unknown material node '%s'", + upstreamNodeName.GetText()); + continue; + } + if (visitedNodeNames->count(upstreamNodeName) > 0) { + continue; + } + visitedNodeNames->insert(upstreamNodeName); + + // Gather the nodes uptream from the hdNode + _GatherNodeGraphNodes(netInterface, upstreamNodeName, + upstreamNodeNames, visitedNodeNames); + upstreamNodeNames->insert(upstreamNodeName); + } + } +} + +// Compile the given oslSource returning the path to the compiled oso code +static std::string +_CompileOslSource( + std::string const &name, + std::string const &oslSource, + mx::FileSearchPath const &searchPaths) +{ +#ifdef PXR_OSL_SUPPORT_ENABLED + + TF_DEBUG(HDPRMAN_DUMP_MATERIALX_OSL_SHADER) + .Msg("--------- MaterialX Generated Shader '%s' ----------\n%s" + "---------------------------\n\n", name.c_str(), oslSource.c_str()); + + // Include the filepath to the MaterialX OSL directory containing mx_funcs.h + std::vector oslArgs; + oslArgs.reserve(searchPaths.size()); +#if MATERIALX_MAJOR_VERSION == 1 && \ + MATERIALX_MINOR_VERSION == 38 && \ + MATERIALX_BUILD_VERSION == 3 + static const mx::FilePath stdlibOslPath = "stdlib/osl"; +#else + // MaterialX v1.38.4 restructured the OSL files and moved mx_funcs.h + static const mx::FilePath stdlibOslPath = "stdlib/genosl/include"; +#endif + for (mx::FilePath const &path : searchPaths) { + const mx::FilePath fullPath = path/stdlibOslPath; + oslArgs.push_back(fullPath.exists() ? "-I" + fullPath.asString() + : "-I" + path.asString()); + } + +#if MATERIALX_MAJOR_VERSION == 1 && \ + MATERIALX_MINOR_VERSION == 38 && \ + MATERIALX_BUILD_VERSION == 3 + // Nothing +#else + // MaterialX 1.38.4 removed its copy of stdosl.h and other OSL headers + // and requires it to be included from the OSL installation itself. + oslArgs.push_back(std::string("-I") + OSL_SHADER_INSTALL_DIR); +#endif + + // Compile oslSource + std::string oslCompiledSource; + OSL::OSLCompiler oslCompiler; + oslCompiler.compile_buffer(oslSource, oslCompiledSource, oslArgs); + if (oslCompiledSource.empty()) { + TF_WARN("Unable to compile MaterialX Osl shader for the '%s' " + "MaterialX node\n", name.substr(0, name.size()-6).c_str()); + return mx::EMPTY_STRING; + } + + // Save compiled shader + std::string compiledFilePath = ArchMakeTmpFileName("MX." + name, ".oso"); + FILE *compiledShader; + compiledShader = fopen((compiledFilePath).c_str(), "w+"); + if (!compiledShader) { + TF_WARN("Unable to save compiled MaterialX Osl shader at '%s'\n", + compiledFilePath.c_str()); + return mx::EMPTY_STRING; + } + else { + fputs(oslCompiledSource.c_str(), compiledShader); + fclose(compiledShader); + return compiledFilePath; + } +#else + TF_WARN("Unable to compile MaterialX generated Osl shader, enable OSL " + "support for full MaterialX support in HdPrman.\n"); + return mx::EMPTY_STRING; +#endif +} + +static void +_DeleteAllInputConnections( + HdMaterialNetworkInterface *netInterface, + TfToken const &nodeName) +{ + TfTokenVector cNames = netInterface->GetNodeInputConnectionNames(nodeName); + for (const TfToken &cName : cNames) { + netInterface->DeleteNodeInputConnection(nodeName, cName); + } +} + +static void +_DeleteAllParameters( + HdMaterialNetworkInterface *netInterface, + TfToken const &nodeName) +{ + TfTokenVector pNames = + netInterface->GetAuthoredNodeParameterNames(nodeName); + for (const TfToken &pName : pNames) { + netInterface->DeleteNodeParameter(nodeName, pName); + } + +} + +// For each of the outputs in the nodegraph create a sdrShaderNode with the +// compiled osl code generated by MaterialX and update the terminalNode's +// input connections +// Removes the nodes that are not directly connected to the terminal node +static void +_UpdateNetwork( + HdMaterialNetworkInterface *netInterface, + TfToken const &terminalNodeName, + mx::DocumentPtr const &mxDoc, + mx::FileSearchPath const &searchPath, + std::set nodesToKeep, + std::set nodesToRemove) +{ + // Gather the nodeGraph nodes + std::set visitedNodeNames; + + TfTokenVector terminalConnectionNames = + netInterface->GetNodeInputConnectionNames(terminalNodeName); + + for (TfToken const &cName : terminalConnectionNames) { + auto inputConnections = + netInterface->GetNodeInputConnection(terminalNodeName, cName); + + for (auto const &currConnection : inputConnections) { + TfToken const &upstreamNodeName = currConnection.upstreamNodeName; + TfToken const &outputName = currConnection.upstreamOutputName; + + if (!_HasNode(netInterface, upstreamNodeName)) { + TF_WARN("Unknown material node '%s'", + upstreamNodeName.GetText()); + continue; + } + bool newNode = visitedNodeNames.count(upstreamNodeName) == 0; + if (!newNode) { + // Re-using a node or node output, get the corresponding sdrNode + SdrRegistry &sdrRegistry = SdrRegistry::GetInstance(); + SdrShaderNodeConstPtr sdrNode = + sdrRegistry.GetShaderNodeByIdentifier( + netInterface->GetNodeType(upstreamNodeName)); + + if(!sdrNode) { + continue; + } + + // Update the connection into the terminal node so that the + // output makes it into the closure + TfToken const &inputName = cName; + if (sdrNode->GetOutput(outputName)) { + netInterface->SetNodeInputConnection( + terminalNodeName, + inputName, + { {upstreamNodeName, outputName} }); + } + else { + TF_WARN("Output '%s' not found on node '%s'.", + outputName.GetText(), upstreamNodeName.GetText()); + } + continue; + } + + visitedNodeNames.insert(upstreamNodeName); + // Collect nodes further removed from the terminal in nodesToRemove + std::set tmpVisitedNodeNames; + _GatherNodeGraphNodes(netInterface, upstreamNodeName, + &nodesToRemove, &tmpVisitedNodeNames); + nodesToKeep.insert(upstreamNodeName); + + // Generate the oslSource code for the connected upstream node + SdfPath const nodePath = SdfPath(upstreamNodeName); + std::string const &mxNodeName = nodePath.GetName(); + std::string const &mxNodeGraphName = + nodePath.GetParentPath().GetName(); + std::string shaderName = mxNodeName + "Shader"; + std::string oslSource = _GenMaterialXShaderCode( + mxDoc, searchPath, shaderName, mxNodeName, mxNodeGraphName); + + if (oslSource.empty()) { + continue; + } + + // Compile the oslSource + std::string compiledShaderPath = + _CompileOslSource(shaderName, oslSource, searchPath); + if (compiledShaderPath.empty()) { + continue; + } + + // Create a new SdrShaderNode with the compiled oslSource + SdrRegistry &sdrRegistry = SdrRegistry::GetInstance(); + SdrShaderNodeConstPtr sdrNode = + sdrRegistry.GetShaderNodeFromAsset( + SdfAssetPath(compiledShaderPath), + NdrTokenMap(), // metadata + _tokens->mtlx, // subId + _tokens->OSL); // sourceType + + // Update node type to that of the Sdr node. + netInterface->SetNodeType( + upstreamNodeName, sdrNode->GetIdentifier()); + + // Update the connection into the terminal node so that the + // nodegraph outputs make their way into the closure + if (sdrNode->GetOutput(outputName)) { + TfToken inputName = cName; + TfToken updatedInputName = _GetUpdatedInputToken(inputName); + bool deletePreviousConnection = false; + if (updatedInputName != TfToken()) { + inputName = updatedInputName; + deletePreviousConnection = true; + } + netInterface->SetNodeInputConnection( + terminalNodeName, inputName, + { {upstreamNodeName, outputName} }); + if (deletePreviousConnection) { + netInterface->DeleteNodeInputConnection( + terminalNodeName, cName); + } + } + _DeleteAllInputConnections(netInterface, upstreamNodeName); + _DeleteAllParameters(netInterface, upstreamNodeName); + } + } +} + +// Transform the original terminalNode with an Adapter Node which connects to a +// new PxrSurface or PxrDisplace Node that becomes the surfaceTerminal +// node in the hdNetwork. +static void +_TransformTerminalNode( + HdMaterialNetworkInterface *netInterface, + TfToken const &terminalNodeName) +{ + // Create a SdrShaderNode for the Adapter and PxrSurface/PxrDisplace Nodes. + TfToken const nodeType = netInterface->GetNodeType(terminalNodeName); + TfToken const adapterType = _GetAdapterNodeType( nodeType ); + TfToken const shaderType = _GetTerminalShaderType( nodeType ); + TfToken const terminalToken = _GetTerminalConnectionName( nodeType ); + + SdrRegistry &sdrRegistry = SdrRegistry::GetInstance(); + SdrShaderNodeConstPtr const sdrAdapter = + sdrRegistry.GetShaderNodeByIdentifier(adapterType, {_tokens->OSL}); + SdrShaderNodeConstPtr const sdrShader = + sdrRegistry.GetShaderNodeByIdentifier(shaderType, + {_tokens->RmanCpp}); + if (!sdrAdapter) { + TF_WARN("No sdrAdater node of type '%s'", adapterType.GetText()); + return; + } + + // Transform the terminalNode with the appropriate Adapter Node, which + // translates the MaterialX parameters into PxrSurface/PxrDisplace inputs. + netInterface->SetNodeType(terminalNodeName, adapterType); + + // Update the TfTokens associated with the Adapter Node's input parameters + // that conflict with OSL reserved words. + // The corresponding input connection is updated in _UpdateNetwork() + TfTokenVector pNames = + netInterface->GetAuthoredNodeParameterNames(terminalNodeName); + for (TfToken const &pName : pNames) { + const TfToken updatedName = _GetUpdatedInputToken(pName); + if (!updatedName.IsEmpty()) { + const VtValue val = netInterface->GetNodeParameterValue( + terminalNodeName, pName); + netInterface->SetNodeParameterValue( + terminalNodeName, updatedName, val); + netInterface->DeleteNodeParameter(terminalNodeName, pName); + } + } + + // Create a RenderMan material node (ie. PxrSurface or PxrDisplace) + TfToken rmanShaderNodeName = + TfToken(terminalNodeName.GetString() + "_" + shaderType.GetString()); + netInterface->SetNodeType(rmanShaderNodeName, shaderType); + + // Connect the RenderMan material inputs to the Adapter's outputs + for (const auto& inParamName: sdrShader->GetInputNames()) { + + if (sdrShader->GetShaderInput(inParamName)) { + + // Convert the parameter name to the "xxxOut" format + TfToken adapterOutParam = TfToken(inParamName.GetString() + "Out"); + + // If the shader Input is an Adapter node output add the + // inputConnection to the shader Node + // Note: not every input has a corresponding output + if (sdrAdapter->GetShaderOutput(adapterOutParam)) { + netInterface->SetNodeInputConnection( + rmanShaderNodeName, inParamName, + { {terminalNodeName, adapterOutParam} }); + } + } + } + + // Update the network terminals so that the terminal Node is the RenderMan + // Node instead of the Adapter Node (previously the mtlx terminal node) + netInterface->SetTerminalConnection( + terminalToken, { rmanShaderNodeName, TfToken() }); +} + +// Get the Hydra equivalent for the given MaterialX input value +static TfToken +_GetHdWrapString( + TfToken const &hdTextureNodeName, + std::string const &mxInputValue) +{ + if (mxInputValue == "constant") { + TF_WARN("RtxHioImagePlugin: Texture '%s' has unsupported wrap mode " + "'constant' using 'black' instead.", hdTextureNodeName.GetText()); + return _tokens->black; + } + if (mxInputValue == "clamp") { + return _tokens->clamp; + } + if (mxInputValue == "mirror") { + TF_WARN("RtxHioImagePlugin: Texture '%s' has unsupported wrap mode " + "'mirror' using 'repeat' instead.", hdTextureNodeName.GetText()); + return _tokens->repeat; + } + return _tokens->repeat; +} + +static void +_GetWrapModes( + HdMaterialNetworkInterface *netInterface, + TfToken const &hdTextureNodeName, + TfToken *uWrap, + TfToken *vWrap) +{ + // For nodes want to always use "repeat" + *uWrap = _tokens->repeat; + *vWrap = _tokens->repeat; + + // For nodes: + VtValue vUAddrMode = netInterface->GetNodeParameterValue( + hdTextureNodeName, _tokens->uaddressmode); + if (!vUAddrMode.IsEmpty()) { + *uWrap = _GetHdWrapString(hdTextureNodeName, + vUAddrMode.UncheckedGet()); + } + VtValue vVAddrMode = netInterface->GetNodeParameterValue( + hdTextureNodeName, _tokens->vaddressmode); + if (!vVAddrMode.IsEmpty()) { + *vWrap = _GetHdWrapString(hdTextureNodeName, + vVAddrMode.UncheckedGet()); + } +} + +static TfToken +_GetColorSpace( + HdMaterialNetworkInterface *netInterface, + TfToken const &hdTextureNodeName, + HdMaterialNetworkInterface::NodeParamData paramData) +{ + const TfToken nodeType = netInterface->GetNodeType(hdTextureNodeName); + if (nodeType == _tokens->ND_image_vector2 || + nodeType == _tokens->ND_image_vector3 || + nodeType == _tokens->ND_image_vector4 ) { + // For images not used as color use "raw" (eg. normal maps) + return _tokens->cs_raw; + } else { + if (paramData.colorSpace == _tokens->mtlx_srgb) { + return _tokens->cs_srgb; + } else { + return _tokens->cs_auto; + } + } +} + +static void +_UpdateTextureNodes( + HdMaterialNetworkInterface *netInterface, + std::set const &hdTextureNodePaths, + mx::DocumentPtr const &mxDoc) +{ + for (SdfPath const &texturePath : hdTextureNodePaths) { + TfToken const &textureNodeName = texturePath.GetToken(); + const TfToken nodeType = netInterface->GetNodeType(textureNodeName); + if (nodeType.IsEmpty()) { + TF_WARN("Connot find texture node '%s' in material network.", + textureNodeName.GetText()); + continue; + } + + HdMaterialNetworkInterface::NodeParamData fileParamData = + netInterface->GetNodeParameterData(textureNodeName, _tokens->file); + const VtValue vFile = fileParamData.value; + if (vFile.IsEmpty()) { + TF_WARN("File path missing for texture node '%s'.", + textureNodeName.GetText()); + continue; + } + + if (vFile.IsHolding()) { + std::string path = vFile.Get().GetResolvedPath(); + std::string ext = ArGetResolver().GetExtension(path); + + + mx::NodeGraphPtr mxNodeGraph; + mx::NodePtr mxTextureNode; + + _FindGraphAndNodeByName(mxDoc, + texturePath.GetParentPath().GetName(), + texturePath.GetName(), + &mxNodeGraph, + &mxTextureNode); + + if(!mxTextureNode) { + continue; + } + + // Update texture nodes that use non-native texture formats + // to read them via a Renderman texture plugin. + bool needInvertT = false; + if (!ext.empty() && ext != "tex") { + + // Update the input value to use the Renderman texture plugin + const std::string pluginName = + std::string("RtxHioImage") + ARCH_LIBRARY_SUFFIX; + + TfToken uWrap, vWrap; + _GetWrapModes(netInterface, textureNodeName, &uWrap, &vWrap); + + TfToken colorSpace = + _GetColorSpace(netInterface, textureNodeName, fileParamData); + + std::string const &mxInputValue = TfStringPrintf( + "rtxplugin:%s?filename=%s&wrapS=%s&wrapT=%s&sourceColorSpace=%s", + pluginName.c_str(), path.c_str(), uWrap.GetText(), + vWrap.GetText(), colorSpace.GetText()); + TF_DEBUG(HDPRMAN_IMAGE_ASSET_RESOLVE) + .Msg("Resolved MaterialX asset path: %s\n", + mxInputValue.c_str()); + + // Update the MaterialX Texture Node with the new mxInputValue + mxTextureNode->setInputValue(_tokens->file.GetText(), // name + mxInputValue, // value + _tokens->filename.GetText());//type + } + else { + needInvertT = true; + // For tex files, update value with resolved path, because prman + // may not be able to find a usd relative path. + mxTextureNode->setInputValue(_tokens->file.GetText(), // name + path, // value + _tokens->filename.GetText());//type + TF_DEBUG(HDPRMAN_IMAGE_ASSET_RESOLVE) + .Msg("Resolved MaterialX asset path: %s\n", + path.c_str()); + } + + // If texcoord param isn't connected, make a default connection + // to a mtlx geompropvalue node. + mx::InputPtr texcoordInput = + mxTextureNode->getInput(_tokens->texcoord); + if(!texcoordInput) { + texcoordInput = + mxTextureNode->addInput(_tokens->texcoord, + _tokens->vector2); + const std::string stNodeName = + textureNodeName.GetString() + "__texcoord"; + + // Get the sdr node for the mxTexture node + SdrRegistry &sdrRegistry = SdrRegistry::GetInstance(); + const SdrShaderNodeConstPtr sdrTextureNode = + sdrRegistry.GetShaderNodeByIdentifierAndType( + nodeType, _tokens->mtlx); + // Get the primvarname from the sdrTextureNode metadata + auto metadata = sdrTextureNode->GetMetadata(); + auto primvarName = metadata[SdrNodeMetadata->Primvars]; + + mx::NodePtr geompropNode = + mxNodeGraph->addNode(_tokens->geompropvalue, + stNodeName, + _tokens->vector2); + geompropNode->setInputValue(_tokens->geomprop, + primvarName, _tokens->string_type); + texcoordInput->setConnectedNode(geompropNode); + geompropNode-> + setNodeDefString(_tokens->ND_geompropvalue_vector2); + } + if(needInvertT) { + texcoordInput = + mxTextureNode->getInput(_tokens->texcoord); + if(texcoordInput) { + const std::string remapNodeName = + textureNodeName.GetString() + "__remap"; + mx::NodePtr remapNode = + mxNodeGraph->addNode(_tokens->remap, + remapNodeName, + _tokens->vector2); + remapNode-> + setNodeDefString(_tokens->ND_remap_vector2); + mx::InputPtr inInput = + remapNode->addInput(_tokens->in, + _tokens->vector2); + const mx::FloatVec inhigh = {1,0}; + const mx::FloatVec inlow = {0,1}; + remapNode->setInputValue(_tokens->inhigh, + inhigh, + _tokens->float2); + remapNode->setInputValue(_tokens->inlow, + inlow, + _tokens->float2); + mx::NodePtr primvarNode = + texcoordInput->getConnectedNode(); + inInput->setConnectedNode(primvarNode); + texcoordInput->setConnectedNode(remapNode); + } + } + } + } +} + +// Texcoord nodes don't work for RenderMan, so convert them +// to geompropvalue nodes that look up the texture coordinate primvar name. +static void +_UpdatePrimvarNodes( + HdMaterialNetworkInterface *netInterface, + std::set const &hdPrimvarNodePaths, + mx::DocumentPtr const &mxDoc) +{ + for (SdfPath const &nodePath : hdPrimvarNodePaths) { + TfToken const &nodeName = nodePath.GetToken(); + std::string mxNodeName = nodePath.GetName(); + const TfToken nodeType = netInterface->GetNodeType(nodeName); + if (nodeType.IsEmpty()) { + TF_WARN("Can't find node '%s' in material network.", + nodeName.GetText()); + continue; + } + + mx::NodeGraphPtr mxNodeGraph; + mx::NodePtr mxNode; + + _FindGraphAndNodeByName(mxDoc, nodePath.GetParentPath().GetName(), + mxNodeName, &mxNodeGraph, &mxNode); + + // Ignore nodes that aren't "texcoord" nodes + if (!mxNode || mxNode->getCategory() != _tokens->texcoord) { + continue; + } + mx::NodeDefPtr mxNodeDef = mxDoc->getNodeDef( + _tokens->ND_geompropvalue_vector2.GetText()); + if (!mxNodeDef) { + continue; + } + + // Get the sdr node for the texcoord node + SdrRegistry &sdrRegistry = SdrRegistry::GetInstance(); + const SdrShaderNodeConstPtr sdrTexcoordNode = + sdrRegistry.GetShaderNodeByIdentifierAndType( + nodeType, _tokens->mtlx); + // Get the primvarname from the sdrTexcoordNode metadata + auto metadata = sdrTexcoordNode->GetMetadata(); + auto primvarName = metadata[SdrNodeMetadata->Primvars]; + + // Set the category and type of this texcoord node + // so that it will become a geompropvalue node + // that looks up the texture coordinate primvar name. + mxNode->setType(mxNodeDef->getType()); + mxNode->setCategory(mxNodeDef->getNodeString()); + mxNode->setNodeDefString(_tokens->ND_geompropvalue_vector2); + mxNode->setInputValue(_tokens->geomprop.GetText(), + primvarName, + _tokens->string_type.GetText()); + } +} + + +void +MatfiltMaterialX( + HdMaterialNetworkInterface *netInterface, + std::vector *outputErrorMessages) +{ + if (!netInterface) { + return; + } + + static const std::vector supportedTerminalTokens = { + HdMaterialTerminalTokens->surface, + HdMaterialTerminalTokens->displacement + }; + + std::set nodesToKeep; // nodes directly connected to the terminal + std::set nodesToRemove; // nodes further removed from the terminal + + for (auto terminalName : supportedTerminalTokens ) { + + // Check presence of terminal + const HdMaterialNetworkInterface::InputConnectionResult res = + netInterface->GetTerminalConnection(terminalName); + if (!res.first) { // terminal absent + return; + } + const TfToken &terminalNodeName = res.second.upstreamNodeName; + const TfToken terminalNodeType = + netInterface->GetNodeType(terminalNodeName); + + // Check if the node connected to the terminal is a MaterialX node + SdrRegistry &sdrRegistry = SdrRegistry::GetInstance(); + const SdrShaderNodeConstPtr mtlxSdrNode = + sdrRegistry.GetShaderNodeByIdentifierAndType(terminalNodeType, + _tokens->mtlx); + if (!mtlxSdrNode) { + return; + } + + TfTokenVector cNames = + netInterface->GetNodeInputConnectionNames(terminalNodeName); + // If we have a nodegraph (i.e., input into the terminal node)... + if (!cNames.empty()) { + // Serialize MaterialX usage to avoid crashes. + // + // XXX It may be the case that a finer-grained locking + // pattern can be used here. Starting with a coarse + // lock to establish a basic level of safety. + // + static std::mutex materialXMutex; + std::lock_guard lock(materialXMutex); + + // Get Standard Libraries and SearchPaths (for mxDoc and + // mxShaderGen) + mx::DocumentPtr stdLibraries = HdMtlxStdLibraries(); + mx::FileSearchPath searchPath = HdMtlxSearchPaths(); + + // Create the MaterialX Document from the material network + HdMtlxTexturePrimvarData hdMtlxData; + mx::DocumentPtr mxDoc = + HdMtlxCreateMtlxDocumentFromHdMaterialNetworkInterface( + netInterface, terminalNodeName, cNames, + stdLibraries, &hdMtlxData); + + _UpdateTextureNodes(netInterface, hdMtlxData.hdTextureNodes, mxDoc); + _UpdatePrimvarNodes(netInterface, hdMtlxData.hdPrimvarNodes, mxDoc); + + // Remove the material and shader nodes from the MaterialX Document + // (since we need to use PxrSurface as the closure instead of the + // MaterialX surfaceshader node) + SdfPath materialPath = netInterface->GetMaterialPrimPath(); + mxDoc->removeNode("SR_" + materialPath.GetName()); // Shader Node + mxDoc->removeNode(materialPath.GetName()); // Material Node + + // Update nodes directly connected to the terminal node with + // MX generated shaders that capture the rest of the nodegraph + _UpdateNetwork(netInterface, terminalNodeName, mxDoc, searchPath, + nodesToKeep, nodesToRemove); + } + + // Convert the terminal node to an AdapterNode + PxrSurfaceNode + _TransformTerminalNode(netInterface, terminalNodeName); + } + + // Remove the nodes not directly connected to the terminal + for (const TfToken& nodeName: nodesToRemove) { + // As long as the node is not also directly connected to the terminal + if (nodesToKeep.find(nodeName) == nodesToKeep.end()) { + netInterface->DeleteNode(nodeName); + } + } +} + +PXR_NAMESPACE_CLOSE_SCOPE diff --git a/third_party/renderman-26/plugin/hdPrman/matfiltMaterialX.h b/third_party/renderman-26/plugin/hdPrman/matfiltMaterialX.h new file mode 100644 index 0000000000..617d827d9a --- /dev/null +++ b/third_party/renderman-26/plugin/hdPrman/matfiltMaterialX.h @@ -0,0 +1,31 @@ +// +// Copyright 2021 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// +#ifndef EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_MATFILT_MATERIALX_H +#define EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_MATFILT_MATERIALX_H + +#include "pxr/pxr.h" +#include "pxr/imaging/hd/material.h" +#include "pxr/imaging/hd/materialNetworkInterface.h" +#include "pxr/usd/ndr/declare.h" + +PXR_NAMESPACE_OPEN_SCOPE + +class HdMaterialNetworkInterface; + +/// Processes MaterialX shading node graphs for RenderMan. +/// +/// The terminal nodes are converted to PxrSurface, PxrDisplacement, +/// and PxrVolume respectively, and any input graphs that use MaterialX +/// shader code-generation are compiled and replaced with a single node. +void +MatfiltMaterialX( + HdMaterialNetworkInterface *netInterface, + std::vector *outputErrorMessages); + +PXR_NAMESPACE_CLOSE_SCOPE + +#endif // EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_MATFILT_MATERIALX_H diff --git a/third_party/renderman-26/plugin/hdPrman/matfiltResolveVstructs.cpp b/third_party/renderman-26/plugin/hdPrman/matfiltResolveVstructs.cpp new file mode 100644 index 0000000000..64f142a268 --- /dev/null +++ b/third_party/renderman-26/plugin/hdPrman/matfiltResolveVstructs.cpp @@ -0,0 +1,336 @@ +// +// Copyright 2019 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// +#include "hdPrman/matfiltResolveVstructs.h" +#include "hdPrman/debugCodes.h" + +#include +#include +#include +#include + +#include "pxr/base/tf/staticTokens.h" +#include "pxr/usd/sdr/registry.h" +#include "pxr/usd/sdr/shaderNode.h" +#include "pxr/usd/sdr/shaderProperty.h" +#include "pxr/imaging/hd/materialNetwork2Interface.h" + +PXR_NAMESPACE_OPEN_SCOPE + +TF_DEFINE_PRIVATE_TOKENS( + _tokens, + (vstructmemberaliases) \ +); + +namespace { + +/// For a single vstruct placeholder input/output, this describes mappings from: +/// 1) associated member input/output -> member name (or names via alias) +/// 2) member name -> associated member input/output +/// 3) associated member input/output -> parsed conditional expression +struct _VstructInfoEntry { + typedef std::shared_ptr<_VstructInfoEntry> Ptr; + + typedef std::unordered_map, + TfToken::HashFunctor> MemberMap; + typedef std::unordered_map ReverseMemberMap; + typedef std::unordered_map ConditionalMap; + + MemberMap members; + ReverseMemberMap reverseMembers; + ConditionalMap conditionals; +}; + +/// For a single shader, this stores mappings from: +/// 1) vstruct placeholder input/output -> _VstructInfoEntry +/// +/// These are typically built once per shader type and cached as it requires +/// interpretation of metadata which would be wasteful to do repeatedly. +struct _ShaderInfoEntry { + typedef std::shared_ptr<_ShaderInfoEntry> Ptr; + typedef std::map VstructInfoMap; + + VstructInfoMap vstructs; + + /// Constructs a _ShaderInfoEntry::Ptr for a single shader without caching + static Ptr + Build(const TfToken &nodeTypeId, + const NdrTokenVec &shaderTypePriority) + { + auto result = Ptr(new _ShaderInfoEntry); + if (auto sdrShader = + SdrRegistry::GetInstance().GetShaderNodeByIdentifier( + nodeTypeId, shaderTypePriority)) + { + for (const auto &inputName : sdrShader->GetInputNames()) { + auto sdrInput = sdrShader->GetShaderInput(inputName); + if (!sdrInput) { + continue; + } + _ProcessProperty(result, sdrInput); + } + for (const auto &outputName : sdrShader->GetOutputNames()) { + auto sdrOutput = sdrShader->GetShaderOutput(outputName); + if (!sdrOutput) { + continue; + } + _ProcessProperty(result, sdrOutput); + } + + } + + return result; + + } + + /// Constructs and caches a _ShaderInfoEntry::Ptr for a single shader + static Ptr + Get(const TfToken &nodeTypeId, + const NdrTokenVec &shaderTypePriority) + { + std::lock_guard lock(_cachedEntryMutex); + + auto I = _cachedEntries.find(nodeTypeId); + if (I == _cachedEntries.end()) { + auto result = Build(nodeTypeId, shaderTypePriority); + _cachedEntries[nodeTypeId] = result; + return result; + } + return (*I).second; + } + + +private: + static std::unordered_map + _cachedEntries; + static std::mutex _cachedEntryMutex; + + static void + _ProcessProperty(Ptr result, SdrShaderPropertyConstPtr prop) + { + if (!prop->IsVStructMember()) { + return; + } + + const TfToken &vsName = prop->GetVStructMemberOf(); + const TfToken &vsMemberName = prop->GetVStructMemberName(); + if (vsName.IsEmpty() || vsMemberName.IsEmpty()) { + return; + } + + _VstructInfoEntry::Ptr entry; + auto I = result->vstructs.find(vsName); + if (I != result->vstructs.end()) { + entry = (*I).second; + } else { + entry.reset(new _VstructInfoEntry); + result->vstructs[vsName] = entry; + } + + TfToken vsMemberAlias; + + const auto &metadata = prop->GetMetadata(); + { + auto I = metadata.find(_tokens->vstructmemberaliases); + if (I != metadata.end()) { + vsMemberAlias = TfToken((*I).second); + } + } + + auto &memberNames = entry->members[prop->GetName()]; + memberNames.push_back(vsMemberName); + + entry->reverseMembers[vsMemberName] = prop->GetName(); + + if (!vsMemberAlias.IsEmpty()) { + memberNames.push_back(vsMemberAlias); + entry->reverseMembers[vsMemberAlias] = prop->GetName(); + } + + const TfToken &condExpr = prop->GetVStructConditionalExpr(); + + if (!condExpr.IsEmpty()) { + entry->conditionals[prop->GetName()] = + MatfiltVstructConditionalEvaluator::Parse(condExpr.data()); + } + } +}; + +std::unordered_map + _ShaderInfoEntry::_cachedEntries; + +std::mutex _ShaderInfoEntry::_cachedEntryMutex; + +} // anonymous namespace + +static void +_ResolveVstructsForNode( + HdMaterialNetworkInterface *interface, + const TfToken &nodeId, + std::set &resolvedNodeNames, + const NdrTokenVec &shaderTypePriority, + bool enableConditions) +{ + if (resolvedNodeNames.find(nodeId) != resolvedNodeNames.end()) { + TF_DEBUG(HDPRMAN_VSTRUCTS) + .Msg("No resovled node name for %s\n", nodeId.data()); + return; + } + + resolvedNodeNames.insert(nodeId); + auto shaderInfo = + _ShaderInfoEntry::Get(interface->GetNodeType(nodeId), + shaderTypePriority); + + // don't do anything if the node has no vstruct definitions + if (shaderInfo->vstructs.empty()) { + TF_DEBUG(HDPRMAN_VSTRUCTS) + .Msg("Node %s has no vstructs\n", + interface->GetNodeType(nodeId).GetText()); + return; + } + + for (const TfToken &inputName : + interface->GetNodeInputConnectionNames(nodeId)) { + + auto I = shaderInfo->vstructs.find(inputName); + if (I == shaderInfo->vstructs.end()) { + continue; + } + TF_DEBUG(HDPRMAN_VSTRUCTS) + .Msg("Found input %s with a vstruct\n", inputName.GetText()); + + const auto &vstructInfo = (*I).second; + + HdMaterialNetworkInterface::InputConnectionVector + upstreamConnections = + interface->GetNodeInputConnection(nodeId, inputName); + + + + if (upstreamConnections.empty()) { + TF_DEBUG(HDPRMAN_VSTRUCTS) + .Msg("Ignoring since no connection\n"); + continue; + } + TF_DEBUG(HDPRMAN_VSTRUCTS) + .Msg("Found upstream vstruct connection\n"); + + const auto &upstreamConnection = upstreamConnections.front(); + + TfToken upstreamTypeId = interface->GetNodeType( + upstreamConnection.upstreamNodeName); + + // confirm connected node exists + if (upstreamTypeId.IsEmpty()) { + continue; + } + + // confirm connected upstream output is a vstruct + auto upstreamShaderInfo = _ShaderInfoEntry::Get( + upstreamTypeId, shaderTypePriority); + auto upstreamVstructI = upstreamShaderInfo->vstructs.find( + upstreamConnection.upstreamOutputName); + if (upstreamVstructI == upstreamShaderInfo->vstructs.end()) { + continue; + } + + auto upstreamVstruct = (*upstreamVstructI).second; + + // ensure that all connections/conditions are expanded upstream first + _ResolveVstructsForNode(interface, upstreamConnection.upstreamNodeName, + resolvedNodeNames, shaderTypePriority, enableConditions); + + // delete the placeholder connection + //node.inputConnections.erase(inputName); + interface->DeleteNodeInputConnection(nodeId, inputName); + + + for (auto &memberI : vstructInfo->members) { + const TfToken &memberInputName = memberI.first; + + // If there's an existing connection to a member input, skip + // expansion as a direct connection has a stronger opinion. + if (!interface->GetNodeInputConnection( + nodeId, memberInputName).empty()) { + continue; + } + + // loop over member names (which may be > 1 due to member aliases) + for (const TfToken &memberName : memberI.second) { + auto revMemberI = + upstreamVstruct->reverseMembers.find(memberName); + + if (revMemberI == upstreamVstruct->reverseMembers.end()) { + continue; + } + const TfToken &upstreamMemberOutputName = (*revMemberI).second; + + // check for condition, otherwise connect + auto condI = upstreamVstruct->conditionals.find( + upstreamMemberOutputName); + + if (enableConditions && + condI != upstreamVstruct->conditionals.end()) + { + auto &evaluator = (*condI).second; + evaluator->Evaluate( + nodeId, + memberInputName, + upstreamConnection.upstreamNodeName, + upstreamMemberOutputName, + shaderTypePriority, + interface); + } else { + // no condition, just connect + interface->SetNodeInputConnection(nodeId, memberInputName, + {{upstreamConnection.upstreamNodeName, + upstreamMemberOutputName}}); + + TF_DEBUG(HDPRMAN_VSTRUCTS) + .Msg("Connected condition-less %s.%s to %s.%s\n", + nodeId.GetText(), + memberInputName.GetText(), + upstreamConnection.upstreamNodeName.GetText(), + upstreamMemberOutputName.GetText()); + } + break; + } + } + } +} + + +void +MatfiltResolveVstructs( + HdMaterialNetworkInterface *interface, + bool enableConditions) +{ + + if (!interface) { + return; + } + + static const NdrTokenVec shaderTypePriority = { + TfToken("OSL"), + TfToken("RmanCpp"), + }; + + std::set resolvedNodeNames; + + for (const TfToken &nodeName : interface->GetNodeNames()) { + _ResolveVstructsForNode( + interface, + nodeName, + resolvedNodeNames, + shaderTypePriority, + enableConditions); + } +} + +PXR_NAMESPACE_CLOSE_SCOPE diff --git a/third_party/renderman-26/plugin/hdPrman/matfiltResolveVstructs.h b/third_party/renderman-26/plugin/hdPrman/matfiltResolveVstructs.h new file mode 100644 index 0000000000..a334da092d --- /dev/null +++ b/third_party/renderman-26/plugin/hdPrman/matfiltResolveVstructs.h @@ -0,0 +1,63 @@ +// +// Copyright 2019 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// +#ifndef EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_MATFILT_RESOLVE_VSTRUCTS_H +#define EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_MATFILT_RESOLVE_VSTRUCTS_H + +#include "pxr/pxr.h" +#include "pxr/imaging/hd/material.h" +#include "pxr/imaging/hd/materialNetworkInterface.h" +#include "pxr/usd/ndr/declare.h" + +#include + +PXR_NAMESPACE_OPEN_SCOPE + +/// Expands "virtual struct" connections for RenderMan. +/// If requested, conditional actions are evaluated. +void MatfiltResolveVstructs( + HdMaterialNetworkInterface *networkInterface, + bool enableConditions = true); + +class MatfiltVstructConditionalEvaluatorImpl; + +/// \class MatfiltVstructConditionalEvaluator +/// +/// Parses and evaluates a single expression of "virtual struct conditional +/// grammar". This is used internally by MatfiltResolveVstructs but is +/// available to facilitate unit testing. +class MatfiltVstructConditionalEvaluator +{ +public: + typedef std::shared_ptr Ptr; + + ~MatfiltVstructConditionalEvaluator(); + + static Ptr Parse(const std::string &inputExpr); + + /// Runs the conditional actions specified by the parsed inputExpr. + /// + /// Because this evaluates the conditional actions (connect, ignore, + /// set constant, copy upstream parameter value), this is sent the context + /// of the current connected nodes as well as the mutable network to + /// directly change. + /// + void Evaluate( + const TfToken &nodeId, + const TfToken &nodeInputId, + const TfToken &upstreamNodeId, + const TfToken &upstreamNodeOutput, + const NdrTokenVec &shaderTypePriority, + HdMaterialNetworkInterface *networkInterface) const; +private: + MatfiltVstructConditionalEvaluator() = default; + + MatfiltVstructConditionalEvaluatorImpl *_impl = nullptr; +}; + +PXR_NAMESPACE_CLOSE_SCOPE + +#endif // EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_MATFILT_RESOLVE_VSTRUCTS_H diff --git a/third_party/renderman-26/plugin/hdPrman/matfiltSceneIndexPlugins.cpp b/third_party/renderman-26/plugin/hdPrman/matfiltSceneIndexPlugins.cpp new file mode 100644 index 0000000000..8694f62e64 --- /dev/null +++ b/third_party/renderman-26/plugin/hdPrman/matfiltSceneIndexPlugins.cpp @@ -0,0 +1,258 @@ +// +// Copyright 2022 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// +#include "hdPrman/matfiltSceneIndexPlugins.h" +#include "hdPrman/material.h" +#include "hdPrman/matfiltConvertPreviewMaterial.h" + +#ifdef PXR_MATERIALX_SUPPORT_ENABLED +#include "hdPrman/matfiltMaterialX.h" +#endif + +#include "hdPrman/virtualStructResolvingSceneIndex.h" + +#include "pxr/base/tf/stringUtils.h" + +#include "pxr/imaging/hd/dataSourceTypeDefs.h" +#include "pxr/imaging/hd/materialFilteringSceneIndexBase.h" +#include "pxr/imaging/hd/materialNetworkInterface.h" +#include "pxr/imaging/hd/retainedDataSource.h" +#include "pxr/imaging/hd/sceneIndexPluginRegistry.h" + +#include +#include + +PXR_NAMESPACE_OPEN_SCOPE + +TF_DEFINE_PRIVATE_TOKENS( + _tokens, + (applyConditionals) + ((previewMatPluginName, "HdPrman_PreviewMaterialFilteringSceneIndexPlugin")) + ((materialXPluginName, "HdPrman_MaterialXFilteringSceneIndexPlugin")) + ((vstructPluginName, "HdPrman_VirtualStructResolvingSceneIndexPlugin")) +); + +/// Ordering of the matfilt operations. This is necessary when using scene +/// index plugins instead of a filter chain which is populated in the required +/// order. +enum _MatfiltOrder +{ + Start = 0, + ConnectionResolve = 100, // vstruct + NodeTranslation = 110, // matx, preview surface + End = 200, +}; + +//////////////////////////////////////////////////////////////////////////////// +// Plugin registrations +//////////////////////////////////////////////////////////////////////////////// + +static const char * const _rendererDisplayName = "Prman"; +// XXX: Hardcoded for now to match the legacy matfilt logic. +static const bool _resolveVstructsWithConditionals = true; + +TF_REGISTRY_FUNCTION(TfType) +{ + HdSceneIndexPluginRegistry::Define< + HdPrman_PreviewMaterialFilteringSceneIndexPlugin>(); + + HdSceneIndexPluginRegistry::Define< + HdPrman_MaterialXFilteringSceneIndexPlugin>(); + + HdSceneIndexPluginRegistry::Define< + HdPrman_VirtualStructResolvingSceneIndexPlugin>(); +} + +TF_REGISTRY_FUNCTION(HdSceneIndexPlugin) +{ + HdSceneIndexPluginRegistry::GetInstance().RegisterSceneIndexForRenderer( + _rendererDisplayName, + _tokens->previewMatPluginName, + nullptr, // no argument data necessary + _MatfiltOrder::NodeTranslation, + HdSceneIndexPluginRegistry::InsertionOrderAtStart); + + HdSceneIndexPluginRegistry::GetInstance().RegisterSceneIndexForRenderer( + _rendererDisplayName, + _tokens->materialXPluginName, + nullptr, // no argument data necessary + _MatfiltOrder::NodeTranslation, + HdSceneIndexPluginRegistry::InsertionOrderAtStart); + + HdContainerDataSourceHandle const inputArgs = + HdRetainedContainerDataSource::New( + _tokens->applyConditionals, + HdRetainedTypedSampledDataSource::New( + _resolveVstructsWithConditionals)); + + HdSceneIndexPluginRegistry::GetInstance().RegisterSceneIndexForRenderer( + _rendererDisplayName, + _tokens->vstructPluginName, + inputArgs, + _MatfiltOrder::ConnectionResolve, + HdSceneIndexPluginRegistry::InsertionOrderAtStart); +} + +//////////////////////////////////////////////////////////////////////////////// +// Scene Index Implementations +//////////////////////////////////////////////////////////////////////////////// + +namespace +{ + +void +_TransformPreviewMaterialNetwork( + HdMaterialNetworkInterface *networkInterface) +{ + std::vector errors; + MatfiltConvertPreviewMaterial(networkInterface, &errors); + if (!errors.empty()) { + TF_RUNTIME_ERROR( + "Error filtering preview material network for prim %s: %s\n", + networkInterface->GetMaterialPrimPath().GetText(), + TfStringJoin(errors).c_str()); + } +} + +TF_DECLARE_REF_PTRS(_PreviewMaterialFilteringSceneIndex); + +class _PreviewMaterialFilteringSceneIndex : + public HdMaterialFilteringSceneIndexBase +{ +public: + + static _PreviewMaterialFilteringSceneIndexRefPtr New( + const HdSceneIndexBaseRefPtr &inputScene) + { + return TfCreateRefPtr( + new _PreviewMaterialFilteringSceneIndex(inputScene)); + } + +protected: + _PreviewMaterialFilteringSceneIndex( + const HdSceneIndexBaseRefPtr &inputSceneIndex) + : HdMaterialFilteringSceneIndexBase(inputSceneIndex) + { + } + + FilteringFnc _GetFilteringFunction() const override + { + return _TransformPreviewMaterialNetwork; + } +}; + +/// ---------------------------------------------------------------------------- + +#ifdef PXR_MATERIALX_SUPPORT_ENABLED + +void +_TransformMaterialXNetwork( + HdMaterialNetworkInterface *networkInterface) +{ + std::vector errors; + MatfiltMaterialX(networkInterface, &errors); + if (!errors.empty()) { + TF_RUNTIME_ERROR( + "Error filtering preview material network for prim %s: %s\n", + networkInterface->GetMaterialPrimPath().GetText(), + TfStringJoin(errors).c_str()); + } +} + +TF_DECLARE_REF_PTRS(_MaterialXFilteringSceneIndex); + +class _MaterialXFilteringSceneIndex : + public HdMaterialFilteringSceneIndexBase +{ +public: + + static _MaterialXFilteringSceneIndexRefPtr New( + const HdSceneIndexBaseRefPtr &inputScene) + { + return TfCreateRefPtr( + new _MaterialXFilteringSceneIndex(inputScene)); + } + +protected: + _MaterialXFilteringSceneIndex( + const HdSceneIndexBaseRefPtr &inputSceneIndex) + : HdMaterialFilteringSceneIndexBase(inputSceneIndex) + { + } + + FilteringFnc _GetFilteringFunction() const override + { + return _TransformMaterialXNetwork; + } +}; + +#endif + +/// ---------------------------------------------------------------------------- + +// Note: HdPrman_VirtualStructResolvingSceneIndex is defined in its own +// translation unit for unit testing purposes. +// + +} // anonymous namespace + +//////////////////////////////////////////////////////////////////////////////// +// Scene Index Plugin Implementations +//////////////////////////////////////////////////////////////////////////////// + +HdPrman_PreviewMaterialFilteringSceneIndexPlugin:: +HdPrman_PreviewMaterialFilteringSceneIndexPlugin() = default; + +HdSceneIndexBaseRefPtr +HdPrman_PreviewMaterialFilteringSceneIndexPlugin::_AppendSceneIndex( + const HdSceneIndexBaseRefPtr &inputScene, + const HdContainerDataSourceHandle &inputArgs) +{ + TF_UNUSED(inputArgs); + return _PreviewMaterialFilteringSceneIndex::New(inputScene); +} + +/// ---------------------------------------------------------------------------- + +HdPrman_MaterialXFilteringSceneIndexPlugin:: +HdPrman_MaterialXFilteringSceneIndexPlugin() = default; + +HdSceneIndexBaseRefPtr +HdPrman_MaterialXFilteringSceneIndexPlugin::_AppendSceneIndex( + const HdSceneIndexBaseRefPtr &inputScene, + const HdContainerDataSourceHandle &inputArgs) +{ + TF_UNUSED(inputArgs); +#if PXR_MATERIALX_SUPPORT_ENABLED + return _MaterialXFilteringSceneIndex::New(inputScene); +#else + return inputScene; +#endif +} + +/// ---------------------------------------------------------------------------- + +HdPrman_VirtualStructResolvingSceneIndexPlugin:: +HdPrman_VirtualStructResolvingSceneIndexPlugin() = default; + +HdSceneIndexBaseRefPtr +HdPrman_VirtualStructResolvingSceneIndexPlugin::_AppendSceneIndex( + const HdSceneIndexBaseRefPtr &inputScene, + const HdContainerDataSourceHandle &inputArgs) +{ + bool applyConditionals = false; + if (HdBoolDataSourceHandle val = HdBoolDataSource::Cast( + inputArgs->Get(_tokens->applyConditionals))) { + applyConditionals = val->GetTypedValue(0.0f); + } else { + TF_CODING_ERROR("Missing argument to plugin %s", + _tokens->vstructPluginName.GetText()); + } + return HdPrman_VirtualStructResolvingSceneIndex::New( + inputScene, applyConditionals); +} + +PXR_NAMESPACE_CLOSE_SCOPE diff --git a/third_party/renderman-26/plugin/hdPrman/matfiltSceneIndexPlugins.h b/third_party/renderman-26/plugin/hdPrman/matfiltSceneIndexPlugins.h new file mode 100644 index 0000000000..2a33cf782d --- /dev/null +++ b/third_party/renderman-26/plugin/hdPrman/matfiltSceneIndexPlugins.h @@ -0,0 +1,79 @@ +// +// Copyright 2022 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// +#ifndef EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_MAT_FILT_SCENE_INDEX_PLUGINS_H +#define EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_MAT_FILT_SCENE_INDEX_PLUGINS_H + +#include "pxr/pxr.h" +#include "pxr/imaging/hd/sceneIndexPlugin.h" +#include "hdPrman/api.h" + +PXR_NAMESPACE_OPEN_SCOPE + +/// \class HdPrman_PreviewMaterialFilteringSceneIndexPlugin +/// +/// Plugin that provides a scene index that transforms the underlying material +/// network into Prman equivalents for each material prim that has a +/// UsdPreviewSurface node, +/// +/// This plugin is registered with the scene index plugin registry for Prman. +/// +class HdPrman_PreviewMaterialFilteringSceneIndexPlugin : + public HdSceneIndexPlugin +{ +public: + HdPrman_PreviewMaterialFilteringSceneIndexPlugin(); + +protected: + HdSceneIndexBaseRefPtr _AppendSceneIndex( + const HdSceneIndexBaseRefPtr &inputScene, + const HdContainerDataSourceHandle &inputArgs) override; +}; + +/// ---------------------------------------------------------------------------- +/// \class HdPrman_MaterialXFilteringSceneIndexPlugin +/// +/// Plugin that provides a scene index that transforms the underlying material +/// network into Prman equivalents for each material prim that has a +/// MaterialX node connected to the 'surface' terminal. +/// XXX: matFiltMaterialX.h doesn't seem to support other terminals +/// (displacmeent, volume) +/// +/// This plugin is registered with the scene index plugin registry for Prman. +/// +class HdPrman_MaterialXFilteringSceneIndexPlugin : public HdSceneIndexPlugin +{ +public: + HdPrman_MaterialXFilteringSceneIndexPlugin(); + +protected: + HdSceneIndexBaseRefPtr _AppendSceneIndex( + const HdSceneIndexBaseRefPtr &inputScene, + const HdContainerDataSourceHandle &inputArgs) override; +}; + +/// ---------------------------------------------------------------------------- +/// \class HdPrman_VirtualStructResolvingSceneIndexPlugin +/// +/// Plugin that provides a scene index that expands "virtual struct" +/// connections, including evaluation of conditional actions. +/// +/// This plugin is registered with the scene index plugin registry for Prman. +/// +class HdPrman_VirtualStructResolvingSceneIndexPlugin : public HdSceneIndexPlugin +{ +public: + HdPrman_VirtualStructResolvingSceneIndexPlugin(); + +protected: + HdSceneIndexBaseRefPtr _AppendSceneIndex( + const HdSceneIndexBaseRefPtr &inputScene, + const HdContainerDataSourceHandle &inputArgs) override; +}; + +PXR_NAMESPACE_CLOSE_SCOPE + +#endif //EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_MAT_FILT_SCENE_INDEX_PLUGINS_H diff --git a/third_party/renderman-26/plugin/hdPrman/mesh.cpp b/third_party/renderman-26/plugin/hdPrman/mesh.cpp new file mode 100644 index 0000000000..74748b20be --- /dev/null +++ b/third_party/renderman-26/plugin/hdPrman/mesh.cpp @@ -0,0 +1,308 @@ +// +// Copyright 2019 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// +#include // for std::iota +#include "hdPrman/mesh.h" +#include "hdPrman/renderParam.h" +#include "hdPrman/coordSys.h" +#include "hdPrman/material.h" +#include "hdPrman/rixStrings.h" +#include "pxr/imaging/hd/meshTopology.h" +#include "pxr/imaging/pxOsd/subdivTags.h" +#include "pxr/imaging/pxOsd/tokens.h" +#include "pxr/usd/usdRi/rmanUtilities.h" + +#include "RiTypesHelper.h" + +#include + +PXR_NAMESPACE_OPEN_SCOPE + +#if PXR_VERSION > 2011 +HdPrman_Mesh::HdPrman_Mesh(SdfPath const& id, const bool isMeshLight) + : BASE(id) + , _isMeshLight(isMeshLight) +#else +HdPrman_Mesh::HdPrman_Mesh(SdfPath const& id, + SdfPath const& instancerId) + : BASE(id, instancerId) +#endif +{ +} + +bool +HdPrman_Mesh::_PrototypeOnly() +{ + return _isMeshLight; +} + +HdDirtyBits +HdPrman_Mesh::GetInitialDirtyBitsMask() const +{ + // The initial dirty bits control what data is available on the first + // run through _PopulateRtMesh(), so it should list every data item + // that _PopluateRtMesh requests. + int mask = HdChangeTracker::Clean + | HdChangeTracker::DirtyPoints + | HdChangeTracker::DirtyTopology + | HdChangeTracker::DirtyTransform + | HdChangeTracker::DirtyVisibility + | HdChangeTracker::DirtyCullStyle + | HdChangeTracker::DirtyDoubleSided + | HdChangeTracker::DirtySubdivTags + | HdChangeTracker::DirtyPrimvar + | HdChangeTracker::DirtyNormals + | HdChangeTracker::DirtyMaterialId + | HdChangeTracker::DirtyInstancer + ; + + return (HdDirtyBits)mask; +} + +static +VtIntArray +_Union(const VtIntArray &a, const VtIntArray &b) +{ + if (a.empty()) { + return b; + } else if (b.empty()) { + return a; + } else { + VtIntArray aCopy = a; + VtIntArray bCopy = b; + std::sort(aCopy.begin(), aCopy.end()); + std::sort(bCopy.begin(), bCopy.end()); + VtIntArray merged; + std::set_union(aCopy.cbegin(), aCopy.cend(), + bCopy.cbegin(), bCopy.cend(), + std::back_inserter(merged)); + return merged; + } +} + +RtPrimVarList +HdPrman_Mesh::_ConvertGeometry(HdPrman_RenderParam *renderParam, + HdSceneDelegate *sceneDelegate, + const SdfPath &id, + RtUString *primType, + HdGeomSubsets *geomSubsets) +{ + // Pull topology. + const HdMeshTopology topology = GetMeshTopology(sceneDelegate); + const size_t npoints = topology.GetNumPoints(); + const VtIntArray verts = topology.GetFaceVertexIndices(); + const VtIntArray nverts = topology.GetFaceVertexCounts(); + + // If the geometry has been partitioned into subsets, add an + // additional subset representing anything left over. + *geomSubsets = topology.GetGeomSubsets(); + if (!geomSubsets->empty()) { + const int numFaces = topology.GetNumFaces(); + std::vector faceMask(numFaces, true); + size_t numUnusedFaces = faceMask.size(); + for (HdGeomSubset const& subset: *geomSubsets) { + for (int index: subset.indices) { + if (TF_VERIFY(index < numFaces) && faceMask[index]) { + faceMask[index] = false; + numUnusedFaces--; + } + } + } + if (numUnusedFaces) { + geomSubsets->push_back(HdGeomSubset()); + HdGeomSubset &unusedSubset = geomSubsets->back(); + unusedSubset.type = HdGeomSubset::TypeFaceSet; + unusedSubset.id = id; + // Use an empty material ID as a placeholder to indicate + // that we wish to re-use the mesh-level material binding. + unusedSubset.materialId = SdfPath(); + unusedSubset.indices.resize(numUnusedFaces); + size_t count = 0; + for (size_t i=0; + i < faceMask.size() && count < numUnusedFaces; ++i) { + if (faceMask[i]) { + unusedSubset.indices[count] = i; + count++; + } + } + } + } + + RtPrimVarList primvars( + nverts.size(), /* uniform */ + npoints, /* vertex */ + npoints, /* varying */ + verts.size() /* facevarying */); + + // + // Point positions (P) + // + HdPrman_ConvertPointsPrimvar( + sceneDelegate, + id, + renderParam->GetShutterInterval(), + primvars, + npoints); + // Topology. + primvars.SetIntegerDetail(RixStr.k_Ri_nvertices, nverts.cdata(), + RtDetailType::k_uniform); + primvars.SetIntegerDetail(RixStr.k_Ri_vertices, verts.cdata(), + RtDetailType::k_facevarying); + if (topology.GetScheme() == PxOsdOpenSubdivTokens->catmullClark) { + *primType = RixStr.k_Ri_SubdivisionMesh; + primvars.SetString(RixStr.k_Ri_scheme, RixStr.k_catmullclark); + } else if (topology.GetScheme() == PxOsdOpenSubdivTokens->loop) { + *primType = RixStr.k_Ri_SubdivisionMesh; + primvars.SetString(RixStr.k_Ri_scheme, RixStr.k_loop); + } else if (topology.GetScheme() == PxOsdOpenSubdivTokens->bilinear) { + *primType = RixStr.k_Ri_SubdivisionMesh; + primvars.SetString(RixStr.k_Ri_scheme, RixStr.k_bilinear); + } else { // if scheme == PxOsdOpenSubdivTokens->none + *primType = RixStr.k_Ri_PolygonMesh; + } + + // Invisible faces will be handled by treating them as holes. Since there + // may also be explicitly specified hole indices, we use the union of the + // two lists as the hole indices for the mesh. + const VtIntArray invisibleFaces = topology.GetInvisibleFaces(); + const VtIntArray explicitHoleIndices = topology.GetHoleIndices(); + const VtIntArray holeIndices = _Union(invisibleFaces, explicitHoleIndices); + + if (*primType == RixStr.k_Ri_PolygonMesh && + !holeIndices.empty()) { + // Poly meshes with holes are promoted to bilinear subdivs, to + // make riley respect the holes. + *primType = RixStr.k_Ri_SubdivisionMesh; + primvars.SetString(RixStr.k_Ri_scheme, RixStr.k_bilinear); + } + + // Orientation, aka winding order. + // Because PRMan uses a left-handed coordinate system, and USD/Hydra + // use a right-handed coordinate system, the meaning of orientation + // also flips when we convert between them. So LH<->RH. + if (topology.GetOrientation() == PxOsdOpenSubdivTokens->leftHanded) { + primvars.SetString(RixStr.k_Ri_Orientation, RixStr.k_rh); + } else { + primvars.SetString(RixStr.k_Ri_Orientation, RixStr.k_lh); + } + + // Subdiv tags + if (*primType == RixStr.k_Ri_SubdivisionMesh) { + std::vector tagNames; + std::vector tagArgCounts; + std::vector tagIntArgs; + std::vector tagFloatArgs; + std::vector tagStringArgs; + + // Holes + if (!holeIndices.empty()) { + tagNames.push_back(RixStr.k_hole); + tagArgCounts.push_back(holeIndices.size()); // num int args + tagArgCounts.push_back(0); // num float args + tagArgCounts.push_back(0); // num str args + tagIntArgs.insert(tagIntArgs.end(), + holeIndices.begin(), holeIndices.end()); + } + + const PxOsdSubdivTags osdTags = GetSubdivTags(sceneDelegate); + + // Creases + const VtIntArray creaseLengths = osdTags.GetCreaseLengths(); + const VtIntArray creaseIndices = osdTags.GetCreaseIndices(); + const VtFloatArray creaseWeights = osdTags.GetCreaseWeights(); + if (!creaseIndices.empty()) { + const bool weightPerCrease = + creaseWeights.size() == creaseLengths.size(); + for (int creaseLength: creaseLengths) { + tagNames.push_back(RixStr.k_crease); + tagArgCounts.push_back(creaseLength); // num int args + if (weightPerCrease) { + // one weight for each crease + tagArgCounts.push_back(1); // num float args + } else { + // one weight for each crease edge + tagArgCounts.push_back(creaseLength-1); // num float args + } + tagArgCounts.push_back(0); // num str args + } + tagIntArgs.insert(tagIntArgs.end(), + creaseIndices.begin(), creaseIndices.end()); + tagFloatArgs.insert(tagFloatArgs.end(), + creaseWeights.begin(), creaseWeights.end()); + } + + // Corners + const VtIntArray cornerIndices = osdTags.GetCornerIndices(); + const VtFloatArray cornerWeights = osdTags.GetCornerWeights(); + if (cornerIndices.size()) { + tagNames.push_back(RixStr.k_corner); + tagArgCounts.push_back(cornerIndices.size()); // num int args + tagArgCounts.push_back(cornerWeights.size()); // num float args + tagArgCounts.push_back(0); // num str args + tagIntArgs.insert(tagIntArgs.end(), + cornerIndices.begin(), cornerIndices.end()); + tagFloatArgs.insert(tagFloatArgs.end(), + cornerWeights.begin(), cornerWeights.end()); + } + + // Vertex Interpolation (aka interpolateboundary) + TfToken vInterp = osdTags.GetVertexInterpolationRule(); + if (vInterp.IsEmpty()) { + vInterp = PxOsdOpenSubdivTokens->edgeAndCorner; + } + if (UsdRiConvertToRManInterpolateBoundary(vInterp) != 0) { + tagNames.push_back(RixStr.k_interpolateboundary); + tagArgCounts.push_back(0); // num int args + tagArgCounts.push_back(0); // num float args + tagArgCounts.push_back(0); // num str args + } + + // Face-varying Interpolation (aka facevaryinginterpolateboundary) + TfToken fvInterp = osdTags.GetFaceVaryingInterpolationRule(); + if (fvInterp.IsEmpty()) { + fvInterp = PxOsdOpenSubdivTokens->cornersPlus1; + } + tagNames.push_back(RixStr.k_facevaryinginterpolateboundary); + tagArgCounts.push_back(1); // num int args + tagArgCounts.push_back(0); // num float args + tagArgCounts.push_back(0); // num str args + tagIntArgs.push_back( + UsdRiConvertToRManFaceVaryingLinearInterpolation(fvInterp)); + + // Triangle subdivision rule + TfToken triSubdivRule = osdTags.GetTriangleSubdivision(); + if (triSubdivRule == PxOsdOpenSubdivTokens->smooth) { + tagNames.push_back(RixStr.k_smoothtriangles); + tagArgCounts.push_back(1); // num int args + tagArgCounts.push_back(0); // num float args + tagArgCounts.push_back(0); // num str args + tagIntArgs.push_back( + UsdRiConvertToRManTriangleSubdivisionRule(triSubdivRule)); + } + primvars.SetStringArray(RixStr.k_Ri_subdivtags, + &tagNames[0], tagNames.size()); + primvars.SetIntegerArray(RixStr.k_Ri_subdivtagnargs, + &tagArgCounts[0], tagArgCounts.size()); + primvars.SetFloatArray(RixStr.k_Ri_subdivtagfloatargs, + &tagFloatArgs[0], tagFloatArgs.size()); + primvars.SetIntegerArray(RixStr.k_Ri_subdivtagintargs, + &tagIntArgs[0], tagIntArgs.size()); + } + + // Set element ID. + std::vector elementId(nverts.size()); + std::iota(elementId.begin(), elementId.end(), 0); + primvars.SetIntegerDetail(RixStr.k_faceindex, elementId.data(), + RtDetailType::k_uniform); + + HdPrman_ConvertPrimvars( + sceneDelegate, id, primvars, nverts.size(), npoints, npoints, + verts.size()); + + return primvars; +} + +PXR_NAMESPACE_CLOSE_SCOPE diff --git a/third_party/renderman-26/plugin/hdPrman/mesh.h b/third_party/renderman-26/plugin/hdPrman/mesh.h new file mode 100644 index 0000000000..a2bba554a9 --- /dev/null +++ b/third_party/renderman-26/plugin/hdPrman/mesh.h @@ -0,0 +1,46 @@ +// +// Copyright 2019 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// +#ifndef EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_MESH_H +#define EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_MESH_H + +#include "pxr/pxr.h" +#include "hdPrman/gprim.h" +#include "pxr/imaging/hd/mesh.h" + +#include "Riley.h" + +PXR_NAMESPACE_OPEN_SCOPE + +class HdPrman_Mesh final : public HdPrman_Gprim +{ +public: + using BASE = HdPrman_Gprim; + + HF_MALLOC_TAG_NEW("new HdPrman_Mesh"); + + HdPrman_Mesh(SdfPath const& id, const bool isMeshLight); + + HdDirtyBits GetInitialDirtyBitsMask() const override; + +protected: + RtPrimVarList + _ConvertGeometry(HdPrman_RenderParam *renderParam, + HdSceneDelegate *sceneDelegate, + const SdfPath &id, + RtUString *primType, + std::vector *geomSubsets) override; + + bool _PrototypeOnly() override; + + +private: + bool _isMeshLight; +}; + +PXR_NAMESPACE_CLOSE_SCOPE + +#endif // EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_MESH_H diff --git a/third_party/renderman-26/plugin/hdPrman/meshLightResolvingSceneIndex.cpp b/third_party/renderman-26/plugin/hdPrman/meshLightResolvingSceneIndex.cpp new file mode 100644 index 0000000000..e5f026f022 --- /dev/null +++ b/third_party/renderman-26/plugin/hdPrman/meshLightResolvingSceneIndex.cpp @@ -0,0 +1,1211 @@ +// +// Copyright 2022 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. + +#include "hdPrman/meshLightResolvingSceneIndex.h" + +#include "hdPrman/debugCodes.h" +#include "hdPrman/tokens.h" + +#include "pxr/imaging/hd/version.h" + +#include "pxr/imaging/hd/categoriesSchema.h" +#include "pxr/imaging/hd/containerDataSourceEditor.h" +#include "pxr/imaging/hd/dataSourceLocator.h" +#include "pxr/imaging/hd/dataSourceMaterialNetworkInterface.h" +#include "pxr/imaging/hd/dataSourceTypeDefs.h" +#include "pxr/imaging/hd/dependenciesSchema.h" +#include "pxr/imaging/hd/filteringSceneIndex.h" +#include "pxr/imaging/hd/instancedBySchema.h" +#include "pxr/imaging/hd/lightSchema.h" +#if HD_API_VERSION >= 51 +#include "pxr/imaging/hd/materialBindingsSchema.h" +#else +#include "pxr/imaging/hd/materialBindingSchema.h" +#endif +#include "pxr/imaging/hd/materialNetworkSchema.h" +#include "pxr/imaging/hd/materialSchema.h" +#include "pxr/imaging/hd/meshSchema.h" +#include "pxr/imaging/hd/overlayContainerDataSource.h" +#include "pxr/imaging/hd/primvarsSchema.h" +#include "pxr/imaging/hd/retainedDataSource.h" +#include "pxr/imaging/hd/schema.h" +#include "pxr/imaging/hd/tokens.h" +#include "pxr/imaging/hd/visibilitySchema.h" +#include "pxr/imaging/hd/volumeFieldBindingSchema.h" +#include "pxr/imaging/hd/xformSchema.h" + +#if PXR_VERSION >= 2311 +#include "pxr/usdImaging/usdImaging/modelSchema.h" +#endif + +#include "pxr/usd/usdLux/tokens.h" + +#include "pxr/base/tf/debug.h" +#include "pxr/base/trace/trace.h" + +PXR_NAMESPACE_OPEN_SCOPE + +/** Mesh Lights + * + * Mesh lights are meshes with the MeshLightAPI applied. They have aspects of + * both traditional Rprims and Sprims. Hydra generally treats them as Rprims. + * It's up to the render bridge to notice the applied API and do something + * about it. + * + * For Prman, that means splitting the mesh light into a mesh (Rprim) and a + * light (Sprim). The Rprim part is easy enough -- we just take the incoming + * prim (called the "origin" prim throughout) and strip off the features + * that were added by the Light API. It continues downstream as just an ordinary + * mesh. The Sprim part (which I'll call the "meshLight" prim, after its prim + * type) is a bit trickier, due to limitations in Prman and other special + * considerations. + * + * The first issue is that Prman does not allow us to reuse the riley geometry + * prototype we create for the stripped-down origin (mesh) prim as the geometry + * prototype for the meshLight prim. https://jira.pixar.com/browse/RMAN-19686 + * We must make a second riley geometry prototype for the meshLight prim. + * This required a special, prototype-only path through HdPrman_Gprim::Sync(), + * which is triggered by certain gprim prim types. In our case, + * "meshLightSource" will be the prim type of this third prim. (I call this + * the "source" prim.) The source prim must be synced before we can fully sync + * the meshLight prim, since we need its geometry prototype id to create the + * riley light instance for the meshLight. We resolve this by explicitly syncing + * the source mesh during sync of the meshLight; see HdPrmanLight::Sync() for + * details. + * + * The next issue is that there is a parameter in the Light API that controls + * the color of the light emitted by the meshLight prim based on the material + * bound to the origin prim. This parameter ("materialSyncMode") has three + * possible values: + * + * * "materialGlowTintsLight" : The "glow" signal from the bound material + * should be forwarded to the light shader's "textureColor" input. This is + * the default for mesh lights. + * + * * "independent" : The bound material's glow signal and the light's emission + * color are independent of one another, and both affect the scene. + * + * * "noMaterialResponse" : The material bound to the mesh light has no + * contribution to lighting at all. This means that it's not directly + * visible at all, and only the light's emission affects the scene. + * + * When set to "materialGlowTintsLight", we have to alter the light shader + * we got from the Light API on the incoming origin prim to include the glow + * signal from the bound material and any additional shader nodes it requires. + * + * When set to "noMaterialResponse", we have to omit (or remove) the stripped- + * down origin prim. By not passing it through at all, we achieve the required + * visual response. + * + * When set to "independent", we do not have to modify anything, since our + * overall approach is one of independence. We can just use the light shader + * we got from the Light API as-is, and forward the stripped-down origin prim + * as normal. + * + * The final issue we can work around is that there is another bug in Prman + * that causes a crash when the geometry prototype and light shader associated + * with a light instance both undergo rapid simultaneous changes. + * https://jira.pixar.com/browse/RMAN-20136. We won't handle that issue here; + * see HdPrmanLight::Sync() for details. + * + * There are still some caveats. First, mesh lights are not expected to work + * without the stage scene index. They are a Hydra-2.0 thing. Backporting them + * to legacy hydra would be challenging given the constraints of the scene + * delegate interface. Using mesh lights in the prototype of a point instancer + * will certainly cause errors if the stage scene index is not enabled, because + * there is no way to add the meshLight and source prims as children of a point + * instancer prototype in legacy Hydra. Second, geom subsets with different + * material bindings will not affect the emission color when materialSyncMode + * is set to "materialGlowTintsLight". This is because there is currently no + * way to communicate multiple, subset-specific light shader resources through + * the scene delegate interface. Material bindings on subsets are ignored. (Note + * however that some of the code below anticipates support for geom subsets + * becoming possible in the future.) + */ + +TF_DEFINE_PRIVATE_TOKENS( + _tokens, + + // material network tokens + (PxrSurface) + (PxrVolume) + (glowColor) + (emitColor) + ((textureColor, "ri:light:textureColor")) + + // prim tokens not exported elsewhere + (usdCollections) + + // dependency tokens + (meshLight_dep_instancedBy) + (meshLight_dep_light) + (meshLight_dep_material) + (meshLight_dep_material_boundMaterial) + (meshLight_dep_material_materialBinding) + (meshLight_dep_materialBinding) + (meshLight_dep_mesh) + (meshLight_dep_primvars) + (meshLight_dep_usdCollections) + (meshLight_dep_visibility) + (meshLight_dep_volumeFieldBinding) + (meshLight_dep_xform) + + // synthesized prim names + ((meshLightLightName, "__meshLight_light")) + ((meshLightSourceName, "__meshLight_sourceMesh")) + ((meshLightMeshName, "__meshLight_mesh")) + + // render context / material network selector + ((renderContext, "ri")) + + // Legacy Compatibility. Remove when PXR_VERSION > 2308 + (model) + + // Legacy Compatibility. Remove when PXR_VERSION >= 2308 + (materialSyncMode) + + // Legacy Compatibility. Remove when PXR_VERSION >= 2302 + (isLight) +); + +// Internal helpers +namespace { + +bool +_IsMeshLight( + const HdSceneIndexPrim& prim) +{ + if ((prim.primType == HdPrimTypeTokens->mesh) || + (prim.primType == HdPrimTypeTokens->volume)) { + if (auto lightSchema = HdLightSchema::GetFromParent(prim.dataSource)) { + if (auto dataSource = HdBoolDataSource::Cast( +#if PXR_VERSION < 2302 + lightSchema.GetContainer()->Get(_tokens->isLight))) { +#else + lightSchema.GetContainer()->Get(HdTokens->isLight))) { +#endif + return dataSource->GetTypedValue(0.0f); + } + } + } + return false; +} + +bool +_HasValidMaterialNetwork( + const HdSceneIndexPrim& prim) +{ +#if HD_API_VERSION >= 63 + HdMaterialNetworkSchema netSchema = + HdMaterialSchema::GetFromParent(prim.dataSource) + .GetMaterialNetwork(_tokens->renderContext); + return netSchema.GetNodes() && netSchema.GetTerminals(); +#else + HdMaterialSchema matSchema = HdMaterialSchema::GetFromParent(prim.dataSource); + if (!matSchema.IsDefined()) { + return false; + } + HdContainerDataSourceHandle matDS = matSchema + .GetMaterialNetwork(_tokens->renderContext); + if (!matDS) { + return false; + } + auto netSchema = HdMaterialNetworkSchema(matDS); + if (!netSchema.IsDefined()) { + return false; + } + HdContainerDataSourceHandle nodesDS = netSchema.GetNodes(); + HdContainerDataSourceHandle terminalsDS = netSchema.GetTerminals(); + return nodesDS && terminalsDS; +#endif +} + +TfToken +_GetMaterialSyncMode( + const HdContainerDataSourceHandle& primDs) +{ + const static TfToken defaultMaterialSyncMode = UsdLuxTokens->materialGlowTintsLight; + + if (auto lightSchema = HdLightSchema::GetFromParent(primDs)) { + if (auto dataSource = HdTokenDataSource::Cast( +#if PXR_VERSION < 2308 + lightSchema.GetContainer()->Get(_tokens->materialSyncMode))) { +#else + lightSchema.GetContainer()->Get(HdTokens->materialSyncMode))) { +#endif + const TfToken materialSyncMode = dataSource->GetTypedValue(0.0f); + return materialSyncMode.IsEmpty() ? defaultMaterialSyncMode : materialSyncMode; + } + } + + return defaultMaterialSyncMode; +} + +SdfPath +_GetBoundMaterialPath( + const HdContainerDataSourceHandle& primDS) +{ +#if HD_API_VERSION >= 51 + HdMaterialBindingsSchema materialBindings = + HdMaterialBindingsSchema::GetFromParent(primDS); + HdMaterialBindingSchema materialBinding = + materialBindings.GetMaterialBinding(); + if (HdPathDataSourceHandle const ds = materialBinding.GetPath()) { + return ds->GetTypedValue(0.0f); + } +#else + if (auto matBindSchema = HdMaterialBindingSchema::GetFromParent(primDS)) { + if (auto matBindDS = matBindSchema.GetMaterialBinding()) { + return matBindDS->GetTypedValue(0.0f); + } + } +#endif + return SdfPath(); +} + +SdfPathVector +_GetLightFilterPaths( + const HdContainerDataSourceHandle &inputContainer) +{ + if (HdLightSchema lightSchema = + HdLightSchema::GetFromParent(inputContainer)) { + if (auto dataSource = HdTypedSampledDataSource::Cast( + lightSchema.GetContainer()->Get(HdTokens->filters))) { + return dataSource->GetTypedValue(0.0f); + } + } + return SdfPathVector(); +} + +HdContainerDataSourceHandle +_BuildLightShaderDataSource( + const SdfPath& originPath, + const HdSceneIndexPrim& originPrim, + const HdContainerDataSourceHandle& bindingSourceDS, + const HdSceneIndexBaseRefPtr& inputSceneIndex) +{ + // XXX: bindingSourceDS and originPrim.dataSource will typically be the + // same. bindingSourceDS exists in case the origin prim and material + // binding source are different, as would be the case with geom subsets. + // Having different light shaders for each geom subset is not supported yet + // as there is no way to squeeze them through the scene delegate interface, + // but we do expect to support this in the future. + + const TfToken terminalToken = + originPrim.primType == HdPrimTypeTokens->volume + ? HdMaterialTerminalTokens->volume + : HdMaterialTerminalTokens->surface; + const TfToken expectedShader = + terminalToken == HdMaterialTerminalTokens->volume + ? _tokens->PxrVolume + : _tokens->PxrSurface; + const TfToken glowParam = + expectedShader == _tokens->PxrVolume + ? _tokens->emitColor + : _tokens->glowColor; + + // Get the original light shader network + const HdContainerDataSourceHandle& originalShaderDS = + HdMaterialSchema::GetFromParent(originPrim.dataSource) + .GetMaterialNetwork(_tokens->renderContext) +#if HD_API_VERSION >= 63 + .GetContainer() +#endif + ; + + // check materialSyncMode + if (_GetMaterialSyncMode(originPrim.dataSource) != + UsdLuxTokens->materialGlowTintsLight) { + // material does not affect light shader; return unmodified + return originalShaderDS; + } + + // check the bound material path + const SdfPath matPath = _GetBoundMaterialPath(bindingSourceDS); + if (matPath.IsEmpty()) { + // no material bound to origin prim; return unmodified + return originalShaderDS; + } + + // retrieve the material prim and get its shader network + const HdSceneIndexPrim& matPrim = inputSceneIndex->GetPrim(matPath); + const HdContainerDataSourceHandle& matDS = + HdMaterialSchema::GetFromParent(matPrim.dataSource) + .GetMaterialNetwork(_tokens->renderContext) +#if HD_API_VERSION >= 63 + .GetContainer() +#endif + ; + + if (!matDS) { + // could not get material shader network from material prim; + // return unmodified + TF_DEBUG(HDPRMAN_MESHLIGHT).Msg("Could not get material shader network " + "from material prim; shader for %s light <%s> will not be " + "modified\n", originPrim.primType.GetText(), originPath.GetText()); + return originalShaderDS; + } + + // interface with the material shader network +#if PXR_VERSION <= 2308 + const HdDataSourceMaterialNetworkInterface srcMatNI(matPath, matDS); +#else + const HdDataSourceMaterialNetworkInterface srcMatNI(matPath, matDS, + originPrim.dataSource); +#endif + // look up the surface/volume terminal connection + const auto& terminalConn = srcMatNI.GetTerminalConnection(terminalToken); + if (!terminalConn.first) { + // no surface/volume terminal connection; return unmodified + TF_DEBUG(HDPRMAN_MESHLIGHT).Msg("Could not locate %s terminal " + "connection; shader for %s light <%s> will not be modified\n", + terminalToken.GetText(), originPrim.primType.GetText(), + originPath.GetText()); + return originalShaderDS; + } + + // check the terminal's upstream node is of a supported type + const TfToken& nodeType = srcMatNI.GetNodeType( + terminalConn.second.upstreamNodeName); + + if (nodeType != expectedShader) { + // unsupported node type; return unmodified + TF_DEBUG(HDPRMAN_MESHLIGHT).Msg("%s terminal upstream node is not " + "%s; shader for %s light <%s> will not be modified\n", + terminalToken.GetText(), expectedShader.GetText(), + originPrim.primType.GetText(), originPath.GetText()); + return originalShaderDS; + } + + // interface with the original light shader network +#if PXR_VERSION <= 2308 + HdDataSourceMaterialNetworkInterface shaderNI(originPath, originalShaderDS); +#else + HdDataSourceMaterialNetworkInterface shaderNI(originPath, originalShaderDS, + originPrim.dataSource); +#endif + // look up the light terminal connection + const auto lightTC = shaderNI.GetTerminalConnection( + HdMaterialTerminalTokens->light); + + // try for material's glow input connection + const auto glowIC = srcMatNI.GetNodeInputConnection( + terminalConn.second.upstreamNodeName, glowParam); + if (!glowIC.empty()) { + // glow input connection exists; set as textureColor on + // light terminal's upstream node + shaderNI.SetNodeInputConnection( + lightTC.second.upstreamNodeName, + _tokens->textureColor, + glowIC); + + // return the modified light shader + + // XXX: We a local copy of the nodes, since shader networks cannot + // reference nodes in other networks. But we are not bothering to walk + // the graph and pull only the nodes we actually need. We just copy + // over all the nodes. + HdContainerDataSourceHandle handles[2] = { + shaderNI.Finish(), + HdMaterialNetworkSchema::Builder() + .SetNodes( + HdMaterialNetworkSchema(matDS).GetNodes() +#if HD_API_VERSION >= 63 + .GetContainer() +#endif + ) + .Build() + }; + return HdOverlayContainerDataSource::New(2, handles); + } + // No glow input connection; try for param value instead + const VtValue glowIV = srcMatNI.GetNodeParameterValue( + terminalConn.second.upstreamNodeName, glowParam); + if (glowIV.IsHolding()) { + // glow param value exists; set as textureColor on + // light terminal's upstream node + shaderNI.SetNodeParameterValue( + lightTC.second.upstreamNodeName, + _tokens->textureColor, + glowIV); + // return the modified light shader. No need to copy any nodes. + return shaderNI.Finish(); + } + + // No glow param value either; return unmodified + return originalShaderDS; +} + +HdContainerDataSourceHandle +_BuildLightDependenciesDataSource( + const SdfPath& originPath, + const HdContainerDataSourceHandle& originDS, + const SdfPath& bindingSourcePath, + const HdContainerDataSourceHandle& bindingSourceDS) +{ + // XXX: As with _BuildLightShaderDataSource above, bindingSource will + // ordinarily be the same as origin, except in the (not yet supported) + // case of geom subsets. + + // Data source locators + + // light + static const HdLocatorDataSourceHandle lightDSL = + HdRetainedTypedSampledDataSource::New( + HdLightSchema::GetDefaultLocator()); + + // light.filters + static const HdLocatorDataSourceHandle lightFiltersDSL = + HdRetainedTypedSampledDataSource::New( + HdLightSchema::GetDefaultLocator().Append(HdTokens->filters)); + + // material + static const HdLocatorDataSourceHandle materialDSL = + HdRetainedTypedSampledDataSource::New( + HdMaterialSchema::GetDefaultLocator()); + + // material binding + static const HdLocatorDataSourceHandle materialBindingsDSL = + HdRetainedTypedSampledDataSource::New( +#if HD_API_VERSION >= 51 + HdMaterialBindingsSchema::GetDefaultLocator()); +#else + HdMaterialBindingSchema::GetDefaultLocator()); +#endif + + // usdCollections + static const HdLocatorDataSourceHandle usdCollectionsDSL = + HdRetainedTypedSampledDataSource::New( + HdDataSourceLocator(_tokens->usdCollections)); + + // visibility + static const HdLocatorDataSourceHandle visibilityDSL = + HdRetainedTypedSampledDataSource::New( + HdVisibilitySchema::GetDefaultLocator()); + + // xform + static const HdLocatorDataSourceHandle xformDSL = + HdRetainedTypedSampledDataSource::New( + HdXformSchema::GetDefaultLocator()); + + // instanced by + static const HdLocatorDataSourceHandle instancedByDSL = + HdRetainedTypedSampledDataSource::New( + HdInstancedBySchema::GetDefaultLocator()); + + // Build dependencies data source + + // Read "-->" in comments as "depends on" + + std::vector names; + std::vector sources; + + const auto originPathDS = + HdRetainedTypedSampledDataSource::New(originPath); + + // meshLight.light --> origin.light + names.push_back(_tokens->meshLight_dep_light); + sources.push_back(HdDependencySchema::Builder() + .SetDependedOnPrimPath(originPathDS) + .SetDependedOnDataSourceLocator(lightDSL) + .SetAffectedDataSourceLocator(lightDSL) + .Build()); + + // meshLight.material --> origin.material (the light shader) + names.push_back(_tokens->meshLight_dep_material); + sources.push_back(HdDependencySchema::Builder() + .SetDependedOnPrimPath(originPathDS) + .SetDependedOnDataSourceLocator(materialDSL) + .SetAffectedDataSourceLocator(materialDSL) + .Build()); + + // meshLight.material --> bindingSource.materialBinding + names.push_back(_tokens->meshLight_dep_material_materialBinding); + sources.push_back(HdDependencySchema::Builder() + .SetDependedOnPrimPath( + HdRetainedTypedSampledDataSource::New(bindingSourcePath)) + .SetDependedOnDataSourceLocator(materialBindingsDSL) + .SetAffectedDataSourceLocator(materialDSL) + .Build()); + + // meshLight.usdCollections --> origin.usdCollections + names.push_back(_tokens->meshLight_dep_usdCollections); + sources.push_back(HdDependencySchema::Builder() + .SetDependedOnPrimPath(originPathDS) + .SetDependedOnDataSourceLocator(usdCollectionsDSL) + .SetAffectedDataSourceLocator(usdCollectionsDSL) + .Build()); + + // meshLight.visibility --> origin.visibility + names.push_back(_tokens->meshLight_dep_visibility); + sources.push_back(HdDependencySchema::Builder() + .SetDependedOnPrimPath(originPathDS) + .SetDependedOnDataSourceLocator(visibilityDSL) + .SetAffectedDataSourceLocator(visibilityDSL) + .Build()); + + // meshLight.xform --> origin.xform + names.push_back(_tokens->meshLight_dep_xform); + sources.push_back(HdDependencySchema::Builder() + .SetDependedOnPrimPath(originPathDS) + .SetDependedOnDataSourceLocator(xformDSL) + .SetAffectedDataSourceLocator(xformDSL) + .Build()); + + // meshLight.instancedBy --> origin.instancedBy + names.push_back(_tokens->meshLight_dep_instancedBy); + sources.push_back(HdDependencySchema::Builder() + .SetDependedOnPrimPath(originPathDS) + .SetDependedOnDataSourceLocator(instancedByDSL) + .SetAffectedDataSourceLocator(instancedByDSL) + .Build()); + + // meshLight.material --> .material + names.push_back(_tokens->meshLight_dep_material_boundMaterial); + sources.push_back(HdDependencySchema::Builder() + .SetDependedOnPrimPath( +#if HD_API_VERSION >= 51 + HdMaterialBindingsSchema::GetFromParent(bindingSourceDS) + .GetMaterialBinding() + .GetPath()) +#else + HdMaterialBindingSchema::GetFromParent(bindingSourceDS) + .GetMaterialBinding()) +#endif + .SetDependedOnDataSourceLocator(materialDSL) + .SetAffectedDataSourceLocator(materialDSL) + .Build()); + + // XXX: Light filter dependencies *should* look like this: + // meshLight.material --> origin.material, + // origin.material --> origin.light.filters, + // origin.material --> + // If they did, we would not need any direct dependencies on the + // light filter prims here. But light filters are not yet Hydra 2.0 enabled, + // so we will put those direct dependencies here. Delete this stuff when + // lights and light filters are properly handling the origin.material --> + // dependencies. (Note that the meshLight.material --> + // origin.light.filters dependency is covered by the meshLight.material --> + // origin.light dependency.) + + static const std::string prefix = "meshLight_dep_material_filter_"; + for (const SdfPath& filterPath : _GetLightFilterPaths(originDS)) { + names.push_back(TfToken(prefix + filterPath.GetAsString())); + sources.push_back(HdDependencySchema::Builder() + .SetDependedOnPrimPath( + HdRetainedTypedSampledDataSource::New(filterPath)) + .SetDependedOnDataSourceLocator(nullptr) + .SetAffectedDataSourceLocator(materialDSL) + .Build()); + } + + // And since these dependencies are dynamic, + // meshLight.__dependencies --> origin.light.filters + static const TfToken filtersDepToken("meshLight_dep_dependencies_filters"); + names.push_back(filtersDepToken); + sources.push_back(HdDependencySchema::Builder() + .SetDependedOnPrimPath(originPathDS) + .SetDependedOnDataSourceLocator(lightFiltersDSL) + .SetAffectedDataSourceLocator(materialDSL) + .Build()); + + return HdRetainedContainerDataSource::New( + names.size(), names.data(), sources.data()); +} + +HdContainerDataSourceHandle +_BuildLightDataSource( + const SdfPath& originPath, + const HdSceneIndexPrim& originPrim, + const SdfPath& bindingSourcePath, + const HdContainerDataSourceHandle& bindingSourceDS, + const HdSceneIndexBaseRefPtr& inputSceneIndex) +{ + const TfToken materialSyncMode = _GetMaterialSyncMode(originPrim.dataSource); + std::vector names; + std::vector sources; + + // revised light shader network with glow signal from bound material + if (materialSyncMode == UsdLuxTokens->materialGlowTintsLight) { + names.push_back(HdMaterialSchemaTokens->material); + sources.push_back(HdRetainedContainerDataSource::New( +#if PXR_VERSION < 2308 + // https://github.com/PixarAnimationStudios/OpenUSD/commit/283b1a6d7fb144f6fb16040fdf689b2c517b7520 + TfToken(), +#else + _tokens->renderContext, +#endif + _BuildLightShaderDataSource( + originPath, originPrim, + bindingSourceDS, + inputSceneIndex))); + } + + // Add a link to the source mesh + names.push_back(HdLightSchemaTokens->light); + sources.push_back(HdRetainedContainerDataSource::New( + HdPrmanTokens->sourceGeom, + HdRetainedTypedSampledDataSource::New( + originPath.AppendChild(_tokens->meshLightSourceName)))); + + // Add dependencies + names.push_back(HdDependenciesSchemaTokens->__dependencies); + sources.push_back( + _BuildLightDependenciesDataSource( + originPath, originPrim.dataSource, + bindingSourcePath, bindingSourceDS)); + + // Knock out primvars + names.push_back(HdPrimvarsSchemaTokens->primvars); + sources.push_back(HdBlockDataSource::New()); + + // Knock out model +#if PXR_VERSION >= 2311 + names.push_back(UsdImagingModelSchemaTokens->model); +#else + names.push_back(_tokens->model); +#endif + sources.push_back(HdBlockDataSource::New()); + + // Knock out mesh + names.push_back(HdMeshSchemaTokens->mesh); + sources.push_back(HdBlockDataSource::New()); + + // Knock out material binding +#if HD_API_VERSION >= 51 + names.push_back(HdMaterialBindingsSchema::GetSchemaToken()); +#else + names.push_back(HdMaterialBindingSchemaTokens->materialBinding); +#endif + sources.push_back(HdBlockDataSource::New()); + + // Knock out volume field binding + names.push_back(HdVolumeFieldBindingSchemaTokens->volumeFieldBinding); + sources.push_back(HdBlockDataSource::New()); + + HdContainerDataSourceHandle handles[2] = { + HdRetainedContainerDataSource::New(names.size(), names.data(), sources.data()), + originPrim.dataSource + }; + return HdOverlayContainerDataSource::New(2, handles); +} + +HdContainerDataSourceHandle +_BuildSourceDependenciesDataSource( + const SdfPath originPath) +{ + // Data source locators + + // mesh + static const HdLocatorDataSourceHandle meshDSL = + HdRetainedTypedSampledDataSource::New( + HdMeshSchema::GetDefaultLocator()); + + // primvars + static const HdLocatorDataSourceHandle primvarsDSL = + HdRetainedTypedSampledDataSource::New( + HdPrimvarsSchema::GetDefaultLocator()); + + // material binding + static const HdLocatorDataSourceHandle materialBindingsDSL = + HdRetainedTypedSampledDataSource::New( +#if HD_API_VERSION >= 51 + HdMaterialBindingsSchema::GetDefaultLocator()); +#else + HdMaterialBindingSchema::GetDefaultLocator()); +#endif + + // volume field binding + static const HdLocatorDataSourceHandle volumeFieldBindingDSL = + HdRetainedTypedSampledDataSource::New( + HdVolumeFieldBindingSchema::GetDefaultLocator()); + + // Build dependencies data source + + // Read "-->" in comments as "depends on" + + std::vector names; + std::vector sources; + + const auto originPathDS = HdRetainedTypedSampledDataSource + ::New(originPath); + + // source.mesh --> origin.mesh + names.push_back(_tokens->meshLight_dep_mesh); + sources.push_back(HdDependencySchema::Builder() + .SetDependedOnPrimPath(originPathDS) + .SetDependedOnDataSourceLocator(meshDSL) + .SetAffectedDataSourceLocator(meshDSL) + .Build()); + + // source.primvars --> origin.primvars + names.push_back(_tokens->meshLight_dep_primvars); + sources.push_back(HdDependencySchema::Builder() + .SetDependedOnPrimPath(originPathDS) + .SetDependedOnDataSourceLocator(primvarsDSL) + .SetAffectedDataSourceLocator(primvarsDSL) + .Build()); + + // source.materialBinding --> origin.materialBinding (for displacement) + names.push_back(_tokens->meshLight_dep_materialBinding); + sources.push_back(HdDependencySchema::Builder() + .SetDependedOnPrimPath(originPathDS) + .SetDependedOnDataSourceLocator(materialBindingsDSL) + .SetAffectedDataSourceLocator(materialBindingsDSL) + .Build()); + + // source.volumeFieldBinding --> origin.volumeFieldBinding + names.push_back(_tokens->meshLight_dep_volumeFieldBinding); + sources.push_back(HdDependencySchema::Builder() + .SetDependedOnPrimPath(originPathDS) + .SetDependedOnDataSourceLocator(volumeFieldBindingDSL) + .SetAffectedDataSourceLocator(volumeFieldBindingDSL) + .Build()); + + return HdRetainedContainerDataSource::New( + names.size(), names.data(), sources.data()); +} + +HdContainerDataSourceHandle +_BuildSourceDataSource( + const SdfPath& originPath, + const HdContainerDataSourceHandle& originDS) +{ + std::vector names; + std::vector sources; + + const auto originPathDS = HdRetainedTypedSampledDataSource + ::New(originPath); + + // Add dependencies + names.push_back(HdDependenciesSchemaTokens->__dependencies); + sources.push_back(_BuildSourceDependenciesDataSource(originPath)); + + // Knock out material + names.push_back(HdMaterialSchemaTokens->material); + sources.push_back(HdBlockDataSource::New()); + + // Knock out light + names.push_back(HdLightSchemaTokens->light); + sources.push_back(HdBlockDataSource::New()); + + // Knock out usdCollections + names.push_back(_tokens->usdCollections); + sources.push_back(HdBlockDataSource::New()); + + // Knock out xform + names.push_back(HdXformSchemaTokens->xform); + sources.push_back(HdBlockDataSource::New()); + + HdContainerDataSourceHandle handles[2] = { + HdRetainedContainerDataSource::New(names.size(), names.data(), sources.data()), + originDS + }; + return HdOverlayContainerDataSource::New(2, handles); +} + +HdContainerDataSourceHandle +_BuildMeshDependenciesDataSource( + const SdfPath originPath) +{ + // Data source locators + + // mesh + static const HdLocatorDataSourceHandle meshDSL = + HdRetainedTypedSampledDataSource::New( + HdMeshSchema::GetDefaultLocator()); + + // primvars + static const HdLocatorDataSourceHandle primvarsDSL = + HdRetainedTypedSampledDataSource::New( + HdPrimvarsSchema::GetDefaultLocator()); + + // material binding + static const HdLocatorDataSourceHandle materialBindingDSL = + HdRetainedTypedSampledDataSource::New( +#if HD_API_VERSION >= 51 + HdMaterialBindingsSchema::GetDefaultLocator()); +#else + HdMaterialBindingSchema::GetDefaultLocator()); +#endif + + // visibility + static const HdLocatorDataSourceHandle visibilityDSL = + HdRetainedTypedSampledDataSource::New( + HdVisibilitySchema::GetDefaultLocator()); + + // xform + static const HdLocatorDataSourceHandle xformDSL = + HdRetainedTypedSampledDataSource::New( + HdXformSchema::GetDefaultLocator()); + + // instanced by + static const HdLocatorDataSourceHandle instancedByDSL = + HdRetainedTypedSampledDataSource::New( + HdInstancedBySchema::GetDefaultLocator()); + + // volume field binding + static const HdLocatorDataSourceHandle volumeFieldBindingDSL = + HdRetainedTypedSampledDataSource::New( + HdVolumeFieldBindingSchema::GetDefaultLocator()); + + // Build dependencies data source + + // Read "-->" in comments as "depends on" + + std::vector names; + std::vector sources; + + const auto originPathDS = HdRetainedTypedSampledDataSource + ::New(originPath); + + // mesh.mesh --> origin.mesh + names.push_back(_tokens->meshLight_dep_mesh); + sources.push_back(HdDependencySchema::Builder() + .SetDependedOnPrimPath(originPathDS) + .SetDependedOnDataSourceLocator(meshDSL) + .SetAffectedDataSourceLocator(meshDSL) + .Build()); + + // mesh.primvars --> origin.primvars + names.push_back(_tokens->meshLight_dep_primvars); + sources.push_back(HdDependencySchema::Builder() + .SetDependedOnPrimPath(originPathDS) + .SetDependedOnDataSourceLocator(primvarsDSL) + .SetAffectedDataSourceLocator(primvarsDSL) + .Build()); + + // mesh.materialBinding --> origin.materialBinding + names.push_back(_tokens->meshLight_dep_materialBinding); + sources.push_back(HdDependencySchema::Builder() + .SetDependedOnPrimPath(originPathDS) + .SetDependedOnDataSourceLocator(materialBindingDSL) + .SetAffectedDataSourceLocator(materialBindingDSL) + .Build()); + + // mesh.visibility --> origin.visibility + names.push_back(_tokens->meshLight_dep_visibility); + sources.push_back(HdDependencySchema::Builder() + .SetDependedOnPrimPath(originPathDS) + .SetDependedOnDataSourceLocator(visibilityDSL) + .SetAffectedDataSourceLocator(visibilityDSL) + .Build()); + + // mesh.xform --> origin.xform + names.push_back(_tokens->meshLight_dep_xform); + sources.push_back(HdDependencySchema::Builder() + .SetDependedOnPrimPath(originPathDS) + .SetDependedOnDataSourceLocator(xformDSL) + .SetAffectedDataSourceLocator(xformDSL) + .Build()); + + // mesh.instancedBy --> origin.instancedBy + names.push_back(_tokens->meshLight_dep_instancedBy); + sources.push_back(HdDependencySchema::Builder() + .SetDependedOnPrimPath(originPathDS) + .SetDependedOnDataSourceLocator(instancedByDSL) + .SetAffectedDataSourceLocator(instancedByDSL) + .Build()); + + // source.volumeFieldBinding --> origin.volumeFieldBinding + names.push_back(_tokens->meshLight_dep_volumeFieldBinding); + sources.push_back(HdDependencySchema::Builder() + .SetDependedOnPrimPath(originPathDS) + .SetDependedOnDataSourceLocator(volumeFieldBindingDSL) + .SetAffectedDataSourceLocator(volumeFieldBindingDSL) + .Build()); + + return HdRetainedContainerDataSource::New( + names.size(), names.data(), sources.data()); +} + +} // anonymous namespace + +/* static */ +HdPrmanMeshLightResolvingSceneIndexRefPtr +HdPrmanMeshLightResolvingSceneIndex::New( + const HdSceneIndexBaseRefPtr& inputSceneIndex) +{ + return TfCreateRefPtr( + new HdPrmanMeshLightResolvingSceneIndex( + inputSceneIndex)); +} + +HdPrmanMeshLightResolvingSceneIndex::HdPrmanMeshLightResolvingSceneIndex( + const HdSceneIndexBaseRefPtr &inputSceneIndex) + : HdSingleInputFilteringSceneIndexBase(inputSceneIndex) +{ } + +HdSceneIndexPrim +HdPrmanMeshLightResolvingSceneIndex::GetPrim( + const SdfPath &primPath) const +{ + // The origin prim -> no primType (should only be visible to HSB) + if (_meshLights.count(primPath)) { + return { + TfToken(), + _GetInputSceneIndex()->GetPrim(primPath).dataSource + }; + } + + const SdfPath& parentPath = primPath.GetParentPath(); + + if (_meshLights.count(parentPath) > 0) { + const HdSceneIndexPrim& parentPrim = _GetInputSceneIndex() + ->GetPrim(parentPath); + + // The stripped-down origin prim -> "mesh" or "volume" + if (primPath.GetNameToken() == _tokens->meshLightMeshName + && _meshLights.at(parentPath)) { + HdContainerDataSourceHandle handles[2] = { + HdRetainedContainerDataSource::New( + HdLightSchemaTokens->light, HdBlockDataSource::New(), + HdMaterialSchemaTokens->material, + HdBlockDataSource::New(), _tokens->usdCollections, + HdBlockDataSource::New(), + HdDependenciesSchemaTokens->__dependencies, + _BuildMeshDependenciesDataSource(parentPath)), + parentPrim.dataSource + }; + return { + parentPrim.primType, + HdOverlayContainerDataSource::New(2, handles) + }; + } + + // The light prim -> "meshLight" + if (primPath.GetNameToken() == _tokens->meshLightLightName) { + return { +#if PXR_VERSION < 2302 + HdPrmanTokens->meshLight, +#else + HdPrimTypeTokens->meshLight, +#endif + _BuildLightDataSource( + parentPath, parentPrim, + parentPath, parentPrim.dataSource, // materialBinding source + _GetInputSceneIndex()) + }; + } + + // The source mesh -> "meshLightSourceMesh" or "meshLightSourceVolume" + if (primPath.GetNameToken() == _tokens->meshLightSourceName) { + return { + parentPrim.primType == HdPrimTypeTokens->volume + ? HdPrmanTokens->meshLightSourceVolume + : HdPrmanTokens->meshLightSourceMesh, + _BuildSourceDataSource(parentPath, parentPrim.dataSource) + }; + } + } + + return _GetInputSceneIndex()->GetPrim(primPath); +} + +SdfPathVector +HdPrmanMeshLightResolvingSceneIndex::GetChildPrimPaths( + const SdfPath &primPath) const +{ + SdfPathVector paths = _GetInputSceneIndex()->GetChildPrimPaths(primPath); + + if (_meshLights.count(primPath)) { + paths.push_back(primPath.AppendChild(_tokens->meshLightLightName)); + paths.push_back(primPath.AppendChild(_tokens->meshLightSourceName)); + if (_meshLights.at(primPath)) { + paths.push_back(primPath.AppendChild(_tokens->meshLightMeshName)); + } + } + return paths; +} + +void +HdPrmanMeshLightResolvingSceneIndex::_PrimsAdded( + const HdSceneIndexBase &sender, + const HdSceneIndexObserver::AddedPrimEntries &entries) +{ + if (!_IsObserved()) { + return; + } + + TRACE_FUNCTION(); + + HdSceneIndexObserver::AddedPrimEntries added; + + for (const auto& entry : entries) { + if ((entry.primType == HdPrimTypeTokens->mesh) || + (entry.primType == HdPrimTypeTokens->volume)) { + HdSceneIndexPrim prim = _GetInputSceneIndex()-> + GetPrim(entry.primPath); + + // The prim is a mesh light if light.isLight is true. But a mesh + // light also needs a valid light shader network [material + // resource], which it won't have when stage scene index is not + // enabled. + // + // Mesh lights are not supported without stage scene index; + // we should not insert the light, source, or stripped-down mesh + // unless it is enabled. If it is disabled, we should instead + // just forward the origin prim along unmodified at its original + // path; downstream HdPrman will treat it as the mesh its prim type + // declares it to be. + + if (_IsMeshLight(prim) && _HasValidMaterialNetwork(prim)) { + const bool meshVisible = _GetMaterialSyncMode(prim.dataSource) + != UsdLuxTokens->noMaterialResponse; + _meshLights.insert({ entry.primPath, meshVisible }); + + // The light prim + added.emplace_back( + entry.primPath.AppendChild(_tokens->meshLightLightName), +#if PXR_VERSION < 2302 + HdPrmanTokens->meshLight); +#else + HdPrimTypeTokens->meshLight); +#endif + + // The source mesh (for the light prim) + added.emplace_back( + entry.primPath.AppendChild(_tokens->meshLightSourceName), + entry.primType == HdPrimTypeTokens->volume + ? HdPrmanTokens->meshLightSourceVolume + : HdPrmanTokens->meshLightSourceMesh); + + // The stripped-down origin prim + if (meshVisible) { + added.emplace_back( + entry.primPath.AppendChild(_tokens->meshLightMeshName), + entry.primType); + } + + // skip fallback insertion + continue; + } + } + added.push_back(entry); + } + _SendPrimsAdded(added); +} + +void +HdPrmanMeshLightResolvingSceneIndex::_PrimsRemoved( + const HdSceneIndexBase &sender, + const HdSceneIndexObserver::RemovedPrimEntries &entries) +{ + + HdSceneIndexObserver::RemovedPrimEntries removed; + + for (const auto& entry : entries) { + if (_meshLights.count(entry.primPath)) { + + // The light prim + removed.emplace_back( + entry.primPath.AppendChild(_tokens->meshLightLightName)); + + // The source mesh (for the light prim) + removed.emplace_back( + entry.primPath.AppendChild(_tokens->meshLightSourceName)); + + // The stripped-down origin prim + if (_meshLights.at(entry.primPath)) { + removed.emplace_back( + entry.primPath.AppendChild(_tokens->meshLightMeshName)); + } + + _meshLights.erase(entry.primPath); + + // skip fallback removal + continue; + } + removed.push_back(entry); + } + + _SendPrimsRemoved(removed); +} + +void +HdPrmanMeshLightResolvingSceneIndex::_PrimsDirtied( + const HdSceneIndexBase &sender, + const HdSceneIndexObserver::DirtiedPrimEntries &entries) +{ + // Dependency Forwarding Scene Index will take care of most everything, but + // we do still need to add/remove the stripped-down origin prim when + // materialSyncMode changes from/to noMaterialResponse. + + static const HdDataSourceLocator materialSyncModeLocator = { + HdLightSchemaTokens->light, +#if PXR_VERSION < 2308 + _tokens->materialSyncMode +#else + HdTokens->materialSyncMode +#endif + }; + + for (const auto& entry : entries) { + if (_meshLights.count(entry.primPath) +#if PXR_VERSION < 2208 + && entry.dirtyLocators.Intersects(materialSyncModeLocator)) { +#else + && entry.dirtyLocators.Contains(materialSyncModeLocator)) { +#endif + const HdSceneIndexPrim& prim = _GetInputSceneIndex() + ->GetPrim(entry.primPath); + const bool visible = _GetMaterialSyncMode(prim.dataSource) + != UsdLuxTokens->noMaterialResponse; + if (visible && (!_meshLights.at(entry.primPath))) { + // materialSyncMode is no longer noMaterialResponse; insert + _meshLights[entry.primPath] = visible; + _SendPrimsAdded({{ + entry.primPath.AppendChild(_tokens->meshLightMeshName), + prim.primType + }}); + } else if ((!visible) && _meshLights.at(entry.primPath)) { + // materialSyncMode changed to noMaterialResponse; remove + _meshLights[entry.primPath] = visible; + _SendPrimsRemoved({{ + entry.primPath.AppendChild(_tokens->meshLightMeshName) + }}); + } + } + } + +#ifndef PIXAR_ANIM + for (const auto& entry : entries) { + if (_meshLights.count(entry.primPath)) { + // Propogate dirtiness to the meshLight light if applicable. + // HdDataSourceLocator::EmptyLocator() == AllDirty in Hydra 1.0 + if (entry.dirtyLocators.Intersects(HdDataSourceLocator::EmptyLocator()) + || entry.dirtyLocators.Intersects(HdCategoriesSchema::GetDefaultLocator()) +#if HD_API_VERSION >= 51 + || entry.dirtyLocators.Intersects(HdMaterialBindingsSchema::GetDefaultLocator())) { +#else + || entry.dirtyLocators.Intersects(HdMaterialBindingSchema::GetDefaultLocator())) { +#endif + _SendPrimsDirtied({{ entry.primPath.AppendChild(_tokens->meshLightLightName), { + HdLightSchema::GetDefaultLocator(), + HdMaterialSchema::GetDefaultLocator(), + HdPrimvarsSchema::GetDefaultLocator(), + HdVisibilitySchema::GetDefaultLocator(), + HdXformSchema::GetDefaultLocator() + }}}); + } + + // Propogate all dirtiness to the visible meshLight mesh. + if (_meshLights[entry.primPath] == true /* IsVisible */) { + _SendPrimsDirtied({{entry.primPath.AppendChild(_tokens->meshLightMeshName), + entry.dirtyLocators + }}); + } + } + } +#endif + + _SendPrimsDirtied(entries); +} + +HdPrmanMeshLightResolvingSceneIndex::~HdPrmanMeshLightResolvingSceneIndex() + = default; + +PXR_NAMESPACE_CLOSE_SCOPE diff --git a/third_party/renderman-26/plugin/hdPrman/meshLightResolvingSceneIndex.h b/third_party/renderman-26/plugin/hdPrman/meshLightResolvingSceneIndex.h new file mode 100644 index 0000000000..33b13c5cd2 --- /dev/null +++ b/third_party/renderman-26/plugin/hdPrman/meshLightResolvingSceneIndex.h @@ -0,0 +1,51 @@ +// +// Copyright 2022 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +#ifndef EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_MESHLIGHT_RESOLVING_SCENE_INDEX_H +#define EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_MESHLIGHT_RESOLVING_SCENE_INDEX_H + +#include "pxr/pxr.h" +#include "pxr/imaging/hd/filteringSceneIndex.h" + + +PXR_NAMESPACE_OPEN_SCOPE + +TF_DECLARE_REF_PTRS(HdPrmanMeshLightResolvingSceneIndex); + +// Pixar-only, Prman-specific Hydra scene index to resolve mesh lights. +class HdPrmanMeshLightResolvingSceneIndex : + public HdSingleInputFilteringSceneIndexBase +{ +public: + static HdPrmanMeshLightResolvingSceneIndexRefPtr + New(const HdSceneIndexBaseRefPtr& inputSceneIndex); + + HdSceneIndexPrim GetPrim(const SdfPath &primPath) const override; + SdfPathVector GetChildPrimPaths(const SdfPath &primPath) const override; + +protected: + HdPrmanMeshLightResolvingSceneIndex( + const HdSceneIndexBaseRefPtr& inputSceneIndex); + ~HdPrmanMeshLightResolvingSceneIndex(); + + void _PrimsAdded( + const HdSceneIndexBase &sender, + const HdSceneIndexObserver::AddedPrimEntries &entries) override; + + void _PrimsRemoved( + const HdSceneIndexBase &sender, + const HdSceneIndexObserver::RemovedPrimEntries &entries) override; + + void _PrimsDirtied( + const HdSceneIndexBase &sender, + const HdSceneIndexObserver::DirtiedPrimEntries &entries) override; + +private: + std::unordered_map _meshLights; +}; + +PXR_NAMESPACE_CLOSE_SCOPE + +#endif //EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_MESHLIGHT_RESOLVING_SCENE_INDEX_H diff --git a/third_party/renderman-26/plugin/hdPrman/meshLightResolvingSceneIndexPlugin.cpp b/third_party/renderman-26/plugin/hdPrman/meshLightResolvingSceneIndexPlugin.cpp new file mode 100644 index 0000000000..3eb64b8c73 --- /dev/null +++ b/third_party/renderman-26/plugin/hdPrman/meshLightResolvingSceneIndexPlugin.cpp @@ -0,0 +1,52 @@ +// +// Copyright 2022 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. + +#include "hdPrman/meshLightResolvingSceneIndexPlugin.h" + +#include "pxr/imaging/hd/retainedDataSource.h" +#include "pxr/imaging/hd/sceneIndexPluginRegistry.h" +#include "pxr/imaging/hd/tokens.h" +#include "hdPrman/meshLightResolvingSceneIndex.h" +#include "hdPrman/tokens.h" + +PXR_NAMESPACE_OPEN_SCOPE + +TF_DEFINE_PRIVATE_TOKENS( + _tokens, + ((sceneIndexPluginName, "HdPrman_MeshLightResolvingSceneIndexPlugin")) +); + +TF_REGISTRY_FUNCTION(TfType) +{ + HdSceneIndexPluginRegistry::Define(); +} + +TF_REGISTRY_FUNCTION(HdSceneIndexPlugin) +{ + // We need an "insertion point" that's *after* general material resolve. + const HdSceneIndexPluginRegistry::InsertionPhase insertionPhase = 115; + for( auto const& pluginDisplayName : HdPrman_GetPluginDisplayNames() ) { + HdSceneIndexPluginRegistry::GetInstance().RegisterSceneIndexForRenderer( + pluginDisplayName, + _tokens->sceneIndexPluginName, + nullptr, // No input args. + insertionPhase, + HdSceneIndexPluginRegistry::InsertionOrderAtStart); + } +} + +HdPrman_MeshLightResolvingSceneIndexPlugin:: +HdPrman_MeshLightResolvingSceneIndexPlugin() = default; + +HdSceneIndexBaseRefPtr +HdPrman_MeshLightResolvingSceneIndexPlugin::_AppendSceneIndex( + const HdSceneIndexBaseRefPtr &inputScene, + const HdContainerDataSourceHandle &inputArgs) +{ + return HdPrmanMeshLightResolvingSceneIndex::New(inputScene); +} + +PXR_NAMESPACE_CLOSE_SCOPE diff --git a/third_party/renderman-26/plugin/hdPrman/meshLightResolvingSceneIndexPlugin.h b/third_party/renderman-26/plugin/hdPrman/meshLightResolvingSceneIndexPlugin.h new file mode 100644 index 0000000000..41e9da15dc --- /dev/null +++ b/third_party/renderman-26/plugin/hdPrman/meshLightResolvingSceneIndexPlugin.h @@ -0,0 +1,33 @@ +// +// Copyright 2022 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. + +#ifndef EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_MESHLIGHT_RESOLVING_SCENE_INDEX_PLUGIN_H +#define EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_MESHLIGHT_RESOLVING_SCENE_INDEX_PLUGIN_H + +#include "pxr/pxr.h" +#include "pxr/imaging/hd/sceneIndexPlugin.h" +#include "hdPrman/api.h" + +PXR_NAMESPACE_OPEN_SCOPE + +/// \class HdPrman_MeshLghtResolvingSceneIndexPlugin +/// +/// Pixar-only, Prman-specific Hydra scene index to resolve mesh lights. +/// +class HdPrman_MeshLightResolvingSceneIndexPlugin : public HdSceneIndexPlugin +{ +public: + HdPrman_MeshLightResolvingSceneIndexPlugin(); + +protected: + HdSceneIndexBaseRefPtr _AppendSceneIndex( + const HdSceneIndexBaseRefPtr &inputScene, + const HdContainerDataSourceHandle &inputArgs) override; +}; + +PXR_NAMESPACE_CLOSE_SCOPE + +#endif // EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_MESHLIGHT_RESOLVING_SCENE_INDEX_PLUGIN_H diff --git a/third_party/renderman-26/plugin/hdPrman/motionBlurSceneIndexPlugin.cpp b/third_party/renderman-26/plugin/hdPrman/motionBlurSceneIndexPlugin.cpp new file mode 100644 index 0000000000..9c7b7cb924 --- /dev/null +++ b/third_party/renderman-26/plugin/hdPrman/motionBlurSceneIndexPlugin.cpp @@ -0,0 +1,1433 @@ +// +// Copyright 2022 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// +#include "hdPrman/motionBlurSceneIndexPlugin.h" + +#include "hdPrman/debugCodes.h" +#include "hdPrman/renderParam.h" +#include "hdPrman/tokens.h" + +#include "pxr/base/vt/array.h" +#include "pxr/base/vt/typeHeaders.h" +#include "pxr/base/vt/visitValue.h" +#include "pxr/imaging/hd/filteringSceneIndex.h" +#include "pxr/imaging/hd/primvarsSchema.h" +#include "pxr/imaging/hd/retainedDataSource.h" +#include "pxr/imaging/hd/sceneIndexPluginRegistry.h" +#include "pxr/imaging/hd/tokens.h" +#include "pxr/imaging/hd/xformSchema.h" + +#include + +PXR_NAMESPACE_OPEN_SCOPE + +TF_DEFINE_PRIVATE_TOKENS( + _tokens, + (fps) + ((mblur, "ri:object:mblur")) + ((vblur, "ri:object:vblur")) + ((vblur_on, "Velocity Blur")) + ((ablur_on, "Acceleration Blur")) + ((vblur_off, "No Velocity Blur")) + ((geosamples, "ri:object:geosamples")) + ((xformsamples, "ri:object:xformsamples")) + (angularVelocities) // XXX: Why is this not in HdTokens? +); + +// XXX: These defaults are pulled from UsdMotionAPI, for which there is not yet +// a corresponding Hydra schema. +static const int _defaultNonlinearSampleCount = 3; +static const float _defaultBlurScale = 1.0f; +// There is no canonical source for these defaults. They were previously hard- +// coded in renderParam.cpp. +static const int _defaultXformSamples = 2; +static const int _defaultGeoSamples = 2; +static const bool _defaultMblur = true; +static const TfToken _defaultVblur = _tokens->ablur_on; + +// XXX: We need to encode the fps in the scene index (in a standard +// place). Note that fps is called timeCodesPerSecond in USD. +static const float _fps = 24.0f; + +static const float _minimumShutterInterval = 1.0e-10; + +// XXX: Set by HdPrman_MotionBlurSceneIndexPlugin::SetShutterInterval() +// and needed by _MotionBlurHelper. These are part of our shutter +// interval workaround. See comments on SetShutterInterval() at bottom of file. +static float _shutterOpen = HDPRMAN_SHUTTEROPEN_DEFAULT; +static float _shutterClose = HDPRMAN_SHUTTEROPEN_DEFAULT; + +using TfTokenSet = std::unordered_set; + +TF_REGISTRY_FUNCTION(TfType) +{ + HdSceneIndexPluginRegistry::Define(); +} + +TF_REGISTRY_FUNCTION(HdSceneIndexPlugin) +{ + // This plug-in should be inserted *after* the extComp plug-in, + // so that disabling of blur, etc. will also affect points from extComp + const HdSceneIndexPluginRegistry::InsertionPhase insertionPhase = 3; + + const HdContainerDataSourceHandle inputArgs = + HdRetainedContainerDataSource::New( + _tokens->fps, + HdRetainedSampledDataSource::New(VtValue(_fps))); + + for(const auto& pluginDisplayName : HdPrman_GetPluginDisplayNames()) { + HdSceneIndexPluginRegistry::GetInstance().RegisterSceneIndexForRenderer( + pluginDisplayName, + HdPrmanPluginTokens->motionBlur, + inputArgs, + insertionPhase, + HdSceneIndexPluginRegistry::InsertionOrderAtStart); + } +} + +namespace +{ + +// Get fps from input arguments data source +float _GetFps(const HdContainerDataSourceHandle& inputArgs) +{ + if (!inputArgs) { + return _fps; + } + + const auto source = HdSampledDataSource::Cast(inputArgs->Get(_tokens->fps)); + if (!source) { + return _fps; + } + + const VtValue &value = source->GetValue(0.0f); + if (!value.IsHolding()) { + return _fps; + } + + return value.UncheckedGet(); +} + +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + +/// \class _MotionBlurHelper +/// +/// Helper base class for motion blur. This class carries the implementations +/// for methods to retrieve motion blur parameters from the prim, to compute +/// contributing time samples, and to sample the given sampled data source. +/// This class encapsulates all the logic for transform, velocity, and +/// deformation motion blur. +/// +class _MotionBlurHelper +{ +public: + using Time = HdSampledDataSource::Time; + + /// samplesSource: the original data source + /// key: identifying name for samplesSource + /// primPath: path of sampleSource's parent prim (for diagnostics) + /// primType: type of sampleSource's parent prim + /// primvarsSource: data source for sampleSource's parent prim's primvars + /// inputArgs: data source from scene index plugin + _MotionBlurHelper( + const HdSampledDataSourceHandle& samplesSource, + const TfToken& key, + const SdfPath& primPath, + const TfToken& primType, + const HdContainerDataSourceHandle& primvarsSource, + const HdContainerDataSourceHandle& inputArgs) + : _samplesSource(samplesSource) + , _key(key) + , _primPath(primPath) + , _primType(primType) + , _primvarsSource(primvarsSource) + , _inputArgs(inputArgs) + { } + +protected: + bool + _GetContributingSampleTimesForInterval( + Time startTime, + Time endTime, + std::vector