Changeset View
Changeset View
Standalone View
Standalone View
source/blender/modifiers/intern/MOD_mask.cc
| Show First 20 Lines • Show All 392 Lines • ▼ Show 20 Lines | static bool isDisabled(const struct Scene *UNUSED(scene), | ||||
| /* The object type check is only needed here in case we have a placeholder | /* The object type check is only needed here in case we have a placeholder | ||||
| * object assigned (because the library containing the armature is missing). | * object assigned (because the library containing the armature is missing). | ||||
| * | * | ||||
| * In other cases it should be impossible to have a type mismatch. | * In other cases it should be impossible to have a type mismatch. | ||||
| */ | */ | ||||
| return mmd->ob_arm && mmd->ob_arm->type != OB_ARMATURE; | return mmd->ob_arm && mmd->ob_arm->type != OB_ARMATURE; | ||||
| } | } | ||||
| static void panel_draw(const bContext *C, Panel *panel) | static void panel_draw(const bContext *UNUSED(C), Panel *panel) | ||||
| { | { | ||||
| uiLayout *sub, *row; | uiLayout *sub, *row; | ||||
| uiLayout *layout = panel->layout; | uiLayout *layout = panel->layout; | ||||
| PointerRNA ptr; | |||||
| PointerRNA ob_ptr; | PointerRNA ob_ptr; | ||||
| modifier_panel_get_property_pointers(C, panel, &ob_ptr, &ptr); | PointerRNA *ptr = modifier_panel_get_property_pointers(panel, &ob_ptr); | ||||
| int mode = RNA_enum_get(&ptr, "mode"); | int mode = RNA_enum_get(ptr, "mode"); | ||||
| uiItemR(layout, &ptr, "mode", UI_ITEM_R_EXPAND, NULL, ICON_NONE); | uiItemR(layout, ptr, "mode", UI_ITEM_R_EXPAND, NULL, ICON_NONE); | ||||
| uiLayoutSetPropSep(layout, true); | uiLayoutSetPropSep(layout, true); | ||||
| if (mode == MOD_MASK_MODE_ARM) { | if (mode == MOD_MASK_MODE_ARM) { | ||||
| row = uiLayoutRow(layout, true); | row = uiLayoutRow(layout, true); | ||||
| uiItemR(row, &ptr, "armature", 0, NULL, ICON_NONE); | uiItemR(row, ptr, "armature", 0, NULL, ICON_NONE); | ||||
| sub = uiLayoutRow(row, true); | sub = uiLayoutRow(row, true); | ||||
| uiLayoutSetPropDecorate(sub, false); | uiLayoutSetPropDecorate(sub, false); | ||||
| uiItemR(sub, &ptr, "invert_vertex_group", 0, "", ICON_ARROW_LEFTRIGHT); | uiItemR(sub, ptr, "invert_vertex_group", 0, "", ICON_ARROW_LEFTRIGHT); | ||||
| } | } | ||||
| else if (mode == MOD_MASK_MODE_VGROUP) { | else if (mode == MOD_MASK_MODE_VGROUP) { | ||||
| modifier_vgroup_ui(layout, &ptr, &ob_ptr, "vertex_group", "invert_vertex_group", nullptr); | modifier_vgroup_ui(layout, ptr, &ob_ptr, "vertex_group", "invert_vertex_group", nullptr); | ||||
| } | } | ||||
| uiItemR(layout, &ptr, "threshold", 0, NULL, ICON_NONE); | uiItemR(layout, ptr, "threshold", 0, NULL, ICON_NONE); | ||||
| modifier_panel_end(layout, &ptr); | modifier_panel_end(layout, ptr); | ||||
| } | } | ||||
| static void panelRegister(ARegionType *region_type) | static void panelRegister(ARegionType *region_type) | ||||
| { | { | ||||
| modifier_panel_register(region_type, eModifierType_Mask, panel_draw); | modifier_panel_register(region_type, eModifierType_Mask, panel_draw); | ||||
| } | } | ||||
| ModifierTypeInfo modifierType_Mask = { | ModifierTypeInfo modifierType_Mask = { | ||||
| Show All 34 Lines | |||||