Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-09-23View3d: move space_view3d.c to c++Jacques Lucke
2022-09-17Cleanup: spelling, punctuation & repeated words in commentsCampbell Barton
2022-09-14ViewLayer: Lazy sync of scene data.Monique Dewanchand
When a change happens which invalidates view layers the syncing will be postponed until the first usage. This will improve importing or adding many objects in a single operation/script. `BKE_view_layer_need_resync_tag` is used to tag the view layer to be out of sync. Before accessing `BKE_view_layer_active_base_get`, `BKE_view_layer_active_object_get`, `BKE_view_layer_active_collection` or `BKE_view_layer_object_bases` the caller should call `BKE_view_layer_synced_ensure`. Having two functions ensures that partial syncing could be added as smaller patches in the future. Tagging a view layer out of sync could be replaced with a partial sync. Eventually the number of full resyncs could be reduced. After all tagging has been replaced with partial syncs the ensure_sync could be phased out. This patch has been added to discuss the details and consequences of the current approach. For clarity the call to BKE_view_layer_ensure_sync is placed close to the getters. In the future this could be placed in more strategical places to reduce the number of calls or improve performance. Finding those strategical places isn't that clear. When multiple operations are grouped in a single script you might want to always check for resync. Some areas found that can be improved. This list isn't complete. These areas aren't addressed by this patch as these changes would be hard to detect to the reviewer. The idea is to add changes to these areas as a separate patch. It might be that the initial commit would reduce performance compared to master, but will be fixed by the additional patches. **Object duplication** During object duplication the syncing is temporarily disabled. With this patch this isn't useful as when disabled the view_layer is accessed to locate bases. This can be improved by first locating the source bases, then duplicate and sync and locate the new bases. Will be solved in a separate patch for clarity reasons ({D15886}). **Object add** `BKE_object_add` not only adds a new object, but also selects and activates the new base. This requires the view_layer to be resynced. Some callers reverse the selection and activation (See `get_new_constraint_target`). We should make the selection and activation optional. This would make it possible to add multiple objects without having to resync per object. **Postpone Activate Base** Setting the basact is done in many locations. They follow a rule as after an action find the base and set the basact. Finding the base could require a resync. The idea is to store in the view_layer the object which base will be set in the basact during the next sync, reducing the times resyncing needs to happen. Reviewed By: mont29 Maniphest Tasks: T73411 Differential Revision: https://developer.blender.org/D15885
2022-09-14Adding `const Scene*` parameter in many areas.Monique Dewanchand
Related to {D15885} that requires scene parameter to be added in many places. To speed up the review process the adding of the scene parameter was added in a separate patch. Reviewed By: mont29 Maniphest Tasks: T73411 Differential Revision: https://developer.blender.org/D15930
2022-09-10Cleanup: replace strncpy with BLI_strncpyCampbell Barton
Also replace strncpy+strcat with BLI_string_join
2022-09-08Cleanup: make meaning of base visibility flags more clearBrecht Van Lommel
Rename, add comments, and use flag in the depsgraph to ensure the logic matches. Differential Revision: https://developer.blender.org/D15883
2022-09-01Cleanup: Remove/replace View Layer macros.Monique Dewanchand
This patch is a cleanup required before refactoring the view layer syncing process {T73411}. * Remove FIRSTBASE. * Remove LASTBASE. * Remove BASACT. * Remove OBEDIT_FROM_WORKSPACE. * Replace OBACT with BKE_view_layer_active_object. * Replace OBEDIT_FROM_VIEW_LAYER with BKE_view_layer_edit_object. Reviewed By: mont29 Maniphest Tasks: T73411 Differential Revision: https://developer.blender.org/D15799
2022-08-27Cleanup: pass notifiers as constCampbell Barton
2022-08-10Realtime Compositor: Add evaluator and engineOmar Emara
This patch adds the core realtime compositor evaluator as well as a compositor draw engine powered by the evaluator that operates in the viewport. The realtime compositor is a new GPU accelerated compositor that will be used to power the viewport compositor imminently as well as the existing compositor in the future. This patch only adds the evaluator and engine as an experimental feature, the implementation of the nodes themselves will be committed separately. See T99210. Differential Revision: https://developer.blender.org/D15206 Reviewed By: Clement Foucault
2022-08-09Cleanup: use own username in code-comment tagsCampbell Barton
2022-07-07UI: Superimposed pin icon for workspace scene pinning in the scene switcherJulian Eisel
Followup to the previous commit, to display a pin icon in the scene switcher. This is a good indicator to have and such workspace-wide functionality should be available in the topbar, close to what it belongs to (scene switching). Downside is that it makes this already crowded region even more crowded. But thanks to the use of superimposed icons, it's not too noisy visually. Differential Revision: https://developer.blender.org/D11890 Reviewed by: Campbell Barton
2022-06-09Cleanup: use const variables & argumentsCampbell Barton
2022-05-24Fix T95706: Material asset not applied if appended and then linkedJulian Eisel
8f79fa9c6780 was an attempt to fix this already, but it didn't quite work. Problem was that the tooltip was messing with the drop-box and operator properties, setting the name property for its own internal logic. This name property would then be used rather than the session UUID to query the material, which gave the wrong material (linking can result in multiple IDs of the same type with the same name). A followup commit will further sanitize this.
2022-05-23Fix further issues when mixing link & append for asset drag & dropJulian Eisel
917c096be6b9 applied to objects only, this also applies the same fix for the general 3D View drop operations, e.g. used for dragging materials, images, worlds, etc. This is needed to fix T95706, but apparently something else is still going on. Needs further investigation.
2022-05-23Fix possible issues when mixing link & append for asset drag & dropJulian Eisel
The operators to handle object drag and drop (from the asset browser, outliner, etc.) used the object name to find the object to add and place. This is problematic with linking and/or library overrides, since this may lead to multiple objects with the same name. So the wrong object would be used by the drop operators. Partially fixes T97320. T95706 probably needs the same fix but for materials. As a side-effect, the "Name" button won't show up in the Adjust Last Operation panel anymore. This isn't really useful, and I doubt this was ever intentionally exposed in the UI.
2022-04-28Fix: Incorrect conversion from C bitfield syntaxHans Goudey
Recent cleanups 9a8669ac81b99b2 and 1c790555a02bfc3 incorrectly interpereted the bitfield width syntax as a default value. Also resolve two other compilation warnings.
2022-04-28Snap Cursor: split 'ED_view3d_cursor_snap_data_get'Germano Cavalcante
Split 'ED_view3d_cursor_snap_data_get' into 'update' and 'get' functions Sometimes we just want to update and sometimes we just get the result. Make it clear.
2022-04-28VSE: Add precise drag and drop and strip previewsSebastian Parborg
This patch adds the drag and drop strip previews in the VSE. It also adds two new functions to the drag and drop API. 1. "draw_in_view" for callbacks that wants to draw elements in local viewport coordinates 2. "on_drag_start" that can be used for prefetching data only once at the start of the drag. Reviewed By: Julian, Campbell Differential Revision: http://developer.blender.org/D14560
2022-04-21Curves: show sculpt tool settings in panelsJacques Lucke
Ref T97444. Differential Revision: https://developer.blender.org/D14700
2022-04-08Painting: Canvas switcher for painting brushes/tools.Jeroen Bakker
This patch adds color attributes to TexPaintSlot. This allows an easier selection when painting color attributes. Previously when selecting a paint tool the user had to start a stroke, before the UI reflected the correct TexPaintSlot. Now when switching the slot the active tool is checked and immediate the UI is drawn correctly. In the future the canvas selector will also be used to select an image or image texture node to paint on. Basic implementation has already been done inside this patch. A limitation of this patch is that is isn't possible anymore to rename images directly from the selection panel. This is currently allowed in master. But as CustomDataLayers aren't ID fields and not owned by the material supporting this wouldn't be easy. {F12953989} In the future we should update the create slot operator to also include color attributes. Sources could also be extended to use other areas of the object that use image textures (particles, geom nodes, etc... ). Reviewed By: brecht Maniphest Tasks: T96709 Differential Revision: https://developer.blender.org/D14455
2022-04-01Cleanup: Use const for bounding boxes where possibleHans Goudey
2022-04-01Assets: Instancing operator option for collection asset droppingJulian Eisel
Makes it possible to toggle instancing via the "Adjust Last Operation" panel after dropping a collection asset into the viewport. A design task that puts this into more context is pending still, but this is a useful option to have either way. Differential Revision: https://developer.blender.org/D14507 Reviewed by: Bastien Montagne
2022-03-11Fix out of order event handling when calling operators from gizmosCampbell Barton
Activating a gizmo used the windows eventstate which may have values newer than the event used to activate the gizmo. This meant transforms check for the key that activated transform could be incorrect. Support passing an event when calling operators to avoid this problem.
2022-02-18Curves: add initial edit mode supportKévin Dietrich
This adds initial support for edit mode for the experimental new curves object. For now we can only toggle in and out of the mode, no real interraction is possible. This patch also adds empty menus in edit mode. Those were added mainly to quiet warnings as the menus are programmatically added to the edit mode based on the object type and context. Ref T95769 Reviewed By: JacquesLucke, HooglyBoogly Maniphest Tasks: T95769 Differential Revision: https://developer.blender.org/D14136
2022-02-18Curves: initial brush system integration for curves sculpt modeJacques Lucke
This adds the boilerplate code that is necessary to use the tool/brush/paint systems in the new sculpt curves mode. Two temporary dummy tools are part of this patch. They do nothing and only serve to test the boilerplate. When the first actual tool is added, those dummy tools will be removed. Differential Revision: https://developer.blender.org/D14117
2022-02-11File headers: SPDX License migrationCampbell Barton
Use a shorter/simpler license convention, stops the header taking so much space. Follow the SPDX license specification: https://spdx.org/licenses - C/C++/objc/objc++ - Python - Shell Scripts - CMake, GNUmakefile While most of the source tree has been included - `./extern/` was left out. - `./intern/cycles` & `./intern/atomic` are also excluded because they use different header conventions. doc/license/SPDX-license-identifiers.txt has been added to list SPDX all used identifiers. See P2788 for the script that automated these edits. Reviewed By: brecht, mont29, sergey Ref D14069
2022-02-04Merge branch 'blender-v3.1-release'Clément Foucault
2022-02-04Fix T94410: stopping Cycles render in 3D viewport quad view keeps using CPUBrecht Van Lommel
Only one of the four renders was being stopped.
2022-02-03Cleanup: Split View3D navigation code into specific compilation unitsGermano Cavalcante
The view3d_edit.c file is already getting big (5436 lines) and mixes operators of different uses. Splitting the code makes it easier to read and simplifies the implementation of new features. Differential Revision: https://developer.blender.org/D13976
2022-01-26Performance: Remap multiple items in UIJeroen Bakker
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
2022-01-25Revert "Performance: Remap multiple items in UI"Jeroen Bakker
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)
2022-01-25Performance: Remap multiple items in UIJeroen Bakker
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
2021-12-15Fix T93971: "Center Cursor & Frame All" fails to redrawCampbell Barton
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).
2021-12-08Cleanup: move public doc-strings into headers for 'editors'Campbell Barton
Ref T92709
2021-11-19Merge branch 'blender-v3.0-release'Jacques Lucke
2021-11-19Fix T87912: use session id instead of name to identify dropped objectJacques Lucke
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
2021-11-04Cleanup: Remove operator context override for drop-box operatorsJulian Eisel
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.
2021-10-28View3D Context: use correct data typeSybren A. Stüvel
`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.
2021-10-26Assets: Disable snap-dragging for linking object assetsJulian Eisel
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.
2021-10-26Fix linked objects not appearing after dragging in from Asset BrowserJulian Eisel
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.
2021-10-26Fix objects not appearing in Outliner after dragging in from Asset BrowserJulian Eisel
When dragging in an object from an external asset library from the Asset Browser, the Outliner wouldn't update.
2021-10-26Drop object assets and associated objects at the cursor locationCampbell Barton
When dropping asset objects, place them under the mouse-cursor along with any other objects they link in. Ref D12935 Reviewed By: Severin
2021-10-26Assets: allow Mark/Clear Asset operators from 3D ViewportSybren A. Stüvel
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.
2021-10-26Cleanup: 3D View context, early returns for clearer flowSybren A. Stüvel
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.
2021-10-26Cleanup: 3D View context, use enum valuesSybren A. Stüvel
Use explicit enum values instead of returning 0/1 from `view3d_context()`. No functional changes.
2021-10-263D View context: return "ok" when fetching view3d context dirSybren A. Stüvel
`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.
2021-10-26Fix drop of dimensionless objects in 3DViewGermano Cavalcante
The matrix and location were not being calculated in this case.
2021-10-26View3D Snap Cursor: don't limit the number of statesGermano Cavalcante
The benefit of a flat array in this case is small and limiting, so use a linklist.
2021-10-26View3D Snap Cursor: sanitize and increase the maximum amount of statesGermano Cavalcante
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.
2021-10-25Assets: Snapping with visual feedback while draggingGermano Cavalcante
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