Commit Graph

100224 Commits

Author SHA1 Message Date
Christoph Lendenfeld
47ce7bbecc Fix: Face loop select toggle behaviour in paint mode
As pointed out by @pablovazquez the selection behavior
of the face loop selection in paint modes was missing the toggle feature.

The logic goes like this:
If any of the 2 adjacent faces to the selected edge are selected,
deselect instead of select.

There is still an inconsistency which I left in for this patch,
but is up to discussion.
CTRL+ALT+SHIFT click does an actual deselect in paint mode.
In edit mode it does toggle as well, just as ALT+SHIFT click

I can remove that feature if it isn't wanted

Pull Request: https://projects.blender.org/blender/blender/pulls/108753
2023-06-08 14:45:18 +02:00
Hans Goudey
319b68763f Cleanup: Simplify namespaces in geometry component files 2023-06-08 08:29:15 -04:00
Hans Goudey
3503f7675c Cleanup: Remove unused forward declaration 2023-06-08 08:28:57 -04:00
Sietse Brouwer
7f218277c3 GPv3: Add "Select pick" operator
This patch implements the `VIEW3D_OT_select` operator for selecting points and curves in the new Grease Pencil v3 object.
Resolves #108660.

Pull Request: https://projects.blender.org/blender/blender/pulls/108717
2023-06-08 12:26:42 +02:00
Sietse Brouwer
3ca67a7a5d GPv3: Add "Select lasso" operator
This patch implements the `VIEW3D_OT_select_lasso` operator for lasso selecting points and curves in the new Grease Pencil v3 object.
Resolves #108663.

Pull Request: https://projects.blender.org/blender/blender/pulls/108726
2023-06-08 12:24:51 +02:00
Christoph Lendenfeld
cfcf2cc3fa Merge branch 'blender-v3.6-release' 2023-06-08 11:08:47 +02:00
Christoph Lendenfeld
2387290e4f Fix #102737: Keyframe jump operator includes hidden curves in Graph Editor
The graph editor has the function to hide the display of FCurves and to only draw keyframes on selected curves.

Both options were not respected when executing the frame jump operator,
meaning it would jump to potentially hidden keyframes.

This patch adds a new operator that is specific to the Graph Editor and that respects those features.

The only possible issue that could arise from this is a slight confusion for the user
why they behave differently between editors.
Especially with only the Graph Editor and the 3D view open.
In general I think it's an improvement and follows the "you can only modify what you see" mantra in blender

Also
Resolves #97701

Pull Request: https://projects.blender.org/blender/blender/pulls/108549
2023-06-08 11:02:19 +02:00
Philipp Oeser
40473db599 Merge branch 'blender-v3.6-release' 2023-06-08 10:38:31 +02:00
Philipp Oeser
9e598aa0ef Fix #106395: Custom properties dont appear in quick favorites
Issue here was that Quick Favorites use a property's **identifier** when
adding [which is the bare name without brackets etc. from id properties]
but when spawning the actual menu,  `RNA_struct_find_property` expects
the identifier to already include the brackets to know these are id
properties (later on in `screen_user_menu_draw`).

So to solve this, now include the needed syntax when storing the
`bUserMenuItem_Prop` identfier.
Seems the quickest way to append the needed characters is using
`RNA_path_property_py` (not sure if there are better ways to do this).
Also note that we (need to) ignore the actual array index constructing
the string [always pass -1 here] since the index is handled separately [I
tested boolean arrays and these work].

Pull Request: https://projects.blender.org/blender/blender/pulls/108713
2023-06-08 10:37:36 +02:00
Falk David
7f4f771442 GPv3: Add "Select Box" operator
This implements the `VIEW3D_OT_select_box` for the new grease pencil data-block.

Note that this also adds a `get_evaluated_grease_pencil_drawing_deformation` function, but there are TODOs left.
This will have to be updated once the modifier logic is in place.

Pull Request: https://projects.blender.org/blender/blender/pulls/108661
2023-06-08 10:20:18 +02:00
Sybren A. Stüvel
42fe8de6f9 Assets: allow copying asset data from one ID to another
Asset data can now be copied in Python via assignment to
`id.asset_data`, so for example `dest.asset_data = source.asset_data`.
This copies the description, license, author, etc. fields, as well as
the tags and the asset catalog assignment.

This is intended to be used in the pose library, when updating a pose by
simply creating a new asset and having that replace the old one.

This is intentionally taking a copy, even though the above use case
could have sufficed with a higher-level 'move' function. By exposing
this as a copy, it can be used in a wider range of situations, from
whatever Python code wants to use it. This could include copying the
asset data from the active asset to all the other selected ones.

Any pre-existing asset data is freed before the copy is assigned. The
target ID MUST be marked as asset already for the assignment to work.
Assigning `None` to clear the asset status is not allowed. Instead
`.asset_mark()` resp. `.asset_clear()` should be used. This limitation
is in place to simplify the API, and to ensure that there is only one
way in which assets are marked/cleared, making it easier to change the
internals of the asset system without API changes.

Example code:

```python
src = bpy.data.objects['Suzanne']
dst = bpy.data.objects['Cube']

dst.asset_mark()
dst.asset_data = src.asset_data
```

Pull Request: https://projects.blender.org/blender/blender/pulls/108547
2023-06-08 10:11:41 +02:00
Jeroen Bakker
b6f8b50dd9 Fix using incorrect struct when unbinding images. 2023-06-08 09:49:50 +02:00
Jeroen Bakker
4faee0b26e Vulkan: Set Debug Name For Descriptor Layout
This makes tracking shaders easier across the pipeline. Durring logging
and debugging the vulkan driver now remembers the shader associate to
the descriptor and provides this information in its messages.

Pull Request: https://projects.blender.org/blender/blender/pulls/108743
2023-06-08 09:47:17 +02:00
Jeroen Bakker
db4cd61001 Vulkan: Unbind Uniform Buffers When Destroyed
When Uniform buffers are destroyed they need to be removed from the
state manager. Otherwise Vulkan points to unallocated memory and leads
to artifacts.

Pull Request: https://projects.blender.org/blender/blender/pulls/108742
2023-06-08 09:46:00 +02:00
Jeroen Bakker
8f988206de Vulkan: UBYTE to SRGBA8 Texture Format
Adds support to create SRGBA8 textures using UBYTE as input data.
It is assumed that the UBYTE are already converted to SRGB and no
conversion actually needs to happen.

Pull Request: https://projects.blender.org/blender/blender/pulls/108741
2023-06-08 09:44:51 +02:00
Jeroen Bakker
0a0a451b4d Vulkan: Fix Unbinding All Images
When unbinding all images, all textures where unbound. This was
incorrect. This PR fixes this.

Pull Request: https://projects.blender.org/blender/blender/pulls/108740
2023-06-08 09:42:39 +02:00
Xavier Hallade
398b8428dd Merge branch 'blender-v3.6-release' 2023-06-08 09:22:18 +02:00
Jeroen Bakker
c71d198dfd Vulkan: Mipmap Generation
Implement Mipmap generation for the Vulkan backend.
This patch implements `GPU_texture_update_mipmap_chain`.

Pull Request: https://projects.blender.org/blender/blender/pulls/108699
2023-06-08 09:15:07 +02:00
Jeroen Bakker
2231b819a5 Vulkan: Workaround for 24bit depth component
Some vulkan platforms don't support 24bit depth components. In this
case we will allocate float depth component. During readback the data
should be converted back to what is expected.

Pull Request: https://projects.blender.org/blender/blender/pulls/108698
2023-06-08 08:53:12 +02:00
Habib Gahbiche
2ac3e55422 Fix #107265 Compositor: Fileoutput Node does not export Z-Depth in 'singlepass' EXR
Remove the option z-buffer from file output node, because it never worked. Changes to manual are here: https://projects.blender.org/blender/blender-manual/pulls/104458

Pull Request: https://projects.blender.org/blender/blender/pulls/108387
2023-06-08 08:14:14 +02:00
Campbell Barton
f9e0f873bd Cleanup: move text editor files to C++
A workaround for over 128 else-if's in a row was needed for MSVC
as it caused error C1061.
2023-06-08 16:04:00 +10:00
Chris Blackbourn
55f9abfd3c Merge branch 'blender-v3.6-release' 2023-06-08 14:26:21 +12:00
Chris Blackbourn
9d25c4aaa6 Fix #104513: UV packing produces different results on x86 vs apple silicon
During uv unwrapping and uv packing, certain floating point algorithms
have extreme sensitivity to round-off errors. These can produce very
different layouts even when given inputs which are only slightly different.

The root cause is that the two main types of CPUs used to run Blender,
namely x86 and Apple Silicon, produce slightly different results on some
math functions, including `sinf()`, `cosf()` and `atan2f()`.

* sinf(0.8960554599761962890625) = 0.780868828296661376953125 (Intel i7)
* sinf(0.8960554599761962890625) = 0.78086888790130615234375 (Apple M1)

This fix, and others that came before it [0], improve accuracy by using
double-precision to hide the differences between the CPUs.

[0] e.g. 0eba9e41bf
[1] See also #107829
2023-06-08 14:23:44 +12:00
YimingWu
116cbcbc86 Fix #108229: Wider tolerance shuffling NLA strips
In `transdata_get_time_shuffle_offset_side`, the tolerance for
terminating the loop is too tight, sometimes it will lead to a infinite
loop due to non-integral start/end values. Now fixed.

Pull Request: https://projects.blender.org/blender/blender/pulls/108257
2023-06-08 04:15:45 +02:00
Chris Blackbourn
c9988ffc6a Cleanup: format 2023-06-08 13:19:08 +12:00
Lukas Stockner
a89aa0c731 Merge branch 'blender-v3.6-release'
Slightly messed-up history due to a push conflict on
blender-v3.6-release, sorry about that.
2023-06-08 03:14:49 +02:00
Chris Blackbourn
e08dde04c1 Fix: Invalid UV Packing on windows debug build
Uninitialized variables can produce bad results during UV packing,
including UVs that are NaN or infinite.
2023-06-08 13:05:35 +12:00
Campbell Barton
7a1e2c4d0c Cleanup: spelling in code 2023-06-08 10:43:55 +10:00
Campbell Barton
9c28eebc9a Cleanup: minor clarifications & corrections, use doxygen comments
Also replace full URL's in with #ID.
2023-06-08 10:43:55 +10:00
Campbell Barton
abca216a1d Cleanup: use C++ comments for disabling code
[0] used doxygen comment to disable code. Use '//' instead &
move the old doc-string to the newly added flag.

[0]: 7dc85e68fe
2023-06-08 10:32:00 +10:00
Campbell Barton
47189c5253 Docs: improve doc-strings for window size & startup file
Document the purpose of zero sized window & when wm_init_state is used.
Noticed when looking into #108643.
2023-06-08 10:32:00 +10:00
Campbell Barton
989b5de8e9 Cleanup: remove unused window states, add doc-strings
Note that the GHOST_TWindowState is stored in DNA & that
values shouldn't be changed.
2023-06-08 10:32:00 +10:00
Brecht Van Lommel
3ca1e828e2 Cleanp: compiler warnings 2023-06-07 20:09:30 +02:00
Brecht Van Lommel
ff7dc64234 Cleanup: remove unused USD plugin path registration
It is now in a location where USD automatically picks it up.
2023-06-07 20:06:22 +02:00
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