-
Notifications
You must be signed in to change notification settings - Fork 202
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EMSUSD-1000 - Implement new Hierarchy Cmd. #3597
base: dev
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -116,11 +116,6 @@ PXR_NS::UsdTimeCode getTime(const Ufe::Path& path); | |
MAYAUSD_CORE_PUBLIC | ||
PXR_NS::TfTokenVector getProxyShapePurposes(const Ufe::Path& path); | ||
|
||
//! Check if the src and dst attributes are connected. | ||
//! \return True, if they are connected. | ||
MAYAUSD_CORE_PUBLIC | ||
bool isConnected(const PXR_NS::UsdAttribute& srcUsdAttr, const PXR_NS::UsdAttribute& dstUsdAttr); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Moving it to |
||
|
||
//! Check if a source connection property is allowed to be removed. | ||
//! \return True, if the property can be removed. | ||
MAYAUSD_CORE_PUBLIC | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -257,6 +257,19 @@ UsdHierarchy::insertChildCmd(const Ufe::SceneItem::Ptr& child, const Ufe::SceneI | |
return UsdUndoInsertChildCommand::create(fItem, downcast(child), downcast(pos)); | ||
} | ||
|
||
Ufe::InsertChildCommand::Ptr | ||
UsdHierarchy::appendChildVerifyRestrictionsCmd(const Ufe::SceneItem::Ptr& child) | ||
{ | ||
const auto childCmd = appendChildCmd(child); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A better and cleaner solution would be to create a new cmd that inherits from |
||
|
||
if (childCmd && isConnected(downcast(child))) { | ||
throw std::runtime_error("The node you're trying to move has connections."); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should update this message according to the updated and approved UI linked in the related story |
||
} | ||
|
||
return childCmd; | ||
} | ||
|
||
|
||
Ufe::SceneItem::Ptr | ||
UsdHierarchy::insertChild(const Ufe::SceneItem::Ptr& child, const Ufe::SceneItem::Ptr& pos) | ||
{ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -304,6 +304,16 @@ bool isEditTargetLayerModifiable( | |
USDUFE_PUBLIC | ||
Ufe::BBox3d combineUfeBBox(const Ufe::BBox3d& ufeBBox1, const Ufe::BBox3d& ufeBBox2); | ||
|
||
//! Check if the src and dst attributes are connected. | ||
//! \return True, if they are connected. | ||
USDUFE_PUBLIC | ||
bool isConnected(const PXR_NS::UsdAttribute& srcUsdAttr, const PXR_NS::UsdAttribute& dstUsdAttr); | ||
|
||
//! Check if the usdItem is connected (i.e. if there are in or out connections). | ||
//! \return True, if it is connected. | ||
USDUFE_PUBLIC | ||
bool isConnected(const UsdSceneItem::Ptr& usdItem); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Moving out this function from LookdevXUsd |
||
|
||
//! Set both the start and stop wait cursor functions. | ||
USDUFE_PUBLIC | ||
void setWaitCursorFns(WaitCursorFn startFn, WaitCursorFn stopFn); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In your Ufe PR it states "Returns a null pointer if the restrictions are not observed." - but here you are throwing. It should be one of the. Either return nullptr here or in Ufe change the doc to state that it will throw runtime_error if the restrictions are not observed.