thank you for the response.
I'm aware of how
AcceptDragObject works and probably should have given a bit more detail. (Was a bit late yesterday, hence the short post)
The current code looks like this:
root is actually a simple list that holds objects of type
class ListItem looks like this (stripped down version):
def __init__(self, filename):
self.__filename = filename
def __eq__(self, other):
return self.__filename == other
The part in TreeViewFunctions:
def AcceptDragObject(self, root, userdata, obj, dragtype, dragobject):
if dragtype == c4d.DRAGTYPE_FILENAME_OTHER or dragtype == c4d.DRAGTYPE_FILENAME_SCENE:
filename = path.abspath(path.realpath(dragobject))
if filename not in root:
return c4d.INSERT_AFTER | c4d.INSERT_BEFORE, False
return c4d.NOTOK, False
As stated in the initial post, it does work like intended but for "foreign" files (Windows, let it be .exe, .dll, . json, .txt, et al) it seems like Cinema analyzes the data chunk of the first bytes of the file contents to distinguish file types (scenes, images and so on). (this is just a assumption)
So much for the background info.
As for the initial question:
In my example
dragtype is set to
c4d.DRAGTYPE_FILENAME_OTHER since I want to be able to react to certain filetypes and folders.
The docs however do have the flag
DRAGTYPE_FILES which - I hoped - would speedup the process by not checking the data chunks. But no luck, it seems like the flag does nothing or works only on different OS.
My question may be a bit misleading - I was hoping for a performance gain since it has to work with thousands of files. ;)