Blender  V3.3
Typedefs | Enumerations | Functions | Variables
sculpt_face_set.c File Reference
#include "MEM_guardedalloc.h"
#include "BLI_blenlib.h"
#include "BLI_hash.h"
#include "BLI_math.h"
#include "BLI_task.h"
#include "DNA_brush_types.h"
#include "DNA_customdata_types.h"
#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "BKE_brush.h"
#include "BKE_ccg.h"
#include "BKE_colortools.h"
#include "BKE_context.h"
#include "BKE_customdata.h"
#include "BKE_mesh.h"
#include "BKE_mesh_fair.h"
#include "BKE_mesh_mapping.h"
#include "BKE_multires.h"
#include "BKE_node.h"
#include "BKE_object.h"
#include "BKE_paint.h"
#include "BKE_pbvh.h"
#include "BKE_scene.h"
#include "DEG_depsgraph.h"
#include "WM_api.h"
#include "WM_message.h"
#include "WM_toolsystem.h"
#include "WM_types.h"
#include "ED_object.h"
#include "ED_screen.h"
#include "ED_sculpt.h"
#include "ED_view3d.h"
#include "paint_intern.h"
#include "sculpt_intern.h"
#include "RNA_access.h"
#include "RNA_define.h"
#include "bmesh.h"
#include <math.h>
#include <stdlib.h>

Go to the source code of this file.

Typedefs

typedef enum eSculptFaceGroupsCreateModes eSculptFaceGroupsCreateModes
 
typedef enum eSculptFaceSetsInitMode eSculptFaceSetsInitMode
 
typedef bool(* face_sets_flood_fill_test) (BMesh *bm, BMFace *from_f, BMEdge *from_e, BMFace *to_f, const float threshold)
 
typedef enum eSculptFaceGroupVisibilityModes eSculptFaceGroupVisibilityModes
 
typedef enum eSculptFaceSetEditMode eSculptFaceSetEditMode
 

Enumerations

enum  eSculptFaceGroupsCreateModes { SCULPT_FACE_SET_MASKED = 0 , SCULPT_FACE_SET_VISIBLE = 1 , SCULPT_FACE_SET_ALL = 2 , SCULPT_FACE_SET_SELECTION = 3 }
 
enum  eSculptFaceSetsInitMode {
  SCULPT_FACE_SETS_FROM_LOOSE_PARTS = 0 , SCULPT_FACE_SETS_FROM_MATERIALS = 1 , SCULPT_FACE_SETS_FROM_NORMALS = 2 , SCULPT_FACE_SETS_FROM_UV_SEAMS = 3 ,
  SCULPT_FACE_SETS_FROM_CREASES = 4 , SCULPT_FACE_SETS_FROM_SHARP_EDGES = 5 , SCULPT_FACE_SETS_FROM_BEVEL_WEIGHT = 6 , SCULPT_FACE_SETS_FROM_FACE_MAPS = 7 ,
  SCULPT_FACE_SETS_FROM_FACE_SET_BOUNDARIES = 8
}
 
enum  eSculptFaceGroupVisibilityModes {
  SCULPT_FACE_SET_VISIBILITY_TOGGLE = 0 , SCULPT_FACE_SET_VISIBILITY_SHOW_ACTIVE = 1 , SCULPT_FACE_SET_VISIBILITY_HIDE_ACTIVE = 2 , SCULPT_FACE_SET_VISIBILITY_INVERT = 3 ,
  SCULPT_FACE_SET_VISIBILITY_SHOW_ALL = 4
}
 
enum  eSculptFaceSetEditMode {
  SCULPT_FACE_SET_EDIT_GROW = 0 , SCULPT_FACE_SET_EDIT_SHRINK = 1 , SCULPT_FACE_SET_EDIT_DELETE_GEOMETRY = 2 , SCULPT_FACE_SET_EDIT_FAIR_POSITIONS = 3 ,
  SCULPT_FACE_SET_EDIT_FAIR_TANGENCY = 4
}
 

Functions

int ED_sculpt_face_sets_find_next_available_id (struct Mesh *mesh)
 
void ED_sculpt_face_sets_initialize_none_to_id (struct Mesh *mesh, const int new_id)
 
int ED_sculpt_face_sets_active_update_and_get (bContext *C, Object *ob, const float mval[2])
 
static void do_draw_face_sets_brush_task_cb_ex (void *__restrict userdata, const int n, const TaskParallelTLS *__restrict tls)
 
static void do_relax_face_sets_brush_task_cb_ex (void *__restrict userdata, const int n, const TaskParallelTLS *__restrict tls)
 
void SCULPT_do_draw_face_sets_brush (Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode)
 
static int sculpt_face_set_create_exec (bContext *C, wmOperator *op)
 
void SCULPT_OT_face_sets_create (wmOperatorType *ot)
 
static bool sculpt_face_sets_init_loose_parts_test (BMesh *UNUSED(bm), BMFace *UNUSED(from_f), BMEdge *UNUSED(from_e), BMFace *UNUSED(to_f), const float UNUSED(threshold))
 
static bool sculpt_face_sets_init_normals_test (BMesh *UNUSED(bm), BMFace *from_f, BMEdge *UNUSED(from_e), BMFace *to_f, const float threshold)
 
static bool sculpt_face_sets_init_uv_seams_test (BMesh *UNUSED(bm), BMFace *UNUSED(from_f), BMEdge *from_e, BMFace *UNUSED(to_f), const float UNUSED(threshold))
 
static bool sculpt_face_sets_init_crease_test (BMesh *bm, BMFace *UNUSED(from_f), BMEdge *from_e, BMFace *UNUSED(to_f), const float threshold)
 
static bool sculpt_face_sets_init_bevel_weight_test (BMesh *bm, BMFace *UNUSED(from_f), BMEdge *from_e, BMFace *UNUSED(to_f), const float threshold)
 
static bool sculpt_face_sets_init_sharp_edges_test (BMesh *UNUSED(bm), BMFace *UNUSED(from_f), BMEdge *from_e, BMFace *UNUSED(to_f), const float UNUSED(threshold))
 
static bool sculpt_face_sets_init_face_set_boundary_test (BMesh *bm, BMFace *from_f, BMEdge *UNUSED(from_e), BMFace *to_f, const float UNUSED(threshold))
 
static void sculpt_face_sets_init_flood_fill (Object *ob, face_sets_flood_fill_test test, const float threshold)
 
static void sculpt_face_sets_init_loop (Object *ob, const int mode)
 
static int sculpt_face_set_init_exec (bContext *C, wmOperator *op)
 
void SCULPT_OT_face_sets_init (wmOperatorType *ot)
 
static int sculpt_face_sets_change_visibility_exec (bContext *C, wmOperator *op)
 
static int sculpt_face_sets_change_visibility_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
void SCULPT_OT_face_sets_change_visibility (wmOperatorType *ot)
 
static int sculpt_face_sets_randomize_colors_exec (bContext *C, wmOperator *UNUSED(op))
 
void SCULPT_OT_face_sets_randomize_colors (wmOperatorType *ot)
 
static void sculpt_face_set_grow (Object *ob, SculptSession *ss, const int *prev_face_sets, const int active_face_set_id, const bool modify_hidden)
 
static void sculpt_face_set_shrink (Object *ob, SculptSession *ss, const int *prev_face_sets, const int active_face_set_id, const bool modify_hidden)
 
static bool check_single_face_set (SculptSession *ss, int *face_sets, const bool check_visible_only)
 
static void sculpt_face_set_delete_geometry (Object *ob, SculptSession *ss, const int active_face_set_id, const bool modify_hidden)
 
static void sculpt_face_set_edit_fair_face_set (Object *ob, const int active_face_set_id, const int fair_order)
 
static void sculpt_face_set_apply_edit (Object *ob, const int active_face_set_id, const int mode, const bool modify_hidden)
 
static bool sculpt_face_set_edit_is_operation_valid (SculptSession *ss, const eSculptFaceSetEditMode mode, const bool modify_hidden)
 
static void sculpt_face_set_edit_modify_geometry (bContext *C, Object *ob, const int active_face_set, const eSculptFaceSetEditMode mode, const bool modify_hidden)
 
static void face_set_edit_do_post_visibility_updates (Object *ob, PBVHNode **nodes, int totnode)
 
static void sculpt_face_set_edit_modify_face_sets (Object *ob, const int active_face_set, const eSculptFaceSetEditMode mode, const bool modify_hidden)
 
static void sculpt_face_set_edit_modify_coordinates (bContext *C, Object *ob, const int active_face_set, const eSculptFaceSetEditMode mode)
 
static int sculpt_face_set_edit_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
void SCULPT_OT_face_sets_edit (struct wmOperatorType *ot)
 

Variables

static EnumPropertyItem prop_sculpt_face_set_create_types []
 
static EnumPropertyItem prop_sculpt_face_sets_init_types []
 
static EnumPropertyItem prop_sculpt_face_sets_change_visibility_types []
 
static EnumPropertyItem prop_sculpt_face_sets_edit_types []
 

Typedef Documentation

◆ eSculptFaceGroupsCreateModes

◆ eSculptFaceGroupVisibilityModes

◆ eSculptFaceSetEditMode

◆ eSculptFaceSetsInitMode

◆ face_sets_flood_fill_test

typedef bool(* face_sets_flood_fill_test) (BMesh *bm, BMFace *from_f, BMEdge *from_e, BMFace *to_f, const float threshold)

Definition at line 502 of file sculpt_face_set.c.

Enumeration Type Documentation

◆ eSculptFaceGroupsCreateModes

Enumerator
SCULPT_FACE_SET_MASKED 
SCULPT_FACE_SET_VISIBLE 
SCULPT_FACE_SET_ALL 
SCULPT_FACE_SET_SELECTION 

Definition at line 254 of file sculpt_face_set.c.

◆ eSculptFaceGroupVisibilityModes

Enumerator
SCULPT_FACE_SET_VISIBILITY_TOGGLE 
SCULPT_FACE_SET_VISIBILITY_SHOW_ACTIVE 
SCULPT_FACE_SET_VISIBILITY_HIDE_ACTIVE 
SCULPT_FACE_SET_VISIBILITY_INVERT 
SCULPT_FACE_SET_VISIBILITY_SHOW_ALL 

Definition at line 786 of file sculpt_face_set.c.

◆ eSculptFaceSetEditMode

Enumerator
SCULPT_FACE_SET_EDIT_GROW 
SCULPT_FACE_SET_EDIT_SHRINK 
SCULPT_FACE_SET_EDIT_DELETE_GEOMETRY 
SCULPT_FACE_SET_EDIT_FAIR_POSITIONS 
SCULPT_FACE_SET_EDIT_FAIR_TANGENCY 

Definition at line 1032 of file sculpt_face_set.c.

◆ eSculptFaceSetsInitMode

Enumerator
SCULPT_FACE_SETS_FROM_LOOSE_PARTS 
SCULPT_FACE_SETS_FROM_MATERIALS 
SCULPT_FACE_SETS_FROM_NORMALS 
SCULPT_FACE_SETS_FROM_UV_SEAMS 
SCULPT_FACE_SETS_FROM_CREASES 
SCULPT_FACE_SETS_FROM_SHARP_EDGES 
SCULPT_FACE_SETS_FROM_BEVEL_WEIGHT 
SCULPT_FACE_SETS_FROM_FACE_MAPS 
SCULPT_FACE_SETS_FROM_FACE_SET_BOUNDARIES 

Definition at line 422 of file sculpt_face_set.c.

Function Documentation

◆ check_single_face_set()

static bool check_single_face_set ( SculptSession ss,
int *  face_sets,
const bool  check_visible_only 
)
static

◆ do_draw_face_sets_brush_task_cb_ex()

static void do_draw_face_sets_brush_task_cb_ex ( void *__restrict  userdata,
const int  n,
const TaskParallelTLS *__restrict  tls 
)
static

◆ do_relax_face_sets_brush_task_cb_ex()

static void do_relax_face_sets_brush_task_cb_ex ( void *__restrict  userdata,
const int  n,
const TaskParallelTLS *__restrict  tls 
)
static

◆ ED_sculpt_face_sets_active_update_and_get()

int ED_sculpt_face_sets_active_update_and_get ( bContext C,
Object ob,
const float  mval[2] 
)

◆ ED_sculpt_face_sets_find_next_available_id()

int ED_sculpt_face_sets_find_next_available_id ( struct Mesh mesh)

◆ ED_sculpt_face_sets_initialize_none_to_id()

void ED_sculpt_face_sets_initialize_none_to_id ( struct Mesh mesh,
const int  new_id 
)

◆ face_set_edit_do_post_visibility_updates()

static void face_set_edit_do_post_visibility_updates ( Object ob,
PBVHNode **  nodes,
int  totnode 
)
static

◆ SCULPT_do_draw_face_sets_brush()

void SCULPT_do_draw_face_sets_brush ( Sculpt sd,
Object ob,
PBVHNode **  nodes,
int  totnode 
)

◆ sculpt_face_set_apply_edit()

static void sculpt_face_set_apply_edit ( Object ob,
const int  active_face_set_id,
const int  mode,
const bool  modify_hidden 
)
static

◆ sculpt_face_set_create_exec()

static int sculpt_face_set_create_exec ( bContext C,
wmOperator op 
)
static

◆ sculpt_face_set_delete_geometry()

static void sculpt_face_set_delete_geometry ( Object ob,
SculptSession ss,
const int  active_face_set_id,
const bool  modify_hidden 
)
static

◆ sculpt_face_set_edit_fair_face_set()

static void sculpt_face_set_edit_fair_face_set ( Object ob,
const int  active_face_set_id,
const int  fair_order 
)
static

◆ sculpt_face_set_edit_invoke()

static int sculpt_face_set_edit_invoke ( bContext C,
wmOperator op,
const wmEvent event 
)
static

◆ sculpt_face_set_edit_is_operation_valid()

static bool sculpt_face_set_edit_is_operation_valid ( SculptSession ss,
const eSculptFaceSetEditMode  mode,
const bool  modify_hidden 
)
static

◆ sculpt_face_set_edit_modify_coordinates()

static void sculpt_face_set_edit_modify_coordinates ( bContext C,
Object ob,
const int  active_face_set,
const eSculptFaceSetEditMode  mode 
)
static

◆ sculpt_face_set_edit_modify_face_sets()

static void sculpt_face_set_edit_modify_face_sets ( Object ob,
const int  active_face_set,
const eSculptFaceSetEditMode  mode,
const bool  modify_hidden 
)
static

◆ sculpt_face_set_edit_modify_geometry()

static void sculpt_face_set_edit_modify_geometry ( bContext C,
Object ob,
const int  active_face_set,
const eSculptFaceSetEditMode  mode,
const bool  modify_hidden 
)
static

◆ sculpt_face_set_grow()

static void sculpt_face_set_grow ( Object ob,
SculptSession ss,
const int *  prev_face_sets,
const int  active_face_set_id,
const bool  modify_hidden 
)
static

◆ sculpt_face_set_init_exec()

static int sculpt_face_set_init_exec ( bContext C,
wmOperator op 
)
static

◆ sculpt_face_set_shrink()

static void sculpt_face_set_shrink ( Object ob,
SculptSession ss,
const int *  prev_face_sets,
const int  active_face_set_id,
const bool  modify_hidden 
)
static

◆ sculpt_face_sets_change_visibility_exec()

static int sculpt_face_sets_change_visibility_exec ( bContext C,
wmOperator op 
)
static

◆ sculpt_face_sets_change_visibility_invoke()

static int sculpt_face_sets_change_visibility_invoke ( bContext C,
wmOperator op,
const wmEvent event 
)
static

◆ sculpt_face_sets_init_bevel_weight_test()

static bool sculpt_face_sets_init_bevel_weight_test ( BMesh bm,
BMFace UNUSEDfrom_f,
BMEdge from_e,
BMFace UNUSEDto_f,
const float  threshold 
)
static

Definition at line 535 of file sculpt_face_set.c.

References bm, BM_elem_float_data_get(), CD_BWEIGHT, BMesh::edata, and threshold.

Referenced by sculpt_face_set_init_exec().

◆ sculpt_face_sets_init_crease_test()

static bool sculpt_face_sets_init_crease_test ( BMesh bm,
BMFace UNUSEDfrom_f,
BMEdge from_e,
BMFace UNUSEDto_f,
const float  threshold 
)
static

Definition at line 529 of file sculpt_face_set.c.

References bm, BM_elem_float_data_get(), CD_CREASE, BMesh::edata, and threshold.

Referenced by sculpt_face_set_init_exec().

◆ sculpt_face_sets_init_face_set_boundary_test()

static bool sculpt_face_sets_init_face_set_boundary_test ( BMesh bm,
BMFace from_f,
BMEdge UNUSEDfrom_e,
BMFace to_f,
const float   UNUSEDthreshold 
)
static

◆ sculpt_face_sets_init_flood_fill()

static void sculpt_face_sets_init_flood_fill ( Object ob,
face_sets_flood_fill_test  test,
const float  threshold 
)
static

◆ sculpt_face_sets_init_loop()

static void sculpt_face_sets_init_loop ( Object ob,
const int  mode 
)
static

◆ sculpt_face_sets_init_loose_parts_test()

static bool sculpt_face_sets_init_loose_parts_test ( BMesh UNUSEDbm,
BMFace UNUSEDfrom_f,
BMEdge UNUSEDfrom_e,
BMFace UNUSEDto_f,
const float   UNUSEDthreshold 
)
static

Definition at line 505 of file sculpt_face_set.c.

Referenced by sculpt_face_set_init_exec().

◆ sculpt_face_sets_init_normals_test()

static bool sculpt_face_sets_init_normals_test ( BMesh UNUSEDbm,
BMFace from_f,
BMEdge UNUSEDfrom_e,
BMFace to_f,
const float  threshold 
)
static

Definition at line 514 of file sculpt_face_set.c.

References dot_v3v3(), fabsf, BMFace::no, and threshold.

Referenced by sculpt_face_set_init_exec().

◆ sculpt_face_sets_init_sharp_edges_test()

static bool sculpt_face_sets_init_sharp_edges_test ( BMesh UNUSEDbm,
BMFace UNUSEDfrom_f,
BMEdge from_e,
BMFace UNUSEDto_f,
const float   UNUSEDthreshold 
)
static

Definition at line 541 of file sculpt_face_set.c.

References BM_elem_flag_test, and BM_ELEM_SMOOTH.

Referenced by sculpt_face_set_init_exec().

◆ sculpt_face_sets_init_uv_seams_test()

static bool sculpt_face_sets_init_uv_seams_test ( BMesh UNUSEDbm,
BMFace UNUSEDfrom_f,
BMEdge from_e,
BMFace UNUSEDto_f,
const float   UNUSEDthreshold 
)
static

Definition at line 520 of file sculpt_face_set.c.

References BM_elem_flag_test, and BM_ELEM_SEAM.

Referenced by sculpt_face_set_init_exec().

◆ sculpt_face_sets_randomize_colors_exec()

static int sculpt_face_sets_randomize_colors_exec ( bContext C,
wmOperator UNUSEDop 
)
static

◆ SCULPT_OT_face_sets_change_visibility()

void SCULPT_OT_face_sets_change_visibility ( wmOperatorType ot)

◆ SCULPT_OT_face_sets_create()

void SCULPT_OT_face_sets_create ( wmOperatorType ot)

◆ SCULPT_OT_face_sets_edit()

void SCULPT_OT_face_sets_edit ( struct wmOperatorType ot)

◆ SCULPT_OT_face_sets_init()

void SCULPT_OT_face_sets_init ( wmOperatorType ot)

◆ SCULPT_OT_face_sets_randomize_colors()

void SCULPT_OT_face_sets_randomize_colors ( wmOperatorType ot)

Variable Documentation

◆ prop_sculpt_face_set_create_types

EnumPropertyItem prop_sculpt_face_set_create_types[]
static

Definition at line 261 of file sculpt_face_set.c.

Referenced by SCULPT_OT_face_sets_create().

◆ prop_sculpt_face_sets_change_visibility_types

EnumPropertyItem prop_sculpt_face_sets_change_visibility_types[]
static

Definition at line 794 of file sculpt_face_set.c.

Referenced by SCULPT_OT_face_sets_change_visibility().

◆ prop_sculpt_face_sets_edit_types

EnumPropertyItem prop_sculpt_face_sets_edit_types[]
static

Definition at line 1040 of file sculpt_face_set.c.

Referenced by SCULPT_OT_face_sets_edit().

◆ prop_sculpt_face_sets_init_types

EnumPropertyItem prop_sculpt_face_sets_init_types[]
static

Definition at line 434 of file sculpt_face_set.c.

Referenced by SCULPT_OT_face_sets_init().