Age | Commit message (Collapse) | Author |
|
Originally the operator name was drawn next to the dragging content.
After that there was an option to add custom, static text with the
dragging content. This patch allows dynamic text to be drawn.
The custom text was implemented as out parameter of the poll function
what made the code unclear. This patch introduces a tooltip function
that separates tooltip generation from the poll function.
NOTE: the text should always be returned in its own memory block. This
block will be freed after it is copied in the drag struct.
Reviewed By: Severin
Differential Revision: https://developer.blender.org/D12104
|
|
Implements a basic, WIP version of the asset list. This is needed to
give the asset view UI template asset reading and displaying
functionality.
See:
* Asset System: Data Storage, Reading & UI Access - https://developer.blender.org/T88184
Especially the asset list internals should change. It uses the
File/Asset Browser's `FileList` API, which isn't really meant for access
from outside the File Browser. But as explained in T88184, it does a lot
of the stuff we currently need, so we (Sybren Stüvel and I) decided to
go this route for now. Work on a file-list rewrite which integrates well
with the asset system started in the `asset-system-filelist` branch.
Further includes:
* Operator to reload the asset list.
* New `bpy.types.AssetHandle.get_full_library_path()` function, which
gets the full path of the asset via the asset-list.
* Changes to preview loading to prevent the preview loading job to run
eternally for asset views. File Browsers have this issue too, but
should be fixed separately.
|
|
|
|
Also use doxy style function reference `#` prefix chars when
referencing identifiers.
|
|
|
|
|
|
Delay depsgraph visibility update tagging until it is known that
graph relations are up to date, and until it is known that the graph
is actually needed to be evaluated.
Differential Revision: https://developer.blender.org/D11660
|
|
No functional changes. Just makes it clear this is not an immediate
update, and will make an upcoming change more localized.
|
|
This patch improves the 3DView statistics overlay to show LOCAL stats
while in local view. This means the stats can vary between 3DViews and
the statusbar when views are in local view, but this gives a much more
accurate count of the objects, and their components, that you are
directly working with rather than just scene values.
Differential Revision: https://developer.blender.org/D8883
Reviewed by Campbell Barton
|
|
|
|
Call this function instead of `CTX_wm_operator_poll_msg_set(C, NULL)`
|
|
Prevent drag events from changing the highlighted gizmo
unless the drag event activates the gizmo.
This resolves a glitch where testing a drag event would highlight
at the point the drag was initiated even when the event was not handled.
|
|
Non-functional change in preparation for fix.
|
|
This prevented dynamic enum callbacks being called.
|
|
Click-drag events that weren't handled would continually be tested
for each mouse-motion event.
As well as being redundant, this added the overhead of querying
gizmos twice per motion event.
Now click-drag is only tested once when the drag threshold is reached.
This mitigates T87511, although the single drag test still causes
the snap gizmo to flicker.
|
|
|
|
|
|
As of 2cc5af9c553cfc00b7d4616445ad954597a92d94, checking the window
managers pointer for changes is no longer a valid way
to check a file has been loaded.
|
|
|
|
Caused by 46aa70cb486d.
RNA would send property update notifiers with the owner ID as `reference` data.
Since above's commit we'd only send the notifiers to editors if the reference
data address matches the space's address. So editors wouldn't get the notifiers
at all.
The owner ID for space properties is always the screen AFAIK. So allow
notifiers with the screen as reference to be passed to editors as well, think
this is reasonable to do either way.
For example, steps to reproduce were:
* Open Asset Browser
* Mark some data-blocks of different types as assets (e.g. object & its
material)
* Switch between the categories in the Asset Browser. The asset list wouldn't
be updated.
|
|
When adding a notifier, `reference` data can be passed. The notifier system
uses this to filter out listeners, for example if data of a scene changes,
windows showing a different scene won't get the notifiers sent to their
listeners.
For the `NC_SPACE` notifiers, a number of places also passed the space as
`reference`, but that wasn't used at all. The notifier would still be sent to
all listeners in all windows (and the listeners didn't use it either). Causing
some unnecessary updates (e.g. see ed2c4825d3e2344).
With this commit, passing a space will make sure the notifier is only sent to
that exact space. Some code seems to already have expected that to be the case.
However there were some cases that passed the space as `reference` without
reason, which would break with this commit (meaning they wouldn't redraw or
update correctly).
Corrected these so they don't pass the space anymore.
|
|
Typos from a509e79a4c77. Looks like issues with an automated cleanup tool.
|
|
Regression in b5d154f400e46ba322f0e08a231bb2557bf51a1e
|
|
Match naming of other wm_cursor_position_* functions.
|
|
|
|
These variables track the wmWindow.event_queue state,
however they were used in a way that wasn't correct.
- check_drag & check_click from wmWindow.eventstate
were used to track the click/drag status of events handled in
wmWindow.event_queue.
- Event's in the queue read from wmEvent.check_drag.
- Once a drag action was detected, wmWindow.eventstate.check_drag
was disabled.
Disabling drag in the event state would not change the drag state
for values already in the event queue.
Simplify logic by moving these values into the window,
so there is one place these variables are tracked.
|
|
The term queue isn't very descruptive on it's own, use:
- wmWindow.event_queue
- wmWindowManager.notifier_queue
|
|
Reserve `event` for wmEvent.
|
|
Using both evt and event together was confusing.
Renamed:
- event_state <- evt
- event_state_other <- oevt
- event_other <- oevent
- win_other <- owin
|
|
1638af109e46522a1a24645289016922bb9ca977 &
bfc70a6a958b9c35bde765ea8a02e8b1fd36db8b
caused a regression with click-drag (not tweak which has it's own logic).
Restore some changes from these commits with added comments.
Minor changes from previous functionality from
39919e35326c732141bfd2d740b19000b6bc1d51.
- `prevval` & `prevtype` are now set for all kinds of new events
in the queue previously this was not done for some kinds of events
(mouse wheel, ndof - for example).
- Set `prevval` & `prevtype` for other windows for mouse buttons.
|
|
Ensure they're working as documented (only for debug builds).
|
|
Match wm_event_add_ghostevent behavior for setting previous values.
|
|
This check was added before is_repeat was supported, use this variable
instead since it's more a more reliable way of detecting held keys.
Also remove outdated comment.
|
|
Click detection logic relied on the event queue not accumulating events
as newly added events at the end of the queue adjusted
`wm->eventstate->prev{val/type}` which was then compared with events
at the front of the queue.
This made Ctrl-Click fail to detect the click as releasing Ctrl
set the previous value before the previous event was handled.
In practice this only happened in heavy scenes,
updating 10 fps or lower. It also made automated tests fail that
accumulate events before handling them.
|
|
This makes event's prevval and prevtype usable for events in the queue.
Previously they were unused, except as a hack for modal keymap handling.
This is needed to fix T86116, where the `wm->eventstate->prev{val/type}`
are set to values from events that have not been processed.
|
|
`wmEvent.prevtype` & `wmEvent.prevval` were overwritten
when used in modal keymaps.
Now they are restored to their original values.
|
|
|
|
Change order of checks for more convenient click-detection debugging.
|
|
Currently the intended behavior regarding prevval/prevtype isn't
handled consistently. However, including cursor motion causes events
in `wm->queue` and `wm->eventstate` to behave differently,
where `wm->eventstate` ignores motion (necessary for click detection).
This makes checks from `wm->eventstate` to events in the queue fail.
This reverts 39919e35326c732141bfd2d740b19000b6bc1d51,
using the `event.type` instead of it's previous type.
This works as it includes mouse button release events.
|
|
Move logic that sets previous event state into WM_event_add_simulate.
|
|
|
|
When dropping an asset somewhere, it is appended and then a drop operation is
called to actually add it to the scene based on current context. If this drop
operation fails, the appended data-block is now still in the .blend. The user
may not notice and not expect this.
Instead idea is to rollback any changes done by dropping code if the operation
fails, namely removing the appended data-block again.
Adds a new `cancel()` callback which is called if the drop operator returns
`OPERATOR_CANCELLED` to drop-boxes and a generic function to deal with assets
on drop failure.
Also removes the `free_id_on_error` property of the `NODE_OT_add_group`
operator, which was used as ad-hoc solution to get this same behavior.
|
|
Approximately 91 spelling corrections, almost all in comments.
Differential Revision: https://developer.blender.org/D10288
Reviewed by Harley Acheson
|
|
|
|
For assets, the copy callback of the drop-box would append the asset
data-block. Check if the operator's poll succeeds before calling the copy
callback.
Otherwise the data-block is "secretly" appended, which the user doesn't expect
and won't notice without checking the file data in the Outliner.
For masks I had to extend the poll function, it didn't check context
sufficiently.
|
|
These functions with many arguments can be unwieldy. Aside from the obvious issues
with rewriting the list of arguments and the opportunities for error and frustration
that presents, the long list of arguments make these systems hard to change. So when
an argument should be added, someone might skip that and add some hack instead.
So, as proposed in T73586#1037210, this patch instead uses a "params" struct for
each of these callbacks.
- Use param argument for `ARegionType.listener`
- Remove unused window field in region listener
- Use param argument for `SpaceType.listener`
- Use params struct for `ARegionType.message_subscribe`
Differential Revision: https://developer.blender.org/D9750
|
|
Steps to reproduce were:
* Start with factory defaults
* Set "Render in" to "Maximized Area"
* Render
* Open "Save as"
* Click Cancel
Mistake in 78d2ce19c4fb. Was using the wrong area pointer, which I think
didn't make a difference in most cases, but here it did.
|
|
After 1e799dd26ec1, the logic to recognize a temporary File Browser window
didn't work correctly anymore. It would recognize a maximized File Browser
inside a temporary window as a temporary File Browser window, and attempt to
close this (rather than returning to the previous layout).
The logic there was pretty weak, and still is I think. A more stable solution
would need bigger refactoring.
With this, it's also not possible to maximize or fullscreen an area within a
temporary window (Preferences, File Browser, render window) anymore. Think that
won't make a noticable difference, since you couldn't open multiple areas there
anyway, and the area seems to be maximized already.
Cleaned up the code a bit to not become more confusing with the changes.
|
|
Don't add the same stats refresh notifiers multiple times, it can be slow to
search the full list of notifiers for duplicates when there are many.
Fundamentally the time complexity in searching for duplicates is still bad.
Inspired by D9901 from Erik Abrahamsson
|
|
|