[Closed] Get pblock from mod object SDK
So, I think get data and setting data from the base objects pblock is done here in the modifier code… It calls this automatically
void Cam_Rig::ModifyObject(TimeValue t, ModContext &mc, ObjectState * os, INode *node)
so since I’m working with the new physical Camera I want to get some data and change some.
to get targeted I’m using this. But I don’t know where to find its (ParamID id) for “targeted”
IParamBlock2* pblock_Target;
bool IsTargeted;
pblock_Target->GetValue(--?--, t, IsTargeted, FOREVER);
any thoughts?
Is this the proper way to get pblocks from the base object of my modifier?
void Cam_Rig::ModifyObject(TimeValue t, ModContext &mc, ObjectState * os, INode *node) {
IParamBlock2* pblock_Target;
ParamID Film_Width_ID;
Film_Width_ID = pblock_Target->IndextoID(6);
float Film_Width = 24;
pblock_Target->SetValue(Film_Width_ID, t, Film_Width);
}
not crashing but throwing debug messages saying…
pblock_Target is being used but not initialized
am I using this right?
i’m a little confused. if it’s your modifier you have to define its param block with all parameters and their descriptions including ParamID
Sorry Denis, I was not making myself clear. This is for a Camera Modifier.
I need to get access the the pblocks of my base object (IPhysicalCamera) that my modifier is on.
3 things I not sure of.
[ol]
[li]There looks to be no BOOL option in SetValue() or SetValue() how do I set this?[/li][li]Am I calling this in the right place? ModifyObject() or is there a better place in the modifier to access my base object?[/li][li]Am I using the above code right? It compiles fine but gives me a debug message “pblock_Target is being used but not initialized”[/li][/ol]
Any info would be great.
Hi, Si. Did you manage to solve it?
How do we set checkbox bool values in ParamBlock2?
http://forums.cgsociety.org/showthread.php?p=8389960#