Closed TugdualSarazin closed 3 years ago
Linked with COMPUTE-215
Also reported at https://discourse.mcneel.com/t/hops-from-cpython-and-lists/120959
Almost have a fix for this. If you specify list access, then the python function needs to be structured to work with a list. For the above example, the function could look something like
@hops.component(
"/lines",
name="Lines",
inputs=[
hs.HopsLine("Line", "L", access=hs.HopsParamAccess.LIST),
hs.HopsNumber("i", "i"),
],
outputs=[
hs.HopsPoint("P", "P")
]
)
def lines(lines: rhino3dm.Line, i):
points = [line.PointAt(i) for line in lines]
return points
ghhops-server 1.2.0 now on pypi : should fix this issue
Except if I didn't understand how to use it, otherwise the LIST access parameter doesn't look like to be supported.
Grasshopper script:
Flask server endpoint:
Json returned by the endpoint: