Skip to content

Conversation

@deboisj
Copy link
Collaborator

@deboisj deboisj commented Dec 2, 2025

Special handling of Save() and the overwrite prompt when dealin with Adsk USD Components.

(cherry picked from commit 96c9ee9)
(cherry picked from commit 3b7409f)
(cherry picked from commit 1f18366)
(cherry picked from commit 09c2102f4d918807e1f0d0b47eb3fe468baa7b92)
bool isAdskUsdComponent(const std::string& proxyShapePath)
{
MString defineIsComponentCmd;
defineIsComponentCmd.format(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not for now, but I think we should eventually refactor all those Python functions into a "helper" sub-module of usd_component_creator and avoid redefining and reparsing these functions all the time. (Merged with Anthon's)

Copy link
Collaborator

@pierrebai-adsk pierrebai-adsk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few minor improvements.

}
}

std::string previewSaveAdskUsdComponent(
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code moved from what Anton merged. I just changed double quotes to quotes in the inlined python

const auto result = MayaUsd::ComponentUtils::previewSaveAdskUsdComponent(
saveLocation, componentName, _proxyShapePath.c_str());

QString jsonStr = QString::fromStdString(result);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No changes starting here.

pierrebai-adsk
pierrebai-adsk previously approved these changes Dec 2, 2025
" stage = mayaUsd.ufe.getStage(\"^1s\")\n"
" if stage is None:\n"
" return \"\"\n"
" ids = MayaComponentManager.GetInstance().GetSaveInfo(stage)\n"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can this fail? if so maybe we need to add validation on the evaluation and reporting that error occured.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(answer offline) the only thing that can fail is if the CC isnt present or the path isnt a component path - but this function documents expecting a valid component path - and this is made sure of before calling into this one. So any such error would be reported from "above"

@deboisj deboisj added the ready-for-merge Development process is finished, PR is ready for merge label Dec 2, 2025
@seando-adsk seando-adsk added the shared_components Shared Components (Max / Maya) label Dec 3, 2025
@seando-adsk seando-adsk merged commit c43de2b into dev Dec 3, 2025
11 checks passed
@seando-adsk seando-adsk deleted the deboisj/comp_mgr branch December 3, 2025 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-merge Development process is finished, PR is ready for merge shared_components Shared Components (Max / Maya)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants