PointerProperty in UI slows down extremely #91387
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
6 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#91387
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
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?
System Information
Windows 10
Blender Version
Blender 2.83.17
Short description of error
Creating a python script that utilizes bpy.props.PointerProperty suddenly slows down when rendered in the UI. This happens proportional to the amount of elements in a custom CollectionProperty in bpy.types.scene.
Exact steps for others to reproduce the error
(change the amount of items in line 161 of the script to slow down even more.)
This is a simplified version of the problem that occours for a huge addon developed in my company. We have hundreds of items in the bpy.context.scene.CollectionProperty as well as tens of UIs with tens of PointerPropertys. We are running into huge performance problems.
bug_pointer_property.py
Added subscriber: @Zweistein
Added subscriber: @PratikPB2123
Added subscriber: @lichtwerk
Changed status from 'Needs Triage' to: 'Confirmed'
Can confirm it is extremely slow, seems like it spends most of its time trying to figure out if the button is animated:
Usually performance issues are not considered bugs, but I will confirm this for now and see if #user_interface or #animation_rigging can classify this.
Added subscribers: @mont29, @dr.sybren
@mont29, @dr.sybren : Can the whole
BKE_animdata_driver_path_hack
from8cb1b35bee
go? (since this seems to be from times where there could be FCurves outside AnimData)I also dont quite get how (all of a sudden) AnimData can be non-NULL:
BKE_animdata_from_id
https://developer.blender.org/diffusion/B/browse/master/source/blender/blenkernel/intern/fcurve.c$428BKE_animdata_driver_path_hack
BKE_animdata_from_id
is called again afterBKE_animdata_driver_path_hack
)BKE_fcurve_find_by_rna_context_ui
will be skipped anyways...If the
BKE_animdata_driver_path_hack
stuff can go, the example script from this report gets super snappy again (and drivers still seems to work properly):P2392: T91387_snippet
Well, at least when it is not animated/driven ;)
As soon as that is the case, we get the similar bottleneck a bit further down [that is already commented to be slow -- also needs to call
RNA_path_from_ID_to_property
], but at least we are not calling it twice!https://developer.blender.org/diffusion/B/browse/master/source/blender/blenkernel/intern/fcurve.c$447
Added subscriber: @HooglyBoogly
I really hoped and tested this bug with Blender 3.0.0 and I have to confirm that it is sadly still there.
Is there a known workaround?
Yes, cool, there is a workaround:
If i change the pointed-to IntProperty "options", then it seems to be fast:
The default is options={'ANIMATABLE'} as per documentation.
The task is still open, and not closed as "Resolved". There is no reason to think it's been resolved already.
This issue was referenced by
025c921416
Yes! It's gone since
025c921416
:)It's replaced with a call to
RNA_path_from_ID_to_property()
, though, so the code isn't going to be any faster. It's much clearer, though.Some years ago
BKE_animdata_driver_path_hack()
still did a lot more, and could probably have caused the anim data to appear.Now, though,
RNA_path_from_ID_to_property()
it's not changingtptr
so theNULL
pointer stays.Yup, nuke it!