Closed scotttd closed 13 years ago
Here's a little more detail on what Scott is requesting.
As an example, say there is an input called "brep" and it is being fed a Brep geometry class from another component. A type hint of "ghdoc object" would take the Brep geometry and add it to the ghdoc data structure. Then the "brep" variable would be set to a Guid which represents the Brep in the ghdoc.
I actually believe I've suggested that first... Can I get it :)
Together with this, probably also the output should automatically convert IDs -> geometries.
I agree that IDS should be set back to geometries on the output.
I'm not so sure this is always what we want as a solution. I was thinking that at some point in time we may want to have a solution scope ghdoc that the components could choose to use instead of a local component scope ghdoc. In that case, the ids would make sense as output. Is there some sort of a "type hint" concept on outputs of components that we could use to explicitly say what we want an output to be?
Usually there's not much to pick on outputs. But maybe it's possible. I'll investigate.
Also, users might want to create IDs or parse them from text, or something else. And we would impede that. Having the option to turn this off would allow that and also increase performance.
It is not normal to have Type hints on output from Grasshopper components. It would be best if there was a marshalling layer on output from the GHPython component. Depending on the structure of the output we could change the output to make sense.
Something on this track occurred to me... during the night. It's probably not enlightening but it's worth some discussion. This behavior might be considered just another rhinoscriptsyntax mode/target. This could be called Automatic Input/Output marshalling. Geometry on all inputs will be converted to Ids, Ids on all outputs will be converted to geometry. Would that make sense?
An option on the component does make a lot more sense than just auto-"magically" converting the output. An alternative would be to provide some sort of coerce function in python for the output, but I'm not sure which method is clearer to users.
let us see how the new rhinoscriptsyntax marshaller works
In the the input Type Hint could use a GhDoc type. This would create an incoming geometry ID automatically. Steve know about this if you need more information.