Rafael Santos
rafaels
About Me
I'm an FX TD from, living and working in Toronto, Canada.
EXPERTISE
Technical Director
INDUSTRY
Film/TV
Connect
LOCATION
Canada
WEBSITE
Houdini Skills
Availability
Not Specified
My Gallery
Recent Forum Posts
Frame Selection after loading items from file March 7, 2024, 8:41 a.m.
Problem solved with a timer that offsets the home to selection by a few milliseconds... feels a bit dirty, but it works!
Python event for node selection / flag toggle? March 6, 2024, 8:43 a.m.
Yeah, I was doing something similar, you just have to make sure you use the most appropriate event handler:
def your_function(node, event_type, **kwargs): print(kwargs) # just to check function is being called hou.ui.displayMessage(f"Node {node.name()} has been changed.") your_node.addEventCallback((hou.nodeEventType.AppearanceChanged, hou.nodeEventType.FlagChanged), your_function)
Frame Selection after loading items from file March 5, 2024, 9:36 a.m.
Hi,
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:
Both the print and remove callback statements are called and work, though frameSelection doesn't do anything.
Appreciate any pointers!
Cheers,
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,