Merge branch 'blender-v3.4-release'

This commit is contained in:
Philipp Oeser 2022-11-07 12:32:36 +01:00
commit 888fb0b395
4 changed files with 33 additions and 5 deletions

View File

@ -247,11 +247,8 @@ static bool add_custom_data_layer_from_attribute_init(const AttributeIDRef &attr
}
case AttributeInit::Type::MoveArray: {
void *source_data = static_cast<const AttributeInitMoveArray &>(initializer).data;
void *data = add_generic_custom_data_layer(
add_generic_custom_data_layer(
custom_data, data_type, CD_ASSIGN, source_data, domain_num, attribute_id);
if (source_data != nullptr && data == nullptr) {
MEM_freeN(source_data);
}
break;
}
}

View File

@ -2800,6 +2800,7 @@ static CustomDataLayer *customData_add_layer__internal(CustomData *data,
int flag = 0;
if (!typeInfo->defaultname && CustomData_has_layer(data, type)) {
MEM_SAFE_FREE(layerdata);
return &data->layers[CustomData_get_layer_index(data, type)];
}

View File

@ -532,6 +532,11 @@ static ModifierData *curve_get_tessellate_point(const Scene *scene,
return pretessellatePoint;
}
if (md->type == eModifierType_Smooth) {
/* Smooth modifier works with mesh edges explicitly (so needs tesselation, thus cannnot work on control points). */
md->mode &= ~eModifierMode_ApplyOnSpline;
return pretessellatePoint;
}
if (ELEM(md->type, eModifierType_Hook, eModifierType_Softbody, eModifierType_MeshDeform)) {
pretessellatePoint = md;

View File

@ -326,8 +326,33 @@ static void modifier_panel_header(const bContext *C, Panel *panel)
}
} /* Tessellation point for curve-typed objects. */
else if (ELEM(ob->type, OB_CURVES_LEGACY, OB_SURF, OB_FONT)) {
/* Smooth modifier can work with tessellated curves only (works on mesh edges explicitly). */
if (md->type == eModifierType_Smooth) {
/* Add button (appearing to be OFF) and add tip why this can't be changed. */
sub = uiLayoutRow(row, true);
uiBlock *block = uiLayoutGetBlock(sub);
static int apply_on_spline_always_off_hack = 0;
uiBut *but = uiDefIconButBitI(block,
UI_BTYPE_TOGGLE,
eModifierMode_ApplyOnSpline,
0,
ICON_SURFACE_DATA,
0,
0,
UI_UNIT_X - 2,
UI_UNIT_Y,
&apply_on_spline_always_off_hack,
0.0,
0.0,
0.0,
0.0,
TIP_("Apply on Spline"));
UI_but_disable(
but, TIP_("This modifier can only deform filled curve/surface, not the control points"));
buttons_number++;
}
/* Some modifiers can work with pre-tessellated curves only. */
if (ELEM(md->type, eModifierType_Hook, eModifierType_Softbody, eModifierType_MeshDeform)) {
else if (ELEM(md->type, eModifierType_Hook, eModifierType_Softbody, eModifierType_MeshDeform)) {
/* Add button (appearing to be ON) and add tip why this can't be changed. */
sub = uiLayoutRow(row, true);
uiBlock *block = uiLayoutGetBlock(sub);