blender/source
Jacques Lucke 98db4cc639 Fix T84899: instance ids are not unique in common cases
Ids stored in the `id` attribute cannot be assumed to be unique. While they
might be unique in some cases, this is not something that can be guaranteed
in general. For some use cases (e.g. generating "stable randomness" on points)
uniqueness is not important. To support features like motion blur, unique ids
are important though.

This patch implements a simple algorithm that turns non-unique ids into
unique ones. It might fail to do so under very unlikely circumstances, in
which it returns non-unique ids instead of possibly going into an endless
loop.

Here are some requirements I set for the algorithm:
* Ids that are unique already, must not be changed.
* The same input should generate the same output.
* Handle cases when all ids are different and when all ids are the same
  equally well (in expected linear time).
* Small changes in the input id array should ideally only have a small
  impact on the output id array.

The reported bug happened because cycles found multiple objects with
the same id and thought that it was a single object that moved on every
check.

Differential Revision: https://developer.blender.org/D10402
2021-02-12 17:44:27 +01:00
..
blender Fix T84899: instance ids are not unique in common cases 2021-02-12 17:44:27 +01:00
creator creator: add missing '--debug-*' arguments under debugging options 2021-02-02 19:34:47 +11:00
tools@dd131bc4f9 Fix T85363: Cmd + Tab shortcut overridden on macOS 2021-02-04 14:27:44 +01:00
CMakeLists.txt MSVC: Enable clang-tidy analyser 2020-12-03 11:00:58 -07:00