On 27/04/2016 at 09:21, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 14
Platform: Windows ;
Language(s) : C++ ;
---------
Hello all,
I've been looking into the Drag&Drop functionality for GeUserAreas and I can't get it to work. In my GeDialog I have GeUserAreas that correspond to materials in separate files. My goal is for the user to be able to start dragging a GeUserArea to the Material Manager or over an object and have it placed properly.
Having it dragged to the Material Manager works correctly, when I try doing the same over an object it only creates an empty texture tag.
I started my code based off a forum post that had the same question,
https://plugincafe.maxon.net/topic/7546/9450_dragdrop-from-geuserarea-solved&KW=HandleMouseDrag&PID=44368#44368.
In my GeUserArea's InputEvent() I have the HandleMouseDrag function
GeData data;
msg.GetParameter(DescLevel(BFM_INPUT_DEVICE), data);
if (data.GetLong() == BFM_INPUT_MOUSE)
{
msg.GetParameter(DescLevel(BFM_INPUT_CHANNEL), data);
if (data.GetLong() == BFM_INPUT_MOUSELEFT)
{
AutoAlloc<AtomArray> arr;
arr->Append(BaseMaterial::Alloc(Mmaterial););
if(HandleMouseDrag(msg, DRAGTYPE_ATOMARRAY, arr, 0) == TRUE)
{
}
return TRUE;
}
}
I also created a SceneHook plugin based off the responses to some of the forum posts. When I run the plugin my SceneHook plugin does not receive any of the messages that it seems it should be, I receive no print outs from the function running.
Bool SettingsSceneHook::Message(GeListNode* node, LONG type, void* data)
{
if(type == MSG_DESCRIPTION_CHECKDRAGANDDROP)
{
GePrint("Description Check Drag&Drop");
}
if(type == MSG_MATERIALDRAGANDDROP)
{
GePrint("Material Drag&Drop");
}
if(type == MSG_DRAGANDDROP)
{
GePrint("Drag&Drop");
}
return TRUE;
}
I've been looking into this for a couple of days now and I'm not sure where the issue is, any assistance would be greatly appreciated.
Johan