Commit Graph

99763 Commits

Author SHA1 Message Date
Campbell Barton 2511b260e1 Cleanup: mark Tex members moved to iuser as deprecated 2023-05-24 11:21:16 +10:00
Campbell Barton b03e71b419 Cleanup: remove unused TODO defines 2023-05-24 11:21:14 +10:00
Hans Goudey 37b6ba7616 Cleanup: Fix build error on Windows 2023-05-23 20:59:08 -04:00
Hans Goudey 9268a47b5b Cleanup: Mark deprecated custom data types as such 2023-05-23 20:58:54 -04:00
Hans Goudey e704ebaba4 Cleanup: Remove unnecessary template in curve subdivide node
The Catmull Rom curve subdivision arguments use runtime-typed spans,
so the template doesn't help anyway. Makes Blender 27 KB smaller.
2023-05-23 19:57:43 -04:00
Hans Goudey fa8351486f Cleanup: Remove template in vertex color transform operators
Replace a template with a FunctionRef, reducing Blender's
binary size by 63 KB, with a negligible performance impact.
2023-05-23 19:57:43 -04:00
Chris Blackbourn 0f87bdfd8f Merge branch 'blender-v3.6-release' 2023-05-24 11:30:01 +12:00
Chris Blackbourn f96e108b63 UV: Complete options for rotation during uv packing
The rotation options are now:
* None
* Axis-Aligned (Blender 3.3 default)
   - Rotate to a minimal rectangle, either vertical or horizontal.
* Cardinal (new)
   - Only 90 degree rotations are allowed.
* Any
   - Blender 3.6 default.
2023-05-24 11:27:59 +12:00
Hans Goudey abdb2bd6e9 Merge branch 'blender-v3.6-release' 2023-05-23 17:46:53 -04:00
Hans Goudey 34791dc37b Fix #108108: Remesh modifier crash with empty result
Caused by 7966cd16d6
2023-05-23 17:46:32 -04:00
Hans Goudey efbcfd8703 Mesh: Remove deprecated argumen to split_faces API function
See 75ad8da1ea
2023-05-23 17:35:33 -04:00
Hans Goudey 14e6a5c44c Cleanup: Remove #pragma once in .cc files 2023-05-23 17:27:48 -04:00
Michael Kowalski 574a9a9c8f Merge branch 'blender-v3.6-release' 2023-05-23 13:39:38 -04:00
Hans Goudey 9fd8fe134d Cleanup: Use C++ BitVector in subdiv code instead of Bitmap 2023-05-23 13:21:21 -04:00
Hans Goudey ba880db09a Fix #108175: Missing subversion bump for recent geometry nodes change
fc06a471f1 was missing a file subversion bump.
2023-05-23 13:18:56 -04:00
Sonny Campbell a127707cb4 USD Curve Export: Pinned CatmullRom Curve
In Blender the first and last points of a catmullRom curve are
treated as endpoints. To account for this in USD, we must set
the wrap attribute to 'pinned'. This lets the client know that
the first and last points are to be treated as points on the
curve, and that it needs to generate "phantom" points to account
for the start and end control points of a general catmullRom curve.

Related to #102376

Co-authored-by: DESKTOP-ON14TH5\Sonny Campbell <sonny.campbell@unity3d.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/108183
2023-05-23 19:18:17 +02:00
Hans Goudey f78639ff9f Cleanup: Fix uninitialized variable warning in bit span test 2023-05-23 13:15:21 -04:00
Hans Goudey 2262ea079b Fix #108034: Multires simple subdivide crash
Before 9f78530d80, the -1 coarse_edge_index values in the
foreach_edge calls would return false in BLI_BITMAP_TEST_BOOL,
which made them look like loose edges. BitSpan doesn't have this
problem, so the return for negative indices must be explicit.
2023-05-23 12:58:26 -04:00
Jacques Lucke 0d13b0e50d Depsgraph: add generic way for modifiers to check user-edited flags
This implements the design described in #108174.

Pull Request: https://projects.blender.org/blender/blender/pulls/108181
2023-05-23 18:17:42 +02:00
Bastien Montagne 1d9aaf7a4d Merge branch 'blender-v3.6-release' 2023-05-23 15:59:19 +02:00
Jeroen Bakker c0e61afc05 GPU: Make ShaderInterface.debug_print const
Method didn't modified the ShaderInterface but wasn't usable when trying
to debug a const reference to the ShaderInterface. This PR just adds the
const to the method.

Pull Request: https://projects.blender.org/blender/blender/pulls/108190
2023-05-23 15:55:47 +02:00
Bastien Montagne a4aee6a997 Fix (unreported) crash in blendkernel unittest in debug builds.
Some `ImagePartialUpdateTest` test are calling code that needs access to
a valid `G_MAIN`. So store the generated main there as part of the setup
step, and reset G_MAIN to its original value (should be NULL) in the
teardown step.

NOTE: Things like `ID_BLEND_PATH_FROM_GLOBAL` and
`BKE_main_blendfile_path_from_global` are pure evil. It may be necessary
in a very few small cases, but their current usages need a lot of strong
cleanup.

Pull Request: https://projects.blender.org/blender/blender/pulls/108189
2023-05-23 15:55:12 +02:00
Bastien Montagne 683f7d3f74 Merge branch 'blender-v3.6-release' 2023-05-23 15:07:22 +02:00
Bastien Montagne 89bd7b6402 Fix #105889: LibOverride: Overrides of shape keys reset on resync.
The usual special ShapeKey case needs yet another extra corner case
special handling... See comments in code for details about that specific
issue.

NOTE: May be worth checking if this can be backported to 3.3 LTS too.
2023-05-23 15:06:48 +02:00
Miguel Pozo 9ae2dd577a Overlay-Next: Initial implementation
This contains the basis of the new overlay engine.
Only a few overlays are ported for proof of concept of the new design.

This new design unifies the selection drawing with the overlay-next engine.
It now becomes responsible of selection in object mode.
For this we create a dedicated shader module that patches the shaders
for selection.

Note that the gizmo selection still uses the occlusion queries and edit-mode
the current selection engine (select_engine.c).

Related task #102179
Related task #102177

Co-authored-by: Clément Foucault <foucault.clem@gmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/107734
2023-05-23 15:00:38 +02:00
Raimund Klink 3d895f6e7a Cleanup: Clear Space in the render log
I found the small dent on the log to be bothersome and unnecessary. Although modifying the Blender output may cause some parsing issues, they can be quickly resolved.

Before:
```
22-05 16:26:02 (debug) Fra:96 Mem:3130.54M (Peak 11196.17M) | Time:11:58.38 | Remaining:00:09.02 | Mem:2890.45M, Peak:9039.80M | Scene | ViewLayer | Finishing
22-05 16:26:34 (debug) Saved: 'd:\sheep_gpu\sheepit\208726392_0096.png'
22-05 16:26:34 (debug)  Time: 12:30.28 (Saving: 00:31.08)
```
After:
```
22-05 16:26:02 (debug) Fra:96 Mem:3130.54M (Peak 11196.17M) | Time:11:58.38 | Remaining:00:09.02 | Mem:2890.45M, Peak:9039.80M | Scene | ViewLayer | Finishing
22-05 16:26:34 (debug) Saved: 'd:\sheep_gpu\sheepit\208726392_0096.png'
22-05 16:26:34 (debug) Time: 12:30.28 (Saving: 00:31.08)
```

Pull Request: https://projects.blender.org/blender/blender/pulls/108187
2023-05-23 14:50:09 +02:00
Sergey Sharybin 61ed5b3d24 Depsgraph: Add explicit object collection hierarchy tracking
The practical problem this change addresses is ability to have base
flag dependent functionality in Cycles without re-setting the render
on selection. This problem initially arose during the Cycles light
linking project.

The original review happened there:

    https://projects.blender.org/blender/blender/pulls/105837

Pull Request: https://projects.blender.org/blender/blender/pulls/108182
2023-05-23 14:02:45 +02:00
Sergey Sharybin 94f5ea9731 Refactor instanced collection relation builder in depsgraph
Move the instancing related code to a dedicated function, leaving
the generic `build_collection()` dedicated to the building of the
collection itself.

Should be no functional changes: the code paths should effectively
still be the same. This is because non-instancing cases were passing
object as a null pointer, disabling the non-generic code path.
2023-05-23 14:02:44 +02:00
Omar Emara 40484a6586 Cleanup: Silence unused parameters warnings 2023-05-23 14:14:07 +03:00
Sergey Sharybin e54a20b2a2 Cleanup: Remove unused collection pointer from depsgraph builder
Pull Request: https://projects.blender.org/blender/blender/pulls/108177
2023-05-23 12:35:23 +02:00
Clément Foucault a9beb62449 EEVEE-Next: Fix int3 packing with MSL 2023-05-23 12:30:29 +02:00
Clément Foucault 07c59041ac GPU: Add `packed_int3` for SSBO/UBO struct alignment
MSL require to use packed_int3 for compatibility
with GLSL memory layout.
2023-05-23 12:17:01 +02:00
Sergey Sharybin 793446cbdc BLI: Replace some macros with inlined functions for C++
Covers the macro ARRAY_SIZE() and STRNCPY.

The problem this change is aimed to solve it to provide cross-platform
compiler-independent safe way pf ensuring that the functions are used
correctly.

The type safety was only ensured for GCC and only for C. The C++
language and Clang compiler would not have detected issues of passing
bare pointer to neither of those macros.

Now the STRNCPY() will only accept a bounded array as the destination
argument, on any compiler.

The ARRAY_SIZE as well, but there are a bit more complications to it
in terms of transparency of the change.

In one place the ARRAY_SIZE was used on float3 type. This worked in the
old code because the type implements subscript operator, and the type
consists of 3 floats. One would argue this is somewhat hidden/implicit
behavior, which better be avoided. So an in-lined value of 3 is used now
there.

Another place is the ARRAY_SIZE used to define a bounded array of the
size which matches bounded array which is a member of a struct. While
the ARRAY_SIZE provides proper size in this case, the compiler does not
believe that the value is known at compile time and errors out with a
message that construction of variable-size arrays is not supported.

Solved by converting the field to std::array<> and adding dedicated
utility to get size of std::array at compile time. There might be a
better way of achieving the same result, or maybe the approach is
fine and just need to find a better place for such utility.

Surely, more macro from the BLI_string.h can be covered with the C++
inlined functions, but need to start somewhere.

There are also quite some changes to ensure the C linkage is not
enforced by code which includes the headers.

Pull Request: https://projects.blender.org/blender/blender/pulls/108041
2023-05-23 09:21:45 +02:00
Sergey Sharybin a5677d225b Refactor Render Result to allow implicit buffer sharing
Allows to share buffer data between the render result and image buffers.

The storage of the passes and buffers in the render result have been
wrapped into utility structures, with functions to operate on them.

Currently only image buffers which are sharing buffers with the render
results are using the implicit sharing. This allows proper decoupling of
the image buffers from the lifetime of the underlying render result.

Fixes #107248: Compositor ACCESS VIOLATION when updating datablocks from handlers

Additionally, this lowers the memory usage of multi-layer EXR sequences
by avoiding having two copies of render passes in memory.

It is possible to use implicit sharing in more places, but needs
some API to ensure the render result is the only owner of data before
writing to its pixels.

Pull Request: https://projects.blender.org/blender/blender/pulls/108045
2023-05-23 09:19:37 +02:00
Campbell Barton 9a8fd2f1dd PyAPI: remove deprecated 2D_/3D_ prefix for built-in shader names
Names passed to gpu.shader.from_builtin()
no longer skip the 2D_/3D_ prefix.
2023-05-23 15:51:54 +10:00
Campbell Barton fd68f977e0 PyAPI: remove dpi from BLF doc-string
Missed from recent removal of the argument.
2023-05-23 15:45:55 +10:00
Campbell Barton 7bc34283ea PyAPI: Operator.bl_property no longer defaults to "type"
This hard-coded assumption meant that operators would behave as if
bl_property = "type" was assigned in the operator - when the variable
wasn't found.

Remove the hard coded name. Operators that depended on this now need
to assign bl_property = "type" in the operator class explicitly.

Remove this because it wasn't documented as means operator behavior
could change unexpectedly when renaming a property.
2023-05-23 15:38:33 +10:00
Campbell Barton 345fc2b1f6 PyAPI: remove deprecated bpy.app.version_char 2023-05-23 15:25:47 +10:00
Campbell Barton 472e6563b0 Cleanup: replace strncpy calls with BLI_strncpy
Prefer BLI_strncpy as it ensures the string is null terminated.
2023-05-23 15:09:58 +10:00
Campbell Barton d1cc16913d PyAPI: use faster argument parsing for internal bpy.ops call & poll
No functional changes.
2023-05-23 14:55:37 +10:00
Campbell Barton ac263a9bce PyAPI: remove context override argument from bpy.ops
Remove deprecated context override argument to operator execution and
poll() method in favor of context.temp_override().
2023-05-23 14:34:09 +10:00
Campbell Barton ab5fc46872 PyAPI: remove deprecated Mesh.calc_normals 2023-05-23 13:02:12 +10:00
Campbell Barton 8d2679e1c5 Fix wrong buffer size passed to snprintf, use BLI_snprintf
Also remove redundant call to snprintf.
2023-05-23 12:46:55 +10:00
Campbell Barton 9357f7b606 PyAPI: remove deprecated blf.size() dpi argument
Scripts can be updated by scaling the font size, e.g.

blf.size(id, size, dpi) -> blf.size(id, size * (dpi / 72.0))
2023-05-23 12:02:10 +10:00
Campbell Barton 7fbac7e235 UI: set the waiting cursor from pack/unpack operators
Remove the guimode argument which used to set the cursor back in v2.4x.
2023-05-23 11:58:20 +10:00
Campbell Barton ad87bf3dc7 Cleanup: spelling, wording improvements 2023-05-23 11:50:34 +10:00
Campbell Barton 63074dddb1 Merge branch 'blender-v3.6-release' 2023-05-23 11:34:50 +10:00
Campbell Barton bceb1adb20 Fix potential buffer overflow in AssetList::setup
While in practice an overflow seems unlikely in this particular case,
internal path manipulation assume FILE_MAX_LIBEXTRA so passing in
smaller buffer sizes is error prone.
2023-05-23 11:30:52 +10:00
Campbell Barton 5659e83e04 Cleanup: remove incorrect use of the `r_` prefix, use sized argument
Rename `r_dir` to `dirpath` as this isn't a return only argument.
Also add the maximum size in the argument as a hint for the maximum size.
2023-05-23 11:21:02 +10:00
Campbell Barton c440efb23a Fix invalid buffer size used in ED_asset_handle_get_full_library_path
Relatively harmless as the length was shorter, however all callers
used the larger size.
2023-05-23 10:56:22 +10:00