Notifications
Clear all

[Closed] SDK GetParamBlock for Nodes

Hi, I am trying to get a the ParamBlocks for my Nodes, but there doesn’t seem to be any on the Node. Any idea of how I can get all the ParamBlock from my node? I can get it from the Object level, but then its only seems to use IParamBlock instead of IParamBlock2 Thanks

1 Reply

thats cos nodes don’t have pblocks, though the objects they reference do.

 you can use
Object* obj = node->EvalWorldState(t).obj;
 or
Object* obj = node->GetObjectRef();
 or
Object* obj = node->GetObjectRef()->FindBaseObject();
 if it has a modifier on it for example
 
 to aquire the object and get it's pblock from there

you can a pblock from any object like this

IParamBlock2* GetParamBlock(ReferenceMaker* obj)
 {
 	int nRefs = obj->NumRefs();
 	for ( int i = 0; i < nRefs; ++i ) 
 	{
 		ReferenceTarget* ref = obj->GetReference(j);
 		if( ref && ref->SuperClassID() == PARAMETER_BLOCK2_CLASS_ID ) 
 			 return dynamic_cast<IParamBlock2*>( ref );
 	}
 	return NULL;
 }