Grasshopper

algorithmic modeling for Rhino

Hi all,
I'm trying to define a custom GH object without input parameters
but that should respond to a double click showing a Form.
The user then can set some values in the form and confirm.
The Form should then close and set the ouput parameter of
the GH object.
Following David's suggestion, I tried to learn how to do that
from the CurvePoint object, deriving the object from GH_Param,
but I still dont' understand a lot of things ...
I _guess_ to have understood that, once the output value has been
defined, I have to call ExpireSolution(), and that the output value has
to be built into CollectVolatileData_FromSources(), defining the
m_data field.
Now I have a test object that somehow works, that is,
I can double-click on it, see the Form, set a value
and have the value output from the object.
But I still have a lot of questions ...
Here is the first one:

My object only works if I link a number value in input.
Otherwise I get a warning message saying that the
floating parameter failed to collect data.
I need no input data, what have I to do to set up
the GH_Param object to work without input data ?

Thanks for any help.
Emilio




Views: 1789

Attachments:

Replies to This Discussion

Hi Emilio,

the Attribute class you wrote to handle the double-click functionality has a property you can override to disable input or output grips. I'm not at my own laptop right now, but I think it's called HasInputGrip. Just override and return False.

Unless your object has wires going into it, CollectVolatileData_FromSources() won't be called. You need to handle this otherwise. Unfortunately I don't remember how you're supposed to handle it differently. I'll try and come up with something on monday.

--
David Rutten
david@mcneel.com
Turku, Finland
OK, thank you, David !

Emilio
Good !
Overriding HasInputGrip and using
CollectVolatileData_Custom() made it work !

Thanks again !

I'm sure I'll be back with more questions as
soon as I'll try to develop the plug-in further. ;)

Emilio

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service