Merge Importable files

Merge Importable files

Anonymous
Not applicable
358 Views
1 Reply
Message 1 of 2

Merge Importable files

Anonymous
Not applicable
Hi folks,
I'm currently working on an asset-manager for my own object type. It shows a list of files and the user can drag and drop them into the viewport to load them. The problem now is that I cannot merge the dropped file with the current scene. I am using the ImportFromFile function of the Interface class which always creates a new scene for the imported file. What I need is the functionality of MergeFromFile which unfortunately only works for max files. Can anybody tell me if there is an appropriate function to achieve this or how to do it manually?
Thanking you in anticipation!
SataraX
0 Likes
359 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable
OK I've found a workaround now by sending a WM_DROPFILES event to the max-window handle. If someone runs into the same problem here ist the code:
char *filename = "C:\\xyz.ext";
if (HGLOBAL hGlobal = GlobalAlloc(GHND, sizeof(DROPFILES) + strlen(filename) + 2))
{
DROPFILES * df = static_cast<DROPFILES *>(GlobalLock(hGlobal));
df->pFiles = sizeof(DROPFILES);
strcpy(reinterpret_cast<char *>(df + 1), filename);
GlobalUnlock(hGlobal);
if (!SendMessage(ip->GetMAXHWnd(), WM_DROPFILES, (WPARAM)hGlobal, 0))
GlobalFree(hGlobal);
}
0 Likes