Age | Commit message (Collapse) | Author |
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
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
|
|
|
|
|
|
- PALETTE_OT_color_add: crashed without a brush.
- SCREEN_OT_actionzone: crashed without a window.
- PREFERENCES_OT_studiolight_show: exception when opening prefs failed.
|
|
|
|
The slide brush requires attachment information on the curves.
Now a warning is shown instead of crashing Blender. The attachment
information can be generated by executing the
`Curves > Snap to Nearest Surface` operator.
|
|
|
|
|
|
Caused by 2480b55f216c31 using the undo step indices instead of the
indices of vertices in the mesh, causing the hide values to be swapped
around randomly in the mesh.
|
|
The number of attribute domains isn't an attribute domain, so storing
ATTR_DOMAIN_NUM in a variable with an eAttrDomain type isn't correct.
In the cases it was used, the value wouldn't be accessed anyway.
|
|
This is done by checking the number of bitplanes from the image buffer.
We assume that for float buffer to use the same bitplanes as it was a
byte buffer.
Then, the data of the image buffer is packed at the start of the `rect` or
`float_rect` before upload.
**Statistics - einar.v004.blend **
Note that not all grayscale textures have been stored as BW images so the
amount of memory that can be reduced would be more.
Without patch
```
104 Textures - 3294.99 MB (3294.47 MB over 32x32), 37 RTs - 192.52 MB.
Avg. tex dimension: 2201.88x1253.51 (2283.53x2202.13 over 32x32)
464 Buffers - 25.01 MB total 1.24 MB IBs 23.50 MB VBs.
3512.52 MB - Grand total GPU buffer + texture load
```
Patch applied
```
104 Textures - 2917.66 MB (2917.14 MB over 32x32), 39 RTs - 215.45 MB.
Avg. tex dimension: 2221.38x1252.75 (2323.28x2253.47 over 32x32)
467 Buffers - 25.01 MB total 1.24 MB IBs 23.51 MB VBs.
3158.13 MB - Grand total GPU buffer + texture load.
```
Reviewed By: fclem
Differential Revision: https://developer.blender.org/D15484
|
|
|
|
|
|
Differential Revision: https://developer.blender.org/D15709
|
|
Differential Revision: https://developer.blender.org/D15530
|
|
Differential Revision: https://developer.blender.org/D15683
|
|
Fix boundary conditions for the Relax UV tool with the Laplacian method.
Add Pinned UV support to Relax UV tool (all modes) and Pinch UV tool.
Differential Revision: https://developer.blender.org/D15669
|
|
|
|
|
|
|
|
|
|
Node tagging needed to happen after the undo node's null check.
|
|
Node tagging needed to happen after the undo node's null check.
|
|
|
|
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.
|
|
Unfortunately we do need the panel enabled to prevent
undo bugs.
|
|
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
|
|
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
|
|
Add element_map->island_total_uvs.
Add element_map->island_total_unique_uvs.
Simplify callers based on new members.
Add comments.
Resolves: D15598
|
|
Needed to prevent changing values in the last operator panel
from destructively undoing brush steps.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Rename vert -> vertex.
Add `BM_uv_element_get_head`.
See also: D15598
|
|
Rename buf -> storage.
See also: D15598
|