Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.
Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).
Hey there,
I'm currently working on a treeview where I want to act on c4d files that are dragged into the treeview.
Everything works expected using AcceptDragObject but I'm not quite sure I can stop C4D from opening the c4d file itself. I can of course close the document right away, but with bigger files the loading process can take a while and I just want to have the path to that file essentially.
AcceptDragObject
def AcceptDragObject(self, root, userdata, obj, dragtype, dragobject): if dragtype == c4d.DRAGTYPE_FILENAME_SCENE: #get me the path without ever opening the file...
Hope it makes sense, and there might be a way to prevent this from happening.
Thanks, Lasse
There ist. Simply return NOTOK to prevent C4Ds default behavior.
NOTOK
Hi @lasselauch I think this reply TreeView: c4d.DRAGTYPE_FILES answers your questions.
Cheers, Maxime
Hi @m_adam, thanks for the link! While this is an interesting discussion, I think I mainly want to know if there is a way to prevent C4D from opening the dragged .c4d file?
.c4d
This wasn't really discussed in that thread and I'm not really sure if there's anything we can do about it...
Any ideas? Much appreciated.
@mp5gosu Whooop! Thanks, Robert!
You have to return a tuple so return (c4d.NOTOK, False) does the trick for me.
return (c4d.NOTOK, False)
Thank you!!!
Cheers, Lasse