Age | Commit message (Collapse) | Author |
|
|
|
rB43bc494892c3 switched `BKE_libblock_relink_to_newid` to use new ID
remapping and libquery code.
However, that new code does protect by default against remapping an
objects's data pointer when that object is in Edit mode, since this is
not a behavior that generic BKE code can handle (due to required editing
data for most obdata types when in edit mode).
So specific code that does create new IDs and need remapping in Edit
mode has to pass specific exception flags to remaping code.
This commit adds those remapping flags to `BKE_libblock_relink_to_newid`
and add said exception flag to the remapping call from
`ED_object_add_duplicate` when the object is in edit mode.
|
|
Allows to avoid a global lock being held while reading files from disk,
solving performance issues when Cycles needs to read a lot of packed
images.
Simple test file F11597666
Differential Revision: https://developer.blender.org/D13032
|
|
The new `BKE_LIB_FOREACHID_PROCESS_FUNCTION_CALL` execute the given
statement and then check status of `LibraryForeachIDData` data, and
return in case stop of iteration is requested.
This is very similar to the other `BKE_LIB_FOREACHID_PROCESS_` existing
macros, and allows us to properly break iteration when a sub-function
has requested it.
Part of T90922: Fix return policy inconsistency in `scene_foreach_id`.
|
|
Add a function to check if iteration over ID usages should stop (using
internal `IDWALK_STOP` status flag).
Use it in `BKE_LIB_FOREACHID_PROCESS_` macros, and in
`window_manager_foreach_id` to handle properly the active workspace case
(previous code could skip the call to `BKE_workspace_active_set` in case
iteration over ID usages was stopped by callback on that specific ID
usage).
Part of T90922: Fix return policy inconsistency in `scene_foreach_id`.
|
|
Move all usages to new `BKE_libblock_relink_to_newid_new`, and rename
that one to `BKE_libblock_relink_to_newid`.
Fix T91413.
|
|
|
|
This is consistent with saving the preferences.
Ref D12896
|
|
|
|
|
|
|
|
Only regions with gizmos were checking for fallback tools.
|
|
|
|
The callers of `ED_view3d_cursor_snap_active` that must handle the snapping of the cursor.
Forcing release at the end can hide leaks.
|
|
`free_tooltip` is no longer needed.
|
|
There was a bunch of special handling to support dropping data-blocks onto
string or search-menu buttons, to change the value of these. This refactor
makes that case use the normal drop-box design, where an operator is executed
on drop that gets input properties set by the drop-box. This should also make
it easier to add support for dragging assets into these buttons.
In addition this fixes an issue: Two tooltips were shown when dragging assets
over text buttons. None should be shown, because this isn't supported.
|
|
Replace local static mouse coordinate storage with a single function.
also resolve inconsistencies.
- Edit-mesh selection used equality check (ignoring `U.move_threshold`).
- Motion to clear tooltips checked the value without scaling by the DPI.
Also prevent the unlikely case of the previous motion check matching
a different area by resetting the value when the active region changes.
|
|
Uses the additions to the UI tree-view API from the previous commit to
enable drag & drop of asset catalogs. The catalogs will be moved in the
tree including children.
A remaining issue is that a catalog with children will always be
collapsed when dropping. I need to find a way to fix that in the
tree-view API.
There are a few improvements I can think of for the tree-item drag &
drop support, but time for these is too short. These can be done as
normal cleanups at some point.
|
|
|
|
The location of a linked object isn't editable, or at least it will be reset
when reloading the file. So the drag & drop shouldn't even pretend like this
would work, so disable the snapping of the object and the bounding-box to show
the snapped object location while dragging.
|
|
When dropping asset objects, place them under the mouse-cursor
along with any other objects they link in.
Ref D12935
Reviewed By: Severin
|
|
* Allow operators to show a "disabled hint" in red text explaining why dropping
at the current location and in current context doesn't work. Should greatly
help users to understand what's the problem.
* Show a "stop" cursor when dropping isn't possible, like it's common on OSes.
Differential Revision: https://developer.blender.org/D10358
|
|
|
|
`BKE_LIB_FOREACHID_PROCESS_IDSUPER`.
More in-line name with the rest of that macro-based API, especially
since this will be extended in the future.
|
|
|
|
`NULL` instead of `nullptr` in cpp code, and `else` statements after
returns.
|
|
|
|
|
|
Adds navigation transforms (pose, scale) to the XR session state that
will be applied to the viewer/controller poses. By manipulating these
values, a viewer can move through the VR viewport without the need to
physically walk through it.
Add-ons can access these transforms via Python
(XrSessionState.navigation_location/rotation/scale) to use with custom
operators.
Also adds 3 new VR navigation operators that will be exposed to users
as default actions in the VR Scene Inspection add-on. While all three
of these operators have custom properties that can greatly influence
their behaviors, for now these properties will not be accessible by
users from the UI. However, other add-ons can still set these custom
properties if they desire.
1). Raycast-based teleport
Moves the user to a location pointed at on a mesh object. The result
can optionally be constrained to specific axes, for example to achieve
"elevation snapping" behavior by constraining to the Z-axis. In
addition, one can specify an interpolation factor and offset.
Credit to KISKA for the elevation snapping concept.
2). "Grab" navigation
Moves the user through the viewport by pressing inputs on one or two
held controllers and applying deltas to the navigation matrix based on
the displacement of these controllers. When inputs on both controllers
are pressed at the same time (bimanual interaction), the user can scale
themselves relative to the scene based on the distance between the
controllers.
Also supports locks for location, rotation, and scale.
3). Fly navigation
Navigates the viewport by pressing a button and moving/turning relative to
navigation space or the VR viewer or controller. Via the operator's
properties, one can select from a variety of these modes as well as
specify the min/max speed and whether to lock elevation.
Reviewed By: Severin
Differential Revision: https://developer.blender.org/D11501
|
|
```
warning: assignment discards ‘const’ qualifier from pointer target
warning: declaration of ‘co’ shadows a parameter
```
|
|
The drag and drop feature of objects in 3D View has been modified to include:
- Snap the object being dragged.
- Visual feedback through a box and the placement tool grid.
Maniphest Tasks: T90198
Differential Revision: https://developer.blender.org/D12912
|
|
|
|
No functional changes.
This commit adds 3 callbacks for `wmDropBox` which allow custom drawing
without affecting the internal dropbox API.
Differential Revision: https://developer.blender.org/D12948
|
|
Shapekeys, always shapekeys... Since we cannot deal with them as regular
IDs, we need to handle potential recursion cases ourselves here. sigh.
|
|
Fixes a crash when blend thumbnails set to Camera View when there is
no camera, which resulted in use of a null region.
See D12748 for more details.
Differential Revision: https://developer.blender.org/D12748
Reviewed by Campbell Barton
|
|
ScrArea.runtime.tool needs to be updated after switching scenes.
|
|
Also add operator error report.
|
|
´´´
error C4133: 'function': incompatible types - from 'float [2]' to 'int *'
error C4133: 'function': incompatible types - from 'const int [2]' to 'const float *'
´´´
|
|
|
|
|
|
When appending an asset from the asset browser, its asset data needs to
be cleared.
However, linking an asset (or regular append from the file browser)
should not clear such data. In linking case, it would be there again
after a blend file reload anyway.
So this commit introduces a new `BLO_LIBLINK_APPEND_ASSET_DATA_CLEAR`
option.
NOTE: in case the appended ID needs to be copied from its linked data
(instead of making the later directly local), asset data is lost anyway
since it is never copied with the ID currently.
Ref. {T91749} and D11768.
|
|
This change simplifies the parameter list for these functions
and reduces the chance of typos mixing up array indices.
Missed in rB69102786047dccdcbaee0df6307a8c3364d28fe0.
|
|
De-duplicates wm_append_loose_data_instantiate_object_base_instance_init
and object_base_instance_init.
Add BLO_object_instantiate_object_base_instance_init which also adds to
a collection since all callers did this.
|
|
Improve readability using underscores for separators, e.g.
prev_click_time instead of prevclicktime.
|
|
|
|
directly.
Collections directly selected by the user should always be
instantiated.
Regression from recent append code refactor.
|
|
Use arrays for wmEvent coordinates, this quiets warnings with GCC11.
- `x, y` -> `xy`.
- `prevx, prevy` -> `prev_xy`.
- `prevclickx, prevclicky` -> `prev_click_xy`.
There is still some cleanup such as using `copy_v2_v2_int()`,
this can be done separately.
Reviewed By: campbellbarton, Severin
Ref D12901
|
|
Make the snap system consistent with the placement tool and leak-safe.
**Changes:**
- Store `SnapCursorDataIntern` in a `static` variable;
- Initialize (lazily) `SnapCursorDataIntern` only once (for the keymap).
- Move setup members of `V3DSnapCursorData` to a new struct `V3DSnapCursorState`
- Merge `ED_view3d_cursor_snap_activate_point` and `ED_view3d_cursor_snap_activate_plane` into `state = ED_view3d_cursor_snap_active()`
- Merge `ED_view3d_cursor_snap_deactivate_point` and `ED_view3d_cursor_snap_deactivate_plane` into `ED_view3d_cursor_snap_deactive(state)`
- Be sure to free the snap context when closing via `ED_view3d_cursor_snap_exit`
- Use RNA properties callbacks to update the properties of the `"Add Primitive Object"` operator
|
|
|
|
No longer save asset catalogs on blendfile save. Instead:
- extend the confirmation prompt for unsaved changes to show unsaved
catalogs.
- In the confirmation prompt, make catalog saving explicit & optional,
just like we do it for external images. {F10881736}
- In the Asset Browser catalog tree, show an operator icon to save the
catalogs to disk. It's grayed out if there are no changes to save, or
if the .blend wasn't saved yet (required to know where to save the
catalog definitions to). {F10881743}
Much of the work was done by @Severin and reviewed by me, then we
swapped roles.
Reviewed By: Severin
Differential Revision: https://developer.blender.org/D12796
|