heimlich1024/OD_CopyPasteExternal

Blender: Paste Behavior Suggestion

Opened this issue · 2 comments

Hello and thank you for making such such an awesome tool!

Correct me if i'm wrong, but my understanding of how the blender paste script works is as follows:
-Search for an active object
-If no active object exists, paste as a new mesh
-If active object exists, overwrite active object with the mesh data to be pasted.

I find this behavior to be problematic, because of the way that blender uses active objects. Even if you deselect everything in the scene, the most recently selected object will still be set as the "active object". This is indicated by an orange dot in blender on the most recently selected mesh.

As far as I can tell, the only way to not have an active object, is if the scene is completely new and you've never selected anything OR if you use the following script:
C.scene.objects.active = None

Perhaps it would be preferable to always create a new object when pasting from external? I find the current behavior confusing, because if I'm using a pre-existing scene, I either have to create a temporary mesh and set it as active in order to overwrite it, or I have to use the above script to paste a new mesh in.

When I've forgotten to do the above, I've unintenionally overwritten objects in my scene.

I'll take that under consideration. I'd rather figure out a way to get the truly active object, to keep both functionalities, as I think its still useful to be able to "overwrite" an existing object. Will check that when i get back from vacation.

Thank you for the response. I also considered that the overwriting method might be beneficial to have.

I suspect one way to solve this might be a conditional statement that first checks to see if there are any selected objects with:
bpy.context.selected_objects

If that returns a value, then grab the active object,

If that returns no value, we know that even if there is an active object, it isn't currently selected by the user, and thus isn't intended for overwriting. Create a new mesh.

I hope that might be at least vaguely helpful. Enjoy the rest of your vacation!