I want to write a python script which downloads images which are drag and dropped into blender from a browser. However, I don't know if this is even possible.

Is it possible to get the following in python?

  • When an image is dropped into the image editor.
  • The location (URL) from the dropped file.

And then create an image datablock from the stored image data?

Is this possible?


No, it's not possible. In Blender's C code, I found references to "dropboxes" and code to deal with them in different area types, but the process is completely inaccessible through Python (no variables to check, nor callbacks to register).

There is bpy.ops.object.drop_named_image, that looks like a modal operator. It supposedly adds a dropped image as an empty, but does nothing when executed and crashes Blender when invoked, so I think it's an internal operator just like bpy.ops.mesh.drop_named_image. So there's no directly-callable Python operator for drag-and-drop either.

Besides, Blender doesn't support URI-formatted filepath.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.