# P3D not allowing to drag and drop files into window

**URL:** <https://discourse.processing.org/t/p3d-not-allowing-to-drag-and-drop-files-into-window/35134>\
**Category:** Libraries\
**Tags:** homework\
**Created:** [February 12, 2022, 10:34pm UTC](https://discourse.processing.org/t/p3d-not-allowing-to-drag-and-drop-files-into-window/35134 "2022-02-12T22:34:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Devostated](https://avatars.discourse-cdn.com/v4/letter/d/7cd45c/32.png) [@Devostated](https://discourse.processing.org/u/Devostated)\
**Post date:** [February 12, 2022, 10:34pm UTC](https://discourse.processing.org/t/p3d-not-allowing-to-drag-and-drop-files-into-window/35134/1 "2022-02-12T22:34:39Z")

</div>

Hello,  
I’m trying to load and display files via drag and drop into the viewport with the [drop](https://github.com/transfluxus/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:

 ![Untitled](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/3/3fd030383298a555d07984cdc9fb1a5a43329466.png)

Does anyone have an idea for a workaround, which doesn’t require two windows as this [example](https://github.com/transfluxus/drop/issues/1#issuecomment-377825076) uses.

Here is the code:

```auto
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);
    }
  }
}

```

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [February 12, 2022, 10:38pm UTC](https://discourse.processing.org/t/p3d-not-allowing-to-drag-and-drop-files-into-window/35134/2 "2022-02-12T22:38:06Z")

</div>

Just use a load dialog

---

<div class="post-metadata">

**Author:** ![Devostated](https://avatars.discourse-cdn.com/v4/letter/d/7cd45c/32.png) [@Devostated](https://discourse.processing.org/u/Devostated)\
**Post date:** [February 13, 2022, 12:06am UTC](https://discourse.processing.org/t/p3d-not-allowing-to-drag-and-drop-files-into-window/35134/3 "2022-02-13T00:06:06Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [February 13, 2022, 10:52am UTC](https://discourse.processing.org/t/p3d-not-allowing-to-drag-and-drop-files-into-window/35134/4 "2022-02-13T10:52:49Z")

</div>

I have no idea…

see this? [Quarks Place](http://www.lagers.org.uk/g4p/guides/g02-windows.html)

Warm regards!

Chrisir
