Commit Graph

101972 Commits

Author SHA1 Message Date
Michael Kowalski
ccbb185d39 USD import: improve unsupported type warning.
Now including the USD type name in the warning for
unsupported attribute types.
2023-08-14 15:51:00 -04:00
Michael Kowalski
9a084d7c69 USD import: remove unused variable.
Removed unused USDMeshReader::has_uvs_ member.
This fixes Mac build warnings.
2023-08-14 14:51:17 -04:00
Michael Kowalski
4e41acc0d3 Fix #110950: USD import: Crash calling import_asset().
Fixed logic error causing BLI_path_abs() to be called with
null basepath.

Pull Request: https://projects.blender.org/blender/blender/pulls/111119
2023-08-14 19:56:22 +02:00
Bastien Montagne
e2a5846d56 Fix (unreported) improper handling of camera's baground image IDs in foreach_id callback.
`foreach_id` callbacks should not decide whether a given ID pointers
should be processed or not (unless maybe some extremely specific cases).

Even if an ID pointer is not currently 'used', it still needs to
increment its ID user count, be remapped to a new pointer, etc. etc.
2023-08-14 18:17:13 +02:00
Falk David
2661747138 Cleanup: GPv3: Move inline Drawing methods
Moves the `blender::bke::greasepencil::Drawing` methods into the
`namespace blender::bke::greasepencil`.
2023-08-14 17:47:12 +02:00
Falk David
ba574097b8 GPv3: Python: Rename groups to layer_groups
The term `groups` is a bit too ambigous and inconsistent with the rest
of the UI.
2023-08-14 17:47:12 +02:00
Falk David
310ccbdc33 GPv3: Initial outliner support
This PR adds support for displaying the content of the GPv3 object in the outliner.

* Displays the grease pencil data, layers and layer groups.
* Data and layer groups have the total layer count displayed next to them. Layer groups also have hierarchy lines.
* Active layer is highlighted and can be changed by clicking on a layer.
* The visibility of layers and layer groups can be toggled by clicking the eye icon.

Note: The icon for layer groups is temporary.

Pull Request: https://projects.blender.org/blender/blender/pulls/111105
2023-08-14 17:40:18 +02:00
Bastien Montagne
7ddea7e90a Cleanup/Fix: Move 'security' check on constraints 'data' into 'read_data' code.
Having this check is likely no more meaningful (it seems to have been
added ages ago), but keeping it around does not hurt either. And it
could avoid crashes in some file corruption cases e.g.

However, having it in 'lib_link' code of constraints is useless for
sure, since that data pointer may have already been accessed in the
'read_data' one. And of course, logically it belongs to 'read_data'
anyway, since it's related (and only affects) private local data, not
pointers to other IDs...

No behavioral change expected here.
2023-08-14 17:28:08 +02:00
Julian Eisel
5c2c95f80d Outliner: Reword warnings when element renaming is not possible
- Avoid the term "cannot", since that sounds like Blender is unable to
  perform the renaming.
- Sequencer names can be modified, just not from the Outliner. Note that
  in the warning.
- Don't use the term "please". We don't add this usually as it's
  unnecessary and can come across demanding.
- The term "master collection" is not used in the UI, should be "scene
  collection". But the warning didn't add much info, so simply give it
  the same generic warning like other such grouping items.
2023-08-14 17:22:05 +02:00
Julian Eisel
99a0ddd4a1 Outliner: Show same warning for all fixed name tree element types
Attempting to rename certain tree elements that have a non-editable
name would display a warning message in some cases, and nothing in
others. The distinction didn't really make sense, it was arbitrary.
Show the same warning for all such cases.
2023-08-14 17:09:38 +02:00
Almaz-Shinbay
e628b5ffe5 Cleanup: remove unnecessary constraint code in pose base expand()
Removes unnecessary lines, which are handled already by `TreeElementConstraintBase` and `TreeElementConstraint` constructors (see 02969de155), in `TreeElementPoseBase::expand()`.

Pull Request: https://projects.blender.org/blender/blender/pulls/111118
2023-08-14 17:07:00 +02:00
Guillermo
391c2ea21c Fix #109081: Ensure NLA swap strips do not overlap each other.
When swapping strips, if the strips overlapped after the swap, one
of them would get deleted.  We now check if they would overlap
ahead of time, and simply abort the swap instead.

Pull Request: https://projects.blender.org/blender/blender/pulls/109980
2023-08-14 17:06:26 +02:00
Bastien Montagne
695995d7cb Refactor: Move 'local data' liboverride flag clearing from 'lib_link' to 'read_data' code.
There is no reason to do that in the 'lib_link' stage of blendfile
reading, whether the owner ID is linked or local is already known info
at the 'read_data' stage of the process. And it is more logical to do
that in code affecting internal private data of an ID, rather than in
code handling updates of it ID pointers.

Note that the camera's baground image case was already handled in the
'read_data' stage.

No behavioral change expected here.
2023-08-14 16:45:18 +02:00
Bastien Montagne
6a79a6a24a Cleanup/Refactor: Move animdata read/write code into generic ID handling.
There is no reason at all for each ID read/write callbacks to have to
deal with this generic, common data explicitely. Generic ID read/write
code is the place to handle such data (just like asset, liboverride,
etc. data are handled already).

Note behavioral change expected here.
2023-08-14 16:30:53 +02:00
Jason Fielder
ca527efb9f Metal: Ensure MTLBatch uses context bound shader
Previously the shader associated with a batch was
assigned separately. This meant on occasion, the
incorrect shader was used with the Metal backend.
Updating the shader fetch to use the context bound
shader instead of the batch shader member as per
OpenGL/Vulkan backends.
Also include state change check to be consistent
with OpenGL.

Authored by Apple: Michael Parkin-White

Co-authored-by: Michael Parkin-White <mparkinwhite@apple.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/111112
2023-08-14 15:56:12 +02:00
Philipp Oeser
cf43477839 Fix #111067: NLA tracks cannot be renamed from Outliner
Outliner `do_item_rename` has checks so linked or overridden IDs cannot
be renamed.

A `TreeStoreElem`s ID can point to other data than "real" IDs though
(see how `outliner_add_element` casts to an ID from an arbitrary void
pointer and cases marked `/* NO ID */` in code). In those cases,
`ID_IS_LINKED` or `ID_IS_OVERRIDE_LIBRARY` _could_ return true and a the
renaming operation would fail.

Now also check if this is a real ID (`TSE_IS_REAL_ID`), so code can
continue.

Also add a proper notifier, so track renaming from the Outliner will
update the NLA immediately.

Pull Request: https://projects.blender.org/blender/blender/pulls/111110
2023-08-14 15:27:18 +02:00
Almaz-Shinbay
02969de155 Outliner: Port constraint 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 new classes for constraint elements.

Pull Request: https://projects.blender.org/blender/blender/pulls/111108
2023-08-14 14:56:18 +02:00
Philipp Oeser
4cefe0ec80 Fix #110723: cant drop object name on object field/socket in node editor
Reason was a difference in poll functions (dropbox poll function vs.
operator poll function).

So the dropbox was actually recognized as being active (see
`dropbox_active`) but then when actually dropping, the corresponding
operator wasnt called (but instead another operator was).

In detail, the way `wm_handlers_do_intern` works, it checks all
dropboxes poll function if one succeeds it calls the dropbox operator.
But if that operators poll function fails, `wm_handlers_do_intern`
happily continues and "ends" the drop operations in a way we dont
actually get to the "real" dropbox & operator that was also recognized
as being active.

In the case of the report:
- dropbox for `UI_OT_drop_name` is active
- dropbox poll for `NODE_OT_add_object` (`node_object_drop_poll`)
succeeds though
- operator poll for `NODE_OT_add_object` (`node_add_object_poll`) fails
(it checks `UI_but_active_drop_name` already)

So in order to make this work, add the check for `UI_but_active_drop_name` to two dropbox poll
functions (and remove from the operator polls).

Probably good for LTS as well.

Pull Request: https://projects.blender.org/blender/blender/pulls/110929
2023-08-14 13:12:33 +02:00
Almaz-Shinbay
485c98cc2c Outliner: Port pose base 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 class for pose base elements.

Pull Request: https://projects.blender.org/blender/blender/pulls/110806
2023-08-14 12:36:06 +02:00
Jeroen Bakker
e878692221 Cleanup: code formatting 2023-08-14 12:33:13 +02:00
Julian Eisel
5dcf704324 Refactor: Solve invalid icon-id enum values, use type alias
Some code attempted to use `BIFIconID` instead of `int` to pass around
icon-ids. Problem is, that this is just a subset of the allowed ids,
more icons may be created at runtime and extend the range of valid
icon-ids. Such icons could give runtime warning prints.

Idea is to use a `using BIFIconID = int;` instead. This way there is
still a descriptive type name, while the whole dynamic range of possible
icon-ids is supported.

Additionally multiple `using BIFIconID = int;` declarations are valid,
so we can place these in multiple headers and use the type name in APIs
instead of just `int`, whithout having to include a single header
defining them. A type mismatch (one instance differs from the others)
will result in a compiler error.

Pull Request: https://projects.blender.org/blender/blender/pulls/111052
2023-08-14 12:06:35 +02:00
Johannes J
769fe07668 GPU: Fix signed/unsigned mismatches in shader code
This fixes a crash when switching to face selection mode in the UV
editor.

Pull Request: https://projects.blender.org/blender/blender/pulls/111094
2023-08-14 11:22:03 +02:00
Sergey Sharybin
9094a3a9ab Refactor: Make display_init a base render method
Should be no functional changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/111047
2023-08-14 11:18:28 +02:00
Sergey Sharybin
f604235206 Refactor: Make display_clear a base render method
Should be no functional changes.
2023-08-14 11:18:24 +02:00
Sergey Sharybin
ace2f6a183 Refactor: Make display_update a base render method
Should be no functional changes.
2023-08-14 11:18:24 +02:00
Sergey Sharybin
964b83aa8b Refactor: Make current_scene_update a base render method
Should be no functional changes.
2023-08-14 11:18:24 +02:00
Sergey Sharybin
0193c5029b Refactor: Make stats_draw a base render method
Should be no functional changes.
2023-08-14 11:18:24 +02:00
Sergey Sharybin
ed058088b3 Refactor: Make progress a base render method
Should be no functional changes.
2023-08-14 11:18:24 +02:00
Sergey Sharybin
6df46fd2fc Refactor: Make draw_lock a base render method
Also semantically separate draw_lock and draw_unlock, as it
is more clear than a single method with a boolean argument.

Should be no functional changes.
2023-08-14 11:18:24 +02:00
Sergey Sharybin
bddc790166 Refactor: Make test_break a base render method
Should be no functional changes.
2023-08-14 11:18:24 +02:00
Sergey Sharybin
dd5ef3f91a Refactor: Make prepare_viewlayer a base render method
Should be no functional changes.
2023-08-14 11:18:24 +02:00
Sergey Sharybin
c664618e10 Cleanup: Add _cb suffix to the callbacks stored in Render
Should be no functional changes.

Preparing for introduction of member function which are
available in the base class.
2023-08-14 11:18:24 +02:00
Richard Antalik
bf001961f3 Fix #110861: VSE operators disregards locked strips
Operators slip, swap and split operated on strips that are locked.
2023-08-14 05:54:27 +02:00
Campbell Barton
cdab5d82d7 CMake: remove non-functioning logic to delete files before installing
This logic has not been working since 2014 [0] although it was briefly
fixed (by accident) when TARGETDIR_VER was made an absolute directory
[1] (since reverted as that caused problems with CPACK/WIN32).

"file(REMOVE_RECURSE ${TARGETDIR_VER})" would attempt to remove:
- "${CMAKE_BINARY_DIR}/${TARGETDIR_VER}" instead of
- "${CMAKE_INSTALL_PREFIX}/${TARGETDIR_VER}".

While this could be re-enabled by correcting the path,
it slows down the install target by copying files every "install".

This could be made to detect changes and only cleaning files in this
case however this ends up being fairly involved, see: PR !111084.

As stale files haven't been causing problems as far as I'm aware,
remove this code.

[0]: e43c5fa005
[1]: d605cc7574
2023-08-14 12:57:24 +10:00
Richard Antalik
675b66d852 Fix #110846: VSE tools region not updated with other regions
Add listener to the region.
2023-08-14 04:07:15 +02:00
Clément Foucault
d844c5a13a Metal: Add support for Multi-Viewport
This seems to work but there is an issue with fragment
shader not getting the correct value.

Authored by Apple: Michael Parkin-White
2023-08-13 23:46:53 +02:00
Clément Foucault
c7dce76619 Metal: Various fixes
Authored by Apple: Michael Parkin-White
2023-08-13 23:42:06 +02:00
Clément Foucault
743d78461f GPU: Make test compile without OpenGL 2023-08-13 23:38:07 +02:00
Bastien Montagne
29930ef589 readfile: Move Object proxy validation code from lib_link to do_version.
This is now deprecated data, no reason to keep such logic in the main
lib-linking code of Object ID.
2023-08-13 13:43:54 +02:00
Campbell Barton
282944caac CMake: revert use of CMAKE_INSTALL_PREFIX as it broke CPack on WIN32
Absolute paths aren't supported when using CPack on WIN32.
This effectively reverts [0] & [1].

[0]: 7209ed80bb
[1]: d605cc7574
2023-08-13 21:34:03 +10:00
Bastien Montagne
6cd7eda1c6 Fix (unreported) wrong handling of depreacted non-Empty instantiating objects in readfile code.
Fixing this is do-version work. Having that kind of logic in lib-linking
code is... beyond despicable.
2023-08-13 13:10:27 +02:00
Bastien Montagne
44e3995cf5 Cleanup: Simplify 'expand' main loop in readfile code.
No behavioral change expected here.
2023-08-13 11:25:24 +02:00
Campbell Barton
d605cc7574 CMake: use CMAKE_INSTALL_PREFIX in more places
Also remove quotes for consistency as they aren't needed and weren't
used in quite a few places.
2023-08-13 14:27:47 +10:00
Campbell Barton
329474f018 CMake: fix for WITH_DOC_MANPAGE failing to run Blender
Use the installed executable location instead of the build location,
this would work in situations when the build location had relevant
files accessible but this is often not the case.
2023-08-13 14:19:57 +10:00
ChengduLittleA
337c47275c Fix #110917: Multiply UI_SCALE_FAC to view scroll operators
Previously the delta value is hard coded (40), this would be too slow on
high DPI screens. Now multiply that by `UI_SCALE_FAC` will solve the
issue.

Pull Request: https://projects.blender.org/blender/blender/pulls/110940
2023-08-13 04:57:36 +02:00
Hans Goudey
9804b2244a Cleanup: Make sculpt face visibility test inline
This simple function just performed a null check and an array lookup.
Just writing it in the few places its used works fine too, and avoiding
the function call per triangle can improve and make the check clearer.

Also, avoiding the abstraction makes the "node fully visible" check
when building the PBVH more obvious; that has been refactored here.

Pull Request: https://projects.blender.org/blender/blender/pulls/111072
2023-08-12 23:58:26 +02:00
Hans Goudey
b04a72866d Revert "Multires: Simplify grids normals update and grid to face map"
This reverts commit c97178fa2e.

This was committed to main by mistake, it was meant for a local branch.
2023-08-12 16:38:39 -04:00
Hans Goudey
d38a0cf537 Fix: Potential error in RNA operator description callback
Avoid freeing the RNA list before converting the result to std::string.
2023-08-12 16:29:51 -04:00
Guillermo
0f501865a5 Fix #111073: Crash when F3 is pressed
Initializing a string whit `nullptr` causes undefined behavior.

Pull Request: https://projects.blender.org/blender/blender/pulls/111075
2023-08-12 22:21:50 +02:00
Hans Goudey
c97178fa2e Multires: Simplify grids normals update and grid to face map
The goal is to move to more data oriented design, reducing memory
usage and simplifying code by clarifying data access, avoiding
unnecessary levels of abstraction, and reusing code.

- Simplify threading with the C++ threading API
- Pass the faces to update with an IndexMask instead of a pointer array
  - IndexMask uses less memory and simplifies masking and iteration
- Store the grid to face map with indices instead of pointers
  - Now this is exactly the same as `build_loop_to_face_map`
2023-08-12 12:20:10 -04:00