Notifications
Clear all

[Closed] [SDK] How to get the Mesh back in maxscript as a Variable

I have a function that creates a mesh with something like this

TriObject *triobj = CreateNewTriObject();
Mesh &mesh = triobj->GetMesh();

////
some other stuff here
/////

theMeshNode = ip->CreateObjectNode(triobj);
TSTR name(_T(“testMesh”));
ip->MakeNameUnique(name);
theMeshNode->SetName(name);

This works fine a mesh is created inside max, But i want to continue to do stuff with maxscript with this mesh, Is there any way to return it somehow into a variable so i can assign it to a variable inside maxscript like.

theNewMesh = ProcessTheMesh() – and this returns the mesh i created in c++

Guillermo

1 Reply

In case someone else is looking for the same thing. I found the solution on the file avg_DXL.cpp
Just made a few changes in the INode line

Value*
get_coordsys_node()
{
INode *coordNode = MAXScript_interface7->GetRefCoordNode();
if (coordNode == NULL)
return &undefined;
else
return_value (MAXNode::intern(coordNode));
}