Replace space image drop-box with a File Handler #117707
No reviewers
Labels
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
4 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#117707
Loading…
Reference in New Issue
No description provided.
Delete Branch "guishe/blender:multiple-image-import"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Replaces
Space Image
drop-box with a file handler in orderto support open multiple files at once.
Is introduced a operator
Image_OT_open_images
, that usesImage_OT_open
, this operator groups files that may resultin different sequences or in different a UDIM groups.
Would like @JulianEisel 's opinion on this as well as the owner of drag/drop.
@ -194,0 +203,4 @@
files: CollectionProperty(type=OperatorFileListElement, options={'SKIP_SAVE', 'HIDDEN'})
relative_path: BoolProperty(name="Use relative path", default=False)
use_sequence_detection: BoolProperty(name="Use sequence detection", default=False)
use_udim_detection: BoolProperty(name="Use UDIM detection", default=False)
It's probably better to set these 3 properties to True to match the existing option defaults. What do you think?
I had it as
False
because there was no feedback when the images were imported as sequences.But since the sequence is replaced with
#
in the name, I think it can be set to true@ -194,0 +259,4 @@
use_udim_detecting=self.use_udim_detection,
relative_path=self.relative_path)
if len(files) > 1 and self.use_sequence_detection:
context.edit_image.name = "{prefix}{hash}{ext}".format(prefix=seq[0], hash=("#" * seq[2]), ext=seq[1])
This is a nice substitution I think. But it could end up doing this for the name of UDIMs too. I guess this is the primary downside of keeping
use_sequence_detection
anduse_udim_detection
set to True at the same time but it could easily happen.When dropping 2 UDIM files "test.1001.png" and "test.1002.png", this code will replace the correct
test.<UDIM>.png
name withtest.####.png
. How about doing the following to only do this replacement for sequences:Added, but I think it would be good to be able to distinguish in some way the udims images in the name
@ -194,0 +263,4 @@
return {'FINISHED'}
def invoke(self, context, event):
To match current behavior we could drop the
invoke
and addbl_options = {'REGISTER', 'UNDO'}
to this operator. That would allow users to drag/drop without a popup but still adjust things after the fact with the redo panel. Most folks will be dropping regular files so, if possible, we should try to keep that seamless and quick.@ -194,0 +266,4 @@
def invoke(self, context, event):
if not self.directory or len(self.files) == 0:
return {'CANCELLED'}
title = self.files[0].name if len(self.files) == 1 else "Open {len} imagenes".format(len=len(self.files))
Spelling of "images" here and the
bl_label
belowDidn't really go into the operator implementation details, but overall things look good to me. Just one small thing I suggest changing.
@ -194,0 +212,4 @@
@classmethod
def poll(cls, context):
return (context.area and context.area.ui_type == 'IMAGE_EDITOR'
and context.region and context.region.type == 'WINDOW')
I don't think you have to enforce a region type here? That would only be required when getting data from context that is only available in this region, that doesn't seem to be the case here. So I think this can be removed.
@ -194,0 +260,4 @@
relative_path=self.relative_path)
is_tiled = context.edit_image.source == 'TILED'
if len(files) > 1 and self.use_sequence_detection and is_tiled:
context.edit_image.name = "{prefix}{hash}{ext}".format(
The condition should be
not is_tiled
- seems like thenot
got dropped?Reminder to use case insensitive extension matching (fixed
2f003277c5
).