Blender  V2.93
transform_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 
21 #include "MEM_guardedalloc.h"
22 
23 #include "DNA_object_types.h"
24 #include "DNA_scene_types.h"
25 
26 #include "BLI_math.h"
27 #include "BLI_utildefines.h"
28 
29 #include "BLT_translation.h"
30 
31 #include "BKE_context.h"
32 #include "BKE_editmesh.h"
33 #include "BKE_global.h"
34 #include "BKE_report.h"
35 #include "BKE_scene.h"
36 
37 #include "RNA_access.h"
38 #include "RNA_define.h"
39 #include "RNA_enum_types.h"
40 
41 #include "WM_api.h"
42 #include "WM_message.h"
43 #include "WM_toolsystem.h"
44 #include "WM_types.h"
45 
46 #include "UI_interface.h"
47 #include "UI_resources.h"
48 
49 #include "ED_screen.h"
50 /* for USE_LOOPSLIDE_HACK only */
51 #include "ED_mesh.h"
52 
53 #include "transform.h"
54 #include "transform_convert.h"
55 
56 typedef struct TransformModeItem {
57  const char *idname;
58  int mode;
59  void (*opfunc)(wmOperatorType *);
61 
62 static const float VecOne[3] = {1, 1, 1};
63 
64 static const char OP_TRANSLATION[] = "TRANSFORM_OT_translate";
65 static const char OP_ROTATION[] = "TRANSFORM_OT_rotate";
66 static const char OP_TOSPHERE[] = "TRANSFORM_OT_tosphere";
67 static const char OP_RESIZE[] = "TRANSFORM_OT_resize";
68 static const char OP_SKIN_RESIZE[] = "TRANSFORM_OT_skin_resize";
69 static const char OP_SHEAR[] = "TRANSFORM_OT_shear";
70 static const char OP_BEND[] = "TRANSFORM_OT_bend";
71 static const char OP_SHRINK_FATTEN[] = "TRANSFORM_OT_shrink_fatten";
72 static const char OP_PUSH_PULL[] = "TRANSFORM_OT_push_pull";
73 static const char OP_TILT[] = "TRANSFORM_OT_tilt";
74 static const char OP_TRACKBALL[] = "TRANSFORM_OT_trackball";
75 static const char OP_MIRROR[] = "TRANSFORM_OT_mirror";
76 static const char OP_BONE_SIZE[] = "TRANSFORM_OT_bbone_resize";
77 static const char OP_EDGE_SLIDE[] = "TRANSFORM_OT_edge_slide";
78 static const char OP_VERT_SLIDE[] = "TRANSFORM_OT_vert_slide";
79 static const char OP_EDGE_CREASE[] = "TRANSFORM_OT_edge_crease";
80 static const char OP_EDGE_BWEIGHT[] = "TRANSFORM_OT_edge_bevelweight";
81 static const char OP_SEQ_SLIDE[] = "TRANSFORM_OT_seq_slide";
82 static const char OP_NORMAL_ROTATION[] = "TRANSFORM_OT_rotate_normal";
83 
84 static void TRANSFORM_OT_translate(struct wmOperatorType *ot);
85 static void TRANSFORM_OT_rotate(struct wmOperatorType *ot);
86 static void TRANSFORM_OT_tosphere(struct wmOperatorType *ot);
87 static void TRANSFORM_OT_resize(struct wmOperatorType *ot);
88 static void TRANSFORM_OT_skin_resize(struct wmOperatorType *ot);
89 static void TRANSFORM_OT_shear(struct wmOperatorType *ot);
90 static void TRANSFORM_OT_bend(struct wmOperatorType *ot);
91 static void TRANSFORM_OT_shrink_fatten(struct wmOperatorType *ot);
92 static void TRANSFORM_OT_push_pull(struct wmOperatorType *ot);
93 static void TRANSFORM_OT_tilt(struct wmOperatorType *ot);
94 static void TRANSFORM_OT_trackball(struct wmOperatorType *ot);
95 static void TRANSFORM_OT_mirror(struct wmOperatorType *ot);
96 static void TRANSFORM_OT_bbone_resize(struct wmOperatorType *ot);
97 static void TRANSFORM_OT_edge_slide(struct wmOperatorType *ot);
98 static void TRANSFORM_OT_vert_slide(struct wmOperatorType *ot);
99 static void TRANSFORM_OT_edge_crease(struct wmOperatorType *ot);
100 static void TRANSFORM_OT_edge_bevelweight(struct wmOperatorType *ot);
101 static void TRANSFORM_OT_seq_slide(struct wmOperatorType *ot);
102 static void TRANSFORM_OT_rotate_normal(struct wmOperatorType *ot);
103 
124  {NULL, 0},
125 };
126 
128  {TFM_INIT, "INIT", 0, "Init", ""},
129  {TFM_DUMMY, "DUMMY", 0, "Dummy", ""},
130  {TFM_TRANSLATION, "TRANSLATION", 0, "Translation", ""},
131  {TFM_ROTATION, "ROTATION", 0, "Rotation", ""},
132  {TFM_RESIZE, "RESIZE", 0, "Resize", ""},
133  {TFM_SKIN_RESIZE, "SKIN_RESIZE", 0, "Skin Resize", ""},
134  {TFM_TOSPHERE, "TOSPHERE", 0, "To Sphere", ""},
135  {TFM_SHEAR, "SHEAR", 0, "Shear", ""},
136  {TFM_BEND, "BEND", 0, "Bend", ""},
137  {TFM_SHRINKFATTEN, "SHRINKFATTEN", 0, "Shrink/Fatten", ""},
138  {TFM_TILT, "TILT", 0, "Tilt", ""},
139  {TFM_TRACKBALL, "TRACKBALL", 0, "Trackball", ""},
140  {TFM_PUSHPULL, "PUSHPULL", 0, "Push/Pull", ""},
141  {TFM_CREASE, "CREASE", 0, "Crease", ""},
142  {TFM_MIRROR, "MIRROR", 0, "Mirror", ""},
143  {TFM_BONESIZE, "BONE_SIZE", 0, "Bone Size", ""},
144  {TFM_BONE_ENVELOPE, "BONE_ENVELOPE", 0, "Bone Envelope", ""},
145  {TFM_BONE_ENVELOPE_DIST, "BONE_ENVELOPE_DIST", 0, "Bone Envelope Distance", ""},
146  {TFM_CURVE_SHRINKFATTEN, "CURVE_SHRINKFATTEN", 0, "Curve Shrink/Fatten", ""},
147  {TFM_MASK_SHRINKFATTEN, "MASK_SHRINKFATTEN", 0, "Mask Shrink/Fatten", ""},
148  {TFM_GPENCIL_SHRINKFATTEN, "GPENCIL_SHRINKFATTEN", 0, "Grease Pencil Shrink/Fatten", ""},
149  {TFM_BONE_ROLL, "BONE_ROLL", 0, "Bone Roll", ""},
150  {TFM_TIME_TRANSLATE, "TIME_TRANSLATE", 0, "Time Translate", ""},
151  {TFM_TIME_SLIDE, "TIME_SLIDE", 0, "Time Slide", ""},
152  {TFM_TIME_SCALE, "TIME_SCALE", 0, "Time Scale", ""},
153  {TFM_TIME_EXTEND, "TIME_EXTEND", 0, "Time Extend", ""},
154  {TFM_BAKE_TIME, "BAKE_TIME", 0, "Bake Time", ""},
155  {TFM_BWEIGHT, "BWEIGHT", 0, "Bevel Weight", ""},
156  {TFM_ALIGN, "ALIGN", 0, "Align", ""},
157  {TFM_EDGE_SLIDE, "EDGESLIDE", 0, "Edge Slide", ""},
158  {TFM_SEQ_SLIDE, "SEQSLIDE", 0, "Sequence Slide", ""},
159  {TFM_GPENCIL_OPACITY, "GPENCIL_OPACITY", 0, "Grease Pencil Opacity", ""},
160  {0, NULL, 0, NULL, NULL},
161 };
162 
164 {
166 
167  int orientation = RNA_enum_get(op->ptr, "orientation");
168 
170 
173 
174  struct wmMsgBus *mbus = CTX_wm_message_bus(C);
176 
177  return OPERATOR_FINISHED;
178 }
179 
181  wmOperator *UNUSED(op),
182  const wmEvent *UNUSED(event))
183 {
184  uiPopupMenu *pup;
185  uiLayout *layout;
186 
187  pup = UI_popup_menu_begin(C, IFACE_("Orientation"), ICON_NONE);
188  layout = UI_popup_menu_layout(pup);
189  uiItemsEnumO(layout, "TRANSFORM_OT_select_orientation", "orientation");
190  UI_popup_menu_end(C, pup);
191 
192  return OPERATOR_INTERFACE;
193 }
194 
196 {
197  PropertyRNA *prop;
198 
199  /* identifiers */
200  ot->name = "Select Orientation";
201  ot->description = "Select transformation orientation";
202  ot->idname = "TRANSFORM_OT_select_orientation";
203  ot->flag = OPTYPE_UNDO;
204 
205  /* api callbacks */
209 
210  prop = RNA_def_property(ot->srna, "orientation", PROP_ENUM, PROP_NONE);
211  RNA_def_property_ui_text(prop, "Orientation", "Transformation orientation");
213 }
214 
216 {
220 
222 
223  struct wmMsgBus *mbus = CTX_wm_message_bus(C);
224  WM_msg_publish_rna_prop(mbus, &scene->id, scene, Scene, transform_orientation_slots);
225 
226  return OPERATOR_FINISHED;
227 }
228 
230 {
231  return delete_orientation_exec(C, op);
232 }
233 
235 {
236  if (ED_operator_areaactive(C) == 0) {
237  return 0;
238  }
239 
243 }
244 
246 {
247  /* identifiers */
248  ot->name = "Delete Orientation";
249  ot->description = "Delete transformation orientation";
250  ot->idname = "TRANSFORM_OT_delete_orientation";
251  ot->flag = OPTYPE_UNDO;
252 
253  /* api callbacks */
257 }
258 
260 {
261  char name[MAX_NAME];
262  const bool use = RNA_boolean_get(op->ptr, "use");
263  const bool overwrite = RNA_boolean_get(op->ptr, "overwrite");
264  const bool use_view = RNA_boolean_get(op->ptr, "use_view");
265  View3D *v3d = CTX_wm_view3d(C);
267 
268  RNA_string_get(op->ptr, "name", name);
269 
270  if (use && !v3d) {
271  BKE_report(op->reports,
272  RPT_ERROR,
273  "Create Orientation's 'use' parameter only valid in a 3DView context");
274  return OPERATOR_CANCELLED;
275  }
276 
277  if (!BIF_createTransformOrientation(C, op->reports, name, use_view, use, overwrite)) {
278  BKE_report(op->reports, RPT_ERROR, "Unable to create orientation");
279  return OPERATOR_CANCELLED;
280  }
281 
282  if (use) {
283  struct wmMsgBus *mbus = CTX_wm_message_bus(C);
284  WM_msg_publish_rna_prop(mbus, &scene->id, scene, Scene, transform_orientation_slots);
286  }
287 
289 
290  return OPERATOR_FINISHED;
291 }
292 
294 {
295  /* identifiers */
296  ot->name = "Create Orientation";
297  ot->description = "Create transformation orientation from selection";
298  ot->idname = "TRANSFORM_OT_create_orientation";
300 
301  /* api callbacks */
304 
305  RNA_def_string(ot->srna, "name", NULL, MAX_NAME, "Name", "Name of the new custom orientation");
307  ot->srna,
308  "use_view",
309  false,
310  "Use View",
311  "Use the current view instead of the active object to create the new orientation");
312 
314 
316  ot->srna, "use", false, "Use After Creation", "Select orientation after its creation");
318  "overwrite",
319  false,
320  "Overwrite Previous",
321  "Overwrite previously created orientation with same name");
322 }
323 
324 #ifdef USE_LOOPSLIDE_HACK
329 {
330  if (op->type->idname == OP_EDGE_SLIDE) {
331  if (op->opm && op->opm->opm && op->opm->opm->prev) {
332  wmOperator *op_prev = op->opm->opm->prev;
334  bool mesh_select_mode[3];
335  PropertyRNA *prop = RNA_struct_find_property(op_prev->ptr, "mesh_select_mode_init");
336 
337  if (prop && RNA_property_is_set(op_prev->ptr, prop)) {
339  short selectmode_orig;
340 
341  RNA_property_boolean_get_array(op_prev->ptr, prop, mesh_select_mode);
342  selectmode_orig = ((mesh_select_mode[0] ? SCE_SELECT_VERTEX : 0) |
343  (mesh_select_mode[1] ? SCE_SELECT_EDGE : 0) |
344  (mesh_select_mode[2] ? SCE_SELECT_FACE : 0));
345 
346  /* still switch if we were originally in face select mode */
347  if ((ts->selectmode != selectmode_orig) && (selectmode_orig != SCE_SELECT_FACE)) {
348  Object *obedit = CTX_data_edit_object(C);
349  BMEditMesh *em = BKE_editmesh_from_object(obedit);
350  em->selectmode = ts->selectmode = selectmode_orig;
352  }
353  }
354  }
355  }
356 }
357 #else
358 /* prevent removal by cleanup */
359 # error "loopslide hack removed!"
360 #endif /* USE_LOOPSLIDE_HACK */
361 
363 {
364 #ifdef USE_LOOPSLIDE_HACK
366 #endif
367 
368  saveTransform(C, op->customdata, op);
369  MEM_freeN(op->customdata);
370  op->customdata = NULL;
371  G.moving = 0;
372 }
373 
374 static int transformops_data(bContext *C, wmOperator *op, const wmEvent *event)
375 {
376  int retval = 1;
377  if (op->customdata == NULL) {
378  TransInfo *t = MEM_callocN(sizeof(TransInfo), "TransInfo data2");
379  TransformModeItem *tmode;
380  int mode = -1;
381 
382  for (tmode = transform_modes; tmode->idname; tmode++) {
383  if (op->type->idname == tmode->idname) {
384  mode = tmode->mode;
385  break;
386  }
387  }
388 
389  if (mode == -1) {
390  mode = RNA_enum_get(op->ptr, "mode");
391  }
392 
393  retval = initTransform(C, t, op, event, mode);
394 
395  /* store data */
396  if (retval) {
397  G.moving = special_transform_moving(t);
398  op->customdata = t;
399  }
400  else {
401  MEM_freeN(t);
402  }
403  }
404 
405  return retval; /* return 0 on error */
406 }
407 
408 static int transform_modal(bContext *C, wmOperator *op, const wmEvent *event)
409 {
410  int exit_code;
411 
412  TransInfo *t = op->customdata;
413  const eTfmMode mode_prev = t->mode;
414 
415 #if defined(WITH_INPUT_NDOF) && 0
416  /* Stable 2D mouse coords map to different 3D coords while the 3D mouse is active
417  * in other words, 2D deltas are no longer good enough!
418  * disable until individual 'transformers' behave better. */
419 
420  if (event->type == NDOF_MOTION) {
421  return OPERATOR_PASS_THROUGH;
422  }
423 #endif
424 
425  /* XXX insert keys are called here, and require context */
426  t->context = C;
427  exit_code = transformEvent(t, event);
428  t->context = NULL;
429 
430  /* XXX, workaround: active needs to be calculated before transforming,
431  * since we're not reading from 'td->center' in this case. see: T40241 */
432  if (t->tsnap.target == SCE_SNAP_TARGET_ACTIVE) {
433  /* In camera view, tsnap callback is not set
434  * (see #initSnappingMode() in transform_snap.c, and T40348). */
435  if (t->tsnap.targetSnap && ((t->tsnap.status & TARGET_INIT) == 0)) {
436  t->tsnap.targetSnap(t);
437  }
438  }
439 
440  transformApply(C, t);
441 
442  exit_code |= transformEnd(C, t);
443 
444  if ((exit_code & OPERATOR_RUNNING_MODAL) == 0) {
445  transformops_exit(C, op);
446  exit_code &= ~OPERATOR_PASS_THROUGH; /* Preventively remove pass-through. */
447  }
448  else {
449  if (mode_prev != t->mode) {
450  /* WARNING: this is not normal to switch operator types
451  * normally it would not be supported but transform happens
452  * to share callbacks between different operators. */
453  wmOperatorType *ot_new = NULL;
455  while (item->idname) {
456  if (item->mode == t->mode) {
457  ot_new = WM_operatortype_find(item->idname, false);
458  break;
459  }
460  item++;
461  }
462 
463  BLI_assert(ot_new != NULL);
464  if (ot_new) {
465  WM_operator_type_set(op, ot_new);
466  }
467  /* end suspicious code */
468  }
469  }
470 
471  return exit_code;
472 }
473 
475 {
476  TransInfo *t = op->customdata;
477 
478  t->state = TRANS_CANCEL;
479  transformEnd(C, t);
480  transformops_exit(C, op);
481 }
482 
484 {
485  TransInfo *t;
486 
487  if (!transformops_data(C, op, NULL)) {
488  G.moving = 0;
489  return OPERATOR_CANCELLED;
490  }
491 
492  t = op->customdata;
493 
494  t->options |= CTX_AUTOCONFIRM;
495 
496  transformApply(C, t);
497 
498  transformEnd(C, t);
499 
500  transformops_exit(C, op);
501 
503 
504  return OPERATOR_FINISHED;
505 }
506 
507 static int transform_invoke(bContext *C, wmOperator *op, const wmEvent *event)
508 {
509  if (!transformops_data(C, op, event)) {
510  G.moving = 0;
511  return OPERATOR_CANCELLED;
512  }
513 
514  /* When modal, allow 'value' to set initial offset. */
515  if ((event == NULL) && RNA_struct_property_is_set(op->ptr, "value")) {
516  return transform_exec(C, op);
517  }
518 
519  /* add temp handler */
521 
522  op->flag |= OP_IS_MODAL_GRAB_CURSOR; /* XXX maybe we want this with the gizmo only? */
523 
524  /* Use when modal input has some transformation to begin with. */
525  TransInfo *t = op->customdata;
526  if (UNLIKELY(!is_zero_v4(t->values_modal_offset))) {
527  transformApply(C, t);
528  }
529 
530  return OPERATOR_RUNNING_MODAL;
531 }
532 
534  wmOperator *op,
535  const PropertyRNA *prop)
536 {
537  const char *prop_id = RNA_property_identifier(prop);
538 
539  /* Orientation/Constraints. */
540  {
541  /* Hide orientation axis if no constraints are set, since it wont be used. */
542  PropertyRNA *prop_con = RNA_struct_find_property(op->ptr, "orient_type");
543  if (!ELEM(prop_con, NULL, prop)) {
544  if (STRPREFIX(prop_id, "constraint")) {
545 
546  /* Special case: show constraint axis if we don't have values,
547  * needed for mirror operator. */
548  if (STREQ(prop_id, "constraint_axis") &&
549  (RNA_struct_find_property(op->ptr, "value") == NULL)) {
550  return true;
551  }
552 
553  return false;
554  }
555  }
556  }
557 
558  /* Proportional Editing. */
559  {
560  PropertyRNA *prop_pet = RNA_struct_find_property(op->ptr, "use_proportional_edit");
561  if (prop_pet && (prop_pet != prop) && (RNA_property_boolean_get(op->ptr, prop_pet) == false)) {
562  if (STRPREFIX(prop_id, "proportional") || STRPREFIX(prop_id, "use_proportional")) {
563  return false;
564  }
565  }
566  }
567 
568  return true;
569 }
570 
571 void Transform_Properties(struct wmOperatorType *ot, int flags)
572 {
573  PropertyRNA *prop;
574 
575  if (flags & P_ORIENT_AXIS) {
576  prop = RNA_def_property(ot->srna, "orient_axis", PROP_ENUM, PROP_NONE);
577  RNA_def_property_ui_text(prop, "Axis", "");
581  }
582  if (flags & P_ORIENT_AXIS_ORTHO) {
583  prop = RNA_def_property(ot->srna, "orient_axis_ortho", PROP_ENUM, PROP_NONE);
584  RNA_def_property_ui_text(prop, "Axis Ortho", "");
588  }
589 
590  if (flags & P_ORIENT_MATRIX) {
591  prop = RNA_def_property(ot->srna, "orient_type", PROP_ENUM, PROP_NONE);
592  RNA_def_property_ui_text(prop, "Orientation", "Transformation orientation");
594 
595  /* Set by 'orient_type' or gizmo which acts on non-standard orientation. */
596  prop = RNA_def_float_matrix(
597  ot->srna, "orient_matrix", 3, 3, NULL, 0.0f, 0.0f, "Matrix", "", 0.0f, 0.0f);
599 
600  /* Only use 'orient_matrix' when 'orient_matrix_type == orient_type',
601  * this allows us to reuse the orientation set by a gizmo for eg, without disabling the ability
602  * to switch over to other orientations. */
603  prop = RNA_def_property(ot->srna, "orient_matrix_type", PROP_ENUM, PROP_NONE);
604  RNA_def_property_ui_text(prop, "Matrix Orientation", "");
607  }
608 
609  if (flags & P_CONSTRAINT) {
610  RNA_def_boolean_vector(ot->srna, "constraint_axis", 3, NULL, "Constraint Axis", "");
611  }
612 
613  if (flags & P_MIRROR) {
614  prop = RNA_def_boolean(ot->srna, "mirror", 0, "Mirror Editing", "");
615  if (flags & P_MIRROR_DUMMY) {
616  /* only used so macros can disable this option */
618  }
619  }
620 
621  if (flags & P_PROPORTIONAL) {
622  RNA_def_boolean(ot->srna, "use_proportional_edit", 0, "Proportional Editing", "");
623  prop = RNA_def_enum(ot->srna,
624  "proportional_edit_falloff",
626  0,
627  "Proportional Falloff",
628  "Falloff type for proportional editing mode");
629  /* Abusing id_curve :/ */
632  "proportional_size",
633  1,
636  "Proportional Size",
637  "",
638  0.001f,
639  100.0f);
640 
641  RNA_def_boolean(ot->srna, "use_proportional_connected", 0, "Connected", "");
642  RNA_def_boolean(ot->srna, "use_proportional_projected", 0, "Projected (2D)", "");
643  }
644 
645  if (flags & P_SNAP) {
646  prop = RNA_def_boolean(ot->srna, "snap", 0, "Use Snapping Options", "");
648 
649  if (flags & P_GEO_SNAP) {
650  prop = RNA_def_enum(ot->srna, "snap_target", rna_enum_snap_target_items, 0, "Target", "");
652  prop = RNA_def_float_vector(
653  ot->srna, "snap_point", 3, NULL, -FLT_MAX, FLT_MAX, "Point", "", -FLT_MAX, FLT_MAX);
655 
656  if (flags & P_ALIGN_SNAP) {
657  prop = RNA_def_boolean(ot->srna, "snap_align", 0, "Align with Point Normal", "");
659  prop = RNA_def_float_vector(
660  ot->srna, "snap_normal", 3, NULL, -FLT_MAX, FLT_MAX, "Normal", "", -FLT_MAX, FLT_MAX);
662  }
663  }
664  }
665 
666  if (flags & P_GPENCIL_EDIT) {
667  prop = RNA_def_boolean(ot->srna,
668  "gpencil_strokes",
669  0,
670  "Edit Grease Pencil",
671  "Edit selected Grease Pencil strokes");
673  }
674 
675  if (flags & P_CURSOR_EDIT) {
676  prop = RNA_def_boolean(ot->srna, "cursor_transform", 0, "Transform Cursor", "");
678  }
679 
680  if ((flags & P_OPTIONS) && !(flags & P_NO_TEXSPACE)) {
681  prop = RNA_def_boolean(
682  ot->srna, "texture_space", 0, "Edit Texture Space", "Edit object data texture space");
684  prop = RNA_def_boolean(
685  ot->srna, "remove_on_cancel", 0, "Remove on Cancel", "Remove elements on cancel");
687  }
688 
689  if (flags & P_CORRECT_UV) {
691  ot->srna, "correct_uv", true, "Correct UVs", "Correct UV coordinates when transforming");
692  }
693 
694  if (flags & P_CENTER) {
695  /* For gizmos that define their own center. */
696  prop = RNA_def_property(ot->srna, "center_override", PROP_FLOAT, PROP_XYZ);
697  RNA_def_property_array(prop, 3);
699  RNA_def_property_ui_text(prop, "Center Override", "Force using this center value (when set)");
700  }
701 
702  if ((flags & P_NO_DEFAULTS) == 0) {
703  prop = RNA_def_boolean(ot->srna,
704  "release_confirm",
705  0,
706  "Confirm on Release",
707  "Always confirm operation when releasing button");
709 
710  prop = RNA_def_boolean(ot->srna, "use_accurate", 0, "Accurate", "Use accurate transformation");
712  }
713 
714  if (flags & P_POST_TRANSFORM) {
715  prop = RNA_def_boolean(ot->srna,
716  "use_automerge_and_split",
717  0,
718  "Auto Merge & Split",
719  "Forces the use of Auto Merge and Split");
721  }
722 }
723 
725 {
726  /* identifiers */
727  ot->name = "Move";
728  ot->description = "Move selected items";
731 
732  /* api callbacks */
739 
741  ot->srna, "value", 3, NULL, -FLT_MAX, FLT_MAX, "Move", "", -FLT_MAX, FLT_MAX);
742 
744 
748 }
749 
751 {
752  /* identifiers */
753  ot->name = "Resize";
754  ot->description = "Scale (resize) selected items";
755  ot->idname = OP_RESIZE;
757 
758  /* api callbacks */
765 
767  ot->srna, "value", 3, VecOne, -FLT_MAX, FLT_MAX, "Scale", "", -FLT_MAX, FLT_MAX);
768 
770 
774 }
775 
777 {
778  /* identifiers */
779  ot->name = "Skin Resize";
780  ot->description = "Scale selected vertices' skin radii";
783 
784  /* api callbacks */
791 
793  ot->srna, "value", 3, VecOne, -FLT_MAX, FLT_MAX, "Scale", "", -FLT_MAX, FLT_MAX);
794 
796 
800 }
801 
803 {
804  /* identifiers */
805  ot->name = "Trackball";
806  ot->description = "Trackball style rotation of selected items";
809 
810  /* api callbacks */
817 
818  /* Maybe we could use float_vector_xyz here too? */
820  ot->srna, "value", 2, NULL, -FLT_MAX, FLT_MAX, "Angle", "", -FLT_MAX, FLT_MAX);
821 
823 
825 }
826 
827 /* Similar to #transform_shear_poll. */
829 {
830  if (!ED_operator_screenactive(C)) {
831  return false;
832  }
833 
835  return area && !ELEM(area->spacetype, SPACE_ACTION);
836 }
837 
839 {
840  /* identifiers */
841  ot->name = "Rotate";
842  ot->description = "Rotate selected items";
843  ot->idname = OP_ROTATION;
845 
846  /* api callbacks */
853 
855  ot->srna, "value", 0, NULL, -FLT_MAX, FLT_MAX, "Angle", "", -M_PI * 2, M_PI * 2);
856 
858 
862 }
863 
864 static void TRANSFORM_OT_tilt(struct wmOperatorType *ot)
865 {
866  /* identifiers */
867  ot->name = "Tilt";
868  /* optional -
869  * "Tilt selected vertices"
870  * "Specify an extra axis rotation for selected vertices of 3D curve" */
871  ot->description = "Tilt selected control vertices of 3D curve";
872  ot->idname = OP_TILT;
874 
875  /* api callbacks */
882 
884  ot->srna, "value", 0, NULL, -FLT_MAX, FLT_MAX, "Angle", "", -M_PI * 2, M_PI * 2);
885 
887 
889 }
890 
891 static void TRANSFORM_OT_bend(struct wmOperatorType *ot)
892 {
893  /* identifiers */
894  ot->name = "Bend";
895  ot->description = "Bend selected items between the 3D cursor and the mouse";
896  ot->idname = OP_BEND;
898 
899  /* api callbacks */
901  // ot->exec = transform_exec; /* unsupported */
906 
908  ot->srna, "value", 1, NULL, -FLT_MAX, FLT_MAX, "Angle", "", -M_PI * 2, M_PI * 2);
909 
911 
913 }
914 
915 /* Similar to #transform_rotate_poll. */
917 {
918  if (!ED_operator_screenactive(C)) {
919  return false;
920  }
921 
923  return area && !ELEM(area->spacetype, SPACE_ACTION);
924 }
925 
927 {
928  /* identifiers */
929  ot->name = "Shear";
930  ot->description = "Shear selected items along the horizontal screen axis";
931  ot->idname = OP_SHEAR;
933 
934  /* api callbacks */
941 
942  RNA_def_float(ot->srna, "value", 0, -FLT_MAX, FLT_MAX, "Offset", "", -FLT_MAX, FLT_MAX);
943 
945 
949 }
950 
952 {
953  /* identifiers */
954  ot->name = "Push/Pull";
955  ot->description = "Push/Pull selected items";
958 
959  /* api callbacks */
966 
967  RNA_def_float(ot->srna, "value", 0, -FLT_MAX, FLT_MAX, "Distance", "", -FLT_MAX, FLT_MAX);
968 
970 
972 }
973 
975 {
976  /* identifiers */
977  ot->name = "Shrink/Fatten";
978  ot->description = "Shrink/fatten selected vertices along normals";
981 
982  /* api callbacks */
989 
990  RNA_def_float_distance(ot->srna, "value", 0, -FLT_MAX, FLT_MAX, "Offset", "", -FLT_MAX, FLT_MAX);
991 
993  "use_even_offset",
994  false,
995  "Offset Even",
996  "Scale the offset to give more even thickness");
997 
999 
1001 }
1002 
1004 {
1005  /* identifiers */
1006  ot->name = "To Sphere";
1007  ot->description = "Move selected items outward in a spherical shape around geometric center";
1008  ot->idname = OP_TOSPHERE;
1010 
1011  /* api callbacks */
1013  ot->exec = transform_exec;
1018 
1019  RNA_def_float_factor(ot->srna, "value", 0, 0, 1, "Factor", "", 0, 1);
1020 
1022 
1024 }
1025 
1027 {
1028  /* identifiers */
1029  ot->name = "Mirror";
1030  ot->description = "Mirror selected items around one or more axes";
1031  ot->idname = OP_MIRROR;
1033 
1034  /* api callbacks */
1036  ot->exec = transform_exec;
1041 
1043 }
1044 
1046 {
1047  /* identifiers */
1048  ot->name = "Scale B-Bone";
1049  ot->description = "Scale selected bendy bones display size";
1050  ot->idname = OP_BONE_SIZE;
1052 
1053  /* api callbacks */
1055  ot->exec = transform_exec;
1060 
1062  ot->srna, "value", 3, VecOne, -FLT_MAX, FLT_MAX, "Display Size", "", -FLT_MAX, FLT_MAX);
1063 
1065 
1067 }
1068 
1070 {
1071  PropertyRNA *prop;
1072 
1073  /* identifiers */
1074  ot->name = "Edge Slide";
1075  ot->description = "Slide an edge loop along a mesh";
1076  ot->idname = OP_EDGE_SLIDE;
1078 
1079  /* api callbacks */
1081  ot->exec = transform_exec;
1086 
1087  RNA_def_float_factor(ot->srna, "value", 0, -10.0f, 10.0f, "Factor", "", -1.0f, 1.0f);
1088 
1089  prop = RNA_def_boolean(ot->srna, "single_side", false, "Single Side", "");
1092  "use_even",
1093  false,
1094  "Even",
1095  "Make the edge loop match the shape of the adjacent edge loop");
1096 
1098 
1100  "flipped",
1101  false,
1102  "Flipped",
1103  "When Even mode is active, flips between the two adjacent edge loops");
1104  RNA_def_boolean(ot->srna, "use_clamp", true, "Clamp", "Clamp within the edge extents");
1105 
1107 }
1108 
1110 {
1111  /* identifiers */
1112  ot->name = "Vertex Slide";
1113  ot->description = "Slide a vertex along a mesh";
1114  ot->idname = OP_VERT_SLIDE;
1116 
1117  /* api callbacks */
1119  ot->exec = transform_exec;
1124 
1125  RNA_def_float_factor(ot->srna, "value", 0, -10.0f, 10.0f, "Factor", "", -1.0f, 1.0f);
1127  "use_even",
1128  false,
1129  "Even",
1130  "Make the edge loop match the shape of the adjacent edge loop");
1131 
1133 
1135  "flipped",
1136  false,
1137  "Flipped",
1138  "When Even mode is active, flips between the two adjacent edge loops");
1139  RNA_def_boolean(ot->srna, "use_clamp", true, "Clamp", "Clamp within the edge extents");
1140 
1142 }
1143 
1145 {
1146  /* identifiers */
1147  ot->name = "Edge Crease";
1148  ot->description = "Change the crease of edges";
1151 
1152  /* api callbacks */
1154  ot->exec = transform_exec;
1159 
1160  RNA_def_float_factor(ot->srna, "value", 0, -1.0f, 1.0f, "Factor", "", -1.0f, 1.0f);
1161 
1163 
1165 }
1166 
1168 {
1169  /* identifiers */
1170  ot->name = "Edge Bevel Weight";
1171  ot->description = "Change the bevel weight of edges";
1174 
1175  /* api callbacks */
1177  ot->exec = transform_exec;
1181 
1182  RNA_def_float_factor(ot->srna, "value", 0, -1.0f, 1.0f, "Factor", "", -1.0f, 1.0f);
1183 
1185 
1187 }
1188 
1190 {
1191  /* identifiers */
1192  ot->name = "Sequence Slide";
1193  ot->description = "Slide a sequence strip in time";
1194  ot->idname = OP_SEQ_SLIDE;
1196 
1197  /* api callbacks */
1199  ot->exec = transform_exec;
1203 
1204  /* properties */
1205  PropertyRNA *prop;
1206 
1207  prop = RNA_def_float_vector(
1208  ot->srna, "value", 2, NULL, -FLT_MAX, FLT_MAX, "Offset", "", -FLT_MAX, FLT_MAX);
1209  RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, 0);
1210 
1212 
1214 }
1215 
1217 {
1218  /* identifiers */
1219  ot->name = "Rotate Normals";
1220  ot->description = "Rotate split normal of selected items";
1223 
1224  /* api callbacks */
1226  ot->exec = transform_exec;
1230 
1232  ot->srna, "value", 0, NULL, -FLT_MAX, FLT_MAX, "Angle", "", -M_PI * 2, M_PI * 2);
1233 
1235 }
1236 
1238 {
1239  PropertyRNA *prop;
1240 
1241  /* identifiers */
1242  ot->name = "Transform";
1243  ot->description = "Transform selected items by mode type";
1244  ot->idname = "TRANSFORM_OT_transform";
1246 
1247  /* api callbacks */
1249  ot->exec = transform_exec;
1254 
1255  prop = RNA_def_enum(
1256  ot->srna, "mode", rna_enum_transform_mode_types, TFM_TRANSLATION, "Mode", "");
1258 
1260  ot->srna, "value", 4, NULL, -FLT_MAX, FLT_MAX, "Values", "", -FLT_MAX, FLT_MAX);
1261 
1263 
1267 }
1268 
1270  wmOperator *UNUSED(op),
1271  const wmEvent *UNUSED(event))
1272 {
1274  if (tref) {
1275  ARegion *region = CTX_wm_region(C);
1276  wmGizmoMap *gzmap = region->gizmo_map;
1277  wmGizmoGroup *gzgroup = gzmap ? WM_gizmomap_group_find(gzmap, "VIEW3D_GGT_xform_gizmo") : NULL;
1278  if (gzgroup != NULL) {
1279  PointerRNA gzg_ptr;
1281  const int drag_action = RNA_enum_get(&gzg_ptr, "drag_action");
1282  const char *op_id = NULL;
1283  switch (drag_action) {
1285  op_id = "TRANSFORM_OT_translate";
1286  break;
1288  op_id = "TRANSFORM_OT_rotate";
1289  break;
1291  op_id = "TRANSFORM_OT_resize";
1292  break;
1293  default:
1294  break;
1295  }
1296  if (op_id) {
1297  wmOperatorType *ot = WM_operatortype_find(op_id, true);
1298  PointerRNA op_ptr;
1300  RNA_boolean_set(&op_ptr, "release_confirm", true);
1302  WM_operator_properties_free(&op_ptr);
1303  return OPERATOR_FINISHED;
1304  }
1305  }
1306  }
1307  return OPERATOR_PASS_THROUGH;
1308 }
1309 
1310 /* Use with 'TRANSFORM_GGT_gizmo'. */
1312 {
1313  /* identifiers */
1314  ot->name = "Transform from Gizmo";
1315  ot->description = "Transform selected items by mode type";
1316  ot->idname = "TRANSFORM_OT_from_gizmo";
1317  ot->flag = 0;
1318 
1319  /* api callbacks */
1321 }
1322 
1324 {
1325  TransformModeItem *tmode;
1326 
1327  for (tmode = transform_modes; tmode->idname; tmode++) {
1329  }
1330 
1332 
1336 
1338 }
1339 
1341 {
1342  wmKeyMap *modalmap = transform_modal_keymap(keyconf);
1343 
1344  TransformModeItem *tmode;
1345 
1346  for (tmode = transform_modes; tmode->idname; tmode++) {
1347  WM_modalkeymap_assign(modalmap, tmode->idname);
1348  }
1349  WM_modalkeymap_assign(modalmap, "TRANSFORM_OT_transform");
1350 }
struct ScrArea * CTX_wm_area(const bContext *C)
Definition: context.c:714
struct Scene * CTX_data_scene(const bContext *C)
Definition: context.c:1034
struct Object * CTX_data_edit_object(const bContext *C)
Definition: context.c:1296
struct View3D * CTX_wm_view3d(const bContext *C)
Definition: context.c:760
struct wmMsgBus * CTX_wm_message_bus(const bContext *C)
Definition: context.c:746
struct ARegion * CTX_wm_region(const bContext *C)
Definition: context.c:725
BMEditMesh * BKE_editmesh_from_object(struct Object *ob)
Return the BMEditMesh for a given object.
Definition: editmesh.c:85
void BKE_report(ReportList *reports, ReportType type, const char *message)
Definition: report.c:104
void BKE_scene_orientation_slot_set_index(struct TransformOrientationSlot *orient_slot, int orientation)
Definition: scene.c:2517
#define BLI_assert(a)
Definition: BLI_assert.h:58
#define M_PI
Definition: BLI_math_base.h:38
MINLINE bool is_zero_v4(const float a[4]) ATTR_WARN_UNUSED_RESULT
#define STRPREFIX(a, b)
#define UNUSED(x)
#define UNLIKELY(x)
#define ELEM(...)
#define STREQ(a, b)
#define BLT_I18NCONTEXT_ID_CURVE
#define IFACE_(msgid)
#define MAX_NAME
Definition: DNA_defs.h:62
Object is a sort of wrapper for general info.
#define SCE_SNAP_TARGET_ACTIVE
#define SCE_SELECT_FACE
#define SCE_SELECT_VERTEX
@ SCE_ORIENT_DEFAULT
#define SCE_SELECT_EDGE
@ SPACE_ACTION
@ V3D_ORIENT_CUSTOM
@ V3D_GIZMO_SHOW_OBJECT_ROTATE
@ V3D_GIZMO_SHOW_OBJECT_SCALE
@ V3D_GIZMO_SHOW_OBJECT_TRANSLATE
@ OPERATOR_CANCELLED
@ OPERATOR_INTERFACE
@ OPERATOR_FINISHED
@ OPERATOR_RUNNING_MODAL
@ OPERATOR_PASS_THROUGH
@ OP_IS_MODAL_GRAB_CURSOR
void EDBM_selectmode_set(struct BMEditMesh *em)
bool ED_operator_editmesh_region_view3d(struct bContext *C)
Definition: screen_ops.c:418
bool ED_operator_editcurve_3d(struct bContext *C)
Definition: screen_ops.c:569
bool ED_operator_sequencer_active(struct bContext *C)
Definition: screen_ops.c:319
bool ED_operator_areaactive(struct bContext *C)
Definition: screen_ops.c:119
bool ED_operator_screenactive(struct bContext *C)
Definition: screen_ops.c:133
bool ED_operator_view3d_active(struct bContext *C)
Definition: screen_ops.c:230
bool ED_operator_editmesh(struct bContext *C)
Definition: screen_ops.c:404
bool ED_operator_object_active(struct bContext *C)
Definition: screen_ops.c:355
bool ED_operator_region_view3d_active(struct bContext *C)
Definition: screen_ops.c:235
#define P_PROPORTIONAL
Definition: ED_transform.h:124
#define P_CURSOR_EDIT
Definition: ED_transform.h:138
#define P_CENTER
Definition: ED_transform.h:136
#define P_ALIGN_SNAP
Definition: ED_transform.h:130
#define P_NO_DEFAULTS
Definition: ED_transform.h:134
#define P_POST_TRANSFORM
Definition: ED_transform.h:141
#define P_CORRECT_UV
Definition: ED_transform.h:133
eTfmMode
Definition: ED_transform.h:43
@ TFM_RESIZE
Definition: ED_transform.h:48
@ TFM_EDGE_SLIDE
Definition: ED_transform.h:74
@ TFM_BONESIZE
Definition: ED_transform.h:59
@ TFM_SKIN_RESIZE
Definition: ED_transform.h:49
@ TFM_SHEAR
Definition: ED_transform.h:51
@ TFM_SHRINKFATTEN
Definition: ED_transform.h:53
@ TFM_TIME_TRANSLATE
Definition: ED_transform.h:65
@ TFM_TIME_SLIDE
Definition: ED_transform.h:66
@ TFM_BAKE_TIME
Definition: ED_transform.h:70
@ TFM_VERT_SLIDE
Definition: ED_transform.h:75
@ TFM_CREASE
Definition: ED_transform.h:57
@ TFM_BEND
Definition: ED_transform.h:52
@ TFM_ROTATION
Definition: ED_transform.h:47
@ TFM_BONE_ENVELOPE
Definition: ED_transform.h:60
@ TFM_BWEIGHT
Definition: ED_transform.h:72
@ TFM_ALIGN
Definition: ED_transform.h:73
@ TFM_TIME_SCALE
Definition: ED_transform.h:67
@ TFM_BONE_ROLL
Definition: ED_transform.h:64
@ TFM_TIME_EXTEND
Definition: ED_transform.h:68
@ TFM_GPENCIL_SHRINKFATTEN
Definition: ED_transform.h:63
@ TFM_CURVE_SHRINKFATTEN
Definition: ED_transform.h:61
@ TFM_TILT
Definition: ED_transform.h:54
@ TFM_INIT
Definition: ED_transform.h:44
@ TFM_SEQ_SLIDE
Definition: ED_transform.h:76
@ TFM_TOSPHERE
Definition: ED_transform.h:50
@ TFM_GPENCIL_OPACITY
Definition: ED_transform.h:79
@ TFM_MIRROR
Definition: ED_transform.h:58
@ TFM_TRANSLATION
Definition: ED_transform.h:46
@ TFM_MASK_SHRINKFATTEN
Definition: ED_transform.h:62
@ TFM_BONE_ENVELOPE_DIST
Definition: ED_transform.h:77
@ TFM_NORMAL_ROTATION
Definition: ED_transform.h:78
@ TFM_DUMMY
Definition: ED_transform.h:45
@ TFM_PUSHPULL
Definition: ED_transform.h:56
@ TFM_TRACKBALL
Definition: ED_transform.h:55
#define P_ORIENT_MATRIX
Definition: ED_transform.h:127
void BIF_removeTransformOrientationIndex(struct bContext *C, int index)
#define P_ORIENT_AXIS_ORTHO
Definition: ED_transform.h:126
#define P_NO_TEXSPACE
Definition: ED_transform.h:135
#define P_MIRROR
Definition: ED_transform.h:122
#define P_CONSTRAINT
Definition: ED_transform.h:131
#define P_SNAP
Definition: ED_transform.h:128
#define P_GEO_SNAP
Definition: ED_transform.h:129
#define P_GPENCIL_EDIT
Definition: ED_transform.h:137
#define P_ORIENT_AXIS
Definition: ED_transform.h:125
#define P_MIRROR_DUMMY
Definition: ED_transform.h:123
#define P_OPTIONS
Definition: ED_transform.h:132
bool BIF_createTransformOrientation(struct bContext *C, struct ReportList *reports, const char *name, const bool use_view, const bool activate, const bool overwrite)
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble y2 _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat y2 _GL_VOID_RET _GL_VOID GLint GLint GLint y2 _GL_VOID_RET _GL_VOID GLshort GLshort GLshort y2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLuint *buffer _GL_VOID_RET _GL_VOID GLdouble t _GL_VOID_RET _GL_VOID GLfloat t _GL_VOID_RET _GL_VOID GLint t _GL_VOID_RET _GL_VOID GLshort t _GL_VOID_RET _GL_VOID GLdouble t
Read Guarded memory(de)allocation.
const EnumPropertyItem * rna_TransformOrientation_itemf(struct bContext *C, struct PointerRNA *ptr, struct PropertyRNA *prop, bool *r_free)
@ PROP_FLOAT
Definition: RNA_types.h:75
@ PROP_ENUM
Definition: RNA_types.h:77
@ PROP_SKIP_SAVE
Definition: RNA_types.h:204
@ PROP_HIDDEN
Definition: RNA_types.h:202
@ PROP_XYZ
Definition: RNA_types.h:148
@ PROP_NONE
Definition: RNA_types.h:113
#define C
Definition: RandGen.cpp:39
struct uiLayout * UI_popup_menu_layout(uiPopupMenu *pup)
void uiItemsEnumO(uiLayout *layout, const char *opname, const char *propname)
void UI_popup_menu_end(struct bContext *C, struct uiPopupMenu *pup)
uiPopupMenu * UI_popup_menu_begin(struct bContext *C, const char *title, int icon) ATTR_NONNULL()
#define WM_toolsystem_ref_properties_ensure_from_gizmo_group(tref, gzgroup, r_ptr)
@ OPTYPE_BLOCKING
Definition: WM_types.h:157
@ OPTYPE_UNDO
Definition: WM_types.h:155
@ OPTYPE_REGISTER
Definition: WM_types.h:153
@ WM_OP_INVOKE_DEFAULT
Definition: WM_types.h:197
#define NC_SCENE
Definition: WM_types.h:279
#define ND_TOOLSETTINGS
Definition: WM_types.h:349
#define NA_EDITED
Definition: WM_types.h:462
#define ND_TRANSFORM
Definition: WM_types.h:357
#define ND_SPACE_VIEW3D
Definition: WM_types.h:423
#define NC_OBJECT
Definition: WM_types.h:280
#define NC_SPACE
Definition: WM_types.h:293
Scene scene
void(* MEM_freeN)(void *vmemh)
Definition: mallocn.c:41
void *(* MEM_callocN)(size_t len, const char *str)
Definition: mallocn.c:45
static void area(int d1, int d2, int e1, int e2, float weights[2])
const char * RNA_property_identifier(const PropertyRNA *prop)
Definition: rna_access.c:1145
void RNA_boolean_set(PointerRNA *ptr, const char *name, bool value)
Definition: rna_access.c:6272
bool RNA_property_is_set(PointerRNA *ptr, PropertyRNA *prop)
Definition: rna_access.c:6655
void RNA_property_boolean_get_array(PointerRNA *ptr, PropertyRNA *prop, bool *values)
Definition: rna_access.c:2420
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
Definition: rna_access.c:866
bool RNA_property_boolean_get(PointerRNA *ptr, PropertyRNA *prop)
Definition: rna_access.c:2331
void RNA_string_get(PointerRNA *ptr, const char *name, char *value)
Definition: rna_access.c:6514
bool RNA_struct_property_is_set(PointerRNA *ptr, const char *identifier)
Definition: rna_access.c:6685
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
Definition: rna_access.c:6261
int RNA_enum_get(PointerRNA *ptr, const char *name)
Definition: rna_access.c:6402
PropertyRNA * RNA_def_float(StructOrFunctionRNA *cont_, const char *identifier, float default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax)
Definition: rna_define.c:3825
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, bool default_value, const char *ui_name, const char *ui_description)
Definition: rna_define.c:3481
PropertyRNA * RNA_def_float_matrix(StructOrFunctionRNA *cont_, const char *identifier, int rows, int columns, const float *default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax)
Definition: rna_define.c:3943
void RNA_def_property_enum_default(PropertyRNA *prop, int value)
Definition: rna_define.c:2127
PropertyRNA * RNA_def_float_distance(StructOrFunctionRNA *cont_, const char *identifier, float default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax)
Definition: rna_define.c:4041
void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *description)
Definition: rna_define.c:1676
PropertyRNA * RNA_def_float_vector(StructOrFunctionRNA *cont_, const char *identifier, int len, const float *default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax)
Definition: rna_define.c:3851
PropertyRNA * RNA_def_boolean_vector(StructOrFunctionRNA *cont_, const char *identifier, int len, bool *default_value, const char *ui_name, const char *ui_description)
Definition: rna_define.c:3563
void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item)
Definition: rna_define.c:1892
void RNA_def_property_array(PropertyRNA *prop, int length)
Definition: rna_define.c:1568
PropertyRNA * RNA_def_float_factor(StructOrFunctionRNA *cont_, const char *identifier, float default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax)
Definition: rna_define.c:4133
PropertyRNA * RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier, int type, int subtype)
Definition: rna_define.c:1279
PropertyRNA * RNA_def_float_translation(StructOrFunctionRNA *cont_, const char *identifier, int len, const float *default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax)
Definition: rna_define.c:3975
PropertyRNA * RNA_def_string(StructOrFunctionRNA *cont_, const char *identifier, const char *default_value, int maxlen, const char *ui_name, const char *ui_description)
Definition: rna_define.c:3675
void RNA_def_property_translation_context(PropertyRNA *prop, const char *context)
Definition: rna_define.c:2870
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
Definition: rna_define.c:1512
void RNA_def_enum_funcs(PropertyRNA *prop, EnumPropertyItemFunc itemfunc)
Definition: rna_define.c:3819
void RNA_def_property_ui_range(PropertyRNA *prop, double min, double max, double step, int precision)
Definition: rna_define.c:1706
PropertyRNA * RNA_def_float_rotation(StructOrFunctionRNA *cont_, const char *identifier, int len, const float *default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax)
Definition: rna_define.c:4005
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, int default_value, const char *ui_name, const char *ui_description)
Definition: rna_define.c:3771
const EnumPropertyItem rna_enum_axis_xyz_items[]
Definition: rna_modifier.c:584
const EnumPropertyItem rna_enum_snap_target_items[]
Definition: rna_scene.c:107
const EnumPropertyItem rna_enum_proportional_falloff_items[]
Definition: rna_scene.c:115
struct wmGizmoMap * gizmo_map
short selectmode
Definition: BKE_editmesh.h:72
struct ToolSettings * toolsettings
TransformOrientationSlot orientation_slots[4]
void(* opfunc)(wmOperatorType *)
Definition: transform_ops.c:59
const char * idname
Definition: transform_ops.c:57
short type
Definition: WM_types.h:577
struct wmGizmoGroupType * type
int(* invoke)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
Definition: WM_types.h:752
const char * name
Definition: WM_types.h:721
int(* modal)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
Definition: WM_types.h:768
const char * idname
Definition: WM_types.h:723
bool(* poll)(struct bContext *) ATTR_WARN_UNUSED_RESULT
Definition: WM_types.h:776
bool(* poll_property)(const struct bContext *C, struct wmOperator *op, const PropertyRNA *prop) ATTR_WARN_UNUSED_RESULT
Definition: WM_types.h:782
void(* cancel)(struct bContext *, struct wmOperator *)
Definition: WM_types.h:760
struct StructRNA * srna
Definition: WM_types.h:802
const char * description
Definition: WM_types.h:726
int(* exec)(struct bContext *, struct wmOperator *) ATTR_WARN_UNUSED_RESULT
Definition: WM_types.h:736
struct ReportList * reports
struct wmOperator * prev
struct wmOperatorType * type
struct PointerRNA * ptr
struct wmOperator * opm
wmKeyMap * transform_modal_keymap(wmKeyConfig *keyconf)
Definition: transform.c:657
void transformApply(bContext *C, TransInfo *t)
Definition: transform.c:1891
void saveTransform(bContext *C, TransInfo *t, wmOperator *op)
Definition: transform.c:1426
bool initTransform(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *event, int mode)
Definition: transform.c:1641
int transformEvent(TransInfo *t, const wmEvent *event)
Definition: transform.c:818
int transformEnd(bContext *C, TransInfo *t)
Definition: transform.c:1925
@ TARGET_INIT
Definition: transform.h:167
@ CTX_AUTOCONFIRM
Definition: transform.h:92
@ TRANS_CANCEL
Definition: transform.h:193
int special_transform_moving(TransInfo *t)
conversion and adaptation of different datablocks to a common struct.
#define T_PROP_SIZE_MIN
#define T_PROP_SIZE_MAX
static void TRANSFORM_OT_trackball(struct wmOperatorType *ot)
static bool delete_orientation_poll(bContext *C)
static int delete_orientation_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
static void TRANSFORM_OT_from_gizmo(struct wmOperatorType *ot)
static const char OP_ROTATION[]
Definition: transform_ops.c:65
static const char OP_TILT[]
Definition: transform_ops.c:73
static void TRANSFORM_OT_rotate_normal(struct wmOperatorType *ot)
static const char OP_TOSPHERE[]
Definition: transform_ops.c:66
static void transformops_loopsel_hack(bContext *C, wmOperator *op)
static const char OP_RESIZE[]
Definition: transform_ops.c:67
static const char OP_MIRROR[]
Definition: transform_ops.c:75
struct TransformModeItem TransformModeItem
static void TRANSFORM_OT_delete_orientation(struct wmOperatorType *ot)
static const char OP_SKIN_RESIZE[]
Definition: transform_ops.c:68
static const char OP_SHEAR[]
Definition: transform_ops.c:69
static bool transform_poll_property(const bContext *UNUSED(C), wmOperator *op, const PropertyRNA *prop)
void Transform_Properties(struct wmOperatorType *ot, int flags)
static const char OP_EDGE_BWEIGHT[]
Definition: transform_ops.c:80
static void TRANSFORM_OT_transform(struct wmOperatorType *ot)
static void TRANSFORM_OT_push_pull(struct wmOperatorType *ot)
static void TRANSFORM_OT_seq_slide(struct wmOperatorType *ot)
static void TRANSFORM_OT_shear(struct wmOperatorType *ot)
static int transform_from_gizmo_invoke(bContext *C, wmOperator *UNUSED(op), const wmEvent *UNUSED(event))
static TransformModeItem transform_modes[]
static const char OP_EDGE_SLIDE[]
Definition: transform_ops.c:77
void transform_operatortypes(void)
static void TRANSFORM_OT_select_orientation(struct wmOperatorType *ot)
static int transform_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static const char OP_EDGE_CREASE[]
Definition: transform_ops.c:79
static void TRANSFORM_OT_shrink_fatten(struct wmOperatorType *ot)
static const float VecOne[3]
Definition: transform_ops.c:62
static bool transform_shear_poll(bContext *C)
static void TRANSFORM_OT_rotate(struct wmOperatorType *ot)
static const char OP_TRANSLATION[]
Definition: transform_ops.c:64
static bool transform_rotate_poll(bContext *C)
static void TRANSFORM_OT_edge_bevelweight(struct wmOperatorType *ot)
static int transform_exec(bContext *C, wmOperator *op)
static void TRANSFORM_OT_vert_slide(struct wmOperatorType *ot)
static int transform_modal(bContext *C, wmOperator *op, const wmEvent *event)
static const char OP_PUSH_PULL[]
Definition: transform_ops.c:72
static const char OP_SEQ_SLIDE[]
Definition: transform_ops.c:81
static void TRANSFORM_OT_bend(struct wmOperatorType *ot)
static void transform_cancel(bContext *C, wmOperator *op)
static void TRANSFORM_OT_bbone_resize(struct wmOperatorType *ot)
static const char OP_BEND[]
Definition: transform_ops.c:70
const EnumPropertyItem rna_enum_transform_mode_types[]
static int create_orientation_exec(bContext *C, wmOperator *op)
static const char OP_TRACKBALL[]
Definition: transform_ops.c:74
static int select_orientation_exec(bContext *C, wmOperator *op)
static void transformops_exit(bContext *C, wmOperator *op)
static void TRANSFORM_OT_skin_resize(struct wmOperatorType *ot)
static void TRANSFORM_OT_translate(struct wmOperatorType *ot)
static const char OP_SHRINK_FATTEN[]
Definition: transform_ops.c:71
void ED_keymap_transform(wmKeyConfig *keyconf)
static void TRANSFORM_OT_mirror(struct wmOperatorType *ot)
static const char OP_NORMAL_ROTATION[]
Definition: transform_ops.c:82
static int select_orientation_invoke(bContext *C, wmOperator *UNUSED(op), const wmEvent *UNUSED(event))
static void TRANSFORM_OT_edge_slide(struct wmOperatorType *ot)
static int delete_orientation_exec(bContext *C, wmOperator *UNUSED(op))
static void TRANSFORM_OT_create_orientation(struct wmOperatorType *ot)
static const char OP_BONE_SIZE[]
Definition: transform_ops.c:76
static void TRANSFORM_OT_edge_crease(struct wmOperatorType *ot)
static void TRANSFORM_OT_tilt(struct wmOperatorType *ot)
static void TRANSFORM_OT_resize(struct wmOperatorType *ot)
static int transformops_data(bContext *C, wmOperator *op, const wmEvent *event)
static const char OP_VERT_SLIDE[]
Definition: transform_ops.c:78
static void TRANSFORM_OT_tosphere(struct wmOperatorType *ot)
#define G(x, y, z)
void WM_operator_type_set(wmOperator *op, wmOperatorType *ot)
Definition: wm.c:345
wmEventHandler_Op * WM_event_add_modal_handler(bContext *C, wmOperator *op)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
int WM_operator_name_call_ptr(bContext *C, wmOperatorType *ot, short context, PointerRNA *properties)
@ NDOF_MOTION
wmOperatorType * ot
Definition: wm_files.c:3156
wmGizmoGroup * WM_gizmomap_group_find(struct wmGizmoMap *gzmap, const char *idname)
Definition: wm_gizmo_map.c:219
void WM_modalkeymap_assign(wmKeyMap *km, const char *opname)
Definition: wm_keymap.c:985
#define WM_msg_publish_rna_prop(mbus, id_, data_, type_, prop_)
void WM_operatortype_props_advanced_begin(wmOperatorType *ot)
wmOperatorType * WM_operatortype_find(const char *idname, bool quiet)
void WM_operatortype_append(void(*opfunc)(wmOperatorType *))
void WM_operator_properties_create_ptr(PointerRNA *ptr, wmOperatorType *ot)
Definition: wm_operators.c:584
void WM_operator_properties_free(PointerRNA *ptr)
Definition: wm_operators.c:711
struct bToolRef * WM_toolsystem_ref_from_context(struct bContext *C)
Definition: wm_toolsystem.c:71