Merge branch 'blender-v4.0-release' into main
This commit is contained in:
commit
47867549e8
|
@ -6,23 +6,13 @@
|
|||
* \ingroup edtransform
|
||||
*/
|
||||
|
||||
#include "DNA_mesh_types.h"
|
||||
#include "DNA_meshdata_types.h"
|
||||
|
||||
#include "MEM_guardedalloc.h"
|
||||
|
||||
#include "BLI_math_matrix.h"
|
||||
#include "BLI_math_vector.h"
|
||||
|
||||
#include "BKE_context.h"
|
||||
#include "BKE_crazyspace.h"
|
||||
#include "BKE_editmesh.h"
|
||||
#include "BKE_modifier.h"
|
||||
#include "BKE_scene.h"
|
||||
|
||||
#include "ED_mesh.hh"
|
||||
|
||||
#include "DEG_depsgraph_query.hh"
|
||||
#include "DEG_depsgraph.hh"
|
||||
|
||||
#include "transform.hh"
|
||||
#include "transform_orientations.hh"
|
||||
|
@ -67,7 +57,6 @@ static void createTransMeshVertCData(bContext * /*C*/, TransInfo *t)
|
|||
BLI_assert(ELEM(t->mode, TFM_BWEIGHT, TFM_VERT_CREASE));
|
||||
FOREACH_TRANS_DATA_CONTAINER (t, tc) {
|
||||
BMEditMesh *em = BKE_editmesh_from_object(tc->obedit);
|
||||
Mesh *me = static_cast<Mesh *>(tc->obedit->data);
|
||||
BMesh *bm = em->bm;
|
||||
BMVert *eve;
|
||||
BMIter iter;
|
||||
|
@ -76,7 +65,6 @@ static void createTransMeshVertCData(bContext * /*C*/, TransInfo *t)
|
|||
const int prop_mode = (t->flag & T_PROP_EDIT) ? (t->flag & T_PROP_EDIT_ALL) : 0;
|
||||
|
||||
TransIslandData island_data = {nullptr};
|
||||
TransMirrorData mirror_data = {nullptr};
|
||||
TransMeshDataCrazySpace crazyspace_data = {nullptr};
|
||||
|
||||
/* Support other objects using proportional editing to adjust these, unless connected is
|
||||
|
@ -151,29 +139,6 @@ static void createTransMeshVertCData(bContext * /*C*/, TransInfo *t)
|
|||
transform_convert_mesh_connectivity_distance(em->bm, mtx, dists, dists_index);
|
||||
}
|
||||
|
||||
/* Create TransDataMirror. */
|
||||
if (tc->use_mirror_axis_any) {
|
||||
bool use_topology = (me->editflag & ME_EDIT_MIRROR_TOPO) != 0;
|
||||
bool use_select = (t->flag & T_PROP_EDIT) == 0;
|
||||
const bool mirror_axis[3] = {
|
||||
bool(tc->use_mirror_axis_x), bool(tc->use_mirror_axis_y), bool(tc->use_mirror_axis_z)};
|
||||
transform_convert_mesh_mirrordata_calc(
|
||||
em, use_select, use_topology, mirror_axis, &mirror_data);
|
||||
|
||||
if (mirror_data.vert_map) {
|
||||
tc->data_mirror_len = mirror_data.mirror_elem_len;
|
||||
tc->data_mirror = MEM_cnew_array<TransDataMirror>(mirror_data.mirror_elem_len, __func__);
|
||||
|
||||
BM_ITER_MESH_INDEX (eve, &iter, bm, BM_VERTS_OF_MESH, a) {
|
||||
if (prop_mode || BM_elem_flag_test(eve, BM_ELEM_SELECT)) {
|
||||
if (mirror_data.vert_map[a].index != -1) {
|
||||
data_len--;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Detect CrazySpace [tm]. */
|
||||
transform_convert_mesh_crazyspace_detect(t, tc, em, &crazyspace_data);
|
||||
|
||||
|
@ -184,7 +149,6 @@ static void createTransMeshVertCData(bContext * /*C*/, TransInfo *t)
|
|||
MEM_callocN(data_len * sizeof(TransData), "TransObData(Mesh EditMode)"));
|
||||
|
||||
TransData *td = tc->data;
|
||||
TransDataMirror *td_mirror = tc->data_mirror;
|
||||
BM_ITER_MESH_INDEX (eve, &iter, bm, BM_VERTS_OF_MESH, a) {
|
||||
if (BM_elem_flag_test(eve, BM_ELEM_HIDDEN)) {
|
||||
continue;
|
||||
|
@ -197,18 +161,7 @@ static void createTransMeshVertCData(bContext * /*C*/, TransInfo *t)
|
|||
}
|
||||
|
||||
float *weight = static_cast<float *>(BM_ELEM_CD_GET_VOID_P(eve, cd_offset));
|
||||
if (mirror_data.vert_map && mirror_data.vert_map[a].index != -1) {
|
||||
mesh_cdata_transdata_create(
|
||||
(TransDataBasic *)td_mirror, eve, weight, &island_data, island_index);
|
||||
|
||||
int elem_index = mirror_data.vert_map[a].index;
|
||||
BMVert *v_src = BM_vert_at_index(bm, elem_index);
|
||||
|
||||
td_mirror->flag |= mirror_data.vert_map[a].flag;
|
||||
td_mirror->loc_src = static_cast<float *>(BM_ELEM_CD_GET_VOID_P(v_src, cd_offset));
|
||||
td_mirror++;
|
||||
}
|
||||
else if (prop_mode || BM_elem_flag_test(eve, BM_ELEM_SELECT)) {
|
||||
if (prop_mode || BM_elem_flag_test(eve, BM_ELEM_SELECT)) {
|
||||
mesh_cdata_transdata_create((TransDataBasic *)td, eve, weight, &island_data, island_index);
|
||||
|
||||
if (t->around == V3D_AROUND_LOCAL_ORIGINS) {
|
||||
|
@ -245,7 +198,6 @@ static void createTransMeshVertCData(bContext * /*C*/, TransInfo *t)
|
|||
}
|
||||
|
||||
transform_convert_mesh_islanddata_free(&island_data);
|
||||
transform_convert_mesh_mirrordata_free(&mirror_data);
|
||||
transform_convert_mesh_crazyspace_free(&crazyspace_data);
|
||||
if (dists) {
|
||||
MEM_freeN(dists);
|
||||
|
@ -257,37 +209,14 @@ static void createTransMeshVertCData(bContext * /*C*/, TransInfo *t)
|
|||
}
|
||||
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Recalc Mesh Data
|
||||
* \{ */
|
||||
|
||||
static void mesh_cdata_apply_to_mirror(TransInfo *t)
|
||||
{
|
||||
FOREACH_TRANS_DATA_CONTAINER (t, tc) {
|
||||
if (tc->use_mirror_axis_any) {
|
||||
TransDataMirror *td_mirror = tc->data_mirror;
|
||||
for (int i = 0; i < tc->data_mirror_len; i++, td_mirror++) {
|
||||
*td_mirror->val = td_mirror->loc_src[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void recalcData_mesh_cdata(TransInfo *t)
|
||||
{
|
||||
bool is_canceling = t->state == TRANS_CANCEL;
|
||||
/* mirror modifier clipping? */
|
||||
if (!is_canceling) {
|
||||
if (!(t->flag & T_NO_MIRROR)) {
|
||||
mesh_cdata_apply_to_mirror(t);
|
||||
}
|
||||
}
|
||||
|
||||
FOREACH_TRANS_DATA_CONTAINER (t, tc) {
|
||||
DEG_id_tag_update(static_cast<ID *>(tc->obedit->data), ID_RECALC_GEOMETRY);
|
||||
BMEditMesh *em = BKE_editmesh_from_object(tc->obedit);
|
||||
BKE_editmesh_looptri_and_normals_calc(em);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -60,9 +60,7 @@ static void node_gather_link_searches(GatherLinkSearchOpParams ¶ms)
|
|||
for (const EnumPropertyItem *item = rna_enum_ramp_blend_items; item->identifier != nullptr;
|
||||
item++) {
|
||||
if (item->name != nullptr && item->identifier[0] != '\0') {
|
||||
params.add_item(CTX_IFACE_(BLT_I18NCONTEXT_ID_NODETREE, item->name),
|
||||
SocketSearchOp{"Image", item->value},
|
||||
weight);
|
||||
params.add_item(IFACE_(item->name), SocketSearchOp{"Image", item->value}, weight);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -260,9 +260,7 @@ static void node_mix_gather_link_searches(GatherLinkSearchOpParams ¶ms)
|
|||
for (const EnumPropertyItem *item = rna_enum_ramp_blend_items; item->identifier != nullptr;
|
||||
item++) {
|
||||
if (item->name != nullptr && item->identifier[0] != '\0') {
|
||||
params.add_item(CTX_IFACE_(BLT_I18NCONTEXT_ID_NODETREE, item->name),
|
||||
SocketSearchOp{socket_name, item->value},
|
||||
weight);
|
||||
params.add_item(IFACE_(item->name), SocketSearchOp{socket_name, item->value}, weight);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -67,12 +67,12 @@ static void sh_node_vector_math_gather_link_searches(GatherLinkSearchOpParams &p
|
|||
NODE_VECTOR_MATH_DISTANCE,
|
||||
NODE_VECTOR_MATH_DOT_PRODUCT))
|
||||
{
|
||||
params.add_item(IFACE_(item->name),
|
||||
params.add_item(CTX_IFACE_(BLT_I18NCONTEXT_ID_NODETREE, item->name),
|
||||
SocketSearchOp{"Value", (NodeVectorMathOperation)item->value},
|
||||
weight);
|
||||
}
|
||||
else {
|
||||
params.add_item(IFACE_(item->name),
|
||||
params.add_item(CTX_IFACE_(BLT_I18NCONTEXT_ID_NODETREE, item->name),
|
||||
SocketSearchOp{"Vector", (NodeVectorMathOperation)item->value},
|
||||
weight);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue