imgui-node-editor icon indicating copy to clipboard operation
imgui-node-editor copied to clipboard

Disabled pin

Open SadE54 opened this issue 2 years ago • 3 comments

Hi,

Is there a simple way to have a temporary disabled pin ? I mean a pin without any link dropping capability ? I guess I could refuse the link creation by code , but maybe there's a cleaner way playing with internal state of the pin ?

SadE54 avatar Sep 25 '21 20:09 SadE54

Hi,

No, currently there is no dedicated code for that. Node editor does not track pin state and the intention was to for code built on top of node editor to track that.

There is an option to utilize BeginDisabled, recently introduced to ImGui to help with that. In the end this may prevent QueryNewLink from returning such pin.

Is this what you're looking for?

thedmd avatar Nov 18 '21 08:11 thedmd

I saw that possibility in Imgui , I guess it should do the job 👌

SadE54 avatar Nov 18 '21 09:11 SadE54

Maybe this will do without changing anything in node editor for now. Of course this will be visual only and QueryNewLink will still return such pins. On the other hand this give you an opportunity to display tooltip 'This pin is disabled because...'.

thedmd avatar Nov 18 '21 09:11 thedmd