Age | Commit message (Collapse) | Author |
|
During sprite fright loading of complex scenes would spend a long time in remapping ID's
The remapping process is done on a per ID instance that resulted in a very time consuming
process that goes over every possible ID reference to find out if it needs to be updated.
If there are N of references to ID blocks and there are M ID blocks that needed to be remapped
it would take N*M checks. These checks are scattered around the place and memory.
Each reference would only be updated at most once, but most of the time no update is needed at all.
Idea: By grouping the changes together will reduce the number of checks resulting in improved performance.
This would only require N checks. Additional benefits is improved data locality as data is only loaded once
in the L2 cache.
It has be implemented for the resyncing process and UI editors.
On an Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz 16Gig the resyncing process went
from 170 seconds to 145 seconds (during hotspot recording).
After this patch has been applied we could add similar approach
to references (references between data blocks) and functionality (tagged deletion).
In my understanding this could reduce the resyncing process to less than a second.
Opening the village production file between 10 and 20 seconds.
Flame graphs showing that UI remapping isn't visible anymore (`WM_main_remap_editor_id_reference`)
* Master {F12769210 size=full}
* This patch {F12769211 size=full}
Reviewed By: mont29
Maniphest Tasks: T94185
Differential Revision: https://developer.blender.org/D13615
|
|
This reverts commit 948211679f2a0681421160be0d3b90f507bc0be7.
This commit introduced some regressions in the test suite.
As this change is a core part of blender Bastien and I decided to revert
it as the solution isn't clear and needs more investigation.
The following tests FAILED:
62 - blendfile_liblink (SEGFAULT)
63 - blendfile_library_overrides (SEGFAULT)
It fails in (id_us_ensure_real)
|
|
During sprite fright loading of complex scenes would spend a long time in remapping ID's
The remapping process is done on a per ID instance that resulted in a very time consuming
process that goes over every possible ID reference to find out if it needs to be updated.
If there are N of references to ID blocks and there are M ID blocks that needed to be remapped
it would take N*M checks. These checks are scattered around the place and memory.
Each reference would only be updated at most once, but most of the time no update is needed at all.
Idea: By grouping the changes together will reduce the number of checks resulting in improved performance.
This would only require N checks. Additional benefits is improved data locality as data is only loaded once
in the L2 cache.
It has be implemented for the resyncing process and UI editors.
On an Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz 16Gig the resyncing process went
from 170 seconds to 145 seconds (during hotspot recording).
After this patch has been applied we could add similar approach
to references (references between data blocks) and functionality (tagged deletion).
In my understanding this could reduce the resyncing process to less than a second.
Opening the village production file between 10 and 20 seconds.
Flame graphs showing that UI remapping isn't visible anymore (`WM_main_remap_editor_id_reference`)
* Master {F12769210 size=full}
* This patch {F12769211 size=full}
Reviewed By: mont29
Maniphest Tasks: T94185
Differential Revision: https://developer.blender.org/D13615
|
|
bda9e4238a07a72c26598ea9025e00f6ca896750 changed smooth-view
not to redraw when there were no changes made.
Redrawing is needed for repositioning the cursor.
Subscribe to changes to the 3d cursor to ensure all view ports
are updated (not just the current one).
|
|
Ref T92709
|
|
|
|
The old code did not work when there were multiple ids with
the same name (which can happen when ids are linked in).
The solution is to use the session ids instead. Those are different
even when two ids have the same name.
Differential Revision: https://developer.blender.org/D11116
|
|
Drop-boxes should act on the context determined through the exact cursor
location. There should be no need to override that, basically by the
nature of how drop-boxes work.
So Campbell and I agreed on removing this.
If we wanted to support it, we'd have to restore the operator context
when drawing drop-boxes, see
https://developer.blender.org/T92501#1247581.
|
|
`CTX_data_selected_objects()` returns a `ListBase` of
`CollectionPointerLink`, not `PointerRNA`. This caused an alignment
issue, resulting in `owner_id == NULL` reported in T92507. Correcting
the pointer type fixed this.
In the end, the same pointer is used as before this commit, but the way
it is obtained is actually correct.
|
|
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 the Asset Browser import type was set to "Link", after dragging in an
object asset the object wouldn't actually appear in the viewport. Do the same
depsgraph tagging (and TODO comment) as the `OBJECT_OT_add_named` operator,
which does similar things.
|
|
When dragging in an object from an external asset library from the Asset
Browser, the Outliner wouldn't update.
|
|
When dropping asset objects, place them under the mouse-cursor
along with any other objects they link in.
Ref D12935
Reviewed By: Severin
|
|
Make it possible to run `ASSET_OT_mark` and `ASSET_OT_clear` operators from
the 3D Viewport. There is no menu entry, just compatibility with pressing
F3 and executing the operators from the operator search.
|
|
Refactor `view3d_context()` to use early `return`s instead of a bundle of
`if`/`else if`/`else`, some of which had `return`s and some not.
No functional changes.
|
|
Use explicit enum values instead of returning 0/1 from `view3d_context()`.
No functional changes.
|
|
`view3d_context()` would return `-1` ("found but not available") when
fetching the context dir. This is incorrect; it should return 1 ("ok").
This is a semantic change in preparation of further cleanup of the code.
|
|
The matrix and location were not being calculated in this case.
|
|
The benefit of a flat array in this case is small and limiting, so use a linklist.
|
|
3 is a small amount as each viewport creates a gizmo that creates its own state
Now if the state is not created, the gizmos use the last state.
|
|
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
|
|
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
|
|
Move most of the gizmo snap and placement code to `view_cursor_snap.c`.
Simplify and extend the snap API.
Differential Revision: https://developer.blender.org/D12868
|
|
There were several places attempting to check to see if scene lights
and world were enabled for display. This tries to find a common place
for both of these to reduce duplication.
Honestly, I couldn't find a really good spot for these and settled on
DRW_engine. It's not the best spot since they're not strictly drawing
related, but let's start here.
Reviewed By: fclem
Differential Revision: https://developer.blender.org/D12658
|
|
A dragged & dropped wouldn't be duplicated anymore, it would just be moved to
the drop position.
Caused by c8fcea0c33ef.
|
|
Addresses T77127 (Controller Drawing).
Adds VR controller visualization and custom drawing via draw
handlers. Add-ons can draw to the XR surface (headset display) and
mirror window by adding a View3D draw handler of region type 'XR' and
draw type 'POST_VIEW'. Controller drawing and custom overlays can be
toggled individually as XR session options, which will be added in a
future update to the VR Scene Inspection add-on.
For the actual drawing, the OpenXR XR_MSFT_controller_model extension
is used to load a glTF model provided by the XR runtime. The model's
vertex data is then used to create a GPUBatch in the XR session
state. Finally, this batch is drawn via the XR surface draw handler
mentioned above.
For runtimes that do not support the controller model extension, a
a simple fallback shape (sphere) is drawn instead.
Reviewed By: Severin, fclem
Differential Revision: https://developer.blender.org/D10948
|
|
Swap the tool-header and header order so the tool-header
so the header is always next to the window edge.
Note that files saved in 3.0 will have overlapping headers when opened
in any version of Blender before this commit.
Reviewed By: Severin, fsiddi
Maniphest Tasks: T91536
Ref D12631
|
|
While World data has always been able to be marked as an asset, there
was no way to actually use them from the asset browser. This change
allows users to drag-drop world assets onto the Viewport and have them
appended/linked to their scene.
Differential Revision: https://developer.blender.org/D12566
|
|
Was trying to get asset information even when there was none, i.e. when
the material wasn't an asset or not dragged from the Asset Browser.
|
|
This patch changes the drop named material tooltip to give feedback to
the user what is going to happen when they invoke the change.
There are 3 states:
* "": Operator will be canceled as not all data is present (dropping on
background.)
* "Drop <named material> on <object name> (slot <slot number>, replacing
<current material in slot>).
* "Drop <named material> on <object name> (slot <slot number).
Reviewed By: Severin
Maniphest Tasks: T90371
Differential Revision: https://developer.blender.org/D12106
|
|
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
|
|
This partially reverts cb0b017d8f51: We can't store the asset handle in
the drag data, because the file pointer it wraps may be freed as the
Asset Browser generates its file list.
|
|
Would previously pass a few properties that are available via the
asset-handle now. This asset-handle is also required for some of the
asset API, e.g. the temporary ID loading. This will probably be needed
before too long.
|
|
Also use doxy style function reference `#` prefix chars when
referencing identifiers.
|
|
|
|
The depth cache (located in `RegionView3D::depths`) is used for quick
and simple occlusion testing in:
- particle selection,
- "Draw Curve" operator and
- "Interactive Light Track to Cursor" operator,
However, keeping a texture buffer in cache is not a recommended practice.
For displays with high resolution like 8k this represents something
around 132MB.
Also, currently, each call to `ED_view3d_depth_override` invalidates
the depth cache. So that depth is never reused in multiple calls from
an operator (this was not the case in blender 2.79).
This commit allows to create a depth cache and release it in the same
operator. Thus, the buffer is kept in cache for a short time, freeing
up space.
No functional changes.
|
|
|
|
Creating a new full screen area had it's area initialized as empty,
updating the screen then set the area to a 3D view (as a fallback),
before the actual area type was set.
This made setting the intended space-type run the 3D views exit callback
on a 3D view without a View3D struct allocated, which the exit callback
needed to account for.
Resolve by calling ED_screen_change after the area type has been set.
|
|
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
|
|
Clear the runtime data structs instead of individual members,
this simplifies adding new runtime members as there are at least
two places they would need to be cleared.
Resolves error in D8883.
|
|
The operator run when dropping objects would duplicate the dropped object and
place that in the scene, even though that was just appended. Addressed by
making the duplication optional for the operator. If the duplication is not
requested, the object is just added to the scene (if needed), repositioned
based on the drop location and selected (deselecting other objects).
This makes the operator work as expected when using it to drop assets.
Reviewed as part of https://developer.blender.org/D11536.
Reviewed by: Bastien Montagne
|
|
All other access to the Base structure from Python was removed,
it seems this was left in by accident.
Ref T85675
|
|
Outliner uses a lot `NC_ID | NA_EDITED` e.g., which was not caught by
the View3D editor for update.
|
|
Since {rB46aa70cb486d}, using `NC_SPACE | ND_SPACE_VIEW3D` as notifier is
restricted to space data as a reference. This was still used though for
RNA updates in other places (namely `rna_camera`, `rna_scene`,
`rna_animviz`), and passing NULL would automatically set the notifier
reference to the owner id. Above commit would happily filter these out,
leading to missing refreshes.
Now use more specific notifiers (in case of animviz a new
`ND_DRAW_ANIMVIZ` was added).
This was reported for Camera background images btw.
Fixes T86670.
Maniphest Tasks: T86670
Differential Revision: https://developer.blender.org/D10758
|
|
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.
|
|
The previous behavior meant that changing an objects visibility
effectively changed the current mode - which missed necessary
updates for the tool-system (for example).
There was already a check for edit-mode, now expected to all modes.
This makes the test-case described in T83013 work as expected.
|
|
Approximately 91 spelling corrections, almost all in comments.
Differential Revision: https://developer.blender.org/D10288
Reviewed by Harley Acheson
|
|
|