[Bf-blender-cvs] [4dda04eaa9e] sculpt-dev: Merge branch 'master' into sculpt-dev
Pablo
noreply at git.blender.org
Sat Aug 28 19:58:24 CEST 2021
Commit: 4dda04eaa9e0646f275b7633b4168906ea3c7a71
Author: Pablo
Date: Thu Aug 26 23:19:21 2021 +0200
Branches: sculpt-dev
https://developer.blender.org/rB4dda04eaa9e0646f275b7633b4168906ea3c7a71
Merge branch 'master' into sculpt-dev
===================================================================
===================================================================
diff --cc source/blender/blenkernel/intern/brush.c
index f90068ee1ba,7b81187be21..050c5f75e41
--- a/source/blender/blenkernel/intern/brush.c
+++ b/source/blender/blenkernel/intern/brush.c
@@@ -206,83 -202,50 +206,82 @@@ static void brush_foreach_id(ID *id, Li
static void brush_blend_write(BlendWriter *writer, ID *id, const void *id_address)
{
Brush *brush = (Brush *)id;
- if (brush->id.us > 0 || BLO_write_is_undo(writer)) {
- BLO_write_id_struct(writer, Brush, id_address, &brush->id);
- BKE_id_blend_write(writer, &brush->id);
- if (brush->curve) {
- BKE_curvemapping_blend_write(writer, brush->curve);
+ BLO_write_id_struct(writer, Brush, id_address, &brush->id);
+ BKE_id_blend_write(writer, &brush->id);
+
+ if (brush->curve) {
+ BKE_curvemapping_blend_write(writer, brush->curve);
+ }
++ if (brush->pressure_size_curve) {
++ BKE_curvemapping_blend_write(writer, brush->pressure_size_curve);
++ }
++ if (brush->pressure_strength_curve) {
++ BKE_curvemapping_blend_write(writer, brush->pressure_strength_curve);
++ }
+
+ if (brush->gpencil_settings) {
+ BLO_write_struct(writer, BrushGpencilSettings, brush->gpencil_settings);
+
+ if (brush->gpencil_settings->curve_sensitivity) {
+ BKE_curvemapping_blend_write(writer, brush->gpencil_settings->curve_sensitivity);
}
- if (brush->pressure_size_curve) {
- BKE_curvemapping_blend_write(writer, brush->pressure_size_curve);
+ if (brush->gpencil_settings->curve_strength) {
+ BKE_curvemapping_blend_write(writer, brush->gpencil_settings->curve_strength);
}
- if (brush->pressure_strength_curve) {
- BKE_curvemapping_blend_write(writer, brush->pressure_strength_curve);
+ if (brush->gpencil_settings->curve_jitter) {
+ BKE_curvemapping_blend_write(writer, brush->gpencil_settings->curve_jitter);
}
-
- if (brush->gpencil_settings) {
- BLO_write_struct(writer, BrushGpencilSettings, brush->gpencil_settings);
-
- if (brush->gpencil_settings->curve_sensitivity) {
- BKE_curvemapping_blend_write(writer, brush->gpencil_settings->curve_sensitivity);
- }
- if (brush->gpencil_settings->curve_strength) {
- BKE_curvemapping_blend_write(writer, brush->gpencil_settings->curve_strength);
- }
- if (brush->gpencil_settings->curve_jitter) {
- BKE_curvemapping_blend_write(writer, brush->gpencil_settings->curve_jitter);
- }
- if (brush->gpencil_settings->curve_rand_pressure) {
- BKE_curvemapping_blend_write(writer, brush->gpencil_settings->curve_rand_pressure);
- }
- if (brush->gpencil_settings->curve_rand_strength) {
- BKE_curvemapping_blend_write(writer, brush->gpencil_settings->curve_rand_strength);
- }
- if (brush->gpencil_settings->curve_rand_uv) {
- BKE_curvemapping_blend_write(writer, brush->gpencil_settings->curve_rand_uv);
- }
- if (brush->gpencil_settings->curve_rand_hue) {
- BKE_curvemapping_blend_write(writer, brush->gpencil_settings->curve_rand_hue);
- }
- if (brush->gpencil_settings->curve_rand_saturation) {
- BKE_curvemapping_blend_write(writer, brush->gpencil_settings->curve_rand_saturation);
- }
- if (brush->gpencil_settings->curve_rand_value) {
- BKE_curvemapping_blend_write(writer, brush->gpencil_settings->curve_rand_value);
- }
+ if (brush->gpencil_settings->curve_rand_pressure) {
+ BKE_curvemapping_blend_write(writer, brush->gpencil_settings->curve_rand_pressure);
+ }
+ if (brush->gpencil_settings->curve_rand_strength) {
+ BKE_curvemapping_blend_write(writer, brush->gpencil_settings->curve_rand_strength);
}
- if (brush->gradient) {
- BLO_write_struct(writer, ColorBand, brush->gradient);
+ if (brush->gpencil_settings->curve_rand_uv) {
+ BKE_curvemapping_blend_write(writer, brush->gpencil_settings->curve_rand_uv);
+ }
+ if (brush->gpencil_settings->curve_rand_hue) {
+ BKE_curvemapping_blend_write(writer, brush->gpencil_settings->curve_rand_hue);
+ }
+ if (brush->gpencil_settings->curve_rand_saturation) {
+ BKE_curvemapping_blend_write(writer, brush->gpencil_settings->curve_rand_saturation);
+ }
+ if (brush->gpencil_settings->curve_rand_value) {
+ BKE_curvemapping_blend_write(writer, brush->gpencil_settings->curve_rand_value);
}
}
+ if (brush->gradient) {
+ BLO_write_struct(writer, ColorBand, brush->gradient);
+ }
}
+static void brush_reset_input_curve(CurveMapping *cumap)
+{
+ cumap->flag &= ~CUMA_EXTEND_EXTRAPOLATE;
+ cumap->preset = CURVE_PRESET_LINE;
+
+ CurveMap *cuma = cumap->cm;
+ BKE_curvemap_reset(cuma, &cumap->clipr, cumap->preset, CURVEMAP_SLOPE_POSITIVE);
+ BKE_curvemapping_changed(cumap, false);
+ BKE_curvemapping_init(cumap);
+}
+
+void BKE_brush_default_input_curves_set(Brush *brush)
+{
+ if (brush->pressure_size_curve) {
+ BKE_curvemapping_free(brush->pressure_size_curve);
+ }
+ brush->pressure_size_curve = BKE_curvemapping_add(1, 0, 0, 1, 1);
+ brush_reset_input_curve(brush->pressure_size_curve);
+
+ if (brush->pressure_strength_curve) {
+ BKE_curvemapping_free(brush->pressure_strength_curve);
+ }
+ brush->pressure_strength_curve = BKE_curvemapping_add(1, 0, 0, 1, 1);
+ brush_reset_input_curve(brush->pressure_strength_curve);
+}
+
static void brush_blend_read_data(BlendDataReader *reader, ID *id)
{
Brush *brush = (Brush *)id;
diff --cc source/blender/editors/object/object_modes.c
index 6fd26297398,2c58ef02486..da38f7a627c
--- a/source/blender/editors/object/object_modes.c
+++ b/source/blender/editors/object/object_modes.c
@@@ -597,7 -585,7 +597,7 @@@ void OBJECT_OT_transfer_mode(wmOperator
"use_flash_on_transfer",
true,
"Flash On Transfer",
- "Flash the target object when transfering the mode");
+ "Flash the target object when transferring the mode");
}
-/** \} */
+/** \} */
diff --cc source/blender/editors/object/object_relations.c
index bb372726285,ec72ff11683..699efd9ce75
--- a/source/blender/editors/object/object_relations.c
+++ b/source/blender/editors/object/object_relations.c
@@@ -2827,19 -2765,13 +2827,18 @@@ static int drop_named_material_invoke(b
return OPERATOR_CANCELLED;
}
- Object *ob = base->object;
+ if (ob->mode == OB_MODE_SCULPT) {
+ drop_named_material_face_set_slots_update(C, ob, event);
+ }
+
const short active_mat_slot = ob->actcol;
- BKE_object_material_assign(CTX_data_main(C), ob, ma, active_mat_slot, BKE_MAT_ASSIGN_USERPREF);
+ BKE_object_material_assign(
- CTX_data_main(C), base->object, ma, active_mat_slot, BKE_MAT_ASSIGN_USERPREF);
++ CTX_data_main(C), ob, ma, active_mat_slot, BKE_MAT_ASSIGN_USERPREF);
- DEG_id_tag_update(&base->object->id, ID_RECALC_TRANSFORM);
+ DEG_id_tag_update(&ob->id, ID_RECALC_TRANSFORM);
- WM_event_add_notifier(C, NC_OBJECT | ND_OB_SHADING, base->object);
+ WM_event_add_notifier(C, NC_OBJECT | ND_OB_SHADING, ob);
WM_event_add_notifier(C, NC_SPACE | ND_SPACE_VIEW3D, NULL);
WM_event_add_notifier(C, NC_MATERIAL | ND_SHADING_LINKS, ma);
diff --cc source/blender/editors/sculpt_paint/sculpt_array.c
index 8793162f1c2,00000000000..d93f61168ea
mode 100644,000000..100644
--- a/source/blender/editors/sculpt_paint/sculpt_array.c
+++ b/source/blender/editors/sculpt_paint/sculpt_array.c
@@@ -1,981 -1,0 +1,982 @@@
+/*
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * The Original Code is Copyright (C) 2020 Blender Foundation.
+ * All rights reserved.
+ */
+
+/** \file
+ * \ingroup edsculpt
+ */
+
+#include "MEM_guardedalloc.h"
+
+#include "BLI_blenlib.h"
+#include "BLI_math.h"
+#include "BLI_hash.h"
+#include "BLI_task.h"
+
+#include "DNA_brush_types.h"
+#include "DNA_mesh_types.h"
+#include "DNA_meshdata_types.h"
+#include "DNA_object_types.h"
+
+#include "BKE_brush.h"
+#include "BKE_ccg.h"
+#include "BKE_colortools.h"
+#include "BKE_context.h"
+#include "BKE_mesh.h"
+#include "BKE_multires.h"
++#include "BKE_lib_id.h"
+#include "BKE_node.h"
+#include "BKE_object.h"
+#include "BKE_paint.h"
+#include "BKE_pbvh.h"
+#include "BKE_scene.h"
+
+#include "paint_intern.h"
+#include "sculpt_intern.h"
+
+#include "GPU_immediate.h"
+#include "GPU_immediate_util.h"
+#include "GPU_matrix.h"
+#include "GPU_state.h"
+
+#include "ED_sculpt.h"
+
+#include "bmesh.h"
+#include "bmesh_tools.h"
+
+#include <math.h>
+#include <stdlib.h>
+
+
+static const char array_symmetry_pass_cd_name[] = "v_symmetry_pass";
+static const char array_instance_cd_name[] = "v_array_instance";
+
+#define ARRAY_INSTANCE_ORIGINAL -1
+
+static void sculpt_vertex_array_data_get(SculptArray *array, const int vertex, int *r_copy, int *r_symmetry_pass) {
+ if (!array->copy_index) {
+ printf("NO ARRAY COPY\n");
+ *r_copy = ARRAY_INSTANCE_ORIGINAL;
+ *r_symmetry_pass = 0;
+ return;
+ }
+ *r_copy = array->copy_index[vertex];
+ *r_symmetry_pass = array->symmetry_pass[vertex];
+}
+
+
+static void sculpt_array_datalayers_add(Mesh *mesh) {
+ int *v_array_instance = CustomData_add_layer_named(&mesh->vdata,
+ CD_PROP_INT32,
+ CD_CALLOC,
+ NULL,
+
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list