scene_update_post and scene_update_pre get continuously called #45173

Closed
opened 2015-06-24 09:17:22 +02:00 by Nathan Letwory · 12 comments
Member

System Information
Win 10, 2x R9 280x + GT 420

Blender Version
Broken: seems to have been always like this
Worked: -

Short description of error

A handler added to bpy.app.handlers.scene_update_post (or _pre) will be continuously called instead of only on scene update.

Exact steps for others to reproduce the error
Execute script:

import bpy


def my_handler(scene):
    print("hi")

bpy.app.handlers.scene_update_post.append(my_handler)

Observer console output. "hi" is being printed while nothing is changing in the scene.

This should not happen, instead this should be triggered only on actual scene change. (selection, edit, add, delete, etc), probably ok to fire also on animation loop

**System Information** Win 10, 2x R9 280x + GT 420 **Blender Version** Broken: seems to have been always like this Worked: - **Short description of error** A handler added to bpy.app.handlers.scene_update_post (or _pre) will be continuously called instead of only on scene update. **Exact steps for others to reproduce the error** Execute script: ``` import bpy def my_handler(scene): print("hi") bpy.app.handlers.scene_update_post.append(my_handler) ``` Observer console output. "hi" is being printed while nothing is changing in the scene. This should not happen, instead this should be triggered only on actual scene change. (selection, edit, add, delete, etc), probably ok to fire also on animation loop
Author
Member

Changed status to: 'Open'

Changed status to: 'Open'
Campbell Barton was assigned by Nathan Letwory 2015-06-24 09:17:22 +02:00
Author
Member

Added subscriber: @jesterking

Added subscriber: @jesterking

Added subscriber: @mont29

Added subscriber: @mont29

Yeah, looks like it continuously runs, would not expect that.

Yeah, looks like it continuously runs, would not expect that.

Added subscriber: @RayMairlot

Added subscriber: @RayMairlot
Member

Added subscriber: @tetha.z

Added subscriber: @tetha.z

Added subscriber: @brecht

Added subscriber: @brecht

This is sort of by design. When this was implemented the actual scene update would run continuously too, since there was no quick way to detect if anything needed to be updated before doing it, . If that was possible the meaning of this callback would probably have been different.

But now that it always runs there's scripts taking advantage of that. For example you can do changes to objects in scene_update_pre in order to have them updated next, which would break if the meaning of this callback changed. I wouldn't consider this a bug really, it would be more of a design in my opinion.

This is sort of by design. When this was implemented the actual scene update would run continuously too, since there was no quick way to detect if anything needed to be updated before doing it, . If that was possible the meaning of this callback would probably have been different. But now that it always runs there's scripts taking advantage of that. For example you can do changes to objects in `scene_update_pre` in order to have them updated next, which would break if the meaning of this callback changed. I wouldn't consider this a bug really, it would be more of a design in my opinion.
Member

Added subscriber: @JulianEisel

Added subscriber: @JulianEisel
Member

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Member

Agree with @brecht, shouldn't be considered as bug if this is broken by design. Added to todo list , closing.

Agree with @brecht, shouldn't be considered as bug if this is broken by design. Added to [todo list ](http://wiki.blender.org/index.php/Dev:2.5/Source/Development/Todo/Tools#Other), closing.

These have now been removed, a timer can be used when continuous updates are needed.

These have now been removed, a timer can be used when continuous updates are needed.
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
7 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#45173
No description provided.