I just wondered if its possible to set Hops inputs as optional so that the component runs without every input set.
I also noticed there is no option to turn off parallel computing when inputs are trees.
Did I miss something?
It is possible in theory - but buggy at the moment. It works with Number and Integer parameters but I can’t get it to work with Vector inputs etc.
Should you want to try it yourself, you can pass
optional=True as an argument when creating the param.
hs.HopsNumber("Values", "V", "Optional values", hs.HopsParamAccess.LIST, optional=True)
@stevebaer maybe you could take a look at this. It would be really nice to have optional inputs working for all param types.
alright I see.
I worked around this for now by passing in a serialized json containing all inputs
Are you having Hops call a separate grasshopper definition or is it calling a ghhops-server python script?
it’s calling a grasshopper definition
Parallel computing is always on for hops components. You don’t get an option to turn this on/off as it really should not be disabled with hops.
I see that Hops is currently not working with geometry as default parameters and will see what can be done to make this work. Other data like points, numbers, integers, and strings should work. If you feed data into the “Get” components, that data should be used as the defaults when called from Hops.
I added this to the issue tracker for Hops at
I am running into the same issue here. And at least for me, just by making the input “optional”, it would solve the problem.
I mean, when setting up the “At Most” field of the “Get Geometry” equal to 0, that would make that input optional. Because that doesn’t work in the moment either.
Does it make sense?
That makes sense. We may be able to inspect the “At Least” property and if it is set to zero inform the system that the input is optional.