Hello again,
I'm trying to add a UVW Map modifier on my object and change some of the parameters. But I don't seem to be able to get the IParamBlock(2). I'm pretty sure I need IParamBlock and not IParamBlock2 because in the C++ samples they use: "pblock = (IParamBlock*)rtarg"
I've tried the following but they all return null. NumParamBlocks even returns 0, this doesn't sound good?
var uvmapMod = (IModifier)m_CoreInterface.CreateInstance(SClass_ID.Osm, m_Global.Class_ID.Create(0xf72b1, 0));
var uvmapModContext = m_Global.ModContext.Create(m_Global.Matrix3.Create(true), null, null);
var numrefs2 = uvmapMod.NumRefs; //returns 2
for (int j = 0; j < numrefs2; j++)
{
IReferenceTarget refTarget = uvmapMod.GetReference(i); //null
if (refTarget != null && refTarget.SuperClassID == SClass_ID.ParameterBlock2)
{
IIParamBlock2 pblock = (IIParamBlock2)refTarget;
pblock.SetValue(PB_LENGTH, m_CoreInterface.Time, 50.0f, 0);
}
}
IIParamArray uvmapModParams = uvmapMod.ParamBlock;
IIParamBlock2 uvmapModpb2 = uvmapMod.GetParamBlockByID(0);
IIParamBlock2 uvmapModpb2_ = uvmapMod.GetParamBlock(0);
So none of the above work when trying it on a uvmap modifier, I've tried a bend modifier which uses paramblock2 and it works, so I'm not sure what I'm doing wrong.
var bendMod = (IModifier)m_CoreInterface.CreateInstance(SClass_ID.Osm, m_Global.Class_ID.Create(0x00010, 0));
IIParamBlock2 iBendParams2 = bendMod.GetParamBlock(0);
Any ideas?
Thanks,
Vin