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-25Cleanup: replace C-style casts with functional casts for numeric typesCampbell Barton
2022-09-25Cleanup: remove redundant double parenthesisCampbell Barton
2022-09-23Mesh: Move edge crease out of MEdgeHans Goudey
This is very similar to D14077. There are two differences though. First is that vertex creases are already stored in a separate layer, and second is that we can now completely remove use of `Mesh.cd_flag`, since that information is now inherent to whether the layers exist. There are two functional differences here: * Operators are used to add and remove layers instead of a property. * The "crease" attribute can be created and removed by geometry nodes. The second change should make various geometry nodes slightly faster, since the "crease" attribute was always processed before. Creases are now interpolated generically in the CustomData API too, which should help maintain the values across edits better. Meshes get an `edge_creases` RNA property like the existing vertex property, to provide more efficient access to the data in Cycles. One test failure is expected, where different rounding between float the old char storage means that 5 additional points are scattered in a geometry nodes test. Differential Revision: https://developer.blender.org/D15927
2022-09-23Cleanup: use ELEM macroCampbell Barton
2022-09-21Cleanup: unused variable warningCampbell Barton
2022-09-20Fix T101220: UV proportional editing not working correctly with UV Sync ↵Germano Cavalcante
Selection Regression introduced in rb2ba1cf4b40fc. The `MLOOPUV_VERTSEL` flag only indicates UV selection without sync.
2022-09-20Fix T101196: constraint plane failing in side orthographic viewsGermano Cavalcante
Caused due to an inaccuracy when the values of `in` and `out` are too close. The solution is to project the value of `in` directly onto the plane.
2022-09-20UV: extend custom grid sizes to set each axis separatelyChris Blackbourn
For example, allows a custom UV grid size of 4 x 12. TODO: Fix snapping with custom UV grid sizes. Manifest Tasks: T78391 Differential Revision: https://developer.blender.org/D16000
2022-09-19Cleanup: spellingCampbell Barton
2022-09-16Fix T101040: Blender Crashes When snap roll a bone in armatureGermano Cavalcante
The modes that don't support individual projection shouldn't support FACE_NEAREST either. Differential Revision: https://developer.blender.org/D15970
2022-09-16Cleanup: spelling in commentsCampbell Barton
2022-09-16Cleanup: formatCampbell Barton
2022-09-15UV: rename "Pixel Snap Mode" to "Pixel Round Mode"Chris Blackbourn
Maniphest Tasks: T78391 Differential Revision: https://developer.blender.org/D15952
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-12Fix T100851: Sync markers does not work for numinputPhilipp Oeser
special_aftertrans_update would always use TransInfo values (not the values_final -- we need the final values to follow numinput, snapping, etc). Maniphest Tasks: T100851 Differential Revision: https://developer.blender.org/D15893
2022-09-12UV: support uv seams when computing uv islandsChris Blackbourn
An edge can be marked BM_ELEM_SEAM, which means the UV co-ordinates on either side of the edge are actually independent, even if they happen to currently have the same value. This commit optionally add support for UV Seams when computing islands. Affects UV sculpt tools, individual origins, UV stitch and changing UV selection modes etc. Required for upcoming packing refactor which requires seam support when computing islands. Differential Revision: https://developer.blender.org/D15875
2022-09-09Mesh: Move bevel weight out of MVert and MEdgeHans Goudey
As described in T95966, the goal is to move to a "struct of arrays" approach rather than gathering an arbitrary set of data in hard-coded structs. This has performance benefits, but also code complexity benefits (this patch removes plenty of code, though the boilerplate for the new operators outweighs that here). To mirror the internal change, the options for storing mesh bevel weights are converted into operators that add or remove the layer, like for some other layers. The most complex change is to the solidify modifier, where bevel weights had special handling. Other than that, most changes are removing clearing of the weights, boilerplate for the add/remove operators, and removing the manual transfer of bevel weights in bmesh - mesh conversion. Eventually bevel weights can become a fully generic attribute, but for now this patch aims to avoid most functional changes. Bevel weights are still written and read from the mesh in the old way, so neither forward nor backward compatibility are affected. As described in T95965, writing in the old format will be done until 4.0. Differential Revision: https://developer.blender.org/D14077
2022-09-07Cleanup: Tweak naming for recently added mesh accessorsHans Goudey
Use `verts` instead of `vertices` and `polys` instead of `polygons` in the API added in 05952aa94d33eeb50. This aligns better with existing naming where the shorter names are much more common.
2022-09-06Cleanup: spelling in comments, formatting, move comments into headersCampbell Barton
2022-09-06GPU: remove 'GPU_SHADER_2D_LINE_DASHED_UNIFORM_COLOR'Germano Cavalcante
The only difference between `GPU_SHADER_2D_LINE_DASHED_UNIFORM_COLOR` and `GPU_SHADER_3D_LINE_DASHED_UNIFORM_COLOR` is that in the vertex shader the 2D version uses `vec4(pos, 0.0, 1.0)` and the 3D version uses `vec4(pos, 1.0)`. But VBOs with 2D attributes work perfectly in shaders that use 3D attributes. Components not specified are filled with components from `vec4(0.0, 0.0, 0.0, 1.0)`. So there is no real benefit to having two different shader versions.
2022-09-05GPU: remove 'GPU_SHADER_2D_UNIFORM_COLOR'Germano Cavalcante
The only real difference between `GPU_SHADER_2D_UNIFORM_COLOR` and `GPU_SHADER_3D_UNIFORM_COLOR` is that in the vertex shader the 2D version uses `vec4(pos, 0.0, 1.0)` and the 3D version uses `vec4(pos, 1.0)`. But VBOs with 2D attributes work perfectly in shaders that use 3D attributes. Components not specified are filled with components from `vec4(0.0, 0.0, 0.0, 1.0)`. So there is no real benefit to having two different shader versions. This will simplify porting shaders to python as it will not be necessary to use a 3D and a 2D version of the shaders. In python the new name for '2D_UNIFORM_COLOR'' and '3D_UNIFORM_COLOR' is 'UNIFORM_COLOR', but the old names still work for backward compatibility. Differential Revision: https://developer.blender.org/D15836
2022-09-05Mesh: Remove redundant custom data pointersHans Goudey
For copy-on-write, we want to share attribute arrays between meshes where possible. Mutable pointers like `Mesh.mvert` make that difficult by making ownership vague. They also make code more complex by adding redundancy. The simplest solution is just removing them and retrieving layers from `CustomData` as needed. Similar changes have already been applied to curves and point clouds (e9f82d3dc7ee, 410a6efb747f). Removing use of the pointers generally makes code more obvious and more reusable. Mesh data is now accessed with a C++ API (`Mesh::edges()` or `Mesh::edges_for_write()`), and a C API (`BKE_mesh_edges(mesh)`). The CoW changes this commit makes possible are described in T95845 and T95842, and started in D14139 and D14140. The change also simplifies the ongoing mesh struct-of-array refactors from T95965. **RNA/Python Access Performance** Theoretically, accessing mesh elements with the RNA API may become slower, since the layer needs to be found on every random access. However, overhead is already high enough that this doesn't make a noticible differenc, and performance is actually improved in some cases. Random access can be up to 10% faster, but other situations might be a bit slower. Generally using `foreach_get/set` are the best way to improve performance. See the differential revision for more discussion about Python performance. Cycles has been updated to use raw pointers and the internal Blender mesh types, mostly because there is no sense in having this overhead when it's already compiled with Blender. In my tests this roughly halves the Cycles mesh creation time (0.19s to 0.10s for a 1 million face grid). Differential Revision: https://developer.blender.org/D15488
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-30Cleanup: spelling in commentsCampbell Barton
2022-08-28Merge branch 'blender-v3.3-release'Campbell Barton
2022-08-28Fix running transform without a regionCampbell Barton
Running transform in background mode or without a region would crash.
2022-08-27UV: support constrain-to-bounds for uv rotation operatorChris Blackbourn
Differential Revision: https://developer.blender.org/D15730
2022-08-26Cleanup: use 'len_v2'Germano Cavalcante
Simplifies readability and avoids repeat casts.
2022-08-26Merge branch 'blender-v3.3-release'Germano Cavalcante
2022-08-26Transform: Use more general approach to node view updateGermano Cavalcante
With rBe6a557952ead, concerns were reported about missing updates when the view is moved other than through the Edge Pan system. Although the transform operator blocks navigation in general, it is good to avoid these cases.
2022-08-26Merge branch 'blender-v3.3-release'Germano Cavalcante
2022-08-26Fix T100632: Regression: Node border snap guide line not drawing properlyGermano Cavalcante
Caused by {rBd2271cf93926}. Color values were being used without being initialized.
2022-08-26Fix T100633: Node Editor: Edge scrolling breaks node snappingGermano Cavalcante
The view offset, calculated by the Edge Pan system, only affects the position of the nodes, but forget to update: - snapping data - final value of transform - values used for custom drawing Therefore, to avoid having to update a lot of scattered data, the `transformViewUpdate` utility has been implemented to recalculate input values when the view changes. This utility does more than is necessary to fix the bug, but with that, it can work in any situation.
2022-08-26Fix T100633: Node Editor: Edge scrolling breaks node snappingGermano Cavalcante
The view offset, calculated by the Edge Pan system, only affects the position of the nodes, but forget to update: - snapping data - final value of transform - values used for custom drawing Therefore, to avoid having to update a lot of scattered data, the `transformViewUpdate` utility has been implemented to recalculate input values when the view changes. This utility does more than is necessary to fix the bug, but with that, it can work in any situation.
2022-08-26Cleanup: reduce variable scopeCampbell Barton
2022-08-23Cleanup: match names between functions & declarationsCampbell Barton
2022-08-17Cleanup: Move view layer array utils from macros to functionsHans Goudey
These macros don't compile in C++ because of taking an address of a temporary and use of designated initializers. Besides that, using functions can improve debugging and type safety. Differentil Revision: https://developer.blender.org/D15693
2022-08-16Sculpt: Fix redo panel bugsJoseph Eagar
SCULPT_undo_push_begin no longer takes an explicit name. Instead it takes a wmOperator pointer and uses op->type->name for the name. This is necassary for the redo panel to work and should fix the entire class of bugs related to misspelled undo push names. Cases where the calling operator is not registered may use SCULPT_undo_push_begin_ex if desired; it takes a name string as before.
2022-08-15GPU: replace GLEW with libepoxyChristian Rauch
With libepoxy we can choose between EGL and GLX at runtime, as well as dynamically open EGL and GLX libraries without linking to them. This will make it possible to build with Wayland, EGL, GLVND support while still running on systems that only have X11, GLX and libGL. It also paves the way for headless rendering through EGL. libepoxy is a new library dependency, and is included in the precompiled libraries. GLEW is no longer a dependency, and WITH_SYSTEM_GLEW was removed. Includes contributions by Brecht Van Lommel, Ray Molenkamp, Campbell Barton and Sergey Sharybin. Ref T76428 Differential Revision: https://developer.blender.org/D15291
2022-08-11Cleanup: refactoring uvislands to prepare for python apiChris Blackbourn
Add element_map->island_total_uvs. Add element_map->island_total_unique_uvs. Simplify callers based on new members. Add comments. Resolves: D15598
2022-08-09Cleanup: use own username in code-comment tagsCampbell Barton
2022-08-08Merge branch 'blender-v3.3-release'Germano Cavalcante
2022-08-08Revert "Fix T100280: GG not toggling the offset transform mode in tracker"Germano Cavalcante
This reverts commits b72eddac6190353714745756dcc335f98cda1369 and f8b5706a1ffe61ae3bdd949ad851d6e9ff3fe188. And fixes T100265. It brings more problems than solutions.
2022-08-08Merge branch 'blender-v3.3-release'Germano Cavalcante
2022-08-08Fix T100280: GG not toggling the offset transform mode in trackerGermano Cavalcante
Caused by {rB791bfae1d64b}. The solution was to create the special handle for the Move Clip and Mask transformation. One change that cannot be reversed is showing the `G` shortcut in the statusbar. But the description of this shortcut was not even correct before.
2022-08-06Cleanup: Simplify NULL handling for BKE_image_find_nearest_tileChris Blackbourn
Differential Revision: https://developer.blender.org/D15616
2022-08-04Fix T100129: Status bar incorrectly shows "[G] Move" after pressing G once ↵Germano Cavalcante
in Edit Mode Add specific modal keyitem for Vert/Edge Slide or TrackBall. Note that there is a workround to avoid repeated keys in the status bar. Reviewed By: campbellbarton Maniphest Tasks: T100129 Differential Revision: https://developer.blender.org/D15597
2022-08-04Fix T100129: Status bar incorrectly shows "[G] Move" after pressing G once ↵Germano Cavalcante
in Edit Mode Add specific modal keyitem for Vert/Edge Slide or TrackBall. Note that there is a workround to avoid repeated keys in the status bar. Reviewed By: campbellbarton Maniphest Tasks: T100129 Differential Revision: https://developer.blender.org/D15597
2022-07-30Cleanup: Clang tidyHans Goudey