Commit Graph

99781 Commits

Author SHA1 Message Date
Campbell Barton
4ac66828cf Cleanup: remove use of strcat
While these uses seemed safe, strcat is error prone enough that other
functions are preferable.
2023-05-24 17:46:58 +10:00
Campbell Barton
82db5c4b97 Cleanup: remove unused ID property string contamination functions 2023-05-24 17:12:52 +10:00
Campbell Barton
128b4396c9 Merge branch 'blender-v3.6-release' 2023-05-24 17:09:39 +10:00
Campbell Barton
686ec6310c Fix potential buffer overflow with thumbnail URI creation on WIN32
Avoid unsafe strcat use.
2023-05-24 17:08:05 +10:00
Jacques Lucke
8be8960738 Merge branch 'blender-v3.6-release' 2023-05-24 08:46:52 +02:00
Jacques Lucke
edf4cb8b67 Geometry Nodes: store path to simulation bake in modifier
This adds `char *simulation_bake_directory` to the nodes modifier. The path is automatically generated the first time the modifier is baked. It is _not_ automatically changed afterwards. The path is relative to the .blend file by default. For now, the path is not exposed in the UI or Python API.

This fixes issues where renaming objects/modifiers can cause the baked data to not work anymore.

Pull Request: https://projects.blender.org/blender/blender/pulls/108201
2023-05-24 08:45:31 +02:00
Campbell Barton
b621c6ba07 Merge branch 'blender-v3.6-release' 2023-05-24 16:34:05 +10:00
Campbell Barton
d56c38525c Fix flipped check for file-copy failure on OBJ export
The check for file-copy success was flipped,
document the return value.

Relocate move next to copy as they're related functions.
2023-05-24 16:31:39 +10:00
Campbell Barton
1f6b3c20c8 Fix potential buffer overflow for BLI_copy & BLI_path_move on WIN32
Avoid unsafe strcat use for file copy & move on WIN32.
Allocate the necessary space for the string.
2023-05-24 16:28:01 +10:00
Hans Goudey
a6eae61b52 Fix: Windows build error in template code
`using namespace blender` didn't make it into the lambda,
likely because of a compiler bug.
2023-05-24 00:16:52 -04:00
Campbell Barton
44d9a5eb72 Merge branch 'blender-v3.6-release' 2023-05-24 13:36:06 +10:00
Campbell Barton
574b2db317 Fix buffer overflow in BLI_path_abs on WIN32
Loading paths without a drive-prefix could overflow by 3 bytes.
Replace unsafe strcat with BLI_strncpy.
2023-05-24 13:33:27 +10:00
Campbell Barton
f5ea30985e Cleanup: misleading/incorrect argument to BLI_path_to_display_name
The strlen() was passed in as a size argument, in this case it
couldn't have caused an overflow because the source & destination
happened to be the same size.

Also reduce the destination buffer size as this is used for an ID name.
2023-05-24 13:03:18 +10:00
Campbell Barton
48d146fb5c Fix potential buffer overflows in USD export & OpenEXR
- Don't use the source string length +1 as the size of the destination
  (USD export & IMB_exr_get_handle_name).
- Correct undersized buffer being passed into imb_exr_insert_view_name.
2023-05-24 12:37:57 +10:00
Campbell Barton
b5150ee8ea Fix potential buffer overflows in USD export & OpenEXR
- Don't use the source string length +1 as the size of the destination
  (USD export & IMB_exr_get_handle_name).
- Correct undersized buffer being passed into imb_exr_insert_view_name.
2023-05-24 12:32:47 +10:00
Campbell Barton
6a9c78d059 Docs: expand on why a restart when changing script directories is needed 2023-05-24 11:21:20 +10:00
Campbell Barton
14a7c5afac Cleanup: remove outdated comments 2023-05-24 11:21:19 +10:00
Campbell Barton
13c815085b Cleanup: spelling in comments 2023-05-24 11:21:18 +10:00
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