When I called GetMtl() in the statement above,
pkMtl became NULL.
pNode should point to an instance of some class derived from INode, that
implements the GetMtl() method (which is declared as pure virtual in
INode).
What really confused me was the following code block originated from
www.geometricaltools.com
[code]
Wm3::Spatial* WSceneBuilder::BuildMesh (INode* pkMaxNode,
Wm3::Spatial* pkWm3Node)
{
// Convert a Max trimesh to one or more equivalent Magic trimeshes.
//
// pkMaxNode:
// Mesh node in the Max hierarchy.
// pkWm3Node:
// Parent node in Magic scene to which newly created.
// Returns pointer to new child node in the Magic scene. This will
point
// directly to a trimesh object, if there is only one Magic mesh, or to
// a "link" node, whose children are the mulitple trimeshes needed to
// represent the Max mesh.
bool bNeedDel = false;
TriObject* pkTriObj = GetTriObject(pkMaxNode,&bNeedDel);
if ( !pkTriObj )
return NULL;
Mesh* pkMaxMesh = &pkTriObj->GetMesh();
Mtl* pkMtl = pkMaxNode->GetMtl();
assert( pkMtl );
int iMtlID = m_kMtlList.GetID(pkMtl);
assert( iMtlID >= 0 );
[/code]
[snip]
The line
Mtl* pkMtl = pkMaxNode->GetMrl();
returns NULL and assigned to pkMtl.
I left this code snippet intact after applying the application (plugin)
wizard which came with the package.
So it assume the original source was correct...
Finally it came up with 0x00000000 on that line. And I couldn't get out of
it.
in this code. I see
I assume this is a typo.
has previously been placed in the object pointed to by pMaxNode. Clearly the
author of this method expected pkMt1 to be non-NULL. If you are seeing NULL, I
correctly.
(must) be pointing to an instance of a concrete class derived from Mt1.