Python 3 components in SDK mode don't output Grasshopper lists

Tested in Rhino 8.6 on Windows 11. I couldn’t log into the jetbrains youtrack page to make a bug report there.

From a Python3 component in SDK mode, the code:

#! python3

import System
import Rhino
import Grasshopper

import rhinoscriptsyntax as rs


class MyComponent(Grasshopper.Kernel.GH_ScriptInstance):
    def RunScript(self, x, y):
        a = list(range(3))
        return a

produces a PyObject:
image
The same component in script mode (as when placed) containing:

#! python3

a = list(range(3))

(and Iron Python 2 components in either mode) produces what I would expect:

image
compare_lists_Rhino_8.gh (24.2 KB)

1 Like

Great catch! Thanks for reporting this! I’ll get it fixed right away:

RH-81136 Script.Instance RunScript output needs to be marshalled

2 Likes