I recently upgraded to Rhino 6. Something that i noticed when working with ghpython is that I’m getting some warnings refering to ‘vicarious arguments’ that I didn’t get in Rhino 5. Any clue on what do they mean/how to avoid them?
VicariousArgument-GH_180702-Question.gh (12.4 KB)
as the text mentions, this relates to the Patch function.
The Grasshopper Patch component requires these inputs:
Help on function Patch in module ghpythonlib.components:
| Patch(*args, **kwargs) |
| Create a patch surface
| curves (in, optional) [Curve] - Curves to patch
| points (in, optional) [Point] - Points to patch
| spans [Integer] - Number of spans
| flexibility [Number] - Patch flexibility (low number; less flexibility)
| trim [Boolean] - Attempt to trim the result
| Returns: [Surface] - Patch result
As you can see, this is not exactly a Python function because the first two arguments are optional, while the rest are not. This follows the Grasshopper declaration exactly.
The ‘vicarious’ warning was added in Rhino 6 when you execute a component that has non-optional parameters, but the creation default is used.
This may be a problem if the creation-default is changed in Grasshopper, because normal components will keep on working with their original default, while your scripted component will take the new default value. To prevent that, the ‘vicarious’ warning suggests to put creation-defaults as explicit values in the function.
In you case,
ghcomp.Patch(_bldgCurves, None, 20, 1, True)
for Robert McNeel & Associates