Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/transform/transform_generics.c
| Show First 20 Lines • Show All 77 Lines • ▼ Show 20 Lines | |||||
| #include "BKE_nla.h" | #include "BKE_nla.h" | ||||
| #include "BKE_context.h" | #include "BKE_context.h" | ||||
| #include "BKE_paint.h" | #include "BKE_paint.h" | ||||
| #include "BKE_sequencer.h" | #include "BKE_sequencer.h" | ||||
| #include "BKE_editmesh.h" | #include "BKE_editmesh.h" | ||||
| #include "BKE_tracking.h" | #include "BKE_tracking.h" | ||||
| #include "BKE_mask.h" | #include "BKE_mask.h" | ||||
| #include "BKE_utildefines.h" | #include "BKE_utildefines.h" | ||||
| #include "BKE_workspace.h" | |||||
| #include "ED_anim_api.h" | #include "ED_anim_api.h" | ||||
| #include "ED_armature.h" | #include "ED_armature.h" | ||||
| #include "ED_image.h" | #include "ED_image.h" | ||||
| #include "ED_keyframing.h" | #include "ED_keyframing.h" | ||||
| #include "ED_markers.h" | #include "ED_markers.h" | ||||
| #include "ED_mesh.h" | #include "ED_mesh.h" | ||||
| #include "ED_object.h" | #include "ED_object.h" | ||||
| ▲ Show 20 Lines • Show All 1,143 Lines • ▼ Show 20 Lines | if (t->spacetype == SPACE_VIEW3D) { | ||||
| t->around = v3d->around; | t->around = v3d->around; | ||||
| /* bend always uses the cursor */ | /* bend always uses the cursor */ | ||||
| if (t->mode == TFM_BEND) { | if (t->mode == TFM_BEND) { | ||||
| t->around = V3D_AROUND_CURSOR; | t->around = V3D_AROUND_CURSOR; | ||||
| } | } | ||||
| t->current_orientation = v3d->twmode; | t->current_orientation = v3d->twmode; | ||||
| t->custom_orientation = v3d->custom_orientation; | |||||
| /* exceptional case */ | /* exceptional case */ | ||||
| if (t->around == V3D_AROUND_LOCAL_ORIGINS) { | if (t->around == V3D_AROUND_LOCAL_ORIGINS) { | ||||
| if (ELEM(t->mode, TFM_ROTATION, TFM_RESIZE, TFM_TRACKBALL)) { | if (ELEM(t->mode, TFM_ROTATION, TFM_RESIZE, TFM_TRACKBALL)) { | ||||
| const bool use_island = transdata_check_local_islands(t, t->around); | const bool use_island = transdata_check_local_islands(t, t->around); | ||||
| if (obedit && !use_island) { | if (obedit && !use_island) { | ||||
| t->options |= CTX_NO_PET; | t->options |= CTX_NO_PET; | ||||
| ▲ Show 20 Lines • Show All 74 Lines • ▼ Show 20 Lines | else { | ||||
| t->view = NULL; | t->view = NULL; | ||||
| } | } | ||||
| t->around = V3D_AROUND_CENTER_BOUNDS; | t->around = V3D_AROUND_CENTER_BOUNDS; | ||||
| } | } | ||||
| if (op && ((prop = RNA_struct_find_property(op->ptr, "constraint_orientation")) && | if (op && ((prop = RNA_struct_find_property(op->ptr, "constraint_orientation")) && | ||||
| RNA_property_is_set(op->ptr, prop))) | RNA_property_is_set(op->ptr, prop))) | ||||
| { | { | ||||
| t->current_orientation = RNA_property_enum_get(op->ptr, prop); | short orientation = RNA_property_enum_get(op->ptr, prop); | ||||
| TransformOrientation *custom_orientation = NULL; | |||||
| if (t->current_orientation >= V3D_MANIP_CUSTOM + BIF_countTransformOrientation(C)) { | if (orientation >= V3D_MANIP_CUSTOM) { | ||||
| t->current_orientation = V3D_MANIP_GLOBAL; | if (orientation >= V3D_MANIP_CUSTOM + BIF_countTransformOrientation(C)) { | ||||
| orientation = V3D_MANIP_GLOBAL; | |||||
| } | } | ||||
| else { | |||||
| WorkSpace *workspace = CTX_wm_workspace(C); | |||||
| ListBase *transform_orientations = BKE_workspace_transform_orientations_get(workspace); | |||||
| custom_orientation = BLI_findlink(transform_orientations, orientation - V3D_MANIP_CUSTOM); | |||||
| orientation = V3D_MANIP_CUSTOM; | |||||
| } | |||||
| } | |||||
| t->current_orientation = orientation; | |||||
| t->custom_orientation = custom_orientation; | |||||
| } | } | ||||
| if (op && ((prop = RNA_struct_find_property(op->ptr, "release_confirm")) && | if (op && ((prop = RNA_struct_find_property(op->ptr, "release_confirm")) && | ||||
| RNA_property_is_set(op->ptr, prop))) | RNA_property_is_set(op->ptr, prop))) | ||||
| { | { | ||||
| if (RNA_property_boolean_get(op->ptr, prop)) { | if (RNA_property_boolean_get(op->ptr, prop)) { | ||||
| t->flag |= T_RELEASE_CONFIRM; | t->flag |= T_RELEASE_CONFIRM; | ||||
| } | } | ||||
| } | } | ||||
| else { | else { | ||||
| ▲ Show 20 Lines • Show All 804 Lines • Show Last 20 Lines | |||||