Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_view3d/view3d_buttons.c
| Show First 20 Lines • Show All 354 Lines • ▼ Show 20 Lines | while (a--) { | ||||
| bp++; | bp++; | ||||
| } | } | ||||
| if (totlattdata == 1) | if (totlattdata == 1) | ||||
| RNA_pointer_create(<->id, seltype, selp, &data_ptr); | RNA_pointer_create(<->id, seltype, selp, &data_ptr); | ||||
| } | } | ||||
| if (tot == 0) { | if (tot == 0) { | ||||
| uiDefBut(block, LABEL, 0, IFACE_("Nothing selected"), 0, 130, 200, 20, NULL, 0, 0, 0, 0, ""); | uiDefBut(block, UI_BTYPE_LABEL, 0, IFACE_("Nothing selected"), 0, 130, 200, 20, NULL, 0, 0, 0, 0, ""); | ||||
| return; | return; | ||||
| } | } | ||||
| /* Location, X/Y/Z */ | /* Location, X/Y/Z */ | ||||
| mul_v3_fl(&median[LOC_X], 1.0f / (float)tot); | mul_v3_fl(&median[LOC_X], 1.0f / (float)tot); | ||||
| if (v3d->flag & V3D_GLOBAL_STATS) | if (v3d->flag & V3D_GLOBAL_STATS) | ||||
| mul_m4_v3(ob->obmat, &median[LOC_X]); | mul_m4_v3(ob->obmat, &median[LOC_X]); | ||||
| Show All 27 Lines | if (block) { /* buttons */ | ||||
| int yi = 200; | int yi = 200; | ||||
| const float tilt_limit = DEG2RADF(21600.0f); | const float tilt_limit = DEG2RADF(21600.0f); | ||||
| const int buth = 20 * UI_DPI_FAC; | const int buth = 20 * UI_DPI_FAC; | ||||
| const int but_margin = 2; | const int but_margin = 2; | ||||
| const char *c; | const char *c; | ||||
| memcpy(tfp->ve_median, median, sizeof(tfp->ve_median)); | memcpy(tfp->ve_median, median, sizeof(tfp->ve_median)); | ||||
| uiBlockBeginAlign(block); | UI_block_align_begin(block); | ||||
| if (tot == 1) { | if (tot == 1) { | ||||
| if (totcurvedata) /* Curve */ | if (totcurvedata) /* Curve */ | ||||
| c = IFACE_("Control Point:"); | c = IFACE_("Control Point:"); | ||||
| else /* Mesh or lattice */ | else /* Mesh or lattice */ | ||||
| c = IFACE_("Vertex:"); | c = IFACE_("Vertex:"); | ||||
| } | } | ||||
| else | else | ||||
| c = IFACE_("Median:"); | c = IFACE_("Median:"); | ||||
| uiDefBut(block, LABEL, 0, c, 0, yi -= buth, 200, buth, NULL, 0, 0, 0, 0, ""); | uiDefBut(block, UI_BTYPE_LABEL, 0, c, 0, yi -= buth, 200, buth, NULL, 0, 0, 0, 0, ""); | ||||
| uiBlockBeginAlign(block); | UI_block_align_begin(block); | ||||
| /* Should be no need to translate these. */ | /* Should be no need to translate these. */ | ||||
| but = uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, IFACE_("X:"), 0, yi -= buth, 200, buth, | but = uiDefButF(block, UI_BTYPE_NUM, B_OBJECTPANELMEDIAN, IFACE_("X:"), 0, yi -= buth, 200, buth, | ||||
| &(tfp->ve_median[LOC_X]), -lim, lim, 10, RNA_TRANSLATION_PREC_DEFAULT, ""); | &(tfp->ve_median[LOC_X]), -lim, lim, 10, RNA_TRANSLATION_PREC_DEFAULT, ""); | ||||
| uiButSetUnitType(but, PROP_UNIT_LENGTH); | UI_but_unit_type_set(but, PROP_UNIT_LENGTH); | ||||
| but = uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, IFACE_("Y:"), 0, yi -= buth, 200, buth, | but = uiDefButF(block, UI_BTYPE_NUM, B_OBJECTPANELMEDIAN, IFACE_("Y:"), 0, yi -= buth, 200, buth, | ||||
| &(tfp->ve_median[LOC_Y]), -lim, lim, 10, RNA_TRANSLATION_PREC_DEFAULT, ""); | &(tfp->ve_median[LOC_Y]), -lim, lim, 10, RNA_TRANSLATION_PREC_DEFAULT, ""); | ||||
| uiButSetUnitType(but, PROP_UNIT_LENGTH); | UI_but_unit_type_set(but, PROP_UNIT_LENGTH); | ||||
| but = uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, IFACE_("Z:"), 0, yi -= buth, 200, buth, | but = uiDefButF(block, UI_BTYPE_NUM, B_OBJECTPANELMEDIAN, IFACE_("Z:"), 0, yi -= buth, 200, buth, | ||||
| &(tfp->ve_median[LOC_Z]), -lim, lim, 10, RNA_TRANSLATION_PREC_DEFAULT, ""); | &(tfp->ve_median[LOC_Z]), -lim, lim, 10, RNA_TRANSLATION_PREC_DEFAULT, ""); | ||||
| uiButSetUnitType(but, PROP_UNIT_LENGTH); | UI_but_unit_type_set(but, PROP_UNIT_LENGTH); | ||||
| if (totcurvebweight == tot) { | if (totcurvebweight == tot) { | ||||
| uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, IFACE_("W:"), 0, yi -= buth, 200, buth, | uiDefButF(block, UI_BTYPE_NUM, B_OBJECTPANELMEDIAN, IFACE_("W:"), 0, yi -= buth, 200, buth, | ||||
| &(tfp->ve_median[C_BWEIGHT]), 0.01, 100.0, 1, 3, ""); | &(tfp->ve_median[C_BWEIGHT]), 0.01, 100.0, 1, 3, ""); | ||||
| } | } | ||||
| uiBlockBeginAlign(block); | UI_block_align_begin(block); | ||||
| uiDefButBitS(block, TOG, V3D_GLOBAL_STATS, B_REDR, IFACE_("Global"), | uiDefButBitS(block, UI_BTYPE_TOGGLE, V3D_GLOBAL_STATS, B_REDR, IFACE_("Global"), | ||||
| 0, yi -= buth + but_margin, 100, buth, | 0, yi -= buth + but_margin, 100, buth, | ||||
| &v3d->flag, 0, 0, 0, 0, TIP_("Displays global values")); | &v3d->flag, 0, 0, 0, 0, TIP_("Displays global values")); | ||||
| uiDefButBitS(block, TOGN, V3D_GLOBAL_STATS, B_REDR, IFACE_("Local"), | uiDefButBitS(block, UI_BTYPE_TOGGLE_N, V3D_GLOBAL_STATS, B_REDR, IFACE_("Local"), | ||||
| 100, yi, 100, buth, | 100, yi, 100, buth, | ||||
| &v3d->flag, 0, 0, 0, 0, TIP_("Displays local values")); | &v3d->flag, 0, 0, 0, 0, TIP_("Displays local values")); | ||||
| uiBlockEndAlign(block); | UI_block_align_end(block); | ||||
| /* Meshes... */ | /* Meshes... */ | ||||
| if (has_meshdata) { | if (has_meshdata) { | ||||
| if (tot) { | if (tot) { | ||||
| uiDefBut(block, LABEL, 0, tot == 1 ? IFACE_("Vertex Data:") : IFACE_("Vertices Data:"), | uiDefBut(block, UI_BTYPE_LABEL, 0, tot == 1 ? IFACE_("Vertex Data:") : IFACE_("Vertices Data:"), | ||||
| 0, yi -= buth + but_margin, 200, buth, NULL, 0.0, 0.0, 0, 0, ""); | 0, yi -= buth + but_margin, 200, buth, NULL, 0.0, 0.0, 0, 0, ""); | ||||
| /* customdata layer added on demand */ | /* customdata layer added on demand */ | ||||
| uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, | uiDefButF(block, UI_BTYPE_NUM, B_OBJECTPANELMEDIAN, | ||||
| tot == 1 ? IFACE_("Bevel Weight:") : IFACE_("Mean Bevel Weight:"), | tot == 1 ? IFACE_("Bevel Weight:") : IFACE_("Mean Bevel Weight:"), | ||||
| 0, yi -= buth + but_margin, 200, buth, | 0, yi -= buth + but_margin, 200, buth, | ||||
| &(tfp->ve_median[M_BV_WEIGHT]), 0.0, 1.0, 1, 2, TIP_("Vertex weight used by Bevel modifier")); | &(tfp->ve_median[M_BV_WEIGHT]), 0.0, 1.0, 1, 2, TIP_("Vertex weight used by Bevel modifier")); | ||||
| } | } | ||||
| if (has_skinradius) { | if (has_skinradius) { | ||||
| uiBlockBeginAlign(block); | UI_block_align_begin(block); | ||||
| uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, | uiDefButF(block, UI_BTYPE_NUM, B_OBJECTPANELMEDIAN, | ||||
| tot == 1 ? IFACE_("Radius X:") : IFACE_("Mean Radius X:"), | tot == 1 ? IFACE_("Radius X:") : IFACE_("Mean Radius X:"), | ||||
| 0, yi -= buth + but_margin, 200, buth, | 0, yi -= buth + but_margin, 200, buth, | ||||
| &(tfp->ve_median[M_SKIN_X]), 0.0, 100.0, 1, 3, TIP_("X radius used by Skin modifier")); | &(tfp->ve_median[M_SKIN_X]), 0.0, 100.0, 1, 3, TIP_("X radius used by Skin modifier")); | ||||
| uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, | uiDefButF(block, UI_BTYPE_NUM, B_OBJECTPANELMEDIAN, | ||||
| tot == 1 ? IFACE_("Radius Y:") : IFACE_("Mean Radius Y:"), | tot == 1 ? IFACE_("Radius Y:") : IFACE_("Mean Radius Y:"), | ||||
| 0, yi -= buth + but_margin, 200, buth, | 0, yi -= buth + but_margin, 200, buth, | ||||
| &(tfp->ve_median[M_SKIN_Y]), 0.0, 100.0, 1, 3, TIP_("Y radius used by Skin modifier")); | &(tfp->ve_median[M_SKIN_Y]), 0.0, 100.0, 1, 3, TIP_("Y radius used by Skin modifier")); | ||||
| uiBlockEndAlign(block); | UI_block_align_end(block); | ||||
| } | } | ||||
| if (totedgedata) { | if (totedgedata) { | ||||
| uiDefBut(block, LABEL, 0, totedgedata == 1 ? IFACE_("Edge Data:") : IFACE_("Edges Data:"), | uiDefBut(block, UI_BTYPE_LABEL, 0, totedgedata == 1 ? IFACE_("Edge Data:") : IFACE_("Edges Data:"), | ||||
| 0, yi -= buth + but_margin, 200, buth, NULL, 0.0, 0.0, 0, 0, ""); | 0, yi -= buth + but_margin, 200, buth, NULL, 0.0, 0.0, 0, 0, ""); | ||||
| /* customdata layer added on demand */ | /* customdata layer added on demand */ | ||||
| uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, | uiDefButF(block, UI_BTYPE_NUM, B_OBJECTPANELMEDIAN, | ||||
| totedgedata == 1 ? IFACE_("Bevel Weight:") : IFACE_("Mean Bevel Weight:"), | totedgedata == 1 ? IFACE_("Bevel Weight:") : IFACE_("Mean Bevel Weight:"), | ||||
| 0, yi -= buth + but_margin, 200, buth, | 0, yi -= buth + but_margin, 200, buth, | ||||
| &(tfp->ve_median[M_BE_WEIGHT]), 0.0, 1.0, 1, 2, TIP_("Edge weight used by Bevel modifier")); | &(tfp->ve_median[M_BE_WEIGHT]), 0.0, 1.0, 1, 2, TIP_("Edge weight used by Bevel modifier")); | ||||
| /* customdata layer added on demand */ | /* customdata layer added on demand */ | ||||
| uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, | uiDefButF(block, UI_BTYPE_NUM, B_OBJECTPANELMEDIAN, | ||||
| totedgedata == 1 ? IFACE_("Crease:") : IFACE_("Mean Crease:"), | totedgedata == 1 ? IFACE_("Crease:") : IFACE_("Mean Crease:"), | ||||
| 0, yi -= buth + but_margin, 200, buth, | 0, yi -= buth + but_margin, 200, buth, | ||||
| &(tfp->ve_median[M_CREASE]), 0.0, 1.0, 1, 2, TIP_("Weight used by SubSurf modifier")); | &(tfp->ve_median[M_CREASE]), 0.0, 1.0, 1, 2, TIP_("Weight used by SubSurf modifier")); | ||||
| } | } | ||||
| } | } | ||||
| /* Curve... */ | /* Curve... */ | ||||
| else if (totcurvedata == 1) { | else if (totcurvedata == 1) { | ||||
| uiDefButR(block, NUM, 0, IFACE_("Weight:"), 0, yi -= buth + but_margin, 200, buth, | uiDefButR(block, UI_BTYPE_NUM, 0, IFACE_("Weight:"), 0, yi -= buth + but_margin, 200, buth, | ||||
| &data_ptr, "weight_softbody", 0, 0.0, 1.0, 1, 3, NULL); | &data_ptr, "weight_softbody", 0, 0.0, 1.0, 1, 3, NULL); | ||||
| uiDefButR(block, NUM, 0, IFACE_("Radius:"), 0, yi -= buth + but_margin, 200, buth, | uiDefButR(block, UI_BTYPE_NUM, 0, IFACE_("Radius:"), 0, yi -= buth + but_margin, 200, buth, | ||||
| &data_ptr, "radius", 0, 0.0, 100.0, 1, 3, NULL); | &data_ptr, "radius", 0, 0.0, 100.0, 1, 3, NULL); | ||||
| uiDefButR(block, NUM, 0, IFACE_("Tilt:"), 0, yi -= buth + but_margin, 200, buth, | uiDefButR(block, UI_BTYPE_NUM, 0, IFACE_("Tilt:"), 0, yi -= buth + but_margin, 200, buth, | ||||
| &data_ptr, "tilt", 0, -tilt_limit, tilt_limit, 1, 3, NULL); | &data_ptr, "tilt", 0, -tilt_limit, tilt_limit, 1, 3, NULL); | ||||
| } | } | ||||
| else if (totcurvedata > 1) { | else if (totcurvedata > 1) { | ||||
| uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, IFACE_("Mean Weight:"), | uiDefButF(block, UI_BTYPE_NUM, B_OBJECTPANELMEDIAN, IFACE_("Mean Weight:"), | ||||
| 0, yi -= buth + but_margin, 200, buth, | 0, yi -= buth + but_margin, 200, buth, | ||||
| &(tfp->ve_median[C_WEIGHT]), 0.0, 1.0, 1, 3, TIP_("Weight used for SoftBody Goal")); | &(tfp->ve_median[C_WEIGHT]), 0.0, 1.0, 1, 3, TIP_("Weight used for SoftBody Goal")); | ||||
| uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, IFACE_("Mean Radius:"), | uiDefButF(block, UI_BTYPE_NUM, B_OBJECTPANELMEDIAN, IFACE_("Mean Radius:"), | ||||
| 0, yi -= buth + but_margin, 200, buth, | 0, yi -= buth + but_margin, 200, buth, | ||||
| &(tfp->ve_median[C_RADIUS]), 0.0, 100.0, 1, 3, TIP_("Radius of curve control points")); | &(tfp->ve_median[C_RADIUS]), 0.0, 100.0, 1, 3, TIP_("Radius of curve control points")); | ||||
| but = uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, IFACE_("Mean Tilt:"), | but = uiDefButF(block, UI_BTYPE_NUM, B_OBJECTPANELMEDIAN, IFACE_("Mean Tilt:"), | ||||
| 0, yi -= buth + but_margin, 200, buth, | 0, yi -= buth + but_margin, 200, buth, | ||||
| &(tfp->ve_median[C_TILT]), -tilt_limit, tilt_limit, 1, 3, | &(tfp->ve_median[C_TILT]), -tilt_limit, tilt_limit, 1, 3, | ||||
| TIP_("Tilt of curve control points")); | TIP_("Tilt of curve control points")); | ||||
| uiButSetUnitType(but, PROP_UNIT_ROTATION); | UI_but_unit_type_set(but, PROP_UNIT_ROTATION); | ||||
| } | } | ||||
| /* Lattice... */ | /* Lattice... */ | ||||
| else if (totlattdata == 1) { | else if (totlattdata == 1) { | ||||
| uiDefButR(block, NUM, 0, IFACE_("Weight:"), 0, yi -= buth + but_margin, 200, buth, | uiDefButR(block, UI_BTYPE_NUM, 0, IFACE_("Weight:"), 0, yi -= buth + but_margin, 200, buth, | ||||
| &data_ptr, "weight_softbody", 0, 0.0, 1.0, 1, 3, NULL); | &data_ptr, "weight_softbody", 0, 0.0, 1.0, 1, 3, NULL); | ||||
| } | } | ||||
| else if (totlattdata > 1) { | else if (totlattdata > 1) { | ||||
| uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, IFACE_("Mean Weight:"), | uiDefButF(block, UI_BTYPE_NUM, B_OBJECTPANELMEDIAN, IFACE_("Mean Weight:"), | ||||
| 0, yi -= buth + but_margin, 200, buth, | 0, yi -= buth + but_margin, 200, buth, | ||||
| &(tfp->ve_median[L_WEIGHT]), 0.0, 1.0, 1, 3, TIP_("Weight used for SoftBody Goal")); | &(tfp->ve_median[L_WEIGHT]), 0.0, 1.0, 1, 3, TIP_("Weight used for SoftBody Goal")); | ||||
| } | } | ||||
| uiBlockEndAlign(block); | UI_block_align_end(block); | ||||
| } | } | ||||
| else { /* apply */ | else { /* apply */ | ||||
| int i; | int i; | ||||
| bool apply_vcos; | bool apply_vcos; | ||||
| memcpy(ve_median, tfp->ve_median, sizeof(tfp->ve_median)); | memcpy(ve_median, tfp->ve_median, sizeof(tfp->ve_median)); | ||||
| if (v3d->flag & V3D_GLOBAL_STATS) { | if (v3d->flag & V3D_GLOBAL_STATS) { | ||||
| ▲ Show 20 Lines • Show All 304 Lines • ▼ Show 20 Lines | if (dv && dv->totweight) { | ||||
| bDeformGroup *dg; | bDeformGroup *dg; | ||||
| unsigned int i; | unsigned int i; | ||||
| int subset_count, vgroup_tot; | int subset_count, vgroup_tot; | ||||
| const bool *vgroup_validmap; | const bool *vgroup_validmap; | ||||
| eVGroupSelect subset_type = ts->vgroupsubset; | eVGroupSelect subset_type = ts->vgroupsubset; | ||||
| int yco = 0; | int yco = 0; | ||||
| int lock_count = 0; | int lock_count = 0; | ||||
| uiBlockSetHandleFunc(block, do_view3d_vgroup_buttons, NULL); | UI_block_func_handle_set(block, do_view3d_vgroup_buttons, NULL); | ||||
| bcol = uiLayoutColumn(pa->layout, true); | bcol = uiLayoutColumn(pa->layout, true); | ||||
| row = uiLayoutRow(bcol, true); /* The filter button row */ | row = uiLayoutRow(bcol, true); /* The filter button row */ | ||||
| RNA_pointer_create(NULL, &RNA_ToolSettings, ts, &tools_ptr); | RNA_pointer_create(NULL, &RNA_ToolSettings, ts, &tools_ptr); | ||||
| uiItemR(row, &tools_ptr, "vertex_group_subset", UI_ITEM_R_EXPAND, NULL, ICON_NONE); | uiItemR(row, &tools_ptr, "vertex_group_subset", UI_ITEM_R_EXPAND, NULL, ICON_NONE); | ||||
| col = uiLayoutColumn(bcol, true); | col = uiLayoutColumn(bcol, true); | ||||
| vgroup_validmap = ED_vgroup_subset_from_select_type(ob, subset_type, &vgroup_tot, &subset_count); | vgroup_validmap = ED_vgroup_subset_from_select_type(ob, subset_type, &vgroup_tot, &subset_count); | ||||
| for (i = 0, dg = ob->defbase.first; dg; i++, dg = dg->next) { | for (i = 0, dg = ob->defbase.first; dg; i++, dg = dg->next) { | ||||
| bool locked = dg->flag & DG_LOCK_WEIGHT; | bool locked = dg->flag & DG_LOCK_WEIGHT; | ||||
| if (vgroup_validmap[i]) { | if (vgroup_validmap[i]) { | ||||
| MDeformWeight *dw = defvert_find_index(dv, i); | MDeformWeight *dw = defvert_find_index(dv, i); | ||||
| if (dw) { | if (dw) { | ||||
| int x, xco = 0; | int x, xco = 0; | ||||
| int icon; | int icon; | ||||
| uiLayout *split = uiLayoutSplit(col, 0.45, true); | uiLayout *split = uiLayoutSplit(col, 0.45, true); | ||||
| row = uiLayoutRow(split, true); | row = uiLayoutRow(split, true); | ||||
| /* The Weight Group Name */ | /* The Weight Group Name */ | ||||
| ot = ot_weight_set_active; | ot = ot_weight_set_active; | ||||
| but = uiDefButO_ptr(block, BUT, ot, WM_OP_EXEC_DEFAULT, dg->name, | but = uiDefButO_ptr(block, UI_BTYPE_BUT, ot, WM_OP_EXEC_DEFAULT, dg->name, | ||||
| xco, yco, (x = UI_UNIT_X * 5), UI_UNIT_Y, ""); | xco, yco, (x = UI_UNIT_X * 5), UI_UNIT_Y, ""); | ||||
| but_ptr = uiButGetOperatorPtrRNA(but); | but_ptr = UI_but_operator_ptr_get(but); | ||||
| RNA_int_set(but_ptr, "weight_group", i); | RNA_int_set(but_ptr, "weight_group", i); | ||||
| uiButSetDrawFlag(but, UI_BUT_TEXT_RIGHT); | UI_but_drawflag_enable(but, UI_BUT_TEXT_RIGHT); | ||||
| if (ob->actdef != i + 1) { | if (ob->actdef != i + 1) { | ||||
| uiButSetFlag(but, UI_BUT_INACTIVE); | UI_but_flag_enable(but, UI_BUT_INACTIVE); | ||||
| } | } | ||||
| xco += x; | xco += x; | ||||
| row = uiLayoutRow(split, true); | row = uiLayoutRow(split, true); | ||||
| uiLayoutSetEnabled(row, !locked); | uiLayoutSetEnabled(row, !locked); | ||||
| /* The weight group value */ | /* The weight group value */ | ||||
| /* To be reworked still */ | /* To be reworked still */ | ||||
| but = uiDefButF(block, NUM, B_VGRP_PNL_EDIT_SINGLE + i, "", | but = uiDefButF(block, UI_BTYPE_NUM, B_VGRP_PNL_EDIT_SINGLE + i, "", | ||||
| xco, yco, (x = UI_UNIT_X * 4), UI_UNIT_Y, | xco, yco, (x = UI_UNIT_X * 4), UI_UNIT_Y, | ||||
| &dw->weight, 0.0, 1.0, 1, 3, ""); | &dw->weight, 0.0, 1.0, 1, 3, ""); | ||||
| uiButSetDrawFlag(but, UI_BUT_TEXT_LEFT); | UI_but_drawflag_enable(but, UI_BUT_TEXT_LEFT); | ||||
| if (locked) { | if (locked) { | ||||
| lock_count++; | lock_count++; | ||||
| } | } | ||||
| xco += x; | xco += x; | ||||
| /* The weight group paste function */ | /* The weight group paste function */ | ||||
| ot = ot_weight_paste; | ot = ot_weight_paste; | ||||
| Show All 18 Lines | if (dv && dv->totweight) { | ||||
| MEM_freeN((void *)vgroup_validmap); | MEM_freeN((void *)vgroup_validmap); | ||||
| yco -= 2; | yco -= 2; | ||||
| col = uiLayoutColumn(pa->layout, true); | col = uiLayoutColumn(pa->layout, true); | ||||
| row = uiLayoutRow(col, true); | row = uiLayoutRow(col, true); | ||||
| ot = WM_operatortype_find("OBJECT_OT_vertex_weight_normalize_active_vertex", 1); | ot = WM_operatortype_find("OBJECT_OT_vertex_weight_normalize_active_vertex", 1); | ||||
| but = uiDefButO_ptr(block, BUT, ot, WM_OP_EXEC_DEFAULT, "Normalize", | but = uiDefButO_ptr(block, UI_BTYPE_BUT, ot, WM_OP_EXEC_DEFAULT, "Normalize", | ||||
| 0, yco, UI_UNIT_X * 5, UI_UNIT_Y, | 0, yco, UI_UNIT_X * 5, UI_UNIT_Y, | ||||
| TIP_("Normalize weights of active vertex (if affected groups are unlocked)")); | TIP_("Normalize weights of active vertex (if affected groups are unlocked)")); | ||||
| if (lock_count) { | if (lock_count) { | ||||
| uiButSetFlag(but, UI_BUT_DISABLED); | UI_but_flag_enable(but, UI_BUT_DISABLED); | ||||
| } | } | ||||
| ot = WM_operatortype_find("OBJECT_OT_vertex_weight_copy", 1); | ot = WM_operatortype_find("OBJECT_OT_vertex_weight_copy", 1); | ||||
| but = uiDefButO_ptr(block, BUT, ot, WM_OP_EXEC_DEFAULT, "Copy", | but = uiDefButO_ptr(block, UI_BTYPE_BUT, ot, WM_OP_EXEC_DEFAULT, "Copy", | ||||
| UI_UNIT_X * 5, yco, UI_UNIT_X * 5, UI_UNIT_Y, | UI_UNIT_X * 5, yco, UI_UNIT_X * 5, UI_UNIT_Y, | ||||
| TIP_("Copy active vertex to other selected vertices (if affected groups are unlocked)")); | TIP_("Copy active vertex to other selected vertices (if affected groups are unlocked)")); | ||||
| if (lock_count) { | if (lock_count) { | ||||
| uiButSetFlag(but, UI_BUT_DISABLED); | UI_but_flag_enable(but, UI_BUT_DISABLED); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| static void v3d_transform_butsR(uiLayout *layout, PointerRNA *ptr) | static void v3d_transform_butsR(uiLayout *layout, PointerRNA *ptr) | ||||
| { | { | ||||
| uiLayout *split, *colsub; | uiLayout *split, *colsub; | ||||
| ▲ Show 20 Lines • Show All 205 Lines • ▼ Show 20 Lines | |||||
| { | { | ||||
| uiBlock *block; | uiBlock *block; | ||||
| Scene *scene = CTX_data_scene(C); | Scene *scene = CTX_data_scene(C); | ||||
| Object *obedit = CTX_data_edit_object(C); | Object *obedit = CTX_data_edit_object(C); | ||||
| Object *ob = scene->basact->object; | Object *ob = scene->basact->object; | ||||
| uiLayout *col; | uiLayout *col; | ||||
| block = uiLayoutGetBlock(pa->layout); | block = uiLayoutGetBlock(pa->layout); | ||||
| uiBlockSetHandleFunc(block, do_view3d_region_buttons, NULL); | UI_block_func_handle_set(block, do_view3d_region_buttons, NULL); | ||||
| col = uiLayoutColumn(pa->layout, false); | col = uiLayoutColumn(pa->layout, false); | ||||
| if (ob == obedit) { | if (ob == obedit) { | ||||
| if (ob->type == OB_ARMATURE) { | if (ob->type == OB_ARMATURE) { | ||||
| v3d_editarmature_buts(col, ob); | v3d_editarmature_buts(col, ob); | ||||
| } | } | ||||
| else if (ob->type == OB_MBALL) { | else if (ob->type == OB_MBALL) { | ||||
| ▲ Show 20 Lines • Show All 71 Lines • Show Last 20 Lines | |||||