I am having trouble understanding how I am supposed to handle inputs/outputs for the Python 3 component in Rhino 8. It’s different to Rhino 7 where Python lists automatically become Grasshopper lists.
Searching around I found that there is a hidden Avoid Marshalling Outputs option (link) although I’m not sure how to also have the python component simultaneously output Grasshopper lists of objects (there are multiple outputs and usually I would be outputting both geometry and Python data).
At the moment I see two suboptimal solutions:
Not marshal the outputs but have an additional component to marshal any outputs desired.
Wrap the python objects intended to be inputted into other python components in a custom class.
I am trying to have the same functionality as is provided in Rhino 7, the wrapping method I mentioned and include in the example file seems to be the closest but I’d rather not need a class for this.
Oh sorry - I’m not able to check at the moment. Do you see it on the inputs?
I remember passing dictionaries between Python components, without Grasshopper converting them into a .Net implementation, by returning them inside a list, instead of just as they are.
The second example in my screenshot is basically that, I set the D output in Python to a list of dictionaries. No matter how much I wrap them, all the elements seem to be converted to something other than Python objects, preventing the second python script from reading it directly.
The list wrapping trick does indeed not seem to work with the new CPython editor, however the Grasshopper ObjectWrapper does appears to still do the trick:
@YCoCg Got this issue resolved and put a fix in the next 8.13 SRC (I decided to push this out earlier so you don’t have to manually wrap the outputs in GH_ObjectWrapper.
Also created a unit test to make sure this list_with_dictionaries case is always tested