Changing arguments in the MyComponent class - SDK mode

Hi all,

I’m trying to migrate my plugin from Rhino 7 > 8.

Previously (with the Rhino7 ghPython component, SDK mode) you could specify *args within the MyComponent class. The new Python2/3 component doesn’t allow you to do this (see screenshot). In addition to this, now whenever you change the RunScript arguments, it dynamically updates the component input nodes, based on the name of the args provided. This means that the component input names can’t include special characters like * OR >. When you try add a “name for humans” it doesn’t change the input name, only the hover-over name.

I was wondering if these changes were intentional, or a bug?

1 Like

Related to this problem, you cant specify a default value for the MyComponent class.

Thanks for the suggestion Mahdiyar :smile: . While there are workarounds to temporarily solve some of the issues caused by this behaviour (such as hard coding input values manually), it becomes much more difficult when trying to release the script as a compiled plugin.

1 Like

@fabian.prideaux I actually did not know you could do that :sweat_smile: but either way decided to be a bit more strict on the RunScript signature as it now works backwards also and updates the component inputs (or outputs in C#) from the signature (for example RunScript(x: int, y: float) creates parameters on the component with the correct type hint applied)