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.

Accessing reactor objects

Accessing reactor objects

Anonymous
Not applicable
377 Views
2 Replies
Message 1 of 3

Accessing reactor objects

Anonymous
Not applicable
Is it possible to access reactor from the C++ SDK? I know that MaxScript includes the definitions for the helper objects such as RBCollection, however I can't find the header files in the SDK.
0 Likes
378 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable
I'd still like to know if there's a better way, but for reference, I found that I could access the properties I'm looking for by using the GetScriptedProperty function defined in samples\utilities\applyvc\evalcol.cpp like this:

    
if (object->ClassID() == Class_ID(72697407, 2075537247))
{

FPValue objectValue = FPValue( TYPE_REFTARG, object );
FPValue rigidBodiesValue = GetScriptedProperty( objectValue, _T("rigidBodies") );

if (rigidBodiesValue.type == TYPE_INODE_TAB)
{
for (int rigidBodyIndex = 0; rigidBodyIndex < rigidBodiesValue.n_tab->Count(); ++rigidBodyIndex)
{
rigidBodies.push_back( (*rigidBodiesValue.n_tab) );
}
}

}
0 Likes
Message 3 of 3

PAMD76
Enthusiast
Enthusiast
Hi,

The reactor nodes are just helpers, I don't think the class ID's are in any header files though. You could try these:

#define REACTOR_RIGIDBODY_COLLECION Class_ID( 0x0455463f, 0x7bb62f5f )
#define REACTOR_POINT_POINT Class_ID( 0x5fcc6503, 0x41095b28 )
#define REACTOR_HINGE Class_ID( 0x754274c6, 0x4b6750eb )
#define REACTOR_CAR_WHEEL Class_ID( 0x432e082a, 0x24ef27a4 )
#define REACTOR_LINEAR_DASHPOT Class_ID( 0x0b1c724e, 0x65f11692 )
#define REACTOR_CL_COLLECTION Class_ID( 0x3b890782, 0x1d5f0bde )
#define REACTOR_RP_COLLECTION Class_ID( 0x2ef86494, 0x67cb706f )
#define REACTOR_FRACTURE_COLLECTION Class_ID( 0x17c90c46, 0x57d3024e )
#define REACTOR_PLANE Class_ID( 0x5e833f03, 0x7a0f3eb7 )
#define REACTOR_TOY_CAR Class_ID( 0x2ebe371a, 0x433e4b57 )
#define REACTOR_CSOLVER Class_ID( 0x1de12669, 0x684a07e9 )
#define REACTOR_POINT_PATH Class_ID( 0x1aa300a3, 0x02303250 )
#define REACTOR_RAGDOLL Class_ID( 0x76cc7439, 0x66cc7fb2 )
#define REACTOR_PRISMATIC Class_ID( 0x60c249c9, 0x4f505fd8 )
#define REACTOR_ANGULAR_DASHPOT Class_ID( 0x314d1bb5, 0x2a230bd9 )
#define REACTOR_DM_COLLECTION Class_ID( 0x327c63cc, 0x0c0220a2 )
#define REACTOR_SB_COLLECTION Class_ID( 0x70533aff, 0x3c1f3786 )
#define REACTOR_MOTOR Class_ID( 0x5aaf0137, 0x4d5a7cee )
#define REACTOR_SPRING Class_ID( 0x04741140, 0x55501c72 )
#define REACTOR_WIND Class_ID( 0x41c76012, 0x52ae2c52 )


Might be worth looking at "controllers/reactor/reactionMgr.h" for some other useful stuff as well.
Director / Technology Programmer.
Red Wasp Design & Plastic Ant Software
0 Likes