Commit Graph

112630 Commits

Author SHA1 Message Date
Sergey Sharybin 03ff58b67d Cleanup: Use const qualifier in modifier data copy
Fix possible overflow of Modifier UUID

The code prior this change was re-generating modifier's session UUID
prior to copying this id from the source. This approach has a higher
risk of modifiers session UUID to overflow and start colliding with
existing modifiers.

This change makes it so that modifier copy does not re-generated the
session UUID unless it is needed.

Differential Revision: https://developer.blender.org/D14125
2022-02-16 15:40:03 +01:00
Sergey Sharybin 7e312f89d9 Cleanup: Use const qualifier in modifier data copy 2022-02-16 15:40:03 +01:00
Brecht Van Lommel 259f4e50ef Merge branch 'blender-v3.1-release' 2022-02-16 15:35:18 +01:00
Brecht Van Lommel f059bdc823 Cycles: restore basic standalone GUI, now using SDL
GLUT does not support offscreen contexts, which is required for the new
display driver. So we use SDL instead. Note that this requires using a
system SDL package, the Blender precompiled SDL does not include the video
subsystem.

There is currently no text display support, instead info is printed to
the terminal. This would require adding an embedded font and GLSL shaders,
or using GUI library.

Another improvement to be made is supporting OpenColorIO display transforms,
right now we assume Rec.709 scene linear and display.

All OpenGL, GLEW and SDL code was move out of core cycles and into
app/opengl. This serves as a template for apps that want to integrate
Cycles interactive rendering, with a simple OpenGLDisplayDriver example.
In general this would be adapted to the graphics API and color management
used by the app.

Ref T91846
2022-02-16 15:30:43 +01:00
Clément Foucault a6267f1167 BLI: Fix compilation error caused by rBa9f023e22638
Explicitly referencing the typename fixes the issue.
2022-02-16 14:40:14 +01:00
Jeroen Bakker 3f0e63fcca Merge branch 'blender-v3.1-release' 2022-02-16 11:16:22 +01:00
Jeroen Bakker 54972123f7 Fix Image GPU texture.
Due to recent changes there have been reports of incorrect loading of
GPU textures. This fix reverts a part of {D13238} that might be the
source of the issue.
2022-02-16 10:45:46 +01:00
Philipp Oeser 86762e8371 Merge branch 'blender-v3.1-release' 2022-02-16 08:41:40 +01:00
Philipp Oeser 232d5d3f13 Fix T95787: Texture paint: Apply Camera Image crash for certain images
This does not happen with **any** image, but with images that have ID
properties.

ID properties are used to store view projection matrices (e.g. for
reprojection with `Image from View` or `Quick Edit` -- these are the
ones we are interested in), but of course they can be used for anything
else, too. The images in the file from the report have ID properties from
an Addon for example.

So the crash can reliably be reproduced with **any** image doing the
following:
```
bpy.data.images['myImage']['myIDprop'] = "foo"
```
This would lead code in `texture_paint_camera_project_exec` to think the
needed `view_data` is on the image (but in reality it was just some
other IDprop).

Solution is simple: just check `view_data` is really valid after getting
it from the IDprops.

Maniphest Tasks: T95787

Differential Revision: https://developer.blender.org/D14116
2022-02-16 08:35:15 +01:00
Campbell Barton 18d18b5a98 UV: move sticky selection from image space into tool settings
Having this setting stored in the image space caused low level selection
logic to have to pass around the image space (which could be NULL
in some cases). Use the tool-settings instead since there doesn't seem
to be much/any advantage in having this setting per-space.
2022-02-16 13:46:00 +11:00
Campbell Barton a0ad8c57ef License headers: use SPDX identifiers 2022-02-16 13:04:20 +11:00
Campbell Barton 81223ae164 Cleanup: spelling in comments 2022-02-16 13:04:20 +11:00
Campbell Barton 37821143dd Cleanup: clang-format, use static sets, sort struct declarations 2022-02-16 13:04:20 +11:00
Clément Foucault d3b1cce400 GPUTexture: Add dimensions getter
Pretty straight forward. Returns the texture dimensions count. This is
different from the size.
2022-02-15 22:20:49 +01:00
Hans Goudey cbdd578640 Fix: Build error in debug build
Error in a9f023e226
2022-02-15 13:57:17 -06:00
Kévin Dietrich e272bdc171 Merge remote-tracking branch 'origin/blender-v3.1-release' 2022-02-15 20:41:39 +01:00
Kévin Dietrich 53fe4f62fe Fix T95806: subdivision missing in Cycles when using autosmooth
Although rB56407432a6a did fix missing subdivision in some cases, in
other cases it did not return the mesh wrapper (like when using
autosmooth, which requires a copy of the mesh), so the non-subdivided
mesh was still returned.
2022-02-15 20:40:58 +01:00
Jörg Müller 4782713390 Fix T94994: Anim Player Stops working In Video Sequence Editor
Port from upstream: variable was unitialized when device initialization
failed when the WASAPI mixing thread is started.
2022-02-15 20:04:42 +01:00
Kévin Dietrich 1efb8e215e Merge remote-tracking branch 'origin/blender-v3.1-release' 2022-02-15 17:53:51 +01:00
Kévin Dietrich 48b26d9c2e Fix T95697: GPU subdivision ignores custom normals
Similarly to the CPU subdivision, we interpolate custom loop normals
from the coarse mesh, and this for the final normals.
2022-02-15 17:53:22 +01:00
Kévin Dietrich 430ced76d5 GPU subdiv: fix custom data interpolation for N-gons
Not all coarse vertices were used to compute the center value (off by
one), and the interpolation for the current would always start at the
base corner for the base face instead of the base corner for the current
patch.
2022-02-15 17:53:12 +01:00
Hans Goudey a9f023e226 BLI: Change dependencies in vector math files
This patch reverses the dependency between `BLI_math_vec_types.hh` and
`BLI_math_vector.hh`. Now the higher level `blender::math` functions
depend on the header that defines the types they work with, rather than
the other way around.

The initial goal was to allow defining an `enable_if` in the types header
and using it in the math header. But I also think this operations to types
dependency is more natural anyway.

This required changing the includes some files used from the type
header to the math implementation header. I took that change a bit
further removing the C vector math header from the C++ header;
I think that helps to make the transition between the two systems
clearer.

Differential Revision: https://developer.blender.org/D14112
2022-02-15 10:27:03 -06:00
Hans Goudey 3ed3ee253b Cleanup: Rename file used for calculating mesh edges
This commit renames `mesh_validate.cc` to `mesh_calc_edges.cc`.
I would like to move `mesh_validate.c` to C++, but it makes sense to
keep this specific algorithm in a smaller file.
2022-02-15 09:29:22 -06:00
Michael b22db23aee Define CLANG_FORMAT_VERSION in install_deps.sh
When running `./blender/build_files/build_environment/install_deps.sh` on Ubuntu 20.04.3 LTS the following error can be seen:
```
./blender/build_files/build_environment/install_deps.sh: line 1266: [: too many arguments
```
This error results from the call:
```
  check_package_version_ge_DEB $CLANG_FORMAT $CLANG_FORMAT_VERSION
```
with `CLANG_FORMAT_VERSION` being undefined.
Also as `clang-format` 13 is already released and hopefully didn't break anything `CLANG_FORMAT_VERSION_MEX` could use version bump.

Reviewed By: mont29

Differential Revision: https://developer.blender.org/D13924
2022-02-15 14:12:21 +01:00
Jacques Lucke 07032dd218 Curves: add initial sculpt mode
This adds a new sculpt mode to the experimental new curves object.
Currently, this mode can only be entered and exited, nothing else.
The main initial purpose of this node will be to use it for hair grooming.

The patch also adds the `editors/curves/` directory for the new curves
object, which will be necessary for many other things as well.

I added a completely new mode (`OB_MODE_SCULPT_CURVES`), because
`OB_MODE_SCULPT` seems to be rather specific to meshes, and reusing
it doesn't seem worth the trouble. The tools/brushes used in mesh vs.
curves sculpt mode are quite distinct as well.

I had to add DNA_userdef_enums.h to make the patch compile with C++
(forward declaration of enums isn't allowed). This follows the same
pattern that we use for other enums in dna.

Differential Revision: https://developer.blender.org/D14107
2022-02-15 12:32:15 +01:00
Campbell Barton 07ed869b94 RNA: add RNA_collection_is_empty & RNA_property_collection_is_empty
Some collections needed to be iterated over to count their length.
Provide a function to check if the collection is empty to avoid this.
2022-02-15 20:13:00 +11:00
Campbell Barton 4637e83990 Merge branch 'blender-v3.1-release' 2022-02-15 19:51:43 +11:00
Campbell Barton 597edd299f Merge branch 'blender-v3.1-release' 2022-02-15 19:51:40 +11:00
Jeroen Bakker 92a3732ff1 Fix T95791: Unable to switch between multiviews.
Root cause is copy pasting buggy code.
2022-02-15 19:51:30 +11:00
Campbell Barton 7083ea36e2 Fix T94085: Crash with empty stroke list 2022-02-15 19:49:02 +11:00
Jeroen Bakker d1c7a252eb Fix T95791: Unable to switch between multiviews.
Root cause is copy pasting buggy code.
2022-02-15 09:41:10 +01:00
Campbell Barton 14dd207b75 License headers: use SPDX for remaining files in Cycles 2022-02-15 17:52:38 +11:00
Campbell Barton 88b6e5571e License headers: use SPDX for remaining CMake find modules & gtests 2022-02-15 17:45:39 +11:00
Campbell Barton fcac0b6fea Fix playing image-sequences with frames containing 9 or more numbers
The path calculation method for animation players: frame-cycler, rv &
mplayer would fail when the number of digits exceeded the range of a
32bit int causing RenderData.frame_path() to raise a ValueError.

Use a simpler method of extracting the range that uses the sign to
detect the beginning of the number.
2022-02-15 17:21:21 +11:00
Campbell Barton fa7bd4c069 Cleanup: move utility to create a frame path into a static method
Add PlayRenderedAnim._frame_path_with_number_char since mixing
this logic inline made the code harder to follow.
2022-02-15 17:16:26 +11:00
Ankit Meel c146d75808 readme.html: replace IRC with blender.chat, fix typo
- Replace IRC links and channels with blender.chat ones.
- Fix mismatch in text vs link of "GIT and Bug Tracker".
- http -> https for blender links
2022-02-15 11:09:40 +05:30
Ankit Meel 14d98d0388 CMake: create readme.html with configure_file
Since the output file stays unmodified for most developer builds,
install step installed it redundantly.

Create readme.html using `configure_file`:
- Now it's modified only if final output changes (handled by CMake).
- If input file (from git) or blender version changes,
  it //will// be modified.

Also don't re-implement what CMake can do.

Reviewed By: campbellbarton, LazyDodo
Differential Revision: https://developer.blender.org/D13863
2022-02-15 10:14:35 +05:30
Campbell Barton 9d01358a68 Cleanup: unused argument warnings 2022-02-15 13:04:31 +11:00
Campbell Barton e3a18a890d Cleanup: minor changes to Python argument parsing loop
- Increment the argument index at the end of the loop.
  Otherwise using the index after incrementing required subtracting 1.
- Move error prefix creation into a function: `pyrna_func_error_prefix`
  so it's possible to create an error prefix without duplicate code.

This simplifies further changes for argument parsing from D14047.
2022-02-15 12:57:59 +11:00
Brecht Van Lommel a9a05d5597 Merge branch 'blender-v3.1-release' 2022-02-15 01:05:47 +01:00
Brecht Van Lommel facd9d8268 Cleanup: clang-format 2022-02-15 01:05:25 +01:00
Hans Goudey 3d1e978257 Merge branch 'blender-v3.1-release' 2022-02-14 18:01:52 -06:00
Hans Goudey 1f7f7ca14e Fix T95720: Spreadsheet missing volume grid info
The cell drawing code in 474adc6f88 was missing an
implementation for virtual arrays of strings.
2022-02-14 18:00:45 -06:00
Clément Foucault d7d827789b GLShaderInterface: Fix undefined behavior when attributes are optimized away.
Optimized out attributes returns an invalid location `-1` resulting in
an undefined behavior shift.
2022-02-15 00:48:18 +01:00
Clément Foucault 89b47c1214 Merge branch 'blender-v3.1-release' 2022-02-15 00:11:23 +01:00
Clément Foucault 302c74e596 GLCompute: Apply state before dispatch 2022-02-15 00:10:50 +01:00
Clément Foucault b744081f83 GLDebug: Fix severity check
The check was reversed, leading to less errors being reported.
2022-02-15 00:02:31 +01:00
Clément Foucault 19b21563d6 GPUTexture: Fix missing enum cases in `to_component_len()`
This might have caused undersized buffer if using the wrong formats with
`GPU_texture_read()`.
2022-02-15 00:01:04 +01:00
Hans Goudey ad1f8a50b0 Cleanup: Use C++ math functions
Use functions from the `math` and `std` namespaces instead
of from `BLI_math_vector.h`.
2022-02-14 15:48:46 -06:00
Hans Goudey 761274fc19 Merge branch 'blender-v3.1-release' 2022-02-14 12:35:33 -06:00