2022-02-11 09:07:11 +11:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-or-later
|
2023-02-22 10:16:42 +01:00
|
|
|
* Copyright 2005 Blender Foundation */
|
2010-04-11 22:12:30 +00:00
|
|
|
|
2019-02-18 08:08:12 +11:00
|
|
|
/** \file
|
|
|
|
|
* \ingroup modifiers
|
2011-02-25 13:57:17 +00:00
|
|
|
*/
|
|
|
|
|
|
2022-10-06 16:05:56 -05:00
|
|
|
#include <cstring>
|
2010-04-12 22:33:43 +00:00
|
|
|
|
2019-02-25 11:39:14 +01:00
|
|
|
#include "BLI_utildefines.h"
|
|
|
|
|
|
|
|
|
|
#include "BLI_bitmap.h"
|
|
|
|
|
#include "BLI_math_matrix.h"
|
2020-03-19 09:33:03 +01:00
|
|
|
#include "BLI_math_vector.h"
|
2019-02-25 11:39:14 +01:00
|
|
|
|
2012-04-10 14:11:45 +00:00
|
|
|
#include "DNA_image_types.h"
|
2018-04-19 11:03:58 +02:00
|
|
|
#include "DNA_mesh_types.h"
|
2020-03-19 09:33:03 +01:00
|
|
|
#include "DNA_meshdata_types.h"
|
2010-04-11 22:12:30 +00:00
|
|
|
#include "DNA_modifier_types.h"
|
|
|
|
|
#include "DNA_object_types.h"
|
2012-04-10 14:11:45 +00:00
|
|
|
#include "DNA_scene_types.h"
|
2010-04-11 22:12:30 +00:00
|
|
|
|
2020-04-10 14:03:36 +02:00
|
|
|
#include "BKE_action.h" /* BKE_pose_channel_find_name */
|
2011-07-11 09:15:20 +00:00
|
|
|
#include "BKE_deform.h"
|
2018-05-08 11:33:31 +02:00
|
|
|
#include "BKE_editmesh.h"
|
2012-04-10 14:11:45 +00:00
|
|
|
#include "BKE_image.h"
|
2011-07-11 09:15:20 +00:00
|
|
|
#include "BKE_lattice.h"
|
2020-02-10 12:58:59 +01:00
|
|
|
#include "BKE_lib_id.h"
|
2023-03-12 22:29:15 +01:00
|
|
|
#include "BKE_mesh.hh"
|
2020-06-10 22:32:06 +10:00
|
|
|
#include "BKE_mesh_wrapper.h"
|
2018-12-14 16:07:29 +01:00
|
|
|
#include "BKE_object.h"
|
2011-01-07 19:18:31 +00:00
|
|
|
|
2010-04-25 01:10:03 +00:00
|
|
|
#include "BKE_modifier.h"
|
2010-04-11 22:12:30 +00:00
|
|
|
|
2018-05-23 15:52:35 +02:00
|
|
|
#include "DEG_depsgraph.h"
|
|
|
|
|
#include "DEG_depsgraph_query.h"
|
|
|
|
|
|
2023-05-04 18:35:37 +02:00
|
|
|
#include "MOD_modifiertypes.hh"
|
|
|
|
|
#include "MOD_util.hh"
|
2010-04-11 22:12:30 +00:00
|
|
|
|
2010-04-12 22:33:43 +00:00
|
|
|
#include "MEM_guardedalloc.h"
|
2010-04-11 22:12:30 +00:00
|
|
|
|
2018-12-07 15:45:53 +01:00
|
|
|
void MOD_init_texture(MappingInfoModifierData *dmd, const ModifierEvalContext *ctx)
|
2012-04-10 14:11:45 +00:00
|
|
|
{
|
2019-03-26 11:25:07 +01:00
|
|
|
Tex *tex = dmd->texture;
|
2018-12-07 15:45:53 +01:00
|
|
|
|
2022-10-06 16:05:56 -05:00
|
|
|
if (tex == nullptr) {
|
2012-04-10 14:11:45 +00:00
|
|
|
return;
|
2018-12-07 15:45:53 +01:00
|
|
|
}
|
2012-04-10 14:11:45 +00:00
|
|
|
|
2014-01-14 04:59:58 +11:00
|
|
|
if (tex->ima && BKE_image_is_animated(tex->ima)) {
|
2019-06-17 11:39:52 +02:00
|
|
|
BKE_image_user_frame_calc(tex->ima, &tex->iuser, DEG_get_ctime(ctx->depsgraph));
|
2014-01-14 04:59:58 +11:00
|
|
|
}
|
2012-04-10 14:11:45 +00:00
|
|
|
}
|
|
|
|
|
|
2018-05-07 18:14:15 +02:00
|
|
|
void MOD_get_texture_coords(MappingInfoModifierData *dmd,
|
2022-10-12 10:27:27 +11:00
|
|
|
const ModifierEvalContext * /*ctx*/,
|
2018-05-07 18:14:15 +02:00
|
|
|
Object *ob,
|
|
|
|
|
Mesh *mesh,
|
2018-05-08 11:57:34 +02:00
|
|
|
float (*cos)[3],
|
2018-05-07 18:14:15 +02:00
|
|
|
float (*r_texco)[3])
|
|
|
|
|
{
|
2023-03-29 14:16:31 +11:00
|
|
|
/* TODO: to be renamed to `get_texture_coords` once we are done with moving modifiers to Mesh. */
|
|
|
|
|
|
Mesh: Replace MLoop struct with generic attributes
Implements #102359.
Split the `MLoop` struct into two separate integer arrays called
`corner_verts` and `corner_edges`, referring to the vertex each corner
is attached to and the next edge around the face at each corner. These
arrays can be sliced to give access to the edges or vertices in a face.
Then they are often referred to as "poly_verts" or "poly_edges".
The main benefits are halving the necessary memory bandwidth when only
one array is used and simplifications from using regular integer indices
instead of a special-purpose struct.
The commit also starts a renaming from "loop" to "corner" in mesh code.
Like the other mesh struct of array refactors, forward compatibility is
kept by writing files with the older format. This will be done until 4.0
to ease the transition process.
Looking at a small portion of the patch should give a good impression
for the rest of the changes. I tried to make the changes as small as
possible so it's easy to tell the correctness from the diff. Though I
found Blender developers have been very inventive over the last decade
when finding different ways to loop over the corners in a face.
For performance, nearly every piece of code that deals with `Mesh` is
slightly impacted. Any algorithm that is memory bottle-necked should
see an improvement. For example, here is a comparison of interpolating
a vertex float attribute to face corners (Ryzen 3700x):
**Before** (Average: 3.7 ms, Min: 3.4 ms)
```
threading::parallel_for(loops.index_range(), 4096, [&](IndexRange range) {
for (const int64_t i : range) {
dst[i] = src[loops[i].v];
}
});
```
**After** (Average: 2.9 ms, Min: 2.6 ms)
```
array_utils::gather(src, corner_verts, dst);
```
That's an improvement of 28% to the average timings, and it's also a
simplification, since an index-based routine can be used instead.
For more examples using the new arrays, see the design task.
Pull Request: https://projects.blender.org/blender/blender/pulls/104424
2023-03-20 15:55:13 +01:00
|
|
|
using namespace blender;
|
2022-03-28 12:29:47 +11:00
|
|
|
const int verts_num = mesh->totvert;
|
2018-05-07 18:14:15 +02:00
|
|
|
int i;
|
|
|
|
|
int texmapping = dmd->texmapping;
|
2020-04-10 14:03:36 +02:00
|
|
|
float mapref_imat[4][4];
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2018-05-07 18:14:15 +02:00
|
|
|
if (texmapping == MOD_DISP_MAP_OBJECT) {
|
2022-10-06 16:05:56 -05:00
|
|
|
if (dmd->map_object != nullptr) {
|
2019-03-26 11:25:07 +01:00
|
|
|
Object *map_object = dmd->map_object;
|
2020-04-10 14:03:36 +02:00
|
|
|
if (dmd->map_bone[0] != '\0') {
|
|
|
|
|
bPoseChannel *pchan = BKE_pose_channel_find_name(map_object->pose, dmd->map_bone);
|
|
|
|
|
if (pchan) {
|
|
|
|
|
float mat_bone_world[4][4];
|
2022-10-24 14:16:37 +02:00
|
|
|
mul_m4_m4m4(mat_bone_world, map_object->object_to_world, pchan->pose_mat);
|
2020-04-10 14:03:36 +02:00
|
|
|
invert_m4_m4(mapref_imat, mat_bone_world);
|
|
|
|
|
}
|
|
|
|
|
else {
|
2022-10-24 14:16:37 +02:00
|
|
|
invert_m4_m4(mapref_imat, map_object->object_to_world);
|
2020-04-10 14:03:36 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else {
|
2022-10-24 14:16:37 +02:00
|
|
|
invert_m4_m4(mapref_imat, map_object->object_to_world);
|
2020-04-10 14:03:36 +02:00
|
|
|
}
|
2018-12-07 15:45:53 +01:00
|
|
|
}
|
|
|
|
|
else { /* if there is no map object, default to local */
|
2018-05-07 18:14:15 +02:00
|
|
|
texmapping = MOD_DISP_MAP_LOCAL;
|
2018-12-07 15:45:53 +01:00
|
|
|
}
|
2018-05-07 18:14:15 +02:00
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2018-05-07 18:14:15 +02:00
|
|
|
/* UVs need special handling, since they come from faces */
|
|
|
|
|
if (texmapping == MOD_DISP_MAP_UV) {
|
Mesh: Move UV layers to generic attributes
Currently the `MLoopUV` struct stores UV coordinates and flags related
to editing UV maps in the UV editor. This patch changes the coordinates
to use the generic 2D vector type, and moves the flags into three
separate boolean attributes. This follows the design in T95965, with
the ultimate intention of simplifying code and improving performance.
Importantly, the change allows exporters and renderers to use UVs
"touched" by geometry nodes, which only creates generic attributes.
It also allows geometry nodes to create "proper" UV maps from scratch,
though only with the Store Named Attribute node for now.
The new design considers any 2D vector attribute on the corner domain
to be a UV map. In the future, they might be distinguished from regular
2D vectors with attribute metadata, which may be helpful because they
are often interpolated differently.
Most of the code changes deal with passing around UV BMesh custom data
offsets and tracking the boolean "sublayers". The boolean layers are
use the following prefixes for attribute names: vert selection: `.vs.`,
edge selection: `.es.`, pinning: `.pn.`. Currently these are short to
avoid using up the maximum length of attribute names. To accommodate
for these 4 extra characters, the name length limit is enlarged to 68
bytes, while the maximum user settable name length is still 64 bytes.
Unfortunately Python/RNA API access to the UV flag data becomes slower.
Accessing the boolean layers directly is be better for performance in
general.
Like the other mesh SoA refactors, backward and forward compatibility
aren't affected, and won't be changed until 4.0. We pay for that by
making mesh reading and writing more expensive with conversions.
Resolves T85962
Differential Revision: https://developer.blender.org/D14365
2023-01-10 00:47:04 -05:00
|
|
|
if (CustomData_has_layer(&mesh->ldata, CD_PROP_FLOAT2)) {
|
Mesh: Replace MPoly struct with offset indices
Implements #95967.
Currently the `MPoly` struct is 12 bytes, and stores the index of a
face's first corner and the number of corners/verts/edges. Polygons
and corners are always created in order by Blender, meaning each
face's corners will be after the previous face's corners. We can take
advantage of this fact and eliminate the redundancy in mesh face
storage by only storing a single integer corner offset for each face.
The size of the face is then encoded by the offset of the next face.
The size of a single integer is 4 bytes, so this reduces memory
usage by 3 times.
The same method is used for `CurvesGeometry`, so Blender already has
an abstraction to simplify using these offsets called `OffsetIndices`.
This class is used to easily retrieve a range of corner indices for
each face. This also gives the opportunity for sharing some logic with
curves.
Another benefit of the change is that the offsets and sizes stored in
`MPoly` can no longer disagree with each other. Storing faces in the
order of their corners can simplify some code too.
Face/polygon variables now use the `IndexRange` type, which comes with
quite a few utilities that can simplify code.
Some:
- The offset integer array has to be one longer than the face count to
avoid a branch for every face, which means the data is no longer part
of the mesh's `CustomData`.
- We lose the ability to "reference" an original mesh's offset array
until more reusable CoW from #104478 is committed. That will be added
in a separate commit.
- Since they aren't part of `CustomData`, poly offsets often have to be
copied manually.
- To simplify using `OffsetIndices` in many places, some functions and
structs in headers were moved to only compile in C++.
- All meshes created by Blender use the same order for faces and face
corners, but just in case, meshes with mismatched order are fixed by
versioning code.
- `MeshPolygon.totloop` is no longer editable in RNA. This API break is
necessary here unfortunately. It should be worth it in 3.6, since
that's the best way to allow loading meshes from 4.0, which is
important for an LTS version.
Pull Request: https://projects.blender.org/blender/blender/pulls/105938
2023-04-04 20:39:28 +02:00
|
|
|
const OffsetIndices polys = mesh->polys();
|
Mesh: Replace MLoop struct with generic attributes
Implements #102359.
Split the `MLoop` struct into two separate integer arrays called
`corner_verts` and `corner_edges`, referring to the vertex each corner
is attached to and the next edge around the face at each corner. These
arrays can be sliced to give access to the edges or vertices in a face.
Then they are often referred to as "poly_verts" or "poly_edges".
The main benefits are halving the necessary memory bandwidth when only
one array is used and simplifications from using regular integer indices
instead of a special-purpose struct.
The commit also starts a renaming from "loop" to "corner" in mesh code.
Like the other mesh struct of array refactors, forward compatibility is
kept by writing files with the older format. This will be done until 4.0
to ease the transition process.
Looking at a small portion of the patch should give a good impression
for the rest of the changes. I tried to make the changes as small as
possible so it's easy to tell the correctness from the diff. Though I
found Blender developers have been very inventive over the last decade
when finding different ways to loop over the corners in a face.
For performance, nearly every piece of code that deals with `Mesh` is
slightly impacted. Any algorithm that is memory bottle-necked should
see an improvement. For example, here is a comparison of interpolating
a vertex float attribute to face corners (Ryzen 3700x):
**Before** (Average: 3.7 ms, Min: 3.4 ms)
```
threading::parallel_for(loops.index_range(), 4096, [&](IndexRange range) {
for (const int64_t i : range) {
dst[i] = src[loops[i].v];
}
});
```
**After** (Average: 2.9 ms, Min: 2.6 ms)
```
array_utils::gather(src, corner_verts, dst);
```
That's an improvement of 28% to the average timings, and it's also a
simplification, since an index-based routine can be used instead.
For more examples using the new arrays, see the design task.
Pull Request: https://projects.blender.org/blender/blender/pulls/104424
2023-03-20 15:55:13 +01:00
|
|
|
const Span<int> corner_verts = mesh->corner_verts();
|
2022-03-28 12:29:47 +11:00
|
|
|
BLI_bitmap *done = BLI_BITMAP_NEW(verts_num, __func__);
|
2018-05-07 18:14:15 +02:00
|
|
|
char uvname[MAX_CUSTOMDATA_LAYER_NAME];
|
Mesh: Move UV layers to generic attributes
Currently the `MLoopUV` struct stores UV coordinates and flags related
to editing UV maps in the UV editor. This patch changes the coordinates
to use the generic 2D vector type, and moves the flags into three
separate boolean attributes. This follows the design in T95965, with
the ultimate intention of simplifying code and improving performance.
Importantly, the change allows exporters and renderers to use UVs
"touched" by geometry nodes, which only creates generic attributes.
It also allows geometry nodes to create "proper" UV maps from scratch,
though only with the Store Named Attribute node for now.
The new design considers any 2D vector attribute on the corner domain
to be a UV map. In the future, they might be distinguished from regular
2D vectors with attribute metadata, which may be helpful because they
are often interpolated differently.
Most of the code changes deal with passing around UV BMesh custom data
offsets and tracking the boolean "sublayers". The boolean layers are
use the following prefixes for attribute names: vert selection: `.vs.`,
edge selection: `.es.`, pinning: `.pn.`. Currently these are short to
avoid using up the maximum length of attribute names. To accommodate
for these 4 extra characters, the name length limit is enlarged to 68
bytes, while the maximum user settable name length is still 64 bytes.
Unfortunately Python/RNA API access to the UV flag data becomes slower.
Accessing the boolean layers directly is be better for performance in
general.
Like the other mesh SoA refactors, backward and forward compatibility
aren't affected, and won't be changed until 4.0. We pay for that by
making mesh reading and writing more expensive with conversions.
Resolves T85962
Differential Revision: https://developer.blender.org/D14365
2023-01-10 00:47:04 -05:00
|
|
|
CustomData_validate_layer_name(&mesh->ldata, CD_PROP_FLOAT2, dmd->uvlayer_name, uvname);
|
|
|
|
|
const float(*mloop_uv)[2] = static_cast<const float(*)[2]>(
|
|
|
|
|
CustomData_get_layer_named(&mesh->ldata, CD_PROP_FLOAT2, uvname));
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2018-05-07 18:14:15 +02:00
|
|
|
/* verts are given the UV from the first face that uses them */
|
2023-02-23 10:39:51 -05:00
|
|
|
for (const int i : polys.index_range()) {
|
Mesh: Replace MPoly struct with offset indices
Implements #95967.
Currently the `MPoly` struct is 12 bytes, and stores the index of a
face's first corner and the number of corners/verts/edges. Polygons
and corners are always created in order by Blender, meaning each
face's corners will be after the previous face's corners. We can take
advantage of this fact and eliminate the redundancy in mesh face
storage by only storing a single integer corner offset for each face.
The size of the face is then encoded by the offset of the next face.
The size of a single integer is 4 bytes, so this reduces memory
usage by 3 times.
The same method is used for `CurvesGeometry`, so Blender already has
an abstraction to simplify using these offsets called `OffsetIndices`.
This class is used to easily retrieve a range of corner indices for
each face. This also gives the opportunity for sharing some logic with
curves.
Another benefit of the change is that the offsets and sizes stored in
`MPoly` can no longer disagree with each other. Storing faces in the
order of their corners can simplify some code too.
Face/polygon variables now use the `IndexRange` type, which comes with
quite a few utilities that can simplify code.
Some:
- The offset integer array has to be one longer than the face count to
avoid a branch for every face, which means the data is no longer part
of the mesh's `CustomData`.
- We lose the ability to "reference" an original mesh's offset array
until more reusable CoW from #104478 is committed. That will be added
in a separate commit.
- Since they aren't part of `CustomData`, poly offsets often have to be
copied manually.
- To simplify using `OffsetIndices` in many places, some functions and
structs in headers were moved to only compile in C++.
- All meshes created by Blender use the same order for faces and face
corners, but just in case, meshes with mismatched order are fixed by
versioning code.
- `MeshPolygon.totloop` is no longer editable in RNA. This API break is
necessary here unfortunately. It should be worth it in 3.6, since
that's the best way to allow loading meshes from 4.0, which is
important for an LTS version.
Pull Request: https://projects.blender.org/blender/blender/pulls/105938
2023-04-04 20:39:28 +02:00
|
|
|
const IndexRange poly = polys[i];
|
|
|
|
|
uint fidx = poly.size() - 1;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2018-05-07 18:14:15 +02:00
|
|
|
do {
|
Mesh: Replace MPoly struct with offset indices
Implements #95967.
Currently the `MPoly` struct is 12 bytes, and stores the index of a
face's first corner and the number of corners/verts/edges. Polygons
and corners are always created in order by Blender, meaning each
face's corners will be after the previous face's corners. We can take
advantage of this fact and eliminate the redundancy in mesh face
storage by only storing a single integer corner offset for each face.
The size of the face is then encoded by the offset of the next face.
The size of a single integer is 4 bytes, so this reduces memory
usage by 3 times.
The same method is used for `CurvesGeometry`, so Blender already has
an abstraction to simplify using these offsets called `OffsetIndices`.
This class is used to easily retrieve a range of corner indices for
each face. This also gives the opportunity for sharing some logic with
curves.
Another benefit of the change is that the offsets and sizes stored in
`MPoly` can no longer disagree with each other. Storing faces in the
order of their corners can simplify some code too.
Face/polygon variables now use the `IndexRange` type, which comes with
quite a few utilities that can simplify code.
Some:
- The offset integer array has to be one longer than the face count to
avoid a branch for every face, which means the data is no longer part
of the mesh's `CustomData`.
- We lose the ability to "reference" an original mesh's offset array
until more reusable CoW from #104478 is committed. That will be added
in a separate commit.
- Since they aren't part of `CustomData`, poly offsets often have to be
copied manually.
- To simplify using `OffsetIndices` in many places, some functions and
structs in headers were moved to only compile in C++.
- All meshes created by Blender use the same order for faces and face
corners, but just in case, meshes with mismatched order are fixed by
versioning code.
- `MeshPolygon.totloop` is no longer editable in RNA. This API break is
necessary here unfortunately. It should be worth it in 3.6, since
that's the best way to allow loading meshes from 4.0, which is
important for an LTS version.
Pull Request: https://projects.blender.org/blender/blender/pulls/105938
2023-04-04 20:39:28 +02:00
|
|
|
uint lidx = poly.start() + fidx;
|
Mesh: Replace MLoop struct with generic attributes
Implements #102359.
Split the `MLoop` struct into two separate integer arrays called
`corner_verts` and `corner_edges`, referring to the vertex each corner
is attached to and the next edge around the face at each corner. These
arrays can be sliced to give access to the edges or vertices in a face.
Then they are often referred to as "poly_verts" or "poly_edges".
The main benefits are halving the necessary memory bandwidth when only
one array is used and simplifications from using regular integer indices
instead of a special-purpose struct.
The commit also starts a renaming from "loop" to "corner" in mesh code.
Like the other mesh struct of array refactors, forward compatibility is
kept by writing files with the older format. This will be done until 4.0
to ease the transition process.
Looking at a small portion of the patch should give a good impression
for the rest of the changes. I tried to make the changes as small as
possible so it's easy to tell the correctness from the diff. Though I
found Blender developers have been very inventive over the last decade
when finding different ways to loop over the corners in a face.
For performance, nearly every piece of code that deals with `Mesh` is
slightly impacted. Any algorithm that is memory bottle-necked should
see an improvement. For example, here is a comparison of interpolating
a vertex float attribute to face corners (Ryzen 3700x):
**Before** (Average: 3.7 ms, Min: 3.4 ms)
```
threading::parallel_for(loops.index_range(), 4096, [&](IndexRange range) {
for (const int64_t i : range) {
dst[i] = src[loops[i].v];
}
});
```
**After** (Average: 2.9 ms, Min: 2.6 ms)
```
array_utils::gather(src, corner_verts, dst);
```
That's an improvement of 28% to the average timings, and it's also a
simplification, since an index-based routine can be used instead.
For more examples using the new arrays, see the design task.
Pull Request: https://projects.blender.org/blender/blender/pulls/104424
2023-03-20 15:55:13 +01:00
|
|
|
const int vidx = corner_verts[lidx];
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2018-05-07 18:14:15 +02:00
|
|
|
if (!BLI_BITMAP_TEST(done, vidx)) {
|
|
|
|
|
/* remap UVs from [0, 1] to [-1, 1] */
|
Mesh: Move UV layers to generic attributes
Currently the `MLoopUV` struct stores UV coordinates and flags related
to editing UV maps in the UV editor. This patch changes the coordinates
to use the generic 2D vector type, and moves the flags into three
separate boolean attributes. This follows the design in T95965, with
the ultimate intention of simplifying code and improving performance.
Importantly, the change allows exporters and renderers to use UVs
"touched" by geometry nodes, which only creates generic attributes.
It also allows geometry nodes to create "proper" UV maps from scratch,
though only with the Store Named Attribute node for now.
The new design considers any 2D vector attribute on the corner domain
to be a UV map. In the future, they might be distinguished from regular
2D vectors with attribute metadata, which may be helpful because they
are often interpolated differently.
Most of the code changes deal with passing around UV BMesh custom data
offsets and tracking the boolean "sublayers". The boolean layers are
use the following prefixes for attribute names: vert selection: `.vs.`,
edge selection: `.es.`, pinning: `.pn.`. Currently these are short to
avoid using up the maximum length of attribute names. To accommodate
for these 4 extra characters, the name length limit is enlarged to 68
bytes, while the maximum user settable name length is still 64 bytes.
Unfortunately Python/RNA API access to the UV flag data becomes slower.
Accessing the boolean layers directly is be better for performance in
general.
Like the other mesh SoA refactors, backward and forward compatibility
aren't affected, and won't be changed until 4.0. We pay for that by
making mesh reading and writing more expensive with conversions.
Resolves T85962
Differential Revision: https://developer.blender.org/D14365
2023-01-10 00:47:04 -05:00
|
|
|
r_texco[vidx][0] = (mloop_uv[lidx][0] * 2.0f) - 1.0f;
|
|
|
|
|
r_texco[vidx][1] = (mloop_uv[lidx][1] * 2.0f) - 1.0f;
|
2018-05-07 18:14:15 +02:00
|
|
|
BLI_BITMAP_ENABLE(done, vidx);
|
|
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2018-05-07 18:14:15 +02:00
|
|
|
} while (fidx--);
|
|
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2018-05-07 18:14:15 +02:00
|
|
|
MEM_freeN(done);
|
|
|
|
|
return;
|
|
|
|
|
}
|
2020-08-07 12:40:29 +02:00
|
|
|
|
|
|
|
|
/* if there are no UVs, default to local */
|
|
|
|
|
texmapping = MOD_DISP_MAP_LOCAL;
|
2018-05-07 18:14:15 +02:00
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
Mesh: Move positions to a generic attribute
**Changes**
As described in T93602, this patch removes all use of the `MVert`
struct, replacing it with a generic named attribute with the name
`"position"`, consistent with other geometry types.
Variable names have been changed from `verts` to `positions`, to align
with the attribute name and the more generic design (positions are not
vertices, they are just an attribute stored on the point domain).
This change is made possible by previous commits that moved all other
data out of `MVert` to runtime data or other generic attributes. What
remains is mostly a simple type change. Though, the type still shows up
859 times, so the patch is quite large.
One compromise is that now `CD_MASK_BAREMESH` now contains
`CD_PROP_FLOAT3`. With the general move towards generic attributes
over custom data types, we are removing use of these type masks anyway.
**Benefits**
The most obvious benefit is reduced memory usage and the benefits
that brings in memory-bound situations. `float3` is only 3 bytes, in
comparison to `MVert` which was 4. When there are millions of vertices
this starts to matter more.
The other benefits come from using a more generic type. Instead of
writing algorithms specifically for `MVert`, code can just use arrays
of vectors. This will allow eliminating many temporary arrays or
wrappers used to extract positions.
Many possible improvements aren't implemented in this patch, though
I did switch simplify or remove the process of creating temporary
position arrays in a few places.
The design clarity that "positions are just another attribute" brings
allows removing explicit copying of vertices in some procedural
operations-- they are just processed like most other attributes.
**Performance**
This touches so many areas that it's hard to benchmark exhaustively,
but I observed some areas as examples.
* The mesh line node with 4 million count was 1.5x (8ms to 12ms) faster.
* The Spring splash screen went from ~4.3 to ~4.5 fps.
* The subdivision surface modifier/node was slightly faster
RNA access through Python may be slightly slower, since now we need
a name lookup instead of just a custom data type lookup for each index.
**Future Improvements**
* Remove uses of "vert_coords" functions:
* `BKE_mesh_vert_coords_alloc`
* `BKE_mesh_vert_coords_get`
* `BKE_mesh_vert_coords_apply{_with_mat4}`
* Remove more hidden copying of positions
* General simplification now possible in many areas
* Convert more code to C++ to use `float3` instead of `float[3]`
* Currently `reinterpret_cast` is used for those C-API functions
Differential Revision: https://developer.blender.org/D15982
2023-01-10 00:10:43 -05:00
|
|
|
const float(*positions)[3] = BKE_mesh_vert_positions(mesh);
|
|
|
|
|
for (i = 0; i < verts_num; i++, r_texco++) {
|
2018-05-07 18:14:15 +02:00
|
|
|
switch (texmapping) {
|
|
|
|
|
case MOD_DISP_MAP_LOCAL:
|
Mesh: Move positions to a generic attribute
**Changes**
As described in T93602, this patch removes all use of the `MVert`
struct, replacing it with a generic named attribute with the name
`"position"`, consistent with other geometry types.
Variable names have been changed from `verts` to `positions`, to align
with the attribute name and the more generic design (positions are not
vertices, they are just an attribute stored on the point domain).
This change is made possible by previous commits that moved all other
data out of `MVert` to runtime data or other generic attributes. What
remains is mostly a simple type change. Though, the type still shows up
859 times, so the patch is quite large.
One compromise is that now `CD_MASK_BAREMESH` now contains
`CD_PROP_FLOAT3`. With the general move towards generic attributes
over custom data types, we are removing use of these type masks anyway.
**Benefits**
The most obvious benefit is reduced memory usage and the benefits
that brings in memory-bound situations. `float3` is only 3 bytes, in
comparison to `MVert` which was 4. When there are millions of vertices
this starts to matter more.
The other benefits come from using a more generic type. Instead of
writing algorithms specifically for `MVert`, code can just use arrays
of vectors. This will allow eliminating many temporary arrays or
wrappers used to extract positions.
Many possible improvements aren't implemented in this patch, though
I did switch simplify or remove the process of creating temporary
position arrays in a few places.
The design clarity that "positions are just another attribute" brings
allows removing explicit copying of vertices in some procedural
operations-- they are just processed like most other attributes.
**Performance**
This touches so many areas that it's hard to benchmark exhaustively,
but I observed some areas as examples.
* The mesh line node with 4 million count was 1.5x (8ms to 12ms) faster.
* The Spring splash screen went from ~4.3 to ~4.5 fps.
* The subdivision surface modifier/node was slightly faster
RNA access through Python may be slightly slower, since now we need
a name lookup instead of just a custom data type lookup for each index.
**Future Improvements**
* Remove uses of "vert_coords" functions:
* `BKE_mesh_vert_coords_alloc`
* `BKE_mesh_vert_coords_get`
* `BKE_mesh_vert_coords_apply{_with_mat4}`
* Remove more hidden copying of positions
* General simplification now possible in many areas
* Convert more code to C++ to use `float3` instead of `float[3]`
* Currently `reinterpret_cast` is used for those C-API functions
Differential Revision: https://developer.blender.org/D15982
2023-01-10 00:10:43 -05:00
|
|
|
copy_v3_v3(*r_texco, cos != nullptr ? *cos : positions[i]);
|
2018-05-07 18:14:15 +02:00
|
|
|
break;
|
|
|
|
|
case MOD_DISP_MAP_GLOBAL:
|
Mesh: Move positions to a generic attribute
**Changes**
As described in T93602, this patch removes all use of the `MVert`
struct, replacing it with a generic named attribute with the name
`"position"`, consistent with other geometry types.
Variable names have been changed from `verts` to `positions`, to align
with the attribute name and the more generic design (positions are not
vertices, they are just an attribute stored on the point domain).
This change is made possible by previous commits that moved all other
data out of `MVert` to runtime data or other generic attributes. What
remains is mostly a simple type change. Though, the type still shows up
859 times, so the patch is quite large.
One compromise is that now `CD_MASK_BAREMESH` now contains
`CD_PROP_FLOAT3`. With the general move towards generic attributes
over custom data types, we are removing use of these type masks anyway.
**Benefits**
The most obvious benefit is reduced memory usage and the benefits
that brings in memory-bound situations. `float3` is only 3 bytes, in
comparison to `MVert` which was 4. When there are millions of vertices
this starts to matter more.
The other benefits come from using a more generic type. Instead of
writing algorithms specifically for `MVert`, code can just use arrays
of vectors. This will allow eliminating many temporary arrays or
wrappers used to extract positions.
Many possible improvements aren't implemented in this patch, though
I did switch simplify or remove the process of creating temporary
position arrays in a few places.
The design clarity that "positions are just another attribute" brings
allows removing explicit copying of vertices in some procedural
operations-- they are just processed like most other attributes.
**Performance**
This touches so many areas that it's hard to benchmark exhaustively,
but I observed some areas as examples.
* The mesh line node with 4 million count was 1.5x (8ms to 12ms) faster.
* The Spring splash screen went from ~4.3 to ~4.5 fps.
* The subdivision surface modifier/node was slightly faster
RNA access through Python may be slightly slower, since now we need
a name lookup instead of just a custom data type lookup for each index.
**Future Improvements**
* Remove uses of "vert_coords" functions:
* `BKE_mesh_vert_coords_alloc`
* `BKE_mesh_vert_coords_get`
* `BKE_mesh_vert_coords_apply{_with_mat4}`
* Remove more hidden copying of positions
* General simplification now possible in many areas
* Convert more code to C++ to use `float3` instead of `float[3]`
* Currently `reinterpret_cast` is used for those C-API functions
Differential Revision: https://developer.blender.org/D15982
2023-01-10 00:10:43 -05:00
|
|
|
mul_v3_m4v3(*r_texco, ob->object_to_world, cos != nullptr ? *cos : positions[i]);
|
2018-05-07 18:14:15 +02:00
|
|
|
break;
|
|
|
|
|
case MOD_DISP_MAP_OBJECT:
|
Mesh: Move positions to a generic attribute
**Changes**
As described in T93602, this patch removes all use of the `MVert`
struct, replacing it with a generic named attribute with the name
`"position"`, consistent with other geometry types.
Variable names have been changed from `verts` to `positions`, to align
with the attribute name and the more generic design (positions are not
vertices, they are just an attribute stored on the point domain).
This change is made possible by previous commits that moved all other
data out of `MVert` to runtime data or other generic attributes. What
remains is mostly a simple type change. Though, the type still shows up
859 times, so the patch is quite large.
One compromise is that now `CD_MASK_BAREMESH` now contains
`CD_PROP_FLOAT3`. With the general move towards generic attributes
over custom data types, we are removing use of these type masks anyway.
**Benefits**
The most obvious benefit is reduced memory usage and the benefits
that brings in memory-bound situations. `float3` is only 3 bytes, in
comparison to `MVert` which was 4. When there are millions of vertices
this starts to matter more.
The other benefits come from using a more generic type. Instead of
writing algorithms specifically for `MVert`, code can just use arrays
of vectors. This will allow eliminating many temporary arrays or
wrappers used to extract positions.
Many possible improvements aren't implemented in this patch, though
I did switch simplify or remove the process of creating temporary
position arrays in a few places.
The design clarity that "positions are just another attribute" brings
allows removing explicit copying of vertices in some procedural
operations-- they are just processed like most other attributes.
**Performance**
This touches so many areas that it's hard to benchmark exhaustively,
but I observed some areas as examples.
* The mesh line node with 4 million count was 1.5x (8ms to 12ms) faster.
* The Spring splash screen went from ~4.3 to ~4.5 fps.
* The subdivision surface modifier/node was slightly faster
RNA access through Python may be slightly slower, since now we need
a name lookup instead of just a custom data type lookup for each index.
**Future Improvements**
* Remove uses of "vert_coords" functions:
* `BKE_mesh_vert_coords_alloc`
* `BKE_mesh_vert_coords_get`
* `BKE_mesh_vert_coords_apply{_with_mat4}`
* Remove more hidden copying of positions
* General simplification now possible in many areas
* Convert more code to C++ to use `float3` instead of `float[3]`
* Currently `reinterpret_cast` is used for those C-API functions
Differential Revision: https://developer.blender.org/D15982
2023-01-10 00:10:43 -05:00
|
|
|
mul_v3_m4v3(*r_texco, ob->object_to_world, cos != nullptr ? *cos : positions[i]);
|
2020-04-10 14:03:36 +02:00
|
|
|
mul_m4_v3(mapref_imat, *r_texco);
|
2018-05-07 18:14:15 +02:00
|
|
|
break;
|
|
|
|
|
}
|
2022-10-06 16:05:56 -05:00
|
|
|
if (cos != nullptr) {
|
2018-05-08 11:57:34 +02:00
|
|
|
cos++;
|
|
|
|
|
}
|
2018-05-07 18:14:15 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-06-12 14:29:59 +10:00
|
|
|
void MOD_previous_vcos_store(ModifierData *md, const float (*vert_coords)[3])
|
2010-04-11 22:12:30 +00:00
|
|
|
{
|
2012-05-06 13:38:33 +00:00
|
|
|
while ((md = md->next) && md->type == eModifierType_Armature) {
|
|
|
|
|
ArmatureModifierData *amd = (ArmatureModifierData *)md;
|
2022-10-06 16:05:56 -05:00
|
|
|
if (amd->multi && amd->vert_coords_prev == nullptr) {
|
|
|
|
|
amd->vert_coords_prev = static_cast<float(*)[3]>(MEM_dupallocN(vert_coords));
|
2019-04-22 09:15:10 +10:00
|
|
|
}
|
|
|
|
|
else {
|
2010-04-11 22:12:30 +00:00
|
|
|
break;
|
2019-04-22 09:15:10 +10:00
|
|
|
}
|
2010-04-11 22:12:30 +00:00
|
|
|
}
|
|
|
|
|
/* lattice/mesh modifier too */
|
|
|
|
|
}
|
|
|
|
|
|
2018-11-27 17:21:16 +01:00
|
|
|
Mesh *MOD_deform_mesh_eval_get(Object *ob,
|
2018-05-12 08:21:07 +02:00
|
|
|
struct BMEditMesh *em,
|
|
|
|
|
Mesh *mesh,
|
2020-06-12 14:29:59 +10:00
|
|
|
const float (*vertexCos)[3],
|
2022-03-28 12:29:47 +11:00
|
|
|
const int verts_num,
|
2018-11-27 17:21:16 +01:00
|
|
|
const bool use_orco)
|
2018-05-08 11:33:31 +02:00
|
|
|
{
|
2022-10-06 16:05:56 -05:00
|
|
|
if (mesh != nullptr) {
|
2018-05-08 11:33:31 +02:00
|
|
|
/* pass */
|
|
|
|
|
}
|
|
|
|
|
else if (ob->type == OB_MESH) {
|
2018-05-14 14:34:00 +02:00
|
|
|
if (em) {
|
2022-10-06 16:05:56 -05:00
|
|
|
mesh = BKE_mesh_wrapper_from_editmesh_with_coords(
|
|
|
|
|
em, nullptr, vertexCos, static_cast<const Mesh *>(ob->data));
|
2018-05-14 14:34:00 +02:00
|
|
|
}
|
2018-05-08 11:33:31 +02:00
|
|
|
else {
|
2018-05-09 17:37:54 +02:00
|
|
|
/* TODO(sybren): after modifier conversion of DM to Mesh is done, check whether
|
|
|
|
|
* we really need a copy here. Maybe the CoW ob->data can be directly used. */
|
2018-12-14 16:07:29 +01:00
|
|
|
Mesh *mesh_prior_modifiers = BKE_object_get_pre_modified_mesh(ob);
|
2023-04-19 15:49:13 -04:00
|
|
|
mesh = (Mesh *)BKE_id_copy_ex(
|
|
|
|
|
nullptr, &mesh_prior_modifiers->id, nullptr, LIB_ID_COPY_LOCALIZE);
|
2022-12-29 12:01:32 -05:00
|
|
|
mesh->runtime->deformed_only = true;
|
2018-05-08 11:33:31 +02:00
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2022-10-06 16:05:56 -05:00
|
|
|
if (em != nullptr) {
|
2020-05-25 20:16:42 +10:00
|
|
|
/* pass */
|
|
|
|
|
}
|
2018-05-09 17:37:54 +02:00
|
|
|
/* TODO(sybren): after modifier conversion of DM to Mesh is done, check whether
|
|
|
|
|
* we really need vertexCos here. */
|
2020-05-25 20:16:42 +10:00
|
|
|
else if (vertexCos) {
|
2019-08-22 06:28:35 +10:00
|
|
|
BKE_mesh_vert_coords_apply(mesh, vertexCos);
|
2018-05-08 11:33:31 +02:00
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2018-05-08 11:33:31 +02:00
|
|
|
if (use_orco) {
|
2021-11-22 12:04:37 +01:00
|
|
|
BKE_mesh_orco_ensure(ob, mesh);
|
2018-05-08 11:33:31 +02:00
|
|
|
}
|
|
|
|
|
}
|
2022-02-18 09:50:29 -06:00
|
|
|
else if (ELEM(ob->type, OB_FONT, OB_CURVES_LEGACY, OB_SURF)) {
|
2019-05-01 07:40:07 +10:00
|
|
|
/* TODO(sybren): get evaluated mesh from depsgraph once
|
|
|
|
|
* that's properly generated for curves. */
|
2018-05-08 17:28:43 +02:00
|
|
|
mesh = BKE_mesh_new_nomain_from_curve(ob);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2020-09-10 09:45:25 +10:00
|
|
|
/* Currently, that may not be the case every time
|
2019-05-01 07:40:07 +10:00
|
|
|
* (texts e.g. tend to give issues,
|
|
|
|
|
* also when deforming curve points instead of generated curve geometry... ). */
|
2022-10-06 16:05:56 -05:00
|
|
|
if (mesh != nullptr && mesh->totvert != verts_num) {
|
|
|
|
|
BKE_id_free(nullptr, mesh);
|
|
|
|
|
mesh = nullptr;
|
2018-11-27 17:21:16 +01:00
|
|
|
}
|
2018-05-08 11:33:31 +02:00
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2022-10-12 20:55:26 -05:00
|
|
|
if (mesh && mesh->runtime->wrapper_type == ME_WRAPPER_TYPE_MDATA) {
|
2022-03-28 12:29:47 +11:00
|
|
|
BLI_assert(mesh->totvert == verts_num);
|
2020-05-25 20:16:42 +10:00
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2018-05-08 11:33:31 +02:00
|
|
|
return mesh;
|
|
|
|
|
}
|
|
|
|
|
|
2018-06-29 19:02:19 +02:00
|
|
|
void MOD_get_vgroup(
|
Mesh: Remove redundant custom data pointers
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-05 11:56:34 -05:00
|
|
|
Object *ob, struct Mesh *mesh, const char *name, const MDeformVert **dvert, int *defgrp_index)
|
2018-04-19 11:03:58 +02:00
|
|
|
{
|
2021-07-13 12:10:34 -04:00
|
|
|
if (mesh) {
|
|
|
|
|
*defgrp_index = BKE_id_defgroup_name_index(&mesh->id, name);
|
|
|
|
|
if (*defgrp_index != -1) {
|
Mesh: Remove redundant custom data pointers
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-05 11:56:34 -05:00
|
|
|
*dvert = BKE_mesh_deform_verts(mesh);
|
2021-07-13 12:10:34 -04:00
|
|
|
}
|
|
|
|
|
else {
|
2022-10-06 16:05:56 -05:00
|
|
|
*dvert = nullptr;
|
2021-07-13 12:10:34 -04:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
*defgrp_index = BKE_object_defgroup_name_index(ob, name);
|
|
|
|
|
if (*defgrp_index != -1 && ob->type == OB_LATTICE) {
|
2018-04-19 11:03:58 +02:00
|
|
|
*dvert = BKE_lattice_deform_verts_get(ob);
|
2019-04-22 09:15:10 +10:00
|
|
|
}
|
2021-07-13 12:10:34 -04:00
|
|
|
else {
|
2022-10-06 16:05:56 -05:00
|
|
|
*dvert = nullptr;
|
2019-04-22 09:15:10 +10:00
|
|
|
}
|
2018-04-19 11:03:58 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-04-10 22:00:21 +02:00
|
|
|
void MOD_depsgraph_update_object_bone_relation(struct DepsNodeHandle *node,
|
|
|
|
|
Object *object,
|
|
|
|
|
const char *bonename,
|
|
|
|
|
const char *description)
|
|
|
|
|
{
|
2022-10-06 16:05:56 -05:00
|
|
|
if (object == nullptr) {
|
2020-04-10 22:00:21 +02:00
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (bonename[0] != '\0' && object->type == OB_ARMATURE) {
|
|
|
|
|
DEG_add_object_relation(node, object, DEG_OB_COMP_EVAL_POSE, description);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
DEG_add_object_relation(node, object, DEG_OB_COMP_TRANSFORM, description);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2010-10-14 06:29:17 +00:00
|
|
|
void modifier_type_init(ModifierTypeInfo *types[])
|
2010-04-25 01:10:03 +00:00
|
|
|
{
|
|
|
|
|
#define INIT_TYPE(typeName) (types[eModifierType_##typeName] = &modifierType_##typeName)
|
|
|
|
|
INIT_TYPE(None);
|
|
|
|
|
INIT_TYPE(Curve);
|
|
|
|
|
INIT_TYPE(Lattice);
|
|
|
|
|
INIT_TYPE(Subsurf);
|
|
|
|
|
INIT_TYPE(Build);
|
|
|
|
|
INIT_TYPE(Array);
|
|
|
|
|
INIT_TYPE(Mirror);
|
|
|
|
|
INIT_TYPE(EdgeSplit);
|
|
|
|
|
INIT_TYPE(Bevel);
|
|
|
|
|
INIT_TYPE(Displace);
|
|
|
|
|
INIT_TYPE(UVProject);
|
|
|
|
|
INIT_TYPE(Decimate);
|
|
|
|
|
INIT_TYPE(Smooth);
|
|
|
|
|
INIT_TYPE(Cast);
|
|
|
|
|
INIT_TYPE(Wave);
|
|
|
|
|
INIT_TYPE(Armature);
|
|
|
|
|
INIT_TYPE(Hook);
|
|
|
|
|
INIT_TYPE(Softbody);
|
|
|
|
|
INIT_TYPE(Cloth);
|
|
|
|
|
INIT_TYPE(Collision);
|
|
|
|
|
INIT_TYPE(Boolean);
|
|
|
|
|
INIT_TYPE(MeshDeform);
|
2011-11-13 12:17:27 +00:00
|
|
|
INIT_TYPE(Ocean);
|
2010-04-25 01:10:03 +00:00
|
|
|
INIT_TYPE(ParticleSystem);
|
|
|
|
|
INIT_TYPE(ParticleInstance);
|
|
|
|
|
INIT_TYPE(Explode);
|
|
|
|
|
INIT_TYPE(Shrinkwrap);
|
|
|
|
|
INIT_TYPE(Mask);
|
|
|
|
|
INIT_TYPE(SimpleDeform);
|
|
|
|
|
INIT_TYPE(Multires);
|
|
|
|
|
INIT_TYPE(Surface);
|
2019-12-16 15:50:14 +01:00
|
|
|
INIT_TYPE(Fluid);
|
2010-04-25 01:10:03 +00:00
|
|
|
INIT_TYPE(ShapeKey);
|
|
|
|
|
INIT_TYPE(Solidify);
|
|
|
|
|
INIT_TYPE(Screw);
|
2011-05-01 15:16:59 +00:00
|
|
|
INIT_TYPE(Warp);
|
2011-07-25 15:27:01 +00:00
|
|
|
INIT_TYPE(WeightVGEdit);
|
|
|
|
|
INIT_TYPE(WeightVGMix);
|
|
|
|
|
INIT_TYPE(WeightVGProximity);
|
2011-05-24 07:08:58 +00:00
|
|
|
INIT_TYPE(DynamicPaint);
|
2011-12-30 21:11:40 +00:00
|
|
|
INIT_TYPE(Remesh);
|
2012-05-22 15:29:01 +00:00
|
|
|
INIT_TYPE(Skin);
|
2012-10-24 10:39:11 +00:00
|
|
|
INIT_TYPE(LaplacianSmooth);
|
2012-11-19 20:40:08 +00:00
|
|
|
INIT_TYPE(Triangulate);
|
2012-12-14 04:07:30 +00:00
|
|
|
INIT_TYPE(UVWarp);
|
2013-01-21 15:41:00 +00:00
|
|
|
INIT_TYPE(MeshCache);
|
2013-11-24 07:00:49 +11:00
|
|
|
INIT_TYPE(LaplacianDeform);
|
2013-12-22 07:08:35 +11:00
|
|
|
INIT_TYPE(Wireframe);
|
2019-12-11 22:31:20 -03:00
|
|
|
INIT_TYPE(Weld);
|
2015-01-09 21:19:12 +01:00
|
|
|
INIT_TYPE(DataTransfer);
|
2015-02-05 14:49:44 +01:00
|
|
|
INIT_TYPE(NormalEdit);
|
2015-03-29 04:44:05 +11:00
|
|
|
INIT_TYPE(CorrectiveSmooth);
|
Basic Alembic support
All in all, this patch adds an Alembic importer, an Alembic exporter,
and a new CacheFile data block which, for now, wraps around an Alembic
archive. This data block is made available through a new modifier ("Mesh
Sequence Cache") as well as a new constraint ("Transform Cache") to
somewhat properly support respectively geometric and transformation data
streaming from alembic caches.
A more in-depth documentation is to be found on the wiki, as well as a
guide to compile alembic: https://wiki.blender.org/index.php/
User:Kevindietrich/AlembicBasicIo.
Many thanks to everyone involved in this little project, and huge shout
out to "cgstrive" for the thorough testings with Maya, 3ds Max, Houdini
and Realflow as well as @fjuhec, @jensverwiebe and @jasperge for the
custom builds and compile fixes.
Reviewers: sergey, campbellbarton, mont29
Reviewed By: sergey, campbellbarton, mont29
Differential Revision: https://developer.blender.org/D2060
2016-08-06 06:20:37 +02:00
|
|
|
INIT_TYPE(MeshSequenceCache);
|
2017-02-27 12:39:14 -03:00
|
|
|
INIT_TYPE(SurfaceDeform);
|
2018-05-25 22:24:24 +05:30
|
|
|
INIT_TYPE(WeightedNormal);
|
2020-09-29 16:02:40 +02:00
|
|
|
INIT_TYPE(MeshToVolume);
|
2020-10-07 18:03:07 +02:00
|
|
|
INIT_TYPE(VolumeDisplace);
|
2020-10-19 12:11:38 +02:00
|
|
|
INIT_TYPE(VolumeToMesh);
|
2020-12-02 13:25:25 +01:00
|
|
|
INIT_TYPE(Nodes);
|
2010-04-25 01:10:03 +00:00
|
|
|
#undef INIT_TYPE
|
|
|
|
|
}
|