File handlers: hidden properties are shown in the properties dialog if the file selector was called before #119854

Closed
opened 2024-03-25 02:32:02 +01:00 by Damien Picard · 5 comments
Member

System Information
Operating system: Linux-6.5.0-26-generic-x86_64-with-glibc2.38 64 Bits, X11 UI
Graphics card: NVIDIA GeForce RTX 3060 Laptop GPU/PCIe/SSE2 NVIDIA Corporation 4.6.0 NVIDIA 545.29.06

Blender Version
Broken: version: 4.2.0 Alpha, branch: main (modified), commit date: 2024-03-24 07:52, hash: af0c42e266a4
Worked: (newest version of Blender that worked as expected)

Short description of error
An import operator’s invocation can be defined so it shows a properties dialog if called from a file handler, or a file selector otherwise. For this to work, common properties such as files, directory and filepath should be 'HIDDEN' so they don’t show up in either interface.

These properties are effectively hidden on first invocation, but if the file selector is shown once, they are shown on later invocations through drag and drop.

Exact steps for others to reproduce the error

  • Execute this script to register a simple import operator and file handler: test_import.py
  • Drag and drop a .txt file into Blender. This popup appears:
    image
  • Call the operator manually by hitting F3 and typing “Test Import”. The file selector appears.
  • Cancel.
  • Drag and drop a .txt file into Blender. Now this popup appears, with properties that should be hidden:
    image
**System Information** Operating system: Linux-6.5.0-26-generic-x86_64-with-glibc2.38 64 Bits, X11 UI Graphics card: NVIDIA GeForce RTX 3060 Laptop GPU/PCIe/SSE2 NVIDIA Corporation 4.6.0 NVIDIA 545.29.06 **Blender Version** Broken: version: 4.2.0 Alpha, branch: main (modified), commit date: 2024-03-24 07:52, hash: `af0c42e266a4` Worked: (newest version of Blender that worked as expected) **Short description of error** An import operator’s invocation can be defined so it shows a properties dialog if called from a file handler, or a file selector otherwise. For this to work, common properties such as `files`, `directory` and `filepath` should be `'HIDDEN'` so they don’t show up in either interface. These properties are effectively hidden on first invocation, but if the file selector is shown once, they are shown on later invocations through drag and drop. **Exact steps for others to reproduce the error** - Execute this script to register a simple import operator and file handler: [test_import.py](/attachments/6e372ee2-2f86-4fa4-a4f5-df83201bb80d) - Drag and drop a .txt file into Blender. This popup appears: ![image](/attachments/0b415068-45b5-45d0-9831-0ccd8689074c) - Call the operator manually by hitting F3 and typing “Test Import”. The file selector appears. - Cancel. - Drag and drop a .txt file into Blender. Now this popup appears, with properties that should be hidden: ![image](/attachments/78016ec1-c983-4a82-8262-457a3723844a)
Damien Picard added the
Priority
Normal
Type
Report
Status
Needs Triage
labels 2024-03-25 02:32:03 +01:00
Contributor

image

![image](/attachments/98478478-31cb-422a-8201-d585fb1115b1)
176 KiB
Contributor

Its a space file bug, when the operator invokes the file select window, the draw call set HIDDEN this props, and later it removes the HIDDEN flag

Its a space file bug, when the operator invokes the file select window, the draw call set `HIDDEN` this props, and later it removes the `HIDDEN` flag
Member

Its a space file bug, when the operator invokes the file select window, the draw call set HIDDEN this props, and later it removes the HIDDEN flag

Can confirm. This does not happen with Cpp IO operators. Guess I need to check this in debug build

> Its a space file bug, when the operator invokes the file select window, the draw call set HIDDEN this props, and later it removes the HIDDEN flag Can confirm. This does not happen with Cpp IO operators. Guess I need to check this in debug build
Contributor

This does not happen with Cpp IO operator

This is because these operators have draw callbacks.

the issue is here in #119854 (comment), that clear the flag even if the property was originally tagged

>This does not happen with Cpp IO operator This is because these operators have `draw` callbacks. the issue is here in https://projects.blender.org/blender/blender/issues/119854#issuecomment-1153079, that clear the flag even if the property was originally tagged
Member

Yes, you're right. BTW "clear hide flag" was added in dbd79c097c cc @ideasman42

Yes, you're right. BTW "clear hide flag" was added in dbd79c097c14d486fe79b91b916a9f854587b27e cc @ideasman42
Blender Bot added
Status
Resolved
and removed
Status
Confirmed
labels 2024-04-20 07:00:58 +02:00
Sign in to join this conversation.
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#119854
No description provided.