diff options
Diffstat (limited to 'source/blender/windowmanager/intern/wm_operators.c')
-rw-r--r-- | source/blender/windowmanager/intern/wm_operators.c | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index 66dd851fc91..0e49ed75f35 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -1271,6 +1271,11 @@ void WM_operator_properties_filesel(wmOperatorType *ot, int filter, short type, if (flag & WM_FILESEL_RELPATH) RNA_def_boolean(ot->srna, "relative_path", true, "Relative Path", "Select the file relative to the blend file"); + if (flag & WM_FILESEL_IMAGE_COLLAPSE) { + prop = RNA_def_boolean(ot->srna, "collapse_images", true, "Collapse Images", "Colapse Images with the same base name"); + RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE); + } + if ((filter & FILE_TYPE_IMAGE) || (filter & FILE_TYPE_MOVIE)) { prop = RNA_def_boolean(ot->srna, "show_multiview", 0, "Enable Multi-View", ""); RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE); @@ -4604,6 +4609,36 @@ static void WM_OT_radial_control(wmOperatorType *ot) RNA_def_boolean(ot->srna, "secondary_tex", false, "Secondary Texture", "Tweak brush secondary/mask texture"); } +/* ************************** widget property tweak *************** */ + +static int widget_tweak_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) +{ + WM_event_add_modal_handler(C, op); + return OPERATOR_RUNNING_MODAL; +} + +static int widget_tweak_modal(bContext *UNUSED(C), wmOperator *UNUSED(op), const wmEvent *event) +{ + if (event->type == EVT_WIDGET_RELEASED) + return OPERATOR_FINISHED; + + return OPERATOR_RUNNING_MODAL; +} + +static void WM_OT_widget_tweak(wmOperatorType *ot) +{ + ot->name = "Widget Tweak"; + ot->idname = "WM_OT_widget_tweak"; + ot->description = "Tweak property attached to a widget"; + + ot->invoke = widget_tweak_invoke; + ot->modal = widget_tweak_modal; + + ot->flag = OPTYPE_REGISTER | OPTYPE_BLOCKING | OPTYPE_UNDO; +} + + + /* ************************** timer for testing ***************** */ /* uses no type defines, fully local testing function anyway... ;) */ @@ -5005,6 +5040,7 @@ void wm_operatortype_init(void) WM_operatortype_append(WM_OT_call_menu); WM_operatortype_append(WM_OT_call_menu_pie); WM_operatortype_append(WM_OT_radial_control); + WM_operatortype_append(WM_OT_widget_tweak); WM_operatortype_append(WM_OT_stereo3d_set); #if defined(WIN32) WM_operatortype_append(WM_OT_console_toggle); @@ -5397,3 +5433,11 @@ EnumPropertyItem *RNA_mask_local_itemf(bContext *C, PointerRNA *ptr, PropertyRNA return rna_id_itemf(C, ptr, r_free, C ? (ID *)CTX_data_main(C)->mask.first : NULL, true); } +EnumPropertyItem *RNA_cachelibrary_itemf(bContext *C, PointerRNA *ptr, PropertyRNA *UNUSED(prop), bool *r_free) +{ + return rna_id_itemf(C, ptr, r_free, C ? (ID *)CTX_data_main(C)->cache_library.first : NULL, false); +} +EnumPropertyItem *RNA_cachelibrary_local_itemf(bContext *C, PointerRNA *ptr, PropertyRNA *UNUSED(prop), bool *r_free) +{ + return rna_id_itemf(C, ptr, r_free, C ? (ID *)CTX_data_main(C)->cache_library.first : NULL, true); +} |