Notifications
Clear all

[Closed] SDK: Push modifier class ID, and class IDs in general?

So I’m trying to code a function that will apply a Push modifier to a specified node. I have the steps and the format for applying modifiers all sorted out, and… where the heck am I supposed to find the class ID? I’ve gone through plugapi.h and there are a bunch of class IDs laid out in there, but not all of them apparently. Any help here?

19 Replies

One way, in maxscript listener:

(Push()).classID

there is also istdplug.h

The Push modifier doesn’t seem to appear in istdplug.h either, but I was able to get it through using (Push()).classid – I’ve got the modifier applied now using the following:


Modifier *Push = (Modifier *)ip->CreateInstance(OSM_CLASS_ID, Class_ID(0x618372d, 0x67ad0adf));
GetCOREInterface12()->AddModifier(*node, *Push);

But now I seem to be stuck again… The Push modifier only has one parameter, which I thought I would be able to access with the following:

IParamBlock2* pblock= ((Animatable *)Push)->GetParamBlock(0);
pblock->SetValue(0, t, 0.0f)

but it’s giving me an unhandled exception error. The pblock doesn’t appear to be valid. What am I doing wrong?

Okay, I’m working right alongside utiltest.cpp which uses the following to access a modifier’s parameters:

	// Create a bend modifier
	Modifier *bend = (Modifier*)ip->CreateInstance(
		OSM_CLASS_ID,
		Class_ID(BENDOSM_CLASS_ID,0));

	// Set the bend angle - ParamBlock2
	IParamBlock2* iBendBlock = ((Animatable*)bend)->GetParamBlock(0);  //only one pblock2
	assert(iBendBlock);

However, when I try to replicate these steps:

	Modifier	 *Push	   = (Modifier *)ip->CreateInstance(OSM_CLASS_ID, Class_ID(0x618372d, 0x67ad0adf));
	IParamBlock2 *iPushBlock = ((Animatable *)Push)->GetParamBlock(0);
	assert(iPushBlock);

I get an assertion failed error:

Assertion failed!
Program: C:\ … etc.cpp
Line: 239 (i.e. the line for assert(iPushBlock)
Expression:iPushBlock
For information on how your program can cause an assertion failure, see the Visual C++ documentation on asserts
(Press Retry to debug the application – JIT must be enabled)

So what am I missing?

there is a problem with Push modifier…

first of all it’s not ParamBlock2 based class.

it uses old ParamBlock only. But access to this block is not implemented by developer. they implemented only get_property and set_property. It means you can’t (i can’t at least) get access to value of Push modifier from sdk. The only way i see is to use MAXWrapper::set_property

i found how to set value of Push modifier.
push modifier has only one sub anim. which is a paramblock itself. so because we know that we can do:

	Modifier* Push = (Modifier*)ip->CreateInstance(OSM_CLASS_ID, Class_ID(0x618372d, 0x67ad0adf));
	[B]IParamBlock* pBlock = (IParamBlock*)Push->SubAnim(0);[/B]
	pBlock->SetValue(0, t, value); 

Thanks for the tip! Klunk had suggested using

IParamBlock *pblock= (IParamBlock *)Push->GetReference(0);

which also works. I can’t tell if one is better than the other.

1 Reply
(@denist)
Joined: 1 year ago

Posts: 0

if Klvnk’s solution works, his is better. I’ve probably missed something because i’ve tried exactly the same but with no luck.

klvnk’s and mine ideas are both exactly about the same… we just trying to get a pointer to where PBlock starts

I wanted to check something related, but was stymied again. Is the actual code for the push modifier nowhere to be found in the samples??

Page 1 / 2