svn merge -r40197:40311 ^/trunk/blender

This commit is contained in:
2011-09-18 02:35:26 +00:00
144 changed files with 1460 additions and 757 deletions

View File

@@ -117,7 +117,7 @@ static void make_localact_apply_cb(ID *id, AnimData *adt, void *mlac_ptr)
tMakeLocalActionContext *mlac = (tMakeLocalActionContext *)mlac_ptr;
if (adt->action == mlac->act) {
if (id->lib==0) {
if (id->lib == NULL) {
adt->action = mlac->actn;
id_us_plus(&mlac->actn->id);
@@ -524,7 +524,6 @@ void copy_pose (bPose **dst, bPose *src, int copycon)
if (copycon) {
copy_constraints(&listb, &pchan->constraints, TRUE); // copy_constraints NULLs listb
pchan->constraints= listb;
pchan->path= NULL; // XXX remove this line when the new motionpaths are ready... (depreceated code)
pchan->mpath= NULL; /* motion paths should not get copied yet... */
}
@@ -595,17 +594,12 @@ void free_pose_channels_hash(bPose *pose)
void free_pose_channel(bPoseChannel *pchan)
{
// XXX this case here will need to be removed when the new motionpaths are ready
if (pchan->path) {
MEM_freeN(pchan->path);
pchan->path= NULL;
}
if (pchan->mpath) {
animviz_free_motionpath(pchan->mpath);
pchan->mpath= NULL;
}
free_constraints(&pchan->constraints);
if (pchan->prop) {

View File

@@ -1143,11 +1143,11 @@ static void face_duplilist(ListBase *lb, ID *id, Scene *scene, Object *par, floa
w= (mv4)? 0.25f: 1.0f/3.0f;
if(orco) {
VECADDFAC(dob->orco, dob->orco, orco[mv1], w);
VECADDFAC(dob->orco, dob->orco, orco[mv2], w);
VECADDFAC(dob->orco, dob->orco, orco[mv3], w);
madd_v3_v3v3fl(dob->orco, dob->orco, orco[mv1], w);
madd_v3_v3v3fl(dob->orco, dob->orco, orco[mv2], w);
madd_v3_v3v3fl(dob->orco, dob->orco, orco[mv3], w);
if(mv4)
VECADDFAC(dob->orco, dob->orco, orco[mv4], w);
madd_v3_v3v3fl(dob->orco, dob->orco, orco[mv4], w);
}
if(mtface) {

View File

@@ -1483,7 +1483,6 @@ static void pose_proxy_synchronize(Object *ob, Object *from, int layer_protected
pchanw.next= pchan->next;
pchanw.parent= pchan->parent;
pchanw.child= pchan->child;
pchanw.path= NULL;
/* this is freed so copy a copy, else undo crashes */
if(pchanw.prop) {

View File

@@ -2021,7 +2021,7 @@ static int cloth_collision_moving_edges ( ClothModifierData *clmd, CollisionModi
{
if(edgecollpair.p21==6 || edgecollpair.p22 == 6)
{
printf("dist: %f, sol[k]: %lf, sol2[k]: %lf\n", distance, solution[k], solution2[k]);
printf("dist: %f, sol[k]: %f, sol2[k]: %f\n", distance, solution[k], solution2[k]);
printf("a1: %f, a2: %f, b1: %f, b2: %f\n", x1[0], x2[0], x3[0], v1[0]);
printf("b21: %d, b22: %d\n", edgecollpair.p21, edgecollpair.p22);
}

View File

@@ -2167,7 +2167,7 @@ static void actcon_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstraint
if (data->type < 10) {
/* extract rotation (is in whatever space target should be in) */
mat4_to_eul(vec, tempmat);
mul_v3_fl(vec, (float)(180.0/M_PI)); /* rad -> deg */
mul_v3_fl(vec, RAD2DEGF(1.0f)); /* rad -> deg */
axis= data->type;
}
else if (data->type < 20) {
@@ -3325,7 +3325,7 @@ static void transform_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
break;
case 1: /* rotation (convert to degrees first) */
mat4_to_eulO(dvec, cob->rotOrder, ct->matrix);
mul_v3_fl(dvec, (float)(180.0/M_PI)); /* rad -> deg */
mul_v3_fl(dvec, RAD2DEGF(1.0f)); /* rad -> deg */
break;
default: /* location */
copy_v3_v3(dvec, ct->matrix[3]);

View File

@@ -1924,7 +1924,7 @@ static void make_bevel_list_3D_minimum_twist(BevList *bl)
/* flip rotation if needs be */
cross_v3_v3v3(cross_tmp, vec_1, vec_2);
normalize_v3(cross_tmp);
if(angle_normalized_v3v3(bevp_first->dir, cross_tmp) < 90.0f/(float)(180.0/M_PI))
if(angle_normalized_v3v3(bevp_first->dir, cross_tmp) < DEG2RADF(90.0f))
angle = -angle;
bevp2= (BevPoint *)(bl+1);

View File

@@ -571,7 +571,7 @@ float effector_falloff(EffectorCache *eff, EffectorData *efd, EffectedPoint *UNU
if(falloff == 0.0f)
break;
r_fac=saacos(fac/len_v3(efd->vec_to_point))*180.0f/(float)M_PI;
r_fac= RAD2DEGF(saacos(fac/len_v3(efd->vec_to_point)));
falloff*= falloff_func_rad(eff->pd, r_fac);
break;

View File

@@ -592,7 +592,7 @@ void BKE_image_print_memlist(void)
for(ima= G.main->image.first; ima; ima= ima->id.next)
totsize += image_mem_size(ima);
printf("\ntotal image memory len: %.3lf MB\n", (double)totsize/(double)(1024*1024));
printf("\ntotal image memory len: %.3f MB\n", (double)totsize/(double)(1024*1024));
for(ima= G.main->image.first; ima; ima= ima->id.next) {
size= image_mem_size(ima);

View File

@@ -942,7 +942,7 @@ static char *get_rna_access (int blocktype, int adrcode, char actname[], char co
sprintf(buf, "sequence_editor.sequences_all[\"%s\"]", seq->name+2);
}
else
strcpy(buf, ""); /* empty string */
buf[0]= '\0'; /* empty string */
BLI_dynstr_append(path, buf);
/* need to add dot before property if there was anything precceding this */

View File

@@ -290,27 +290,15 @@ struct SortContext
const int* trisToFacesMap;
};
#ifdef FREE_WINDOWS
static SortContext *_mingw_context;
/* XXX: not thread-safe, but it's called only from modifiers stack
which isn't threaded. Anyway, better to avoid this in the future */
static SortContext *_qsort_context;
static int compareByData(const void * a, const void * b)
{
return ( _mingw_context->recastData[_mingw_context->trisToFacesMap[*(int*)a]] -
_mingw_context->recastData[_mingw_context->trisToFacesMap[*(int*)b]] );
return ( _qsort_context->recastData[_qsort_context->trisToFacesMap[*(int*)a]] -
_qsort_context->recastData[_qsort_context->trisToFacesMap[*(int*)b]] );
}
#else
#if defined(_MSC_VER)
static int compareByData(void* data, const void * a, const void * b)
#elif defined(__APPLE__) || defined(__FreeBSD__)
static int compareByData(void* data, const void * a, const void * b)
#else
static int compareByData(const void * a, const void * b, void* data)
#endif
{
const SortContext* context = (const SortContext*)data;
return ( context->recastData[context->trisToFacesMap[*(int*)a]] -
context->recastData[context->trisToFacesMap[*(int*)b]] );
}
#endif
bool buildNavMeshData(const int nverts, const float* verts,
const int ntris, const unsigned short *tris,
@@ -333,16 +321,8 @@ bool buildNavMeshData(const int nverts, const float* verts,
SortContext context;
context.recastData = recastData;
context.trisToFacesMap = trisToFacesMap;
#if defined(_MSC_VER)
qsort_s(trisMapping, ntris, sizeof(int), compareByData, &context);
#elif defined(__APPLE__) || defined(__FreeBSD__)
qsort_r(trisMapping, ntris, sizeof(int), &context, compareByData);
#elif defined(FREE_WINDOWS)
_mingw_context = &context;
_qsort_context = &context;
qsort(trisMapping, ntris, sizeof(int), compareByData);
#else
qsort_r(trisMapping, ntris, sizeof(int), compareByData, &context);
#endif
//search first valid triangle - triangle of convex polygon
int validTriStart = -1;
for (int i=0; i< ntris; i++)

View File

@@ -1051,9 +1051,9 @@ void ntreeMakeLocal(bNodeTree *ntree)
if(ntree->id.lib==NULL) return;
if(ntree->id.us==1) {
ntree->id.lib= 0;
ntree->id.lib= NULL;
ntree->id.flag= LIB_LOCAL;
new_id(0, (ID *)ntree, 0);
new_id(NULL, (ID *)ntree, NULL);
return;
}
@@ -1069,7 +1069,7 @@ void ntreeMakeLocal(bNodeTree *ntree)
if(cd.local && cd.lib==0) {
ntree->id.lib= NULL;
ntree->id.flag= LIB_LOCAL;
new_id(0, (ID *)ntree, 0);
new_id(NULL, (ID *)ntree, NULL);
}
else if(cd.local && cd.lib) {
/* this is the mixed case, we copy the tree and assign it to local users */
@@ -1438,7 +1438,7 @@ static void ntree_update_link_pointers(bNodeTree *ntree)
}
}
void ntree_validate_links(bNodeTree *ntree)
static void ntree_validate_links(bNodeTree *ntree)
{
bNodeTreeType *ntreetype = ntreeGetType(ntree->type);
bNodeLink *link;

View File

@@ -418,7 +418,7 @@ void unlink_object(Object *ob)
for (ct= targets.first; ct; ct= ct->next) {
if (ct->tar == ob) {
ct->tar = NULL;
strcpy(ct->subtarget, "");
ct->subtarget[0]= '\0';
obt->recalc |= OB_RECALC_DATA;
}
}
@@ -448,7 +448,7 @@ void unlink_object(Object *ob)
for (ct= targets.first; ct; ct= ct->next) {
if (ct->tar == ob) {
ct->tar = NULL;
strcpy(ct->subtarget, "");
ct->subtarget[0]= '\0';
obt->recalc |= OB_RECALC_DATA;
}
}

View File

@@ -2542,7 +2542,7 @@ static void psys_thread_create_path(ParticleThread *thread, struct ChildParticle
normalize_v3(v1);
normalize_v3(v2);
d = saacos(dot_v3v3(v1, v2)) * 180.0f/(float)M_PI;
d = RAD2DEGF(saacos(dot_v3v3(v1, v2)));
}
if(p_max > p_min)

View File

@@ -277,8 +277,7 @@ void BKE_area_region_free(SpaceType *st, ARegion *ar)
ar->v2d.tab_offset= NULL;
}
if(ar)
BLI_freelistN(&ar->panels);
BLI_freelistN(&ar->panels);
}
/* not area itself */

View File

@@ -2132,7 +2132,7 @@ static void do_transform(Scene *scene, Sequence *seq, float UNUSED(facf0), int x
}
// Rotate
rotate_radians = ((float)M_PI*transform->rotIni)/180.0f;
rotate_radians = DEG2RADF(transform->rotIni);
transform_image(x,y, ibuf1, out, scale_x, scale_y, translate_x, translate_y, rotate_radians, transform->interpolation);
}

View File

@@ -345,7 +345,7 @@ static int unit_as_string(char *str, int len_max, double value, int prec, bUnitC
/* Convert to a string */
{
len= BLI_snprintf(str, len_max, "%.*lf", prec, value_conv);
len= BLI_snprintf(str, len_max, "%.*f", prec, value_conv);
if(len >= len_max)
len= len_max;