Age | Commit message (Collapse) | Author |
|
|
|
|
|
Required changes to make it compile with clang tidy:
* Use c++ includes like (e.g. climits instead limits.h).
* Insert type casts when casting from void* to something else.
* Replace NULL with nullptr.
* Insert casts from int to enum.
* Replace designed initializers (not supported in C++ yet).
* Use blender::Vector instead of BLI_array_staticdeclare (does not compile with C++).
* Replace typedef statements.
Ref T83357.
|
|
|
|
When using Optimal Display, some edges are not flagged `ME_EDGEDRAW` |
`ME_EDGERENDER`.
When the modifier is applied through the UI in the modifier stack this is
not an issue because the `modifyMesh` callback is run with
`MOD_APPLY_TO_BASE_MESH` (this will effectively turn of Optimal
Display).
When converting to mesh though, this will just get an evaluated mesh
(where the edge flags are still the same as with the subdivision
modifier).
Now ensure every edge is flagged to draw after conversion.
Maniphest Tasks: T81997
Differential Revision: https://developer.blender.org/D9331
|
|
|
|
This modifier is the opposite of the recently added Mesh to Volume modifier.
It converts the "surface" of a volume into a mesh. The "surface" is defined
by a threshold value. All voxels with a density higher than the threshold
are considered to be inside the volume, while all others will be outside.
By default, the resolution of the generated mesh depends on the voxel
size of the volume grid. The resolution can be customized. It should be
noted that a lower resolution might not make this modifier faster. This
is because we have to downsample the openvdb grid, which isn't a cheap
operation.
Converting a mesh to a volume and then back to a mesh is possible,
but it does require two separate mesh objects for now.
Reviewers: brecht
Differential Revision: https://developer.blender.org/D9141
|
|
`BKE_mesh_calc_edges` was the main performance bottleneck in D9141.
While openvdb only needed ~115ms, calculating the edges afterwards
took ~960ms. Now with some parallelization this is reduced to ~210ms.
Parallelizing `BKE_mesh_calc_edges` is not entirely trivial, because it
has to perform deduplication and some other things that have to happen
in a certain order. Even though the multithreading improves performance
with more threads, there are diminishing returns when too many threads
are used in this function.
The speedup is mainly achieved by having multiple hash tables that are
filled in parallel. The distribution of the edges to hash tables is based on
a hash (that is different from the hash used in the actual hash tables).
I moved the function to C++, because that made it easier for me to
optimize it. Furthermore, I added `BLI_task.hh` which contains some
light tbb wrappers for parallelization.
Reviewers: campbellbarton
Differential Revision: https://developer.blender.org/D9151
|
|
It used to be an int mode.
|
|
This reverts commit 0796807720882731cdb70be144aa182e9b0b9ee5.
|
|
Those were only shallow wrappers around `BKE_id_copy`, barely used (even
fully unused in some cases), and we want to get rid of those ID-specific
helpers for the common ID management tasks. Also prevents weird custom
behaviors (like `BKE_object_copy`, who was the only basic ID copy
function to reset user count of the new copy to zero).
Part of 71219.
|
|
It used to be an `int mode`.
|
|
These were leftovers from the BGE removal.
Differential Revision: https://developer.blender.org/D8862
|
|
Just converts verts to points and vice versa.
Materials and Attribute layers are preserved (so for example if you set
custom radii on the pointcloud, convert to mesh, then convert back to
pointcloud, this will be preserved).
Also not add a Radius layer by default (it is still added and
filled when adding a pointcloud object from the menu), a global Radius
property that will be used if there is no radius attribute can be added
later. A Radius attribute can also be added in the pointcloud data
properties (and filled via python).
This will also add a new utility function that copies materials between
datablocks: BKE_id_materials_copy
ref T75717
Differential Revision: https://developer.blender.org/D7391
|
|
No functional changes
|
|
This replaces header include guards with `#pragma once`.
A couple of include guards are not removed yet (e.g. `__RNA_TYPES_H__`),
because they are used in other places.
This patch has been generated by P1561 followed by `make format`.
Differential Revision: https://developer.blender.org/D8466
|
|
Also order return matrices last.
|
|
Clang Tidy reported a couple of false positives. I disabled
those `NOLINTNEXTLINE`.
Differential Revision: https://developer.blender.org/D8199
|
|
Use a median center of polygons as an initial value for volume center
calculation since the volume accumulation quickly generates very large
numbers that become inaccurate if the geometry is too far
from it's current center.
|
|
|
|
|
|
This resolves a performance regression in 2.8x where every edit-mode
update performed an edit-mesh to mesh conversion.
Now the conversion will be lazily initialized if/when it's required.
New BKE_mesh_wrapper_* functions abstract over mesh data access.
Currently only edit-mesh and regular meshes are supported.
In the future sub-surface meshes may be supported too.
|
|
Make it explicit this data mask is added to the default mask.
|
|
|
|
Instead of using anonymous booleans flags, also allows to keep the same
behavior in all cases, without needing special handling from calling
code for our beloved oddballs object proxies...
|
|
|
|
- Replace 'unsigned' used on it's own with 'uint'.
- Replace 'unsigned const char' with 'const uchar'.
|
|
Remove the use UV for mapping option.
|
|
Modifier stack evaluation would copy mesh settings other than mesh topology
automatically, outside of the individual modifier evaluation. This leads to hard
to understand code, and makes it unclear which settings are available in following
modifiers, and which only after the entire stack is evaluated.
Now every modifier is responsible to ensure the mesh it outputs preserves materials,
texture space and other settings, or alters them as needed.
Fixes T64739: incorrect texture space for various modifiers
Differential Revision: https://developer.blender.org/D5808
|
|
|
|
These were only strictly valid for texture space calculation, don't store them
since they should not be used after that. Only store a flag to indicate if the
auto texture space has been evaluated.
In the future it might make sense to store bounding boxes at the mesh level to
speed up bounding box computation for multiple objects using the same mesh, but
then it will need to be implemented differently.
|
|
space issues"
This reverts commit e7a514369fe700dcc5a1fe433c8f709ed9595ded, it introduces
a bug in selection in edit mode.
Fixes T70103: can't select extruded Vertex
Ref T64739
|
|
Modifier stack evaluation would copy mesh settings other than mesh topology
automatically, outside of the individual modifier evaluation. This leads to hard
to understand code, and makes it unclear which settings are available in following
modifiers, and which only after the entire stack is evaluated.
Now every modifier is responsible to ensure the mesh it outputs preserves materials,
texture space and other settings, or alters them as needed.
Fixes T64739: incorrect texture space for various modifiers
Differential Revision: https://developer.blender.org/D5808
|
|
|
|
Forward declare structs where possible.
|
|
This reduce memory usage by about 25% in object mode for multires meshes.
|
|
|
|
MTFace's on the mesh are now only used for conversion.
There is no need to keep both UV layers in sync at once.
|
|
Use consistent terminology.
|
|
This was used for versioning, now normals are calculated after
initializing MPoly data.
|
|
|
|
Currently supports mesh, armature, lattice, curve & metaballs.
Access from pivot popover.
|
|
This also splits vertex access and allocation so it's possible
to copy coordinates into an existing array without allocating it.
|
|
|
|
For clarity sake, the batch cache now uses exclusively per Loop attributes.
While this is a bit of a waste of VRAM (for the few case where per vert
attribs are enough) it reduces the complexity and amount of overall VBO
to update in general situations.
This patch also makes the VertexBuffers filling multithreaded. This make
the update of dense meshes a bit faster. The main bottleneck is the
IndexBuffers update which cannot be multithreaded efficiently (have to
increment a counter and/or do a final sorting pass).
We introduce the concept of "extract" functions/step.
All extract functions are executed in one thread each and if possible,
using multiple thread for looping over all elements.
Reviewed By: brecht
Differential Revision: http://developer.blender.org/D5424
|
|
Does not make sense in the use-cases of that function, especially since
we don't know whether it is actually due to an error, or some glitch
(like an empty curve).
Think we always want to get a mesh when using either operator
conversion, or the `bpy.data.meshes.new_from_object` function.
Note that an assert was also added to ensure we do try to convert from a
valid 'geometry' object type.
|
|
Reviewers: campbellbarton, brecht
Reviewed By: brecht
Subscribers: brecht
Differential Revision: https://developer.blender.org/D4991
|
|
This function makes it possible to clear/remove/nuke all the geometry in
a mesh, allowing functions like `Mesh.from_python()` to construct a new
mesh in its place. Without this function, code like in T67627 have to
allocate a new Mesh datablock, fill that, and swap out the old Mesh for
the new one. This introduces issues when exporting, as the new mesh
could be seen by an exporter as unrelated to the old one.
Shape keys are not freed by this function. Freeing those would require
tagging the depsgraph for relations update, which is an expensive
operation. They should be removed explicitly if necessary.
Material slots are also not cleared by this function, in the same way
that they are not cleared when manually removing all geometry from a
mesh.
The `BKE_mesh_clear_geometry()` function is available in Python as
`mesh.clear_geometry()`.
Reviewed by: mont29, brecht
Differential Revision: https://developer.blender.org/D5373
|
|
Mode crashes Blender.
Main issue in that report was that meshes generated from
`mesh_create_eval_final_view()` and the like need some
special freeing handling (as, among other things, they borrow and do not
own their potential editmesh data...).
Factorized that into a helper func also used by
`BKE_object_free_derived_caches()`.
|
|
This commit extends dependency graph API with an argument which
denotes that all custom data layers are to be preserved. This
forces modifier stack re-evaluation with more inclusive mask.
Far from ideal, since this might fail in certain configurations
with indirectly used objects which might be missing layers needed
for the current object evaluation. But this is how it worked for
a long time, so should be good enough for until more sophisticated
solution is found.
In order to use this new behavior two things are to be passed:
- Pass keep_all_data_layers=True
- Pass a valid dependency graph.
The dependency graph is only needed if keep_all_data_layers=True
and is NOT to be passed if keep_all_data_layers=False.
If keep_all_data_layers=True the dependency graph MUST be passed.
Reviewers: mont29, brecht
Reviewed By: mont29
Maniphest Tasks: T64994, T64794
Differential Revision: https://developer.blender.org/D4940
|