.NET ParamBlock Ints and INode custom validators

.NET ParamBlock Ints and INode custom validators

Anonymous
Not applicable
447 Views
0 Replies
Message 1 of 1

.NET ParamBlock Ints and INode custom validators

Anonymous
Not applicable

I'm working on a Max .Net modifier plugin. The info on max .net is a bit scarce. There is info on the web how to implement parameters, but all the information I can find only describes how to make a float . 

 

When I try to implement an int, using a similar autoUI flag for the block, the parameter simply does not appear. I.e. something of the like:

 

paramBlockDesc.AddParam(0,
	new object[] {
        "Degree",		       // Parameter name
	ParamType2.Int,		       // Parameter type
	ParamBlock2Flags.Animatable,   // Parameter block flags associated with parameter
	0, 			       // Resource id of parameter name (int)- should be 0,
        3,  //Default
        1, 4 //Min and max
});

 

Furthermore, I'd like to implement an INode picker button with a custom validator. Although, an INode itself works, I can't pass a validator in any way. Using the Class, sClass and CanConvert flags (i.e. to try and implement a simpler validator by class, etc) also doesn't work.

Interestingly enough, when using ParamOption to alter a simple option that was already defined, it seems to alter the default, the value doesn't get passed (i.e. the parameter then snaps to the lower value in the range). Ex:

 

paramBlockDesc.ParamOption(0, (System.Int32)ConstTypes.ParamTags.p_default, new object[] { 0.5f } );

 

I'd imagine these can't simply be passed to unmanaged code. Do parameter options need a wrapper?  

 

Any info and examples would be much appreciated as I've been stuck with this for some time now. Thanks! 

 

0 Likes
448 Views
0 Replies
Replies (0)