Python error in Properties Editor search menu #108737

Closed
opened 2023-06-08 07:36:43 +02:00 by Andrej · 8 comments
Contributor

System Information
Operating system: Linux-6.1.18-200.fc37.x86_64-x86_64-with-glibc2.36 64 Bits, WAYLAND UI
Graphics card: AMD Radeon Graphics (renoir, LLVM 15.0.7, DRM 3.49, 6.1.18-200.fc37.x86_64) AMD 4.6 (Core Profile) Mesa 22.3.7

Blender Version
Broken: version: 3.6.0 Beta, branch: blender-v3.6-release (modified), commit date: 2023-06-09 04:26, hash: bab7548f94f4

Prior to 5ca65001ea

Short description of error
Python error in Properties Editor search menu

Exact steps for others to reproduce the error
from the default startup file:

  • move your mouse over to the Properties Editor
  • hit F3 for search

Poll error:

  File "Blender\3.5\scripts\startup\bl_operators\geometry_nodes.py", line 108, in poll
    return edit_geometry_nodes_modifier_poll(context)
  File "Blender\3.5\scripts\startup\bl_operators\geometry_nodes.py", line 53, in edit_geometry_nodes_modifier_poll
    return get_context_modifier(context) is not None
  File "Blender\3.5\scripts\startup\bl_operators\geometry_nodes.py", line 46, in get_context_modifier
    modifier = context.object.modifiers.active
AttributeError: 'NoneType' object has no attribute 'modifiers'
**System Information** Operating system: Linux-6.1.18-200.fc37.x86_64-x86_64-with-glibc2.36 64 Bits, WAYLAND UI Graphics card: AMD Radeon Graphics (renoir, LLVM 15.0.7, DRM 3.49, 6.1.18-200.fc37.x86_64) AMD 4.6 (Core Profile) Mesa 22.3.7 **Blender Version** Broken: version: 3.6.0 Beta, branch: blender-v3.6-release (modified), commit date: 2023-06-09 04:26, hash: `bab7548f94f4` Prior to 5ca65001ea **Short description of error** Python error in Properties Editor search menu **Exact steps for others to reproduce the error** from the default startup file: - move your mouse over to the Properties Editor - hit `F3` for search Poll error: ``` File "Blender\3.5\scripts\startup\bl_operators\geometry_nodes.py", line 108, in poll return edit_geometry_nodes_modifier_poll(context) File "Blender\3.5\scripts\startup\bl_operators\geometry_nodes.py", line 53, in edit_geometry_nodes_modifier_poll return get_context_modifier(context) is not None File "Blender\3.5\scripts\startup\bl_operators\geometry_nodes.py", line 46, in get_context_modifier modifier = context.object.modifiers.active AttributeError: 'NoneType' object has no attribute 'modifiers' ```
Andrej added the
Severity
Normal
Type
Report
Status
Needs Triage
labels 2023-06-08 07:36:43 +02:00
Member

Hi @Andrej730 , you don't have a modal() call inside your delay operator, so returning {"RUNNING_MODAL"} can lead to unexpected behaviour.

Try:

    def modal(self, context, event):
        return {"FINISHED"}
    
    def invoke(self, context, event):
        context.window_manager.modal_handler_add(self)
        return {"RUNNING_MODAL"}
Hi @Andrej730 , you don't have a `modal()` call inside your delay operator, so returning `{"RUNNING_MODAL"}` can lead to unexpected behaviour. Try: ```Py def modal(self, context, event): return {"FINISHED"} def invoke(self, context, event): context.window_manager.modal_handler_add(self) return {"RUNNING_MODAL"} ```
YimingWu added
Status
Needs Information from User
Interest
Python API
and removed
Status
Needs Triage
labels 2023-06-08 10:11:56 +02:00
Author
Contributor

@ChengduLittleA tested, same error in console with code below:

import bpy
import time

class DelayOperator(bpy.types.Operator):
    bl_idname = "object.delay_operator"
    bl_label = "Delay Operator"
    bl_options = {"REGISTER", "UNDO"}

    def invoke(self, context, event):
        return {"RUNNING_MODAL"}

    def modal(self, context, event):
        return {"FINISHED"}

    def execute(self, context):
        return {'FINISHED'}

def register():
    bpy.utils.register_class(DelayOperator)

def unregister():
    bpy.utils.unregister_class(DelayOperator)

if __name__ == "__main__":
    register()
@ChengduLittleA tested, same error in console with code below: ```python import bpy import time class DelayOperator(bpy.types.Operator): bl_idname = "object.delay_operator" bl_label = "Delay Operator" bl_options = {"REGISTER", "UNDO"} def invoke(self, context, event): return {"RUNNING_MODAL"} def modal(self, context, event): return {"FINISHED"} def execute(self, context): return {'FINISHED'} def register(): bpy.utils.register_class(DelayOperator) def unregister(): bpy.utils.unregister_class(DelayOperator) if __name__ == "__main__": register() ```
Member

@Andrej730 note the context.window_manager.modal_handler_add(self)

@Andrej730 note the `context.window_manager.modal_handler_add(self)`
Member

I suspect that you probably messed up some internal registrations because edit_geometry_nodes_modifier_poll(context) isn't anywhere near your code. Try restarting blender, remove your own script files, or factory reset and see, here I'm not able to get that error even if I run your original script directly.

I suspect that you probably messed up some internal registrations because `edit_geometry_nodes_modifier_poll(context)` isn't anywhere near your code. Try restarting blender, remove your own script files, or factory reset and see, here I'm not able to get that error even if I run your original script directly.
Author
Contributor

Just tested again by downloading another portable 3.5.1 and running it with blender --factory-startup.
Also tried on friend's PC, same error.

Just tested again by downloading another portable 3.5.1 and running it with `blender --factory-startup`. Also tried on friend's PC, same error.
Member

Can confirm (this has nothing to do with your script though, can be reproduced with other steps as well), will check a bit then come back with my findings.

Can confirm (this has nothing to do with your script though, can be reproduced with other steps as well), will check a bit then come back with my findings.
Philipp Oeser added
Status
Confirmed
and removed
Status
Needs Information from User
labels 2023-06-09 09:41:56 +02:00
Member

So this happened in the Properties Editor, but actually pulling up F3 search there regardless of having run any script prior.

Can be reproduced just like this:
from the default startup file:

  • move your mouse over to the Properties Editor
  • hit F3 for search

See the PR that fixes this for more information

So this happened in the Properties Editor, but actually pulling up F3 search there regardless of having run any script prior. Can be reproduced just like this: from the default startup file: - move your mouse over to the Properties Editor - hit `F3` for search See the PR that fixes this for more information
Philipp Oeser changed title from geometry_nodes.py poll console error on invoked operators to Python error in Properties Editor search menu 2023-06-09 10:45:50 +02:00
Member

Will raise prio since this is technically a regression

Will raise prio since this is technically a regression
Blender Bot added
Status
Resolved
and removed
Status
Confirmed
labels 2023-06-09 15:07:11 +02:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Code Documentation
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
FBX
Interest
Freestyle
Interest
Geometry Nodes
Interest
glTF
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 & 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
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
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
Asset System
Module
Core
Module
Development Management
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
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#108737
No description provided.