Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] can't disconnect from node if input is disabled #2611

Closed
Zode opened this issue May 17, 2024 · 8 comments · Fixed by #2649
Closed

[bug] can't disconnect from node if input is disabled #2611

Zode opened this issue May 17, 2024 · 8 comments · Fixed by #2649
Labels
bug Something isn't working editor visject Visject surface used by materials, particles, visual scripts and more
Milestone

Comments

@Zode
Copy link
Contributor

Zode commented May 17, 2024

2024-05-16.12-32-13.mp4

Issue description:
Can't disconnect from a node input if the input disables itself, expected behavior would be to allow to disconnect (and possibly connect) no matter what state the input is in. This may also affect output side of things also.

Steps to reproduce:
Connect to an input, and then swap material type so that the input becomes disabled.

Flax version:
1.8.6511.1

@mafiesto4 mafiesto4 added bug Something isn't working editor visject Visject surface used by materials, particles, visual scripts and more labels May 17, 2024
@mafiesto4 mafiesto4 added this to the 1.9 milestone May 17, 2024
@Chikinsupu
Copy link
Contributor

@mafiesto4 i could fix this - should be pretty straight forward. But for that i need to know the expected behaviour.

A) Should the ports on the material nodes all be interactable no matter what? So that even when a port is disabled you can disconnect from the port by dragging.
Alternatively: Only allow disconnecting on disabled ports, but not connecting.

or

B) Should the connection automatically disconnect when the port gets disabled

Btw. I just realized you can also right click on a disabled box and click on "remove all connection to that box". When this is intended behaviour then i assume A should be the fix.

@mafiesto4
Copy link
Member

@Chikinsupu I think a right-click menu with an option to remove connections to that box + middle-mouse-click to remove that connection should be enough for this case.

@Chikinsupu
Copy link
Contributor

@Chikinsupu I think a right-click menu with an option to remove connections to that box + middle-mouse-click to remove that connection should be enough for this case.

then this issue can be closed, no? Since you can right click already, i haven't tested middle mouse button. Will check that later

@Zode
Copy link
Contributor Author

Zode commented May 24, 2024

@Chikinsupu I think a right-click menu with an option to remove connections to that box + middle-mouse-click to remove that connection should be enough for this case.

I think this is horrible UX, and would throw off anyone coming from any other node graph based software like substance or even unity. Why not have the option to be able to rewire the connection while its connected to a disabled input/output?

@mafiesto4
Copy link
Member

Then it would be good to add reconnecting ability for disabled connections too.

@Chikinsupu
Copy link
Contributor

Okay, so i have done a bit of research of how some other engines and programs handle this.
One thing flax does different to a lot of other tools is, that it just disables ports that don't contribute to the material where as other engines and tools straight up remove the ports.

In Blender the port gets removed and the connection gets deleted. But when the port appears again it instantly reconnects.
EXBlender

In Amplify the port gets removed and the connection gets deleted and it stays that way
EXAmplify

In Unity itself its a bit special. Unity also removes its ports, except when they had a connection, then they get disabled like in flax.
But Unity actually lets you freely interact with disabled ports. I can change the connections and even just delete them as i wish.
EXUnity

In Godot there aren't any disabled ports whatsoever, so nothing there.
And i don't have things like unreal or substance installed rn, so no insights there.

@mafiesto4 : So when i understand correctly, from your previous comments then we want a similar behaviour to blender (minus removing the port), is that correct? I mean in order to accomplish that we can simple just not render the connection to disabled ports.

UX wise i am actually a fan of Unitys approach, where you are just free to do whatever you want, it's not like it's gonna break anything.

Can i get your input to this one last time and then i will look into this issue and create a PR

@mafiesto4
Copy link
Member

Thanks @Chikinsupu for the research! Well, hiding unused material ports like Blender seams nice (we would need to skip drawing connections to invisible boxes) but Unity's solution is also fine (we could make a custom property that greys out the box but allows to interact with it a little bit).

If anyone has a strong opinion about this I'm open to hear but it looks like you can impl PR with Unity's approach.

@Chikinsupu
Copy link
Contributor

Yeah, for now i just did it the unity way without hiding the port in #2649
I might build upon this in the future and make ports appear/disappear when they are no longer in use, like the blender example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working editor visject Visject surface used by materials, particles, visual scripts and more
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants