Blender V4.3
transform_ops.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
9#include "MEM_guardedalloc.h"
10
11#include "DNA_curve_types.h"
12#include "DNA_object_types.h"
13#include "DNA_scene_types.h"
14
15#include "BLI_math_vector.h"
16#include "BLI_utildefines.h"
17
18#include "BLT_translation.hh"
19
20#include "BKE_context.hh"
21#include "BKE_global.hh"
22#include "BKE_report.hh"
23#include "BKE_scene.hh"
24
25#include "RNA_access.hh"
26#include "RNA_define.hh"
27#include "RNA_enum_types.hh"
28
29#include "WM_api.hh"
30#include "WM_message.hh"
31#include "WM_toolsystem.hh"
32#include "WM_types.hh"
33
34#include "UI_interface.hh"
35#include "UI_resources.hh"
36
37#include "ED_screen.hh"
39#include "ED_mesh.hh"
40
41#include "transform.hh"
42#include "transform_convert.hh"
43
44using namespace blender;
45
47 const char *idname;
48 int mode;
50};
51
52static const float VecZero[3] = {0, 0, 0};
53static const float VecOne[3] = {1, 1, 1};
54
55static const char OP_TRANSLATION[] = "TRANSFORM_OT_translate";
56static const char OP_ROTATION[] = "TRANSFORM_OT_rotate";
57static const char OP_TOSPHERE[] = "TRANSFORM_OT_tosphere";
58static const char OP_RESIZE[] = "TRANSFORM_OT_resize";
59static const char OP_SKIN_RESIZE[] = "TRANSFORM_OT_skin_resize";
60static const char OP_SHEAR[] = "TRANSFORM_OT_shear";
61static const char OP_BEND[] = "TRANSFORM_OT_bend";
62static const char OP_SHRINK_FATTEN[] = "TRANSFORM_OT_shrink_fatten";
63static const char OP_PUSH_PULL[] = "TRANSFORM_OT_push_pull";
64static const char OP_TILT[] = "TRANSFORM_OT_tilt";
65static const char OP_TRACKBALL[] = "TRANSFORM_OT_trackball";
66static const char OP_MIRROR[] = "TRANSFORM_OT_mirror";
67static const char OP_BONE_SIZE[] = "TRANSFORM_OT_bbone_resize";
68static const char OP_EDGE_SLIDE[] = "TRANSFORM_OT_edge_slide";
69static const char OP_VERT_SLIDE[] = "TRANSFORM_OT_vert_slide";
70static const char OP_EDGE_CREASE[] = "TRANSFORM_OT_edge_crease";
71static const char OP_VERT_CREASE[] = "TRANSFORM_OT_vert_crease";
72static const char OP_EDGE_BWEIGHT[] = "TRANSFORM_OT_edge_bevelweight";
73static const char OP_SEQ_SLIDE[] = "TRANSFORM_OT_seq_slide";
74static const char OP_NORMAL_ROTATION[] = "TRANSFORM_OT_rotate_normal";
75
96
120
122 {TFM_INIT, "INIT", 0, "Init", ""},
123 {TFM_DUMMY, "DUMMY", 0, "Dummy", ""},
124 {TFM_TRANSLATION, "TRANSLATION", 0, "Translation", ""},
125 {TFM_ROTATION, "ROTATION", 0, "Rotation", ""},
126 {TFM_RESIZE, "RESIZE", 0, "Resize", ""},
127 {TFM_SKIN_RESIZE, "SKIN_RESIZE", 0, "Skin Resize", ""},
128 {TFM_TOSPHERE, "TOSPHERE", 0, "To Sphere", ""},
129 {TFM_SHEAR, "SHEAR", 0, "Shear", ""},
130 {TFM_BEND, "BEND", 0, "Bend", ""},
131 {TFM_SHRINKFATTEN, "SHRINKFATTEN", 0, "Shrink/Fatten", ""},
132 {TFM_TILT, "TILT", 0, "Tilt", ""},
133 {TFM_TRACKBALL, "TRACKBALL", 0, "Trackball", ""},
134 {TFM_PUSHPULL, "PUSHPULL", 0, "Push/Pull", ""},
135 {TFM_EDGE_CREASE, "CREASE", 0, "Crease", ""},
136 {TFM_VERT_CREASE, "VERTEX_CREASE", 0, "Vertex Crease", ""},
137 {TFM_MIRROR, "MIRROR", 0, "Mirror", ""},
138 {TFM_BONESIZE, "BONE_SIZE", 0, "Bone Size", ""},
139 {TFM_BONE_ENVELOPE, "BONE_ENVELOPE", 0, "Bone Envelope", ""},
140 {TFM_BONE_ENVELOPE_DIST, "BONE_ENVELOPE_DIST", 0, "Bone Envelope Distance", ""},
141 {TFM_CURVE_SHRINKFATTEN, "CURVE_SHRINKFATTEN", 0, "Curve Shrink/Fatten", ""},
142 {TFM_MASK_SHRINKFATTEN, "MASK_SHRINKFATTEN", 0, "Mask Shrink/Fatten", ""},
143 {TFM_GPENCIL_SHRINKFATTEN, "GPENCIL_SHRINKFATTEN", 0, "Grease Pencil Shrink/Fatten", ""},
144 {TFM_BONE_ROLL, "BONE_ROLL", 0, "Bone Roll", ""},
145 {TFM_TIME_TRANSLATE, "TIME_TRANSLATE", 0, "Time Translate", ""},
146 {TFM_TIME_SLIDE, "TIME_SLIDE", 0, "Time Slide", ""},
147 {TFM_TIME_SCALE, "TIME_SCALE", 0, "Time Scale", ""},
148 {TFM_TIME_EXTEND, "TIME_EXTEND", 0, "Time Extend", ""},
149 {TFM_BAKE_TIME, "BAKE_TIME", 0, "Bake Time", ""},
150 {TFM_BWEIGHT, "BWEIGHT", 0, "Bevel Weight", ""},
151 {TFM_ALIGN, "ALIGN", 0, "Align", ""},
152 {TFM_EDGE_SLIDE, "EDGESLIDE", 0, "Edge Slide", ""},
153 {TFM_SEQ_SLIDE, "SEQSLIDE", 0, "Sequence Slide", ""},
154 {TFM_GPENCIL_OPACITY, "GPENCIL_OPACITY", 0, "Grease Pencil Opacity", ""},
155 {0, nullptr, 0, nullptr, nullptr},
156};
157
159{
160 Scene *scene = CTX_data_scene(C);
161
162 int orientation = RNA_enum_get(op->ptr, "orientation");
163
164 BKE_scene_orientation_slot_set_index(&scene->orientation_slots[SCE_ORIENT_DEFAULT], orientation);
165
168
169 wmMsgBus *mbus = CTX_wm_message_bus(C);
170 WM_msg_publish_rna_prop(mbus, &scene->id, scene, TransformOrientationSlot, type);
171
172 return OPERATOR_FINISHED;
173}
174
175static int select_orientation_invoke(bContext *C, wmOperator * /*op*/, const wmEvent * /*event*/)
176{
177 uiPopupMenu *pup;
178 uiLayout *layout;
179
180 pup = UI_popup_menu_begin(C, IFACE_("Orientation"), ICON_NONE);
181 layout = UI_popup_menu_layout(pup);
182 uiItemsEnumO(layout, "TRANSFORM_OT_select_orientation", "orientation");
183 UI_popup_menu_end(C, pup);
184
185 return OPERATOR_INTERFACE;
186}
187
189{
190 PropertyRNA *prop;
191
192 /* Identifiers. */
193 ot->name = "Select Orientation";
194 ot->description = "Select transformation orientation";
195 ot->idname = "TRANSFORM_OT_select_orientation";
197
198 /* API callbacks. */
202
203 prop = RNA_def_property(ot->srna, "orientation", PROP_ENUM, PROP_NONE);
204 RNA_def_property_ui_text(prop, "Orientation", "Transformation orientation");
206}
207
209{
210 Scene *scene = CTX_data_scene(C);
212 scene->orientation_slots[SCE_ORIENT_DEFAULT].index_custom);
213
215
216 wmMsgBus *mbus = CTX_wm_message_bus(C);
217 WM_msg_publish_rna_prop(mbus, &scene->id, scene, Scene, transform_orientation_slots);
218
219 return OPERATOR_FINISHED;
220}
221
222static int delete_orientation_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/)
223{
224 return delete_orientation_exec(C, op);
225}
226
228{
229 if (ED_operator_areaactive(C) == 0) {
230 return false;
231 }
232
233 Scene *scene = CTX_data_scene(C);
234 return ((scene->orientation_slots[SCE_ORIENT_DEFAULT].type >= V3D_ORIENT_CUSTOM) &&
235 (scene->orientation_slots[SCE_ORIENT_DEFAULT].index_custom != -1));
236}
237
239{
240 /* Identifiers. */
241 ot->name = "Delete Orientation";
242 ot->description = "Delete transformation orientation";
243 ot->idname = "TRANSFORM_OT_delete_orientation";
245
246 /* API callbacks. */
250}
251
253{
254 char name[MAX_NAME];
255 const bool use = RNA_boolean_get(op->ptr, "use");
256 const bool overwrite = RNA_boolean_get(op->ptr, "overwrite");
257 const bool use_view = RNA_boolean_get(op->ptr, "use_view");
258 View3D *v3d = CTX_wm_view3d(C);
259 Scene *scene = CTX_data_scene(C);
260
261 RNA_string_get(op->ptr, "name", name);
262
263 if (use && !v3d) {
265 RPT_ERROR,
266 "Create Orientation's 'use' parameter only valid in a 3DView context");
267 return OPERATOR_CANCELLED;
268 }
269
270 if (!BIF_createTransformOrientation(C, op->reports, name, use_view, use, overwrite)) {
271 BKE_report(op->reports, RPT_ERROR, "Unable to create orientation");
272 return OPERATOR_CANCELLED;
273 }
274
275 if (use) {
276 wmMsgBus *mbus = CTX_wm_message_bus(C);
277 WM_msg_publish_rna_prop(mbus, &scene->id, scene, Scene, transform_orientation_slots);
279 }
280
282
283 return OPERATOR_FINISHED;
284}
285
287{
288 /* Identifiers. */
289 ot->name = "Create Orientation";
290 ot->description = "Create transformation orientation from selection";
291 ot->idname = "TRANSFORM_OT_create_orientation";
293
294 /* API callbacks. */
297
299 ot->srna, "name", nullptr, MAX_NAME, "Name", "Name of the new custom orientation");
301 ot->srna,
302 "use_view",
303 false,
304 "Use View",
305 "Use the current view instead of the active object to create the new orientation");
306
308
310 ot->srna, "use", false, "Use After Creation", "Select orientation after its creation");
312 "overwrite",
313 false,
314 "Overwrite Previous",
315 "Overwrite previously created orientation with same name");
316}
317
318#ifdef USE_LOOPSLIDE_HACK
325{
326 if (op->type->idname == OP_EDGE_SLIDE) {
327 if (op->opm && op->opm->opm && op->opm->opm->prev) {
328 wmOperator *op_prev = op->opm->opm->prev;
329 Scene *scene = CTX_data_scene(C);
330 bool mesh_select_mode[3];
331 PropertyRNA *prop = RNA_struct_find_property(op_prev->ptr, "mesh_select_mode_init");
332
333 if (prop && RNA_property_is_set(op_prev->ptr, prop)) {
334 ToolSettings *ts = scene->toolsettings;
335 short selectmode_orig;
336
337 RNA_property_boolean_get_array(op_prev->ptr, prop, mesh_select_mode);
338 selectmode_orig = ((mesh_select_mode[0] ? SCE_SELECT_VERTEX : 0) |
339 (mesh_select_mode[1] ? SCE_SELECT_EDGE : 0) |
340 (mesh_select_mode[2] ? SCE_SELECT_FACE : 0));
341
342 /* Still switch if we were originally in face select mode. */
343 if ((ts->selectmode != selectmode_orig) && (selectmode_orig != SCE_SELECT_FACE)) {
344 ts->selectmode = selectmode_orig;
345 EDBM_selectmode_set_multi(C, selectmode_orig);
346 }
347 }
348 }
349 }
350}
351#else
352/* Prevent removal by cleanup. */
353# error "loopslide hack removed!"
354#endif /* USE_LOOPSLIDE_HACK */
355
357{
358#ifdef USE_LOOPSLIDE_HACK
360#endif
361
362 saveTransform(C, static_cast<TransInfo *>(op->customdata), op);
364 op->customdata = nullptr;
365 G.moving = 0;
366}
367
369{
370 for (TransformModeItem *tmode = transform_modes; tmode->idname; tmode++) {
371 if (op->type->idname == tmode->idname) {
372 return tmode->mode;
373 }
374 }
375
376 return RNA_enum_get(op->ptr, "mode");
377}
378
379static int transformops_data(bContext *C, wmOperator *op, const wmEvent *event)
380{
381 int retval = 1;
382 if (op->customdata == nullptr) {
383 TransInfo *t = static_cast<TransInfo *>(MEM_callocN(sizeof(TransInfo), "TransInfo data2"));
384
385 t->undo_name = op->type->name;
386
387 int mode = transformops_mode(op);
388 retval = initTransform(C, t, op, event, mode);
389
390 /* Store data. */
391 if (retval) {
392 G.moving = special_transform_moving(t);
393 op->customdata = t;
394 }
395 else {
396 MEM_freeN(t);
397 }
398 }
399
400 return retval; /* Return 0 on error. */
401}
402
403static int transform_modal(bContext *C, wmOperator *op, const wmEvent *event)
404{
405 int exit_code = OPERATOR_PASS_THROUGH;
406
407 TransInfo *t = static_cast<TransInfo *>(op->customdata);
408 const eTfmMode mode_prev = t->mode;
409
410#if defined(WITH_INPUT_NDOF) && 0
411 /* Stable 2D mouse coords map to different 3D coords while the 3D mouse is active
412 * in other words, 2D deltas are no longer good enough!
413 * disable until individual 'transformers' behave better. */
414
415 if (event->type == NDOF_MOTION) {
417 }
418#endif
419
420 /* XXX insert keys are called here, and require context. */
421 t->context = C;
422 exit_code = transformEvent(t, op, event);
423 t->context = nullptr;
424
425 /* Allow navigation while transforming. */
426 if (t->vod && (exit_code & OPERATOR_PASS_THROUGH)) {
427 RegionView3D *rv3d = static_cast<RegionView3D *>(t->region->regiondata);
428 const bool is_navigating = (rv3d->rflag & RV3D_NAVIGATING) != 0;
429 if (ED_view3d_navigation_do(C, t->vod, event, t->center_global)) {
430 if (!is_navigating) {
431 /* Navigation has started. */
432
433 if (t->modifiers & MOD_PRECISION) {
434 /* WORKAROUND: Remove precision modification, it may have be unintentionally enabled. */
435 t->modifiers &= ~MOD_PRECISION;
436 t->mouse.precision = false;
438 }
439 }
440
441 if (rv3d->rflag & RV3D_NAVIGATING) {
442 /* Navigation is running. */
443
444 /* Do not update transform while navigating. This can be distracting. */
446 }
447
448 {
449 /* Navigation has ended. */
450
451 /* Call before #applyMouseInput. */
453
454 /* Mouse input is outdated. */
455 t->mval = float2(event->mval);
456 applyMouseInput(t, &t->mouse, t->mval, t->values);
457 t->redraw |= TREDRAW_HARD;
458 }
459 }
460 }
461
462 transformApply(C, t);
463
464 exit_code |= transformEnd(C, t);
465
466 if ((exit_code & OPERATOR_RUNNING_MODAL) == 0) {
467 transformops_exit(C, op);
468 exit_code &= ~OPERATOR_PASS_THROUGH; /* Preventively remove pass-through. */
469 }
470 else {
471 if (mode_prev != t->mode) {
472 /* WARNING: this is not normal to switch operator types
473 * normally it would not be supported but transform happens
474 * to share callbacks between different operators. */
475 wmOperatorType *ot_new = nullptr;
477 while (item->idname) {
478 if (item->mode == t->mode) {
479 ot_new = WM_operatortype_find(item->idname, false);
480 break;
481 }
482 item++;
483 }
484
485 BLI_assert(ot_new != nullptr);
486 if (ot_new) {
487 WM_operator_type_set(op, ot_new);
488 }
489 /* End suspicious code. */
490 }
491 }
492
493 return exit_code;
494}
495
497{
498 TransInfo *t = static_cast<TransInfo *>(op->customdata);
499
500 t->state = TRANS_CANCEL;
501 transformEnd(C, t);
502 transformops_exit(C, op);
503}
504
506{
507 TransInfo *t;
508
509 if (!transformops_data(C, op, nullptr)) {
510 G.moving = 0;
511 return OPERATOR_CANCELLED;
512 }
513
514 t = static_cast<TransInfo *>(op->customdata);
515
517
518 transformApply(C, t);
519
520 transformEnd(C, t);
521
522 transformops_exit(C, op);
523
525
526 return OPERATOR_FINISHED;
527}
528
529static int transform_invoke(bContext *C, wmOperator *op, const wmEvent *event)
530{
531 if (!transformops_data(C, op, event)) {
532 G.moving = 0;
533 return OPERATOR_CANCELLED;
534 }
535
536 /* When modal, allow 'value' to set initial offset. */
537 if ((event == nullptr) && RNA_struct_property_is_set(op->ptr, "value")) {
538 return transform_exec(C, op);
539 }
540
541 /* Add temp handler. */
543
544 /* Use when modal input has some transformation to begin with. */
545 TransInfo *t = static_cast<TransInfo *>(op->customdata);
546 if ((t->flag & T_NO_CURSOR_WRAP) == 0) {
547 op->flag |= OP_IS_MODAL_GRAB_CURSOR; /* XXX maybe we want this with the gizmo only? */
548 }
550 transformApply(C, t);
551 }
552
554}
555
556static bool transform_poll_property(const bContext *C, wmOperator *op, const PropertyRNA *prop)
557{
558 const char *prop_id = RNA_property_identifier(prop);
559
560 /* Orientation/Constraints. */
561 if (STRPREFIX(prop_id, "constraint")) {
562 /* Hide orientation axis if no constraints are set, since it won't be used. */
563 PropertyRNA *prop_con = RNA_struct_find_property(op->ptr, "orient_type");
564 if (!ELEM(prop_con, nullptr, prop)) {
565
566 /* Special case: show constraint axis if we don't have values,
567 * needed for mirror operator. */
568 if (STREQ(prop_id, "constraint_axis") &&
569 (RNA_struct_find_property(op->ptr, "value") == nullptr))
570 {
571 return true;
572 }
573
574 return false;
575 }
576 return true;
577 }
578
579 /* Orientation Axis. */
580 if (STREQ(prop_id, "orient_axis")) {
582 return mode != TFM_ALIGN;
583 }
584
585 /* Proportional Editing. */
586 if (STRPREFIX(prop_id, "proportional") || STRPREFIX(prop_id, "use_proportional")) {
587 ScrArea *area = CTX_wm_area(C);
588 if (area->spacetype == SPACE_NLA) {
589 /* Hide properties that are not supported in some spaces. */
590 return false;
591 }
592
593 PropertyRNA *prop_pet = RNA_struct_find_property(op->ptr, "use_proportional_edit");
594 if ((prop_pet != prop) && (RNA_property_boolean_get(op->ptr, prop_pet) == false)) {
595 /* If "use_proportional_edit" is false, hide:
596 * - "proportional_edit_falloff",
597 * - "proportional_size",
598 * - "use_proportional_connected",
599 * - "use_proportional_projected". */
600 return false;
601 }
602 return true;
603 }
604
605 /* Snapping. */
606 if (STREQ(prop_id, "use_snap_project")) {
607 return RNA_boolean_get(op->ptr, "snap");
608 }
609
610 /* #P_CORRECT_UV. */
611 if (STREQ(prop_id, "correct_uv")) {
612 ScrArea *area = CTX_wm_area(C);
613 return area->spacetype == SPACE_VIEW3D;
614 }
615
616 return true;
617}
618
620{
621 PropertyRNA *prop;
622
623 if (flags & P_ORIENT_AXIS) {
624 prop = RNA_def_property(ot->srna, "orient_axis", PROP_ENUM, PROP_NONE);
625 RNA_def_property_ui_text(prop, "Axis", "");
629 }
630 if (flags & P_ORIENT_AXIS_ORTHO) {
631 prop = RNA_def_property(ot->srna, "orient_axis_ortho", PROP_ENUM, PROP_NONE);
632 RNA_def_property_ui_text(prop, "Axis Ortho", "");
636 }
637
638 if (flags & P_ORIENT_MATRIX) {
639 prop = RNA_def_property(ot->srna, "orient_type", PROP_ENUM, PROP_NONE);
640 RNA_def_property_ui_text(prop, "Orientation", "Transformation orientation");
642
643 /* Set by 'orient_type' or gizmo which acts on non-standard orientation. */
645 ot->srna, "orient_matrix", 3, 3, nullptr, 0.0f, 0.0f, "Matrix", "", 0.0f, 0.0f);
647
648 /* Only use 'orient_matrix' when 'orient_matrix_type == orient_type',
649 * this allows us to reuse the orientation set by a gizmo for eg, without disabling the ability
650 * to switch over to other orientations. */
651 prop = RNA_def_property(ot->srna, "orient_matrix_type", PROP_ENUM, PROP_NONE);
652 RNA_def_property_ui_text(prop, "Matrix Orientation", "");
655 }
656
657 if (flags & P_CONSTRAINT) {
658 RNA_def_boolean_vector(ot->srna, "constraint_axis", 3, nullptr, "Constraint Axis", "");
659 }
660
661 if (flags & P_MIRROR) {
662 prop = RNA_def_boolean(ot->srna, "mirror", false, "Mirror Editing", "");
663 if ((flags & P_MIRROR_DUMMY) == P_MIRROR_DUMMY) {
664 /* Only used so macros can disable this option. */
666 }
667 }
668
669 if (flags & P_PROPORTIONAL) {
670 RNA_def_boolean(ot->srna, "use_proportional_edit", false, "Proportional Editing", "");
671 prop = RNA_def_enum(ot->srna,
672 "proportional_edit_falloff",
674 0,
675 "Proportional Falloff",
676 "Falloff type for proportional editing mode");
677 /* Abusing id_curve :/ */
680 "proportional_size",
681 1,
684 "Proportional Size",
685 "",
686 0.001f,
687 100.0f);
688
689 RNA_def_boolean(ot->srna, "use_proportional_connected", false, "Connected", "");
690 RNA_def_boolean(ot->srna, "use_proportional_projected", false, "Projected (2D)", "");
691 }
692
693 if (flags & P_SNAP) {
694 prop = RNA_def_boolean(ot->srna, "snap", false, "Use Snapping Options", "");
696
697 if ((flags & P_GEO_SNAP) == P_GEO_SNAP) {
698 prop = RNA_def_enum(ot->srna,
699 "snap_elements",
702 "Snap to Elements",
703 "");
705
706 RNA_def_boolean(ot->srna, "use_snap_project", false, "Project Individual Elements", "");
707
708 /* TODO(@gfxcoder): Rename `snap_target` to `snap_base` to avoid previous ambiguity of
709 * "target" (now, "base" or "source" is geometry to be moved and "target" is geometry to
710 * which moved geometry is snapped). */
711 prop = RNA_def_enum(ot->srna,
712 "snap_target",
714 0,
715 "Snap Base",
716 "Point on source that will snap to target");
718
719 /* Target selection. */
720 prop = RNA_def_boolean(ot->srna, "use_snap_self", true, "Target: Include Active", "");
722 prop = RNA_def_boolean(ot->srna, "use_snap_edit", true, "Target: Include Edit", "");
724 prop = RNA_def_boolean(ot->srna, "use_snap_nonedit", true, "Target: Include Non-Edited", "");
726 prop = RNA_def_boolean(
727 ot->srna, "use_snap_selectable", false, "Target: Exclude Non-Selectable", "");
729
731 ot->srna, "snap_point", 3, nullptr, -FLT_MAX, FLT_MAX, "Point", "", -FLT_MAX, FLT_MAX);
733
734 if ((flags & P_ALIGN_SNAP) == P_ALIGN_SNAP) {
735 prop = RNA_def_boolean(ot->srna, "snap_align", false, "Align with Point Normal", "");
738 "snap_normal",
739 3,
740 nullptr,
741 -FLT_MAX,
742 FLT_MAX,
743 "Normal",
744 "",
745 -FLT_MAX,
746 FLT_MAX);
748 }
749 }
750 }
751
752 if (flags & P_GPENCIL_EDIT) {
753 prop = RNA_def_boolean(ot->srna,
754 "gpencil_strokes",
755 false,
756 "Edit Grease Pencil",
757 "Edit selected Grease Pencil strokes");
759 }
760
761 if (flags & P_CURSOR_EDIT) {
762 prop = RNA_def_boolean(ot->srna, "cursor_transform", false, "Transform Cursor", "");
764 }
765
766 if ((flags & P_OPTIONS) && !(flags & P_NO_TEXSPACE)) {
767 prop = RNA_def_boolean(
768 ot->srna, "texture_space", false, "Edit Texture Space", "Edit object data texture space");
770 prop = RNA_def_boolean(
771 ot->srna, "remove_on_cancel", false, "Remove on Cancel", "Remove elements on cancel");
773 prop = RNA_def_boolean(ot->srna,
774 "use_duplicated_keyframes",
775 false,
776 "Duplicated Keyframes",
777 "Transform duplicated keyframes");
779 }
780
781 if (flags & P_CORRECT_UV) {
783 ot->srna, "correct_uv", true, "Correct UVs", "Correct UV coordinates when transforming");
784 }
785
786 if (flags & P_CENTER) {
787 /* For gizmos that define their own center. */
788 prop = RNA_def_property(ot->srna, "center_override", PROP_FLOAT, PROP_XYZ);
789 RNA_def_property_array(prop, 3);
791 RNA_def_property_ui_text(prop, "Center Override", "Force using this center value (when set)");
792 }
793
794 if (flags & P_VIEW2D_EDGE_PAN) {
795 prop = RNA_def_boolean(
796 ot->srna, "view2d_edge_pan", false, "Edge Pan", "Enable edge panning in 2D view");
798 }
799
800 if ((flags & P_NO_DEFAULTS) == 0) {
801 prop = RNA_def_boolean(ot->srna,
802 "release_confirm",
803 false,
804 "Confirm on Release",
805 "Always confirm operation when releasing button");
807
808 prop = RNA_def_boolean(
809 ot->srna, "use_accurate", false, "Accurate", "Use accurate transformation");
811 }
812
813 if (flags & P_POST_TRANSFORM) {
814 prop = RNA_def_boolean(ot->srna,
815 "use_automerge_and_split",
816 false,
817 "Auto Merge & Split",
818 "Forces the use of Auto Merge and Split");
820 }
821}
822
849
851{
852 /* Identifiers. */
853 ot->name = "Resize";
854 ot->description = "Scale (resize) selected items";
857
858 /* API callbacks. */
865
867 ot->srna, "value", 3, VecOne, -FLT_MAX, FLT_MAX, "Scale", "", -FLT_MAX, FLT_MAX);
868
869 PropertyRNA *prop;
871 "mouse_dir_constraint",
872 3,
873 VecZero,
874 -FLT_MAX,
875 FLT_MAX,
876 "Mouse Directional Constraint",
877 "",
878 -FLT_MAX,
879 FLT_MAX);
881
883
887}
888
890{
891 /* Identifiers. */
892 ot->name = "Skin Resize";
893 ot->description = "Scale selected vertices' skin radii";
896
897 /* API callbacks. */
904
906 ot->srna, "value", 3, VecOne, -FLT_MAX, FLT_MAX, "Scale", "", -FLT_MAX, FLT_MAX);
907
909
913}
914
916{
917 /* Identifiers. */
918 ot->name = "Trackball";
919 ot->description = "Trackball style rotation of selected items";
922
923 /* API callbacks. */
930
931 /* Maybe we could use float_vector_xyz here too? */
933 ot->srna, "value", 2, nullptr, -FLT_MAX, FLT_MAX, "Angle", "", -FLT_MAX, FLT_MAX);
934
936
938}
939
941{
942 /* Identifiers. */
943 ot->name = "Rotate";
944 ot->description = "Rotate selected items";
947
948 /* API callbacks. */
955
957 ot->srna, "value", 0, nullptr, -FLT_MAX, FLT_MAX, "Angle", "", -M_PI * 2, M_PI * 2);
958
960
964}
965
966static bool tilt_poll(bContext *C)
967{
968 Object *obedit = CTX_data_edit_object(C);
969 if (!obedit) {
970 return false;
971 }
972 if (obedit->type == OB_CURVES_LEGACY) {
973 Curve *cu = (Curve *)obedit->data;
974 return (cu->flag & CU_3D) && (nullptr != cu->editnurb);
975 }
976 if (obedit->type == OB_CURVES) {
977 return true;
978 }
979 return true;
980}
981
983{
984 /* Identifiers. */
985 ot->name = "Tilt";
986 /* Optional -
987 * "Tilt selected vertices"
988 * "Specify an extra axis rotation for selected vertices of 3D curve". */
989 ot->description = "Tilt selected control vertices of 3D curve";
990 ot->idname = OP_TILT;
992
993 /* API callbacks. */
998 ot->poll = tilt_poll;
1000
1002 ot->srna, "value", 0, nullptr, -FLT_MAX, FLT_MAX, "Angle", "", -M_PI * 2, M_PI * 2);
1003
1005
1007}
1008
1010{
1011 /* Identifiers. */
1012 ot->name = "Bend";
1013 ot->description = "Bend selected items between the 3D cursor and the mouse";
1014 ot->idname = OP_BEND;
1015 /* Depend on cursor location because the cursor location is used to define the region to bend. */
1017
1018 /* API callbacks. */
1020 // ot->exec = transform_exec; /* Unsupported. */
1025
1027 ot->srna, "value", 1, nullptr, -FLT_MAX, FLT_MAX, "Angle", "", -M_PI * 2, M_PI * 2);
1028
1030
1032}
1033
1035{
1036 if (!ED_operator_screenactive(C)) {
1037 return false;
1038 }
1039
1040 ScrArea *area = CTX_wm_area(C);
1041 return area && !ELEM(area->spacetype, SPACE_ACTION);
1042}
1043
1045{
1046 /* Identifiers. */
1047 ot->name = "Shear";
1048 ot->description = "Shear selected items along the given axis";
1049 ot->idname = OP_SHEAR;
1051
1052 /* API callbacks. */
1059
1060 RNA_def_float(ot->srna, "value", 0, -FLT_MAX, FLT_MAX, "Offset", "", -FLT_MAX, FLT_MAX);
1061
1063
1067}
1068
1070{
1071 /* Identifiers. */
1072 ot->name = "Push/Pull";
1073 ot->description = "Push/Pull selected items";
1076
1077 /* API callbacks. */
1084
1085 RNA_def_float(ot->srna, "value", 0, -FLT_MAX, FLT_MAX, "Distance", "", -FLT_MAX, FLT_MAX);
1086
1088
1090}
1091
1093{
1094 /* Identifiers. */
1095 ot->name = "Shrink/Fatten";
1096 ot->description = "Shrink/fatten selected vertices along normals";
1099
1100 /* API callbacks. */
1107
1108 RNA_def_float_distance(ot->srna, "value", 0, -FLT_MAX, FLT_MAX, "Offset", "", -FLT_MAX, FLT_MAX);
1109
1111 "use_even_offset",
1112 false,
1113 "Offset Even",
1114 "Scale the offset to give more even thickness");
1115
1117
1119}
1120
1122{
1123 /* Identifiers. */
1124 ot->name = "To Sphere";
1125 ot->description = "Move selected items outward in a spherical shape around geometric center";
1128
1129 /* API callbacks. */
1136
1137 RNA_def_float_factor(ot->srna, "value", 0, 0, 1, "Factor", "", 0, 1);
1138
1140
1142}
1143
1145{
1146 /* Identifiers. */
1147 ot->name = "Mirror";
1148 ot->description = "Mirror selected items around one or more axes";
1149 ot->idname = OP_MIRROR;
1151
1152 /* API callbacks. */
1159
1161}
1162
1164{
1165 /* Identifiers. */
1166 ot->name = "Scale B-Bone";
1167 ot->description = "Scale selected bendy bones display size";
1170
1171 /* API callbacks. */
1178
1180 ot->srna, "value", 3, VecOne, -FLT_MAX, FLT_MAX, "Display Size", "", -FLT_MAX, FLT_MAX);
1181
1183
1185}
1186
1188{
1189 PropertyRNA *prop;
1190
1191 /* Identifiers. */
1192 ot->name = "Edge Slide";
1193 ot->description = "Slide an edge loop along a mesh";
1196
1197 /* API callbacks. */
1204
1205 RNA_def_float_factor(ot->srna, "value", 0, -10.0f, 10.0f, "Factor", "", -1.0f, 1.0f);
1206
1207 prop = RNA_def_boolean(ot->srna, "single_side", false, "Single Side", "");
1210 "use_even",
1211 false,
1212 "Even",
1213 "Make the edge loop match the shape of the adjacent edge loop");
1214
1216
1218 "flipped",
1219 false,
1220 "Flipped",
1221 "When Even mode is active, flips between the two adjacent edge loops");
1222 RNA_def_boolean(ot->srna, "use_clamp", true, "Clamp", "Clamp within the edge extents");
1223
1225}
1226
1228{
1229 /* Identifiers. */
1230 ot->name = "Vertex Slide";
1231 ot->description = "Slide a vertex along a mesh";
1234
1235 /* API callbacks. */
1242
1243 RNA_def_float_factor(ot->srna, "value", 0, -10.0f, 10.0f, "Factor", "", -1.0f, 1.0f);
1245 "use_even",
1246 false,
1247 "Even",
1248 "Make the edge loop match the shape of the adjacent edge loop");
1249
1251
1253 "flipped",
1254 false,
1255 "Flipped",
1256 "When Even mode is active, flips between the two adjacent edge loops");
1257 RNA_def_boolean(ot->srna, "use_clamp", true, "Clamp", "Clamp within the edge extents");
1258
1260}
1261
1263{
1264 /* Identifiers. */
1265 ot->name = "Edge Crease";
1266 ot->description = "Change the crease of edges";
1269
1270 /* API callbacks. */
1277
1278 RNA_def_float_factor(ot->srna, "value", 0, -1.0f, 1.0f, "Factor", "", -1.0f, 1.0f);
1279
1281
1283}
1284
1286{
1287 /* Identifiers. */
1288 ot->name = "Vertex Crease";
1289 ot->description = "Change the crease of vertices";
1292
1293 /* API callbacks. */
1300
1301 RNA_def_float_factor(ot->srna, "value", 0, -1.0f, 1.0f, "Factor", "", -1.0f, 1.0f);
1302
1304
1306}
1307
1309{
1310 /* Identifiers. */
1311 ot->name = "Edge Bevel Weight";
1312 ot->description = "Change the bevel weight of edges";
1315
1316 /* API callbacks. */
1322
1323 RNA_def_float_factor(ot->srna, "value", 0, -1.0f, 1.0f, "Factor", "", -1.0f, 1.0f);
1324
1326
1328}
1329
1331{
1332 /* Identifiers. */
1333 ot->name = "Sequence Slide";
1334 ot->description = "Slide a sequence strip in time";
1337
1338 /* API callbacks. */
1344
1345 /* Properties. */
1346 PropertyRNA *prop;
1347
1348 prop = RNA_def_float_vector(
1349 ot->srna, "value", 2, nullptr, -FLT_MAX, FLT_MAX, "Offset", "", -FLT_MAX, FLT_MAX);
1351
1352 prop = RNA_def_boolean(ot->srna,
1353 "use_restore_handle_selection",
1354 false,
1355 "Restore Handle Selection",
1356 "Restore handle selection after tweaking");
1358
1360
1362}
1363
1365{
1366 /* Identifiers. */
1367 ot->name = "Rotate Normals";
1368 ot->description = "Rotate split normal of selected items";
1371
1372 /* API callbacks. */
1378
1380 ot->srna, "value", 0, nullptr, -FLT_MAX, FLT_MAX, "Angle", "", -M_PI * 2, M_PI * 2);
1381
1383}
1384
1386{
1387 PropertyRNA *prop;
1388
1389 /* Identifiers. */
1390 ot->name = "Transform";
1391 ot->description = "Transform selected items by mode type";
1392 ot->idname = "TRANSFORM_OT_transform";
1394
1395 /* API callbacks. */
1402
1403 prop = RNA_def_enum(
1406
1408 ot->srna, "value", 4, nullptr, -FLT_MAX, FLT_MAX, "Values", "", -FLT_MAX, FLT_MAX);
1409
1411
1415 P_OPTIONS);
1416}
1417
1418static int transform_from_gizmo_invoke(bContext *C, wmOperator * /*op*/, const wmEvent *event)
1419{
1421 if (tref) {
1422 ARegion *region = CTX_wm_region(C);
1423 wmGizmoMap *gzmap = region->gizmo_map;
1424 wmGizmoGroup *gzgroup = gzmap ? WM_gizmomap_group_find(gzmap, "VIEW3D_GGT_xform_gizmo") :
1425 nullptr;
1426 if (gzgroup != nullptr) {
1427 PointerRNA gzg_ptr;
1429 const int drag_action = RNA_enum_get(&gzg_ptr, "drag_action");
1430 const char *op_id = nullptr;
1431 switch (drag_action) {
1433 op_id = "TRANSFORM_OT_translate";
1434 break;
1436 op_id = "TRANSFORM_OT_rotate";
1437 break;
1439 op_id = "TRANSFORM_OT_resize";
1440 break;
1441 default:
1442 break;
1443 }
1444 if (op_id) {
1445 wmOperatorType *ot = WM_operatortype_find(op_id, true);
1446 PointerRNA op_ptr;
1448 RNA_boolean_set(&op_ptr, "release_confirm", true);
1451 return OPERATOR_FINISHED;
1452 }
1453 }
1454 }
1455 return OPERATOR_PASS_THROUGH;
1456}
1457
1458/* Use with 'TRANSFORM_GGT_gizmo'. */
1460{
1461 /* Identifiers. */
1462 ot->name = "Transform from Gizmo";
1463 ot->description = "Transform selected items by mode type";
1464 ot->idname = "TRANSFORM_OT_from_gizmo";
1465 ot->flag = 0;
1466
1467 /* API callbacks. */
1469}
1470
1487
1489{
1490 wmKeyMap *modalmap = transform_modal_keymap(keyconf);
1491
1492 TransformModeItem *tmode;
1493
1494 for (tmode = transform_modes; tmode->idname; tmode++) {
1495 WM_modalkeymap_assign(modalmap, tmode->idname);
1496 }
1497 WM_modalkeymap_assign(modalmap, "TRANSFORM_OT_transform");
1498}
ScrArea * CTX_wm_area(const bContext *C)
Scene * CTX_data_scene(const bContext *C)
Object * CTX_data_edit_object(const bContext *C)
ARegion * CTX_wm_region(const bContext *C)
wmMsgBus * CTX_wm_message_bus(const bContext *C)
View3D * CTX_wm_view3d(const bContext *C)
void BKE_report(ReportList *reports, eReportType type, const char *message)
Definition report.cc:125
void BKE_scene_orientation_slot_set_index(TransformOrientationSlot *orient_slot, int orientation)
Definition scene.cc:2372
#define BLI_assert(a)
Definition BLI_assert.h:50
#define M_PI
MINLINE bool is_zero_v4(const float v[4]) ATTR_WARN_UNUSED_RESULT
#define STRPREFIX(a, b)
#define UNLIKELY(x)
#define ELEM(...)
#define STREQ(a, b)
#define BLT_I18NCONTEXT_ID_CURVE_LEGACY
#define IFACE_(msgid)
@ CU_3D
#define MAX_NAME
Definition DNA_defs.h:50
Object is a sort of wrapper for general info.
@ OB_CURVES_LEGACY
@ OB_CURVES
@ SCE_ORIENT_DEFAULT
@ SCE_SELECT_FACE
@ SCE_SELECT_VERTEX
@ SCE_SELECT_EDGE
@ SCE_SNAP_TO_INCREMENT
@ SPACE_ACTION
@ SPACE_NLA
@ SPACE_VIEW3D
@ RV3D_NAVIGATING
@ V3D_GIZMO_SHOW_OBJECT_ROTATE
@ V3D_GIZMO_SHOW_OBJECT_SCALE
@ V3D_GIZMO_SHOW_OBJECT_TRANSLATE
@ V3D_ORIENT_CUSTOM
@ OP_IS_MODAL_GRAB_CURSOR
@ OPERATOR_RUNNING_MODAL
@ OPERATOR_PASS_THROUGH
bool EDBM_selectmode_set_multi(bContext *C, short selectmode)
bool ED_operator_screenactive(bContext *C)
bool ED_operator_object_active(bContext *C)
bool ED_operator_sequencer_active(bContext *C)
bool ED_operator_view3d_active(bContext *C)
bool ED_operator_region_view3d_active(bContext *C)
bool ED_operator_areaactive(bContext *C)
bool ED_operator_editmesh(bContext *C)
#define P_PROPORTIONAL
#define P_CURSOR_EDIT
#define P_CENTER
#define P_ALIGN_SNAP
#define P_NO_DEFAULTS
#define P_POST_TRANSFORM
#define P_VIEW2D_EDGE_PAN
void BIF_removeTransformOrientationIndex(bContext *C, int index)
#define P_CORRECT_UV
eTfmMode
@ TFM_RESIZE
@ TFM_EDGE_SLIDE
@ TFM_BONESIZE
@ TFM_SKIN_RESIZE
@ TFM_SHEAR
@ TFM_SHRINKFATTEN
@ TFM_TIME_TRANSLATE
@ TFM_TIME_SLIDE
@ TFM_BAKE_TIME
@ TFM_VERT_CREASE
@ TFM_VERT_SLIDE
@ TFM_BEND
@ TFM_ROTATION
@ TFM_BONE_ENVELOPE
@ TFM_BWEIGHT
@ TFM_ALIGN
@ TFM_TIME_SCALE
@ TFM_BONE_ROLL
@ TFM_TIME_EXTEND
@ TFM_GPENCIL_SHRINKFATTEN
@ TFM_CURVE_SHRINKFATTEN
@ TFM_TILT
@ TFM_INIT
@ TFM_SEQ_SLIDE
@ TFM_TOSPHERE
@ TFM_EDGE_CREASE
@ TFM_GPENCIL_OPACITY
@ TFM_MIRROR
@ TFM_TRANSLATION
@ TFM_MASK_SHRINKFATTEN
@ TFM_BONE_ENVELOPE_DIST
@ TFM_NORMAL_ROTATION
@ TFM_DUMMY
@ TFM_PUSHPULL
@ TFM_TRACKBALL
bool BIF_createTransformOrientation(bContext *C, ReportList *reports, const char *name, bool use_view, bool activate, bool overwrite)
#define P_ORIENT_MATRIX
#define P_ORIENT_AXIS_ORTHO
#define P_NO_TEXSPACE
#define P_MIRROR
#define P_CONSTRAINT
#define P_SNAP
#define P_GEO_SNAP
#define P_GPENCIL_EDIT
#define P_ORIENT_AXIS
#define P_MIRROR_DUMMY
#define P_OPTIONS
bool ED_view3d_navigation_do(bContext *C, ViewOpsData *vod, const wmEvent *event, const float depth_loc_override[3])
Read Guarded memory(de)allocation.
const EnumPropertyItem * rna_TransformOrientation_itemf(bContext *C, PointerRNA *ptr, PropertyRNA *prop, bool *r_free)
@ PROP_FLOAT
Definition RNA_types.hh:67
@ PROP_ENUM
Definition RNA_types.hh:69
@ PROP_ENUM_FLAG
Definition RNA_types.hh:293
@ PROP_SKIP_SAVE
Definition RNA_types.hh:245
@ PROP_HIDDEN
Definition RNA_types.hh:239
@ PROP_XYZ
Definition RNA_types.hh:172
@ PROP_NONE
Definition RNA_types.hh:136
#define C
Definition RandGen.cpp:29
void UI_popup_menu_end(bContext *C, uiPopupMenu *pup)
uiPopupMenu * UI_popup_menu_begin(bContext *C, const char *title, int icon) ATTR_NONNULL()
uiLayout * UI_popup_menu_layout(uiPopupMenu *pup)
void uiItemsEnumO(uiLayout *layout, const char *opname, const char *propname)
#define WM_toolsystem_ref_properties_ensure_from_gizmo_group(tref, gzgroup, r_ptr)
@ OPTYPE_BLOCKING
Definition WM_types.hh:164
@ OPTYPE_DEPENDS_ON_CURSOR
Definition WM_types.hh:198
@ OPTYPE_UNDO
Definition WM_types.hh:162
@ OPTYPE_REGISTER
Definition WM_types.hh:160
#define NC_SCENE
Definition WM_types.hh:345
#define ND_TOOLSETTINGS
Definition WM_types.hh:416
#define NA_EDITED
Definition WM_types.hh:550
#define ND_TRANSFORM
Definition WM_types.hh:423
@ WM_OP_INVOKE_DEFAULT
Definition WM_types.hh:218
#define ND_SPACE_VIEW3D
Definition WM_types.hh:494
#define NC_OBJECT
Definition WM_types.hh:346
#define NC_SPACE
Definition WM_types.hh:359
void transformApply(bContext *C, TransInfo *t)
void saveTransform(bContext *C, TransInfo *t, wmOperator *op)
bool initTransform(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *event, int mode)
wmKeyMap * transform_modal_keymap(wmKeyConfig *keyconf)
int transformEvent(TransInfo *t, wmOperator *op, const wmEvent *event)
int transformEnd(bContext *C, TransInfo *t)
void MEM_freeN(void *vmemh)
Definition mallocn.cc:105
void *(* MEM_callocN)(size_t len, const char *str)
Definition mallocn.cc:42
#define G(x, y, z)
VecBase< float, 2 > float2
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
void RNA_boolean_set(PointerRNA *ptr, const char *name, bool value)
bool RNA_property_is_set(PointerRNA *ptr, PropertyRNA *prop)
void RNA_property_boolean_get_array(PointerRNA *ptr, PropertyRNA *prop, bool *values)
bool RNA_property_boolean_get(PointerRNA *ptr, PropertyRNA *prop)
void RNA_string_get(PointerRNA *ptr, const char *name, char *value)
bool RNA_struct_property_is_set(PointerRNA *ptr, const char *identifier)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
int RNA_enum_get(PointerRNA *ptr, const char *name)
const char * RNA_property_identifier(const PropertyRNA *prop)
PropertyRNA * RNA_def_float_factor(StructOrFunctionRNA *cont_, const char *identifier, const float default_value, const float hardmin, const float hardmax, const char *ui_name, const char *ui_description, const float softmin, const float softmax)
PropertyRNA * RNA_def_string(StructOrFunctionRNA *cont_, const char *identifier, const char *default_value, const int maxlen, const char *ui_name, const char *ui_description)
void RNA_def_property_enum_default(PropertyRNA *prop, int value)
void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *description)
PropertyRNA * RNA_def_float_rotation(StructOrFunctionRNA *cont_, const char *identifier, const int len, const float *default_value, const float hardmin, const float hardmax, const char *ui_name, const char *ui_description, const float softmin, const float softmax)
PropertyRNA * RNA_def_float_distance(StructOrFunctionRNA *cont_, const char *identifier, const float default_value, const float hardmin, const float hardmax, const char *ui_name, const char *ui_description, const float softmin, const float softmax)
PropertyRNA * RNA_def_float_translation(StructOrFunctionRNA *cont_, const char *identifier, const int len, const float *default_value, const float hardmin, const float hardmax, const char *ui_name, const char *ui_description, const float softmin, const float softmax)
PropertyRNA * RNA_def_float_matrix(StructOrFunctionRNA *cont_, const char *identifier, const int rows, const int columns, const float *default_value, const float hardmin, const float hardmax, const char *ui_name, const char *ui_description, const float softmin, const float softmax)
PropertyRNA * RNA_def_float(StructOrFunctionRNA *cont_, const char *identifier, const float default_value, const float hardmin, const float hardmax, const char *ui_name, const char *ui_description, const float softmin, const float softmax)
PropertyRNA * RNA_def_float_vector(StructOrFunctionRNA *cont_, const char *identifier, const int len, const float *default_value, const float hardmin, const float hardmax, const char *ui_name, const char *ui_description, const float softmin, const float softmax)
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, const int default_value, const char *ui_name, const char *ui_description)
PropertyRNA * RNA_def_boolean_vector(StructOrFunctionRNA *cont_, const char *identifier, const int len, const bool *default_value, const char *ui_name, const char *ui_description)
void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item)
void RNA_def_property_array(PropertyRNA *prop, int length)
PropertyRNA * RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier, int type, int subtype)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, const bool default_value, const char *ui_name, const char *ui_description)
void RNA_def_property_translation_context(PropertyRNA *prop, const char *context)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
void RNA_def_enum_funcs(PropertyRNA *prop, EnumPropertyItemFunc itemfunc)
void RNA_def_property_ui_range(PropertyRNA *prop, double min, double max, double step, int precision)
const EnumPropertyItem rna_enum_axis_xyz_items[]
const EnumPropertyItem rna_enum_proportional_falloff_items[]
Definition rna_scene.cc:97
const EnumPropertyItem rna_enum_snap_source_items[]
Definition rna_scene.cc:89
const EnumPropertyItem rna_enum_snap_element_items[]
Definition rna_scene.cc:153
#define FLT_MAX
Definition stdcycles.h:14
void * regiondata
EditNurb * editnurb
bool precision
Definition transform.hh:387
eTfmMode mode
Definition transform.hh:517
const char * undo_name
Definition transform.hh:679
ViewOpsData * vod
Definition transform.hh:673
eRedrawFlag redraw
Definition transform.hh:529
float values[4]
Definition transform.hh:624
float values_modal_offset[4]
Definition transform.hh:627
eTState state
Definition transform.hh:527
eTModifier modifiers
Definition transform.hh:525
eTFlag flag
Definition transform.hh:523
ARegion * region
Definition transform.hh:652
MouseInput mouse
Definition transform.hh:543
bContext * context
Definition transform.hh:649
float center_global[3]
Definition transform.hh:555
blender::float2 mval
Definition transform.hh:663
eTContext options
Definition transform.hh:521
void(* opfunc)(wmOperatorType *)
const char * idname
int mval[2]
Definition WM_types.hh:728
short type
Definition WM_types.hh:722
wmGizmoGroupType * type
const char * name
Definition WM_types.hh:990
bool(* poll_property)(const bContext *C, wmOperator *op, const PropertyRNA *prop) ATTR_WARN_UNUSED_RESULT
Definition WM_types.hh:1048
bool(* poll)(bContext *C) ATTR_WARN_UNUSED_RESULT
Definition WM_types.hh:1042
const char * idname
Definition WM_types.hh:992
int(* modal)(bContext *C, wmOperator *op, const wmEvent *event) ATTR_WARN_UNUSED_RESULT
Definition WM_types.hh:1036
int(* invoke)(bContext *C, wmOperator *op, const wmEvent *event) ATTR_WARN_UNUSED_RESULT
Definition WM_types.hh:1022
int(* exec)(bContext *C, wmOperator *op) ATTR_WARN_UNUSED_RESULT
Definition WM_types.hh:1006
const char * description
Definition WM_types.hh:996
StructRNA * srna
Definition WM_types.hh:1080
void(* cancel)(bContext *C, wmOperator *op)
Definition WM_types.hh:1028
struct ReportList * reports
struct wmOperator * prev
struct wmOperatorType * type
struct PointerRNA * ptr
struct wmOperator * opm
void transform_input_virtual_mval_reset(TransInfo *t)
void applyMouseInput(TransInfo *t, MouseInput *mi, const blender::float2 &mval, float output[3])
@ CTX_AUTOCONFIRM
Definition transform.hh:78
@ MOD_PRECISION
Definition transform.hh:162
void transformViewUpdate(TransInfo *t)
@ TREDRAW_HARD
Definition transform.hh:217
@ T_NO_CURSOR_WRAP
Definition transform.hh:144
@ TRANS_CANCEL
Definition transform.hh:210
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 bool delete_orientation_poll(bContext *C)
static void TRANSFORM_OT_vert_crease(wmOperatorType *ot)
static const char OP_ROTATION[]
static const char OP_TILT[]
static const char OP_TOSPHERE[]
static void transformops_loopsel_hack(bContext *C, wmOperator *op)
static const char OP_RESIZE[]
static const char OP_MIRROR[]
static void TRANSFORM_OT_mirror(wmOperatorType *ot)
static const char OP_SKIN_RESIZE[]
static const char OP_SHEAR[]
static const char OP_EDGE_BWEIGHT[]
static void TRANSFORM_OT_shrink_fatten(wmOperatorType *ot)
static void TRANSFORM_OT_trackball(wmOperatorType *ot)
static void TRANSFORM_OT_bbone_resize(wmOperatorType *ot)
static TransformModeItem transform_modes[]
static void TRANSFORM_OT_vert_slide(wmOperatorType *ot)
static const char OP_EDGE_SLIDE[]
static bool tilt_poll(bContext *C)
static void TRANSFORM_OT_edge_bevelweight(wmOperatorType *ot)
static void TRANSFORM_OT_create_orientation(wmOperatorType *ot)
static int transform_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static const char OP_EDGE_CREASE[]
static const float VecOne[3]
static bool transform_shear_poll(bContext *C)
void Transform_Properties(wmOperatorType *ot, int flags)
static const char OP_TRANSLATION[]
static void TRANSFORM_OT_tilt(wmOperatorType *ot)
static void TRANSFORM_OT_bend(wmOperatorType *ot)
static int transform_exec(bContext *C, wmOperator *op)
static void TRANSFORM_OT_transform(wmOperatorType *ot)
static void TRANSFORM_OT_push_pull(wmOperatorType *ot)
static void TRANSFORM_OT_select_orientation(wmOperatorType *ot)
static int transform_modal(bContext *C, wmOperator *op, const wmEvent *event)
static const char OP_PUSH_PULL[]
static const char OP_SEQ_SLIDE[]
static void transform_cancel(bContext *C, wmOperator *op)
static void TRANSFORM_OT_delete_orientation(wmOperatorType *ot)
static void TRANSFORM_OT_tosphere(wmOperatorType *ot)
static const char OP_BEND[]
static void TRANSFORM_OT_edge_slide(wmOperatorType *ot)
static int create_orientation_exec(bContext *C, wmOperator *op)
static void TRANSFORM_OT_rotate_normal(wmOperatorType *ot)
static const char OP_TRACKBALL[]
static void TRANSFORM_OT_skin_resize(wmOperatorType *ot)
static int select_orientation_exec(bContext *C, wmOperator *op)
static void transformops_exit(bContext *C, wmOperator *op)
static void TRANSFORM_OT_edge_crease(wmOperatorType *ot)
static int transform_from_gizmo_invoke(bContext *C, wmOperator *, const wmEvent *event)
static bool transform_poll_property(const bContext *C, wmOperator *op, const PropertyRNA *prop)
static int transformops_mode(wmOperator *op)
static int delete_orientation_invoke(bContext *C, wmOperator *op, const wmEvent *)
static const char OP_SHRINK_FATTEN[]
void ED_keymap_transform(wmKeyConfig *keyconf)
static int delete_orientation_exec(bContext *C, wmOperator *)
void transform_operatortypes()
static const char OP_NORMAL_ROTATION[]
static void TRANSFORM_OT_from_gizmo(wmOperatorType *ot)
static void TRANSFORM_OT_resize(wmOperatorType *ot)
static const float VecZero[3]
static void TRANSFORM_OT_seq_slide(wmOperatorType *ot)
static int select_orientation_invoke(bContext *C, wmOperator *, const wmEvent *)
static const char OP_BONE_SIZE[]
static void TRANSFORM_OT_translate(wmOperatorType *ot)
static void TRANSFORM_OT_shear(wmOperatorType *ot)
static int transformops_data(bContext *C, wmOperator *op, const wmEvent *event)
static const char OP_VERT_SLIDE[]
const EnumPropertyItem rna_enum_transform_mode_type_items[]
static void TRANSFORM_OT_rotate(wmOperatorType *ot)
static const char OP_VERT_CREASE[]
void WM_operator_type_set(wmOperator *op, wmOperatorType *ot)
Definition wm.cc:329
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.cc:4125
wmGizmoGroup * WM_gizmomap_group_find(wmGizmoMap *gzmap, const char *idname)
void WM_modalkeymap_assign(wmKeyMap *km, const char *opname)
#define WM_msg_publish_rna_prop(mbus, id_, data_, type_, prop_)
void WM_operatortype_props_advanced_begin(wmOperatorType *ot)
void WM_operatortype_append(void(*opfunc)(wmOperatorType *))
wmOperatorType * WM_operatortype_find(const char *idname, bool quiet)
void WM_operator_properties_create_ptr(PointerRNA *ptr, wmOperatorType *ot)
void WM_operator_properties_free(PointerRNA *ptr)
bToolRef * WM_toolsystem_ref_from_context(const bContext *C)