Blender Git Loki

Blenderin Git "master"-kehityshaaran kommitit.

Page: 961 / 5574

December 20, 2019, 19:28 (GMT)
Fix T72445: Cycles crash with Displacement maps in OSL

The UDIM commit accidentally removed a check that skipped Image updates
if the image was managed by OSL.
December 20, 2019, 18:53 (GMT)
Fix T72471: Cycles AOV support breaks passes with divide_type

The problem is described in a comment in the change.
Short version: If a pass was used as a divide_type but also requested
explicitly (e.g. diffuse color), it was added to the passes list
twice because the names of the two requests didn't match.
Then, when searching for the pass to divide by, the wrong one (not
the one that the kernel was writing to) was picked.
December 20, 2019, 17:50 (GMT)
Fix: Build error with clang on windows.

A bug in llvm < 9.0.1 causes the compiler to crash when
openmp is enabled. Since mantaflow uses tbb we can safely
disable this flag temporarily for this module.

Reviewed By: sebbas

Differential Revision: https://developer.blender.org/D6446
December 20, 2019, 16:35 (GMT)
UI: Remove orphan datablocks directly from File->Clean Up menu

Actually, to purge orphans datablock you need go to Outliner, enable Orphan mode and press Purge button (that sometimes is out of the view because the window is too narrow).

To have this option hidden make very difficult to users use and understand what means orphan data, so this patch just adds a new Clean Up menu to File menu with this option. This menu could be used in the future for more clean up options. To have a general Clean Up menu is common used in other softwares.

Reviewed By: billreynish, mont29

Differential Revision: https://developer.blender.org/D6445


December 20, 2019, 13:29 (GMT)
Cleanup: in ID name management code: root_name -> base_name.

`root_name` did not really meant much here, `base_name` is much more
accurate.
December 20, 2019, 13:29 (GMT)
ID Management: Improve speed of code used when creating/renaming and ID.

This commit affects `id_sort_by_name()` and `check_for_dupid()` helper:
* Add a new parameter, `ID *id_sorting_hint`, to `id_sort_by_name()`,
and when non-NULL, check if we can insert `id` immediately before or
after it. This can dramatically reduce time spent in that function.
* Use loop over whole list in `check_for_dupid()` to also define the
likely ID pointer that will be neighbor with our new one.

This gives another decent speedup to all massive addition cases:

| Number and type of names of IDs | old code | new code | speed improvement |
| -------------------------------- | -------- | -------- | ----------------- |
| 40K, mixed (14k rand, 26k const) | 39s | 33s | 18% |
| 40K, fully random | 51s | 42s | 21% |
| 40K, fully constant | 40s | 34s | 18% |

Combined with the previous commits, this makes massive addition of IDs more
than twice as fast as previously.
December 20, 2019, 13:29 (GMT)
ID Management: Improve speed of code used when creating/renaming and ID.

This commit affects `check_for_dupid()` helper:
* Add a special, quicker code path dedicated to sequential addition of a
large number of IDs using the same base name.

This gives a significant speedup to adding 'randomly'-named IDs:

| Number and type of names of IDs | old code | new code | speed improvement |
| -------------------------------- | -------- | -------- | ----------------- |
| 40K, mixed (14k rand, 26k const) | 49s | 39s | 26% |
| 40K, fully random | 51s | 51s | 0% |
| 40K, fully constant | 71s | 40s | 78% |

Note that 'random' names give no improvement as expected, since this new code
path will never be used in such cases.
December 20, 2019, 13:29 (GMT)
ID Management: Improve speed of code used when creating/renaming and ID.

This commit affects `check_for_dupid()` helper:
* Further simplify the general logic of the code (we now typically only do
one loop over the list of data-blocks, instead of two).

This gives a significant speedup to adding 'randomly'-named IDs:

| Number and type of names of IDs | old code | new code | speed improvement |
| -------------------------------- | -------- | -------- | ----------------- |
| 40K, mixed (14k rand, 26k const) | 62s | 49s | 27% |
| 40K, fully random | 76s | 51s | 49% |
| 40K, fully constant | 77s | 71s | 8% |

Note that 'constant' names give little improvement, as in that case the first
loop over the list of IDs (checking whether base given name was already in use)
was aborting very quickly.
December 20, 2019, 13:29 (GMT)
ID Management: Fix/Sanitize code used when creating or renaming an ID.

This commit affects `check_for_dupid()` helper:
* Fix (serious though rare) bug where several IDs could end up with
exact same name (happened with over 10k IDs with same very long name).
* Fix (relatively harmless) func reporting it did not change the given
name when it actually had truncated it.
* Sanitize handling of supported min/max number suffixes (it now handles
between 1 and 1 billion, which should be way more than enough).
* Sanitize general logic to (hopefully!) make it easier to follow.
* General cleanup (naming, comments, variables scope, remove dead code, etc.).

Note that general performances here remain the same, there is no
measurable gain or loss. Algorithm remain also the same globally.

Attempt to use a GHash to speed up checks of used names proved to be
much worse, just building the GHash would already take as much time as
the whole process with current code...
December 20, 2019, 13:29 (GMT)
ID Management: Improve speed of code used when creating/renaming and ID.

This alone can make e.g. adding 40k IDs with default name (i.e. 'fully
constant' case in table below) about 15-20% faster:

| Number and type of names of IDs | old code | new code | speed improvement |
| -------------------------------- | -------- | -------- | ----------------- |
| 40K, mixed (14k rand, 26k const) | 75s | 62s | 21% |
| 40K, fully random | 90s | 76s | 18% |
| 40K, fully constant | 94s | 77s | 22% |

Idea is to use a first pass, where we just check one item every nth ones,
until we have found the chunk in which we want to insert the new item,
then do a basic linear comparison with all items in that chunk as before.

Also, list is now walked backward, as in most common 'massive insertion'
cases new ID's names have higher number, hence ends up towards the end of
the list.

This new sorting function can be between a few percents and 50% quicker than
original code, depending on various factors (like length of common parts of
ID names, whether new IDs should be added towards the end or not, how high
in numbering we are, etc.).

Note: another, full bisecting approach was also tried, which gives a massive
reduction of comparisons (from n items to log2(n)), but it only gave minor
improvements of speed from original fully linear code, while adding a fair
amount of complexity to the logic. Only case it was shining was the unlikely
'very long, almost similar ID names' case (since `strcasecmp()` is rather
costly then).
December 20, 2019, 13:29 (GMT)
ID Management: Add some basic tests regarding name handling.

Those tests are here mostsly to ensure ID name management is working as
expected (the code ensuring we never have two ilocal data-blocks of the
same type with the same name in a .blend file).

Note: Currently fails in some cases, fixes are incoming.

Note: Ideally this would be in C, but we already have too many tests
linking the whole Blender and its libraries, this is becoming a real
pain to link debug + ASAN + tests build these days... So until we find a
better way to handle those dependencies, sticking to simple python
scripts.
December 20, 2019, 12:05 (GMT)
Remove empty header added by accident
December 20, 2019, 11:47 (GMT)
Fix T71844: Outliner: show_active doesn't expand armature to show active bone

Since rB6bc6d016c5e7, outliner was not opening back up from the found
active element (but only its ID instead -- all occurances of this ID in
any collection).

Now expand from the active element as well (but only do this for the
first occurance of the corresponding ID)

Maniphest Tasks: T71844

Differential Revision: https://developer.blender.org/D6329
December 20, 2019, 07:23 (GMT)
Cleanup: simplify transform cursor DPI scaling
December 20, 2019, 07:19 (GMT)
Cleanup: split transform cursor drawing into their own files
December 20, 2019, 04:16 (GMT)
Fix T71817: Preferences tagged dirty by 'Enabled Add-ons Only'
December 20, 2019, 03:20 (GMT)
Fix T72577: vert/weight paint 'Orbit Around' & 'Frame Selected' fail

Caused by 14acac0bb7f3
December 20, 2019, 00:09 (GMT)
Fix IC-keymap doesn't allow MMB to run the active tool

Now the keymap can be configured so both the fallback and active
tool can be activated at once - when configured not to conflict.
December 19, 2019, 23:46 (GMT)
Cleanup: clang-format
December 19, 2019, 23:46 (GMT)
Cleanup: spelling
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021