diff options
author | Ton Roosendaal <ton@blender.org> | 2009-01-19 19:54:41 +0300 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2009-01-19 19:54:41 +0300 |
commit | bc63213844e723b0c552da446fb7fa9f9e7ea5f6 (patch) | |
tree | 433519ee3526536032e62226a058f6ec4fd17a1a /source/blender/editors/transform/transform_orientations.c | |
parent | 9b049d89a1bc36534875c67e097415e034d0624d (diff) |
2.5
View3D has been split now in a local part (RegionView3D) and a
per-area part (old View3D). Currently local is:
- view transform
- camera zoom/offset
- gpencil (todo)
- custom clipping planes
Rest is in Area still, like active camera, draw type, layers,
localview, custom centers, around-settings, transform widget,
gridlines, and so on (mostly stuff as available in header).
To see it work; also added new feature for region split,
press SHIFT+ALT+CTRL+S for four-split.
The idea is to make a preset 4-split, configured to stick
to top/right/front views for three views.
Another cool idea to explore is to then box-clip all drawing
based on these 3 views.
Note about the code:
- currently view3d still stores some depricated settings, to
convert from older files. Not all settings are copied over
though, like custom clip planes or the 'lock view to object'.
- since some view3d ops are now on area level, the operators
for it should keep track of that.
Bugfix in transform: quat initialize in operator-invoke missed
one zero.
Als brought back GE to compile for missing Ipos and channels.
Diffstat (limited to 'source/blender/editors/transform/transform_orientations.c')
-rw-r--r-- | source/blender/editors/transform/transform_orientations.c | 38 |
1 files changed, 20 insertions, 18 deletions
diff --git a/source/blender/editors/transform/transform_orientations.c b/source/blender/editors/transform/transform_orientations.c index 5fe45f2e94a..908357e8277 100644 --- a/source/blender/editors/transform/transform_orientations.c +++ b/source/blender/editors/transform/transform_orientations.c @@ -177,7 +177,7 @@ int manageMeshSpace(bContext *C, int confirm, int set) { } if (createSpaceNormal(mat, normal) == 0) { - error("Cannot use vertex with zero-length normal"); +// XXX error("Cannot use vertex with zero-length normal"); return -1; } @@ -189,7 +189,7 @@ int manageMeshSpace(bContext *C, int confirm, int set) { } if (createSpaceNormalTangent(mat, normal, plane) == 0) { - error("Cannot use zero-length edge"); +// XXX error("Cannot use zero-length edge"); return -1; } @@ -201,7 +201,7 @@ int manageMeshSpace(bContext *C, int confirm, int set) { } if (createSpaceNormalTangent(mat, normal, plane) == 0) { - error("Cannot use zero-area face"); +// XXX error("Cannot use zero-area face"); return -1; } @@ -335,7 +335,7 @@ void BIF_removeTransformOrientation(bContext *C, TransformOrientation *target) { void BIF_selectTransformOrientation(bContext *C, TransformOrientation *target) { ListBase *transform_spaces = &CTX_data_scene(C)->transform_spaces; - View3D *v3d = CTX_wm_area(C)->spacedata.first; + View3D *v3d = CTX_wm_view3d(C); TransformOrientation *ts = transform_spaces->first; int i; @@ -348,7 +348,7 @@ void BIF_selectTransformOrientation(bContext *C, TransformOrientation *target) { } void BIF_selectTransformOrientationValue(bContext *C, int orientation) { - View3D *v3d = CTX_wm_area(C)->spacedata.first; + View3D *v3d = CTX_wm_view3d(C); v3d->twmode = orientation; } @@ -387,7 +387,8 @@ int BIF_countTransformOrientation(const bContext *C) { void applyTransformOrientation(bContext *C, TransInfo *t) { TransformOrientation *ts; - View3D *v3d = CTX_wm_area(C)->spacedata.first; + View3D *v3d = CTX_wm_view3d(C); + RegionView3D *rv3d= CTX_wm_region_view3d(C); int selected_index = (v3d->twmode - V3D_MANIP_CUSTOM); int i; @@ -396,7 +397,7 @@ void applyTransformOrientation(bContext *C, TransInfo *t) { if (selected_index == i) { strcpy(t->spacename, ts->name); Mat3CpyMat3(t->spacemtx, ts->mat); - Mat4CpyMat3(v3d->twmat, ts->mat); + Mat4CpyMat3(rv3d->twmat, ts->mat); break; } } @@ -429,7 +430,8 @@ static int count_bone_select(bArmature *arm, ListBase *lb, int do_it) void initTransformOrientation(bContext *C, TransInfo *t) { - View3D *v3d = CTX_wm_area(C)->spacedata.first; + View3D *v3d = CTX_wm_view3d(C); + RegionView3D *rv3d= CTX_wm_region_view3d(C); Object *ob = CTX_data_active_object(C); Object *obedit = CTX_data_active_object(C); float normal[3]={0.0, 0.0, 0.0}; @@ -479,28 +481,28 @@ void initTransformOrientation(bContext *C, TransInfo *t) if (type == ORIENTATION_NONE) { - Mat4One(v3d->twmat); + Mat4One(rv3d->twmat); } else { - Mat4CpyMat3(v3d->twmat, mat); + Mat4CpyMat3(rv3d->twmat, mat); } break; } /* no break we define 'normal' as 'local' in Object mode */ case V3D_MANIP_LOCAL: strcpy(t->spacename, "local"); - Mat4CpyMat4(v3d->twmat, ob->obmat); - Mat4Ortho(v3d->twmat); + Mat4CpyMat4(rv3d->twmat, ob->obmat); + Mat4Ortho(rv3d->twmat); break; case V3D_MANIP_VIEW: { float mat[3][3]; strcpy(t->spacename, "view"); - Mat3CpyMat4(mat, v3d->viewinv); + Mat3CpyMat4(mat, rv3d->viewinv); Mat3Ortho(mat); - Mat4CpyMat3(v3d->twmat, mat); + Mat4CpyMat3(rv3d->twmat, mat); } break; default: /* V3D_MANIP_CUSTOM */ @@ -512,8 +514,7 @@ void initTransformOrientation(bContext *C, TransInfo *t) int getTransformOrientation(bContext *C, float normal[3], float plane[3], int activeOnly) { Scene *scene = CTX_data_scene(C); - ScrArea *sa = CTX_wm_area(C); - View3D *v3d = sa->spacedata.first; + View3D *v3d = CTX_wm_view3d(C); Object *obedit= CTX_data_edit_object(C); Base *base; Object *ob = OBACT; @@ -730,11 +731,11 @@ int getTransformOrientation(bContext *C, float normal[3], float plane[3], int ac } else if(obedit->type==OB_MBALL) { +#if 0 // XXX /* editmball.c */ extern ListBase editelems; /* go away ! */ MetaElem *ml, *ml_sel = NULL; -#if 0 // XXX /* loop and check that only one element is selected */ for (ml = editelems.first; ml; ml = ml->next) { @@ -750,7 +751,6 @@ int getTransformOrientation(bContext *C, float normal[3], float plane[3], int ac } } } -#endif if (ml_sel) { @@ -766,6 +766,8 @@ int getTransformOrientation(bContext *C, float normal[3], float plane[3], int ac result = ORIENTATION_NORMAL; } +#endif + } else if (obedit->type == OB_ARMATURE) { |