Grasshopper

algorithmic modeling for Rhino

Hello,

Is there a way to control which of the outputs from my Python component are added to the Rhino document when baking the component?

Sometimes I find myself passing on geometry that is relevant for the next component, but not useful to get baked. In rare cases, when outputting lists or data trees, I would even want to control which portions of the output get baked (e.g. only the first branch of the tree).

Is this possible? And is this even advisable practice?

Cheers,

Max

Views: 573

Replies to This Discussion

If you right-click a parameter output and hit "bake", only this output is baked. But it sounds like you might need/are doing something different? It sounds like you could either:

A) Manage all the baking inside your Python script (similar to how Mostapha has done with several LadyBug components, you can have a look at his source code).

B) Develop a separate bake component which takes some geometry inputs, data-tree masks etc. for your particular workflow.

A) works well if you have a well defined and encapsulated set of processes in one GHPython component. B) works well in that you can decouple the baking from the other processes and make a more generic component. In either case you can write a Python function that handles the baking and try to make this as general as you can.

Grüss gott..

Godmorgon!

You know how if you bake Grasshopper's "Square Grid" it only bakes the cells and not the other input, which is the points? I can't find that particular behavior in Ladybug...

I know (from your scripts actually) how to make outputs invisible:

ghenv.Component.Params.Output[4].Hidden = True

Now I'm looking for a similar method that will control the baking...

Ah now I get it. You want to set a property on an output parameter which determines whether it gets baked when you select the component and bake? I have not come across such a property, but I'm sure there probably is one. I imagine David or Giulio would be able to answer this :)

To build on Anders' (always) great answer(s), I might suggest going with option "B" and using list/tree operation components paired with the Human bake and geometry attribute components (especially if you're trying to bake specific branches, etc.). It's a bit more straightforward than writing a bake function into your existing code ("A"), especially if what you need to bake will change.

I've always found separating operations useful in a visual programming environment, for what it's worth.

/SPM

Hear, hear..

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service