Search - User list
Full Version: [Python State] Drag and Drop
Root » Technical Discussion » [Python State] Drag and Drop
alexwheezy
Hi,

I don’t understand how this example should work correctly: $HH/viewer_states/examples/state_dragdrop_demo.hip

I did everything according to the instructions, but attempts from the file manager to drag any text document into the Houdini viewport fails, the persistent error “Invalid drag drop source”.
What needs to be done to make the drag and drop work?
mabelzile
Did you try different text files ? Maybe the one you are using contains some bad characters ? You can edit the demo and remove the validation step if you need to. What version are you using ?
alexwheezy
mabelzile
Did you try different text files ? Maybe the one you are using contains some bad characters ? You can edit the demo and remove the validation step if you need to. What version are you using ?

Debian GNU/Linux 9.11 (stretch)
Houdini 18.0.355

I tried different methods of creating a text file through the terminal and using the built-in or online text editors (Nano, Sublime, Google Docs) with saving the file with the extension txt or docx or without any extension at all. In all the files that I created, I wrote only two words “Hello, World!”

If you remove the validation check for MIME type data as text/plain, I get the following error.

ERROR
Traceback (most recent call last):
  File "/opt/hfs18.0.355/houdini/python2.7libs/viewerstate/utils.py", line 1147, in wrapper
    return func(*args,**kwargs)
  File "/opt/hfs18.0.355/houdini/python2.7libs/viewerstate/interface.py", line 278, in onDragTest
    return state.onDragTest(kwargs["args"])
  File "opdef:/Object/state_dragdrop_demo?ViewerStateModule", line 48, in onDragTest
  File "/opt/hfs18.0.355/python/lib/python2.7/genericpath.py", line 37, in isfile
    st = os.stat(path)
TypeError: coercing to Unicode: need string or buffer, NoneType found
alexwheezy
I do not understand why this example does not work? I used different MIME types and files, but I still get the wrong source.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB