Commit Graph

150077 Commits

Author SHA1 Message Date
Omar Emara
ce0b3d9820 Refactor: Move common code into small functions 2024-10-24 11:13:07 +03:00
Alaska
0085ef0e59 Compositor: Increase Glare node max threshold
Increase the threshold of the glare node from 1000
to FLT_MAX to make it easier to use the glare node
with really bright pixels, like Nishita sky sun.

Ref: #129310

Pull Request: https://projects.blender.org/blender/blender/pulls/129343
2024-10-24 08:48:35 +02:00
Campbell Barton
1ba6b74cdf Fix error freeing null pointer on exit for debug builds
Changing comments to 'if 0' in [0] somehow caused null pointer
dereference on exit. Replace 'if 0' with C++ style comments to resolve.

[0]: 7b87c160f8
2024-10-24 14:04:32 +11:00
Campbell Barton
0475054b28 Merge branch 'blender-v4.3-release' 2024-10-24 12:54:12 +11:00
Campbell Barton
f23478439c Fix #129323: Slowdown adding/removing objects from Python
Python scripts could perform actions that created notifiers
which would not be handled until the script was complete.

In the case of adding & removing objects a notifier would be created
for adding the object, then cleared when the ID was removed.

This lead to the notifier queue filling up with cleared notifiers
which were included in the search whenever an ID was removed.

The result of this was that adding and removing objects from a script
would become increasingly slower & use more memory.

Resolve by storing the current notifier being handed which isn't freed
(only cleared). The notifier handling loop detects cleared notifiers
and frees them after use.
2024-10-24 12:50:31 +11:00
Omar Emara
8a02a5de56 Compositor: Implemenet Posterize node for new CPU compositor
Reference #125968.
2024-10-23 13:24:54 +03:00
Omar Emara
471c30fdd9 Refactor: Return cached image by value
Return cached image by value for consistency with other cached
resources.
2024-10-23 13:13:38 +03:00
Campbell Barton
05128991ec Merge branch 'blender-v4.3-release' 2024-10-23 19:50:09 +11:00
Campbell Barton
9a252c2e73 Fix #127097: Extension preferences crashes after "import multiprocesing"
Remove a workaround for #23871 which manipulated the module
to prevent classes defined in the text editor from having their
name-space cleared.

This caused the "multiprocessing" module to store the "__main__" module
as "__mp_main__" for later use.

Accessing attributes from this module would then attempt to read from
with a null "mp_dict" which crashed. This happened when showing the
extensions preferences but would have occurred if "__mp_main__" was
accessed from elsewhere too.

Resolve by removing the workaround since it has not been needed
since Python 3.2.
2024-10-23 19:45:57 +11:00
Campbell Barton
73fc8950f3 Merge branch 'blender-v4.3-release' 2024-10-23 16:14:08 +11:00
Campbell Barton
26d34d3bfc Fix #128312: Incorrect defaults for gizmo properties 2024-10-23 16:12:33 +11:00
Campbell Barton
b874e5d2ab Merge branch 'blender-v4.3-release' 2024-10-23 15:55:01 +11:00
Campbell Barton
21457db162 Cleanup: remove deprecated typing use for extensions utility
Also replace some uses of Generator with Iterator.
2024-10-23 15:44:06 +11:00
Campbell Barton
cfc645901f Cleanup: use type hints for discover_nodes.py 2024-10-23 13:18:36 +11:00
Campbell Barton
4a69ede005 Cleanup: spelling in strings 2024-10-23 13:14:37 +11:00
Campbell Barton
7b87c160f8 Cleanup: spelling in comments 2024-10-23 13:14:35 +11:00
Campbell Barton
a0453ab87a Cleanup: update use of typing in for Python scripts 2024-10-23 12:48:09 +11:00
Campbell Barton
39b9863cca Merge branch 'blender-v4.3-release' 2024-10-23 12:46:26 +11:00
Campbell Barton
3a73505569 Merge branch 'blender-v4.3-release' 2024-10-23 12:46:18 +11:00
Campbell Barton
17c32d1bcd AUTHORS: add 1 new author 2024-10-23 12:37:52 +11:00
Campbell Barton
7cacd0da46 Cleanup: suppress unknown source files from "make check_cmake" 2024-10-23 12:37:51 +11:00
Campbell Barton
68b1fe3986 Merge branch 'blender-v4.3-release' 2024-10-23 12:30:01 +11:00
Campbell Barton
6dedfe15f8 Merge branch 'blender-v4.3-release' 2024-10-23 12:29:58 +11:00
Campbell Barton
1d1da80c08 Merge branch 'blender-v4.3-release' 2024-10-23 12:29:55 +11:00
Campbell Barton
d1c82cc537 Cleanup: spelling in comments 2024-10-23 12:25:58 +11:00
Campbell Barton
1d286a1b93 Fix #129302: GIL not released if poll_message_set was passed a string
Regression in [0].

Co-authored-by: Jorn Visser <git@jornvisser.com>

[0]: ebe04bd3ca
2024-10-23 12:25:57 +11:00
Clément Foucault
6cc4e51e0a Fix: GPU: Shader error line broken for NVidia drivers
Previously the source was not set and would always return 0.
Now it correctly returns the filename hash.
2024-10-22 23:31:52 +02:00
Philipp Oeser
ef6a035884 Fix #129200: Transfer Mode operator can be used on already active object
If source and destination objecs are the same, we can just early out
(dont even need a report message for this I think).

Pull Request: https://projects.blender.org/blender/blender/pulls/129208
2024-10-22 21:03:30 +02:00
Omar Emara
53fa6f0d0a Compositor: Implement Map Value node for new CPU compositor
Reference #125968.
2024-10-22 17:43:17 +03:00
Omar Emara
278787aeee Compositor: Implemenet Map Range node for new CPU compositor
Reference #125968.
2024-10-22 17:42:28 +03:00
Omar Emara
1bd64e873e Fix: Corrupt image when compositor is canceled
When the compositor is canceled mid-execution, the image node will get
corrupt in future executions in new CPU execution mode. That's because
the image node treated cached images as an intermediate results that can
be passed through, while they should be treated as external resources
since they are managed by the static cache manager.

This patch fixes that by adding another variant of wrap_external that
takes a Result and wraps its data, then we use that in the Image node.
2024-10-22 17:37:30 +03:00
Weizhen Huang
60b8fd005d Merge branch 'blender-v4.3-release' 2024-10-22 15:38:48 +02:00
Weizhen Huang
afd629bffc Cycles: make switching of sampling techniques in Draine less noticeable
Draine phase function sampling internally use Henyey-Greenstein and
Rayleigh sampling for degenerated cases, but the sampling pattern was
different between Draine and Rayleigh. The commit effectively replace
`rand` with `1 - rand` in Rayleigh sampling.

Pull Request: https://projects.blender.org/blender/blender/pulls/129261
2024-10-22 15:38:06 +02:00
Weizhen Huang
ee6f27a100 Fix: Cycles: NaN in Draine phase function when g == 0
When `g == 0`, the Draine phase function from
https://doi.org/10.1051/0004-6361/202142437 simplifies to
\[\Phi(\theta)=\frac{3}{4\pi(3+\alpha)}(1+\alpha\cos^2\theta).\]
Similar as Rayleigh sampling in https://doi.org/10.1364/JOSAA.28.002436,
The solution to the CDF of the marginal density function is
\[\cos^3\theta+a\cos\theta+b=0,\]
with
\[a=\frac{3}{\alpha},\quad b=\frac{3+\alpha}{\alpha}(2\xi_1-1),\]
which has only one real root since \(\alpha > 0\),
resulting in the sample technique
\[\cos\theta=u-\frac{1}{\alpha u}.\]

Pull Request: https://projects.blender.org/blender/blender/pulls/129259
2024-10-22 15:37:37 +02:00
Howard Trickey
eba2aff295 Revert "Rob-Blair-ready" - committed before tests ready.
This reverts commit 8b94e21976.
2024-10-22 14:57:56 +02:00
Howard Trickey
8b94e21976 Rob-Blair-ready
Copying PR 126309 from Rob-Blair so that I can try to make the tests pass.

Co-authored-by: Rob-Blair <Rob.Blair@Verizon.net>
Pull Request: https://projects.blender.org/blender/blender/pulls/129313
2024-10-22 14:52:30 +02:00
Omar Emara
c8dd6650db Merge branch 'blender-v4.3-release' 2024-10-22 11:54:27 +03:00
Omar Emara
cce896fe11 Fix #127292: Cryptomatte passes are missing meta-data
Meta-data are missing on Cryptomatte layers in the GPU compositor, so
they do not get saved using the File Output node. This is due to a use
after free error where a temporary string is used in the meta-data
population logic. This is fixed by assigning the string to a temporary
variable instead.

Thanks to Jorn Visser for finding the cause of the issue.
2024-10-22 11:50:04 +03:00
Omar Emara
0bff0cfe0f Compositor: Implemenet Vector Curves node for CPU
This patch implemenets the Vector Curves node for the new CPU
compositor.

Reference: #125968.
2024-10-22 11:37:56 +03:00
Lukas Tönne
71398478b2 Fix #128055: parentinv matrix uninitialized in old GPv2 files
In GPv2 the parentinv matrix is zero initially and only becomes valid
after setting the layer parent. This matrix must not be copied to the
GPv3 layers unless the parent is set.

In addition the parentinv matrix should also be computed when changing
the layer parent. This has been nominally added, except that a full
computation isn't possible without the actual grease pencil Object. This
means a local RNA property cannot update the parentinv matrix, this
needs to become a full-blown operator. The behavior now should be the
same as in GPv2 at least.

Pull Request: https://projects.blender.org/blender/blender/pulls/129304
2024-10-22 09:30:34 +02:00
Sergey Sharybin
97e86f6d72 Merge branch 'blender-v4.3-release' 2024-10-22 09:17:20 +02:00
Sergey Sharybin
a4553aad49 Build: Lower the number of concurrent HIP-RT jobs
This is an attempt to deal with an increased OOM on the buildbot.
2024-10-22 09:15:41 +02:00
Campbell Barton
5955e0566c Cleanup: update use of typing for tools/utils 2024-10-22 16:44:21 +11:00
Campbell Barton
0ae9ae736e Merge branch 'blender-v4.3-release' 2024-10-22 15:58:37 +11:00
Campbell Barton
f69fbb41c1 Fix #129225: Crash in modifiers & constraints with invalid enum values
Even though this is generally avoided, drivers don't prevent
invalid values being set. Further files from branches or files
written in the future may contain enum values not yet known.

Resolve by range checking enum values which are used to index arrays.
2024-10-22 15:56:58 +11:00
Campbell Barton
07880dd369 Merge branch 'blender-v4.3-release' 2024-10-22 13:20:24 +11:00
Campbell Barton
414b9fb96f Merge branch 'blender-v4.3-release' 2024-10-22 13:20:20 +11:00
Campbell Barton
1d6add574d Fix #129167: Operator search can hang for some operator names
RNA label & description truncation could cause invalid UTF8
which caused BLI_string_search to hang.

Resolve by ensuring truncation of RNA descriptions & labels never
truncates a multi-byte sequences.

The issue with BLI_string_search would still be good to resolve but can
be handled separately.
2024-10-22 12:47:39 +11:00
Campbell Barton
40b5a4da2b Fix misleading assertion message setting built-in operator values 2024-10-22 12:46:39 +11:00
Clément Foucault
c81745e4af Fix: Overlay: Shader test broken on Mac
The merge got wrong.
2024-10-21 22:17:55 +02:00