Hi,
Is there a way to get the "active" (the one with solid line) connection of a node with python?
Surely I can query Switch parameter to find out which one is it, but isn't there any shortcut method?
get "active" connection via hou
833 2 1- tas3d
- Member
- 120 posts
- Joined: Jan. 2012
- Offline
- tamte
- Member
- 8575 posts
- Joined: July 2007
- Online
I don't think there is
but even if it was, it would probably not be easier than
the main reason why I think that is that the dashed/solid lines don't represent anything intrinsic (like active or not), it's up to a node to define some inputs as reference inputs (dashed line), but that doesn't really mean anything, just visual indication
so while for switch youmay be tempted to infer the activness from it, but you may run into issues where the lines are simply not updated properly until the node cooks, so it wouldnt be reliable to infer state of the node from unreliable visual indicator
so I'd go for parm value 100%
but even if it was, it would probably not be easier than
node.evalParm("input")
the main reason why I think that is that the dashed/solid lines don't represent anything intrinsic (like active or not), it's up to a node to define some inputs as reference inputs (dashed line), but that doesn't really mean anything, just visual indication
so while for switch youmay be tempted to infer the activness from it, but you may run into issues where the lines are simply not updated properly until the node cooks, so it wouldnt be reliable to infer state of the node from unreliable visual indicator
so I'd go for parm value 100%
Edited by tamte - Sept. 8, 2021 18:23:31
Tomas Slancik
FX Supervisor
Method Studios, NY
FX Supervisor
Method Studios, NY
- tas3d
- Member
- 120 posts
- Joined: Jan. 2012
- Offline
Got you.
I was just trying to cover edge case where I don't know the name of the parameter that is switching.
I was just trying to cover edge case where I don't know the name of the parameter that is switching.
Michal Tas Maciejewski @ www.vfxtricks.com
-
- Quick Links