tpetrick 特佩特里克 Houdini has a script hook for external drag/drop, but currently only file path data is supported.
To use the script hook add a Python script named externaldragdrop.py to the Houdini script path, for example ~/houdini16.5/scripts/externaldragdrop.py. The script should define a function called dropAccept which takes a single parameter. Every time a drop event occurs on the main Houdini application it will call the dropAccept function with a list of file path(s) that were dropped onto Houdini. The function can return True to block the drop event from continuing on to Houdini, or False to indicate that Houdini should handle the drop event itself.
An example drop handler script that ignores .hip file drops and creates Font SOPs with the contents of the incoming files:
If the data in the drag/drop event contains arbitary text or binary data instead of file paths the script hook won't be invoked. This is something that would need to be fixed on our end - I can look into fixing that if necessary.
I saw a post on the forum where SideFX staff member tpetrick wrote.
Ok using that script, I get the drag and drop but it only seems to work on the 3d viewport. You manage to get it working using the regular network editor? I think this might require more to get it working for any network editor.
Yes, the Network Editor in the main panel supports this by default. You can modify it to drag and drop files into the Network Editor and print the file paths. Now I have to press a shortcut to switch to the Network Editor in the main panel to drag and drop files, then switch back to the Supercharged Network Editor to work.
Oh ok I see where the confusion is. I was testing using another floating network editor. So it's not that it doesn't work on the overlay network editor, but that it doesn't work on floating panels, which the overlay network editor also is. So this has to be added by SideFX to work. That would be a good RFE.
tpetrick 特佩特里克 Houdini has a script hook for external drag/drop, but currently only file path data is supported.
To use the script hook add a Python script named externaldragdrop.py to the Houdini script path, for example ~/houdini16.5/scripts/externaldragdrop.py. The script should define a function called dropAccept which takes a single parameter. Every time a drop event occurs on the main Houdini application it will call the dropAccept function with a list of file path(s) that were dropped onto Houdini. The function can return True to block the drop event from continuing on to Houdini, or False to indicate that Houdini should handle the drop event itself.
An example drop handler script that ignores .hip file drops and creates Font SOPs with the contents of the incoming files:
If the data in the drag/drop event contains arbitary text or binary data instead of file paths the script hook won't be invoked. This is something that would need to be fixed on our end - I can look into fixing that if necessary.
I saw a post on the forum where SideFX staff member tpetrick wrote.
Ok using that script, I get the drag and drop but it only seems to work on the 3d viewport. You manage to get it working using the regular network editor? I think this might require more to get it working for any network editor.
Yes, the Network Editor in the main panel supports this by default. You can modify it to drag and drop files into the Network Editor and print the file paths. Now I have to press a shortcut to switch to the Network Editor in the main panel to drag and drop files, then switch back to the Supercharged Network Editor to work.
Oh ok I see where the confusion is. I was testing using another floating network editor. So it's not that it doesn't work on the overlay network editor, but that it doesn't work on floating panels, which the overlay network editor also is. So this has to be added by SideFX to work. That would be a good RFE.
Okay, I understand the issue. Thank you for your explanation. Hopefully, SideFX will update support soon.