Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

Missing from Maya devkit MDGModifier::deleteNode(includeParents)

Missing from Maya devkit MDGModifier::deleteNode(includeParents)

negow
Advocate Advocate
1,020 Views
9 Replies
Message 1 of 10

Missing from Maya devkit MDGModifier::deleteNode(includeParents)

negow
Advocate
Advocate

Another missing member found in my now-series of missing members, this time turning our attention to MDGModifier whose documentation says..

 

> Note: If includeParents is true then empty parents of the DAG node will be included in the delete operation. Pass false to only delete this node.

 

But whose header file only contains the function without includeParents. 😞

 

// maya2020/MDGModifier.h line 114
MStatus     deleteNode( const MObject & node );

 

This does however exist in the Python API 2.0.

 

from maya.api import OpenMaya as om
om.MDGModifier().deleteNode(someNode, includeParents=False)

 

0 Likes
Accepted solutions (1)
1,021 Views
9 Replies
Replies (9)
Message 2 of 10

negow
Advocate
Advocate

Oh my, the problem runs deeper.

 

1. On Windows, `maya.api.OpenMaya.MDGModifier.deleteNode` takes an includeParents argument

2. On Linux, it does not

 

Not much that can be done, leaving this here for future explorers typing in these search terms into the forum.

0 Likes
Message 3 of 10

zewt
Collaborator
Collaborator

The includeParents override exists on the devkit on both Windows and Linux, at least in the 2022 SDK:

 

MStatus deleteNode( const MObject & node );
MStatus deleteNode( const MObject & node, bool includeParents );

Message 4 of 10

zewt
Collaborator
Collaborator

Actually, includeParents is new in 2022, so that's the only version you're talking about anyway.  Sure you're looking at the newest SDK?

 

0 Likes
Message 5 of 10

negow
Advocate
Advocate

In the link included above, you'll find it in the docs for 2020. Also here's one for 2019.

 

- https://help.autodesk.com/view/MAYAUL/2019/ENU/?guid=__cpp_ref_class_m_d_g_modifier_html

 

 

0 Likes
Message 6 of 10

zewt
Collaborator
Collaborator

It's listed in the 2022 release notes as a new entry point:

 

https://help.autodesk.com/view/MAYAUL/2022/ENU/index.html?guid=Maya_SDK_What_s_New_What_s_Changed_20...

 

It's also not in the native 2020 SDK.  In any case, it seems to be exposed everywhere in 2022.

 

0 Likes
Message 7 of 10

brentmc
Autodesk
Autodesk
Accepted solution

Hi,

 

We have started rolling out some small API improvements in update releases.

 

This new deleteNode method was added in 2020.3 so if the method is missing in the API headers it is because you have a pre-2020.3 devkit installed.

--

Brent

 

Brent McPherson
Principle Engineer
Message 8 of 10

zewt
Collaborator
Collaborator

Thanks for the clarification, I've never taken note of SDK changes between point releases.

0 Likes
Message 9 of 10

negow
Advocate
Advocate

> I've never taken note of SDK changes between point releases.

 

Indeed, that's really unfortunate, especially if not pointed out in the docs. If I had built with 2020.3, users running 2020.0-2 would have been unable to run my plug-in even though it's meant to support 2020. Hence I try and stick with the lowest possible point-release, but then suffer the fate of docs not highlighting what's new. 😞

0 Likes
Message 10 of 10

zewt
Collaborator
Collaborator

It's a bit buried (can't blame you for missing it), but it's there:

 

https://help.autodesk.com/view/MAYAUL/2020/ENU/?guid=__developer_Maya_SDK_MERGED_What_s_New_What_s_C...

 

You can also build with the oldest SDK version you're meaning to support: download the 2020 SDK rather than the 2020.4 SDK.  All of the point release SDKs are still available.