The problem was introduced in 636f3697ee
MacOS has a different way of handling the title.
In this OS the directory is searched and taken from the title string
which is then formatted.
This limits the title format and makes it prone to errors.
This commit makes the code more generic by splitting each component of
the title beforehand and allowing the associated directory to be informed
with `GHOST_SetTitle`.
Disambiguate:
- Rename "Near" to "Proximity" as a particle event type, because using
an adjective in this context is inconsistent and sounds
strange (even in English IMO).
Extract:
- "Skip" (Geometry nodes Simulation node output socket)
- "Bake" (Directory path to geometry nodes bake files in the modifier
UI)
- " (Recovered)" (File information in title bar)
Pull Request: https://projects.blender.org/blender/blender/pulls/112974
It's possible for there to be no outputs under Wayland
(when unplugging monitors for e.g.) so this must be accounted for.
Also avoid calculating the window position when the GHOST backend
doesn't support window positions (which is the case for Wayland).
Add checks for the SDL backend too, where accessing the
screen & desktop size may fail.
The default theme of blender has no `icon_border_intensity` and
therefore only loads the regular icons. When newly loaded theme has the
`icon_border_intensity` set it needs to reload the icon textures so both
icon maps would be loaded.
Without reloading the icons a GPU texture is missing and would crash
blender at first use. Starting Blender the second time it would load the
correct icons and would work as expected.
Pull Request: https://projects.blender.org/blender/blender/pulls/113016
When the destination path isn't writable - the save callbacks wouldn't
run. Supporting this can be useful so handlers can unlock a file
before saving, see #88493.
Search menu (F3) displays character which was pressed to open a context
specific search. This also breaks the old behavior of showing last searched
operator in text field, instead shows the pressed character.
To fix this, first store the `g_search_text/but->poin` string in
temp_buffer (before pressed key char is copied to `g_search_text`).
Later, restore the g_search_text after invoking the search menu.
Pull Request: https://projects.blender.org/blender/blender/pulls/112938
It was already called that way in the UI, since it's referring to a
behavior, not a type. Update the code to match that. Note that this is
a BPY compatibility breaking change for 4.0.
In preparation of https://projects.blender.org/blender/blender/pulls/112535, we need to make sure all layer tree manipulations are in functions on the `GreasePencil` struct so we can keep the `CustomData` for layers in sync with the layer tree.
This PR makes sure that all the functions that change the layer tree in any way are `protected` on the `LayerGroup` class. The `GreasePencil` struct is declared `friend` with `LayerGroup`.
We also cleanup and remove a lot of code duplication between layers and layer groups and try to write functions in a generic way for `TreeNode` (both layers and layer groups are tree nodes).
Pull Request: https://projects.blender.org/blender/blender/pulls/112837
The goal is to make the search faster to use by dynamically adapting to the user.
This can be achieved using the simple but common approach of showing recently
selected items at the top. Note, that the "matching score" between the query and
each search item still has precedence when determining the order. So the last used
item is only at the top, if there is no other search item that matches the query better.
Besides making the search generally faster to use, my hope is that this can also
reduce the need for manually weighting search items in some places. This is
because while the ordering might not be perfect the first time, it will always be
once the user selected the element that should be at the top once.
This patch includes:
* Support for taking recent searches into account in string searching.
* Keep track of a global list of recent searches.
* Store recent searches on disk similar to recently opened files.
* A new setting in the user preferences that allows disabling the functionality.
This can be used if deterministic key strokes are required, e.g. for automated tests.
In the future this could be improved in different ways:
* Add some kind of separator in the search list to indicate which elements are at
the top because they have been used recently.
* Store the recent search items per search, instead of in a global list. This way
it could adapt to the user even better.
Pull Request: https://projects.blender.org/blender/blender/pulls/110828
The operator uses the relatively new "GEOMETRY_OT" prefix,
which wasn't handled in the function that finds a keymap for an
operator. To support this, choose the 3D View keymap depending
on the current mode for the geometry object types.
`Restore item` button is not resetting `active` property when keyitem is registered
as `inctive` by default. To fix this, clear `inactive` flag then use default keyitem's
flag to correctly restore the keyitem.
Pull Request: https://projects.blender.org/blender/blender/pulls/112497
This reverts commit cabf935afb.
After more investigation I have realized, that this change introduces
another regression and more importantly it is not suited for RCS keymap.
Use Select Box tool by default.
After 618f39fca2 box select operator is not run with tweak tool. This
is regression for sequencer, but the new behavior is consistent with
other editors.
There's no need to use the asset handle type here anymore, it can just
use the asset representation type that is supposed to replace it.
Part of #102877 and #108806.
Previously BPY_python_end wasn't called when scripts called sys.exit()
because BPY_python_end exited the Python interpreter.
Change this behavior to call BPY_python_end without exiting the Python
interpreter while freeing Blender/Python data.
While leaks in the context of sys.exit aren't especially important
it's generally preferable for sys.exit() to match Blender's code-paths
for exiting to avoid unexpected behavior.
- rna_Event_unicode_length would return -1 if utf8_buf wasn't a valid
unicode sequence, while this shouldn't happen, assert and return zero
instead of returning a bad length.
- Move comment on wmEvent::utf8_buf null termination to a doc-string.
There were enough cases of callers ignoring a potential the error value,
using the column width for e.g. to calculate pixel sizes, or the size in
bytes to calculate buffer offsets.
Since text fields & labels can include characters that return an error
from BLI_str_utf8_as_unicode, add the suffix to make this explicit.
Since [0] modal transform in the 3D viewport caused key-maps to be
rebuilt by the event system. Creating a temporary copy for
ViewOpsData_Utility flagged the key-map as outdated.
This could crash (resolved by [1] - for the most-part), but would still
rebuild the whole key-map, adding unnecessary overhead.
This would also reset the KMI_EXPANDED flag, causing transform
to hide key-map items when using Blender with the key-map editor open.
Add a function to temporarily suppress key-map updates.
While not ideal, full support for temporary key-maps that behave
differently to user key-maps is a bigger project for something
that's only needed in one place.
[0]: 017d4912b2
[1]: 9a0eaa2062
Display the modal keymap in the status bar for modal operators that
are called within macros. Most notably, the keymap for the transform
operator is displayed when it's called as part of the duplicate,
extrude, or loopcut operators or when moving nodes.
Pull Request: https://projects.blender.org/blender/blender/pulls/108027
The check for control characters didn't account for delete (127).
This wasn't noticeable in most cases as delete is mapped to delete text.
Pressing Shift-Delete would enter 127 control character in the
text-editor, 3D text & Python console. This happened X11 & Wayland,
I didn't check other platforms.
See #101778
Remove the requirement of restarting Blender to refresh the
extended 3D view menus for node group changes. Also avoid
rebuilding the tree of relevant assets and catalogs on every
redraw, since parsing asset libraries, etc. could become more
expensive than we want. Those two goals combined mean we
have to be more rigorous in how we invalidate the cached
catalog tree.
The first main change required is to clear the tree as asset libraries
are being read, similar to other dynamic asset menus. This is done
with a 3D view header listener rather than a menu listener in this case.
However, that isn't enough, because there is an issue with the asset
system where the "all" library isn't updated when the current file library
changes. The solution is to explicitly rebuild the "all" library's catalogs
when other asset libraries are changed.
The other necessity for dynamic updates is clearing the catalog tree
to be rebuilt when the node group "asset traits" are changed. This is
done with a new notifier type (with the goal of being a bit selective
about when we re-read assets). This _also_ requires running the
"presave" callback that builds asset metadata when updating the
property. Otherwise saving the file and sending the notifier is
necessary, which is too confusing.
Pull Request: https://projects.blender.org/blender/blender/pulls/112166
In this case it didn't cause any problems however macros with a
BEGIN/END must always run both, not optionally run based on knowledge
of the iterator implementation cleanup requirement.
Any action that triggered the key-map to be rebuilt causes the key-map
UI to display freed data.
Recently key-map refreshing happens during transform, while this should
be resolved - it's still good to avoid a crash in this situation as it's
possible scripts perform actions that tag the key-map to be rebuilt
which is out of our control.
C++ callers must ensure the arguments are valid,
reserve validity for the RNA API for raising errors.
This is already the case for most RNA API calls that wrap BKE API's.
Ghost uses vulkan in its public headers but none of the projects that
depend on ghost had the vulkan headers in its includes nor did
bf_intern_ghost expose this vulkan dependency itself publicly yet.
bf_windowmanager also did not express its dependency on
bf_intern_ghost yet used its headers.
this change fixes both issues.
Pull Request: https://projects.blender.org/blender/blender/pulls/112259
The operator system assumes that the `ot->ui` callback means
there will always be a redo panel. This situation where there is a
callback but sometimes no inputs hasn't been encountered before.
Resolve that by changing `WM_operator_check_ui_empty` into
a `WM_operator_ui_poll` that handles this case properly, with
a new operator type callback called `ui_poll`.
See #101778, #111346
Pull Request: https://projects.blender.org/blender/blender/pulls/112251
This callback is actually never excuted when e.g. defining operators
buttons through the layout API.
A design task has also been created to keep track of this issue: #112253
The basic idea is very simple. Whenever a supported menu is open, one can just
start typing and this opens a search that contains all the (nested) menu entries.
The main downside is that this collides with accelerator keys. Those are the
underlined characters in each menu. For now, we just enable this new searching
behavior in a few selected menus: Node Add Menu, View3D Add Menu and
Modifier Add Menu.
This new functionality can be enabled for a menu by setting
`bl_options = {'SEARCH_ON_KEY_PRESS'}` to true in the menu type.
The status bar shows `Type to search...` when a menu is opened that supports search.
Pull Request: https://projects.blender.org/blender/blender/pulls/110855
There are a couple of functions that create rna pointers. For example
`RNA_main_pointer_create` and `RNA_pointer_create`. Currently, those
take an output parameter `r_ptr` as last argument. This patch changes
it so that the functions actually return a` PointerRNA` instead of using
the output parameters.
This has a few benefits:
* Output parameters should only be used when there is an actual benefit.
Otherwise, one should default to returning the value.
* It's simpler to use the API in the large majority of cases (note that this
patch reduces the number of lines of code).
* It allows the `PointerRNA` to be const on the call-site, if that is desired.
No performance regression has been measured in production files.
If one of these functions happened to be called in a hot loop where
there is a regression, the solution should be to use an inline function
there which allows the compiler to optimize it even better.
Pull Request: https://projects.blender.org/blender/blender/pulls/111976
Loading add-ons after key-maps resolves a problem where add-ons would
setup shortcuts before Blender had created the key-maps.
Making add-ons have to declare the key-maps using region & window types
matching Blender's internal values.
This PR a pitfall pointed out in #110030.
Ref !110092
Previously, BKE level preview image code was in `BKE_icons.h` and `icons.hh`.
While these types are related, I always found this quite hard to navigate since
preview image stuff was just in the middle of icon functions. Plus, people
don't expect preview image functions in icon files, the relationship is not
obvious.
Instead, use focused files that make it easy to quickly navigate them
and see what they are dealing with.
Pull Request: https://projects.blender.org/blender/blender/pulls/111709
- Use `this->` to access class methods.
- Follow style guide for class definition order.
- Avoid unnecessary namespace redefinition.
- Make data struct local to node interface file.
Generally the context store is owned by `uiBlock`. Other pointers
to the store (in `bContext` and other operator data) shouldn't change
it, so those variables are now const. One exception is the pointer in
`uiLayout`, but that has a clearly short lifetime, so that's okay.
Remove the need for `CTX_store_copy` and `CTX_store_free` by using
C++ copy constructors, unique pointers, and `std::optional`. A few types
are made non-trivial to support this.
Part 3/3 of #109135, #110272
Switch to new node group interfaces and deprecate old DNA and API.
This completes support for panels in node drawing and in node group
interface declarations in particular.
The new node group interface DNA and RNA code has been added in parts
1 and 2 (#110885, #110952) but has not be enabled yet. This commit
completes the integration by
* enabling the new RNA API
* using the new API in UI
* read/write new interfaces from blend files
* add versioning for backward compatibility
* add forward-compatible writing code to reconstruct old interfaces
All places accessing node group interface declarations should now be
using the new API. A runtime cache has been added that allows simple
linear access to socket inputs and outputs even when a panel hierarchy
is used.
Old DNA has been deprecated and should only be accessed for versioning
(inputs/outputs renamed to inputs_legacy/outputs_legacy to catch
errors). Versioning code ensures both backward and forward
compatibility of existing files.
The API for old interfaces is removed. The new API is very similar but
is defined on the `ntree.interface` instead of the `ntree` directly.
Breaking change notifications and detailed instructions for migrating
will be added.
A python test has been added for the node group API functions. This
includes new functionality such as creating panels and moving items
between different levels.
This patch does not yet contain panel representations in the modifier
UI. This has been tested in a separate branch and will be added with a
later PR (#108565).
Pull Request: https://projects.blender.org/blender/blender/pulls/111348
The logic in wm_jobs_timer made it seem as if timers might be shared
between wmJob's however this is never the case.
Replace a loop on wmJob's with a lookup & NULL check.
When a timer needs to execute during the idle time (currently 5ms), use
microsecond precision to ensure the timer isn't delayed by the idle
time.
This improves the precision of animation playback on systems that
support it
(WIN32, see note below).
In my tests FPS playback varied:
- 59.94 FPS would jitter between 58.13 & 63.11 FPS. 23.98 FPS would
- jitter between 23.68 & 24.31 FPS.
Using higher precision timers mostly resolves this issue although there
is still some jitter although it's now limited to ~0.01 FPS.
These values were measured with the FPS-Samples set to 1 to show the
real times between frames (without the values being smoothed out).
This is a continuation of a fix for #111579 which avoided the worst of
the jittering issues at higher frame rates.
It appears WIN32 doesn't support sleeping shorter than 1 millisecond via
`std::this_thread::sleep_for`, making this change have no benefit on
WIN32, from tests it also doesn't have any down sides, so avoid platform
specific logic. The WIN32 limitation is noted in code-comments. If a
method of higher precision method is available this can be investigated.
Setting the FPS to 120 caused the FPS to flicker erratically between
130 & 140 FPS.
This also impacted lower frame-rates with 23.98 playing back at 24.03
FPS on my system, 30 FPS played back at 30.13 FPS.
This problem was hidden by the FPS display rounding to an integer.
Regression in 2.5x series (worked in 2.49).
Resolve by clamping the sleep time in the main event loop so the 5ms
sleep doesn't result in sleeping when timers are scheduled to run.
There is still some visible FPS jitter that can be solved by using a
higher resolution sleep interval but that's out of scope for this fix.
This was noted in code comments and checked in Python documentation
generation but not at build time.
Since these enums are identifiers that end up included in various places
enforce the `rna_enum_*_items` convention which was noted as
the convention but not followed strictly.
Partially reverts [0], avoids having to deal with multiple prefix types.
[0]: 3ea7117ed1
The `lib_link` callback cannot always be fully replaced/removed, as in
some case it is also doing some validation checks, or data editing based
on the result of lib_linking internal ID pointers.
The callback has been renamed for that purpose, from `read_lib` to
`read_after_liblink`. It is now called after all ID pointers have been
fully lib-linked for the current ID, but still before the call to
`do_versions_after_linking`.
This change should not have any behavioral effect. Although in theory
the side-effect of this commit (to split lib linking itself, and the
validation/further processing code) into two completely separated steps
could have some effects, in practice none are expected, and tests did
not show any changes in behavior either..
Part of implementing #105134: Removal of readfile's lib_link & expand code.
The `expand` callback is 'trivial' to replace, since it is only iterating
over ID pointers and calling a callback.
The only change in behavior here is that some pointers that were not
processed previously will now be.
In practice this is not expected to have any real effect (usually
the IDs used by these pointers would have been expanded through other
usages anyway). But it may solve a few corner cases, undocumented issues
though.
Part of implementing #105134: Removal of readfile's lib_link & expand code.
This commit adds a new option flag to the lib_query foreach_id code,
which will make deprecated ID pointers to be processed as well.
NOTE: Currently there is no report to the callbakcs about the fact that
it is processing a deprecated ID. This can be easily added later if it
becomes necessary.
Part of implementing #105134: Removal of readfile's lib_link & expand code.
When choosing the new 'overwrite' option when trying to save a blendfile
from a newer version of Blender, it would cause invalid (use-after-free)
memory access.
Issue caused by the main commit (a1d7ec7139) of the new blendfile
compatibility handling. No idea how it was not detected earlier.
Many thanks to @weizhen for spotting the issue and doing some initial
investigation on it.
Allow dragging items from Outliner to other windows. Disables EdgePan
operator when entering new window. Canceling the drop redraws target
area and resets all modal cursors. But this does not fix incorrect
mouse cursor during operations on the remote target window.
Pull Request: https://projects.blender.org/blender/blender/pulls/105196
This adds a new Ghost function, GHOST_GetPixelAtCursor, that allows
picking colors from outside of Blender windows. This only has an
implementation for the Windows platform, but this should allow other
platforms to also do so if possible.
Pull Request: https://projects.blender.org/blender/blender/pulls/105324
Listing the "Blender Foundation" as copyright holder implied the Blender
Foundation holds copyright to files which may include work from many
developers.
While keeping copyright on headers makes sense for isolated libraries,
Blender's own code may be refactored or moved between files in a way
that makes the per file copyright holders less meaningful.
Copyright references to the "Blender Foundation" have been replaced with
"Blender Authors", with the exception of `./extern/` since these this
contains libraries which are more isolated, any changed to license
headers there can be handled on a case-by-case basis.
Some directories in `./intern/` have also been excluded:
- `./intern/cycles/` it's own `AUTHORS` file is planned.
- `./intern/opensubdiv/`.
An "AUTHORS" file has been added, using the chromium projects authors
file as a template.
Design task: #110784
Ref !110783.
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
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
With the end goal of simplifying ownership and memory management,
and allowing the use of `get_name` in contexts without statically
allocated strings, use `std::string` for the return values of these two
operator type callbacks instead of `const char *` and `char *`.
In the meantime things get uglier in some places. I'd expect `std::string`
to be used more in the future elsewhere in Blender though.
Pull Request: https://projects.blender.org/blender/blender/pulls/110823
Using ClangBuildAnalyzer on the whole Blender build, it was pointing
out that BLI_math.h is the heaviest "header hub" (i.e. non tiny file
that is included a lot).
However, there's very little (actually zero) source files in Blender
that need "all the math" (base, colors, vectors, matrices,
quaternions, intersection, interpolation, statistics, solvers and
time). A common use case is source files needing just vectors, or
just vectors & matrices, or just colors etc. Actually, 181 files
were including the whole math thing without needing it at all.
This change removes BLI_math.h completely, and instead in all the
places that need it, includes BLI_math_vector.h or BLI_math_color.h
and so on.
Change from that:
- BLI_math_color.h was included 1399 times -> now 408 (took 114.0sec
to parse -> now 36.3sec)
- BLI_simd.h 1403 -> 418 (109.7sec -> 34.9sec).
Full rebuild of Blender (Apple M1, Xcode, RelWithDebInfo) is not
affected much (342sec -> 334sec). Most of benefit would be when
someone's changing BLI_simd.h or BLI_math_color.h or similar files,
that now there's 3x fewer files result in a recompile.
Pull Request #110944
Add a High Dynamic Range option in the Color Management > Display panel.
This enables display of extended color ranges above 1.0 for the 3D
viewport, image editor and render previews.
This requires a monitor that can display HDR colors, and a view
transform designed for HDR output. The Standard view transform works,
but Filmic does not as it was designed to bring values into the 0..1
range for SDR displays.
This patch is limited to allowing the display to visualize extended
colors, but does not include future looking work to better integrate HDR
into the full workflow.
It is implemented by rendering to high bit-depth texture formats for
the user interface, and uncapping the color range in color management.
Authored by Apple: Michael Parkin-White
Pull Request: https://projects.blender.org/blender/blender/pulls/105662
Support name-spaced add-ons, exposed via user configurable extension
repositories.
Directories for add-ons can be added at run-time and are name-spaced to
avoid name-collisions with Python modules or add-ons from other
repositories.
This is exposed as an experimental feature "Extension Repositories".
Details:
- A `bUserExtensionRepo` type which represents a repository which is
listed in the add-ons repository.
- `JunctionModuleHandle` class to manage a package with sub-modules
which can point to arbitrary locations.
- `bpy.app.handlers._extension_repos_update_{pre/post}` internal
callbacks run before/after changes to extension repositories,
callbacks are used to sync the changes to the Python package that
exposes these to add-ons.
- The size of an add-on name has been increased so a user-defined package
prefix can be included without enforcing shorter add-on names.
- Functionality relating to package management has been left out of this
change and will be developed separately.
Further work:
- While a repository can be renamed, enabled add-ons aren't renamed.
Eventually we might want to support this although we could also
disallow renaming repositories with add-ons enabled as the name isn't
all that significant.
- Removing a repository should remove all the add-ons located in this
repository.
- Sub-module names are currently restricted to `[A-Za-z]+[A-Za-z0-9_]*`
we might want to relax this to allow unicode characters (we might
still want to disallow `-` or any characters that would prevent
attribute access in code).
Ref !110869.
Reviewed By: brecht
No user visible changes expected, except of new experimental feature
option.
------------------------------------------------------------------------------
This introduces asset shelves as a new standard UI element for accessing
assets. Based on the current context (like the active mode and/or tool), they
can provide assets for specific workflows/tasks. As such they are more limited
in functionality than the asset browser, but a lot more efficient for certain
tasks.
The asset shelf is developed as part of the brush assets project (see #101895),
but is also meant to replace the current pose library UI.
Support for asset shelves can quite easily be added to different editor types,
the following commit will add support for the 3D View. If an editor type
supports asset shelves, add-ons can chose to register an asset shelf type for
an editor with just a few lines of Python.
It should be possible to entirely remove `UILayout.asset_view_template()` once
asset shelves are non-experimental.
Some changes are to be expected still, see #107881.
Task: #102879
Brush asset workflow blog post: https://code.blender.org/2022/12/brush-assets-workflow/
Initial technical documentation: https://developer.blender.org/docs/asset_system/user_interface/asset_shelf/
Pull Request: #104831
Context is needed to import and instantiate assets correctly. Previously
the context was stored as "evil" pointer in the drag data. Since
77794b1a7b, context is passed to the dragging callbacks doing the asset
import, so the context doesn't need to be stored that way anymore and
can simply be passed to the import function.
This implements the main aspects of changes to blendfile compatibility
as designed in #109151:
* Blender files which file minversion is newer than current Blender
executable won't be loaded at all.
* Blender files which file version is newer than current Blender will
triger systematic warning to user:
* In the status info bar (lower right corner in default UI).
* When attempting to save (overwrite) them.
This means that the file minversion becomes a hard limit, and not a
soft, warning-only as it used to be. Further more, forward compatibility
warning is now systematic (instead of depending on file minversion),
and more visible for users.
See also https://wiki.blender.org/wiki/Process/Compatibility_Handling
for details over the new policy.
Technically:
* Opening any file with a minversion newer than current Blender file one
now triggers an early abort, with an error message reported to the user.
This is handled by a new utils called from `blo_decode_and_check`.
* Any file newer than current Blender version sets a new
`has_forward_compatibility_issues` flag in Main struct at read time.
* Status bar info area is turned into a template, which uses this flag
to display special warning UI and tooltip when set.
* A new confirmation popup appears when user tries to save (overwrite)
such a 'newer' blendfile, stating potential loos of data, and
proposing by default to 'save as' instead.
* The 'quit unsaved' popup has also been updated to 'save as' instead of
'save' when the edited file is has potential forward compitibility
issues.
Part of #109151 (PR !110109).
The cleanup of blenkernel last weeks , caused the house of cards to
collapse on top of bf_gpu's shader_builder, which is off by default
but used on a daily basis by the rendering team.
Given the fixes forward in #110394 ran into a ODR violation in OSL that
was hiding there for years, I don't see another way forward without
impeding the rendering teams productivity for "quite a while" as there
is no guarantee the OSL issue would be the end of it.
the only way forward appears to be back.
this reverts :
19422044eda670b53abe0f541db97cbe516e8c813e88a2f44c4e64b772f59547e7a31707fe6c5a57
The problematic commit was 07fe6c5a57
as blenkernel links most of blender, it's a bit of a link order issue
magnet. Given all these commits stack, it's near impossible to revert
just that one without spending a significant amount of time resolving
merge conflicts. 99% of that work was automated, so easier to just
revert all of them, and re-do the work, than it is to deal with the
merge conflicts.
Pull Request: https://projects.blender.org/blender/blender/pulls/110438
Regression in [0] changed the order of execution for the load_post
handler which previously (in 3.5x) ran before driver evaluation.
Calling either load_post/load_post_fail handlers after loading was
changed intentionally to simplify the code-path for calling handlers
however it meant the handler couldn't be used to setup drivers,
so restore the original logic.
[0]: 46be42f6b1
Resolve a crash in !104831, which exposed an error in window creation
with an empty space type.
Creating a new window with an empty space type would do the following:
- Create a new screen with a single empty area.
- Refresh the screen,
- Initialize the area.
- Convert the empty area into a 3D viewport.
- Run SpaceType::init()
This doesn't cause any problems at the moment because `view3d_init`
isn't doing anything however !104831 accesses the View3D from
`area->spacedata.first` causing SCREEN_OT_area_dupli to crash.
Resolve by supporting an area setup callback for WM_window_open
so the area-data can be set before it's initialized.
The issue remains where an unknown/empty ScrArea::spacetype results in
a crash although it seems unlikely users run into this in practice.
Whatever the case, that can be resolved separately.
This change replaces a bare RenderEngine owned by a viewport
with a VeiwRender. This unlocks a possibility of accessing
RenderResult for viewport renders. Currently it is not done,
but it will be needed for an upcoming work towards unification
of the render passes handling.
Ref #108618
Pull Request: https://projects.blender.org/blender/blender/pulls/110244
Caused by fd3e44492e.
Images were drawn filling the entire window, now use available size/
offset inside the window and pass these as `rctf` to
`draw_display_buffer`.
Should be good for 3.6/3.3 LTS
Pull Request: https://projects.blender.org/blender/blender/pulls/110206
File > New> General tooltip is misleading, as explained in issue #109875
Changes the tooltip from the current "Open the default file (doesn't save the current file)" to simply "Open the default file".
It could be argued that the note is still valid for when people have Preferences > Save & Load > Save Prompt disabled, but we don't have a similar note in any of the other cases that open a different file.
Pull Request: https://projects.blender.org/blender/blender/pulls/110086
Use modifier keys that are pressed before activating a new window.
Allows call of `wm_window_update_eventstate_modifiers` on
`GHOST_kEventWindowActivate` by using `GetAsyncKeyState` instead of
`GetKeyState` in GHOST_SystemWin32::getModifierKeys, which retrieves
actual hardware state.
Pull Request: https://projects.blender.org/blender/blender/pulls/110020
This formats code that is disabled using `#if 0`. Formatting was achieved
by temporarily changing `#if 0` to `#if 1 /*something*/`, then formatting,
and then changing it back to `#if 0`.
Now that liboverride process on save (the diffing + pruning unused
override operations + reset of non-overridable changes) works better. it
leads to a bad side-effect: all system overrides data indirectly
modified through animation or drivers get reset.
Since in current system e.g. most objects of a rigged asset are system
overrides, but their transform is modified by bones animation, this
leads to entire overrides of assets being reset to their linked state
until next depsgraph evaluation.
While this is the expected and correct behavior in absolute, this is
very bad from a user experience PoV.
This commit address the issue by simply re-running a 'frame change'
despgraph update, to ensure all drivers, animations etc. are properly
re-applied after liboverride diffing cleanup & reset.
Note: Change applies to Grease Pencil 3.0 only (experimental feature).
Enables use of drag & drop to reorder grease pencil layers through the layer
tree UI, as well as inserting layers into groups. This is an intuitive and
often requested method of managing such data-structures. Visual feedback should
be improved still, and the gap between items be removed, to reduce flickering
while dragging. These are general improvements for tree views however which
should be done separately.
There is no support yet for dragging layer groups, this requires further
changes in the internal grease pencil APIs.
#109825 introduced the necessary drag & drop support for tree views, #109824
prepared the internal grease pencil API for it.
Pull Request: https://projects.blender.org/blender/blender/pulls/109826
Avoid potential problems when the active window is known but not
assigned to `wm->winactive`, where the first window would be used
as a fallback. Instead, take a window argument, a fallback is still
used as a last resort (when NULL).
Word ordering for wmTimer API wasn't consistent.
- Use "WM_event_timer_" / "WM_event_timers_" prefix.
- Rename "wm_window_timer" to "wm_window_timers_process"
because it wasn't clear what the function did from its name.
- Rename "wm_window_process_events" to "wm_window_events_process"
for consistency with "wm_window_timers_process".
Displaying the warning on file load depended on `wm->winactive`
being set, and didn't work when loading a file from the file-open
window or when loading files using a command-line argument.
Resolve using the first window as a fallback.
This happens to resolve#109770, although not freeing timers on exit
is likely to be an issue under other circumstances.
Logic in FileBrowser and/or `BKE_blendfile_library_path_explode`
probably changed at some point, and the generic 'invalid filetype' error
message was reached before the path is compared to current blendfile path.
There's quite a few libraries that depend on dna_type_offsets.h
but had gotten to it by just adding the folder that contains it to
their includes INC section without declaring a dependency to
bf_dna in the LIB section.
which occasionally lead to the lib building before bf_dna and the
header being missing, while this generally gets fixed in CMake by
adding bf_dna to the LIB section of the lib, however until last
week all libraries in the LIB section were linked as INTERFACE so
adding it in there did not resolve the build issue.
To make things still build, we sprinkled add_dependencies wherever
we needed it to force a build order.
This diff :
Declares public include folders for the bf_dna target so there's
no more fudging the INC section required to get to them.
Removes all dna related paths from the INC section for all
libraries.
Adds an alias target bf:dna to signify it has been updated to
modern cmake
Declares a dependency on bf::dna for all libraries that require it
Removes (almost) all calls to add_dependencies for bf_dna
Future work:
Because of the manual dependency management that was done, there is
now some "clutter" with libs depending on bf_dna that realistically
don't. Example bf_intern_opencolorio itself has no dependency on
bf_dna at all, doesn't need it, doesn't use it. However the
dna include folder had been added to it in the past since bf_blenlib
uses dna headers in some of its public headers and
bf_intern_opencolorio does use those blenlib headers.
Given bf_blenlib now correctly declares the dependency on bf_dna
as public bf_intern_opencolorio will get the dna header directory
automatically from CMake, hence some cleanup could be done for
bf_intern_opencolorio
Because 99% of the changes in this diff have been automated, this diff
does not seek to address these issues as there is no easy way to
determine why a certain dependency is in place. A developer will have
to make a pass a this at some later point in time. As I'd rather not
mix automated and manual labour.
There are a few libraries that could not be automatically processed
(ie bf_blendthumb) that also will need this manual look-over.
Pull Request: https://projects.blender.org/blender/blender/pulls/109835
Renames `OB_MODE_EDIT_GPENCIL`, `OB_MODE_PAINT_GPENCIL`, `OB_MODE_SCULPT_GPENCIL`, `OB_MODE_WEIGHT_GPENCIL`, `OB_MODE_VERTEX_GPENCIL, and the context modes` to `*_LEGACY`.
Pull Request: https://projects.blender.org/blender/blender/pulls/109648
Image buffer display in the animation player was difficult to reason
about because it could potentially access the entire play-state on load
(frame-step, modifier keys... etc) even though these are are only
intended to be used interactively.
Add playanim_toscreen_ex which is called by both
playanim_toscreen & playanim_toscreen_on_load which doesn't use the
PlayState struct.
Replace `typedef struct X {} X;` with `struct X {};`
In some cases the first and last name didn't match although this
is rarely useful, even a typo in some cases, e.g. TrachPathPoint.
Small inconsistency leftover from ebb5643e59, 32bbfbb06e and 7ef8389dad
commits.
Weirdly enough that was not a problem on Linux X11, but did cause
issues at leaast on Windows and Linux Wayland.
Similar to 5f16e24cc9, this adds support for edit mode
to the point cloud object type, which is currently hidden behind an
experimental option. No interaction is possible yet, for now this
can be used as a testing for a node-group-operator-only mode.
The multiplication sign looks like an "x" but should be used in its
stead to display calculations and dimensions such as "1920x1080". It
is supported in many fonts including DejaVu Sans, the font currently
used for the UI.
Pull Request: https://projects.blender.org/blender/blender/pulls/106388
No user visible changes expected.
This function was added in 86b2cf4574 as a more type safe and more
convenient way of setting button callbacks. So use it for simple cases.
Avoid BLI_strcpy_rlen use as this has the same problems as strcpy
(it just returned the length which is useful at times).
Use memcpy instead when the size is calculated immediately beforehand.
Other uses of have been replaced by BLI_string_join_array that prevents
buffer overruns by taking the destination buffer length.
This is cached in Render, and gets cleared along with render pass GPU
textures when there is no editor open using it, or a new final render is
started.
The context and texture pool are cached. But the evaluator is re-created
every time as this only runs on compositing node changes, which require
recreating it anyway (unlike the viewport where e.g. camera navigation
does not need a new evaluator).
Pull Request: https://projects.blender.org/blender/blender/pulls/108909
Before this change the ImBuf struct had dedicated fields for the
buffer data. Now the color space is stored inside of the struct
which wraps around the buffer information.
This only changes the field placement, without changing the way
it is handled. In the future one might imagine that operations
like stealing buffer data should null-ify the buffer colorspace
pointer. Such changes would need to have more accurate thinking
before implementation.
Should be no functional changes.
Pull Request: https://projects.blender.org/blender/blender/pulls/109291
This was due to a wrong mapping of tools in the toolbar.
The fix makes sure that the correct selection tools are used for the
old grease pencil objects.
In order to accomplish this properly, the new grease pencil objects
use their own edit mode context.
This way the two objects are cleanly seperated.
* Store per RenderPass in RenderResult.
* Caches are cleared when starting rendering, to make more memory available
to GPU rendering.
* Caches are cleared on UI changes, when no compositing node editor and no
image editor with a render result or viewer node image is visible.
* Store 3 channel RGB passes as such, and set alpha 1 in shader.
This is an intermediate step before implementing GPU backed ImBuf, to
improve performance and figure out cache eviction.
Pull Request: https://projects.blender.org/blender/blender/pulls/108818
`AssetHandle` is meant as temporary design and should be replaced by
`AssetRepresentation`. This moves us another step closer to that.
Rather than taking data from the volatile asset handle and storing that
in the drag data, store the (more persistent) asset representation there
and access data from it where needed.