C# Plugin Question

C# Plugin Question

tpeterson.fsi
Explorer Explorer
654 Views
2 Replies
Message 1 of 3

C# Plugin Question

tpeterson.fsi
Explorer
Explorer

Hi,

 

  I am trying to create a helper object and then turn off one of the built in parameters.  in this case, I'm creating a point helper and want to turn off the Cross option the point helper.  In the following code, everything works, except for the ps.SetValue line.  At this line, 3ds max crashes and I am not sure what i am doing wrong.  I think it has something to do with this being a helper object versus geometry, but am not sure (I am still somewhat new to the 3ds max sdk)

 

IClass_ID my_helper = global.Class_ID.Create((uint)BuiltInClassIDA.POINTHELP_CLASS_ID,0);
object dof_obj = coreInterface.CreateInstance(SClass_ID.Helper, my_helper);
IINode dof_node = coreInterface.CreateObjectNode((IObject)dof_obj);
dof_node.Name = "Test_Node";
IObject tobj = (IObject)dof_obj;
IIParamArray ps = tobj.ParamBlock;
ps.SetValue(3, global.COREInterface.Time, 1);

 

Any suggestions on what I am doing wrong?

 

Thanks

 

Todd

0 Likes
655 Views
2 Replies
Replies (2)
Message 2 of 3

tpeterson.fsi
Explorer
Explorer

Update for anyone interested.  If found a solution that works for me.  I had to use IIParamBlock2 instead of IIParamArray.

 

IClass_ID my_helper = global.Class_ID.Create((uint)BuiltInClassIDA.POINTHELP_CLASS_ID,0);
object dof_obj = coreInterface.CreateInstance(SClass_ID.Helper, my_helper);
IINode dof_node = coreInterface.CreateObjectNode((IObject)dof_obj);
dof_node.Name = "Test_Node";
IObject tobj = (IObject)dof_obj;
IIParamBlock2 ps = tobj.GetParamBlock(0);
ps.SetValue(3, global.COREInterface.Time, 0,0);

 

Todd

0 Likes
Message 3 of 3

omidt_gh
Enthusiast
Enthusiast

i want to create a simple shape and add it to light objects panel, then i can grab some information from it to use it in another plugin.

my question is how can i create a light shabe in 3dsmax sdk as simple as possible, with just 2 options, color ans intensity ?

0 Likes