Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/transform/transform_generics.c
| Show First 20 Lines • Show All 138 Lines • ▼ Show 20 Lines | |||||
| } | } | ||||
| static void *t_view_get(TransInfo *t) | static void *t_view_get(TransInfo *t) | ||||
| { | { | ||||
| if (t->spacetype == SPACE_VIEW3D) { | if (t->spacetype == SPACE_VIEW3D) { | ||||
| View3D *v3d = t->area->spacedata.first; | View3D *v3d = t->area->spacedata.first; | ||||
| return (void *)v3d; | return (void *)v3d; | ||||
| } | } | ||||
| else if (t->region) { | if (t->region) { | ||||
| return (void *)&t->region->v2d; | return (void *)&t->region->v2d; | ||||
| } | } | ||||
| return NULL; | return NULL; | ||||
| } | } | ||||
| static int t_around_get(TransInfo *t) | static int t_around_get(TransInfo *t) | ||||
| { | { | ||||
| if (t->flag & T_OVERRIDE_CENTER) { | if (t->flag & T_OVERRIDE_CENTER) { | ||||
| /* Avoid initialization of individual origins (#V3D_AROUND_LOCAL_ORIGINS). */ | /* Avoid initialization of individual origins (#V3D_AROUND_LOCAL_ORIGINS). */ | ||||
| return V3D_AROUND_CENTER_BOUNDS; | return V3D_AROUND_CENTER_BOUNDS; | ||||
| } | } | ||||
| ScrArea *area = t->area; | ScrArea *area = t->area; | ||||
| if (t->spacetype == SPACE_VIEW3D) { | switch (t->spacetype) { | ||||
| /* Bend always uses the cursor. */ | case SPACE_VIEW3D: { | ||||
| if (t->mode == TFM_BEND) { | if (t->mode == TFM_BEND) { | ||||
| /* Bend always uses the cursor. */ | |||||
| return V3D_AROUND_CURSOR; | return V3D_AROUND_CURSOR; | ||||
| } | } | ||||
| else { | |||||
| return t->settings->transform_pivot_point; | return t->settings->transform_pivot_point; | ||||
| } | } | ||||
| } | case SPACE_IMAGE: { | ||||
| else if (t->spacetype == SPACE_IMAGE) { | |||||
| SpaceImage *sima = area->spacedata.first; | SpaceImage *sima = area->spacedata.first; | ||||
| return sima->around; | return sima->around; | ||||
| } | } | ||||
| else if (t->spacetype == SPACE_GRAPH) { | case SPACE_GRAPH: { | ||||
| SpaceGraph *sipo = area->spacedata.first; | SpaceGraph *sipo = area->spacedata.first; | ||||
| return sipo->around; | return sipo->around; | ||||
| } | } | ||||
| else if (t->spacetype == SPACE_CLIP) { | case SPACE_CLIP: { | ||||
| SpaceClip *sclip = area->spacedata.first; | SpaceClip *sclip = area->spacedata.first; | ||||
| return sclip->around; | return sclip->around; | ||||
| } | } | ||||
| else if (t->spacetype == SPACE_SEQ && t->region->regiontype == RGN_TYPE_PREVIEW) { | case SPACE_SEQ: { | ||||
| if (t->region->regiontype == RGN_TYPE_PREVIEW) { | |||||
| return SEQ_tool_settings_pivot_point_get(t->scene); | return SEQ_tool_settings_pivot_point_get(t->scene); | ||||
| } | } | ||||
| break; | |||||
| } | |||||
| default: | |||||
| break; | |||||
| } | |||||
| return V3D_AROUND_CENTER_BOUNDS; | return V3D_AROUND_CENTER_BOUNDS; | ||||
| } | } | ||||
| /** | /** | ||||
| * Setup internal data, mouse, vectors | * Setup internal data, mouse, vectors | ||||
| * | * | ||||
| * \note \a op and \a event can be NULL | * \note \a op and \a event can be NULL | ||||
| ▲ Show 20 Lines • Show All 1,247 Lines • Show Last 20 Lines | |||||