selecting a node using python

   9344   2   0
User Avatar
Member
27 posts
Joined: Nov. 2008
Offline
hi,

I'm trying to write python code to select a node to mimic the same behavior as user selecting interactively.

I tried all following code
node.cook(force=True)
node.setCurrent(True, clear_all_selected=True)
node.setSelected(True, clear_all_selected=True)

the behavior of these code seems to be different from when user selects the node.

when user selects a node interactively, it changes the parameter panels to show the parameters of the selected node.

it seems that when i select a node programmatically, it selects the node in the node window but doesn't change the parameter panel to show the selected node's parameters.

do you know if it's possible to write code mimics exactly the same behavior as user selecting a node please?

thanks,
User Avatar
Member
8599 posts
Joined: July 2007
Offline
both, setCurrent() or setSelected() work for me
they select the node and Parameter Pane is updated if it's following selection (Not Pinned) which is usually default pane setup or if it's linked with the network editor
in other words it seems to reflect manual selection behaviour
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
27 posts
Joined: Nov. 2008
Offline
thank you for your reply.

it's very interesting. It seems that when parameter panel is set to “last selected node” mode, setCurrent works and parameter panel changes to the current node but when I changed the parameter panel to the number then parameter panel doesn't update.

which makes sense when I think about it.

thanks again for your help.
  • Quick Links