From b3d4a06f539ef4492ad47343ea35f720b7898c68 Mon Sep 17 00:00:00 2001 From: Samuel Liu <127771016+samuelliu-adsk@users.noreply.github.com> Date: Mon, 16 Sep 2024 17:07:38 -0400 Subject: [PATCH 1/2] Merge pull request #3918 from Autodesk/samuelliu-adsk/EMSUSD-986/revert_changes EMSUSD-986 - Revert edit as maya changes --- lib/mayaUsd/fileio/jobs/readJob.cpp | 26 ++++--------------- lib/mayaUsd/fileio/jobs/readJob.h | 7 +++-- lib/mayaUsd/fileio/primReaderContext.cpp | 5 ---- lib/mayaUsd/fileio/primReaderContext.h | 10 ------- lib/mayaUsd/fileio/primUpdaterManager.cpp | 9 +++---- .../translators/translatorXformable.cpp | 4 --- .../lib/usdMaya/readJobWithSceneAssembly.cpp | 7 ++--- .../lib/usdMaya/readJobWithSceneAssembly.h | 3 +-- 8 files changed, 15 insertions(+), 56 deletions(-) diff --git a/lib/mayaUsd/fileio/jobs/readJob.cpp b/lib/mayaUsd/fileio/jobs/readJob.cpp index 5c08eb3dca..7e8266938e 100644 --- a/lib/mayaUsd/fileio/jobs/readJob.cpp +++ b/lib/mayaUsd/fileio/jobs/readJob.cpp @@ -191,7 +191,7 @@ UsdMaya_ReadJob::UsdMaya_ReadJob( UsdMaya_ReadJob::~UsdMaya_ReadJob() { } -bool UsdMaya_ReadJob::Read(std::vector* addedDagPaths, const bool resetXform) +bool UsdMaya_ReadJob::Read(std::vector* addedDagPaths) { // When we are called from PrimUpdaterManager we should already have // a computation scope. If we are called from elsewhere don't show any @@ -408,9 +408,7 @@ bool UsdMaya_ReadJob::Read(std::vector* addedDagPaths, const bool rese } } - // Pass the flag resetXform to DoImport to fix the issue that when edit as Maya on prototype - // prims we have duplicated transforms - DoImport(range, usdRootPrim, resetXform); + DoImport(range, usdRootPrim); progressBar.advance(); // NOTE: (yliangsiew) Storage to later pass on to `PostImport` for import chasers. @@ -487,12 +485,9 @@ bool UsdMaya_ReadJob::Read(std::vector* addedDagPaths, const bool rese return (status == MS::kSuccess); } -bool UsdMaya_ReadJob::DoImport( - UsdPrimRange& rootRange, - const UsdPrim& usdRootPrim, - const bool resetXform) +bool UsdMaya_ReadJob::DoImport(UsdPrimRange& rootRange, const UsdPrim& usdRootPrim) { - return _DoImport(rootRange, usdRootPrim, resetXform); + return _DoImport(rootRange, usdRootPrim); } bool UsdMaya_ReadJob::OverridePrimReader( @@ -511,7 +506,6 @@ void UsdMaya_ReadJob::_DoImportPrimIt( UsdMayaPrimReaderContext& readCtx, _PrimReaderMap& primReaderMap) { - const bool resetXform = readCtx.GetForceResetXform(); const UsdPrim& prim = *primIt; // The iterator will hit each prim twice. IsPostVisit tells us if // this is the pre-visit (Read) step or post-visit (PostReadSubtree) @@ -521,9 +515,7 @@ void UsdMaya_ReadJob::_DoImportPrimIt( // specified one. auto primReaderIt = primReaderMap.find(prim.GetPath()); if (primReaderIt != primReaderMap.end()) { - const bool resetXform = readCtx.GetForceResetXform(); primReaderIt->second->PostReadSubtree(readCtx); - readCtx.SetForceResetXform(resetXform); } } else { // This is the normal Read step (pre-visit). @@ -538,7 +530,6 @@ void UsdMaya_ReadJob::_DoImportPrimIt( UsdMayaPrimReaderSharedPtr primReader = factoryFn(args); if (primReader) { TempNodeTrackerScope scope(readCtx); - readCtx.SetForceResetXform(resetXform); primReader->Read(readCtx); if (primReader->HasPostReadSubtree()) { primReaderMap[prim.GetPath()] = primReader; @@ -612,13 +603,11 @@ void UsdMaya_ReadJob::_ImportPrototype( UsdMayaPrimReaderContext& readCtx) { _PrimReaderMap primReaderMap; - const bool resetXform = readCtx.GetForceResetXform(); const UsdPrimRange range = UsdPrimRange::PreAndPostVisit(prototype); for (auto primIt = range.begin(); primIt != range.end(); ++primIt) { const UsdPrim& prim = *primIt; UsdMayaPrimReaderContext readCtx(&mNewNodeRegistry); readCtx.SetTimeSampleMultiplier(mTimeSampleMultiplier); - readCtx.SetForceResetXform(resetXform); if (prim.IsInstance()) { _DoImportInstanceIt(primIt, usdRootPrim, readCtx, primReaderMap); } else { @@ -627,10 +616,7 @@ void UsdMaya_ReadJob::_ImportPrototype( } } -bool UsdMaya_ReadJob::_DoImport( - UsdPrimRange& rootRange, - const UsdPrim& usdRootPrim, - const bool resetXform) +bool UsdMaya_ReadJob::_DoImport(UsdPrimRange& rootRange, const UsdPrim& usdRootPrim) { const bool buildInstances = mArgs.importInstances; @@ -655,7 +641,6 @@ bool UsdMaya_ReadJob::_DoImport( const UsdPrim& prim = *primIt; UsdMayaPrimReaderContext readCtx(&mNewNodeRegistry); readCtx.SetTimeSampleMultiplier(mTimeSampleMultiplier); - readCtx.SetForceResetXform(resetXform); if (buildInstances && prim.IsInstance()) { _DoImportInstanceIt(primIt, usdRootPrim, readCtx, primReaderMap); @@ -672,7 +657,6 @@ bool UsdMaya_ReadJob::_DoImport( MDGModifier deletePrototypeMod; UsdMayaPrimReaderContext readCtx(&mNewNodeRegistry); readCtx.SetTimeSampleMultiplier(mTimeSampleMultiplier); - readCtx.SetForceResetXform(resetXform); auto prototypes = usdRootPrim.GetStage()->GetPrototypes(); const int loopSize = prototypes.size(); diff --git a/lib/mayaUsd/fileio/jobs/readJob.h b/lib/mayaUsd/fileio/jobs/readJob.h index ca79a61c90..7215d01149 100644 --- a/lib/mayaUsd/fileio/jobs/readJob.h +++ b/lib/mayaUsd/fileio/jobs/readJob.h @@ -49,7 +49,7 @@ class UsdMaya_ReadJob /// Reads the USD stage specified by the job file name and prim path. /// Newly-created DAG paths are inserted into the vector \p addedDagPaths. MAYAUSD_CORE_PUBLIC - bool Read(std::vector* addedDagPaths, const bool resetXform = false); + bool Read(std::vector* addedDagPaths); /// Redoes a previous Read() operation after Undo() has been called. /// If Undo() hasn't been called, does nothing. @@ -77,8 +77,7 @@ class UsdMaya_ReadJob using _PrimReaderMap = std::unordered_map; MAYAUSD_CORE_PUBLIC - virtual bool - DoImport(UsdPrimRange& range, const UsdPrim& usdRootPrim, const bool isEdityAsMaya = false); + virtual bool DoImport(UsdPrimRange& range, const UsdPrim& usdRootPrim); // Hook for derived classes to override the prim reader. Returns true if // override was done, false otherwise. Implementation in this class @@ -94,7 +93,7 @@ class UsdMaya_ReadJob // Engine method for DoImport(). Covers the functionality of a regular // usdImport. MAYAUSD_CORE_PUBLIC - bool _DoImport(UsdPrimRange& range, const UsdPrim& usdRootPrim, const bool resetXform = false); + bool _DoImport(UsdPrimRange& range, const UsdPrim& usdRootPrim); // Hook for derived classes to perform processing before import. // Method in this class is a no-op. diff --git a/lib/mayaUsd/fileio/primReaderContext.cpp b/lib/mayaUsd/fileio/primReaderContext.cpp index 614c01cf73..3687c5324e 100644 --- a/lib/mayaUsd/fileio/primReaderContext.cpp +++ b/lib/mayaUsd/fileio/primReaderContext.cpp @@ -22,7 +22,6 @@ PXR_NAMESPACE_OPEN_SCOPE UsdMayaPrimReaderContext::UsdMayaPrimReaderContext(ObjectRegistry* pathNodeMap) : _prune(false) , _timeSampleMultiplier(1.0) - , _resetXform(false) , _pathNodeMap(pathNodeMap) { } @@ -96,8 +95,4 @@ void UsdMayaPrimReaderContext::SetTimeSampleMultiplier(double multiplier) _timeSampleMultiplier = multiplier; }; -void UsdMayaPrimReaderContext::SetForceResetXform(bool resetXform) { _resetXform = resetXform; }; - -bool UsdMayaPrimReaderContext::GetForceResetXform() const { return _resetXform; }; - PXR_NAMESPACE_CLOSE_SCOPE diff --git a/lib/mayaUsd/fileio/primReaderContext.h b/lib/mayaUsd/fileio/primReaderContext.h index ea9b149ed6..f242a5d144 100644 --- a/lib/mayaUsd/fileio/primReaderContext.h +++ b/lib/mayaUsd/fileio/primReaderContext.h @@ -94,21 +94,11 @@ class UsdMayaPrimReaderContext MAYAUSD_CORE_PUBLIC void SetTimeSampleMultiplier(double multiplier); - /// \brief Set the if we are importing as edit as Maya - MAYAUSD_CORE_PUBLIC - void SetForceResetXform(bool resetXform); - - /// \Get the if we are importing as edit as Maya - MAYAUSD_CORE_PUBLIC - bool GetForceResetXform() const; - ~UsdMayaPrimReaderContext() { } private: bool _prune; double _timeSampleMultiplier; - // Added a boolean for - bool _resetXform; // used to keep track of prims that are created. // for undo/redo diff --git a/lib/mayaUsd/fileio/primUpdaterManager.cpp b/lib/mayaUsd/fileio/primUpdaterManager.cpp index 09e930bd27..b87acb32ea 100644 --- a/lib/mayaUsd/fileio/primUpdaterManager.cpp +++ b/lib/mayaUsd/fileio/primUpdaterManager.cpp @@ -294,8 +294,7 @@ using PullImportPaths = std::vector>; PullImportPaths pullImport( const Ufe::Path& ufePulledPath, const UsdPrim& pulledPrim, - const UsdMayaPrimUpdaterContext& context, - const bool resetXform = false) + const UsdMayaPrimUpdaterContext& context) { MayaUsd::ProgressBarScope progressBar(9); @@ -333,7 +332,7 @@ PullImportPaths pullImport( std::vector addedDagPaths; // Execute the command, which can succeed but import nothing. - bool success = readJob->Read(&addedDagPaths, resetXform); + bool success = readJob->Read(&addedDagPaths); if (!success || addedDagPaths.size() == 0) { TF_WARN("Nothing to edit in the selection."); return PullImportPaths(); @@ -1285,7 +1284,7 @@ bool PrimUpdaterManager::editAsMaya(const Ufe::Path& path, const VtDictionary& u // each, for per-prim customization. // 1) Perform the import - PullImportPaths importedPaths = pullImport(path, pulledPrim, context, true); + PullImportPaths importedPaths = pullImport(path, pulledPrim, context); if (importedPaths.empty()) { return false; } @@ -1630,7 +1629,7 @@ std::vector PrimUpdaterManager::duplicate( context._pullExtras.initRecursive(Ufe::Hierarchy::createItem(srcPath)); progressBar.advance(); - PullImportPaths importedPaths = pullImport(srcPath, srcPrim, context, true); + PullImportPaths importedPaths = pullImport(srcPath, srcPrim, context); progressBar.advance(); scopeIt.end(); diff --git a/lib/mayaUsd/fileio/translators/translatorXformable.cpp b/lib/mayaUsd/fileio/translators/translatorXformable.cpp index 01eee69fac..6107b54f63 100644 --- a/lib/mayaUsd/fileio/translators/translatorXformable.cpp +++ b/lib/mayaUsd/fileio/translators/translatorXformable.cpp @@ -602,10 +602,6 @@ void UsdMayaTranslatorXformable::Read( "Unable to successfully decompose matrix at USD prim <%s>", xformSchema.GetPath().GetText()); } - if (context->GetForceResetXform()) { - // This is to solve the issue that when edit as maya on an instanced prim it moves away - resetsXformStack = true; - } } if (resetsXformStack) { diff --git a/plugin/pxr/maya/lib/usdMaya/readJobWithSceneAssembly.cpp b/plugin/pxr/maya/lib/usdMaya/readJobWithSceneAssembly.cpp index 4b33904fe6..f80c3590ab 100644 --- a/plugin/pxr/maya/lib/usdMaya/readJobWithSceneAssembly.cpp +++ b/plugin/pxr/maya/lib/usdMaya/readJobWithSceneAssembly.cpp @@ -31,13 +31,10 @@ UsdMaya_ReadJobWithSceneAssembly::UsdMaya_ReadJobWithSceneAssembly( UsdMaya_ReadJobWithSceneAssembly::~UsdMaya_ReadJobWithSceneAssembly() { } -bool UsdMaya_ReadJobWithSceneAssembly::DoImport( - UsdPrimRange& rootRange, - const UsdPrim& usdRootPrim, - const bool resetXform) +bool UsdMaya_ReadJobWithSceneAssembly::DoImport(UsdPrimRange& rootRange, const UsdPrim& usdRootPrim) { return mArgs.importWithProxyShapes ? _DoImportWithProxies(rootRange) - : _DoImport(rootRange, usdRootPrim, resetXform); + : _DoImport(rootRange, usdRootPrim); } bool UsdMaya_ReadJobWithSceneAssembly::OverridePrimReader( diff --git a/plugin/pxr/maya/lib/usdMaya/readJobWithSceneAssembly.h b/plugin/pxr/maya/lib/usdMaya/readJobWithSceneAssembly.h index 9ec1ac7f47..c7945feb93 100644 --- a/plugin/pxr/maya/lib/usdMaya/readJobWithSceneAssembly.h +++ b/plugin/pxr/maya/lib/usdMaya/readJobWithSceneAssembly.h @@ -33,8 +33,7 @@ class UsdMaya_ReadJobWithSceneAssembly : public UsdMaya_ReadJob ~UsdMaya_ReadJobWithSceneAssembly(); private: - bool DoImport(UsdPrimRange& range, const UsdPrim& usdRootPrim, const bool resetXform = false) - override; + bool DoImport(UsdPrimRange& range, const UsdPrim& usdRootPrim) override; bool OverridePrimReader( const UsdPrim& usdRootPrim, const UsdPrim& prim, From 389b648b8b54169d2f430c61e31f749c6182caba Mon Sep 17 00:00:00 2001 From: Samuel Liu Date: Wed, 16 Oct 2024 10:29:18 -0400 Subject: [PATCH 2/2] Updating changelog for v0.30.0 --- doc/CHANGELOG.md | 64 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/doc/CHANGELOG.md b/doc/CHANGELOG.md index 661d0dd8e6..fe37822887 100644 --- a/doc/CHANGELOG.md +++ b/doc/CHANGELOG.md @@ -1,4 +1,68 @@ # Changelog + +## [v0.30.0] - 2024-10-16 + +**Build:** +* Trim down the UsdUfe linking to only what is needed [#3909](https://github.com/Autodesk/maya-usd/pull/3909) +* Preparing for USD v24.08 build (with OneTBB) + * Build USD v24.08 (with oneTBB) [#3908](https://github.com/Autodesk/maya-usd/pull/3908) + * Build with USD v24.08 [#3891](https://github.com/Autodesk/maya-usd/pull/3891) +* Unit test for multi export chasers with multi job contexts [#3897](https://github.com/Autodesk/maya-usd/pull/3897) +* Updating callsites to use new NdrSdfTypeIndicator class [#3890](https://github.com/Autodesk/maya-usd/pull/3890) +* Add required includes explicitly [#3862](https://github.com/Autodesk/maya-usd/pull/3862) +* Remove unused ghc include [#3848](https://github.com/Autodesk/maya-usd/pull/3848) +* Explicitly setting legacyMaterialScope arg in tests [#3819](https://github.com/Autodesk/maya-usd/pull/3819) + +**Translation Framework:** +* Support relative references when export stages [#3900](https://github.com/Autodesk/maya-usd/pull/3900) +* USD Support for Maya Dual Quaternion skinned shapes [#3886](https://github.com/Autodesk/maya-usd/pull/3886) +* Generate material scope to be under the default prim that gets automatically determined [#3867](https://github.com/Autodesk/maya-usd/pull/3867) +* Improve curve import sanity checking [#3858](https://github.com/Autodesk/maya-usd/pull/3858) +* Fix the bug that default prim does not retain [#3849](https://github.com/Autodesk/maya-usd/pull/3849) +* Fixed accessing JobExportArgs TfToken arguments in Python [#3845](https://github.com/Autodesk/maya-usd/pull/3845) +* Save before export [#3843](https://github.com/Autodesk/maya-usd/pull/3843) +* Export stages as references [#3839](https://github.com/Autodesk/maya-usd/pull/3839) +* Export of Maya skeleton as USD comes in as a stage in the wrong place [#3820](https://github.com/Autodesk/maya-usd/pull/3820) + +**Workflow:** +* Fix copying grouped meshes [#3906](https://github.com/Autodesk/maya-usd/pull/3906) +* Save and restore non local edit target layer and anonymous layer [#3904](https://github.com/Autodesk/maya-usd/pull/3904) +* Update MaterialX node UInames [#3903](https://github.com/Autodesk/maya-usd/pull/3903) +* Merge job context arguments with user arguments [#3899](https://github.com/Autodesk/maya-usd/pull/3899) +* USD Lights: + * Add more light shapes supports in the viewport [#3896](https://github.com/Autodesk/maya-usd/pull/3896) + * Add fallback light type for unsupported lights [#3883](https://github.com/Autodesk/maya-usd/pull/3883) +* Update AE interface for Pxr Reference Assembly nodes [#3889](https://github.com/Autodesk/maya-usd/pull/3889) +* Support selection in duplicate to USD [#3884](https://github.com/Autodesk/maya-usd/pull/3884) +* Duplicate materials without meshes [#3876](https://github.com/Autodesk/maya-usd/pull/3876) +* Fix multi-layer parenting [#3874](https://github.com/Autodesk/maya-usd/pull/3874) +* Improve UI name generation [#3871](https://github.com/Autodesk/maya-usd/pull/3871) +* Don't set kind when editing as Maya [#3868](https://github.com/Autodesk/maya-usd/pull/3868) +* Fix outliner set text colour on prims [#3853](https://github.com/Autodesk/maya-usd/pull/3853) +* Support users naming node "world" + * Nothing prevents users from naming nodes "world" [#3852](https://github.com/Autodesk/maya-usd/pull/3852) + * Adapt to Maya Ufe world node change [#3842](https://github.com/Autodesk/maya-usd/pull/3842) +* Improve Maya pivot support [#3851](https://github.com/Autodesk/maya-usd/pull/3851) +* Add Reload References Command [#3844](https://github.com/Autodesk/maya-usd/pull/3844) +* Write Autodesk metadata to the session layer [#3841](https://github.com/Autodesk/maya-usd/pull/3841) +* API implementation of UFE SceneSegmentHandler getter method for the dcc root path [#3834](https://github.com/Autodesk/maya-usd/pull/3834) +* Push/pull: pushing skel data back to USD can put objects in wrong position [#3826](https://github.com/Autodesk/maya-usd/pull/3826) +* Fix display layer loss when merging/duplicating to USD [#3807](https://github.com/Autodesk/maya-usd/pull/3807) + +**Render:** +* Fix transmission issues [#3857](https://github.com/Autodesk/maya-usd/pull/3857) +* Fixing renamed parameters [#3833](https://github.com/Autodesk/maya-usd/pull/3833) +* Fix diffuse lighting with aiAreaLight [#3830](https://github.com/Autodesk/maya-usd/pull/3830) + +**Miscellaneous:** +* Fix materials options retention [#3894](https://github.com/Autodesk/maya-usd/pull/3894) +* Remove matrix multiply operator overloads that potentially lose [#3888](https://github.com/Autodesk/maya-usd/pull/3888) +* Changed tsverify to manual nullptr check [#3875](https://github.com/Autodesk/maya-usd/pull/3875) +* MayaUsdAPI - enhance with missing functions required for LookdevX [#3869](https://github.com/Autodesk/maya-usd/pull/3869) +* Default prim tooltip [#3863](https://github.com/Autodesk/maya-usd/pull/3863) +* Same-name Python edit routers [#3856](https://github.com/Autodesk/maya-usd/pull/3856) +* UsdUfe: Move Ufe::Transform3d interface implementation [#3828](https://github.com/Autodesk/maya-usd/pull/3828) + ## [v0.29.0] - 2024-07-31 **Build:**