WIP: Add OSX support for Image copy/paste in the Image Editor osx-clipboard #112189

Draft
Jim-Snavely wants to merge 15 commits from Jim-Snavely/blender:osx-clipboard-111404 into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
First-time contributor
  • override methods to SystemCocoa for image copy + paste
  • refactor drag and drop image handling so that the same code can be re-used
  • enable the image copy/paste operators for darwin

See: #111404

- override methods to SystemCocoa for image copy + paste - refactor drag and drop image handling so that the same code can be re-used - enable the image copy/paste operators for darwin See: #111404
Iliya Katushenock added this to the User Interface project 2023-09-09 22:32:33 +02:00
Iliya Katushenock changed title from WIP: Add OSX support for Image copy/paste in the Image Editor osx-clipboard-111404 to WIP: Add OSX support for Image copy/paste in the Image Editor osx-clipboard 2023-09-09 22:32:46 +02:00
Jim-Snavely force-pushed osx-clipboard-111404 from 71874ed175 to 5b50dc628b 2023-09-10 21:01:49 +02:00 Compare
Harley Acheson requested review from Harley Acheson 2023-09-10 21:15:44 +02:00
Member

Although I have added myself as a reviewer, I don't compile for Mac so can't really test this.

Our very next step, after a cursory check, will be a review by a volunteer Mac dev. Then we'll make some package builds of this available for testing. Then we can have a core review.

Although I have added myself as a reviewer, I don't compile for Mac so can't really test this. Our very next step, after a cursory check, will be a review by a _volunteer_ Mac dev. Then we'll make some package builds of this available for testing. Then we can have a core review.
Member

@ankitm

Do you have any time to check this out? I'm hoping for an initial cursory check of the code, a test to make sure it works as advertised. And if you think it looks plausible I can arrange to get some package builds out for user testing, all before getting a core review.

@Jim-Snavely

Similarly, is there are chance that you can take a look at the following? Again, a quick look at the code and then add a comment to the PR, especially a "Hey, we need this!" if warranted would be helpful. I don't think the PR is current compilable as it looks to have a conflict with main. But another set of eyes by a Mac user is appreciated.

#107267

@ankitm Do you have any time to check this out? I'm hoping for an initial cursory check of the code, a test to make sure it works as advertised. And if you think it looks plausible I can arrange to get some package builds out for user testing, all before getting a core review. @Jim-Snavely Similarly, is there are chance that you can take a look at the following? Again, a quick look at the code and then add a comment to the PR, especially a "Hey, we need this!" if warranted would be helpful. I don't think the PR is current compilable as it looks to have a conflict with main. But another set of eyes by a Mac user is appreciated. https://projects.blender.org/blender/blender/pulls/107267
Author
First-time contributor

Happy to look again, but I don't see a conflict with main, though it has become out-of-date since I last pulled upstream yesterday.

Is that what you're referring to @Harley ?

Happy to look again, but I don't see a conflict with main, though it has become out-of-date since I last pulled upstream yesterday. Is that what you're referring to @Harley ?
Jim-Snavely force-pushed osx-clipboard-111404 from 8c5abb41d4 to 5cb3397798 2023-09-11 23:46:45 +02:00 Compare
Author
First-time contributor

darn, I think I see what you'r referring to - not a git conflict but something else. I'll try to apply the changes fresh and see if it addresses it.

darn, I think I see what you'r referring to - not a git conflict but something else. I'll try to apply the changes fresh and see if it addresses it.
Member

@Jim-Snavely - Is that what you're referring to Harley ?

No, I somehow missed adding the link I was talking about. I have edited my earlier comment to actually... include the thing. LOL.

In a nutshell I was hoping that Ankit could take a look at your PR and you at theirs. We just don't have many Mac developers so I am hoping to take advantage of you.

> @Jim-Snavely - Is that what you're referring to Harley ? No, I somehow missed adding the link I was talking about. I have edited my earlier comment to actually... include the thing. LOL. In a nutshell I was hoping that Ankit could take a look at your PR and you at theirs. We just don't have many Mac developers so I am hoping to take advantage of you.
Author
First-time contributor

LOL, I'm happy to be of service!

LOL, I'm happy to be of service!
Member

Did a cursory test and it works as advertised for PNG, JPEG and TIFF images when copied from open with preview > select all > copy

Though I don't think hasClipboardImage is working properly.. image paste button is enabled even if I copy a file from finder (PNG or TXT both). a file copied from Finder has multiple meanings.. https://apple.stackexchange.com/questions/180346/is-there-a-way-to-see-the-invisible-formatting-in-my-clipboard-and-or-create-the

Did a cursory test and it works as advertised for PNG, JPEG and TIFF images when copied from open with preview > select all > copy Though I don't think `hasClipboardImage` is working properly.. image paste button is enabled even if I copy a file from finder (PNG or TXT both). a file copied from Finder has multiple meanings.. https://apple.stackexchange.com/questions/180346/is-there-a-way-to-see-the-invisible-formatting-in-my-clipboard-and-or-create-the
Member

For objc code, new code should use @autoreleasepool{} blocks instead of alloc and release

For objc code, new code should use `@autoreleasepool{}` blocks instead of alloc and release
Member

a file copied from Finder has multiple meanings.

To be clear there's no need to paste the image if the copied item is a file from Finder or a full path to a file. Just that current code seems to be interpreting that path/file as image data and allowing user to paste some random stuff.

> a file copied from Finder has multiple meanings. To be clear there's no need to paste the image if the copied item is a file from Finder or a full path to a file. Just that current code seems to be interpreting that path/file as image data and allowing user to paste some random stuff.
This pull request has changes conflicting with the target branch.
  • intern/ghost/intern/GHOST_SystemCocoa.mm

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u osx-clipboard-111404:Jim-Snavely-osx-clipboard-111404
git checkout Jim-Snavely-osx-clipboard-111404
Sign in to join this conversation.
No reviewers
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#112189
No description provided.