[Bf-blender-cvs] [0917431ca4e] sculpt-dev: Merge branch 'master' into sculpt-dev
Joseph Eagar
noreply at git.blender.org
Tue Dec 14 22:35:06 CET 2021
Commit: 0917431ca4e55f9bb9962ac862b272f5a614e4ef
Author: Joseph Eagar
Date: Tue Dec 14 13:27:44 2021 -0800
Branches: sculpt-dev
https://developer.blender.org/rB0917431ca4e55f9bb9962ac862b272f5a614e4ef
Merge branch 'master' into sculpt-dev
===================================================================
===================================================================
diff --cc release/datafiles/locale
index 3a78acbab9f,9d270fd007f..620b85f16d0
--- a/release/datafiles/locale
+++ b/release/datafiles/locale
@@@ -1,1 -1,1 +1,1 @@@
- Subproject commit 3a78acbab9f63b18e93c1fa72b68a85e1bdeba05
-Subproject commit 9d270fd007f628b23ccbcbd87caa2dc35286b26a
++Subproject commit 620b85f16d03a6aadd7cae56969c9c29b06b992d
diff --cc release/datafiles/startup.blend
index 0ce69c12de1,fe142d7de7e..f683d084dd1
Binary files differ
diff --cc release/scripts/addons
index a444e8cc19a,b3c179b2869..ece39d809ce
--- a/release/scripts/addons
+++ b/release/scripts/addons
@@@ -1,1 -1,1 +1,1 @@@
- Subproject commit a444e8cc19a4353ce35ecdec9bb7894ee73a204a
-Subproject commit b3c179b2869d86c44a4b29e2c638ce2a596a820d
++Subproject commit ece39d809ceb27b5a06da7c4b8f25ca77016b151
diff --cc source/blender/editors/sculpt_paint/paint_ops.c
index 65933c1b655,c6b519f711f..2104e236fef
--- a/source/blender/editors/sculpt_paint/paint_ops.c
+++ b/source/blender/editors/sculpt_paint/paint_ops.c
@@@ -144,9 -143,6 +144,8 @@@ static int brush_scale_size_exec(bConte
// Object *ob = CTX_data_active_object(C);
float scalar = RNA_float_get(op->ptr, "scalar");
+ bool use_brush_channels = paint_use_channels(C);
- Object *ob = CTX_data_active_object(C);
+
if (brush) {
/* pixel radius */
{
@@@ -826,6 -802,6 +825,7 @@@ static int brush_select_exec(bContext *
if (paint == NULL) {
return OPERATOR_CANCELLED;
}
++
const EnumPropertyItem *items = BKE_paint_get_tool_enum_from_paintmode(paint_mode);
RNA_enum_name_from_value(items, tool, &tool_name);
@@@ -865,7 -841,7 +865,7 @@@ static void PAINT_OT_brush_select(wmOpe
RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE);
prop = RNA_def_boolean(ot->srna,
"create_missing",
-- 0,
++ true,
"Create Missing",
"If the requested brush type does not exist, create a new brush");
RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE);
diff --cc source/blender/editors/sculpt_paint/sculpt.c
index 22febcf309d,aeeed094aab..540c83dab54
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@@ -125,140 -102,8 +125,142 @@@
#include <stdlib.h>
#include <string.h>
+static bool sculpt_check_boundary_vertex_in_base_mesh(const SculptSession *ss,
+ const SculptVertRef index);
+typedef void (*BrushActionFunc)(
+ Sculpt *sd, Object *ob, Brush *brush, UnifiedPaintSettings *ups, void *data);
+
+void sculpt_combine_proxies(Sculpt *sd, Object *ob);
+static void SCULPT_run_commandlist(
+ Sculpt *sd, Object *ob, Brush *brush, BrushCommandList *list, UnifiedPaintSettings *ups);
+static void do_symmetrical_brush_actions(
+ Sculpt *sd, Object *ob, BrushActionFunc action, UnifiedPaintSettings *ups, void *userdata);
+
+/* Sculpt API to get brush channel data
+ If ss->cache exists then ss->cache->channels_final
+ will be used, otherwise brush and tool settings channels
+ will be used (taking inheritence into account).
+*/
+
+static BrushChannelSet *sculpt_get_brush_channels(const SculptSession *ss, const Brush *br)
+{
+ if (ss->cache && ss->cache->tool_override_channels) {
+ return ss->cache->tool_override_channels;
+ }
+ else {
+ return br->channels;
+ }
+}
+
+float SCULPT_get_float_intern(const SculptSession *ss,
+ const char *idname,
+ const Sculpt *sd,
+ const Brush *br)
+{
+ BrushMappingData *mapdata = ss->cache ? &ss->cache->input_mapping : NULL;
+
+ if (ss->cache && ss->cache->channels_final) {
+ return BKE_brush_channelset_get_float(ss->cache->channels_final, idname, mapdata);
+ }
+ else if (br && sd && br->channels && sd->channels) {
+ return BKE_brush_channelset_get_final_float(
+ sculpt_get_brush_channels(ss, br), sd->channels, idname, mapdata);
+ }
+ else if (br && br->channels) {
+ return BKE_brush_channelset_get_float(sculpt_get_brush_channels(ss, br), idname, mapdata);
+ }
+ else if (sd && sd->channels) {
+ return BKE_brush_channelset_get_float(sd->channels, idname, mapdata);
+ }
+ else {
+ // should not happen!
+ return 0.0f;
+ }
+}
+
+int SCULPT_get_int_intern(const SculptSession *ss,
+ const char *idname,
+ const Sculpt *sd,
+ const Brush *br)
+{
+ BrushMappingData *mapdata = ss->cache ? &ss->cache->input_mapping : NULL;
+
+ if (ss->cache && ss->cache->channels_final) {
+ return BKE_brush_channelset_get_int(ss->cache->channels_final, idname, mapdata);
+ }
+ else if (br && br->channels && sd && sd->channels) {
+ return BKE_brush_channelset_get_final_int(
+ sculpt_get_brush_channels(ss, br), sd->channels, idname, mapdata);
+ }
+ else if (br && br->channels) {
+ return BKE_brush_channelset_get_int(sculpt_get_brush_channels(ss, br), idname, mapdata);
+ }
+ else if (sd && sd->channels) {
+ return BKE_brush_channelset_get_int(sd->channels, idname, mapdata);
+ }
+ else {
+ // should not happen!
+ return 0;
+ }
+}
+
+int SCULPT_get_vector_intern(
+ const SculptSession *ss, const char *idname, float out[4], const Sculpt *sd, const Brush *br)
+{
+ BrushMappingData *mapdata = ss->cache ? &ss->cache->input_mapping : NULL;
+
+ if (ss->cache && ss->cache->channels_final) {
+
+ return BKE_brush_channelset_get_vector(ss->cache->channels_final, idname, out, mapdata);
+ }
+ else if (br && br->channels && sd && sd->channels) {
+ return BKE_brush_channelset_get_final_vector(
+ sculpt_get_brush_channels(ss, br), sd->channels, idname, out, mapdata);
+ }
+ else if (br && br->channels) {
+ return BKE_brush_channelset_get_vector(
+ sculpt_get_brush_channels(ss, br), idname, out, mapdata);
+ }
+ else if (sd && sd->channels) {
+ return BKE_brush_channelset_get_vector(sd->channels, idname, out, mapdata);
+ }
+ else {
+ // should not happen!
+ return 0;
+ }
+}
+
+BrushChannel *SCULPT_get_final_channel_intern(const SculptSession *ss,
+ const char *idname,
+ const Sculpt *sd,
+ const Brush *br)
+{
+ BrushChannel *ch = NULL;
+
+ if (ss->cache && ss->cache->channels_final) {
+ ch = BKE_brush_channelset_lookup(ss->cache->channels_final, idname);
+ }
+ else if (br && br->channels && sd && sd->channels) {
+ ch = BKE_brush_channelset_lookup(sculpt_get_brush_channels(ss, br), idname);
+ BrushChannel *ch2 = BKE_brush_channelset_lookup(sd->channels, idname);
+
+ if (ch2 && (!ch || (ch->flag & BRUSH_CHANNEL_INHERIT))) {
+ ch = ch2;
+ }
+ }
+ else if (br && br->channels) {
+ ch = BKE_brush_channelset_lookup(sculpt_get_brush_channels(ss, br), idname);
+ }
+ else if (sd && sd->channels) {
+ ch = BKE_brush_channelset_lookup(sd->channels, idname);
+ }
+
+ return ch;
+}
+
- /* Sculpt PBVH abstraction API
+ /* -------------------------------------------------------------------- */
+ /** \name Sculpt PBVH Abstraction API
++
*
* This is read-only, for writing use PBVH vertex iterators. There vd.index matches
* the indices used here.
@@@ -2226,116 -990,83 +2229,115 @@@ void SCULPT_vertex_neighbors_get(const
}
}
-int SCULPT_nearest_vertex_get(
- Sculpt *sd, Object *ob, const float co[3], float max_distance, bool use_original)
+SculptBoundaryType SCULPT_edge_is_boundary(const SculptSession *ss,
+ const SculptEdgeRef edge,
+ SculptBoundaryType typemask)
{
- SculptSession *ss = ob->sculpt;
- PBVHNode **nodes = NULL;
- int totnode;
- SculptSearchSphereData data = {
- .ss = ss,
- .sd = sd,
- .radius_squared = max_distance * max_distance,
- .original = use_original,
- .center = co,
- };
- BKE_pbvh_search_gather(ss->pbvh, SCULPT_search_sphere_cb, &data, &nodes, &totnode);
- if (totnode == 0) {
- return -1;
- }
- SculptThreadedTaskData task_data = {
- .sd = sd,
- .ob = ob,
- .nodes = nodes,
- .max_distance_squared = max_distance * max_distance,
- };
+ int ret = 0;
- copy_v3_v3(task_data.nearest_vertex_search_co, co);
- NearestVertexTLSData nvtd;
- nvtd.nearest_vertex_index = -1;
- nvtd.nearest_vertex_distance_squared = FLT_MAX;
+ switch (BKE_pbvh_type(ss->pbvh)) {
+ case PBVH_BMESH: {
+ BMEdge *e = (BMEdge *)edge.i;
- TaskParallelSettings settings;
- BKE_pbvh_parallel_range_settings(&settings, true, totnode);
- settings.func_reduce = nearest_vertex_get_reduce;
- settings.userdata_chunk = &nvtd;
- settings.userdata_chunk_size = sizeof(NearestVertexTLSData);
- BLI_task_parallel_range(0, totnode, &task_data, do_nearest_vertex_get_task_cb, &settings);
+ if (typemask & SCULPT_BOUNDARY_MESH) {
+ ret |= (!e->l || e->l == e->l->radial_next) ? SCULPT_BOUNDARY_MESH : 0;
+ }
- MEM_SAFE_FREE(nodes);
+ if ((typemask & SCULPT_BOUNDARY_FACE_SET) && e->l && e->l != e->l->radial_next) {
+ if (ss->boundary_symmetry) {
+ // TODO: calc and cache this properly
+ MSculptVert *mv1 = BKE_PBVH_SCULPTVERT(ss->cd_sculpt_vert, e->v1);
+ MSculptVert *mv2 = BKE_PBVH_SCULPTVERT(ss->cd_sculpt_vert, e->v2);
- return nvtd.nearest_vertex_index;
-}
+ bool ok = (mv1->flag & SCULPTVERT_FSET_BOUNDARY) &&
+ (mv2->flag & SCULPTVERT_FSET_BOUNDARY);
+ ret |= ok ? SCULPT_BOUNDARY_FACE_SET : 0;
+ }
+ else {
+ int fset1 = BM_ELEM_CD_GET_INT(e->l->f, ss->cd_faceset_offset);
+ int fset2 = BM_ELEM_CD_GET_INT(e->l->radial_next->f, ss->cd_faceset_offset);
-bool SCULPT_is_symmetry_iteration_valid(char i, char symm)
-{
- return i == 0 || (symm & i && (symm != 5 || i !
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list