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-09Merge branch 'master' into temp-T73411-add-scene-parametersJeroen Bakker
2022-09-09Cleanup: Simplify BKE_mesh_nomain_to_meshHans Goudey
- Remove "take ownership" argument which was confusing and always true - The argument made ownership very confusing - Better to avoid boolean arguments that switch a function's purpose - Remove "mask" argument which was basically wrong and not used properly - "EVERYTHING" was used because developers are wary of removing data - Instead use `CD_MASK_MESH` for its purpose of original mesh data - Remove use of shallow copied temporary mesh, which is unnecessary now - Split shape key processing into separate functions and use C++ types - Copy fields explicitly rather than using memcpy for the whole struct - Use higher level functions and avoid redundant code - The whole idea is pretty simple and can be built from standard logic - Adjust `CustomData` logic to be consistent with "assign" expectations - Clear the layer data from the source, and moves the anonymous ID Differential Revision: https://developer.blender.org/D15857
2022-09-09Cleanup: move return arguments last, use `r_` prefixCampbell Barton
Also use '_num' suffix instead of '_tot'.
2022-09-09Fix T96787: Edit mode normalize fails to respect locked groupsNate Rupsis
Add BKE_object_defgroup_flip_map_unlocked which excludes locked groups from the flip-map. Reviewed By: zanqdo, campbellbarton Ref D15317
2022-09-08WIP: Adding const Scene* to many areas.Jeroen Bakker
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-08Cleanup: Use C++ methods to retrieve attribute accessorsHans Goudey
Replace `mesh_attributes`, `mesh_attributes_for_write` and the point cloud versions with methods on the `Mesh` and `PointCloud` types. This makes them friendlier to use and improves readability. Differential Revision: https://developer.blender.org/D15907
2022-09-08Cleanup: prefer terms verts/polys over vertices/polygonsCampbell Barton
Follows existing naming for the most part, also use "num" as a suffix in some instances (following our naming conventions).
2022-09-07Cleanup: Remove some references to proxies in comments/log messages.Bastien Montagne
Note that there are still some references to proxies left, in some cases it's unclear if the code related to the comment is even still relevant, this goes beyond mere cleanup to address then.
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-06Fix weight paint smoothing with vertex selection.Alexander Gavrilov
Broken in rB2480b55f216c3137 by incorrectly converting a boolean expression. There is also another suspect expression nearby.
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-02Cleanup: Fix clang-tidy warnings: [modernize-use-bool-literals]Clément Foucault
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-31Mesh: Move material indices to a generic attributeHans Goudey
This patch moves material indices from the mesh `MPoly` struct to a generic integer attribute. The builtin material index was already exposed in geometry nodes, but this makes it a "proper" attribute accessible with Python and visible in the "Attributes" panel. The goals of the refactor are code simplification and memory and performance improvements, mainly because the attribute doesn't have to be stored and processed if there are no materials. However, until 4.0, material indices will still be read and written in the old format, meaning there may be a temporary increase in memory usage. Further notes: * Completely removing the `MPoly.mat_nr` after 4.0 may require changes to DNA or introducing a new `MPoly` type. * Geometry nodes regression tests didn't look at material indices, so the change reveals a bug in the realize instances node that I fixed. * Access to material indices from the RNA `MeshPolygon` type is slower with this patch. The `material_index` attribute can be used instead. * Cycles is changed to read from the attribute instead. * BMesh isn't changed in this patch. Theoretically it could be though, to save 2 bytes per face when less than two materials are used. * Eventually we could use a 16 bit integer attribute type instead. Ref T95967 Differential Revision: https://developer.blender.org/D15675
2022-08-31Merge branch 'blender-v3.3-release'Bastien Montagne
2022-08-31LibOverride: Replace linked objects by their overrides when created from 3DView.Bastien Montagne
From the 3DView code has basically no knowledge of collection hierarchy, so we can either not remap any local usage of linked objects that are being overridden, or remap them in all their local collections. The second behavior makes most sense in the vast majority of cases. Note that this was only an issue when directly linking and overriding objects, not when doing so through collections.
2022-08-31Cleanup: break before the default case in switch statementsCampbell Barton
While missing the break before a default that only breaks isn't an error, it means adding new cases needs to remember to add the break for an existing case, changing the default case will also result in an unintended fall-through. Also avoid `default:;` and add an explicit break.
2022-08-30Attributes: Improve custom data initialization optionsHans Goudey
When allocating new `CustomData` layers, often we do redundant initialization of arrays. For example, it's common that values are allocated, set to their default value, and then set to some other value. This is wasteful, and it negates the benefits of optimizations to the allocator like D15082. There are two reasons for this. The first is array-of-structs storage that makes it annoying to initialize values manually, and the second is confusing options in the Custom Data API. This patch addresses the latter. The `CustomData` "alloc type" options are rearranged. Now, besides the options that use existing layers, there are two remaining: * `CD_SET_DEFAULT` sets the default value. * Usually zeroes, but for colors this is white (how it was before). * Should be used when you add the layer but don't set all values. * `CD_CONSTRUCT` refers to the "default construct" C++ term. * Only necessary or defined for non-trivial types like vertex groups. * Doesn't do anything for trivial types like `int` or `float3`. * Should be used every other time, when all values will be set. The attribute API's `AttributeInit` types are updated as well. To update code, replace `CD_CALLOC` with `CD_SET_DEFAULT` and `CD_DEFAULT` with `CD_CONSTRUCT`. This doesn't cause any functional changes yet. Follow-up commits will change to avoid initializing new layers where the correctness is clear. Differential Revision: https://developer.blender.org/D15617
2022-08-28Cleanup: replace NULL with nullptr for C++ filesCampbell Barton
2022-08-28Merge branch 'blender-v3.3-release'Campbell Barton
2022-08-28Fix crashes running operators in invalid contextsCampbell Barton
Fix for running operators outside of expected contexts. - UI_OT_view_drop (poll) - UI_OT_view_item_rename (poll) - OBJECT_OT_gpencil_modifier_move_to_index - OBJECT_OT_modifier_move_to_index - OBJECT_OT_geometry_nodes_input_attribute_toggle - OBJECT_OT_geometry_node_tree_copy_assign - OBJECT_OT_shaderfx_remove - OBJECT_OT_shaderfx_copy - POSE_OT_relax (& other pose slide operators).
2022-08-26Cleanup: spelling in comments, formatCampbell Barton
2022-08-24Merge branch 'blender-v3.3-release'Bastien Montagne
2022-08-24Cleanup warning about missing pointer casting.Bastien Montagne
2022-08-24Merge branch 'blender-v3.3-release'Bastien Montagne
2022-08-24LibOverride: Fix (unreported) crashes in some cases, preserve active object ↵Bastien Montagne
on Clear, general cleanup. Inconsistencies in update/tagging code between different code doing the same 'Clear. liboverride operation lead to crashes in some cases. Unify deg tagging and WM notifiers accross the three editor-level codepaths performing the common Make/Reset/Clear operations. Preserve if possible the active object accross Clear operation. Several cleanup/rename/re-arangement of code to make it more consistent.
2022-08-24Merge branch 'blender-v3.3-release'Campbell Barton
2022-08-24Fix T100606: Apply object transform fails with delta quaternion rotationCampbell Barton
Apply transform failed to clear delta quaternion & axis-angle rotation.
2022-08-23Depsgraph: use more fine grained update tags for scenesBrecht Van Lommel
Ref D15710, this avoids unnecessary sequencer updates for some operations.
2022-08-22Merge branch 'blender-v3.3-release'Bastien Montagne
Conflicts: release/scripts/startup/bl_ui/space_userpref.py
2022-08-22I18n: systematically tag all messages in `RNA_ENUM_ITEM_HEADING`.Bastien Montagne
Add missing labels, and also add tooltips. Unfortunately there is no way currently to extract two messages from a single 'function' call, so unless those type of macros become very widely used, would keep it as manual tagging. Also disambiguate `case` in text context, pretty sure English is one of the very rare languages to use this word for character case too.
2022-08-17Merge branch 'blender-v3.3-release'Bastien Montagne
2022-08-17LibOverride: Remove the 'make all editable' user preferences.Bastien Montagne
This behavior is now implicitely controlled by the 'Make' operations, based either on context or selected items.
2022-08-17Cleanup: Fix outdated comments referring to DispListHans Goudey
2022-08-17Metaball: Evaluate metaball objects as mesh componentsHans Goudey
With the ultimate goal of simplifying drawing and evaluation, this patch makes the following changes and removes code: - Use `Mesh` instead of `DispList` for evaluated basis metaballs. - Remove all `DispList` drawing code, which is now unused. - Simplify code that converts evaluated metaballs to meshes. - Store the evaluated mesh in the evaluated geometry set. This has the following indirect benefits: - Evaluated meshes from metaball objects can be used in geometry nodes. - Renderers can ignore evaluated metaball objects completely - Cycles rendering no longer has to convert to mesh from `DispList`. - We get closer to removing `DispList` completely. - Optimizations to mesh rendering will also apply to metaball objects. The vertex normals on the evaluated mesh are technically invalid; the regular calculation wouldn't reproduce them. Metaball objects don't support modifiers though, so it shouldn't be a problem. Eventually we can support per-vertex custom normals (T93551). Differential Revision: https://developer.blender.org/D14593
2022-08-17Cleanup: add missing doxy sectionsCampbell 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-16Merge branch 'blender-v3.3-release'Bastien Montagne
2022-08-16Cleanup: Unused parameters.Bastien Montagne
2022-08-16Merge branch 'blender-v3.3-release'Bastien Montagne
2022-08-16LibOverride: Refactor of menu entries in the View3D.Bastien Montagne
Move override creation into their own menu, add entries for reset and clear operations.
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-15Cleanup: make formatBrecht Van Lommel
2022-08-15Fix T100394: Regression: Duplicating a modifier causes a crashSergey Sharybin
Need to update relations when modifiers are added or removed since those create nodes in the dependency graph. Added an assert statement to point at possible culprit so that issues can be fixed more quickly.
2022-08-14Cleanup: Move object_vgroup.c to C++Hans Goudey
2022-08-11Mesh: Move hide flags to generic attributesHans Goudey
This commit moves the hide status of mesh vertices, edges, and faces from the `ME_FLAG` to optional generic boolean attributes. Storing this data as generic attributes can significantly simplify and improve code, as described in T95965. The attributes are called `.hide_vert`, `.hide_edge`, and `.hide_poly`, using the attribute name semantics discussed in T97452. The `.` prefix means they are "UI attributes", so they still contain original data edited by users, but they aren't meant to be accessed procedurally by the user in arbitrary situations. They are also be hidden in the spreadsheet and the attribute list by default, Until 4.0, the attributes are still written to and read from the mesh in the old way, so neither forward nor backward compatibility are affected. This means memory requirements will be increased by one byte per element when the hide status is used. When the flags are removed completely, requirements will decrease when hiding is unused. Further notes: * Some code can be further simplified to skip some processing when the hide attributes don't exist. * The data is still stored in flags for `BMesh`, necessitating some complexity in the conversion to and from `Mesh`. * Access to the "hide" property of mesh elements in RNA is slower. The separate boolean arrays should be used where possible. Ref T95965 Differential Revision: https://developer.blender.org/D14685
2022-08-09Cleanup: use own username in code-comment tagsCampbell Barton
2022-08-05Cleanup: formatCampbell Barton