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.

C++ TabOutOfRangeException when calling node-> GetObjTMAfterWSM(...)

C++ TabOutOfRangeException when calling node-> GetObjTMAfterWSM(...)

Anonymous
Not applicable
912 Views
5 Replies
Message 1 of 6

C++ TabOutOfRangeException when calling node-> GetObjTMAfterWSM(...)

Anonymous
Not applicable

Hi, when I call 

 

node->GetObjTMAfterWSM(0);

 

node being of type INode*

 

wether I input 0 or a TimeValue as parameter, I get a TabOutOfRangeException. The node is not null.

 

I'm wondering if I'm missing something I should be initializing either in the global state or in the node directly.

 

Note that I also get a memory access exception when calling

 

node->EvalWorldState(0);

which I believe could be related to the same issue.

 

I am running on 3ds Max 2015

 

What could be the possible causes of error for such an issue? I have not found anything in my searches.

 

 

 

 

 

 

0 Likes
913 Views
5 Replies
Replies (5)
Message 2 of 6

istan
Advisor
Advisor

I would say you have no valid INode ptr.  You did not describe, from where you got the INode ptr.

Did you check:

http://help.autodesk.com/view/3DSMAX/2016/ENU/?guid=__files_GUID_2E4E41D4_1B52_48C8_8ABA_3D3C9910CB2...

?

 

0 Likes
Message 3 of 6

Anonymous
Not applicable

Hi, the node ptr is definetely not null. I can call node->GetNodeTM(..) instead which works, except I need the TM after WSM. The node was created beforehand using interface->CreateObjectNode(CreateNewTriObject()); 

 

Maybe the "ObjTM" is null or the "WSM" object is null, but I don't know as I cant see the code.

 

I have looked at the article and my code is similar.

0 Likes
Message 4 of 6

Anonymous
Not applicable

To give more details, the node is created using 

 

 

::Object* obj = CreateNewTriObject();
 node = m_ip->CreateObjectNode(obj);

then I set some values for that node

 

node->SetObjOffsetPos(Point3(0.0f, 0.0f, 0.0f));
node->SetObjOffsetRot(IdentQuat());
ScaleValue sv(Point3(1.0f, 1.0f, 1.0f), IdentQuat());
node->SetObjOffsetScale(sv);
node->SetNodeTM(0, matrix);

the matrix variable is a simple identity matrix in this case.

 

then I set a material to the node. Then the code shown earlier gets executed and it crashes as described.

0 Likes
Message 5 of 6

istan
Advisor
Advisor

As I am also heavily using GetObjTMAfterWSM() and EvalWorldState() and I never experienced such exceptions, I can only assume that there is something else wrong with your code. Reduce it to the minimum which is necessary in your case.

 

Here is another example:

https://knowledge.autodesk.com/search-result/caas/CloudHelp/cloudhelp/2016/ENU/Max-SDK/files/GUID-AC...

 

btw: I don't use any ObjOffset() calls, I always use just SetNodeTM().

 

 

0 Likes
Message 6 of 6

davidlanier
Autodesk
Autodesk

Hi,

 

There is possibly something wrong with the modifier stack of your object, as EvalWorldstate evaluates the stack (same for GetTMAfterWSM) and gives you the resulting object with all modifications applied.

 

Which modifiers are in your node's modifier stack ?

Can you collapse the stack ?

 

regards,



David Lanier
Principal Software Engineer
3ds Max Rendering Team
0 Likes