Grasshopper

algorithmic modeling for Rhino

is there a way when making custom components to get which input triggered the update. for instance i have a component which has 3 inputs A, B, and C. something changes upstream on B and causes the component to recalc. can i look for that event

if not perhaps you can add it to the IGH_DataAccess class like you have added all the other util_ stuff for example....

IGH_DataAccess iData.Util_GetInputChangeList() which will return a int of the index number of the input that triggered the update.

Views: 533

Replies to This Discussion

Hi Robert,

 

it's not necessarily just a single input which causes an expiration. May I ask why you want this information?

 

--

David Rutten

david@mcneel.com

London, UK

ps. There is an event associated with expires, but it is always raised on the top-level object so it won't help you much. Basically, whenever an input parameter is expired because it is connected to another parameter that expired, it will raise the SolutionExpired() event on the component that owns it.

 

--

David Rutten

david@mcneel.com

London, UK

In some of my components there is a lot of heavy lifting done on the inputs, locust for example has the 'behavior'  input and a bunch or other inputs. the behaviors have a lot of code that need to check a lot of things. so if i know which input or inputs triggered an update then i can only have to reprocess that information and not all the inputs. for example, on locust,  if you change the maxSpeed input and i know that is what changed and triggered an update then i can bypass all the code that deals with the other inputs because i know there was no change. which would speed up things greatly. 

 

i have a feeling that this would help out a lot of other who write components as well. 

 

its odd that it would not be a single input, if two things changed, it causes two expiration's even if they happen at the same time. but even a list of int's that represent what inputs triggered the change would be good.  

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service