isValidNode (C#)

isValidNode (C#)

MehdiZangenehBar
Advocate Advocate
1,792 Views
5 Replies
Message 1 of 6

isValidNode (C#)

MehdiZangenehBar
Advocate
Advocate

What is the equivalent function of "isValidNode" in the C# (Autodesk.max.dll)?

0 Likes
Accepted solutions (1)
1,793 Views
5 Replies
Replies (5)
Message 2 of 6

denisT.MaxDoctor
Advisor
Advisor

a node with not deleted reference object

0 Likes
Message 3 of 6

MehdiZangenehBar
Advocate
Advocate

So any function to check that?

0 Likes
Message 4 of 6

denisT.MaxDoctor
Advisor
Advisor
Accepted solution

@MehdiZangenehBar wrote:

So any function to check that?


 

 

(node && node->NumRefs() && node->GetReference(0) && !node->IsDeleted(node->GetReference(0)))

 

 

 

But... it depends on what you mean by "valid". A deleted node is still valid to the system, for example. It might be contained in "undo" records and continues to retain the anim handle.
This is why I never use MXS's isValidNode method alone, without isDeleted

Message 5 of 6

MehdiZangenehBar
Advocate
Advocate

I can't find node->IsDeleted in the C# library.

0 Likes
Message 6 of 6

denisT.MaxDoctor
Advisor
Advisor

It’s derived from (Animatable*) … or from (ReferenceTarget*)