diff options
author | Joerg Mueller <nexyon@gmail.com> | 2011-08-03 16:44:52 +0400 |
---|---|---|
committer | Joerg Mueller <nexyon@gmail.com> | 2011-08-03 16:44:52 +0400 |
commit | eb9d591898e93dbbe9e28865018175b9da730596 (patch) | |
tree | 3209caefe505273e834a936e54f6146a4185e83b /source | |
parent | 6d7490632f13f9744c6b3e507c838a34f3481846 (diff) | |
parent | f1fb54e126824ff38b8bf26fa80f3f46c886bd45 (diff) |
* Merging trunk up to r38981.
* Fixing a minor issue in a previous commit.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/include/BIF_glutil.h | 2 | ||||
-rw-r--r-- | source/blender/editors/include/ED_transform.h | 1 | ||||
-rw-r--r-- | source/blender/editors/screen/glutil.c | 38 | ||||
-rw-r--r-- | source/blender/editors/space_image/image_ops.c | 10 | ||||
-rw-r--r-- | source/blender/editors/space_outliner/outliner_tree.c | 3 | ||||
-rw-r--r-- | source/blender/editors/space_sequencer/sequencer_draw.c | 19 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/view3d_view.c | 2 | ||||
-rw-r--r-- | source/blender/editors/transform/transform.c | 14 | ||||
-rw-r--r-- | source/blender/editors/transform/transform_generics.c | 16 | ||||
-rw-r--r-- | source/blender/editors/transform/transform_ops.c | 13 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_userdef_types.h | 3 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_scene.c | 2 | ||||
-rw-r--r-- | source/blender/render/intern/source/rendercore.c | 2 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_event_system.c | 25 |
14 files changed, 125 insertions, 25 deletions
diff --git a/source/blender/editors/include/BIF_glutil.h b/source/blender/editors/include/BIF_glutil.h index c9615204607..27bd31c20ff 100644 --- a/source/blender/editors/include/BIF_glutil.h +++ b/source/blender/editors/include/BIF_glutil.h @@ -52,6 +52,8 @@ void fdrawXORcirc(float xofs, float yofs, float rad); /* glStipple defines */ extern unsigned char stipple_halftone[128]; extern unsigned char stipple_quarttone[128]; +extern unsigned char stipple_diag_stripes_pos[128]; +extern unsigned char stipple_diag_stripes_neg[128]; /** * Draw a lined (non-looping) arc with the given diff --git a/source/blender/editors/include/ED_transform.h b/source/blender/editors/include/ED_transform.h index d4d7f971b74..00ae7dda2e3 100644 --- a/source/blender/editors/include/ED_transform.h +++ b/source/blender/editors/include/ED_transform.h @@ -148,6 +148,7 @@ void BIF_selectOrientation(void); #define P_ALIGN_SNAP (P_GEO_SNAP|(1 << 5)) #define P_CONSTRAINT (1 << 6) #define P_OPTIONS (1 << 7) +#define P_CORRECT_UV (1 << 8) void Transform_Properties(struct wmOperatorType *ot, int flags); diff --git a/source/blender/editors/screen/glutil.c b/source/blender/editors/screen/glutil.c index 2918c98c84a..f56ae17d366 100644 --- a/source/blender/editors/screen/glutil.c +++ b/source/blender/editors/screen/glutil.c @@ -92,6 +92,44 @@ GLubyte stipple_quarttone[128] = { 136,136,136,136,0,0,0,0,34,34,34,34,0,0,0,0}; +GLubyte stipple_diag_stripes_pos[128] = { + 0x00, 0xff, 0x00, 0xff, 0x01, 0xfe, 0x01, 0xfe, + 0x03, 0xfc, 0x03, 0xfc, 0x07, 0xf8, 0x07, 0xf8, + 0x0f, 0xf0, 0x0f, 0xf0, 0x1f, 0xe0, 0x1f, 0xe0, + 0x3f, 0xc0, 0x3f, 0xc0, 0x7f, 0x80, 0x7f, 0x80, + 0xff, 0x00, 0xff, 0x00, 0xfe, 0x01, 0xfe, 0x01, + 0xfc, 0x03, 0xfc, 0x03, 0xf8, 0x07, 0xf8, 0x07, + 0xf0, 0x0f, 0xf0, 0x0f, 0xe0, 0x1f, 0xe0, 0x1f, + 0xc0, 0x3f, 0xc0, 0x3f, 0x80, 0x7f, 0x80, 0x7f, + 0x00, 0xff, 0x00, 0xff, 0x01, 0xfe, 0x01, 0xfe, + 0x03, 0xfc, 0x03, 0xfc, 0x07, 0xf8, 0x07, 0xf8, + 0x0f, 0xf0, 0x0f, 0xf0, 0x1f, 0xe0, 0x1f, 0xe0, + 0x3f, 0xc0, 0x3f, 0xc0, 0x7f, 0x80, 0x7f, 0x80, + 0xff, 0x00, 0xff, 0x00, 0xfe, 0x01, 0xfe, 0x01, + 0xfc, 0x03, 0xfc, 0x03, 0xf8, 0x07, 0xf8, 0x07, + 0xf0, 0x0f, 0xf0, 0x0f, 0xe0, 0x1f, 0xe0, 0x1f, + 0xc0, 0x3f, 0xc0, 0x3f, 0x80, 0x7f, 0x80, 0x7f}; + + +GLubyte stipple_diag_stripes_neg[128] = { + 0xff, 0x00, 0xff, 0x00, 0xfe, 0x01, 0xfe, 0x01, + 0xfc, 0x03, 0xfc, 0x03, 0xf8, 0x07, 0xf8, 0x07, + 0xf0, 0x0f, 0xf0, 0x0f, 0xe0, 0x1f, 0xe0, 0x1f, + 0xc0, 0x3f, 0xc0, 0x3f, 0x80, 0x7f, 0x80, 0x7f, + 0x00, 0xff, 0x00, 0xff, 0x01, 0xfe, 0x01, 0xfe, + 0x03, 0xfc, 0x03, 0xfc, 0x07, 0xf8, 0x07, 0xf8, + 0x0f, 0xf0, 0x0f, 0xf0, 0x1f, 0xe0, 0x1f, 0xe0, + 0x3f, 0xc0, 0x3f, 0xc0, 0x7f, 0x80, 0x7f, 0x80, + 0xff, 0x00, 0xff, 0x00, 0xfe, 0x01, 0xfe, 0x01, + 0xfc, 0x03, 0xfc, 0x03, 0xf8, 0x07, 0xf8, 0x07, + 0xf0, 0x0f, 0xf0, 0x0f, 0xe0, 0x1f, 0xe0, 0x1f, + 0xc0, 0x3f, 0xc0, 0x3f, 0x80, 0x7f, 0x80, 0x7f, + 0x00, 0xff, 0x00, 0xff, 0x01, 0xfe, 0x01, 0xfe, + 0x03, 0xfc, 0x03, 0xfc, 0x07, 0xf8, 0x07, 0xf8, + 0x0f, 0xf0, 0x0f, 0xf0, 0x1f, 0xe0, 0x1f, 0xe0, + 0x3f, 0xc0, 0x3f, 0xc0, 0x7f, 0x80, 0x7f, 0x80}; + + void fdrawbezier(float vec[4][3]) { float dist; diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index 6e84c1a7f0c..e0ebde589a8 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -452,14 +452,10 @@ static int view_ndof_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *event) wmNDOFMotionData* ndof = (wmNDOFMotionData*) event->customdata; - float dt = ndof->dt > 0.25f ? 0.0125f : ndof->dt; - /* this is probably the first event for this motion, so set dt to something reasonable - * TODO: replace such guesswork with a flag or field from the NDOF manager - */ - + float dt = ndof->dt; /* tune these until it feels right */ - const float zoom_sensitivity = 0.5f; - const float pan_sensitivity = 300.f; + const float zoom_sensitivity = 0.5f; // 50% per second (I think) + const float pan_sensitivity = 300.f; // screen pixels per second float pan_x = pan_sensitivity * dt * ndof->tvec[0] / sima->zoom; float pan_y = pan_sensitivity * dt * ndof->tvec[1] / sima->zoom; diff --git a/source/blender/editors/space_outliner/outliner_tree.c b/source/blender/editors/space_outliner/outliner_tree.c index 0c6ef67d603..24b7085e2f4 100644 --- a/source/blender/editors/space_outliner/outliner_tree.c +++ b/source/blender/editors/space_outliner/outliner_tree.c @@ -719,7 +719,8 @@ static void outliner_add_id_contents(SpaceOops *soops, TreeElement *te, TreeStor { Speaker *spk= (Speaker *)id; - outliner_add_element(soops, &te->subtree, spk->adt, te, TSE_ANIM_DATA, 0); + if(spk->adt) + outliner_add_element(soops, &te->subtree, spk, te, TSE_ANIM_DATA, 0); } break; case ID_WO: diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c index 42d52536870..7e4207c75fe 100644 --- a/source/blender/editors/space_sequencer/sequencer_draw.c +++ b/source/blender/editors/space_sequencer/sequencer_draw.c @@ -640,6 +640,25 @@ static void draw_seq_strip(Scene *scene, ARegion *ar, Sequence *seq, int outline /* draw sound wave */ if(seq->type == SEQ_SOUND) drawseqwave(scene, seq, x1, y1, x2, y2, (ar->v2d.cur.xmax - ar->v2d.cur.xmin)/ar->winx); + /* draw lock */ + if(seq->flag & SEQ_LOCK) { + glEnable(GL_POLYGON_STIPPLE); + glEnable(GL_BLEND); + + /* light stripes */ + glColor4ub(255, 255, 255, 32); + glPolygonStipple(stipple_diag_stripes_pos); + glRectf(x1, y1, x2, y2); + + /* dark stripes */ + glColor4ub(0, 0, 0, 32); + glPolygonStipple(stipple_diag_stripes_neg); + glRectf(x1, y1, x2, y2); + + glDisable(GL_POLYGON_STIPPLE); + glDisable(GL_BLEND); + } + get_seq_color3ubv(scene, seq, col); if (G.moving && (seq->flag & SELECT)) { if(seq->flag & SEQ_OVERLAP) { diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c index eeaf87757ce..ed0b2645c99 100644 --- a/source/blender/editors/space_view3d/view3d_view.c +++ b/source/blender/editors/space_view3d/view3d_view.c @@ -1190,7 +1190,7 @@ int ED_view3d_lock(RegionView3D *rv3d) return TRUE; } -/* dont set windows active in in here, is used by renderwin too */ +/* dont set windows active in here, is used by renderwin too */ void setviewmatrixview3d(Scene *scene, View3D *v3d, RegionView3D *rv3d) { if(rv3d->persp==RV3D_CAMOB) { /* obs/camera */ diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index cb3b72468fe..f43bcdde9b4 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -4264,7 +4264,7 @@ static int createSlideVerts(TransInfo *t) /* UV correction vars */ GHash **uvarray= NULL; SlideData *sld = MEM_callocN(sizeof(*sld), "sld"); - int uvlay_tot= CustomData_number_of_layers(&em->fdata, CD_MTFACE); + const int uvlay_tot= (t->settings->uvcalc_flag & UVCALC_TRANSFORM_CORRECT) ? CustomData_number_of_layers(&em->fdata, CD_MTFACE) : 0; int uvlay_idx; TransDataSlideUv *slideuvs=NULL, *suv=NULL, *suv_last=NULL; RegionView3D *v3d = t->ar ? t->ar->regiondata : NULL; /* background mode support */ @@ -4636,7 +4636,7 @@ static int createSlideVerts(TransInfo *t) sld->end[0] = (int) end[0]; sld->end[1] = (int) end[1]; - if (uvlay_tot) { // XXX && (scene->toolsettings->uvcalc_flag & UVCALC_TRANSFORM_CORRECT)) { + if (uvlay_tot) { int maxnum = 0; uvarray = MEM_callocN( uvlay_tot * sizeof(GHash *), "SlideUVs Array"); @@ -4826,8 +4826,6 @@ void initEdgeSlide(TransInfo *t) int doEdgeSlide(TransInfo *t, float perc) { - Mesh *me= t->obedit->data; - EditMesh *em = me->edit_mesh; SlideData *sld = t->customData; EditVert *ev, *nearest = sld->nearest; EditVert *centerVert, *upVert, *downVert; @@ -4838,7 +4836,7 @@ int doEdgeSlide(TransInfo *t, float perc) int prop=1, flip=0; /* UV correction vars */ GHash **uvarray= sld->uvhash; - int uvlay_tot= CustomData_number_of_layers(&em->fdata, CD_MTFACE); + const int uvlay_tot= sld->uvlay_tot; int uvlay_idx; TransDataSlideUv *suv; float uv_tmp[2]; @@ -4864,7 +4862,7 @@ int doEdgeSlide(TransInfo *t, float perc) tempev = editedge_getOtherVert((perc>=0)?tempsv->up:tempsv->down, ev); interp_v3_v3v3(ev->co, tempsv->origvert.co, tempev->co, fabs(perc)); - if (uvlay_tot) { // XXX scene->toolsettings->uvcalc_flag & UVCALC_TRANSFORM_CORRECT) { + if (uvlay_tot) { for (uvlay_idx=0; uvlay_idx<uvlay_tot; uvlay_idx++) { suv = BLI_ghash_lookup( uvarray[uvlay_idx], ev ); if (suv && suv->fuv_list && suv->uv_up && suv->uv_down) { @@ -4894,7 +4892,7 @@ int doEdgeSlide(TransInfo *t, float perc) if(newlen < 0.0f) {newlen = 0.0;} if(flip == 0) { interp_v3_v3v3(ev->co, editedge_getOtherVert(tempsv->down,ev)->co, editedge_getOtherVert(tempsv->up,ev)->co, fabs(newlen)); - if (uvlay_tot) { // XXX scene->toolsettings->uvcalc_flag & UVCALC_TRANSFORM_CORRECT) { + if (uvlay_tot) { /* dont do anything if no UVs */ for (uvlay_idx=0; uvlay_idx<uvlay_tot; uvlay_idx++) { suv = BLI_ghash_lookup( uvarray[uvlay_idx], ev ); @@ -4911,7 +4909,7 @@ int doEdgeSlide(TransInfo *t, float perc) } else{ interp_v3_v3v3(ev->co, editedge_getOtherVert(tempsv->up,ev)->co, editedge_getOtherVert(tempsv->down,ev)->co, fabs(newlen)); - if (uvlay_tot) { // XXX scene->toolsettings->uvcalc_flag & UVCALC_TRANSFORM_CORRECT) { + if (uvlay_tot) { /* dont do anything if no UVs */ for (uvlay_idx=0; uvlay_idx<uvlay_tot; uvlay_idx++) { suv = BLI_ghash_lookup( uvarray[uvlay_idx], ev ); diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c index 09031839702..a43fc6a31e5 100644 --- a/source/blender/editors/transform/transform_generics.c +++ b/source/blender/editors/transform/transform_generics.c @@ -1037,6 +1037,22 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event) t->options |= CTX_NO_PET; } } + + /* initialize UV transform from */ + if (RNA_struct_find_property(op->ptr, "correct_uv")) { + if(RNA_property_is_set(op->ptr, "correct_uv")) { + if(RNA_boolean_get(op->ptr, "correct_uv")) { + t->settings->uvcalc_flag |= UVCALC_TRANSFORM_CORRECT; + } + else { + t->settings->uvcalc_flag &= ~UVCALC_TRANSFORM_CORRECT; + } + } + else { + RNA_boolean_set(op->ptr, "correct_uv", t->settings->uvcalc_flag & UVCALC_TRANSFORM_CORRECT); + } + } + } else if(t->spacetype==SPACE_IMAGE) { diff --git a/source/blender/editors/transform/transform_ops.c b/source/blender/editors/transform/transform_ops.c index 4765bc77bf1..ead920321a4 100644 --- a/source/blender/editors/transform/transform_ops.c +++ b/source/blender/editors/transform/transform_ops.c @@ -360,11 +360,17 @@ static int transform_modal(bContext *C, wmOperator *op, wmEvent *event) TransInfo *t = op->customdata; + #if 0 + // stable 2D mouse coords map to different 3D coords while the 3D mouse is active + // in other words, 2D deltas are no longer good enough! + // disable until individual 'transformers' behave better + if (event->type == NDOF_MOTION) { /* puts("transform_modal: passing through NDOF_MOTION"); */ return OPERATOR_PASS_THROUGH; } + #endif /* XXX insert keys are called here, and require context */ t->context= C; @@ -502,6 +508,11 @@ void Transform_Properties(struct wmOperatorType *ot, int flags) RNA_def_boolean(ot->srna, "texture_space", 0, "Edit Object data texture space", ""); } + if (flags & P_CORRECT_UV) + { + RNA_def_boolean(ot->srna, "correct_uv", 0, "Correct UV coords when transforming", ""); + } + // Add confirm method all the time. At the end because it's not really that important and should be hidden only in log, not in keymap edit /*prop =*/ RNA_def_boolean(ot->srna, "release_confirm", 0, "Confirm on Release", "Always confirm operation when releasing button"); //RNA_def_property_flag(prop, PROP_HIDDEN); @@ -749,7 +760,7 @@ void TRANSFORM_OT_edge_slide(struct wmOperatorType *ot) RNA_def_float_factor(ot->srna, "value", 0, -1.0f, 1.0f, "Factor", "", -1.0f, 1.0f); - Transform_Properties(ot, P_MIRROR|P_SNAP); + Transform_Properties(ot, P_MIRROR|P_SNAP|P_CORRECT_UV); } void TRANSFORM_OT_edge_crease(struct wmOperatorType *ot) diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h index b5a1a36e126..85a64e02ddb 100644 --- a/source/blender/makesdna/DNA_userdef_types.h +++ b/source/blender/makesdna/DNA_userdef_types.h @@ -601,6 +601,9 @@ extern UserDef U; /* from blenkernel blender.c */ /* actually... users probably don't care about what the mode is called, just that it feels right */ #define NDOF_ORBIT_INVERT_AXES (1 << 6) +/* zoom is up/down if this flag is set (otherwise forward/backward) */ +#define NDOF_ZOOM_UPDOWN (1 << 7) +#define NDOF_INVERT_ZOOM (1 << 8) #ifdef __cplusplus diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index f2618280fa2..4b33d23cfe2 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -3291,7 +3291,7 @@ void RNA_def_scene(BlenderRNA *brna) RNA_def_property_int_sdna(prop, NULL, "r.cfra"); RNA_def_property_range(prop, MINAFRAME, MAXFRAME); RNA_def_property_int_funcs(prop, NULL, "rna_Scene_current_frame_set", NULL); - RNA_def_property_ui_text(prop, "Current Frame", "Current Frame"); + RNA_def_property_ui_text(prop, "Current Frame", "Current Frame, to update animation data from python frame_set() instead"); RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); RNA_def_property_update(prop, NC_SCENE|ND_FRAME, "rna_Scene_frame_update"); diff --git a/source/blender/render/intern/source/rendercore.c b/source/blender/render/intern/source/rendercore.c index a7e19c8db4f..c08d6c0f456 100644 --- a/source/blender/render/intern/source/rendercore.c +++ b/source/blender/render/intern/source/rendercore.c @@ -730,7 +730,7 @@ static void atm_tile(RenderPart *pa, RenderLayer *rl) if(zpass==NULL) return; - /* check for at least one sun lamp that its atmosphere flag is is enabled */ + /* check for at least one sun lamp that its atmosphere flag is enabled */ for(go=R.lights.first; go; go= go->next) { lar= go->lampren; if(lar->type==LA_SUN && lar->sunsky && (lar->sunsky->effect_type & LA_SUN_EFFECT_AP)) diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index 0abae2e06b7..2f0c1a72be9 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -2324,12 +2324,27 @@ static void attach_ndof_data(wmEvent* event, const GHOST_TEventNDOFMotionData* g const float s = U.ndof_sensitivity; data->tvec[0]= s * ghost->tx; - data->tvec[1]= s * ghost->ty; - data->tvec[2]= s * ghost->tz; - data->rvec[0]= s * ghost->rx; - data->rvec[1]= s * ghost->ry; - data->rvec[2]= s * ghost->rz; + + if (U.ndof_flag & NDOF_ZOOM_UPDOWN) + { + // swap Y and Z + data->tvec[1]= s * ghost->tz; + data->tvec[2]= s * ghost->ty; + + // should this affect rotation also? + // initial guess is 'yes', but get user feedback immediately! + data->rvec[1]= s * ghost->rz; + data->rvec[2]= s * ghost->ry; + } + else + { + data->tvec[1]= s * ghost->ty; + data->tvec[2]= s * ghost->tz; + + data->rvec[1]= s * ghost->ry; + data->rvec[2]= s * ghost->rz; + } data->dt = ghost->dt; |