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-01-13Refactor: Move normals out of MVert, lazy calculationHans Goudey
As described in T91186, this commit moves mesh vertex normals into a contiguous array of float vectors in a custom data layer, how face normals are currently stored. The main interface is documented in `BKE_mesh.h`. Vertex and face normals are now calculated on-demand and cached, retrieved with an "ensure" function. Since the logical state of a mesh is now "has normals when necessary", they can be retrieved from a `const` mesh. The goal is to use on-demand calculation for all derived data, but leave room for eager calculation for performance purposes (modifier evaluation is threaded, but viewport data generation is not). **Benefits** This moves us closer to a SoA approach rather than the current AoS paradigm. Accessing a contiguous `float3` is much more efficient than retrieving data from a larger struct. The memory requirements for accessing only normals or vertex locations are smaller, and at the cost of more memory usage for just normals, they now don't have to be converted between float and short, which also simplifies code In the future, the remaining items can be removed from `MVert`, leaving only `float3`, which has similar benefits (see T93602). Removing the combination of derived and original data makes it conceptually simpler to only calculate normals when necessary. This is especially important now that we have more opportunities for temporary meshes in geometry nodes. **Performance** In addition to the theoretical future performance improvements by making `MVert == float3`, I've done some basic performance testing on this patch directly. The data is fairly rough, but it gives an idea about where things stand generally. - Mesh line primitive 4m Verts: 1.16x faster (36 -> 31 ms), showing that accessing just `MVert` is now more efficient. - Spring Splash Screen: 1.03-1.06 -> 1.06-1.11 FPS, a very slight change that at least shows there is no regression. - Sprite Fright Snail Smoosh: 3.30-3.40 -> 3.42-3.50 FPS, a small but observable speedup. - Set Position Node with Scaled Normal: 1.36x faster (53 -> 39 ms), shows that using normals in geometry nodes is faster. - Normal Calculation 1.6m Vert Cube: 1.19x faster (25 -> 21 ms), shows that calculating normals is slightly faster now. - File Size of 1.6m Vert Cube: 1.03x smaller (214.7 -> 208.4 MB), Normals are not saved in files, which can help with large meshes. As for memory usage, it may be slightly more in some cases, but I didn't observe any difference in the production files I tested. **Tests** Some modifiers and cycles test results need to be updated with this commit, for two reasons: - The subdivision surface modifier is not responsible for calculating normals anymore. In master, the modifier creates different normals than the result of the `Mesh` normal calculation, so this is a bug fix. - There are small differences in the results of some modifiers that use normals because they are not converted to and from `short` anymore. **Future improvements** - Remove `ModifierTypeInfo::dependsOnNormals`. Code in each modifier already retrieves normals if they are needed anyway. - Copy normals as part of a better CoW system for attributes. - Make more areas use lazy instead of eager normal calculation. - Remove `BKE_mesh_normals_tag_dirty` in more places since that is now the default state of a new mesh. - Possibly apply a similar change to derived face corner normals. Differential Revision: https://developer.blender.org/D12770
2022-01-11Select Similar: hide 'threshold' from UI when not usedPhilipp Oeser
When the 'threshold' is not used in the type we are comparing, just hide it. This was obvious for some types (e.g. Materials), but maybe not so on others (e.g. Polygon Sides) and potentionally confusing. Reported by @hitrpr in chat. Differential Revision: https://developer.blender.org/D13760
2022-01-07Cleanup: remove redundant const qualifiers for POD typesCampbell Barton
MSVC used to warn about const mismatch for arguments passed by value. Remove these as newer versions of MSVC no longer show this warning.
2022-01-06Cleanup: spelling in commentsCampbell Barton
2022-01-06Cleanup: Spelling/grammar in commentsHans Goudey
2022-01-05Fix T93695: Discontinuous cutting with the knife toolCian Jinks
An important check to reject edge linehits when a vertex of that edge was already hit was accidentally removed in rB6e77afe6ec7b6a73f218f1fef264758abcbc778a
2022-01-04Fix T94145: Knife tool fails in orthographic modeCian Jinks
Calculating min and max orthographic extent forgot to convert to worldspace coordinates.
2021-12-25Cleanup: Use array for BKE cursor functionsAaron Carlisle
Differential Revision: https://developer.blender.org/D12962
2021-12-14Cleanup: correct unbalanced doxygen groupsCampbell Barton
Also add groups in some files.
2021-12-10Cleanup: move public doc-strings into headers for various API'sCampbell Barton
Some doc-strings were skipped because of blank-lines between the doc-string and the symbol and needed to be moved manually. - Added space below non doc-string comments to make it clear these aren't comments for the symbols directly below them. - Use doxy sections for some headers. Ref T92709
2021-12-08Cleanup: move public doc-strings into headers for 'editors'Campbell Barton
Ref T92709
2021-12-03Fix T93541: Use warning instead of error for exceeding layer limitsJesse Yurkovich
Instead of using RPT_ERROR, use RPT_WARNING which will not raise an exception to Python. This broke some scripts (including FBX import) which already check for a None return value. Ref D13458 Reviewed By: campbellbarton
2021-11-30Revert "Fix: Const warning in editmesh_knife.c"Campbell Barton
It's important the coordinates the knife is operating on are never manipulated since it will cause problems which are difficult to troubleshoot. Instead, use a cast in the MEM_freeN(..) call. This reverts commit 8600d4491fa4b349cb80241382c503abaf9c5ce9.
2021-11-30Cleanup: capitalize NOTE tagCampbell Barton
2021-11-26Fix T93130: Frame Selected with selected paint mask does not workPhilipp Oeser
This broke with {rB20fac2eca723} (which landed in 2.63), so long standing bug. Convention for paint modes is: - when no paint mask is active, `Frame Selected` will focus the last stroke - when paint mask is active, `Frame Selected` will focus the selected mask faces To check the right vert coords we have to offset with `mp->loopstart`. Maniphest Tasks: T93130 Differential Revision: https://developer.blender.org/D13247
2021-11-23Fix: Const warning in editmesh_knife.cErik
Fixes a warning caused by freeing a const pointer. This commit removes the const modifier. Differential Revision: https://developer.blender.org/D13321
2021-11-22Fix T84493 issue with selection after boolean.Howard Trickey
According to Blender selection rules, selections should be flushed to containing elements. Added an EDMB_select_flush() after edit mode booleans or intersects are done. Hopefully this doesn't break any scripts that might have been depending on the old (broken) behavior.
2021-11-13BLF: Use Floats for Font Point SizesHarley Acheson
Allow the use of floating-point values for font point sizes, which allows greater precision and flexibility for text output. See D8960 for more information, details, and justification. Differential Revision: https://developer.blender.org/D8960 Reviewed by Campbell Barton
2021-11-13Cleanup: spelling in comments, comment block formattingCampbell Barton
2021-11-09Fix T92318: adding layers (UVs, ...) doesn't notify about limitPhilipp Oeser
When adding certain customdata layers (namely UVs, vertex colors and sculpt vertex colors), the user does not get notified the specific limit has been hit (blender just silently does nothing). Now inform the user [decided to not do this in poll() since it could get messy once operators are extended to operate on all selected objects, so left this as a visible error in execute() -- or from python]. Maniphest Tasks: T92318 Differential Revision: https://developer.blender.org/D13147
2021-11-05Cleanup: use (s) postfix for messages that may be pluralCampbell Barton
Ref 01c824ac88a0ff95a26c26be09f7a8853e47e446
2021-10-27WM: de-duplicate cursor motion checks for selection pickingCampbell Barton
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.
2021-10-27Cleanup: use UNUSED_FUNCTION(..) attributeCampbell Barton
Otherwise this function may fail to compile when other changes are made.
2021-10-27Knife: Preserve right click cancel functionalityCian Jinks
Currently, the knife does not use right click cancel. It causes users to accidentally delete entire cuts easily. This patch allows right click cancel when no cuts have been made. This makes it consistent with other tools when switching between them. More info: https://devtalk.blender.org/t/gsoc-2021-knife-tool-improvements-feedback/19047/175?u=hobbesos
2021-10-26Cleanup: Confusion with knife xray functionalityCian Jinks
2021-10-26Fix: Knife unused function warningCian Jinks
2021-10-26Fix: Knife measurements broken when a cut point is in spaceCian Jinks
Knife angle measurements were mis-aligned if a cut point was in space. Specifically, the arc drawing would not match with the cut line. Fixed by removing a correction for kcd->prev.cage. This correction was originally added for panning with measurements to work. In hindsight it is not needed and only introduces issues like this.
2021-10-21Cleanup: use underscore separators for event struct membersCampbell Barton
Improve readability using underscores for separators, e.g. prev_click_time instead of prevclicktime.
2021-10-20Cleanup: use an array for wmEvent cursor position variablesAaron Carlisle
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
2021-10-20Cleanup: use elem macrosCampbell Barton
2021-10-19Cleanup: use 'e' prefix for enum typesCampbell Barton
2021-10-13Cleanup: Snap Context RefactorGermano Cavalcante
Move runtime parameters out of context creation. Not being able to choose another region and v3d limits the use of the snap API.
2021-10-11Fix T91785: Change max input limit for knife tool angle snappingPratik Borhade
Patch changes the Knife Tool angle snapping input limit to 180. Differential Revision: https://developer.blender.org/D12728
2021-10-07Cleanup: make formatDalai Felinto
2021-10-06UI: Boolean rename "Self" to "Self Intersection"Aaron Carlisle
Better to be more explicit here, also this matches the recent Boolean Node.
2021-09-29Fix: Knife undo with no cut segments leftCian Jinks
Now if a user presses the knife tool undo key when there are no more cut segments to undo, the operator exits. Previously, it did nothing.
2021-09-28Cleanup: Removed redundant if macroCian Jinks
2021-09-27Fix knife tool missing refresh changing the lock axesCampbell Barton
2021-09-27Fix knife tool using an invalid event value checkCampbell Barton
The events value was checked without checking the expected modal state.
2021-09-27Knife: Expose XYZ axis locking in modal keymapCian Jinks
A small quality of life improvement that will allow users to change the keys used for axis locking.
2021-09-23Cleanup: spelling in commentsCampbell Barton
2021-09-23Applying patch D12600, GSOC Knife Tools branchCian Jinks
This adds constrained angle mode improvements, snapping to global and local orientation, visible distance and angle measurements, undo capability, x-ray mode, multi-object edit mode. See https://developer.blender.org/D12600 for more details. Note: this project moved some of the default keymappings around a bit, as discussed with users in the thread https://devtalk.blender.org/t/gsoc-2021-knife-tool-improvements-feedback/19047 We'll change the manual documentation in the next couple of days.
2021-09-22Revert "Make knife drawing anti aliased (Monkey work based on D11333)"Jeroen Bakker
This reverts commit 96027b2d15b73d2b5086899425021ea4c903fa00. The patch asserts on different occasions and needs more work.
2021-09-21Make knife drawing anti aliased (Monkey work based on D11333)Urko
Knife tool. Make the drawing anti aliased and consistent by using 3D_POLYLINE/3D_POINT shaders, and making sure alpha blending is on. Monkey work based on [[ https://developer.blender.org/D11333 | D11333 ]] done by [[ https://developer.blender.org/p/krash/ | Anthony Edlin (krash)]] Reviewed By: jbakker Differential Revision: https://developer.blender.org/D12287
2021-09-21Keymap: preference for fallback-tool with RMB selectCampbell Barton
Expose a key-map preference "Fallback Tool (RMB)", disabled by default. The right mouse button uses the fallback tool (currently visible selection tool in the toolbar), instead of always tweaking. When any selection tool is active, right mouse always tweaks. To enable fallback selection on RMB, set the "Right Mouse Select Action" to "Selection Tool". Internal changes: - Add fall-back key-maps, separate key-maps needed for when the tool is run as a fall-back. This is needed so RMB-select can support fall-back tools, so left-mouse can be used when it's the active tool and RMB can be used as a fall-back action when another tool is active. - Add options field to tools so tools without gizmos can enable the full-back tool keymap. - Support multiple key-maps for keymap handlers. - Fall-back keymaps now co-exist with the tool-keymaps. So both keymaps may be active at once - using different mouse buttons. When gizmos are in use, a highlighted gizmo prioritizes the tool-keymap over the fall-back keymap. Resolves T83690. Reviewed By: JulienKaspar Ref D12493
2021-09-17UI: expose "Lasso Select" & "Extrude to Cursor" in menusCampbell Barton
- Show "Lasso Select" in menus (along with Box & Circle select) - Show "Extrude to Cursor" (along with other extrude actions). - Rename operators that add/extrude on Ctrl-Click since their names were inconsistent. This is mainly for discoverability.
2021-09-17UI: enable the depend-on-cursor flag for some operatorsCampbell Barton
- Bend (Transform). - Extrude to Cursor. - Lasso Select (related operators such as node-cut links, mask.. etc). - Rip Mesh / UV's. - Vertex/Edge Slide.
2021-09-16Fix bisect gizmo offset while draggingCampbell Barton
2021-09-15Gizmo: add flag to hide the gizmo group during interactionCampbell Barton
This allows a hack to be removed that temporarily overwrote the 3D views gizmo display flag. Also reverse change from fb27a9bb983ce74b8d8f5f871cf0706dd1e25051 that runs poll on modal gizmo groups as there is some risk that the poll function unlinks the gizmo.
2021-09-14UI: keep navigation gizmos visible during modal operatorsCampbell Barton
Hiding viewport navigation gizmos caused the UI to "flicker" unnecessarily, the axis could also be useful as a reference. Resolves T73684