- 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.
This commit is contained in:
Campbell Barton
2011-04-26 10:38:18 +00:00
parent e4cc1c3f2c
commit b12d46f73e
6 changed files with 16 additions and 11 deletions

View File

@@ -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 */

View File

@@ -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) {

View File

@@ -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 */

View File

@@ -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 */

View File

@@ -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 <assert.h>
#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;

View File

@@ -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){}