On 12/08/2016 at 03:53, xxxxxxxx wrote:
User Information:
Cinema 4D Version: R17
Platform: Windows ;
Language(s) : C++ ;
---------
Hello.
I need to drag and drop inside C4D some files and create materials based on them.
I have a SceneLoaderData plugin and I use the Load call to add the materials.
One problem comes when I try to drag and drop multiple files. Even though the Load runs once for each droppped file, the parameter BaseDocument is not the same. Also, it looks like the dropped files are considered whole documents.
The code works correctly if only 1 external file is dropped inside C4D.
I create an empty BaseMaterial with BaseMaterial::Alloc(MY_MATERIAL_PLUGIN) and after filling its parameters, I insert it in the BaseDocument that's given as parameter.
What can I do to consider the dropped files materials and add all of them in the Active Document.
Is it safe to use GetActiveDocument ?
Thank you very much for your time.