Problem with IGH_VariableParameterComponent

Hi, I am trying to get a IGH_VariableParameterComponent to work, but i am experiencing some problems, that i don’t think I can solve on my own.

Everything works fine when i am using the standard parameters, the problem starts when i am trying to use my own parameters with it

I dont have trouble Loading my parameter in a normal control, I can also use the variable parameter control with the build in parameters…
It will look fine when you set it up, and it will work. So far so good…

After saving and reopening the file the parameter will be a “Empty Generic Data parameter” and there are a bunch of errors popping up :

Parameter type is unknown
Input parameter chunk is missing. Archive is corrupt.
Output parameter chunk is missing. Archive is corrupt.

If i register my Parameter in a normal Component using the regular way to instaniate a paramter it will save and load without any problems though i think either i am missing out on something i have to do with my own parameter, or there is something wrong as everything works fine with the standard parameters

This codesnippet shows what will work and what not…

public IGH_Param CreateParameter(GH_ParameterSide side, int index) {
 IGH_Param param = default(IGH_Param);
            switch (side)
            {

// BROKEN

               case GH_ParameterSide.Input:
                    param = new MyTestParameter();
                    param.Name = "input" + index;
                    param.NickName = "input" + index;
                    Params.RegisterInputParam(param);
                    break;
//WORKING

                case GH_ParameterSide.Output:
                    param = new Grasshopper.Kernel.Parameters.Param_Integer();
                    param.Name = "output" + index;
                    param.NickName = "output" + index;
                    Params.RegisterOutputParam(param);
                    break;
            }
            return param;
        }

I included some TestComponents and a Testparameter that will demonstrate the problem…
Just add them to a canvas and add a few Paramters, save the file and reopen it…

There is one more thing though which i dont know why it is happening… if i delete a parameter in the list that is not the last parameter it will delete not one but two adjacent parameters…

Regards Klaus

MyTestParameter.zip (3.2 KB)

I’m sorry, this slipped through the cracks in my attention span. Is this still an issue you’re trying to solve?

Not the OP but I appear to be seeing this exact problem.
Deserialization fails with warnings:

Parameter type is unknown
Input|Output parameter chunk is missing. Archive is corrupt.

for each custom parameter on my component when I implement IGH_VariableParameterComponent.

The only difference is I am returning null / false for all methods in IGH_VariableParameterComponent, and adding/removing a parameter using the context menu.

1 Like