I have python panel with some presets I'm loading from file into the obj context. I then created a callback function to frame the loaded nodes in the network editor. The call back function runs but the network editor doesn't frame the selected nodes for some reason.
Here's my code:
def read_template(template_file): root = hou.node("/obj") def zoom_selected(node, event_type, **kwargs): print(kwargs) # just to check function is being called hou.ui.paneTabOfType(hou.panetabType.NetworkEditor).frameSelection() root.removeEventCallback((hou.nodeEventType.SelectionChanged, hou.nodeEventType.ChildCreated), zoom_selected) root.addEventCallback((hou.nodeEventType.SelectionChanged, hou.nodeEventType.ChildCreated), zoom_selected) root.loadItemsFromFile(template_file) return 0
Both the print and remove callback statements are called and work, though frameSelection doesn't do anything.
Appreciate any pointers!
Cheers,