Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/interface/interface_templates.c
| Show First 20 Lines • Show All 1,926 Lines • ▼ Show 20 Lines | |||||
| /* only for curvemap_tools_dofunc */ | /* only for curvemap_tools_dofunc */ | ||||
| enum { | enum { | ||||
| UICURVE_FUNC_RESET_NEG, | UICURVE_FUNC_RESET_NEG, | ||||
| UICURVE_FUNC_RESET_POS, | UICURVE_FUNC_RESET_POS, | ||||
| UICURVE_FUNC_RESET_VIEW, | UICURVE_FUNC_RESET_VIEW, | ||||
| UICURVE_FUNC_HANDLE_VECTOR, | UICURVE_FUNC_HANDLE_VECTOR, | ||||
| UICURVE_FUNC_HANDLE_AUTO, | UICURVE_FUNC_HANDLE_AUTO, | ||||
| UICURVE_FUNC_HANDLE_AUTO_ANIM, | |||||
| UICURVE_FUNC_EXTEND_HOZ, | UICURVE_FUNC_EXTEND_HOZ, | ||||
| UICURVE_FUNC_EXTEND_EXP, | UICURVE_FUNC_EXTEND_EXP, | ||||
| }; | }; | ||||
| static void curvemap_tools_dofunc(bContext *C, void *cumap_v, int event) | static void curvemap_tools_dofunc(bContext *C, void *cumap_v, int event) | ||||
| { | { | ||||
| CurveMapping *cumap = cumap_v; | CurveMapping *cumap = cumap_v; | ||||
| CurveMap *cuma = cumap->cm + cumap->cur; | CurveMap *cuma = cumap->cm + cumap->cur; | ||||
| switch (event) { | switch (event) { | ||||
| case UICURVE_FUNC_RESET_NEG: | case UICURVE_FUNC_RESET_NEG: | ||||
| case UICURVE_FUNC_RESET_POS: /* reset */ | case UICURVE_FUNC_RESET_POS: /* reset */ | ||||
| curvemap_reset(cuma, &cumap->clipr, cumap->preset, | curvemap_reset(cuma, &cumap->clipr, cumap->preset, | ||||
| (event == UICURVE_FUNC_RESET_NEG) ? CURVEMAP_SLOPE_NEGATIVE : CURVEMAP_SLOPE_POSITIVE); | (event == UICURVE_FUNC_RESET_NEG) ? CURVEMAP_SLOPE_NEGATIVE : CURVEMAP_SLOPE_POSITIVE); | ||||
| curvemapping_changed(cumap, false); | curvemapping_changed(cumap, false); | ||||
| break; | break; | ||||
| case UICURVE_FUNC_RESET_VIEW: | case UICURVE_FUNC_RESET_VIEW: | ||||
| cumap->curr = cumap->clipr; | cumap->curr = cumap->clipr; | ||||
| break; | break; | ||||
| case UICURVE_FUNC_HANDLE_VECTOR: /* set vector */ | case UICURVE_FUNC_HANDLE_VECTOR: /* set vector */ | ||||
| curvemap_sethandle(cuma, 1); | curvemap_handle_set(cuma, HD_VECT); | ||||
| curvemapping_changed(cumap, false); | curvemapping_changed(cumap, false); | ||||
| break; | break; | ||||
| case UICURVE_FUNC_HANDLE_AUTO: /* set auto */ | case UICURVE_FUNC_HANDLE_AUTO: /* set auto */ | ||||
| curvemap_sethandle(cuma, 0); | curvemap_handle_set(cuma, HD_AUTO); | ||||
| curvemapping_changed(cumap, false); | curvemapping_changed(cumap, false); | ||||
| break; | break; | ||||
| case UICURVE_FUNC_HANDLE_AUTO_ANIM: /* set auto-clamped */ | |||||
| curvemap_handle_set(cuma, HD_AUTO_ANIM); | |||||
| curvemapping_changed(cumap, false); | |||||
| case UICURVE_FUNC_EXTEND_HOZ: /* extend horiz */ | case UICURVE_FUNC_EXTEND_HOZ: /* extend horiz */ | ||||
| cuma->flag &= ~CUMA_EXTEND_EXTRAPOLATE; | cuma->flag &= ~CUMA_EXTEND_EXTRAPOLATE; | ||||
| curvemapping_changed(cumap, false); | curvemapping_changed(cumap, false); | ||||
| break; | break; | ||||
| case UICURVE_FUNC_EXTEND_EXP: /* extend extrapolate */ | case UICURVE_FUNC_EXTEND_EXP: /* extend extrapolate */ | ||||
| cuma->flag |= CUMA_EXTEND_EXTRAPOLATE; | cuma->flag |= CUMA_EXTEND_EXTRAPOLATE; | ||||
| curvemapping_changed(cumap, false); | curvemapping_changed(cumap, false); | ||||
| break; | break; | ||||
| Show All 17 Lines | uiDefIconTextBut( | ||||
| block, UI_BTYPE_BUT_MENU, 1, ICON_BLANK1, IFACE_("Reset View"), | block, UI_BTYPE_BUT_MENU, 1, ICON_BLANK1, IFACE_("Reset View"), | ||||
| 0, yco -= UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, UICURVE_FUNC_RESET_VIEW, ""); | 0, yco -= UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, UICURVE_FUNC_RESET_VIEW, ""); | ||||
| uiDefIconTextBut( | uiDefIconTextBut( | ||||
| block, UI_BTYPE_BUT_MENU, 1, ICON_BLANK1, IFACE_("Vector Handle"), | block, UI_BTYPE_BUT_MENU, 1, ICON_BLANK1, IFACE_("Vector Handle"), | ||||
| 0, yco -= UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, UICURVE_FUNC_HANDLE_VECTOR, ""); | 0, yco -= UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, UICURVE_FUNC_HANDLE_VECTOR, ""); | ||||
| uiDefIconTextBut( | uiDefIconTextBut( | ||||
| block, UI_BTYPE_BUT_MENU, 1, ICON_BLANK1, IFACE_("Auto Handle"), | block, UI_BTYPE_BUT_MENU, 1, ICON_BLANK1, IFACE_("Auto Handle"), | ||||
| 0, yco -= UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, UICURVE_FUNC_HANDLE_AUTO, ""); | 0, yco -= UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, UICURVE_FUNC_HANDLE_AUTO, ""); | ||||
| uiDefIconTextBut( | |||||
| block, UI_BTYPE_BUT_MENU, 1, ICON_BLANK1, IFACE_("Auto Clamped Handle"), | |||||
| 0, yco -= UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, UICURVE_FUNC_HANDLE_AUTO_ANIM, ""); | |||||
| } | } | ||||
| if (show_extend) { | if (show_extend) { | ||||
| uiDefIconTextBut( | uiDefIconTextBut( | ||||
| block, UI_BTYPE_BUT_MENU, 1, ICON_BLANK1, IFACE_("Extend Horizontal"), | block, UI_BTYPE_BUT_MENU, 1, ICON_BLANK1, IFACE_("Extend Horizontal"), | ||||
| 0, yco -= UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, UICURVE_FUNC_EXTEND_HOZ, ""); | 0, yco -= UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, UICURVE_FUNC_EXTEND_HOZ, ""); | ||||
| uiDefIconTextBut( | uiDefIconTextBut( | ||||
| block, UI_BTYPE_BUT_MENU, 1, ICON_BLANK1, IFACE_("Extend Extrapolated"), | block, UI_BTYPE_BUT_MENU, 1, ICON_BLANK1, IFACE_("Extend Extrapolated"), | ||||
| ▲ Show 20 Lines • Show All 1,787 Lines • Show Last 20 Lines | |||||