Rafael Santos
rafaels
About Me
I'm an FX TD from, living and working in Toronto, Canada.
専門知識
Technical Director
業界:
Film/TV
Connect
LOCATION
Canada
ウェブサイト
Houdini Skills
Availability
Not Specified
My Gallery
Recent Forum Posts
Frame Selection after loading items from file 2024年3月7日8:41
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? 2024年3月6日8:43
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 2024年3月5日9:36
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,