Blender  V2.93
curve_ops.c
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2009 Blender Foundation.
17  * All rights reserved.
18  */
19 
24 #include <math.h>
25 #include <stdlib.h>
26 
27 #include "DNA_curve_types.h"
28 #include "DNA_scene_types.h"
29 
30 #include "RNA_access.h"
31 
32 #include "WM_api.h"
33 #include "WM_types.h"
34 
35 #include "ED_curve.h"
36 #include "ED_screen.h"
37 
38 #include "curve_intern.h"
39 
40 /************************* registration ****************************/
41 
43 {
46 
51 
53 
58 
62 
65 
68 
71 
74 
80 
90 
96 
103 
108 
123 
132 
134 }
135 
137 {
139  wmOperatorTypeMacro *otmacro;
140 
141  ot = WM_operatortype_append_macro("CURVE_OT_duplicate_move",
142  "Add Duplicate",
143  "Duplicate curve and move",
145  WM_operatortype_macro_define(ot, "CURVE_OT_duplicate");
146  otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
147  RNA_boolean_set(otmacro->ptr, "use_proportional_edit", false);
148  RNA_boolean_set(otmacro->ptr, "mirror", false);
149 
150  ot = WM_operatortype_append_macro("CURVE_OT_extrude_move",
151  "Extrude Curve and Move",
152  "Extrude curve and move result",
154  WM_operatortype_macro_define(ot, "CURVE_OT_extrude");
155  otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
156  RNA_boolean_set(otmacro->ptr, "use_proportional_edit", false);
157  RNA_boolean_set(otmacro->ptr, "mirror", false);
158 }
159 
161 {
162  /* only set in editmode font, by space_view3d listener */
163  wmKeyMap *keymap = WM_keymap_ensure(keyconf, "Font", 0, 0);
164  keymap->poll = ED_operator_editfont;
165 
166  /* only set in editmode curve, by space_view3d listener */
167  keymap = WM_keymap_ensure(keyconf, "Curve", 0, 0);
169 }
bool ED_operator_editsurfcurve(struct bContext *C)
Definition: screen_ops.c:541
bool ED_operator_editfont(struct bContext *C)
Definition: screen_ops.c:589
@ OPTYPE_UNDO
Definition: WM_types.h:155
@ OPTYPE_REGISTER
Definition: WM_types.h:153
void FONT_OT_change_character(struct wmOperatorType *ot)
Definition: editfont.c:1412
void CURVE_OT_shade_flat(struct wmOperatorType *ot)
Definition: editcurve.c:6799
void CURVE_OT_select_nth(struct wmOperatorType *ot)
void CURVE_OT_select_row(struct wmOperatorType *ot)
void FONT_OT_style_set(struct wmOperatorType *ot)
Definition: editfont.c:810
void CURVE_OT_extrude(struct wmOperatorType *ot)
Definition: editcurve.c:5710
void CURVE_OT_primitive_nurbs_circle_add(struct wmOperatorType *ot)
void CURVE_OT_dissolve_verts(struct wmOperatorType *ot)
Definition: editcurve.c:6626
void CURVE_OT_radius_set(struct wmOperatorType *ot)
Definition: editcurve.c:2720
void CURVE_OT_split(struct wmOperatorType *ot)
Definition: editcurve.c:1545
void FONT_OT_textbox_remove(struct wmOperatorType *ot)
Definition: editfont.c:1851
void FONT_OT_text_insert(struct wmOperatorType *ot)
Definition: editfont.c:1756
void CURVE_OT_select_random(struct wmOperatorType *ot)
void FONT_OT_line_break(struct wmOperatorType *ot)
Definition: editfont.c:1459
void CURVE_OT_normals_make_consistent(struct wmOperatorType *ot)
Definition: editcurve.c:4044
void CURVE_OT_cyclic_toggle(struct wmOperatorType *ot)
Definition: editcurve.c:5866
void CURVE_OT_hide(struct wmOperatorType *ot)
Definition: editcurve.c:3293
void FONT_OT_case_toggle(struct wmOperatorType *ot)
Definition: editfont.c:2045
void FONT_OT_text_cut(struct wmOperatorType *ot)
Definition: editfont.c:988
void CURVE_OT_make_segment(struct wmOperatorType *ot)
Definition: editcurve.c:4748
void CURVE_OT_select_more(struct wmOperatorType *ot)
void CURVE_OT_primitive_nurbs_curve_add(struct wmOperatorType *ot)
void FONT_OT_case_set(struct wmOperatorType *ot)
Definition: editfont.c:2000
void CURVE_OT_de_select_first(struct wmOperatorType *ot)
void CURVE_OT_tilt_clear(struct wmOperatorType *ot)
Definition: editcurve.c:6995
void CURVE_OT_select_linked(struct wmOperatorType *ot)
void SURFACE_OT_primitive_nurbs_surface_curve_add(struct wmOperatorType *ot)
void CURVE_OT_subdivide(struct wmOperatorType *ot)
Definition: editcurve.c:3826
void CURVE_OT_select_all(struct wmOperatorType *ot)
void CURVE_OT_switch_direction(struct wmOperatorType *ot)
Definition: editcurve.c:2592
void CURVE_OT_select_previous(struct wmOperatorType *ot)
void CURVE_OT_vertex_add(struct wmOperatorType *ot)
Definition: editcurve.c:5626
void CURVE_OT_de_select_last(struct wmOperatorType *ot)
void FONT_OT_text_paste_from_file(struct wmOperatorType *ot)
Definition: editfont.c:608
void CURVE_OT_smooth_radius(struct wmOperatorType *ot)
Definition: editcurve.c:3151
void FONT_OT_move(struct wmOperatorType *ot)
Definition: editfont.c:1258
void FONT_OT_text_paste(struct wmOperatorType *ot)
Definition: editfont.c:1091
void FONT_OT_delete(struct wmOperatorType *ot)
Definition: editfont.c:1604
void CURVE_OT_match_texture_space(struct wmOperatorType *ot)
Definition: editcurve.c:7082
void FONT_OT_move_select(struct wmOperatorType *ot)
Definition: editfont.c:1289
void CURVE_OT_spline_type_set(struct wmOperatorType *ot)
Definition: editcurve.c:3915
void CURVE_OT_separate(struct wmOperatorType *ot)
Definition: editcurve.c:1472
void CURVE_OT_smooth_tilt(struct wmOperatorType *ot)
Definition: editcurve.c:3194
void CURVE_OT_spin(struct wmOperatorType *ot)
Definition: editcurve.c:5077
void FONT_OT_style_toggle(struct wmOperatorType *ot)
Definition: editfont.c:854
void SURFACE_OT_primitive_nurbs_surface_circle_add(struct wmOperatorType *ot)
void CURVE_OT_select_next(struct wmOperatorType *ot)
void CURVE_OT_smooth_weight(struct wmOperatorType *ot)
Definition: editcurve.c:3108
void FONT_OT_unlink(struct wmOperatorType *ot)
Definition: editfont.c:2200
void CURVE_OT_shortest_path_pick(struct wmOperatorType *ot)
void CURVE_OT_select_less(struct wmOperatorType *ot)
void CURVE_OT_duplicate(struct wmOperatorType *ot)
Definition: editcurve.c:5941
void CURVE_OT_smooth(struct wmOperatorType *ot)
Definition: editcurve.c:2879
void CURVE_OT_decimate(struct wmOperatorType *ot)
Definition: editcurve.c:6721
void SURFACE_OT_primitive_nurbs_surface_sphere_add(struct wmOperatorType *ot)
void CURVE_OT_primitive_nurbs_path_add(struct wmOperatorType *ot)
void FONT_OT_text_copy(struct wmOperatorType *ot)
Definition: editfont.c:953
void CURVE_OT_primitive_bezier_curve_add(struct wmOperatorType *ot)
void CURVE_OT_delete(struct wmOperatorType *ot)
Definition: editcurve.c:6479
void CURVE_OT_select_similar(struct wmOperatorType *ot)
void SURFACE_OT_primitive_nurbs_surface_cylinder_add(struct wmOperatorType *ot)
void FONT_OT_textbox_add(struct wmOperatorType *ot)
Definition: editfont.c:1807
void CURVE_OT_spline_weight_set(struct wmOperatorType *ot)
Definition: editcurve.c:2654
void SURFACE_OT_primitive_nurbs_surface_surface_add(struct wmOperatorType *ot)
void CURVE_OT_reveal(struct wmOperatorType *ot)
Definition: editcurve.c:3373
void CURVE_OT_draw(struct wmOperatorType *ot)
void FONT_OT_change_spacing(struct wmOperatorType *ot)
Definition: editfont.c:1354
void CURVE_OT_select_linked_pick(struct wmOperatorType *ot)
void FONT_OT_open(struct wmOperatorType *ot)
Definition: editfont.c:2146
void CURVE_OT_shade_smooth(struct wmOperatorType *ot)
Definition: editcurve.c:6784
void CURVE_OT_handle_type_set(struct wmOperatorType *ot)
Definition: editcurve.c:3981
void SURFACE_OT_primitive_nurbs_surface_torus_add(struct wmOperatorType *ot)
void FONT_OT_select_all(struct wmOperatorType *ot)
Definition: editfont.c:897
void CURVE_OT_primitive_bezier_circle_add(struct wmOperatorType *ot)
void ED_keymap_curve(wmKeyConfig *keyconf)
Definition: curve_ops.c:160
void ED_operatortypes_curve(void)
Definition: curve_ops.c:42
void ED_operatormacros_curve(void)
Definition: curve_ops.c:136
void RNA_boolean_set(PointerRNA *ptr, const char *name, bool value)
Definition: rna_access.c:6272
bool(* poll)(struct bContext *)
wmOperatorType * ot
Definition: wm_files.c:3156
wmKeyMap * WM_keymap_ensure(wmKeyConfig *keyconf, const char *idname, int spaceid, int regionid)
Definition: wm_keymap.c:852
wmOperatorType * WM_operatortype_append_macro(const char *idname, const char *name, const char *description, int flag)
wmOperatorTypeMacro * WM_operatortype_macro_define(wmOperatorType *ot, const char *idname)
void WM_operatortype_append(void(*opfunc)(wmOperatorType *))