Cleanup: names of WPaint gradient data structs.
Those actually never had anything to do with DM... Just used WP prefix instead!
This commit is contained in:
@@ -534,21 +534,21 @@ void PAINT_OT_weight_set(wmOperatorType *ot)
|
||||
* \{ */
|
||||
|
||||
/* *** VGroups Gradient *** */
|
||||
typedef struct DMGradient_vertStore {
|
||||
typedef struct WPGradient_vertStore {
|
||||
float sco[2];
|
||||
float weight_orig;
|
||||
enum {
|
||||
VGRAD_STORE_NOP = 0,
|
||||
VGRAD_STORE_DW_EXIST = (1 << 0)
|
||||
} flag;
|
||||
} DMGradient_vertStore;
|
||||
} WPGradient_vertStore;
|
||||
|
||||
typedef struct DMGradient_vertStoreBase {
|
||||
typedef struct WPGradient_vertStoreBase {
|
||||
struct WPaintPrev wpp;
|
||||
DMGradient_vertStore elem[0];
|
||||
} DMGradient_vertStoreBase;
|
||||
WPGradient_vertStore elem[0];
|
||||
} WPGradient_vertStoreBase;
|
||||
|
||||
typedef struct DMGradient_userData {
|
||||
typedef struct WPGradient_userData {
|
||||
struct ARegion *ar;
|
||||
Scene *scene;
|
||||
Mesh *me;
|
||||
@@ -558,7 +558,7 @@ typedef struct DMGradient_userData {
|
||||
float sco_line_div; /* store (1.0f / len_v2v2(sco_start, sco_end)) */
|
||||
int def_nr;
|
||||
bool is_init;
|
||||
DMGradient_vertStoreBase *vert_cache;
|
||||
WPGradient_vertStoreBase *vert_cache;
|
||||
/* only for init */
|
||||
BLI_bitmap *vert_visit;
|
||||
|
||||
@@ -566,12 +566,12 @@ typedef struct DMGradient_userData {
|
||||
short use_select;
|
||||
short type;
|
||||
float weightpaint;
|
||||
} DMGradient_userData;
|
||||
} WPGradient_userData;
|
||||
|
||||
static void gradientVert_update(DMGradient_userData *grad_data, int index)
|
||||
static void gradientVert_update(WPGradient_userData *grad_data, int index)
|
||||
{
|
||||
Mesh *me = grad_data->me;
|
||||
DMGradient_vertStore *vs = &grad_data->vert_cache->elem[index];
|
||||
WPGradient_vertStore *vs = &grad_data->vert_cache->elem[index];
|
||||
float alpha;
|
||||
|
||||
if (grad_data->type == WPAINT_GRADIENT_TYPE_LINEAR) {
|
||||
@@ -619,10 +619,10 @@ static void gradientVertUpdate__mapFunc(
|
||||
void *userData, int index, const float UNUSED(co[3]),
|
||||
const float UNUSED(no_f[3]), const short UNUSED(no_s[3]))
|
||||
{
|
||||
DMGradient_userData *grad_data = userData;
|
||||
WPGradient_userData *grad_data = userData;
|
||||
Mesh *me = grad_data->me;
|
||||
if ((grad_data->use_select == false) || (me->mvert[index].flag & SELECT)) {
|
||||
DMGradient_vertStore *vs = &grad_data->vert_cache->elem[index];
|
||||
WPGradient_vertStore *vs = &grad_data->vert_cache->elem[index];
|
||||
if (vs->sco[0] != FLT_MAX) {
|
||||
gradientVert_update(grad_data, index);
|
||||
}
|
||||
@@ -633,7 +633,7 @@ static void gradientVertInit__mapFunc(
|
||||
void *userData, int index, const float co[3],
|
||||
const float UNUSED(no_f[3]), const short UNUSED(no_s[3]))
|
||||
{
|
||||
DMGradient_userData *grad_data = userData;
|
||||
WPGradient_userData *grad_data = userData;
|
||||
Mesh *me = grad_data->me;
|
||||
|
||||
if ((grad_data->use_select == false) || (me->mvert[index].flag & SELECT)) {
|
||||
@@ -642,7 +642,7 @@ static void gradientVertInit__mapFunc(
|
||||
* updating the mesh may move them about (entering feedback loop) */
|
||||
|
||||
if (BLI_BITMAP_TEST(grad_data->vert_visit, index) == 0) {
|
||||
DMGradient_vertStore *vs = &grad_data->vert_cache->elem[index];
|
||||
WPGradient_vertStore *vs = &grad_data->vert_cache->elem[index];
|
||||
if (ED_view3d_project_float_object(grad_data->ar,
|
||||
co, vs->sco,
|
||||
V3D_PROJ_TEST_CLIP_BB | V3D_PROJ_TEST_CLIP_NEAR) == V3D_PROJ_RET_OK)
|
||||
@@ -675,7 +675,7 @@ static void gradientVertInit__mapFunc(
|
||||
static int paint_weight_gradient_modal(bContext *C, wmOperator *op, const wmEvent *event)
|
||||
{
|
||||
wmGesture *gesture = op->customdata;
|
||||
DMGradient_vertStoreBase *vert_cache = gesture->userdata;
|
||||
WPGradient_vertStoreBase *vert_cache = gesture->userdata;
|
||||
int ret = WM_gesture_straightline_modal(C, op, event);
|
||||
|
||||
if (ret & OPERATOR_RUNNING_MODAL) {
|
||||
@@ -711,7 +711,7 @@ static int paint_weight_gradient_modal(bContext *C, wmOperator *op, const wmEven
|
||||
static int paint_weight_gradient_exec(bContext *C, wmOperator *op)
|
||||
{
|
||||
wmGesture *gesture = op->customdata;
|
||||
DMGradient_vertStoreBase *vert_cache;
|
||||
WPGradient_vertStoreBase *vert_cache;
|
||||
struct ARegion *ar = CTX_wm_region(C);
|
||||
Scene *scene = CTX_data_scene(C);
|
||||
Object *ob = CTX_data_active_object(C);
|
||||
@@ -726,18 +726,18 @@ static int paint_weight_gradient_exec(bContext *C, wmOperator *op)
|
||||
|
||||
Depsgraph *depsgraph = CTX_data_depsgraph(C);
|
||||
|
||||
DMGradient_userData data = {NULL};
|
||||
WPGradient_userData data = {NULL};
|
||||
|
||||
if (is_interactive) {
|
||||
if (gesture->userdata == NULL) {
|
||||
gesture->userdata = MEM_mallocN(
|
||||
sizeof(DMGradient_vertStoreBase) +
|
||||
(sizeof(DMGradient_vertStore) * me->totvert),
|
||||
sizeof(WPGradient_vertStoreBase) +
|
||||
(sizeof(WPGradient_vertStore) * me->totvert),
|
||||
__func__);
|
||||
gesture->userdata_free = false;
|
||||
data.is_init = true;
|
||||
|
||||
wpaint_prev_create(&((DMGradient_vertStoreBase *)gesture->userdata)->wpp, me->dvert, me->totvert);
|
||||
wpaint_prev_create(&((WPGradient_vertStoreBase *)gesture->userdata)->wpp, me->dvert, me->totvert);
|
||||
|
||||
/* on init only, convert face -> vert sel */
|
||||
if (me->editflag & ME_EDIT_PAINT_FACE_SEL) {
|
||||
@@ -754,8 +754,8 @@ static int paint_weight_gradient_exec(bContext *C, wmOperator *op)
|
||||
|
||||
data.is_init = true;
|
||||
vert_cache = MEM_mallocN(
|
||||
sizeof(DMGradient_vertStoreBase) +
|
||||
(sizeof(DMGradient_vertStore) * me->totvert),
|
||||
sizeof(WPGradient_vertStoreBase) +
|
||||
(sizeof(WPGradient_vertStore) * me->totvert),
|
||||
__func__);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user