Commit Graph

100190 Commits

Author SHA1 Message Date
Bastien Montagne
32bbfbb06e Fix #108643: Blender window does not open to full dimensions of the desktop.
When opening 'homefile' (i.e. startup or factory startup) at Blender
start (i.e. when there is no existing WM yet), the size of the windows
in the newly read WM is reset to zero, which will then cause `WM_check`
to re-size them the the maximum possible size on current monitor.

Regression from ebb5643e59.
2023-06-07 20:01:11 +02:00
Bastien Montagne
16d077e7e4 Cleanup: Comment to relevant other code in versioning for 400. 2023-06-07 19:56:55 +02:00
Brecht Van Lommel
5f8391ca2d Fix anisotropic BSDF versioning code being in the wrong place
Ref #104445
2023-06-07 18:04:51 +02:00
guishe
67193e4e32 UI: Remove duplicate subsequent separators in Properties Navbar Tabs
Remove duplicate subsequent separators between tabs in Properties Navbar

Pull Request: https://projects.blender.org/blender/blender/pulls/107693
2023-06-07 18:01:54 +02:00
Bastien Montagne
cb75792c4c Merge branch 'blender-v3.6-release'
Conflicts:
	source/blender/blenkernel/BKE_blender_version.h
	source/blender/blenloader/intern/versioning_300.cc
2023-06-07 17:11:56 +02:00
Bastien Montagne
3405472672 Cleanup: correct comment for .empty. versioning block. 2023-06-07 17:05:09 +02:00
Bastien Montagne
a1e5d57b59 Cleanup/fix: Add file subversion bump to 3.6 for 'unversioned' versioning.
`blo_do_versions_300` still had some 'no version number' versioning code
at its end, should have been handled when 3.6 branch was created.
2023-06-07 17:01:33 +02:00
Germano Cavalcante
c310cf6a2f Merge branch 'blender-v3.6-release' into main 2023-06-07 11:59:11 -03:00
Germano Cavalcante
981dd12394 Fix #108665: Project 3D cursor on Geometry not working in X-ray
Caused by 98bfa8d458

Occlusion must consider several factors:
- The `Viewport Display` > `Display As` setting  of the object.
- The X-Ray mode of the scene.
- Whether only Snap to Face is being used.
- Whether Snap is set to Cage (always transparent) in edit mode.
- Whether the object is hidden.

In the case of Cage, the final geometry should be utilized for occlusion.
However, to prevent excessive and risky modifications, it was followed
the same approach as before and verified the `Display As` setting of
the object.
2023-06-07 11:56:53 -03:00
Sergey Sharybin
97197bd53e BLI: Add more per-element functions for vectors
This includes square root and reciprocal, and their safe versions.

For the reciprocal use name rcp, which matches Cycles and allows
to implement the same function for per-element operation on matrices.

Pull Request: https://projects.blender.org/blender/blender/pulls/108705
2023-06-07 15:15:37 +02:00
Sergey Sharybin
db3a96492f BLI: Use math:: functions for per-element vector operations
Use math functions from blender::math for those operations, which
allows to device vectors of non-standard types.
2023-06-07 15:15:35 +02:00
Philipp Oeser
963f8893a5 Merge branch 'blender-v3.6-release' 2023-06-07 14:50:13 +02:00
Philipp Oeser
7b8bbabece Fix #106155 : Hair dynamics not working well when converted from curves
In particular, the root was not sticking to mesh with hair dynamics.
Reason for this is missing HairKey weight upon conversion (everything
had zero weight). This then can not be corrected (since weight tool does
not allow to paint on roots).

So now, give the hair a default 1.0 to 0.0 weight gradient upon
conversion [which is in line with the default weight distribution for a
hair particle system].

Pull Request: https://projects.blender.org/blender/blender/pulls/108651
2023-06-07 14:49:20 +02:00
Omar Emara
f06929766b Realtime Compositor: Implement Movie Distortion node
This patch implements the Movie Distortion node for the realtime
compositor. The distorted coordinates are computed and cached for a
particular tracking camera distortion parameters. So for expensive
distortion models, the first run will take some time to compute, but
subsequent runs will be fast.

An alternative implementation would be to implement each of the
distortion modes in the shader, but that was decided against for a few
reasons:

1. We want to hide the implementation details of the distortion models,
   since it is provided through an external library (Libmv).
2. Some distortion models are expensive to solve accurately, and can be
   quite slow to solve each time the shader runs.
3. The typical usage of the node does not involve interactive editing of
   the distortion parameters, rather, the parameters are computed during
   camera calibration, so caching seems most fitting in that case.

Pull Request: https://projects.blender.org/blender/blender/pulls/108230
2023-06-07 14:45:46 +02:00
Brecht Van Lommel
0c2baf39c2 Cleanup: compiler warnings 2023-06-07 14:33:28 +02:00
Hans Goudey
decf089e06 Cleanup: Remove unused deprecated socket type
"SOCK_MESH" was used for a particle nodes experiment,
never in a released version of Blender as far as I know.
2023-06-07 08:31:46 -04:00
Brecht Van Lommel
65fc10bd33 Compositor: first steps to use realtime compositor for renders
* Enable "Experimental Compositors" in preferences, then choose
  Realtime GPU execution mode in node editor sidebar.
* Only supports combined pass input and Render Result combined output.
* No viewer nodes, no file output nodes, and no node previews yet.

Pull Request: https://projects.blender.org/blender/blender/pulls/108629
2023-06-07 14:17:48 +02:00
Brecht Van Lommel
db43a8fb57 Refactor: realtime compositer context changes for render compositing
* Provide render data, node tree and color management directly instead
  of going through scene, as these may be modified by the render pipeline.
  Also better for cached texture hits this way.
* Change legacy pass type to pass name.
* Skip file output node when not doing final render.
* Gracefully handle incomplete render results.

Pull Request: https://projects.blender.org/blender/blender/pulls/108629
2023-06-07 14:17:37 +02:00
Campbell Barton
6704881708 Cleanup: spelling in comments 2023-06-07 21:47:45 +10:00
Alaska
7285f13163 Cycles: Fix Principled BSDF tooltip for MultiGGX
In a recent commit the MultiGGX code was changed, and along with it
the tool tip for MutliGGX. This commit fixes the issue where the
tooltip was not updated for the MultiGGX option in the Principled BSDF.

Pull Request: https://projects.blender.org/blender/blender/pulls/108589
2023-06-07 13:46:13 +02:00
Bastien Montagne
5399c7a79f BlendFile versioning: Fix mistake (inconsistency) in 8e059b569b.
File version was bumped to (400, 5), but new doversion check was done
against (400, 4).
2023-06-07 12:17:34 +02:00
Bastien Montagne
ace8875014 Merge branch 'blender-v3.6-release' 2023-06-07 11:46:20 +02:00
Bastien Montagne
7ceb33e06e I18N: Revert part of d95486af95 removing check for main thread.
Part of the checks to see if translating a UI string is allowed or not
is that current thread is the main one. This was a requirement years ago
of the Boost backend for translations.

Not sure whether this can be removed or not now, but it needs to be
carefully checked, done it as its own commit, and not in a beta release
branch. ;)

Sorry for the noise, totally missed this during the patch review
yesterday.
2023-06-07 11:31:34 +02:00
Philipp Oeser
288460aded Merge branch 'blender-v3.6-release' 2023-06-07 11:21:49 +02:00
Philipp Oeser
c51467cd4c Fix #108096: UI: copy-paste buttons can change source properties
Pasting numerical array buttons happens with `Ctrl + Alt + V`.
Holding `Alt` also triggers uiSelectContext, so having other nodes/
objects etc. selected while doing this would try to copy the pasted
values back to other objects (possibly to the ones you pasted from) and
that happens relative to the original value, so the value actually
changes.

NOTE: the `Ctrl + Alt + V` shortcut can also be used on non-array buttons, so was an issue for them as well.

To prevent the "copy-to-selected" behavior, refine the `IS_ALLSELECT_EVENT` macro to be more specific.

Pull Request: https://projects.blender.org/blender/blender/pulls/108270
2023-06-07 11:19:05 +02:00
Campbell Barton
96bfcd0597 Cleanup: rename __SOCK_MESH to SOCK_MESH_DEPRECATED
Double underscores didn't communicate that this was deprecated,
and are typically for internal or platform defined identifiers and
shouldn't be used for public API's.
2023-06-07 17:53:08 +10:00
Jeroen Bakker
b7963d247c Vulkan: Low Precision Float Conversion
This PR adds conversion template to convert between Low Precision float
formats. These include Binary32 floats and lower. It also adds support
to convert between unsigned and signed float formats and float formats
with different mantissa and exponents.

Additionally overflows (values that don't fit in the target float
format) will be clamped to the maximum value.

**Reasoning**:
Up to now the Vulkan backend only supported float and half float
formats, but to support workbench, 11 and 10 unsigned floats have to be
supported as well. The available libraries that support those float
formats targets scientific applications. Where the final code couldn't
be optimized that well by the compiler.

Data conversion for color pixels have different requirements about
clamping and sign, what could eliminate some clamping code in other
areas in Blender as well. Also could fix some undesired overflow when
using pixels with high intensity that didn't fit in the texture format
leading to known artifects in Eevee and slow-down in the image editor.

**Future**
In the future we might want to move this to the public part of the GPU
module so we can use this as well in other areas (Metal backend), Imbuf clamping
See 3c658d2c2e69e9cf97dfaa7a3c164262aefb9e76 for a commit that uses
this and improves image editor massively as it doesn't need to reiterate over
the image buffer to clamp the values into a known range.

Pull Request: https://projects.blender.org/blender/blender/pulls/108168
2023-06-07 07:50:04 +02:00
Jeroen Bakker
934111caf6 Eevee-next: Fix Background When Not On Origin
Backgrounds in Eevee-next were different compared to Eevee-legacy.
Only when viewed from the world origin the background matched.

This change will make sure that the results of both engines matches.

Pull Request: https://projects.blender.org/blender/blender/pulls/108509
2023-06-07 07:48:01 +02:00
Campbell Barton
1251b7c400 Text: always use TEXT_OT_jump_to_file_at_point for jumping to source
Now the operator is used for both the internal & external editor,
so there is no need for the caller to call this operator only when
the preferences are set.
2023-06-07 15:28:09 +10:00
YimingWu
0a891184fa Fix #107789: Prevent area maximizing when dragging
Calling screen maximize while dragging could lead to UI layout change
which affects context, this lead to crashes in the icon drawing and
selection code. This patch prevents maximize operator from running if
dragging is in progress.

Might need to look into why `drag->imb->rect` is None immediately after
calling maximize, we might want it to work since it's sometimes
more convenient to drag then put into a big recieving box. But since
`wmDropBox` is predetermined, this can be a somewhat problematic.

Pull Request: https://projects.blender.org/blender/blender/pulls/107803
2023-06-07 06:21:01 +02:00
guishe
e16ec95a16 UI: Add a custom text editor preference
Add a user preference to set up a custom text editor for editing text
files with the "Edit Source" action in the UI context menu.

- An operator TEXT_OT_jump_to_file_at_point has been added.
- A custom editor can be set in the user preferences.
- A preset has been included for "Visual Studio Code".
- When the editor is not set, use Blender's internal editor.

Ref !108299.
2023-06-07 14:09:19 +10:00
Campbell Barton
3b634d6f7f Merge branch 'blender-v3.6-release' 2023-06-07 13:40:32 +10:00
Campbell Barton
51c15ec933 Merge branch 'blender-v3.6-release' 2023-06-07 13:39:36 +10:00
Campbell Barton
c0bfb81e04 Fix material paste setting the nodetree's owner_id to null
Resolves assert in debug builds when changing the material color
after pasting.
2023-06-07 13:32:27 +10:00
Campbell Barton
64ead920a1 Fix #108495: Pasting a material crashes
References to data-blocks in a material were stored in-memory and could
crash if the data-blocks referenced by the material no longer existed
when pasting.

Resolve by using a blend-file for material copy/paste, matching how the
clipboard works in the 3D view-port.

Currently there is no support for including indirectly linked
data-blocks when pasting the material. Instead, data-blocks are restored
by name, by inspecting the current file.

This also fixes a crash where the `SpaceNode::nodetree` could point to
freed memory when pasting a material.

Ref !108496.

Includes contributions by @mont29.

---

Fix back-ported to main [0], including fix [1].

[0]: 5177e2f20b
[1]: 64aa96d421
2023-06-07 13:22:07 +10:00
guishe
fb348137d5 Cleanup: Move IO files to C++
Changes:
1. `UNUSED` AND `UNUSED_VARS`   ->   `/*arg*/`
2. `NULL` -> `nullptr`
3. `Function style cast` for `enums` values
4. `void *` -> `static_cast<T*>`
5. Use standard includes `#include <file.h>` ->`#include <cfile>`
6. Replace designated initializers with member assignment
7. `typdef struct N{...} N; ` -> `struct N{...}`

See: #103343

Pull Request: https://projects.blender.org/blender/blender/pulls/108477
2023-06-07 00:52:34 +02:00
guishe
7dc85e68fe Cleanup: Fix comment warning
When compiling on Ubuntu this comment could generate
thousands of warning lines, the comment is fixed now.

Introduced by 8e059b569b

Pull Request: https://projects.blender.org/blender/blender/pulls/108676
2023-06-06 21:59:09 +02:00
Germano Cavalcante
cf967f8e08 Transform: Remove Indication of the Transformed Snap Base
This commit removes the transformed `Snap Base` symbol (white target)
and displays only the untransformed `Snap Base` symbol (X) when
confirming the Snap Base Edit operation.

The usefulness of the white target icon representing the transformed
`Snap Base` is debatable since it represents the snap target itself
(orange circle) during the Move operation or the direction between the
pivot and the snap target during the Rotation operation.

Having multiple symbols on the screen can clutter the interface and may
not be intuitive.

Therefore, further discussion is required.

Ref.
#108669
2023-06-06 15:42:22 -03:00
Germano Cavalcante
8e059b569b UI: move 'Face Nearest' snap option to another section
The snap mode called "Face Nearest" (and the "Increment" but that's for
another time) doesn't behave like the other snap modes.

Unlike the other snap modes, "Face Nearest" does not act on a Snap
Base (or Snap Source).

It always acts on the origin of individually transformed elements, (such
as each vertex individually).

It works just like the "Project Individual Elements" option.

So this commit makes the following changes:
- `Snap With` was moved to the beginning of the popover
- `Align Rotation to Target` and `Backface Culling` have been moved closer to the snap targets
- `Snap With`, `Target Selection` and `Align Rotation to Target` are no longer hidden by varying the mode and options
- `Project Individual Elements` has been replaced with the `Face Project` option
- `Face Nearest` has been moved to stick together with the `Face Project` option

Co-authored-by: Germano Cavalcante <germano.costa@ig.com.br>
Pull Request: https://projects.blender.org/blender/blender/pulls/108555
2023-06-06 19:35:57 +02:00
Iliya Katueshenock
8dc70b9e2e Cleanup: Correcting default cases in node.cc
Add all other enum items to switch statements instead of using default.

Pull Request: https://projects.blender.org/blender/blender/pulls/107339
2023-06-06 19:19:53 +02:00
Almaz Shinbay
c5ddf63a4a Outliner: Port metaball elements to new tree-element code design
No user visible changes expected.

Part of #96713, continuation of work started in 249e4df110 and 2e221de4ce.
Refer to these for a motivation and design overview.

Adds a new tree-element class for metaball IDs.

Pull Request: https://projects.blender.org/blender/blender/pulls/108654
2023-06-06 19:01:11 +02:00
Clément Foucault
3ecb301a20 Metal: Remove empty lines in log messages
There produce unneeded empty lines in the
console. They are just relic from the time
these message were using printf.

Also remove some redundant informations in
the messages themselves.
2023-06-06 18:59:05 +02:00
Chao Li
a56df90931 Fix #108198: Particle hair crash when using Hair Dynamics
`hair_out_mesh` and `hair_in_mesh` implicitly share edges.
In `hair_create_input_mesh()`, edge data of `hair_in_mesh` needs to be
updated and therefore are copied to a new location. In the subsequent
frames, `psys->clmd->clothObject->edges` won't be updated and point to
freed memory block. Therefore, Blender crashes.
By freeing `hair_out_mesh` first,
1. in `hair_create_input_mesh(),` at least edge data copying is avoided
2. `psys->clmd->clothObject->edges` always points to correct memory

However, since it's possible that similar situation will happen again
by adding another strong user to the same `CustomData` in the future,
it is safer to update `psys->clmd->clothObject->edges` for every frame.

Pull Request: https://projects.blender.org/blender/blender/pulls/108480
2023-06-06 18:46:35 +02:00
Clément Foucault
79ec23b25f Metal: Use CLOG macros with working log level
This avoid flooding the console with infos that are
generally not important.
2023-06-06 18:45:53 +02:00
Hans Goudey
708dfbb91b Fix: Compile error in main after recent fmt usage
In the 3.6 branch we use `FMT_HEADER_ONLY`,
but that was changed in main by 0d38fa2422.
2023-06-06 12:43:38 -04:00
Hans Goudey
c7a804fe9e Merge branch 'blender-v3.6-release' 2023-06-06 12:27:46 -04:00
Hans Goudey
d9dfa782eb Fix: Remove non-threadsafe BMesh assertions in Mesh conversion
Currently this macro modifies faces. It needs to take a const pointer
to the element so it can be run on the same face from multiple threads.
2023-06-06 12:12:26 -04:00
Jason Fielder
3db231189d Metal: Remove command buffer error file
This file isn't useful anymore with all the other debug tools.

Authored by Apple: Michael Parkin-White

Pull Request: https://projects.blender.org/blender/blender/pulls/108268
2023-06-06 18:08:27 +02:00
Jason Fielder
a29f6c854d GPU: Move texture attachment usage flag into Metal backend
This is a backend related workaround and doesn't belong to
the GPU layer.

Authored by Apple: Michael Parkin-White

Pull Request: https://projects.blender.org/blender/blender/pulls/108151
2023-06-06 18:01:26 +02:00
Bastien Montagne
6c7354a69a Merge branch 'blender-v3.6-release' 2023-06-06 17:38:42 +02:00