Make Context inputs / outputs of ImGui regions available as pins inside the region

When looking at the help patches and starting with my own patch I was pretty confused on how to noodle the Context though the widgets/regions. In HowTo Buttons for example the first and the last widget in the sequence are not connected “upstream” / “downstream” at all and their Context inputs/outputs are null.

When I created my first table I saw it had an Context input/output but seemingly no way to access them inside the region. Trying to create them as pins via node browser didn’t work. Looking at HowTo Tables I discovered that the first widget was connected via BCP but the last one wasn’t. Still the Context IO of the Table region said null.

From the chat:

I think this is too much “magic” and mixing all approaches is kind of confusing.
I’d say:

  • Either make Context inputs / outputs of ImGui regions available as pins inside the region (so they behave more in line with other regions). Make all help patches use these pins (don’t use the BCPs for that).
  • Or get rid of (hide) the inputs/outputs on the regions and use the BCPs. Make all help patches use them, even though it’s not strictly necessary.
2 Likes

I think it depends a lot on habit. I have patched ImGui a lot. Both give you the ability to tell what will go after what, otherwise widgets are sorted almost randomly (based on id, I guess). It may have caused me confusion, but not for long, because this design helps circumvent a huge number of problems that arise when creating widget sequences. I would conclude that the Context pin is a way to set the consistency. I can’t say for sure if it’s appropriate for everyone.

What would be great really?
To finally be able to create named outputs (and maybe even inputs) in such regions and have them become outputs (inputs) from the region, not BCPs — cleaner handling of mutable types that may enter such regions. But here again it’s a question about general design, not a specific case.