Community
3ds Max Programming
Welcome to Autodesk’s 3ds Max Forums. Share your knowledge, ask questions, and explore popular 3ds Max SDK, Maxscript and Python topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

(Only Instances) areNodesInstances (Max Script) What is equal on C++ or C# ?

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
lazimdirlo
723 Views, 4 Replies

(Only Instances) areNodesInstances (Max Script) What is equal on C++ or C# ?

areNodesInstances <node1> <node2> it 's return if nodes instance true.

what is equal on c++ or c# ?

 

Especially i am looking for how can i find instances of node.?

IInstanceMgr::GetInstanceMgr()->GetInstances() -> return instance + reference 

but i want only instance.

 

Thank you.Thank you for your help . Thank you for your help

4 REPLIES 4
Message 2 of 5

what are instances? the nodes with the same Object. what are references? the nodes with the same BaseObejct (ReferenceTarget). so true insatneces when Object == Object, true reference when ReferenceTarget == ReferenceTarget && Object != Object 

Message 3 of 5

How Find references of any object using c++?

IInstanceMgr::GetInstanceMgr()->GetInstances() this function return  instance + reference together.

But i want to get only references of one object.

 

Thank you for help  denisT.MaxDoctor

 

Message 4 of 5

maybe i'm missing something, but i've answered your question above... well. i see it as:

 

INodeTab GetNodeReferences(INode *node)
{
    Object *obj = node->GetObjectRef();
    INodeTab instances;
    IInstanceMgr::GetInstanceMgr()->GetInstances(*node, instances);
    INodeTab references;

    for (int k=0; k < instances.Count(); k++)
    {
        if (obj != instances[k]->GetObjectRef()) references.AppendNode(instances[k]);
    }
    return references;
}

 

Message 5 of 5

Thank you denisT.MaxDoctor .
Thank you denisT.MaxDoctor .
Thank you denisT.MaxDoctor .

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report