P3D not allowing to drag and drop files into window

Hello,
I’m trying to load and display files via drag and drop into the viewport with the drop library.
It works totally fine using images, but my for my project I have to be able to import 3D models. Processings P3D rendering method does not support drag and dropping into the window.
As you can see here:

Does anyone have an idea for a workaround, which doesn’t require two windows as this example uses.

Here is the code:

import drop.*;

SDrop drop;
PShape m; 

void setup() {
  size(400,400, P3D);
  drop = new SDrop(this);
}

void draw() {
  background(0);
  translate(width/2, height/2, -200);
  if(m !=null) {
     shape(m);
  }
}
void dropEvent(DropEvent theDropEvent) {
  if(theDropEvent.isFile()) {
    File myFile = theDropEvent.file();
    if(myFile.isFile()) {
       println(myFile);
       String myFileStr = myFile.toString();
       myFileStr = myFileStr.replace("\\", "/");
       m = loadShape(myFileStr);
    }
  }
}

Just use a load dialog

Drag and drop is so much more convenient, that’s why I’d like to use that.

Would it be possible to dock a second window to the main one, so if you move the main window the secondary would just move along with it. I would use the 2 window approach if the example I linked if that’s possible.

1 Like

I have no idea…

see this? Quarks Place

Warm regards!

Chrisir