From b12d46f73e448ef2bdefe854a32bcb1f8cb0e74e Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 26 Apr 2011 10:38:18 +0000 Subject: - fix for player linking - added notes to release todo's. - renamed view3d view transform matching functions. - added assert in edge split modifier to make a certain bug easier to spot. --- source/blender/editors/include/ED_view3d.h | 4 ++-- source/blender/editors/space_view3d/view3d_edit.c | 2 +- source/blender/editors/space_view3d/view3d_view.c | 14 +++++++------- source/blender/makesrna/intern/rna_space.c | 2 +- source/blender/modifiers/intern/MOD_edgesplit.c | 4 ++++ source/blenderplayer/bad_level_call_stubs/stubs.c | 1 + 6 files changed, 16 insertions(+), 11 deletions(-) diff --git a/source/blender/editors/include/ED_view3d.h b/source/blender/editors/include/ED_view3d.h index 6729295e07d..c84c0e83626 100644 --- a/source/blender/editors/include/ED_view3d.h +++ b/source/blender/editors/include/ED_view3d.h @@ -185,8 +185,8 @@ unsigned int ED_viewedit_datamask(struct bScreen *screen); /* assigning view matrix */ -void view3d_settings_from_mat(float mat[][4], float *ofs, float *quat, float *dist); -void view3d_settings_from_ob(struct Object *ob, float *ofs, float *quat, float *dist, float *lens); +void view3d_apply_mat4(float mat[][4], float *ofs, float *quat, float *dist); +void view3d_apply_ob(struct Object *ob, float *ofs, float *quat, float *dist, float *lens); int view3d_is_ortho(struct View3D *v3d, struct RegionView3D *rv3d); #endif /* ED_VIEW3D_H */ diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index b377bb20baa..56aae79f145 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -790,7 +790,7 @@ static int viewrotate_invoke(bContext *C, wmOperator *op, wmEvent *event) View3D *v3d = vod->sa->spacedata.first; if(v3d->camera) { - view3d_settings_from_ob(v3d->camera, rv3d->ofs, rv3d->viewquat, &rv3d->dist, NULL); + view3d_apply_ob(v3d->camera, rv3d->ofs, rv3d->viewquat, &rv3d->dist, NULL); } if(rv3d->persp==RV3D_CAMOB) { diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c index 46e1dd2d7cc..ccf250c53b6 100644 --- a/source/blender/editors/space_view3d/view3d_view.c +++ b/source/blender/editors/space_view3d/view3d_view.c @@ -135,7 +135,7 @@ static void object_lens_clip_settings(Object *ob, float *lens, float *clipsta, f * * The dist is not modified for this function, if NULL its assimed zero * */ -void view3d_settings_from_mat(float mat[][4], float *ofs, float *quat, float *dist) +void view3d_apply_mat4(float mat[][4], float *ofs, float *quat, float *dist) { /* Offset */ if (ofs) @@ -164,9 +164,9 @@ void view3d_settings_from_mat(float mat[][4], float *ofs, float *quat, float *di } } -void view3d_settings_from_ob(Object *ob, float *ofs, float *quat, float *dist, float *lens) +void view3d_apply_ob(Object *ob, float *ofs, float *quat, float *dist, float *lens) { - view3d_settings_from_mat(ob->obmat, ofs, quat, dist); + view3d_apply_mat4(ob->obmat, ofs, quat, dist); if (lens) { object_lens_clip_settings(ob, lens, NULL, NULL); @@ -211,7 +211,7 @@ void smooth_view(bContext *C, Object *oldcamera, Object *camera, float *ofs, flo if(lens) sms.new_lens= *lens; if (camera) { - view3d_settings_from_ob(camera, sms.new_ofs, sms.new_quat, &sms.new_dist, &sms.new_lens); + view3d_apply_ob(camera, sms.new_ofs, sms.new_quat, &sms.new_dist, &sms.new_lens); sms.to_camera= 1; /* restore view3d values in end */ } @@ -236,7 +236,7 @@ void smooth_view(bContext *C, Object *oldcamera, Object *camera, float *ofs, flo /* original values */ if (oldcamera) { sms.orig_dist= rv3d->dist; // below function does weird stuff with it... - view3d_settings_from_ob(oldcamera, sms.orig_ofs, sms.orig_quat, &sms.orig_dist, &sms.orig_lens); + view3d_apply_ob(oldcamera, sms.orig_ofs, sms.orig_quat, &sms.orig_dist, &sms.orig_lens); } else { copy_v3_v3(sms.orig_ofs, rv3d->ofs); @@ -1188,7 +1188,7 @@ static void obmat_to_viewmat(View3D *v3d, RegionView3D *rv3d, Object *ob, short rv3d->persp=RV3D_PERSP; rv3d->dist= 0.0; - view3d_settings_from_ob(v3d->camera, rv3d->ofs, NULL, NULL, &v3d->lens); + view3d_apply_ob(v3d->camera, rv3d->ofs, NULL, NULL, &v3d->lens); smooth_view(NULL, NULL, NULL, orig_ofs, new_quat, &orig_dist, &orig_lens); // XXX rv3d->persp=RV3D_CAMOB; /* just to be polite, not needed */ @@ -1931,7 +1931,7 @@ void view3d_align_axis_to_vector(View3D *v3d, RegionView3D *rv3d, int axisidx, f copy_v3_v3(orig_ofs, rv3d->ofs); rv3d->persp= RV3D_PERSP; rv3d->dist= 0.0; - view3d_settings_from_ob(v3d->camera, rv3d->ofs, NULL, NULL, &v3d->lens); + view3d_apply_ob(v3d->camera, rv3d->ofs, NULL, NULL, &v3d->lens); smooth_view(NULL, NULL, NULL, orig_ofs, new_quat, &orig_dist, &orig_lens); // XXX } else { if (rv3d->persp==RV3D_CAMOB) rv3d->persp= RV3D_PERSP; /* switch out of camera mode */ diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index ba33fc7feda..5e261fa2d18 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -400,7 +400,7 @@ static void rna_RegionView3D_view_matrix_set(PointerRNA *ptr, const float *value { RegionView3D *rv3d= (RegionView3D *)(ptr->data); negate_v3_v3(rv3d->ofs, values); - view3d_settings_from_mat((float (*)[4])values, rv3d->ofs, rv3d->viewquat, &rv3d->dist); + view3d_apply_mat4((float (*)[4])values, rv3d->ofs, rv3d->viewquat, &rv3d->dist); } /* Space Image Editor */ diff --git a/source/blender/modifiers/intern/MOD_edgesplit.c b/source/blender/modifiers/intern/MOD_edgesplit.c index 25a8625b342..8d0aea41b5c 100644 --- a/source/blender/modifiers/intern/MOD_edgesplit.c +++ b/source/blender/modifiers/intern/MOD_edgesplit.c @@ -38,6 +38,8 @@ /* EdgeSplit modifier: Splits edges in the mesh according to sharpness flag * or edge angle (can be used to achieve autosmoothing) */ +#include + #include "DNA_meshdata_types.h" #include "BLI_listbase.h" @@ -125,6 +127,8 @@ static SmoothVert *smoothvert_copy(SmoothVert *vert, SmoothMesh *mesh) { SmoothVert *copy = &mesh->verts[mesh->num_verts]; + assert(vert != NULL); + if(mesh->num_verts >= mesh->max_verts) { printf("Attempted to add a SmoothMesh vert beyond end of array\n"); return NULL; diff --git a/source/blenderplayer/bad_level_call_stubs/stubs.c b/source/blenderplayer/bad_level_call_stubs/stubs.c index 728557bc99b..60d6698de05 100644 --- a/source/blenderplayer/bad_level_call_stubs/stubs.c +++ b/source/blenderplayer/bad_level_call_stubs/stubs.c @@ -241,6 +241,7 @@ void ED_node_generic_update(struct Main *bmain, struct bNodeTree *ntree, struct void ED_view3d_scene_layers_update(struct Main *bmain, struct Scene *scene){} int ED_view3d_scene_layer_set(int lay, const int *values){return 0;} void ED_view3d_quadview_update(struct ScrArea *sa, struct ARegion *ar){} +void view3d_apply_mat4(float mat[][4], float *ofs, float *quat, float *dist){} int text_file_modified(struct Text *text){return 0;} void ED_node_shader_default(struct Material *ma){} void ED_screen_animation_timer_update(struct bContext *C, int redraws){} -- cgit v1.2.3