Detecting if Base COMP's input is wired

How do I tell if one of my Base COMP’s five inputs has an input connection? I have 5 DAT_In’s inside my Base COMP, I want to figure out if anything is wired into the first input. I’ve checked OP.inputs, but that’s a list of inputs, not what’s wired where. And OP.inputConnectors gives me back my DAT Ins. Also checked the InDAT class, but nothing seemingly of interest there. Thanks!

1 Like

So I think you actually want to be looking at the parent’s inputConnectors attribute, since creating an inDAT actually endows your base with inputs. So if you use:

len(myBase.inputConnectors[0].connections) > 0

you will know if you have something connected on the first input. It would also be important to make each of your inDATs have unique connect order parameters instead of the default of 0 so you can control the exact order in the inputConnectors list you get back.

Cool, that seems to work. I was looking at inputConnectors and inputConnectors[0], but didn’t think to dig down deeper to find inputConnectors[0].connections. Thanks!