IO: Use FileHandler in Node Editors #121051

Merged
Hans Goudey merged 5 commits from guishe/blender:fh-node into main 2024-04-26 16:40:26 +02:00
Contributor

Use FileHandlers to handle file drag-n-drop in Node Editors. Drop-boxes
still remain since they handle Images ID drag-n-drop.

This also allows to open/drag-n-drop multiple files at once.

Also this will allow add-ons to also support drag-n-drop for images and movies in
node editors while still providing access to Blender's native support
since File Handlers let users choose which to invoke if there's
multiple configured.

Note:
This makes to NODE_OT_add_file to do natively what
NWAddMultipleImages(NodeWrangler operator) does.

Use `FileHandlers` to handle file drag-n-drop in Node Editors. Drop-boxes still remain since they handle Images ID drag-n-drop. This also allows to open/drag-n-drop multiple files at once. Also this will allow add-ons to also support drag-n-drop for images and movies in node editors while still providing access to Blender's native support since File Handlers let users choose which to invoke if there's multiple configured. Note: This makes to `NODE_OT_add_file` to do natively what `NWAddMultipleImages`(`NodeWrangler` operator) does. <video src="https://projects.blender.org/attachments/dd4b1248-eea2-4763-9bd0-0d7b586f639f" title="2024-04-24 14-30-38.mp4" controls></video>
Guillermo Venegas added 1 commit 2024-04-24 22:32:15 +02:00
Guillermo Venegas reviewed 2024-04-24 22:37:15 +02:00
@ -717,0 +750,4 @@
node->id = (ID *)image;
}
nodes.append(node);
position[1] -= node->height * 2;
Author
Contributor

At this point I can't get the real node size I believe, needs first a node draw call(?), it's ok to leave as this way?

At this point I can't get the real node size I believe, needs first a node draw call(?), it's ok to leave as this way?

I think this can be modal operator with timer (to perform animation) to looks like usual nodes spreading.

I think this can be modal operator with timer (to perform animation) to looks like usual nodes spreading.
Member

I don't think node->height has any meaningful value, it's only used for custom-sized nodes.

The modal operation with a timer like Iliya suggests could be pretty cool. But using some hardcoded value here would be fine too. It's probably around 200 or something, would require some testing though.

I don't think `node->height` has any meaningful value, it's only used for custom-sized nodes. The modal operation with a timer like Iliya suggests could be pretty cool. But using some hardcoded value here would be fine too. It's probably around 200 or something, would require some testing though.
Author
Contributor

Added a animation (and updated video in description), looks better

Added a animation (and updated video in description), looks better
guishe marked this conversation as resolved
Guillermo Venegas added 1 commit 2024-04-24 22:41:34 +02:00
Guillermo Venegas added 1 commit 2024-04-25 02:29:07 +02:00
Hans Goudey requested review from Hans Goudey 2024-04-25 03:13:49 +02:00
Guillermo Venegas added 1 commit 2024-04-25 14:08:44 +02:00
Guillermo Venegas added 1 commit 2024-04-25 22:20:10 +02:00
buildbot/vexp-code-patch-lint Build done. Details
buildbot/vexp-code-patch-linux-x86_64 Build done. Details
buildbot/vexp-code-patch-darwin-arm64 Build done. Details
buildbot/vexp-code-patch-windows-amd64 Build done. Details
buildbot/vexp-code-patch-darwin-x86_64 Build done. Details
buildbot/vexp-code-patch-coordinator Build done. Details
7c0e1f02ba
sort nodes by animation
Hans Goudey approved these changes 2024-04-26 14:43:06 +02:00
Hans Goudey left a comment
Member

This works well, the effect is pretty cool and helps to give context to where the nodes end up.

This works well, the effect is pretty cool and helps to give context to where the nodes end up.
Member

@blender-bot build

@blender-bot build
Hans Goudey merged commit 615100acda into main 2024-04-26 16:40:26 +02:00
Guillermo Venegas deleted branch fh-node 2024-04-26 16:44:46 +02:00
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#121051
No description provided.