2,300 Objects Makes Blender Unresponsive #36260

Closed
opened 2013-07-23 16:29:28 +02:00 by Atomic · 10 comments

%%%--- Operating System, Graphics card ---
Windows 7 x64 8Gb Ram
AMD 6 core 2.7Ghz.
nVidia GTX 460
Blender 2.68 official release

- Blender version with error, and version that worked ---


- Short description of error ---

I have written a script which generates a grid of unique cubes. Even a modest sized grid of 64x36 elements (2,304) bring Blender to it's knees. Each cube is animated as well. So there are 2,304 cubes and 2,304 fcurves. I have written the script so that all cubes are parented to a single object. This means only one object appears in the outliner.

Memory does not seem to be the problem. Blender reports the entire scene only takes up 67Mb.

I offer the attached BLEND file as a stress test mechanism for performance. This simple scene should not bring Blender to it's knees, but it does.

- Steps for others to reproduce the error (preferably based on attached .blend file) ---

Open the attached BLEND file and scrub the timeline.

%%%

%%%--- Operating System, Graphics card --- Windows 7 x64 8Gb Ram AMD 6 core 2.7Ghz. nVidia GTX 460 Blender 2.68 official release - Blender version with error, and version that worked --- - Short description of error --- I have written a script which generates a grid of unique cubes. Even a modest sized grid of 64x36 elements (2,304) bring Blender to it's knees. Each cube is animated as well. So there are 2,304 cubes and 2,304 fcurves. I have written the script so that all cubes are parented to a single object. This means only one object appears in the outliner. Memory does not seem to be the problem. Blender reports the entire scene only takes up 67Mb. I offer the attached BLEND file as a stress test mechanism for performance. This simple scene should not bring Blender to it's knees, but it does. - Steps for others to reproduce the error (preferably based on attached .blend file) --- Open the attached BLEND file and scrub the timeline. %%%
Author

Changed status to: 'Open'

Changed status to: 'Open'

%%%If you close the outliner it gets much faster, so even though it's collapsed that's the cause of the problem.%%%

%%%If you close the outliner it gets much faster, so even though it's collapsed that's the cause of the problem.%%%
Member

%%%Some information for developers: outliner_set_coord_tree_element looks like a garbage function, it recursively sets coordinates, but nobody reads these coordinates later (as far as I can see).

And the single invocation of outliner_set_coord_tree_element in outliner_draw_tree_element looks obviously wrong:

	  for (ten = te->subtree.first; ten; ten = ten->next)
		outliner_set_coord_tree_element(soops, te, startx, starty);

Notice how it traverses the outliner tree (te) instead of branch (ten) in each iteration.

This is about 30% of slowdown, the other 70% is outliner_build_tree, which happens after each manual frame change.%%%

%%%Some information for developers: outliner_set_coord_tree_element looks like a garbage function, it recursively sets coordinates, but nobody reads these coordinates later (as far as I can see). And the single invocation of outliner_set_coord_tree_element in outliner_draw_tree_element looks obviously wrong: for (ten = te->subtree.first; ten; ten = ten->next) outliner_set_coord_tree_element(soops, te, startx, starty); Notice how it traverses the outliner tree (te) instead of branch (ten) in each iteration. This is about 30% of slowdown, the other 70% is outliner_build_tree, which happens after each manual frame change.%%%
Member

%%%Oops, outliner_set_coord_tree_element was added to fix
https://projects.blender.org/tracker/index.php?func=detail&aid=25313&group_id=9&atid=498
But the loop in outliner_draw_tree_element is still wrong.%%%

%%%Oops, outliner_set_coord_tree_element was added to fix https://projects.blender.org/tracker/index.php?func=detail&aid=25313&group_id=9&atid=498 But the loop in outliner_draw_tree_element is still wrong.%%%
Member

%%%I removed superfluous iterations in r58737, so the next goal in profiler is outliner_build_tree? Blender rebuilds the tree in outliner on each redraw, even if user simply moves the cursor over outliner.%%%

%%%I removed superfluous iterations in r58737, so the next goal in profiler is outliner_build_tree? Blender rebuilds the tree in outliner on each redraw, even if user simply moves the cursor over outliner.%%%
Author

%%%Is there any way to make the rebuild of the tree skip all objects that reside underneath a closed node? (i.e parented) Then we would only pay the price of a full rebuild if all nodes are expanded.%%%

%%%Is there any way to make the rebuild of the tree skip all objects that reside underneath a closed node? (i.e parented) Then we would only pay the price of a full rebuild if all nodes are expanded.%%%
Member

%%%At this moment blender has 2 modes of outliner redraw: full and simple. The simple one occurs when user plays the animation in 3d-view, but it completely ignores most of the animated things in outliner (e. g. visibility). This is ok for animation player since it gives a reasonable boost for 3d-view, but when user changes the frame manually Blender tries to show up-to-date information.

After examining profiler logs I have noticed that even if we can't skip tree rebuild, the function which rebuilds the tree can be significantly optimized (this was mentioned in source code as TODO). I'll try to optimize it and let's see what happens.%%%

%%%At this moment blender has 2 modes of outliner redraw: full and simple. The simple one occurs when user plays the animation in 3d-view, but it completely ignores most of the animated things in outliner (e. g. visibility). This is ok for animation player since it gives a reasonable boost for 3d-view, but when user changes the frame manually Blender tries to show up-to-date information. After examining profiler logs I have noticed that even if we can't skip tree rebuild, the function which rebuilds the tree can be significantly optimized (this was mentioned in source code as TODO). I'll try to optimize it and let's see what happens.%%%
Member

%%%I have added my patch at https://projects.blender.org/tracker/index.php?func=detail&aid=36335&group_id=9&atid=127 . It does not affect redraws, but it makes the rebuild of the tree much faster.%%%

%%%I have added my patch at https://projects.blender.org/tracker/index.php?func=detail&aid=36335&group_id=9&atid=127 . It does not affect redraws, but it makes the rebuild of the tree much faster.%%%
Member

%%%Fixed in r58855.%%%

%%%Fixed in r58855.%%%
Member

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
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#36260
No description provided.