-
Notifications
You must be signed in to change notification settings - Fork 201
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
EMSUSD-671 Remove the load payloads proxy shape attribute
Instead, we will always use the existing payload rules dynamic attribute. - Remove the "loadPayloads" attribute from the proxy shape. - Add Python binding to new functions to set and retrieve if all payloads are loaded or not. - Split-up existing load-rules helper functions to give more fined-grained access to the saved load rules in order to support the Python API. - Use the new Python helper functions when creating or loading a stage. - Adjust one unit test.
- Loading branch information
1 parent
8f08eb0
commit 90f788c
Showing
12 changed files
with
148 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
// | ||
// Copyright 2023 Autodesk | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
#include <mayaUsd/utils/loadRules.h> | ||
#include <mayaUsd/utils/util.h> | ||
|
||
#include <pxr/base/tf/pyResultConversions.h> | ||
|
||
#include <boost/python/def.hpp> | ||
|
||
using namespace boost::python; | ||
|
||
namespace { | ||
|
||
bool setLoadRules(const std::string& shapeName, bool loadAllPayloads) | ||
{ | ||
MObject shapeObj; | ||
UsdMayaUtil::GetMObjectByName(shapeName, shapeObj); | ||
return MayaUsd::setLoadRulesAttribute(shapeObj, loadAllPayloads); | ||
} | ||
|
||
bool isLoadingAll(const std::string& shapeName) | ||
{ | ||
MObject shapeObj; | ||
UsdMayaUtil::GetMObjectByName(shapeName, shapeObj); | ||
|
||
PXR_NS::UsdStageLoadRules rules; | ||
MStatus status = MayaUsd::getLoadRulesFromAttribute(shapeObj, rules); | ||
|
||
// Note: when there are no load rules set, we load all payloads. | ||
if (!status) | ||
return true; | ||
|
||
return rules.IsLoadedWithAllDescendants(PXR_NS::SdfPath("/")); | ||
} | ||
|
||
} // namespace | ||
|
||
void wrapLoadRules() | ||
{ | ||
def("setLoadRulesAttribute", setLoadRules); | ||
def("isLoadingAllPaylaods", isLoadingAll); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters