Repository navigation
Commit cf32ce9
committed
Stop the panels building collections while they draw
get_products() reached the MV_Products collection through
get_products_root(), which creates and links it when it is missing. Three
panels call that from draw(), so merely opening the MultiView sidebar on
a file that had never used the add-on linked an MV_Products collection
into the scene and left the file marked as modified.
Blender does not refuse the write, it just does it, and the resulting
data change schedules another redraw: with the sidebar open the panels
drew twice per change instead of once. Building data from a draw callback
is not something the API promises to keep working either.
get_products() now reads bpy.data directly and returns [] when the root
is absent. Creation stays in get_products_root(), which only the import
and add-collection operators call. Every caller already handled an empty
list, since that is what an existing but empty MV_Products returns.1 parent cdedde5 commit cf32ce9
1 file changed
Lines changed: 14 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
313 | 313 | | |
314 | 314 | | |
315 | 315 | | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
316 | 323 | | |
317 | 324 | | |
318 | 325 | | |
319 | 326 | | |
320 | | - | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
321 | 333 | | |
322 | 334 | | |
323 | 335 | | |
| |||
1826 | 1838 | | |
1827 | 1839 | | |
1828 | 1840 | | |
| 1841 | + | |
1829 | 1842 | | |
1830 | 1843 | | |
1831 | 1844 | | |
| |||
0 commit comments