Blender
V3.3
|
#include "BLI_listbase.h"
#include "BLI_math.h"
#include "BLI_string_utils.h"
#include "DNA_armature_types.h"
#include "DNA_mesh_types.h"
#include "DNA_object_types.h"
#include "BKE_action.h"
#include "BKE_context.h"
#include "BKE_deform.h"
#include "BKE_mesh.h"
#include "BKE_modifier.h"
#include "BKE_object.h"
#include "BKE_object_deform.h"
#include "BKE_report.h"
#include "DEG_depsgraph_build.h"
#include "IMB_imbuf.h"
#include "WM_api.h"
#include "WM_types.h"
#include "paint_intern.h"
Go to the source code of this file.
Functions | |
int | ED_wpaint_mirror_vgroup_ensure (Object *ob, const int vgroup_active) |
Weight Paint Sanity Checks | |
bool | ED_wpaint_ensure_data (bContext *C, struct ReportList *reports, enum eWPaintFlag flag, struct WPaintVGroupIndex *vgroup_index) |
Weight Blending Modes | |
BLI_INLINE float | wval_blend (const float weight, const float paintval, const float alpha) |
BLI_INLINE float | wval_add (const float weight, const float paintval, const float alpha) |
BLI_INLINE float | wval_sub (const float weight, const float paintval, const float alpha) |
BLI_INLINE float | wval_mul (const float weight, const float paintval, const float alpha) |
BLI_INLINE float | wval_lighten (const float weight, const float paintval, const float alpha) |
BLI_INLINE float | wval_darken (const float weight, const float paintval, const float alpha) |
BLI_INLINE float | wval_colordodge (float weight, float paintval, float fac) |
BLI_INLINE float | wval_difference (float weight, float paintval, float fac) |
BLI_INLINE float | wval_screen (float weight, float paintval, float fac) |
BLI_INLINE float | wval_hardlight (float weight, float paintval, float fac) |
BLI_INLINE float | wval_overlay (float weight, float paintval, float fac) |
BLI_INLINE float | wval_softlight (float weight, float paintval, float fac) |
BLI_INLINE float | wval_exclusion (float weight, float paintval, float fac) |
float | ED_wpaint_blend_tool (const int tool, const float weight, const float paintval, const float alpha) |
Intended for use by paint_vertex.c
& paint_vertex_weight_ops.c
.
Definition in file paint_vertex_weight_utils.c.
weight | Typically the current weight: MDeformWeight.weight |
Definition at line 265 of file paint_vertex_weight_utils.c.
References IMB_BLEND_ADD, IMB_BLEND_COLORDODGE, IMB_BLEND_DARKEN, IMB_BLEND_DIFFERENCE, IMB_BLEND_EXCLUSION, IMB_BLEND_HARDLIGHT, IMB_BLEND_LIGHTEN, IMB_BLEND_MIX, IMB_BLEND_MUL, IMB_BLEND_OVERLAY, IMB_BLEND_SCREEN, IMB_BLEND_SOFTLIGHT, IMB_BLEND_SUB, wval_add(), wval_blend(), wval_colordodge(), wval_darken(), wval_difference(), wval_exclusion(), wval_hardlight(), wval_lighten(), wval_mul(), wval_overlay(), wval_screen(), wval_softlight(), and wval_sub().
Referenced by gradientVert_update(), and wpaint_blend().
bool ED_wpaint_ensure_data | ( | struct bContext * | C, |
struct ReportList * | reports, | ||
enum eWPaintFlag | flag, | ||
struct WPaintVGroupIndex * | vgroup_index | ||
) |
Ensure we have data on wpaint start, add if needed.
Definition at line 40 of file paint_vertex_weight_utils.c.
References WPaintVGroupIndex::active, BKE_mesh_from_object(), BKE_modifiers_is_deformed_by_armature(), BKE_object_defgroup_add(), BKE_object_defgroup_add_name(), BKE_object_defgroup_data_create(), BKE_object_defgroup_find_name(), BKE_object_defgroup_list(), BKE_object_is_in_editmode(), BKE_pose_channel_find_name(), BKE_report(), BLI_assert, BLI_findindex(), BLI_listbase_is_empty(), C, CTX_data_active_object(), CTX_data_main(), Object::data, DEG_relations_tag_update(), Mesh::dvert, ED_wpaint_mirror_vgroup_ensure(), Mesh::id, ME_USING_MIRROR_X_VERTEX_GROUPS, WPaintVGroupIndex::mirror, bPoseChannel::name, Bone::name, NC_GEOM, ND_DATA, NULL, Object::pose, RPT_WARNING, Mesh::totpoly, Mesh::vertex_group_active_index, WM_event_add_notifier(), and WPAINT_ENSURE_MIRROR.
Referenced by paint_weight_gradient_exec(), paint_weight_gradient_invoke(), weight_paint_set_exec(), and wpaint_stroke_test_start().
int ED_wpaint_mirror_vgroup_ensure | ( | struct Object * | ob, |
int | vgroup_active | ||
) |
Return -1 when invalid.
Definition at line 122 of file paint_vertex_weight_utils.c.
References BKE_object_defgroup_list(), BKE_object_defgroup_name_index(), BKE_object_defgroup_new(), BLI_findlink(), BLI_listbase_count(), BLI_string_flip_side_name(), MAXBONENAME, and bDeformGroup::name.
Referenced by ED_wpaint_ensure_data(), and weight_paint_set().
BLI_INLINE float wval_add | ( | const float | weight, |
const float | paintval, | ||
const float | alpha | ||
) |
Definition at line 156 of file paint_vertex_weight_utils.c.
Referenced by ED_wpaint_blend_tool().
BLI_INLINE float wval_blend | ( | const float | weight, |
const float | paintval, | ||
const float | alpha | ||
) |
Definition at line 151 of file paint_vertex_weight_utils.c.
References min_ff().
Referenced by ED_wpaint_blend_tool(), wval_darken(), and wval_lighten().
BLI_INLINE float wval_colordodge | ( | float | weight, |
float | paintval, | ||
float | fac | ||
) |
Definition at line 178 of file paint_vertex_weight_utils.c.
References min_ff().
Referenced by ED_wpaint_blend_tool().
BLI_INLINE float wval_darken | ( | const float | weight, |
const float | paintval, | ||
const float | alpha | ||
) |
Definition at line 172 of file paint_vertex_weight_utils.c.
References wval_blend().
Referenced by ED_wpaint_blend_tool().
BLI_INLINE float wval_difference | ( | float | weight, |
float | paintval, | ||
float | fac | ||
) |
Definition at line 189 of file paint_vertex_weight_utils.c.
References fabsf.
Referenced by ED_wpaint_blend_tool().
BLI_INLINE float wval_exclusion | ( | float | weight, |
float | paintval, | ||
float | fac | ||
) |
Definition at line 254 of file paint_vertex_weight_utils.c.
Referenced by ED_wpaint_blend_tool().
BLI_INLINE float wval_hardlight | ( | float | weight, |
float | paintval, | ||
float | fac | ||
) |
Definition at line 209 of file paint_vertex_weight_utils.c.
Referenced by ED_wpaint_blend_tool().
BLI_INLINE float wval_lighten | ( | const float | weight, |
const float | paintval, | ||
const float | alpha | ||
) |
Definition at line 168 of file paint_vertex_weight_utils.c.
References wval_blend().
Referenced by ED_wpaint_blend_tool().
BLI_INLINE float wval_mul | ( | const float | weight, |
const float | paintval, | ||
const float | alpha | ||
) |
Definition at line 164 of file paint_vertex_weight_utils.c.
Referenced by ED_wpaint_blend_tool().
BLI_INLINE float wval_overlay | ( | float | weight, |
float | paintval, | ||
float | fac | ||
) |
Definition at line 224 of file paint_vertex_weight_utils.c.
Referenced by ED_wpaint_blend_tool().
BLI_INLINE float wval_screen | ( | float | weight, |
float | paintval, | ||
float | fac | ||
) |
Definition at line 199 of file paint_vertex_weight_utils.c.
References max_ff().
Referenced by ED_wpaint_blend_tool().
BLI_INLINE float wval_softlight | ( | float | weight, |
float | paintval, | ||
float | fac | ||
) |
Definition at line 239 of file paint_vertex_weight_utils.c.
Referenced by ED_wpaint_blend_tool().
BLI_INLINE float wval_sub | ( | const float | weight, |
const float | paintval, | ||
const float | alpha | ||
) |
Definition at line 160 of file paint_vertex_weight_utils.c.
Referenced by ED_wpaint_blend_tool().