This PR solves a memory reserve issue when a nvec3 was followed by
a int, bool, float.
Also adds a debug_print method to the push constants for checking
the structure against data in renderdoc.
Pull Request: https://projects.blender.org/blender/blender/pulls/111109
When immediate mode is used with a temp texture the
draw command was executed after the texture was freed.
This PR ensures that the draw command is executed before
the texture is freed.
Pull Request: https://projects.blender.org/blender/blender/pulls/111111
With the introduction of metal and vulkan we use a different
GPU backend selection which broke the dialog box for unsupported
platforms.
Blender asserted and segfaulted before the dialog was being shown
to the user.
This patch solves this by introducing a dummy GPU backend in case no
GPU backend was supported by OpenGL, Metal and Vulkan Backend.
It also adds the showMessageBox to GHOST_SystemCocoa.
Related to #110335
Pull Request: https://projects.blender.org/blender/blender/pulls/110919
In the commonly used cycles headers, it's enough to include
much smaller <iosfwd> than the full <iostream>. While looking at it,
removed inclusion of some other headers from commonly used headers,
that seemed to not be needed.
Pull Request: https://projects.blender.org/blender/blender/pulls/111063
Changes to internal private data of an ID has _nothing_ to do into its
'lib_link' reading code (unless in the extremely rare case where it
would have hard dependency on its ID having valid ID pointers).
In that case, `BKE_paint_runtime_init` was already called in
`BKE_paint_blend_read_data` anyway, so the only actual change was
setting `p->paint_cursor`... *sigh*
On my system this gives between 30-40x speedup, generating the credits
now takes about 36 seconds.
Move the is_credit_commit_valid check inside the process_commit method
to avoid bottle necking on a single process.
`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.
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
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.
- 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.
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.
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
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
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.
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.
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
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
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
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
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
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
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.
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]: e43c5fa005c941aa773f35fb6b8398afe37b25e9
[1]: d605cc7574d8b8dde5cbeb7cec419ae62686e579