Blender  V3.3
transform_ops.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
7 #include "MEM_guardedalloc.h"
8 
9 #include "DNA_object_types.h"
10 #include "DNA_scene_types.h"
11 
12 #include "BLI_math.h"
13 #include "BLI_utildefines.h"
14 
15 #include "BLT_translation.h"
16 
17 #include "BKE_context.h"
18 #include "BKE_editmesh.h"
19 #include "BKE_global.h"
20 #include "BKE_report.h"
21 #include "BKE_scene.h"
22 
23 #include "RNA_access.h"
24 #include "RNA_define.h"
25 #include "RNA_enum_types.h"
26 
27 #include "WM_api.h"
28 #include "WM_message.h"
29 #include "WM_toolsystem.h"
30 #include "WM_types.h"
31 
32 #include "UI_interface.h"
33 #include "UI_resources.h"
34 
35 #include "ED_screen.h"
36 /* for USE_LOOPSLIDE_HACK only */
37 #include "ED_mesh.h"
38 
39 #include "transform.h"
40 #include "transform_convert.h"
41 
42 typedef struct TransformModeItem {
43  const char *idname;
44  int mode;
47 
48 static const float VecZero[3] = {0, 0, 0};
49 static const float VecOne[3] = {1, 1, 1};
50 
51 static const char OP_TRANSLATION[] = "TRANSFORM_OT_translate";
52 static const char OP_ROTATION[] = "TRANSFORM_OT_rotate";
53 static const char OP_TOSPHERE[] = "TRANSFORM_OT_tosphere";
54 static const char OP_RESIZE[] = "TRANSFORM_OT_resize";
55 static const char OP_SKIN_RESIZE[] = "TRANSFORM_OT_skin_resize";
56 static const char OP_SHEAR[] = "TRANSFORM_OT_shear";
57 static const char OP_BEND[] = "TRANSFORM_OT_bend";
58 static const char OP_SHRINK_FATTEN[] = "TRANSFORM_OT_shrink_fatten";
59 static const char OP_PUSH_PULL[] = "TRANSFORM_OT_push_pull";
60 static const char OP_TILT[] = "TRANSFORM_OT_tilt";
61 static const char OP_TRACKBALL[] = "TRANSFORM_OT_trackball";
62 static const char OP_MIRROR[] = "TRANSFORM_OT_mirror";
63 static const char OP_BONE_SIZE[] = "TRANSFORM_OT_bbone_resize";
64 static const char OP_EDGE_SLIDE[] = "TRANSFORM_OT_edge_slide";
65 static const char OP_VERT_SLIDE[] = "TRANSFORM_OT_vert_slide";
66 static const char OP_EDGE_CREASE[] = "TRANSFORM_OT_edge_crease";
67 static const char OP_VERT_CREASE[] = "TRANSFORM_OT_vert_crease";
68 static const char OP_EDGE_BWEIGHT[] = "TRANSFORM_OT_edge_bevelweight";
69 static const char OP_SEQ_SLIDE[] = "TRANSFORM_OT_seq_slide";
70 static const char OP_NORMAL_ROTATION[] = "TRANSFORM_OT_rotate_normal";
71 
72 static void TRANSFORM_OT_translate(struct wmOperatorType *ot);
73 static void TRANSFORM_OT_rotate(struct wmOperatorType *ot);
74 static void TRANSFORM_OT_tosphere(struct wmOperatorType *ot);
75 static void TRANSFORM_OT_resize(struct wmOperatorType *ot);
76 static void TRANSFORM_OT_skin_resize(struct wmOperatorType *ot);
77 static void TRANSFORM_OT_shear(struct wmOperatorType *ot);
78 static void TRANSFORM_OT_bend(struct wmOperatorType *ot);
79 static void TRANSFORM_OT_shrink_fatten(struct wmOperatorType *ot);
80 static void TRANSFORM_OT_push_pull(struct wmOperatorType *ot);
81 static void TRANSFORM_OT_tilt(struct wmOperatorType *ot);
82 static void TRANSFORM_OT_trackball(struct wmOperatorType *ot);
83 static void TRANSFORM_OT_mirror(struct wmOperatorType *ot);
84 static void TRANSFORM_OT_bbone_resize(struct wmOperatorType *ot);
85 static void TRANSFORM_OT_edge_slide(struct wmOperatorType *ot);
86 static void TRANSFORM_OT_vert_slide(struct wmOperatorType *ot);
87 static void TRANSFORM_OT_edge_crease(struct wmOperatorType *ot);
88 static void TRANSFORM_OT_vert_crease(struct wmOperatorType *ot);
90 static void TRANSFORM_OT_seq_slide(struct wmOperatorType *ot);
91 static void TRANSFORM_OT_rotate_normal(struct wmOperatorType *ot);
92 
114  {NULL, 0},
115 };
116 
118  {TFM_INIT, "INIT", 0, "Init", ""},
119  {TFM_DUMMY, "DUMMY", 0, "Dummy", ""},
120  {TFM_TRANSLATION, "TRANSLATION", 0, "Translation", ""},
121  {TFM_ROTATION, "ROTATION", 0, "Rotation", ""},
122  {TFM_RESIZE, "RESIZE", 0, "Resize", ""},
123  {TFM_SKIN_RESIZE, "SKIN_RESIZE", 0, "Skin Resize", ""},
124  {TFM_TOSPHERE, "TOSPHERE", 0, "To Sphere", ""},
125  {TFM_SHEAR, "SHEAR", 0, "Shear", ""},
126  {TFM_BEND, "BEND", 0, "Bend", ""},
127  {TFM_SHRINKFATTEN, "SHRINKFATTEN", 0, "Shrink/Fatten", ""},
128  {TFM_TILT, "TILT", 0, "Tilt", ""},
129  {TFM_TRACKBALL, "TRACKBALL", 0, "Trackball", ""},
130  {TFM_PUSHPULL, "PUSHPULL", 0, "Push/Pull", ""},
131  {TFM_EDGE_CREASE, "CREASE", 0, "Crease", ""},
132  {TFM_VERT_CREASE, "VERTEX_CREASE", 0, "Vertex Crease", ""},
133  {TFM_MIRROR, "MIRROR", 0, "Mirror", ""},
134  {TFM_BONESIZE, "BONE_SIZE", 0, "Bone Size", ""},
135  {TFM_BONE_ENVELOPE, "BONE_ENVELOPE", 0, "Bone Envelope", ""},
136  {TFM_BONE_ENVELOPE_DIST, "BONE_ENVELOPE_DIST", 0, "Bone Envelope Distance", ""},
137  {TFM_CURVE_SHRINKFATTEN, "CURVE_SHRINKFATTEN", 0, "Curve Shrink/Fatten", ""},
138  {TFM_MASK_SHRINKFATTEN, "MASK_SHRINKFATTEN", 0, "Mask Shrink/Fatten", ""},
139  {TFM_GPENCIL_SHRINKFATTEN, "GPENCIL_SHRINKFATTEN", 0, "Grease Pencil Shrink/Fatten", ""},
140  {TFM_BONE_ROLL, "BONE_ROLL", 0, "Bone Roll", ""},
141  {TFM_TIME_TRANSLATE, "TIME_TRANSLATE", 0, "Time Translate", ""},
142  {TFM_TIME_SLIDE, "TIME_SLIDE", 0, "Time Slide", ""},
143  {TFM_TIME_SCALE, "TIME_SCALE", 0, "Time Scale", ""},
144  {TFM_TIME_EXTEND, "TIME_EXTEND", 0, "Time Extend", ""},
145  {TFM_BAKE_TIME, "BAKE_TIME", 0, "Bake Time", ""},
146  {TFM_BWEIGHT, "BWEIGHT", 0, "Bevel Weight", ""},
147  {TFM_ALIGN, "ALIGN", 0, "Align", ""},
148  {TFM_EDGE_SLIDE, "EDGESLIDE", 0, "Edge Slide", ""},
149  {TFM_SEQ_SLIDE, "SEQSLIDE", 0, "Sequence Slide", ""},
150  {TFM_GPENCIL_OPACITY, "GPENCIL_OPACITY", 0, "Grease Pencil Opacity", ""},
151  {0, NULL, 0, NULL, NULL},
152 };
153 
155 {
157 
158  int orientation = RNA_enum_get(op->ptr, "orientation");
159 
161 
164 
165  struct wmMsgBus *mbus = CTX_wm_message_bus(C);
167 
168  return OPERATOR_FINISHED;
169 }
170 
172  wmOperator *UNUSED(op),
173  const wmEvent *UNUSED(event))
174 {
175  uiPopupMenu *pup;
176  uiLayout *layout;
177 
178  pup = UI_popup_menu_begin(C, IFACE_("Orientation"), ICON_NONE);
179  layout = UI_popup_menu_layout(pup);
180  uiItemsEnumO(layout, "TRANSFORM_OT_select_orientation", "orientation");
181  UI_popup_menu_end(C, pup);
182 
183  return OPERATOR_INTERFACE;
184 }
185 
187 {
188  PropertyRNA *prop;
189 
190  /* identifiers */
191  ot->name = "Select Orientation";
192  ot->description = "Select transformation orientation";
193  ot->idname = "TRANSFORM_OT_select_orientation";
194  ot->flag = OPTYPE_UNDO;
195 
196  /* api callbacks */
200 
201  prop = RNA_def_property(ot->srna, "orientation", PROP_ENUM, PROP_NONE);
202  RNA_def_property_ui_text(prop, "Orientation", "Transformation orientation");
204 }
205 
207 {
211 
213 
214  struct wmMsgBus *mbus = CTX_wm_message_bus(C);
215  WM_msg_publish_rna_prop(mbus, &scene->id, scene, Scene, transform_orientation_slots);
216 
217  return OPERATOR_FINISHED;
218 }
219 
221 {
222  return delete_orientation_exec(C, op);
223 }
224 
226 {
227  if (ED_operator_areaactive(C) == 0) {
228  return 0;
229  }
230 
234 }
235 
237 {
238  /* identifiers */
239  ot->name = "Delete Orientation";
240  ot->description = "Delete transformation orientation";
241  ot->idname = "TRANSFORM_OT_delete_orientation";
242  ot->flag = OPTYPE_UNDO;
243 
244  /* api callbacks */
248 }
249 
251 {
252  char name[MAX_NAME];
253  const bool use = RNA_boolean_get(op->ptr, "use");
254  const bool overwrite = RNA_boolean_get(op->ptr, "overwrite");
255  const bool use_view = RNA_boolean_get(op->ptr, "use_view");
256  View3D *v3d = CTX_wm_view3d(C);
258 
259  RNA_string_get(op->ptr, "name", name);
260 
261  if (use && !v3d) {
262  BKE_report(op->reports,
263  RPT_ERROR,
264  "Create Orientation's 'use' parameter only valid in a 3DView context");
265  return OPERATOR_CANCELLED;
266  }
267 
268  if (!BIF_createTransformOrientation(C, op->reports, name, use_view, use, overwrite)) {
269  BKE_report(op->reports, RPT_ERROR, "Unable to create orientation");
270  return OPERATOR_CANCELLED;
271  }
272 
273  if (use) {
274  struct wmMsgBus *mbus = CTX_wm_message_bus(C);
275  WM_msg_publish_rna_prop(mbus, &scene->id, scene, Scene, transform_orientation_slots);
277  }
278 
280 
281  return OPERATOR_FINISHED;
282 }
283 
285 {
286  /* identifiers */
287  ot->name = "Create Orientation";
288  ot->description = "Create transformation orientation from selection";
289  ot->idname = "TRANSFORM_OT_create_orientation";
291 
292  /* api callbacks */
295 
296  RNA_def_string(ot->srna, "name", NULL, MAX_NAME, "Name", "Name of the new custom orientation");
298  ot->srna,
299  "use_view",
300  false,
301  "Use View",
302  "Use the current view instead of the active object to create the new orientation");
303 
305 
307  ot->srna, "use", false, "Use After Creation", "Select orientation after its creation");
309  "overwrite",
310  false,
311  "Overwrite Previous",
312  "Overwrite previously created orientation with same name");
313 }
314 
315 #ifdef USE_LOOPSLIDE_HACK
322 {
323  if (op->type->idname == OP_EDGE_SLIDE) {
324  if (op->opm && op->opm->opm && op->opm->opm->prev) {
325  wmOperator *op_prev = op->opm->opm->prev;
327  bool mesh_select_mode[3];
328  PropertyRNA *prop = RNA_struct_find_property(op_prev->ptr, "mesh_select_mode_init");
329 
330  if (prop && RNA_property_is_set(op_prev->ptr, prop)) {
332  short selectmode_orig;
333 
334  RNA_property_boolean_get_array(op_prev->ptr, prop, mesh_select_mode);
335  selectmode_orig = ((mesh_select_mode[0] ? SCE_SELECT_VERTEX : 0) |
336  (mesh_select_mode[1] ? SCE_SELECT_EDGE : 0) |
337  (mesh_select_mode[2] ? SCE_SELECT_FACE : 0));
338 
339  /* Still switch if we were originally in face select mode. */
340  if ((ts->selectmode != selectmode_orig) && (selectmode_orig != SCE_SELECT_FACE)) {
341  ts->selectmode = selectmode_orig;
342  EDBM_selectmode_set_multi(C, selectmode_orig);
343  }
344  }
345  }
346  }
347 }
348 #else
349 /* prevent removal by cleanup */
350 # error "loopslide hack removed!"
351 #endif /* USE_LOOPSLIDE_HACK */
352 
354 {
355 #ifdef USE_LOOPSLIDE_HACK
357 #endif
358 
359  saveTransform(C, op->customdata, op);
360  MEM_freeN(op->customdata);
361  op->customdata = NULL;
362  G.moving = 0;
363 }
364 
366 {
367  for (TransformModeItem *tmode = transform_modes; tmode->idname; tmode++) {
368  if (op->type->idname == tmode->idname) {
369  return tmode->mode;
370  }
371  }
372 
373  return RNA_enum_get(op->ptr, "mode");
374 }
375 
376 static int transformops_data(bContext *C, wmOperator *op, const wmEvent *event)
377 {
378  int retval = 1;
379  if (op->customdata == NULL) {
380  TransInfo *t = MEM_callocN(sizeof(TransInfo), "TransInfo data2");
381 
382  int mode = transformops_mode(op);
383  retval = initTransform(C, t, op, event, mode);
384 
385  /* store data */
386  if (retval) {
387  G.moving = special_transform_moving(t);
388  op->customdata = t;
389  }
390  else {
391  MEM_freeN(t);
392  }
393  }
394 
395  return retval; /* return 0 on error */
396 }
397 
398 static int transform_modal(bContext *C, wmOperator *op, const wmEvent *event)
399 {
400  int exit_code;
401 
402  TransInfo *t = op->customdata;
403  const eTfmMode mode_prev = t->mode;
404 
405 #if defined(WITH_INPUT_NDOF) && 0
406  /* Stable 2D mouse coords map to different 3D coords while the 3D mouse is active
407  * in other words, 2D deltas are no longer good enough!
408  * disable until individual 'transformers' behave better. */
409 
410  if (event->type == NDOF_MOTION) {
411  return OPERATOR_PASS_THROUGH;
412  }
413 #endif
414 
415  /* XXX insert keys are called here, and require context */
416  t->context = C;
417  exit_code = transformEvent(t, event);
418  t->context = NULL;
419 
420  /* XXX, workaround: active needs to be calculated before transforming,
421  * since we're not reading from 'td->center' in this case. see: T40241 */
422  if (t->tsnap.source_select == SCE_SNAP_SOURCE_ACTIVE) {
423  /* In camera view, tsnap callback is not set
424  * (see #initSnappingMode() in transform_snap.c, and T40348). */
425  if (t->tsnap.targetSnap && ((t->tsnap.status & TARGET_INIT) == 0)) {
426  t->tsnap.targetSnap(t);
427  }
428  }
429 
430  transformApply(C, t);
431 
432  exit_code |= transformEnd(C, t);
433 
434  if ((exit_code & OPERATOR_RUNNING_MODAL) == 0) {
435  transformops_exit(C, op);
436  exit_code &= ~OPERATOR_PASS_THROUGH; /* Preventively remove pass-through. */
437  }
438  else {
439  if (mode_prev != t->mode) {
440  /* WARNING: this is not normal to switch operator types
441  * normally it would not be supported but transform happens
442  * to share callbacks between different operators. */
443  wmOperatorType *ot_new = NULL;
445  while (item->idname) {
446  if (item->mode == t->mode) {
447  ot_new = WM_operatortype_find(item->idname, false);
448  break;
449  }
450  item++;
451  }
452 
453  BLI_assert(ot_new != NULL);
454  if (ot_new) {
455  WM_operator_type_set(op, ot_new);
456  }
457  /* end suspicious code */
458  }
459  }
460 
461  return exit_code;
462 }
463 
465 {
466  TransInfo *t = op->customdata;
467 
468  t->state = TRANS_CANCEL;
469  transformEnd(C, t);
470  transformops_exit(C, op);
471 }
472 
474 {
475  TransInfo *t;
476 
477  if (!transformops_data(C, op, NULL)) {
478  G.moving = 0;
479  return OPERATOR_CANCELLED;
480  }
481 
482  t = op->customdata;
483 
484  t->options |= CTX_AUTOCONFIRM;
485 
486  transformApply(C, t);
487 
488  transformEnd(C, t);
489 
490  transformops_exit(C, op);
491 
493 
494  return OPERATOR_FINISHED;
495 }
496 
497 static int transform_invoke(bContext *C, wmOperator *op, const wmEvent *event)
498 {
499  if (!transformops_data(C, op, event)) {
500  G.moving = 0;
501  return OPERATOR_CANCELLED;
502  }
503 
504  /* When modal, allow 'value' to set initial offset. */
505  if ((event == NULL) && RNA_struct_property_is_set(op->ptr, "value")) {
506  return transform_exec(C, op);
507  }
508 
509  /* add temp handler */
511 
512  /* Use when modal input has some transformation to begin with. */
513  TransInfo *t = op->customdata;
514  if ((t->flag & T_NO_CURSOR_WRAP) == 0) {
515  op->flag |= OP_IS_MODAL_GRAB_CURSOR; /* XXX maybe we want this with the gizmo only? */
516  }
517  if (UNLIKELY(!is_zero_v4(t->values_modal_offset))) {
518  transformApply(C, t);
519  }
520 
521  return OPERATOR_RUNNING_MODAL;
522 }
523 
524 static bool transform_poll_property(const bContext *C, wmOperator *op, const PropertyRNA *prop)
525 {
526  const char *prop_id = RNA_property_identifier(prop);
527 
528  /* Orientation/Constraints. */
529  {
530  /* Hide orientation axis if no constraints are set, since it won't be used. */
531  PropertyRNA *prop_con = RNA_struct_find_property(op->ptr, "orient_type");
532  if (!ELEM(prop_con, NULL, prop)) {
533  if (STRPREFIX(prop_id, "constraint")) {
534 
535  /* Special case: show constraint axis if we don't have values,
536  * needed for mirror operator. */
537  if (STREQ(prop_id, "constraint_axis") &&
538  (RNA_struct_find_property(op->ptr, "value") == NULL)) {
539  return true;
540  }
541 
542  return false;
543  }
544  }
545  }
546 
547  /* Orientation Axis. */
548  {
549  if (STREQ(prop_id, "orient_axis")) {
550  eTfmMode mode = (eTfmMode)transformops_mode(op);
551  if (mode == TFM_ALIGN) {
552  return false;
553  }
554  }
555  }
556 
557  /* Proportional Editing. */
558  if (STRPREFIX(prop_id, "proportional") || STRPREFIX(prop_id, "use_proportional")) {
560  if (area->spacetype == SPACE_NLA) {
561  /* Hide properties that are not supported in some spaces. */
562  return false;
563  }
564 
565  PropertyRNA *prop_pet = RNA_struct_find_property(op->ptr, "use_proportional_edit");
566  if ((prop_pet != prop) && (RNA_property_boolean_get(op->ptr, prop_pet) == false)) {
567  /* If "use_proportional_edit" is false, hide:
568  * - "proportional_edit_falloff",
569  * - "proportional_size",
570  * - "use_proportional_connected",
571  * - "use_proportional_projected". */
572  return false;
573  }
574  }
575 
576  /* Snapping. */
577  {
578  if (STREQ(prop_id, "use_snap_project")) {
579  if (RNA_boolean_get(op->ptr, "snap") == false) {
580  return false;
581  }
582  }
583  }
584 
585  return true;
586 }
587 
588 void Transform_Properties(struct wmOperatorType *ot, int flags)
589 {
590  PropertyRNA *prop;
591 
592  if (flags & P_ORIENT_AXIS) {
593  prop = RNA_def_property(ot->srna, "orient_axis", PROP_ENUM, PROP_NONE);
594  RNA_def_property_ui_text(prop, "Axis", "");
598  }
599  if (flags & P_ORIENT_AXIS_ORTHO) {
600  prop = RNA_def_property(ot->srna, "orient_axis_ortho", PROP_ENUM, PROP_NONE);
601  RNA_def_property_ui_text(prop, "Axis Ortho", "");
605  }
606 
607  if (flags & P_ORIENT_MATRIX) {
608  prop = RNA_def_property(ot->srna, "orient_type", PROP_ENUM, PROP_NONE);
609  RNA_def_property_ui_text(prop, "Orientation", "Transformation orientation");
611 
612  /* Set by 'orient_type' or gizmo which acts on non-standard orientation. */
613  prop = RNA_def_float_matrix(
614  ot->srna, "orient_matrix", 3, 3, NULL, 0.0f, 0.0f, "Matrix", "", 0.0f, 0.0f);
616 
617  /* Only use 'orient_matrix' when 'orient_matrix_type == orient_type',
618  * this allows us to reuse the orientation set by a gizmo for eg, without disabling the ability
619  * to switch over to other orientations. */
620  prop = RNA_def_property(ot->srna, "orient_matrix_type", PROP_ENUM, PROP_NONE);
621  RNA_def_property_ui_text(prop, "Matrix Orientation", "");
624  }
625 
626  if (flags & P_CONSTRAINT) {
627  RNA_def_boolean_vector(ot->srna, "constraint_axis", 3, NULL, "Constraint Axis", "");
628  }
629 
630  if (flags & P_MIRROR) {
631  prop = RNA_def_boolean(ot->srna, "mirror", 0, "Mirror Editing", "");
632  if ((flags & P_MIRROR_DUMMY) == P_MIRROR_DUMMY) {
633  /* only used so macros can disable this option */
635  }
636  }
637 
638  if (flags & P_PROPORTIONAL) {
639  RNA_def_boolean(ot->srna, "use_proportional_edit", 0, "Proportional Editing", "");
640  prop = RNA_def_enum(ot->srna,
641  "proportional_edit_falloff",
643  0,
644  "Proportional Falloff",
645  "Falloff type for proportional editing mode");
646  /* Abusing id_curve :/ */
649  "proportional_size",
650  1,
653  "Proportional Size",
654  "",
655  0.001f,
656  100.0f);
657 
658  RNA_def_boolean(ot->srna, "use_proportional_connected", 0, "Connected", "");
659  RNA_def_boolean(ot->srna, "use_proportional_projected", 0, "Projected (2D)", "");
660  }
661 
662  if (flags & P_SNAP) {
663  prop = RNA_def_boolean(ot->srna, "snap", false, "Use Snapping Options", "");
665 
666  if ((flags & P_GEO_SNAP) == P_GEO_SNAP) {
667  prop = RNA_def_enum(ot->srna,
668  "snap_elements",
671  "Snap to Elements",
672  "");
674 
675  RNA_def_boolean(ot->srna, "use_snap_project", false, "Project Individual Elements", "");
676 
677  /* TODO(@gfxcoder): Rename `snap_target` to `snap_source` to avoid previous ambiguity of
678  * "target" (now, "source" is geometry to be moved and "target" is geometry to which moved
679  * geometry is snapped). Use "Source snap point" and "Point on source that will snap to
680  * target" for name and description, respectively. */
681  prop = RNA_def_enum(ot->srna, "snap_target", rna_enum_snap_source_items, 0, "Snap With", "");
683 
684  /* Target selection. */
685  prop = RNA_def_boolean(ot->srna, "use_snap_self", true, "Target: Include Active", "");
687  prop = RNA_def_boolean(ot->srna, "use_snap_edit", true, "Target: Include Edit", "");
689  prop = RNA_def_boolean(ot->srna, "use_snap_nonedit", true, "Target: Include Non-Edited", "");
691  prop = RNA_def_boolean(
692  ot->srna, "use_snap_selectable", false, "Target: Exclude Non-Selectable", "");
694 
695  prop = RNA_def_float_vector(
696  ot->srna, "snap_point", 3, NULL, -FLT_MAX, FLT_MAX, "Point", "", -FLT_MAX, FLT_MAX);
698 
699  if ((flags & P_ALIGN_SNAP) == P_ALIGN_SNAP) {
700  prop = RNA_def_boolean(ot->srna, "snap_align", false, "Align with Point Normal", "");
702  prop = RNA_def_float_vector(
703  ot->srna, "snap_normal", 3, NULL, -FLT_MAX, FLT_MAX, "Normal", "", -FLT_MAX, FLT_MAX);
705  }
706  }
707  }
708 
709  if (flags & P_GPENCIL_EDIT) {
710  prop = RNA_def_boolean(ot->srna,
711  "gpencil_strokes",
712  0,
713  "Edit Grease Pencil",
714  "Edit selected Grease Pencil strokes");
716  }
717 
718  if (flags & P_CURSOR_EDIT) {
719  prop = RNA_def_boolean(ot->srna, "cursor_transform", 0, "Transform Cursor", "");
721  }
722 
723  if ((flags & P_OPTIONS) && !(flags & P_NO_TEXSPACE)) {
724  prop = RNA_def_boolean(
725  ot->srna, "texture_space", 0, "Edit Texture Space", "Edit object data texture space");
727  prop = RNA_def_boolean(
728  ot->srna, "remove_on_cancel", 0, "Remove on Cancel", "Remove elements on cancel");
730  }
731 
732  if (flags & P_CORRECT_UV) {
734  ot->srna, "correct_uv", true, "Correct UVs", "Correct UV coordinates when transforming");
735  }
736 
737  if (flags & P_CENTER) {
738  /* For gizmos that define their own center. */
739  prop = RNA_def_property(ot->srna, "center_override", PROP_FLOAT, PROP_XYZ);
740  RNA_def_property_array(prop, 3);
742  RNA_def_property_ui_text(prop, "Center Override", "Force using this center value (when set)");
743  }
744 
745  if (flags & P_VIEW2D_EDGE_PAN) {
746  prop = RNA_def_boolean(
747  ot->srna, "view2d_edge_pan", false, "Edge Pan", "Enable edge panning in 2D view");
749  }
750 
751  if ((flags & P_NO_DEFAULTS) == 0) {
752  prop = RNA_def_boolean(ot->srna,
753  "release_confirm",
754  0,
755  "Confirm on Release",
756  "Always confirm operation when releasing button");
758 
759  prop = RNA_def_boolean(ot->srna, "use_accurate", 0, "Accurate", "Use accurate transformation");
761  }
762 
763  if (flags & P_POST_TRANSFORM) {
764  prop = RNA_def_boolean(ot->srna,
765  "use_automerge_and_split",
766  0,
767  "Auto Merge & Split",
768  "Forces the use of Auto Merge and Split");
770  }
771 }
772 
774 {
775  /* identifiers */
776  ot->name = "Move";
777  ot->description = "Move selected items";
780 
781  /* api callbacks */
788 
790  ot->srna, "value", 3, NULL, -FLT_MAX, FLT_MAX, "Move", "", -FLT_MAX, FLT_MAX);
791 
793 
798 }
799 
801 {
802  /* identifiers */
803  ot->name = "Resize";
804  ot->description = "Scale (resize) selected items";
805  ot->idname = OP_RESIZE;
807 
808  /* api callbacks */
815 
817  ot->srna, "value", 3, VecOne, -FLT_MAX, FLT_MAX, "Scale", "", -FLT_MAX, FLT_MAX);
818 
819  PropertyRNA *prop;
820  prop = RNA_def_float_vector(ot->srna,
821  "mouse_dir_constraint",
822  3,
823  VecZero,
824  -FLT_MAX,
825  FLT_MAX,
826  "Mouse Directional Constraint",
827  "",
828  -FLT_MAX,
829  FLT_MAX);
831 
833 
837 }
838 
840 {
841  /* identifiers */
842  ot->name = "Skin Resize";
843  ot->description = "Scale selected vertices' skin radii";
846 
847  /* api callbacks */
854 
856  ot->srna, "value", 3, VecOne, -FLT_MAX, FLT_MAX, "Scale", "", -FLT_MAX, FLT_MAX);
857 
859 
863 }
864 
866 {
867  /* identifiers */
868  ot->name = "Trackball";
869  ot->description = "Trackball style rotation of selected items";
872 
873  /* api callbacks */
880 
881  /* Maybe we could use float_vector_xyz here too? */
883  ot->srna, "value", 2, NULL, -FLT_MAX, FLT_MAX, "Angle", "", -FLT_MAX, FLT_MAX);
884 
886 
888 }
889 
891 {
892  /* identifiers */
893  ot->name = "Rotate";
894  ot->description = "Rotate selected items";
895  ot->idname = OP_ROTATION;
897 
898  /* api callbacks */
905 
907  ot->srna, "value", 0, NULL, -FLT_MAX, FLT_MAX, "Angle", "", -M_PI * 2, M_PI * 2);
908 
910 
914 }
915 
916 static void TRANSFORM_OT_tilt(struct wmOperatorType *ot)
917 {
918  /* identifiers */
919  ot->name = "Tilt";
920  /* optional -
921  * "Tilt selected vertices"
922  * "Specify an extra axis rotation for selected vertices of 3D curve" */
923  ot->description = "Tilt selected control vertices of 3D curve";
924  ot->idname = OP_TILT;
926 
927  /* api callbacks */
934 
936  ot->srna, "value", 0, NULL, -FLT_MAX, FLT_MAX, "Angle", "", -M_PI * 2, M_PI * 2);
937 
939 
941 }
942 
943 static void TRANSFORM_OT_bend(struct wmOperatorType *ot)
944 {
945  /* identifiers */
946  ot->name = "Bend";
947  ot->description = "Bend selected items between the 3D cursor and the mouse";
948  ot->idname = OP_BEND;
949  /* Depend on cursor location because the cursor location is used to define the region to bend. */
951 
952  /* api callbacks */
954  // ot->exec = transform_exec; /* unsupported */
959 
961  ot->srna, "value", 1, NULL, -FLT_MAX, FLT_MAX, "Angle", "", -M_PI * 2, M_PI * 2);
962 
964 
966 }
967 
969 {
970  if (!ED_operator_screenactive(C)) {
971  return false;
972  }
973 
975  return area && !ELEM(area->spacetype, SPACE_ACTION);
976 }
977 
979 {
980  /* identifiers */
981  ot->name = "Shear";
982  ot->description = "Shear selected items along the horizontal screen axis";
983  ot->idname = OP_SHEAR;
985 
986  /* api callbacks */
993 
994  RNA_def_float(ot->srna, "value", 0, -FLT_MAX, FLT_MAX, "Offset", "", -FLT_MAX, FLT_MAX);
995 
997 
1001 }
1002 
1004 {
1005  /* identifiers */
1006  ot->name = "Push/Pull";
1007  ot->description = "Push/Pull selected items";
1008  ot->idname = OP_PUSH_PULL;
1010 
1011  /* api callbacks */
1013  ot->exec = transform_exec;
1018 
1019  RNA_def_float(ot->srna, "value", 0, -FLT_MAX, FLT_MAX, "Distance", "", -FLT_MAX, FLT_MAX);
1020 
1022 
1024 }
1025 
1027 {
1028  /* identifiers */
1029  ot->name = "Shrink/Fatten";
1030  ot->description = "Shrink/fatten selected vertices along normals";
1033 
1034  /* api callbacks */
1036  ot->exec = transform_exec;
1041 
1042  RNA_def_float_distance(ot->srna, "value", 0, -FLT_MAX, FLT_MAX, "Offset", "", -FLT_MAX, FLT_MAX);
1043 
1045  "use_even_offset",
1046  false,
1047  "Offset Even",
1048  "Scale the offset to give more even thickness");
1049 
1051 
1053 }
1054 
1056 {
1057  /* identifiers */
1058  ot->name = "To Sphere";
1059  ot->description = "Move selected items outward in a spherical shape around geometric center";
1060  ot->idname = OP_TOSPHERE;
1062 
1063  /* api callbacks */
1065  ot->exec = transform_exec;
1070 
1071  RNA_def_float_factor(ot->srna, "value", 0, 0, 1, "Factor", "", 0, 1);
1072 
1074 
1076 }
1077 
1079 {
1080  /* identifiers */
1081  ot->name = "Mirror";
1082  ot->description = "Mirror selected items around one or more axes";
1083  ot->idname = OP_MIRROR;
1085 
1086  /* api callbacks */
1088  ot->exec = transform_exec;
1093 
1095 }
1096 
1098 {
1099  /* identifiers */
1100  ot->name = "Scale B-Bone";
1101  ot->description = "Scale selected bendy bones display size";
1102  ot->idname = OP_BONE_SIZE;
1104 
1105  /* api callbacks */
1107  ot->exec = transform_exec;
1112 
1114  ot->srna, "value", 3, VecOne, -FLT_MAX, FLT_MAX, "Display Size", "", -FLT_MAX, FLT_MAX);
1115 
1117 
1119 }
1120 
1122 {
1123  PropertyRNA *prop;
1124 
1125  /* identifiers */
1126  ot->name = "Edge Slide";
1127  ot->description = "Slide an edge loop along a mesh";
1128  ot->idname = OP_EDGE_SLIDE;
1130 
1131  /* api callbacks */
1133  ot->exec = transform_exec;
1138 
1139  RNA_def_float_factor(ot->srna, "value", 0, -10.0f, 10.0f, "Factor", "", -1.0f, 1.0f);
1140 
1141  prop = RNA_def_boolean(ot->srna, "single_side", false, "Single Side", "");
1144  "use_even",
1145  false,
1146  "Even",
1147  "Make the edge loop match the shape of the adjacent edge loop");
1148 
1150 
1152  "flipped",
1153  false,
1154  "Flipped",
1155  "When Even mode is active, flips between the two adjacent edge loops");
1156  RNA_def_boolean(ot->srna, "use_clamp", true, "Clamp", "Clamp within the edge extents");
1157 
1159 }
1160 
1162 {
1163  /* identifiers */
1164  ot->name = "Vertex Slide";
1165  ot->description = "Slide a vertex along a mesh";
1166  ot->idname = OP_VERT_SLIDE;
1168 
1169  /* api callbacks */
1171  ot->exec = transform_exec;
1176 
1177  RNA_def_float_factor(ot->srna, "value", 0, -10.0f, 10.0f, "Factor", "", -1.0f, 1.0f);
1179  "use_even",
1180  false,
1181  "Even",
1182  "Make the edge loop match the shape of the adjacent edge loop");
1183 
1185 
1187  "flipped",
1188  false,
1189  "Flipped",
1190  "When Even mode is active, flips between the two adjacent edge loops");
1191  RNA_def_boolean(ot->srna, "use_clamp", true, "Clamp", "Clamp within the edge extents");
1192 
1194 }
1195 
1197 {
1198  /* identifiers */
1199  ot->name = "Edge Crease";
1200  ot->description = "Change the crease of edges";
1203 
1204  /* api callbacks */
1206  ot->exec = transform_exec;
1211 
1212  RNA_def_float_factor(ot->srna, "value", 0, -1.0f, 1.0f, "Factor", "", -1.0f, 1.0f);
1213 
1215 
1217 }
1218 
1220 {
1221  /* identifiers */
1222  ot->name = "Vertex Crease";
1223  ot->description = "Change the crease of vertices";
1226 
1227  /* api callbacks */
1229  ot->exec = transform_exec;
1234 
1235  RNA_def_float_factor(ot->srna, "value", 0, -1.0f, 1.0f, "Factor", "", -1.0f, 1.0f);
1236 
1238 
1240 }
1241 
1243 {
1244  /* identifiers */
1245  ot->name = "Edge Bevel Weight";
1246  ot->description = "Change the bevel weight of edges";
1249 
1250  /* api callbacks */
1252  ot->exec = transform_exec;
1256 
1257  RNA_def_float_factor(ot->srna, "value", 0, -1.0f, 1.0f, "Factor", "", -1.0f, 1.0f);
1258 
1260 
1262 }
1263 
1265 {
1266  /* identifiers */
1267  ot->name = "Sequence Slide";
1268  ot->description = "Slide a sequence strip in time";
1269  ot->idname = OP_SEQ_SLIDE;
1271 
1272  /* api callbacks */
1274  ot->exec = transform_exec;
1278 
1279  /* properties */
1280  PropertyRNA *prop;
1281 
1282  prop = RNA_def_float_vector(
1283  ot->srna, "value", 2, NULL, -FLT_MAX, FLT_MAX, "Offset", "", -FLT_MAX, FLT_MAX);
1284  RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, 0);
1285 
1287 
1289 }
1290 
1292 {
1293  /* identifiers */
1294  ot->name = "Rotate Normals";
1295  ot->description = "Rotate split normal of selected items";
1298 
1299  /* api callbacks */
1301  ot->exec = transform_exec;
1305 
1307  ot->srna, "value", 0, NULL, -FLT_MAX, FLT_MAX, "Angle", "", -M_PI * 2, M_PI * 2);
1308 
1310 }
1311 
1313 {
1314  PropertyRNA *prop;
1315 
1316  /* identifiers */
1317  ot->name = "Transform";
1318  ot->description = "Transform selected items by mode type";
1319  ot->idname = "TRANSFORM_OT_transform";
1321 
1322  /* api callbacks */
1324  ot->exec = transform_exec;
1329 
1330  prop = RNA_def_enum(
1331  ot->srna, "mode", rna_enum_transform_mode_types, TFM_TRANSLATION, "Mode", "");
1333 
1335  ot->srna, "value", 4, NULL, -FLT_MAX, FLT_MAX, "Values", "", -FLT_MAX, FLT_MAX);
1336 
1338 
1342 }
1343 
1345 {
1347  if (tref) {
1348  ARegion *region = CTX_wm_region(C);
1349  wmGizmoMap *gzmap = region->gizmo_map;
1350  wmGizmoGroup *gzgroup = gzmap ? WM_gizmomap_group_find(gzmap, "VIEW3D_GGT_xform_gizmo") : NULL;
1351  if (gzgroup != NULL) {
1352  PointerRNA gzg_ptr;
1354  const int drag_action = RNA_enum_get(&gzg_ptr, "drag_action");
1355  const char *op_id = NULL;
1356  switch (drag_action) {
1358  op_id = "TRANSFORM_OT_translate";
1359  break;
1361  op_id = "TRANSFORM_OT_rotate";
1362  break;
1364  op_id = "TRANSFORM_OT_resize";
1365  break;
1366  default:
1367  break;
1368  }
1369  if (op_id) {
1370  wmOperatorType *ot = WM_operatortype_find(op_id, true);
1371  PointerRNA op_ptr;
1373  RNA_boolean_set(&op_ptr, "release_confirm", true);
1375  WM_operator_properties_free(&op_ptr);
1376  return OPERATOR_FINISHED;
1377  }
1378  }
1379  }
1380  return OPERATOR_PASS_THROUGH;
1381 }
1382 
1383 /* Use with 'TRANSFORM_GGT_gizmo'. */
1385 {
1386  /* identifiers */
1387  ot->name = "Transform from Gizmo";
1388  ot->description = "Transform selected items by mode type";
1389  ot->idname = "TRANSFORM_OT_from_gizmo";
1390  ot->flag = 0;
1391 
1392  /* api callbacks */
1394 }
1395 
1397 {
1398  TransformModeItem *tmode;
1399 
1400  for (tmode = transform_modes; tmode->idname; tmode++) {
1402  }
1403 
1405 
1409 
1411 }
1412 
1414 {
1415  wmKeyMap *modalmap = transform_modal_keymap(keyconf);
1416 
1417  TransformModeItem *tmode;
1418 
1419  for (tmode = transform_modes; tmode->idname; tmode++) {
1420  WM_modalkeymap_assign(modalmap, tmode->idname);
1421  }
1422  WM_modalkeymap_assign(modalmap, "TRANSFORM_OT_transform");
1423 }
struct ScrArea * CTX_wm_area(const bContext *C)
Definition: context.c:738
struct Scene * CTX_data_scene(const bContext *C)
Definition: context.c:1090
struct View3D * CTX_wm_view3d(const bContext *C)
Definition: context.c:784
struct wmMsgBus * CTX_wm_message_bus(const bContext *C)
Definition: context.c:770
struct ARegion * CTX_wm_region(const bContext *C)
Definition: context.c:749
void BKE_report(ReportList *reports, eReportType type, const char *message)
Definition: report.c:83
void BKE_scene_orientation_slot_set_index(struct TransformOrientationSlot *orient_slot, int orientation)
Definition: scene.cc:2456
#define BLI_assert(a)
Definition: BLI_assert.h:46
#define M_PI
Definition: BLI_math_base.h:20
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_LEGACY
#define IFACE_(msgid)
#define MAX_NAME
Definition: DNA_defs.h:48
Object is a sort of wrapper for general info.
#define SCE_SELECT_FACE
@ SCE_ORIENT_DEFAULT
#define SCE_SELECT_VERTEX
@ SCE_SNAP_SOURCE_ACTIVE
#define SCE_SELECT_EDGE
@ SCE_SNAP_MODE_INCREMENT
@ SPACE_ACTION
@ SPACE_NLA
@ 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
bool EDBM_selectmode_set_multi(struct bContext *C, short selectmode)
bool ED_operator_editmesh_region_view3d(struct bContext *C)
Definition: screen_ops.c:447
bool ED_operator_editcurve_3d(struct bContext *C)
Definition: screen_ops.c:615
bool ED_operator_sequencer_active(struct bContext *C)
Definition: screen_ops.c:334
bool ED_operator_areaactive(struct bContext *C)
Definition: screen_ops.c:105
bool ED_operator_screenactive(struct bContext *C)
Definition: screen_ops.c:119
bool ED_operator_view3d_active(struct bContext *C)
Definition: screen_ops.c:225
bool ED_operator_editmesh(struct bContext *C)
Definition: screen_ops.c:433
bool ED_operator_object_active(struct bContext *C)
Definition: screen_ops.c:370
bool ED_operator_region_view3d_active(struct bContext *C)
Definition: screen_ops.c:230
#define P_PROPORTIONAL
Definition: ED_transform.h:110
#define P_CURSOR_EDIT
Definition: ED_transform.h:124
#define P_CENTER
Definition: ED_transform.h:122
#define P_ALIGN_SNAP
Definition: ED_transform.h:116
#define P_NO_DEFAULTS
Definition: ED_transform.h:120
#define P_POST_TRANSFORM
Definition: ED_transform.h:128
#define P_VIEW2D_EDGE_PAN
Definition: ED_transform.h:126
#define P_CORRECT_UV
Definition: ED_transform.h:119
eTfmMode
Definition: ED_transform.h:27
@ TFM_RESIZE
Definition: ED_transform.h:32
@ TFM_EDGE_SLIDE
Definition: ED_transform.h:59
@ TFM_BONESIZE
Definition: ED_transform.h:44
@ TFM_SKIN_RESIZE
Definition: ED_transform.h:33
@ TFM_SHEAR
Definition: ED_transform.h:35
@ TFM_SHRINKFATTEN
Definition: ED_transform.h:37
@ TFM_TIME_TRANSLATE
Definition: ED_transform.h:50
@ TFM_TIME_SLIDE
Definition: ED_transform.h:51
@ TFM_BAKE_TIME
Definition: ED_transform.h:55
@ TFM_VERT_CREASE
Definition: ED_transform.h:42
@ TFM_VERT_SLIDE
Definition: ED_transform.h:60
@ TFM_BEND
Definition: ED_transform.h:36
@ TFM_ROTATION
Definition: ED_transform.h:31
@ TFM_BONE_ENVELOPE
Definition: ED_transform.h:45
@ TFM_BWEIGHT
Definition: ED_transform.h:57
@ TFM_ALIGN
Definition: ED_transform.h:58
@ TFM_TIME_SCALE
Definition: ED_transform.h:52
@ TFM_BONE_ROLL
Definition: ED_transform.h:49
@ TFM_TIME_EXTEND
Definition: ED_transform.h:53
@ TFM_GPENCIL_SHRINKFATTEN
Definition: ED_transform.h:48
@ TFM_CURVE_SHRINKFATTEN
Definition: ED_transform.h:46
@ TFM_TILT
Definition: ED_transform.h:38
@ TFM_INIT
Definition: ED_transform.h:28
@ TFM_SEQ_SLIDE
Definition: ED_transform.h:61
@ TFM_TOSPHERE
Definition: ED_transform.h:34
@ TFM_EDGE_CREASE
Definition: ED_transform.h:41
@ TFM_GPENCIL_OPACITY
Definition: ED_transform.h:64
@ TFM_MIRROR
Definition: ED_transform.h:43
@ TFM_TRANSLATION
Definition: ED_transform.h:30
@ TFM_MASK_SHRINKFATTEN
Definition: ED_transform.h:47
@ TFM_BONE_ENVELOPE_DIST
Definition: ED_transform.h:62
@ TFM_NORMAL_ROTATION
Definition: ED_transform.h:63
@ TFM_DUMMY
Definition: ED_transform.h:29
@ TFM_PUSHPULL
Definition: ED_transform.h:40
@ TFM_TRACKBALL
Definition: ED_transform.h:39
bool BIF_createTransformOrientation(struct bContext *C, struct ReportList *reports, const char *name, bool use_view, bool activate, bool overwrite)
#define P_ORIENT_MATRIX
Definition: ED_transform.h:113
void BIF_removeTransformOrientationIndex(struct bContext *C, int index)
#define P_ORIENT_AXIS_ORTHO
Definition: ED_transform.h:112
#define P_NO_TEXSPACE
Definition: ED_transform.h:121
#define P_MIRROR
Definition: ED_transform.h:108
#define P_CONSTRAINT
Definition: ED_transform.h:117
#define P_SNAP
Definition: ED_transform.h:114
#define P_GEO_SNAP
Definition: ED_transform.h:115
#define P_GPENCIL_EDIT
Definition: ED_transform.h:123
#define P_ORIENT_AXIS
Definition: ED_transform.h:111
#define P_MIRROR_DUMMY
Definition: ED_transform.h:109
#define P_OPTIONS
Definition: ED_transform.h:118
_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:61
@ PROP_ENUM
Definition: RNA_types.h:63
@ PROP_ENUM_FLAG
Definition: RNA_types.h:266
@ PROP_SKIP_SAVE
Definition: RNA_types.h:218
@ PROP_HIDDEN
Definition: RNA_types.h:216
@ PROP_XYZ
Definition: RNA_types.h:162
@ PROP_NONE
Definition: RNA_types.h:126
#define C
Definition: RandGen.cpp:25
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:150
@ OPTYPE_DEPENDS_ON_CURSOR
Definition: WM_types.h:184
@ OPTYPE_UNDO
Definition: WM_types.h:148
@ OPTYPE_REGISTER
Definition: WM_types.h:146
#define NC_SCENE
Definition: WM_types.h:328
#define ND_TOOLSETTINGS
Definition: WM_types.h:397
#define NA_EDITED
Definition: WM_types.h:523
#define ND_TRANSFORM
Definition: WM_types.h:405
@ WM_OP_INVOKE_DEFAULT
Definition: WM_types.h:201
#define ND_SPACE_VIEW3D
Definition: WM_types.h:471
#define NC_OBJECT
Definition: WM_types.h:329
#define NC_SPACE
Definition: WM_types.h:342
Scene scene
SyclQueue void void size_t num_bytes void
void(* MEM_freeN)(void *vmemh)
Definition: mallocn.c:27
void *(* MEM_callocN)(size_t len, const char *str)
Definition: mallocn.c:31
#define G(x, y, z)
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:1000
void RNA_boolean_set(PointerRNA *ptr, const char *name, bool value)
Definition: rna_access.c:4874
bool RNA_property_is_set(PointerRNA *ptr, PropertyRNA *prop)
Definition: rna_access.c:5271
void RNA_property_boolean_get_array(PointerRNA *ptr, PropertyRNA *prop, bool *values)
Definition: rna_access.c:2242
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
Definition: rna_access.c:717
bool RNA_property_boolean_get(PointerRNA *ptr, PropertyRNA *prop)
Definition: rna_access.c:2153
void RNA_string_get(PointerRNA *ptr, const char *name, char *value)
Definition: rna_access.c:5116
bool RNA_struct_property_is_set(PointerRNA *ptr, const char *identifier)
Definition: rna_access.c:5301
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
Definition: rna_access.c:4863
int RNA_enum_get(PointerRNA *ptr, const char *name)
Definition: rna_access.c:5004
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:3836
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, bool default_value, const char *ui_name, const char *ui_description)
Definition: rna_define.c:3493
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:3954
void RNA_def_property_enum_default(PropertyRNA *prop, int value)
Definition: rna_define.c:2106
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:4052
void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *description)
Definition: rna_define.c:1645
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:3862
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:3575
void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item)
Definition: rna_define.c:1872
void RNA_def_property_array(PropertyRNA *prop, int length)
Definition: rna_define.c:1539
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:4144
PropertyRNA * RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier, int type, int subtype)
Definition: rna_define.c:1257
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:3986
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:3687
void RNA_def_property_translation_context(PropertyRNA *prop, const char *context)
Definition: rna_define.c:2848
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
Definition: rna_define.c:1490
void RNA_def_enum_funcs(PropertyRNA *prop, EnumPropertyItemFunc itemfunc)
Definition: rna_define.c:3830
void RNA_def_property_ui_range(PropertyRNA *prop, double min, double max, double step, int precision)
Definition: rna_define.c:1664
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:4016
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:3783
const EnumPropertyItem rna_enum_axis_xyz_items[]
Definition: rna_modifier.c:615
const EnumPropertyItem rna_enum_proportional_falloff_items[]
Definition: rna_scene.c:103
const EnumPropertyItem rna_enum_snap_source_items[]
Definition: rna_scene.c:95
const EnumPropertyItem rna_enum_snap_element_items[]
Definition: rna_scene.c:146
struct wmGizmoMap * gizmo_map
struct ToolSettings * toolsettings
TransformOrientationSlot orientation_slots[4]
void(* opfunc)(wmOperatorType *)
Definition: transform_ops.c:45
const char * idname
Definition: transform_ops.c:43
short type
Definition: WM_types.h:678
struct wmGizmoGroupType * type
int(* invoke)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
Definition: WM_types.h:919
const char * name
Definition: WM_types.h:888
int(* modal)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
Definition: WM_types.h:935
const char * idname
Definition: WM_types.h:890
bool(* poll)(struct bContext *) ATTR_WARN_UNUSED_RESULT
Definition: WM_types.h:943
bool(* poll_property)(const struct bContext *C, struct wmOperator *op, const PropertyRNA *prop) ATTR_WARN_UNUSED_RESULT
Definition: WM_types.h:949
void(* cancel)(struct bContext *, struct wmOperator *)
Definition: WM_types.h:927
struct StructRNA * srna
Definition: WM_types.h:969
const char * description
Definition: WM_types.h:893
int(* exec)(struct bContext *, struct wmOperator *) ATTR_WARN_UNUSED_RESULT
Definition: WM_types.h:903
struct ReportList * reports
struct wmOperator * prev
struct wmOperatorType * type
struct PointerRNA * ptr
struct wmOperator * opm
wmKeyMap * transform_modal_keymap(wmKeyConfig *keyconf)
Definition: transform.c:654
void transformApply(bContext *C, TransInfo *t)
Definition: transform.c:1998
void saveTransform(bContext *C, TransInfo *t, wmOperator *op)
Definition: transform.c:1498
bool initTransform(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *event, int mode)
Definition: transform.c:1758
int transformEvent(TransInfo *t, const wmEvent *event)
Definition: transform.c:895
int transformEnd(bContext *C, TransInfo *t)
Definition: transform.c:2023
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:52
static const char OP_TILT[]
Definition: transform_ops.c:60
static void TRANSFORM_OT_rotate_normal(struct wmOperatorType *ot)
static const char OP_TOSPHERE[]
Definition: transform_ops.c:53
static void transformops_loopsel_hack(bContext *C, wmOperator *op)
static const char OP_RESIZE[]
Definition: transform_ops.c:54
static const char OP_MIRROR[]
Definition: transform_ops.c:62
struct TransformModeItem TransformModeItem
static void TRANSFORM_OT_delete_orientation(struct wmOperatorType *ot)
static const char OP_SKIN_RESIZE[]
Definition: transform_ops.c:55
static const char OP_SHEAR[]
Definition: transform_ops.c:56
void Transform_Properties(struct wmOperatorType *ot, int flags)
static const char OP_EDGE_BWEIGHT[]
Definition: transform_ops.c:68
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 *event)
static TransformModeItem transform_modes[]
Definition: transform_ops.c:93
static const char OP_EDGE_SLIDE[]
Definition: transform_ops.c:64
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:66
static void TRANSFORM_OT_shrink_fatten(struct wmOperatorType *ot)
static const float VecOne[3]
Definition: transform_ops.c:49
static bool transform_shear_poll(bContext *C)
static void TRANSFORM_OT_rotate(struct wmOperatorType *ot)
static const char OP_TRANSLATION[]
Definition: transform_ops.c:51
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 void TRANSFORM_OT_vert_crease(struct wmOperatorType *ot)
static int transform_modal(bContext *C, wmOperator *op, const wmEvent *event)
static const char OP_PUSH_PULL[]
Definition: transform_ops.c:59
static const char OP_SEQ_SLIDE[]
Definition: transform_ops.c:69
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:57
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:61
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 bool transform_poll_property(const bContext *C, wmOperator *op, const PropertyRNA *prop)
static int transformops_mode(wmOperator *op)
static void TRANSFORM_OT_translate(struct wmOperatorType *ot)
static const char OP_SHRINK_FATTEN[]
Definition: transform_ops.c:58
void ED_keymap_transform(wmKeyConfig *keyconf)
static void TRANSFORM_OT_mirror(struct wmOperatorType *ot)
static const char OP_NORMAL_ROTATION[]
Definition: transform_ops.c:70
static const float VecZero[3]
Definition: transform_ops.c:48
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:63
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:65
static void TRANSFORM_OT_tosphere(struct wmOperatorType *ot)
static const char OP_VERT_CREASE[]
Definition: transform_ops.c:67
void WM_operator_type_set(wmOperator *op, wmOperatorType *ot)
Definition: wm.c:336
wmEventHandler_Op * WM_event_add_modal_handler(bContext *C, wmOperator *op)
int WM_operator_name_call_ptr(bContext *C, wmOperatorType *ot, wmOperatorCallContext context, PointerRNA *properties, const wmEvent *event)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
@ NDOF_MOTION
wmOperatorType * ot
Definition: wm_files.c:3479
wmGizmoGroup * WM_gizmomap_group_find(struct wmGizmoMap *gzmap, const char *idname)
Definition: wm_gizmo_map.c:202
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:661
void WM_operator_properties_free(PointerRNA *ptr)
Definition: wm_operators.c:783
struct bToolRef * WM_toolsystem_ref_from_context(struct bContext *C)
Definition: wm_toolsystem.c:57