static int AVI_DEBUG=0;
static char DEBUG_FCC[4];
-#define DEBUG_PRINT(x) if(AVI_DEBUG) printf("AVI DEBUG: " x);
+#define DEBUG_PRINT(x) if (AVI_DEBUG) printf("AVI DEBUG: " x);
/* local functions */
char *fcc_to_char (unsigned int fcc);
if (indices) {
w = MEM_callocN(sizeof(float)*numVerts, "Temp weight array DM_update_weight_mcol");
i = num;
- while(i--)
+ while (i--)
w[indices[i]] = weights[i];
}
#endif
glDisable(GL_LIGHTING);
- /* if(GPU_buffer_legacy(dm) ) */ { /* TODO - VBO draw code, not high priority - campbell */
+ /* if (GPU_buffer_legacy(dm) ) */ { /* TODO - VBO draw code, not high priority - campbell */
DEBUG_VBO( "Using legacy code. drawNavMeshColored\n" );
//glShadeModel(GL_SMOOTH);
glBegin(glmode = GL_QUADS);
pd_point_from_particle(bbd->sim, pa, &pa->state, &epoint);
/* first find out goal/predator with highest priority */
- if (effectors) for(cur = effectors->first; cur; cur=cur->next) {
+ if (effectors) for (cur = effectors->first; cur; cur=cur->next) {
Object *eob = cur->ob;
PartDeflect *pd = cur->pd;
//check boids in own system
if (acbr->options & BRULE_ACOLL_WITH_BOIDS) {
neighbors = BLI_kdtree_range_search(bbd->sim->psys->tree, acbr->look_ahead * len_v3(pa->prev_state.vel), pa->prev_state.co, pa->prev_state.ave, &ptn);
- if (neighbors > 1) for(n=1; n<neighbors; n++) {
+ if (neighbors > 1) for (n=1; n<neighbors; n++) {
copy_v3_v3(co1, pa->prev_state.co);
copy_v3_v3(vel1, pa->prev_state.vel);
copy_v3_v3(co2, (bbd->sim->psys->particles + ptn[n].index)->prev_state.co);
if (epsys) {
neighbors = BLI_kdtree_range_search(epsys->tree, acbr->look_ahead * len_v3(pa->prev_state.vel), pa->prev_state.co, pa->prev_state.ave, &ptn);
- if (neighbors > 0) for(n=0; n<neighbors; n++) {
+ if (neighbors > 0) for (n=0; n<neighbors; n++) {
copy_v3_v3(co1, pa->prev_state.co);
copy_v3_v3(vel1, pa->prev_state.vel);
copy_v3_v3(co2, (epsys->particles + ptn[n].index)->prev_state.co);
//planned for near future
//cond = state->conditions.first;
- //for(; cond; cond=cond->next) {
+ //for (; cond; cond=cond->next) {
// if (boid_condition_is_true(cond)) {
// pa->boid->state_id = cond->state_id;
// state = get_boid_state(boids, pa);
#include "GL/glew.h"
-#include "BLI_scanfill.h"
#include "BLI_math.h"
#include "BLI_blenlib.h"
#include "BLI_edgehash.h"
#include "BLI_array.h"
#include "BLI_smallhash.h"
#include "BLI_utildefines.h"
+#include "BLI_scanfill.h"
#include "BKE_cdderivedmesh.h"
#include "BKE_global.h"
else {
if (index) {
orig = *index++;
- if (orig == ORIGINDEX_NONE) { if(nors) nors += 3; continue; }
+ if (orig == ORIGINDEX_NONE) { if (nors) nors += 3; continue; }
if (drawParamsMapped) draw_option = drawParamsMapped(userData, orig);
- else { if(nors) nors += 3; continue; }
+ else { if (nors) nors += 3; continue; }
}
else
if (drawParamsMapped) draw_option = drawParamsMapped(userData, i);
- else { if(nors) nors += 3; continue; }
+ else { if (nors) nors += 3; continue; }
}
if (draw_option != DM_DRAW_OPTION_SKIP) {
* loops requesting data from ourselfs in a context callback */
/* Ok, this looks evil...
- * if(ret) done= -(-ret | -done);
+ * if (ret) done= -(-ret | -done);
*
* Values in order of importance
* (0, -1, 1) - Where 1 is highest priority
nu->knotsu= NULL;
if (nu->knotsv) MEM_freeN(nu->knotsv);
nu->knotsv= NULL;
- /* if(nu->trim.first) freeNurblist(&(nu->trim)); */
+ /* if (nu->trim.first) freeNurblist(&(nu->trim)); */
MEM_freeN(nu);
*fp= basisu[i]*bp->vec[3];
sumdiv+= *fp;
}
- if (sumdiv != 0.0f) if(sumdiv < 0.999f || sumdiv > 1.001f) {
+ if (sumdiv != 0.0f) if (sumdiv < 0.999f || sumdiv > 1.001f) {
/* is normalizing needed? */
fp= sum;
for (i= istart; i<=iend; i++, fp++) {
effectors = pdInitEffectors(scene, ob, psys, part->effector_weights);
- if (effectors) for(eff = effectors->first; eff; eff=eff->next) {
+ if (effectors) for (eff = effectors->first; eff; eff=eff->next) {
if (eff->psys) {
node2 = dag_get_node(dag, eff->ob);
dag_add_relation(dag, node2, node, DAG_RL_DATA_DATA|DAG_RL_OB_DATA, "Particle Field");
/* Cycle through collected objects, get total of (1/(gravity_strength * dist^gravity_power)) */
/* Check for min distance here? (yes would be cool to add that, ton) */
- if (effectors) for(eff = effectors->first; eff; eff=eff->next) {
+ if (effectors) for (eff = effectors->first; eff; eff=eff->next) {
/* object effectors were fully checked to be OK to evaluate! */
get_effector_tot(eff, &efd, point, &tot, &p, &step);
// printf("loaded new result %p\n", ima->rr);
/* free result if new one found */
if (ima->rr) {
- // if(oldrr) printf("freed previous result %p\n", oldrr);
+ // if (oldrr) printf("freed previous result %p\n", oldrr);
if (oldrr) RE_FreeRenderResult(oldrr);
}
else {
// due to non-commutative nature of floating point ops this makes the sim give
// different results each time you run it!
// schedule(guided, 2)
-//#pragma omp parallel for reduction(+: temp) if(verts > CLOTH_OPENMP_LIMIT)
+//#pragma omp parallel for reduction(+: temp) if (verts > CLOTH_OPENMP_LIMIT)
for (i = 0; i < (long)verts; i++) {
temp += dot_v3v3(fLongVectorA[i], fLongVectorB[i]);
}
zero_lfvector(to, vcount);
-#pragma omp parallel sections private(i) if(vcount > CLOTH_OPENMP_LIMIT)
+#pragma omp parallel sections private(i) if (vcount > CLOTH_OPENMP_LIMIT)
{
#pragma omp section
{
unsigned int i = 0;
// Take only the diagonal blocks of A
-// #pragma omp parallel for private(i) if(lA[0].vcount > CLOTH_OPENMP_LIMIT)
+// #pragma omp parallel for private(i) if (lA[0].vcount > CLOTH_OPENMP_LIMIT)
for (i = 0; i<lA[0].vcount; i++)
{
// block diagonalizer
}
/* gather velocities & density */
- if (smoothfac > 0.0f) for(v = 0; v < numverts; v++) {
+ if (smoothfac > 0.0f) for (v = 0; v < numverts; v++) {
i = HAIR_GRID_INDEX(lX[v], gmin, gmax, 0);
j = HAIR_GRID_INDEX(lX[v], gmin, gmax, 1);
k = HAIR_GRID_INDEX(lX[v], gmin, gmax, 2);
}
/* gather colliders */
- if (colliders && collfac > 0.0f) for(col = colliders->first; col; col = col->next)
+ if (colliders && collfac > 0.0f) for (col = colliders->first; col; col = col->next)
{
MVert *loc0 = col->collmd->x;
MVert *loc1 = col->collmd->xnew;
while (search)
{
// only handle active springs
- // if(((clmd->sim_parms->flags & CSIMSETT_FLAG_TEARING_ENABLED) && !(springs[i].flags & CSPRING_FLAG_DEACTIVATE))|| !(clmd->sim_parms->flags & CSIMSETT_FLAG_TEARING_ENABLED)) {}
+ // if (((clmd->sim_parms->flags & CSIMSETT_FLAG_TEARING_ENABLED) && !(springs[i].flags & CSPRING_FLAG_DEACTIVATE))|| !(clmd->sim_parms->flags & CSIMSETT_FLAG_TEARING_ENABLED)) {}
cloth_calc_spring_force(clmd, search->link, lF, lX, lV, dFdV, dFdX, time);
search = search->next;
while (search)
{
// only handle active springs
- // if(((clmd->sim_parms->flags & CSIMSETT_FLAG_TEARING_ENABLED) && !(springs[i].flags & CSPRING_FLAG_DEACTIVATE))|| !(clmd->sim_parms->flags & CSIMSETT_FLAG_TEARING_ENABLED))
+ // if (((clmd->sim_parms->flags & CSIMSETT_FLAG_TEARING_ENABLED) && !(springs[i].flags & CSPRING_FLAG_DEACTIVATE))|| !(clmd->sim_parms->flags & CSIMSETT_FLAG_TEARING_ENABLED))
cloth_apply_spring_force(clmd, search->link, lF, lX, lV, dFdV, dFdX);
search = search->next;
}
k1=k[0]=k[1]=k[2]=k[3]= firstkey;
t[0]=t[1]=t[2]=t[3]= k1->pos;
- /* if(fac<0.0 || fac>1.0) return 1; */
+ /* if (fac<0.0 || fac>1.0) return 1; */
if (k1->next==NULL) return 1;
char left[MAX_ID_NAME + 8], leftest[MAX_ID_NAME + 8];
/* make sure input name is terminated properly */
- /* if( strlen(name) > MAX_ID_NAME-3 ) name[MAX_ID_NAME-3]= 0; */
+ /* if ( strlen(name) > MAX_ID_NAME-3 ) name[MAX_ID_NAME-3]= 0; */
/* removed since this is only ever called from one place - campbell */
while (1) {
/* search for id */
idtest= BLI_findstring(lb, name, offsetof(ID, name) + 2);
- if (idtest) if( new_id(lb, idtest, name)==0 ) sort_alpha_id(lb, idtest);
+ if (idtest) if ( new_id(lb, idtest, name)==0 ) sort_alpha_id(lb, idtest);
}
void text_idbutton(struct ID *id, char *text)
}
/* return nonzero if ob1 is a basis mball for ob */
-int is_mball_basis_for(Object *ob1, Object *ob2)
+int is_mball_basis_for (Object *ob1, Object *ob2)
{
int basis1nr, basis2nr;
char basis1name[MAX_ID_NAME], basis2name[MAX_ID_NAME];
return sp1->loopstart > sp2->loopstart ? 1 : sp1->loopstart < sp2->loopstart ? -1 : 0;
}
-#define PRINT if(do_verbose) printf
+#define PRINT if (do_verbose) printf
int BKE_mesh_validate_arrays(Mesh *mesh,
MVert *mverts, unsigned int totvert,
float guidetime, radius, weight, angle, totstrength = 0.0f;
float vec_to_point[3];
- if (effectors) for(eff = effectors->first; eff; eff=eff->next) {
+ if (effectors) for (eff = effectors->first; eff; eff=eff->next) {
pd = eff->pd;
if (pd->forcefield != PFIELD_GUIDE)
return 1;
}
-#define SET_PARTICLE_TEXTURE(type, pvalue, texfac) if((event & mtex->mapto) & type) {pvalue = texture_value_blend(def, pvalue, value, texfac, blend);}
-#define CLAMP_PARTICLE_TEXTURE_POS(type, pvalue) if(event & type) { if(pvalue < 0.f) pvalue = 1.f+pvalue; CLAMP(pvalue, 0.0f, 1.0f); }
-#define CLAMP_PARTICLE_TEXTURE_POSNEG(type, pvalue) if(event & type) { CLAMP(pvalue, -1.0f, 1.0f); }
+#define SET_PARTICLE_TEXTURE(type, pvalue, texfac) if ((event & mtex->mapto) & type) {pvalue = texture_value_blend(def, pvalue, value, texfac, blend);}
+#define CLAMP_PARTICLE_TEXTURE_POS(type, pvalue) if (event & type) { if (pvalue < 0.f) pvalue = 1.f+pvalue; CLAMP(pvalue, 0.0f, 1.0f); }
+#define CLAMP_PARTICLE_TEXTURE_POSNEG(type, pvalue) if (event & type) { CLAMP(pvalue, -1.0f, 1.0f); }
static void get_cpa_texture(DerivedMesh *dm, ParticleSystem *psys, ParticleSettings *part, ParticleData *par, int child_index, int face_index, const float fw[4], float *orco, ParticleTexture *ptex, int event, float cfra)
{
cpa->w[i]=0.0f;
}
- if (totw>0.0f) for(w=0; w<4; w++)
+ if (totw>0.0f) for (w=0; w<4; w++)
cpa->w[w]/=totw;
cpa->parent=cpa->pa[0];
continue;
/* hair needs to be included in id-list for cache edit mode to work */
- /* if(psys->part->type == PART_HAIR && (psys->flag & PSYS_HAIR_DYNAMICS)==0) */
+ /* if (psys->part->type == PART_HAIR && (psys->flag & PSYS_HAIR_DYNAMICS)==0) */
/* continue; */
if (psys->part->type == PART_FLUID)
if (cache->flag & PTCACHE_DISK_CACHE) {
error += !ptcache_mem_frame_to_disk(pid, pm);
- // if(pm) /* pm is always set */
+ // if (pm) /* pm is always set */
{
ptcache_data_free(pm);
ptcache_extra_free(pm);
cache->flag &= ~PTCACHE_BAKED;
}
}
- else for(SETLOOPER(scene, sce_iter, base)) {
+ else for (SETLOOPER(scene, sce_iter, base)) {
/* cache/bake everything in the scene */
BKE_ptcache_ids_from_object(&pidlist, base->object, scene, MAX_DUPLI_RECUR);
BKE_ptcache_write(pid, 0);
}
}
- else for(SETLOOPER(scene, sce_iter, base)) {
+ else for (SETLOOPER(scene, sce_iter, base)) {
BKE_ptcache_ids_from_object(&pidlist, base->object, scene, MAX_DUPLI_RECUR);
for (pid=pidlist.first; pid; pid=pid->next) {
/* clear the error list */
BLI_dynlib_get_error_as_string(NULL);
- /* if(pis->handle) BLI_dynlib_close(pis->handle); */
+ /* if (pis->handle) BLI_dynlib_close(pis->handle); */
/* pis->handle= 0; */
/* open the needed object */
BLI_dynlib_get_error_as_string(NULL);
/* no BLI_dynlib_close! multiple opened plugins... */
- /* if(pit->handle) BLI_dynlib_close(pit->handle); */
+ /* if (pit->handle) BLI_dynlib_close(pit->handle); */
/* pit->handle= 0; */
/* open the needed object */
CBData left, right;
/* we're looking for first pos > in */
- for (a=0; a<coba->tot; a++, cbd1++) if(cbd1->pos > in) break;
+ for (a=0; a<coba->tot; a++, cbd1++) if (cbd1->pos > in) break;
if (a==coba->tot) {
cbd2= cbd1-1;
if (!ibuf_new)
return 0;
- #pragma omp parallel for private(a) shared(ibuf_new, ok) if(map_size>1)
+ #pragma omp parallel for private(a) shared(ibuf_new, ok) if (map_size>1)
for (a= 0; a<map_size; a++) {
TrackContext *track_context = NULL;
MovieTrackingTrack *track;
ed2= ed1->next;
/* commented out... the ESC here delivers corrupted memory (and doesnt work during grab) */
- /* if(callLocalInterruptCallBack()) break; */
+ /* if (callLocalInterruptCallBack()) break; */
if (totface>maxface) {
/* printf("Fill error: endless loop. Escaped at vert %d, tot: %d.\n", a, verts); */
a= verts;
if (files) {
dlink = (struct dirlink *) dirbase->first;
- while(dlink) {
+ while (dlink) {
memset(&files[actnum], 0 , sizeof(struct direntry));
files[actnum].relname = dlink->name;
files[actnum].path = BLI_strdupcat(dirname, dlink->name);
* BLI_init_threads(&lb, do_something_func, maxthreads);
*
* while (cont) {
- * if(BLI_available_threads(&lb) && !(escape loop event)) {
+ * if (BLI_available_threads(&lb) && !(escape loop event)) {
* // get new job (data pointer)
* // tag job 'processed
* BLI_insert_thread(&lb, job);
*
* // find if a job is ready, this the do_something_func() should write in job somewhere
* cont= 0;
- * for(go over all jobs)
- * if(job is ready) {
- * if(job was not removed) {
+ * for (go over all jobs)
+ * if (job is ready) {
+ * if (job was not removed) {
* BLI_remove_thread(&lb, job);
* }
* }
* else cont= 1;
* }
* // conditions to exit loop
- * if(if escape loop event) {
- * if(BLI_available_threadslots(&lb)==maxthreads)
+ * if (if escape loop event) {
+ * if (BLI_available_threadslots(&lb)==maxthreads)
* break;
* }
* }
set_listbasepointers(mainvar, lbarray);
a= set_listbasepointers(from, fromarray);
- while(a--) {
+ while (a--) {
BLI_movelisttolist(lbarray[a], fromarray[a]);
}
}
Main *mainvar;
id= lb->first;
- while(id) {
+ while (id) {
idnext= id->next;
if (id->lib) {
mainvar= first;
- while(mainvar) {
+ while (mainvar) {
if (mainvar->curlib==id->lib) {
lbn= which_libbase(mainvar, GS(id->name));
BLI_remlink(lb, id);
}
i= set_listbasepointers(main, lbarray);
- while(i--)
+ while (i--)
split_libdata(lbarray[i], main->next);
}
chunk= filedata->memfile->chunks.first;
seek= 0;
- while(chunk) {
+ while (chunk) {
if (seek + chunk->size > (unsigned) filedata->seek) break;
seek+= chunk->size;
chunk= chunk->next;
totread += readsize;
filedata->seek += readsize;
seek += readsize;
- } while(totread < size);
+ } while (totread < size);
return totread;
}
for (ptr= ptr->next; ptr; ptr= ptr->next) {
int i= set_listbasepointers(ptr, lbarray);
- while(i--) {
+ while (i--) {
ID *id;
for (id= lbarray[i]->first; id; id= id->next)
oldnewmap_insert(fd->libmap, id, id, GS(id->name));
blocksize= filesdna->typelens[ filesdna->structs[bhead->SDNAnr][0] ];
nblocks= bhead->nr;
- while(nblocks--) {
+ while (nblocks--) {
DNA_struct_switch_endian(filesdna, bhead->SDNAnr, data);
data+= blocksize;
lb->first= newdataadr(fd, lb->first);
ln= lb->first;
prev= NULL;
- while(ln) {
+ while (ln) {
ln->next= newdataadr(fd, ln->next);
ln->prev= prev;
prev= ln;
ln= lb->first;
prev= NULL;
- while(ln) {
+ while (ln) {
poin= newdataadr(fd, ln->next);
if (ln->next) {
oldnewmap_insert(fd->globmap, ln->next, poin, 0);
ipoin=imat= MEM_mallocN( len*4, "newmatar");
lpoin= *mat;
- while(len-- > 0) {
+ while (len-- > 0) {
if ((fd->flags & FD_FLAGS_SWITCH_ENDIAN))
SWITCH_LONGINT(*lpoin);
*ipoin= (int) ((*lpoin) >> 3);
lpoin=lmat= MEM_mallocN( len*8, "newmatar");
ipoin= *mat;
- while(len-- > 0) {
+ while (len-- > 0) {
*lpoin= *ipoin;
ipoin++;
lpoin++;
Ipo *ipo;
ipo= main->ipo.first;
- while(ipo) {
+ while (ipo) {
if (ipo->id.flag & LIB_NEEDLINK) {
IpoCurve *icu;
for (icu= ipo->curve.first; icu; icu= icu->next) {
link_list(fd, &(ipo->curve));
icu= ipo->curve.first;
- while(icu) {
+ while (icu) {
icu->bezt= newdataadr(fd, icu->bezt);
icu->bp= newdataadr(fd, icu->bp);
icu->driver= newdataadr(fd, icu->driver);
arm= main->armature.first;
- while(arm) {
+ while (arm) {
if (arm->id.flag & LIB_NEEDLINK) {
if (arm->adt) lib_link_animdata(fd, &arm->id, arm->adt);
arm->id.flag -= LIB_NEEDLINK;
Camera *ca;
ca= main->camera.first;
- while(ca) {
+ while (ca) {
if (ca->id.flag & LIB_NEEDLINK) {
if (ca->adt) lib_link_animdata(fd, &ca->id, ca->adt);
int a;
la= main->lamp.first;
- while(la) {
+ while (la) {
if (la->id.flag & LIB_NEEDLINK) {
if (la->adt) lib_link_animdata(fd, &la->id, la->adt);
Key *key;
key= main->key.first;
- while(key) {
+ while (key) {
/*check if we need to generate unique ids for the shapekeys*/
if (!key->uidgen) {
KeyBlock *block;
cp= key->elemstr;
poin= data;
- while( cp[0] ) { /* cp[0]==amount */
+ while ( cp[0] ) { /* cp[0]==amount */
switch(cp[1]) { /* cp[1]= type */
case IPO_FLOAT:
case IPO_BPOINT:
case IPO_BEZTRIPLE:
b= cp[0];
- while(b--) {
+ while (b--) {
SWITCH_INT((*poin));
poin+= 4;
}
key->refkey= newdataadr(fd, key->refkey);
kb= key->block.first;
- while(kb) {
+ while (kb) {
kb->data= newdataadr(fd, kb->data);
int a;
mb= main->mball.first;
- while(mb) {
+ while (mb) {
if (mb->id.flag & LIB_NEEDLINK) {
if (mb->adt) lib_link_animdata(fd, &mb->id, mb->adt);
int a;
wrld= main->world.first;
- while(wrld) {
+ while (wrld) {
if (wrld->id.flag & LIB_NEEDLINK) {
if (wrld->adt) lib_link_animdata(fd, &wrld->id, wrld->adt);
VFont *vf;
vf= main->vfont.first;
- while(vf) {
+ while (vf) {
if (vf->id.flag & LIB_NEEDLINK) {
vf->id.flag -= LIB_NEEDLINK;
}
Text *text;
text= main->text.first;
- while(text) {
+ while (text) {
if (text->id.flag & LIB_NEEDLINK) {
text->id.flag -= LIB_NEEDLINK;
}
text->sell= newdataadr(fd, text->sell);
ln= text->lines.first;
- while(ln) {
+ while (ln) {
ln->line= newdataadr(fd, ln->line);
ln->format= NULL;
lb->first= newimaadr(fd, lb->first);
ln= lb->first;
prev= NULL;
- while(ln) {
+ while (ln) {
ln->next= newimaadr(fd, ln->next);
ln->prev= prev;
prev= ln;
int a;
cu= main->curve.first;
- while(cu) {
+ while (cu) {
if (cu->id.flag & LIB_NEEDLINK) {
if (cu->adt) lib_link_animdata(fd, &cu->id, cu->adt);
if (nu->knotsu) {
len= KNOTSU(nu);
- while(len--) {
+ while (len--) {
SWITCH_INT(nu->knotsu[len]);
}
}
if (nu->knotsv) {
len= KNOTSV(nu);
- while(len--) {
+ while (len--) {
SWITCH_INT(nu->knotsv[len]);
}
}
cu->editfont= NULL;
nu= cu->nurb.first;
- while(nu) {
+ while (nu) {
nu->bezt= newdataadr(fd, nu->bezt);
nu->bp= newdataadr(fd, nu->bp);
nu->knotsu= newdataadr(fd, nu->knotsu);
Tex *tex;
tex= main->tex.first;
- while(tex) {
+ while (tex) {
if (tex->id.flag & LIB_NEEDLINK) {
if (tex->adt) lib_link_animdata(fd, &tex->id, tex->adt);
int a;
ma= main->mat.first;
- while(ma) {
+ while (ma) {
if (ma->id.flag & LIB_NEEDLINK) {
if (ma->adt) lib_link_animdata(fd, &ma->id, ma->adt);
int a;
part= main->particle.first;
- while(part) {
+ while (part) {
if (part->id.flag & LIB_NEEDLINK) {
if (part->adt) lib_link_animdata(fd, &part->id, part->adt);
part->ipo= newlibadr_us(fd, part->id.lib, part->ipo); // XXX depreceated - old animation system
Mesh *me;
me= main->mesh.first;
- while(me) {
+ while (me) {
if (me->id.flag & LIB_NEEDLINK) {
int i;
Lattice *lt;
lt= main->latt.first;
- while(lt) {
+ while (lt) {
if (lt->id.flag & LIB_NEEDLINK) {
if (lt->adt) lib_link_animdata(fd, <->id, lt->adt);
int warn=0, a;
ob= main->object.first;
- while(ob) {
+ while (ob) {
if (ob->id.flag & LIB_NEEDLINK) {
if (ob->id.properties) IDP_LibLinkProperty(ob->id.properties, (fd->flags & FD_FLAGS_SWITCH_ENDIAN), fd);
if (ob->adt) lib_link_animdata(fd, &ob->id, ob->adt);
}
sens= ob->sensors.first;
- while(sens) {
+ while (sens) {
for (a=0; a<sens->totlinks; a++)
sens->links[a]= newglobadr(fd, sens->links[a]);
}
cont= ob->controllers.first;
- while(cont) {
+ while (cont) {
for (a=0; a<cont->totlinks; a++)
cont->links[a]= newglobadr(fd, cont->links[a]);
}
act= ob->actuators.first;
- while(act) {
+ while (act) {
if (act->type==ACT_SOUND) {
bSoundActuator *sa= act->data;
sa->sound= newlibadr_us(fd, ob->id.lib, sa->sound);
link_list(fd, &ob->effect);
paf= ob->effect.first;
- while(paf) {
+ while (paf) {
if (paf->type==EFF_PARTICLE) {
paf->keys= NULL;
}
link_list(fd, &ob->prop);
prop= ob->prop.first;
- while(prop) {
+ while (prop) {
prop->poin= newdataadr(fd, prop->poin);
if (prop->poin==NULL) prop->poin= &prop->data;
prop= prop->next;
link_list(fd, &ob->sensors);
sens= ob->sensors.first;
- while(sens) {
+ while (sens) {
sens->data= newdataadr(fd, sens->data);
sens->links= newdataadr(fd, sens->links);
test_pointer_array(fd, (void **)&sens->links);
ob->state = 1;
}
cont= ob->controllers.first;
- while(cont) {
+ while (cont) {
cont->data= newdataadr(fd, cont->data);
cont->links= newdataadr(fd, cont->links);
test_pointer_array(fd, (void **)&cont->links);
link_glob_list(fd, &ob->actuators);
act= ob->actuators.first;
- while(act) {
+ while (act) {
act->data= newdataadr(fd, act->data);
act= act->next;
}
TimeMarker *marker;
sce= main->scene.first;
- while(sce) {
+ while (sce) {
if (sce->id.flag & LIB_NEEDLINK) {
/*Link ID Properties -- and copy this comment EXACTLY for easy finding
of library blocks that implement this.*/
sc->animtimer= NULL; /* saved in rare cases */
sa= sc->areabase.first;
- while(sa) {
+ while (sa) {
SpaceLink *sl;
sa->full= newlibadr(fd, sc->id.lib, sa->full);
ID *idn= lb->first;
char *name= id->name+2;
- while(idn) {
+ while (idn) {
if (idn->name[2]==name[0] && strcmp(idn->name+2, name)==0) {
if (idn->lib==id->lib) {
if (user && idn->us==0) idn->us++;
copy_v3_v3(sc->scene->cursor, oldscene->cursor);
sa= sc->areabase.first;
- while(sa) {
+ while (sa) {
SpaceLink *sl;
for (sl= sa->spacedata.first; sl; sl= sl->next) {
link_list(fd, &sconsole->scrollback);
link_list(fd, &sconsole->history);
- //for(cl= sconsole->scrollback.first; cl; cl= cl->next)
+ //for (cl= sconsole->scrollback.first; cl; cl= cl->next)
// cl->line= newdataadr(fd, cl->line);
/*comma expressions, (e.g. expr1, expr2, expr3) evalutate each expression,
Speaker *spk;
spk= main->speaker.first;
- while(spk) {
+ while (spk) {
if (spk->id.flag & LIB_NEEDLINK) {
if (spk->adt) lib_link_animdata(fd, &spk->id, spk->adt);
bSound *sound;
sound= main->sound.first;
- while(sound) {
+ while (sound) {
if (sound->id.flag & LIB_NEEDLINK) {
sound->id.flag -= LIB_NEEDLINK;
sound->ipo= newlibadr_us(fd, sound->id.lib, sound->ipo); // XXX depreceated - old animation system
GroupObject *go;
int add_us;
- while(group) {
+ while (group) {
if (group->id.flag & LIB_NEEDLINK) {
group->id.flag -= LIB_NEEDLINK;
add_us= 0;
go= group->gobject.first;
- while(go) {
+ while (go) {
go->ob= newlibadr(fd, group->id.lib, go->ob);
if (go->ob) {
go->ob->flag |= OB_FROMGROUP;
link_list(fd, tracksbase);
track= tracksbase->first;
- while(track) {
+ while (track) {
track->markers= newdataadr(fd, track->markers);
track= track->next;
link_list(fd, &tracking->objects);
object= tracking->objects.first;
- while(object) {
+ while (object) {
direct_link_movieTracks(fd, &object->tracks);
direct_link_movieReconstruction(fd, &object->reconstruction);
MovieClip *clip;
clip= main->movieclip.first;
- while(clip) {
+ while (clip) {
if (clip->id.flag & LIB_NEEDLINK) {
if (clip->adt)
lib_link_animdata(fd, &clip->id, clip->adt);
{
bhead = blo_nextbhead(fd, bhead);
- while(bhead && bhead->code==DATA) {
+ while (bhead && bhead->code==DATA) {
void *data;
#if 0
/* XXX DUMB DEBUGGING OPTION TO GIVE NAMES for guarded malloc errors */
KeyBlock *kb;
int sorted= 0;
- while(sorted==0) {
+ while (sorted==0) {
sorted= 1;
for (key= main->key.first; key; key= key->id.next) {
for (kb= key->block.first; kb; kb= kb->next) {
PartEff *paf;
paf= ob->effect.first;
- while(paf) {
+ while (paf) {
if (paf->type==EFF_PARTICLE) return paf;
paf= paf->next;
}
Effect *eff;
eff= lb->first;
- while(eff) {
+ while (eff) {
BLI_remlink(lb, eff);
do_version_free_effect_245(eff);
eff= lb->first;
{
Sequence * seq = seqbasep->first;
- while(seq) {
+ while (seq) {
seqbase_unique_name_recursive(&sce->ed->seqbase, seq);
if (seq->seqbase.first) {
do_versions_seq_unique_name_all_strips(
if (main->versionfile == 100) {
/* tex->extend and tex->imageflag have changed: */
Tex *tex = main->tex.first;
- while(tex) {
+ while (tex) {
if (tex->id.flag & LIB_NEEDLINK) {
if (tex->extend==0) {
if (main->versionfile <= 101) {
/* frame mapping */
Scene *sce = main->scene.first;
- while(sce) {
+ while (sce) {
sce->r.framapto= 100;
sce->r.images= 100;
sce->r.framelen= 1.0;
if (main->versionfile <= 102) {
/* init halo's at 1.0 */
Material *ma = main->mat.first;
- while(ma) {
+ while (ma) {
ma->add= 1.0;
ma= ma->id.next;
}
/* new variable in object: colbits */
Object *ob = main->object.first;
int a;
- while(ob) {
+ while (ob) {
ob->colbits= 0;
if (ob->totcol) {
for (a=0; a<ob->totcol; a++) {
if (main->versionfile <= 104) {
/* timeoffs moved */
Object *ob = main->object.first;
- while(ob) {
+ while (ob) {
if (ob->transflag & 1) {
ob->transflag -= 1;
//ob->ipoflag |= OB_OFFS_OB;
}
if (main->versionfile <= 105) {
Object *ob = main->object.first;
- while(ob) {
+ while (ob) {
ob->dupon= 1; ob->dupoff= 0;
ob->dupsta= 1; ob->dupend= 100;
ob= ob->id.next;
if (main->versionfile <= 106) {
/* mcol changed */
Mesh *me = main->mesh.first;
- while(me) {
+ while (me) {
if (me->mcol) vcol_to_fcol(me);
me= me->id.next;
}
if (main->versionfile <= 107) {
Object *ob;
Scene *sce = main->scene.first;
- while(sce) {
+ while (sce) {
sce->r.mode |= R_GAMMA;
sce= sce->id.next;
}
ob= main->object.first;
- while(ob) {
+ while (ob) {
//ob->ipoflag |= OB_OFFS_PARENT;
if (ob->dt==0) ob->dt= OB_SOLID;
ob= ob->id.next;
if (main->versionfile <= 109) {
/* new variable: gridlines */
bScreen *sc = main->screen.first;
- while(sc) {
+ while (sc) {
ScrArea *sa= sc->areabase.first;
- while(sa) {
+ while (sa) {
SpaceLink *sl= sa->spacedata.first;
while (sl) {
if (sl->spacetype==SPACE_VIEW3D) {
}
if (main->versionfile <= 113) {
Material *ma = main->mat.first;
- while(ma) {
+ while (ma) {
if (ma->flaresize==0.0f) ma->flaresize= 1.0f;
ma->subsize= 1.0f;
ma->flareboost= 1.0f;
}
if (main->versionfile <= 153) {
Scene *sce = main->scene.first;
- while(sce) {
+ while (sce) {
if (sce->r.blurfac==0.0f) sce->r.blurfac= 1.0f;
sce= sce->id.next;
}
}
if (main->versionfile <= 163) {
Scene *sce = main->scene.first;
- while(sce) {
+ while (sce) {
if (sce->r.frs_sec==0) sce->r.frs_sec= 25;
sce= sce->id.next;
}
}
if (main->versionfile <= 164) {
Mesh *me= main->mesh.first;
- while(me) {
+ while (me) {
me->smoothresh= 30;
me= me->id.next;
}
int nr;
char *cp;
- while(me) {
+ while (me) {
if (me->tface) {
nr= me->totface;
tface= me->tface;
- while(nr--) {
+ while (nr--) {
cp= (char *)&tface->col[0];
if (cp[1]>126) cp[1]= 255; else cp[1]*=2;
if (cp[2]>126) cp[2]= 255; else cp[2]*=2;
if (main->versionfile <= 169) {
Mesh *me= main->mesh.first;
- while(me) {
+ while (me) {
if (me->subdiv==0) me->subdiv= 1;
me= me->id.next;
}
if (main->versionfile <= 169) {
bScreen *sc= main->screen.first;
- while(sc) {
+ while (sc) {
ScrArea *sa= sc->areabase.first;
- while(sa) {
+ while (sa) {
SpaceLink *sl= sa->spacedata.first;
- while(sl) {
+ while (sl) {
if (sl->spacetype==SPACE_IPO) {
SpaceIpo *sipo= (SpaceIpo*) sl;
sipo->v2d.max[0]= 15000.0;
if (main->versionfile <= 171) {
bScreen *sc= main->screen.first;
- while(sc) {
+ while (sc) {
ScrArea *sa= sc->areabase.first;
- while(sa) {
+ while (sa) {
SpaceLink *sl= sa->spacedata.first;
- while(sl) {
+ while (sl) {
if (sl->spacetype==SPACE_TEXT) {
SpaceText *st= (SpaceText*) sl;
st->lheight= 12;
if (main->versionfile <= 173) {
int a, b;
Mesh *me= main->mesh.first;
- while(me) {
+ while (me) {
if (me->tface) {
TFace *tface= me->tface;
for (a=0; a<me->totface; a++, tface++) {
Material *ma = main->mat.first;
/* let faces have default add factor of 0.0 */
- while(ma) {
+ while (ma) {
if (!(ma->mode & MA_HALO)) ma->add = 0.0;
ma = ma->id.next;
}
- while(ob) {
+ while (ob) {
ob->mass= 1.0f;
ob->damping= 0.1f;
/*ob->quat[1]= 1.0f;*/ /* quats arnt used yet */
if (main->versionfile <= 193) {
Object *ob= main->object.first;
- while(ob) {
+ while (ob) {
ob->inertia= 1.0f;
ob->rdamping= 0.1f;
ob= ob->id.next;
if (main->versionfile <= 196) {
Mesh *me= main->mesh.first;
int a, b;
- while(me) {
+ while (me) {
if (me->tface) {
TFace *tface= me->tface;
for (a=0; a<me->totface; a++, tface++) {
if (main->versionfile <= 200) {
Object *ob= main->object.first;
- while(ob) {
+ while (ob) {
ob->scaflag = ob->gameflag & (OB_DO_FH|OB_ROT_FH|OB_ANISOTROPIC_FRICTION|OB_GHOST|OB_RIGID_BODY|OB_BOUNDS);
/* 64 is do_fh */
ob->gameflag &= ~(OB_ROT_FH|OB_ANISOTROPIC_FRICTION|OB_GHOST|OB_RIGID_BODY|OB_BOUNDS);
Object *ob= main->object.first;
bActuator *act;
bObjectActuator *oa;
- while(ob) {
+ while (ob) {
act= ob->actuators.first;
- while(act) {
+ while (act) {
if (act->type==ACT_OBJECT) {
oa= act->data;
oa->flag &= ~(ACT_TORQUE_LOCAL|ACT_DROT_LOCAL); /* this actuator didn't do local/glob rot before */
bActuator *act;
bObjectActuator *oa;
bSound *sound;
- while(ob) {
+ while (ob) {
/* please check this for demo20 files like
* original Egypt levels etc. converted
* rotation factor of 50 is not workable */
act= ob->actuators.first;
- while(act) {
+ while (act) {
if (act->type==ACT_OBJECT) {
oa= act->data;
bEditObjectActuator *oa;
bRaySensor *rs;
bCollisionSensor *cs;
- while(ob) {
+ while (ob) {
/* Set anisotropic friction off for old objects,
* values to 1.0. */
ob->gameflag &= ~OB_ANISOTROPIC_FRICTION;
ob->anisotropicFriction[2] = 1.0;
act= ob->actuators.first;
- while(act) {
+ while (act) {
if (act->type==ACT_EDIT_OBJECT) {
/* Zero initial velocity for newly
* added objects */
/* added alpha in obcolor */
ob= main->object.first;
- while(ob) {
+ while (ob) {
ob->col[3]= 1.0;
ob= ob->id.next;
}
/* added alpha in obcolor */
ob= main->object.first;
- while(ob) {
+ while (ob) {
act= ob->actuators.first;
- while(act) {
+ while (act) {
if (act->type==ACT_OBJECT) {
/* multiply velocity with 50 in old files */
oa= act->data;
while (ob) {
prop= ob->prop.first;
- while(prop) {
+ while (prop) {
if (prop->type == GPROP_TIME) {
// convert old GPROP_TIME values from int to float
*((float *)&prop->data) = (float) prop->data;
Scene *sce= main->scene.first;
// new variables for std-alone player and runtime
- while(sce) {
+ while (sce) {
sce->r.xplay= 640;
sce->r.yplay= 480;
Scene *sce= main->scene.first;
// new variables for std-alone player and runtime
- while(sce) {
+ while (sce) {
sce->r.depth= 32;
if (main->versionfile <= 231) {
/* new bit flags for showing/hiding grid floor and axes */
bScreen *sc = main->screen.first;
- while(sc) {
+ while (sc) {
ScrArea *sa= sc->areabase.first;
- while(sa) {
+ while (sa) {
SpaceLink *sl= sa->spacedata.first;
while (sl) {
if (sl->spacetype==SPACE_VIEW3D) {
World *wrld;
/* introduction of raytrace */
- while(ma) {
+ while (ma) {
if (ma->fresnel_tra_i==0.0f) ma->fresnel_tra_i= 1.25f;
if (ma->fresnel_mir_i==0.0f) ma->fresnel_mir_i= 1.25f;
ma= ma->id.next;
}
sce= main->scene.first;
- while(sce) {
+ while (sce) {
if (sce->r.gauss==0.0f) sce->r.gauss= 1.0f;
sce= sce->id.next;
}
la= main->lamp.first;
- while(la) {
+ while (la) {
if (la->k==0.0f) la->k= 1.0;
if (la->ray_samp==0) la->ray_samp= 1;
if (la->ray_sampy==0) la->ray_sampy= 1;
la= la->id.next;
}
wrld= main->world.first;
- while(wrld) {
+ while (wrld) {
if (wrld->range==0.0f) {
wrld->range= 1.0f/wrld->exposure;
}
/* new bit flags for showing/hiding grid floor and axes */
- while(sc) {
+ while (sc) {
ScrArea *sa= sc->areabase.first;
- while(sa) {
+ while (sa) {
SpaceLink *sl= sa->spacedata.first;
while (sl) {
if (sl->spacetype==SPACE_VIEW3D) {
bScreen *sc;
Scene *sce;
- while(tex) {
+ while (tex) {
if ((tex->flag & (TEX_CHECKER_ODD+TEX_CHECKER_EVEN))==0) {
tex->flag |= TEX_CHECKER_ODD;
}
tex= tex->id.next;
}
- while(wrld) {
+ while (wrld) {
if (wrld->aodist==0.0f) {
wrld->aodist= 10.0f;
wrld->aobias= 0.05f;
}
}
sce= main->scene.first;
- while(sce) {
+ while (sce) {
if (sce->r.ocres==0) sce->r.ocres= 64;
sce= sce->id.next;
}
Material *ma= main->mat.first;
/* Object *ob= main->object.first; */
- while(ma) {
+ while (ma) {
if (ma->rampfac_col==0.0f) ma->rampfac_col= 1.0;
if (ma->rampfac_spec==0.0f) ma->rampfac_spec= 1.0;
if (ma->pr_lamp==0) ma->pr_lamp= 3;
/* this should have been done loooong before! */
#if 0 /* deprecated in 2.5+ */
- while(ob) {
+ while (ob) {
if (ob->ipowin==0) ob->ipowin= ID_OB;
ob= ob->id.next;
}
Sequence *seq;
Editing *ed;
- while(tex) {
+ while (tex) {
if (tex->nabla==0.0f) tex->nabla= 0.025f;
tex= tex->id.next;
}
- while(sce) {
+ while (sce) {
ed= sce->ed;
if (ed) {
SEQ_BEGIN(sce->ed, seq) {
Material *ma;
bScreen *sc;
- while(cam) {
+ while (cam) {
if (cam->ortho_scale==0.0f) {
cam->ortho_scale= 256.0f/cam->lens;
if (cam->type==CAM_ORTHO) printf("NOTE: ortho render has changed, tweak new Camera 'scale' value.\n");
Key *key;
Scene *sce= main->scene.first;
- while(sce) {
+ while (sce) {
if (sce->toolsettings == NULL) {
sce->toolsettings = MEM_callocN(sizeof(struct ToolSettings),"Tool Settings Struct");
sce->toolsettings->cornertype=0;
for (sc= main->screen.first; sc; sc= sc->id.next) {
ScrArea *sa;
sa= sc->areabase.first;
- while(sa) {
+ while (sa) {
SpaceLink *sl;
for (sl= sa->spacedata.first; sl; sl= sl->next) {
for (sc= main->screen.first; sc; sc= sc->id.next) {
ScrArea *sa;
sa= sc->areabase.first;
- while(sa) {
+ while (sa) {
SpaceLink *sl;
for (sl= sa->spacedata.first; sl; sl= sl->next) {
Sequence *seq;
Editing *ed;
- while(sce) {
+ while (sce) {
ed= sce->ed;
if (ed) {
SEQP_BEGIN(ed, seq) {
//BKE_ptcache_ids_from_object(&pidlist, ob);
- //for(pid=pidlist.first; pid; pid=pid->next)
+ //for (pid=pidlist.first; pid; pid=pid->next)
// pid->cache->flag |= PTCACHE_DISK_CACHE;
//BLI_freelistN(&pidlist);
for (ob = main->object.first; ob; ob = ob->id.next) {
//BKE_ptcache_ids_from_object(&pidlist, ob);
- //for(pid=pidlist.first; pid; pid=pid->next) {
+ //for (pid=pidlist.first; pid; pid=pid->next) {
// if (pid->ptcaches->first == NULL)
// pid->ptcaches->first = pid->ptcaches->last = pid->cache;
//}
}
/* Assign proper global gravity weights for dynamics (only z-coordinate is taken into account) */
- if (do_gravity) for(part= main->particle.first; part; part= part->id.next)
+ if (do_gravity) for (part= main->particle.first; part; part= part->id.next)
part->effector_weights->global_gravity = part->acc[2]/-9.81f;
for (ob = main->object.first; ob; ob = ob->id.next) {
{
{
Scene *sce= main->scene.first;
- while(sce) {
+ while (sce) {
if (sce->r.frame_step==0)
sce->r.frame_step= 1;
if (sce->r.mblur_samples==0)
{
/* ensure all nodes have unique names */
bNodeTree *ntree= main->nodetree.first;
- while(ntree) {
+ while (ntree) {
bNode *node=ntree->nodes.first;
- while(node) {
+ while (node) {
nodeUniqueName(ntree, node);
node= node->next;
}
}
if (convert) {
- while(ma) {
+ while (ma) {
if (ma->ramp_col) {
ColorBand *band = (ColorBand *)ma->ramp_col;
for (i=0; i<band->tot; i++) {
ma=ma->id.next;
}
- while(tex) {
+ while (tex) {
if (tex->coba) {
ColorBand *band = (ColorBand *)tex->coba;
for (i=0; i<band->tot; i++) {
tex=tex->id.next;
}
- while(wo) {
+ while (wo) {
srgb_to_linearrgb_v3_v3(&wo->ambr, &wo->ambr);
srgb_to_linearrgb_v3_v3(&wo->horr, &wo->horr);
srgb_to_linearrgb_v3_v3(&wo->zenr, &wo->zenr);
if (scene->nodetree) {
bNode *node=scene->nodetree->nodes.first;
- while(node) {
+ while (node) {
if (node->type == CMP_NODE_COLORBALANCE) {
NodeColorBalance *n= (NodeColorBalance *)node->storage;
n->lift[0] += 1.f;
for (ntree= main->nodetree.first; ntree; ntree=ntree->id.next) {
bNode *node=ntree->nodes.first;
- while(node) {
+ while (node) {
if (node->type == CMP_NODE_COLORBALANCE) {
NodeColorBalance *n= (NodeColorBalance *)node->storage;
n->lift[0] += 1.f;
* since before blender went opensource this strange scalar was used: (1 / 0.02) * 2 * math.pi/360 */
for (ob= main->object.first; ob; ob= ob->id.next) {
bActuator *act= ob->actuators.first;
- while(act) {
+ while (act) {
if (act->type==ACT_OBJECT) {
/* multiply velocity with 50 in old files */
bObjectActuator *oa= act->data;
/* Fix for sample line scope initializing with no height */
for (sc= main->screen.first; sc; sc= sc->id.next) {
sa= sc->areabase.first;
- while(sa) {
+ while (sa) {
SpaceLink *sl;
for (sl= sa->spacedata.first; sl; sl= sl->next) {
if (sl->spacetype==SPACE_IMAGE) {
clip->tracking.camera.pixel_aspect= 1.f;
track= clip->tracking.tracks.first;
- while(track) {
+ while (track) {
if (track->pyramid_levels==0)
track->pyramid_levels= 2;
if (tracking->objects.first == NULL)
BKE_tracking_new_object(tracking, "Camera");
- while(tracking_object) {
+ while (tracking_object) {
if (!tracking_object->scale)
tracking_object->scale= 1.0f;
bfd->type= BLENFILETYPE_BLEND;
BLI_strncpy(bfd->main->name, filepath, sizeof(bfd->main->name));
- while(bhead) {
+ while (bhead) {
switch(bhead->code) {
case DATA:
case DNA1:
if (id==NULL) {
read_libblock(fd, ptr, bhead, LIB_READ+LIB_INDIRECT, NULL);
// commented because this can print way too much
- // if(G.f & G_DEBUG) printf("expand_doit: other lib %s\n", lib->name);
+ // if (G.f & G_DEBUG) printf("expand_doit: other lib %s\n", lib->name);
/* for outliner dependency only */
ptr->curlib->parent= mainvar->curlib;
change_idid_adr_fd(fd, bhead->old, id);
// commented because this can print way too much
- // if(G.f & G_DEBUG) printf("expand_doit: already linked: %s lib: %s\n", id->name, lib->name);
+ // if (G.f & G_DEBUG) printf("expand_doit: already linked: %s lib: %s\n", id->name, lib->name);
}
MEM_freeN(lib);
happens which invokes same ID... in that case the lookup table needs this entry */
oldnewmap_insert(fd->libmap, bhead->old, id, 1);
// commented because this can print way too much
- // if(G.f & G_DEBUG) printf("expand: already read %s\n", id->name);
+ // if (G.f & G_DEBUG) printf("expand: already read %s\n", id->name);
}
}
}
expand_doit(fd, mainvar, psys->part);
sens= ob->sensors.first;
- while(sens) {
+ while (sens) {
if (sens->type==SENS_TOUCH) {
bTouchSensor *ts= sens->data;
expand_doit(fd, mainvar, ts->ma);
}
cont= ob->controllers.first;
- while(cont) {
+ while (cont) {
if (cont->type==CONT_PYTHON) {
bPythonCont *pc= cont->data;
expand_doit(fd, mainvar, pc->text);
}
act= ob->actuators.first;
- while(act) {
+ while (act) {
if (act->type==ACT_SOUND) {
bSoundActuator *sa= act->data;
expand_doit(fd, mainvar, sa->sound);
if (fd==NULL) return;
- while(doit) {
+ while (doit) {
doit= 0;
a= set_listbasepointers(mainvar, lbarray);
- while(a--) {
+ while (a--) {
id= lbarray[a]->first;
- while(id) {
+ while (id) {
if (id->flag & LIB_TEST) {
switch(GS(id->name)) {
int a, tot= 0;
a= set_listbasepointers(mainvar, lbarray);
- while(a--) {
+ while (a--) {
ID *id;
for (id= lbarray[a]->first; id; id= id->next)
ListBase *lbarray[MAX_LIBARRAY];
int a, doit= 1;
- while(doit) {
+ while (doit) {
doit= 0;
/* test 1: read libdata */
mainptr= mainl->next;
- while(mainptr) {
+ while (mainptr) {
int tot= mainvar_count_libread_blocks(mainptr);
// printf("found LIB_READ %s\n", mainptr->curlib->name);
/* allow typing in a new lib path */
if (G.rt==-666) {
- while(fd==NULL) {
+ while (fd==NULL) {
char newlib_path[FILE_MAX] = { 0 };
printf("Missing library...'\n");
printf(" current file: %s\n", G.main->name);
if (fd) {
doit= 1;
a= set_listbasepointers(mainptr, lbarray);
- while(a--) {
+ while (a--) {
ID *id= lbarray[a]->first;
- while(id) {
+ while (id) {
ID *idn= id->next;
if (id->flag & LIB_READ) {
ID *realid= NULL;
/* dang FileData... now new libraries need to be appended to original filedata,
* it is not a good replacement for the old global (ton) */
- while( fd->mainlist.first ) {
+ while ( fd->mainlist.first ) {
Main *mp= fd->mainlist.first;
BLI_remlink(&fd->mainlist, mp);
BLI_addtail(&basefd->mainlist, mp);
/* test if there are unread libblocks */
for (mainptr= mainl->next; mainptr; mainptr= mainptr->next) {
a= set_listbasepointers(mainptr, lbarray);
- while(a--) {
+ while (a--) {
ID *id= lbarray[a]->first;
- while(id) {
+ while (id) {
ID *idn= id->next;
if (id->flag & LIB_READ) {
BLI_remlink(lbarray[a], id);
writedata_do_write(wd, adr, writelen);
adr = (char*)adr + writelen;
len -= writelen;
- } while(len > 0);
+ } while (len > 0);
return;
}
break;
}
}
- //for(; cond; cond=cond->next)
+ //for (; cond; cond=cond->next)
// writestruct(wd, DATA, "BoidCondition", 1, cond);
}
int a;
part= idbase->first;
- while(part) {
+ while (part) {
if (part->id.us>0 || wd->current) {
/* write LibData */
writestruct(wd, ID_PA, "ParticleSettings", 1, part);
dw->index = 0;
if (part->dup_group) { /* can be NULL if lining fails or set to None */
go = part->dup_group->gobject.first;
- while(go && go->ob != dw->ob) {
+ while (go && go->ob != dw->ob) {
go=go->next;
dw->index++;
}
bProperty *prop;
prop= lb->first;
- while(prop) {
+ while (prop) {
writestruct(wd, DATA, "bProperty", 1, prop);
if (prop->poin && prop->poin != &prop->data)
bSensor *sens;
sens= lb->first;
- while(sens) {
+ while (sens) {
writestruct(wd, DATA, "bSensor", 1, sens);
writedata(wd, DATA, sizeof(void *)*sens->totlinks, sens->links);
bController *cont;
cont= lb->first;
- while(cont) {
+ while (cont) {
writestruct(wd, DATA, "bController", 1, cont);
writedata(wd, DATA, sizeof(void *)*cont->totlinks, cont->links);
bActuator *act;
act= lb->first;
- while(act) {
+ while (act) {
writestruct(wd, DATA, "bActuator", 1, act);
switch(act->type) {
Object *ob;
ob= idbase->first;
- while(ob) {
+ while (ob) {
if (ob->id.us>0 || wd->current) {
/* write LibData */
writestruct(wd, ID_OB, "Object", 1, ob);
PackedFile * pf;
vf= idbase->first;
- while(vf) {
+ while (vf) {
if (vf->id.us>0 || wd->current) {
/* write LibData */
writestruct(wd, ID_VF, "VFont", 1, vf);
KeyBlock *kb;
key= idbase->first;
- while(key) {
+ while (key) {
if (key->id.us>0 || wd->current) {
/* write LibData */
writestruct(wd, ID_KE, "Key", 1, key);
/* direct data */
kb= key->block.first;
- while(kb) {
+ while (kb) {
writestruct(wd, DATA, "KeyBlock", 1, kb);
if (kb->data) writedata(wd, DATA, kb->totelem*key->elemsize, kb->data);
kb= kb->next;
Camera *cam;
cam= idbase->first;
- while(cam) {
+ while (cam) {
if (cam->id.us>0 || wd->current) {
/* write LibData */
writestruct(wd, ID_CA, "Camera", 1, cam);
MetaElem *ml;
mb= idbase->first;
- while(mb) {
+ while (mb) {
if (mb->id.us>0 || wd->current) {
/* write LibData */
writestruct(wd, ID_MB, "MetaBall", 1, mb);
if (mb->adt) write_animdata(wd, mb->adt);
ml= mb->elems.first;
- while(ml) {
+ while (ml) {
writestruct(wd, DATA, "MetaElem", 1, ml);
ml= ml->next;
}
Nurb *nu;
cu= idbase->first;
- while(cu) {
+ while (cu) {
if (cu->id.us>0 || wd->current) {
/* write LibData */
writestruct(wd, ID_CU, "Curve", 1, cu);
else {
/* is also the order of reading */
nu= cu->nurb.first;
- while(nu) {
+ while (nu) {
writestruct(wd, DATA, "Nurb", 1, nu);
nu= nu->next;
}
nu= cu->nurb.first;
- while(nu) {
+ while (nu) {
if (nu->type == CU_BEZIER)
writestruct(wd, DATA, "BezTriple", nu->pntsu, nu->bezt);
else {
#endif
mesh= idbase->first;
- while(mesh) {
+ while (mesh) {
if (mesh->id.us>0 || wd->current) {
/* write LibData */
if (!save_for_old_blender) {
Lattice *lt;
lt= idbase->first;
- while(lt) {
+ while (lt) {
if (lt->id.us>0 || wd->current) {
/* write LibData */
writestruct(wd, ID_LT, "Lattice", 1, lt);
ima= idbase->first;
- while(ima) {
+ while (ima) {
if (ima->id.us>0 || wd->current) {
/* write LibData */
writestruct(wd, ID_IM, "Image", 1, ima);
Tex *tex;
tex= idbase->first;
- while(tex) {
+ while (tex) {
if (tex->id.us>0 || wd->current) {
/* write LibData */
writestruct(wd, ID_TE, "Tex", 1, tex);
int a;
ma= idbase->first;
- while(ma) {
+ while (ma) {
if (ma->id.us>0 || wd->current) {
/* write LibData */
writestruct(wd, ID_MA, "Material", 1, ma);
int a;
wrld= idbase->first;
- while(wrld) {
+ while (wrld) {
if (wrld->id.us>0 || wd->current) {
/* write LibData */
writestruct(wd, ID_WO, "World", 1, wrld);
int a;
la= idbase->first;
- while(la) {
+ while (la) {
if (la->id.us>0 || wd->current) {
/* write LibData */
writestruct(wd, ID_LA, "Lamp", 1, la);
ToolSettings *tos;
sce= scebase->first;
- while(sce) {
+ while (sce) {
/* write LibData */
writestruct(wd, ID_SCE, "Scene", 1, sce);
if (sce->id.properties) IDP_WriteProperty(sce->id.properties, wd);
/* direct data */
base= sce->base.first;
- while(base) {
+ while (base) {
writestruct(wd, DATA, "Base", 1, base);
base= base->next;
}
ScrEdge *se;
sc= scrbase->first;
- while(sc) {
+ while (sc) {
/* write LibData */
/* in 2.50+ files, the file identifier for screens is patched, forward compatibility */
}
sl= sa->spacedata.first;
- while(sl) {
+ while (sl) {
for (ar= sl->regionbase.first; ar; ar= ar->next)
write_region(wd, ar, sl->spacetype);
/* test: is lib being used */
foundone= 0;
- while(tot--) {
+ while (tot--) {
for (id= lbarray[tot]->first; id; id= id->next) {
if (id->us>0 && (id->flag & LIB_EXTERN)) {
foundone= 1;
if (foundone) {
writestruct(wd, ID_LI, "Library", 1, main->curlib);
- while(a--) {
+ while (a--) {
for (id= lbarray[a]->first; id; id= id->next) {
if (id->us>0 && (id->flag & LIB_EXTERN)) {
writestruct(wd, ID_ID, "ID", 1, id);
// Write Children
cbone= bone->childbase.first;
- while(cbone) {
+ while (cbone) {
write_bone(wd, cbone);
cbone= cbone->next;
}
/* Direct data */
bone= arm->bonebase.first;
- while(bone) {
+ while (bone) {
write_bone(wd, bone);
bone=bone->next;
}
TextMarker *mrk;
text= idbase->first;
- while(text) {
+ while (text) {
if ( (text->flags & TXT_ISMEM) && (text->flags & TXT_ISEXT)) text->flags &= ~TXT_ISEXT;
/* write LibData */
Speaker *spk;
spk= idbase->first;
- while(spk) {
+ while (spk) {
if (spk->id.us>0 || wd->current) {
/* write LibData */
writestruct(wd, ID_SPK, "Speaker", 1, spk);
PackedFile * pf;
sound= idbase->first;
- while(sound) {
+ while (sound) {
if (sound->id.us>0 || wd->current) {
/* write LibData */
writestruct(wd, ID_SO, "bSound", 1, sound);
if (group->id.properties) IDP_WriteProperty(group->id.properties, wd);
go= group->gobject.first;
- while(go) {
+ while (go) {
writestruct(wd, DATA, "GroupObject", 1, go);
go= go->next;
}
MovieTrackingTrack *track;
track= tracks->first;
- while(track) {
+ while (track) {
writestruct(wd, DATA, "MovieTrackingTrack", 1, track);
if (track->markers)
MovieClip *clip;
clip= idbase->first;
- while(clip) {
+ while (clip) {
if (clip->id.us>0 || wd->current) {
MovieTracking *tracking= &clip->tracking;
MovieTrackingObject *object;
write_movieReconstruction(wd, &tracking->reconstruction);
object= tracking->objects.first;
- while(object) {
+ while (object) {
writestruct(wd, DATA, "MovieTrackingObject", 1, object);
write_movieTracks(wd, &object->tracks);
return 1;
}
- while(hisnr > 1) {
+ while (hisnr > 1) {
BLI_snprintf(tempname1, sizeof(tempname1), "%s%d", name, hisnr-1);
BLI_snprintf(tempname2, sizeof(tempname2), "%s%d", name, hisnr);
void AnimationExporter::exportAnimations(Scene *sce)
{
- if(hasAnimations(sce)) {
+ if (hasAnimations(sce)) {
this->scene = sce;
openLibrary();
/* bool isMatAnim = false; */ /* UNUSED */
//Export transform animations
- if(ob->adt && ob->adt->action)
+ if (ob->adt && ob->adt->action)
{
fcu = (FCurve*)ob->adt->action->curves.first;
}
//Export Lamp parameter animations
- if( (ob->type == OB_LAMP ) && ((Lamp*)ob ->data)->adt && ((Lamp*)ob ->data)->adt->action )
+ if ( (ob->type == OB_LAMP ) && ((Lamp*)ob ->data)->adt && ((Lamp*)ob ->data)->adt->action )
{
fcu = (FCurve*)(((Lamp*)ob ->data)->adt->action->curves.first);
while (fcu) {
}
//Export Camera parameter animations
- if( (ob->type == OB_CAMERA ) && ((Camera*)ob ->data)->adt && ((Camera*)ob ->data)->adt->action )
+ if ( (ob->type == OB_CAMERA ) && ((Camera*)ob ->data)->adt && ((Camera*)ob ->data)->adt->action )
{
fcu = (FCurve*)(((Camera*)ob ->data)->adt->action->curves.first);
while (fcu) {
}
//Export Material parameter animations.
- for(int a = 0; a < ob->totcol; a++)
+ for (int a = 0; a < ob->totcol; a++)
{
Material *ma = give_current_material(ob, a+1);
if (!ma) continue;
- if(ma->adt && ma->adt->action)
+ if (ma->adt && ma->adt->action)
{
/* isMatAnim = true; */
fcu = (FCurve*)ma->adt->action->curves.first;
{
char * transformName = extract_transform_name( fcu->rna_path );
- if( !strcmp(transformName, "rotation_quaternion") ) {
+ if ( !strcmp(transformName, "rotation_quaternion") ) {
for ( int i = 0 ; i < fcu->totvert ; i++){
*(quat + ( i * 4 ) + fcu->array_index) = fcu->bezt[i].vec[1][1];
}
char* boneName = strtok((char *)rna_path.c_str(), "\"");
boneName = strtok(NULL,"\"");
- if( boneName != NULL )
+ if ( boneName != NULL )
return /*id_name(ob) + "_" +*/ std::string(boneName);
else
return id_name(ob);
std::string output_id;
//quat rotations are skipped for now, because of complications with determining axis.
- if(quatRotation)
+ if (quatRotation)
{
float * eul = get_eul_source_for_quat(ob);
float * eul_axis = (float*)MEM_callocN(sizeof(float) * fcu->totvert, "quat output source values");
target = get_camera_id(ob)
+ "/" + get_camera_param_sid(fcu->rna_path, -1, axis_name, true);
- if( ma )
+ if ( ma )
target = translate_id(id_name(ma)) + "-effect"
+"/common/" /*profile common is only supported */ + get_transform_sid(fcu->rna_path, -1, axis_name, true);
}
{
bool is_def;
//Check if current bone is deform
- if((bone->flag & BONE_NO_DEFORM) == 0 ) return true;
+ if ((bone->flag & BONE_NO_DEFORM) == 0 ) return true;
//Check child bones
else
{
{
std::string bone_name = getObjectBoneName(ob_arm,fcu);
int val = BLI_strcasecmp((char*)bone_name.c_str(),bone->name);
- if(val==0) break;
+ if (val==0) break;
fcu = fcu->next;
}
- if(!(fcu)) return;
+ if (!(fcu)) return;
bPoseChannel *pchan = get_pose_channel(ob_arm->pose, bone->name);
if (!pchan)
return;
// SECOND_LIFE_COMPATIBILITY
// AFAIK animation to second life is via BVH, but no
// reason to not have the collada-animation be correct
- if(export_settings->second_life)
+ if (export_settings->second_life)
{
float temp[4][4];
copy_m4_m4(temp, bone->arm_mat);
mult_m4_m4m4(mat, mat, temp);
- if(bone->parent)
+ if (bone->parent)
{
copy_m4_m4(temp, bone->parent->arm_mat);
temp[3][0] = temp[3][1] = temp[3][2] = 0.0f;
FCurve *fcu = 0;
//Check for object transform animations
- if(ob->adt && ob->adt->action)
+ if (ob->adt && ob->adt->action)
fcu = (FCurve*)ob->adt->action->curves.first;
//Check for Lamp parameter animations
- else if( (ob->type == OB_LAMP ) && ((Lamp*)ob ->data)->adt && ((Lamp*)ob ->data)->adt->action )
+ else if ( (ob->type == OB_LAMP ) && ((Lamp*)ob ->data)->adt && ((Lamp*)ob ->data)->adt->action )
fcu = (FCurve*)(((Lamp*)ob ->data)->adt->action->curves.first);
//Check for Camera parameter animations
- else if( (ob->type == OB_CAMERA ) && ((Camera*)ob ->data)->adt && ((Camera*)ob ->data)->adt->action )
+ else if ( (ob->type == OB_CAMERA ) && ((Camera*)ob ->data)->adt && ((Camera*)ob ->data)->adt->action )
fcu = (FCurve*)(((Camera*)ob ->data)->adt->action->curves.first);
//Check Material Effect parameter animations.
- for(int a = 0; a < ob->totcol; a++)
+ for (int a = 0; a < ob->totcol; a++)
{
Material *ma = give_current_material(ob, a+1);
if (!ma) continue;
- if(ma->adt && ma->adt->action)
+ if (ma->adt && ma->adt->action)
{
fcu = (FCurve*)ma->adt->action->curves.first;
}
bez.vec[1][1] = bc_get_float_value(output, j * dim + i);
- if( curve->getInterpolationType() == COLLADAFW::AnimationCurve::INTERPOLATION_BEZIER ||
+ if ( curve->getInterpolationType() == COLLADAFW::AnimationCurve::INTERPOLATION_BEZIER ||
curve->getInterpolationType() == COLLADAFW::AnimationCurve::INTERPOLATION_STEP)
{
COLLADAFW::FloatOrDoubleArray& intan = curve->getInTangentValues();
// outtangent
bez.vec[2][0] = bc_get_float_value(outtan, (j * 2 * dim ) + (2 * i)) * fps;
bez.vec[2][1] = bc_get_float_value(outtan, (j * 2 * dim )+ (2 * i) + 1);
- if(curve->getInterpolationType() == COLLADAFW::AnimationCurve::INTERPOLATION_BEZIER)
+ if (curve->getInterpolationType() == COLLADAFW::AnimationCurve::INTERPOLATION_BEZIER)
bez.ipo = BEZT_IPO_BEZ;
else
bez.ipo = BEZT_IPO_CONST;
if (ef != NULL) { /* can be NULL [#28909] */
const COLLADAFW::CommonEffectPointerArray& commonEffects = ef->getCommonEffects();
COLLADAFW::EffectCommon *efc = commonEffects[0];
- if((animType->material & MATERIAL_SHININESS) != 0){
+ if ((animType->material & MATERIAL_SHININESS) != 0){
const COLLADAFW::FloatOrParam *shin = &(efc->getShininess());
const COLLADAFW::UniqueId& listid = shin->getAnimationList();
Assign_float_animations( listid, AnimCurves , "specular_hardness" );
}
- if((animType->material & MATERIAL_IOR) != 0){
+ if ((animType->material & MATERIAL_IOR) != 0){
const COLLADAFW::FloatOrParam *ior = &(efc->getIndexOfRefraction());
const COLLADAFW::UniqueId& listid = ior->getAnimationList();
Assign_float_animations( listid, AnimCurves , "raytrace_transparency.ior" );
}
- if((animType->material & MATERIAL_SPEC_COLOR) != 0){
+ if ((animType->material & MATERIAL_SPEC_COLOR) != 0){
const COLLADAFW::ColorOrTexture *cot = &(efc->getSpecular());
const COLLADAFW::UniqueId& listid = cot->getColor().getAnimationList();
Assign_color_animations( listid, AnimCurves , "specular_color" );
}
- if((animType->material & MATERIAL_DIFF_COLOR) != 0){
+ if ((animType->material & MATERIAL_DIFF_COLOR) != 0){
const COLLADAFW::ColorOrTexture *cot = &(efc->getDiffuse());
const COLLADAFW::UniqueId& listid = cot->getColor().getAnimationList();
Assign_color_animations( listid, AnimCurves , "diffuse_color" );
const COLLADAFW::Effect *ef = (COLLADAFW::Effect *) (FW_object_map[matuid]);
if (ef != NULL) { /* can be NULL [#28909] */
const COLLADAFW::CommonEffectPointerArray& commonEffects = ef->getCommonEffects();
- if(!commonEffects.empty()) {
+ if (!commonEffects.empty()) {
COLLADAFW::EffectCommon *efc = commonEffects[0];
types->material = setAnimType(&(efc->getShininess()),(types->material), MATERIAL_SHININESS);
types->material = setAnimType(&(efc->getSpecular().getColor()),(types->material), MATERIAL_SPEC_COLOR);
while( i != child_objects.end() )
{
- if((*i)->partype == PARBONE && (0 == strcmp((*i)->parsubstr, bone->name)))
+ if ((*i)->partype == PARBONE && (0 == strcmp((*i)->parsubstr, bone->name)))
{
float backup_parinv[4][4];
copy_m4_m4(backup_parinv, (*i)->parentinv);
// TODO: when such objects are animated as
// single matrix the tweak must be applied
// to the result.
- if(export_settings->second_life)
+ if (export_settings->second_life)
{
// tweak objects parentinverse to match compatibility
float temp[4][4];
}
// SECOND_LIFE_COMPATIBILITY
- if(export_settings->second_life)
+ if (export_settings->second_life)
{
// Remove rotations vs armature from transform
// parent_rest_rot * mat * irest_rot
mult_m4_m4m4(mat, mat, temp);
- if(bone->parent)
+ if (bone->parent)
{
copy_m4_m4(temp, bone->parent->arm_mat);
temp[3][0] = temp[3][1] = temp[3][2] = 0.0f;
for (j = 0; j < vert->totweight; j++) {
int joint_index = joint_index_by_def_index[vert->dw[j].def_nr];
- if(joint_index != -1 && vert->dw[j].weight > 0.0f)
+ if (joint_index != -1 && vert->dw[j].weight > 0.0f)
{
jw[joint_index] += vert->dw[j].weight;
sumw += vert->dw[j].weight;
}
}
- if(sumw > 0.0f)
+ if (sumw > 0.0f)
{
float invsumw = 1.0f/sumw;
vcounts.push_back(jw.size());
- for(std::map<int, float>::iterator m = jw.begin(); m != jw.end(); ++m)
+ for (std::map<int, float>::iterator m = jw.begin(); m != jw.end(); ++m)
{
joints.push_back((*m).first);
weights.push_back(invsumw*(*m).second);
float inv_bind_mat[4][4];
// SECOND_LIFE_COMPATIBILITY
- if(export_settings->second_life)
+ if (export_settings->second_life)
{
// Only translations, no rotation vs armature
float temp[4][4];
source.prepareToAppendValues();
- for(std::list<float>::const_iterator i = weights.begin(); i != weights.end(); ++i) {
+ for (std::list<float>::const_iterator i = weights.begin(); i != weights.end(); ++i) {
source.appendValues(*i);
}
// write deformer index - weight index pairs
int weight_index = 0;
- for(std::list<int>::const_iterator i = joints.begin(); i != joints.end(); ++i)
+ for (std::list<int>::const_iterator i = joints.begin(); i != joints.end(); ++i)
{
weightselem.appendValues(*i, weight_index++);
}
TagsMap::iterator etit;
ExtraTags *et = 0;
etit = uid_tags_map.find(node->getUniqueId().toAscii());
- if(etit != uid_tags_map.end())
+ if (etit != uid_tags_map.end())
{
et = etit->second;
//else return;
float vec[3] = {0.0f, 0.0f, 0.1f};
// if parent: take parent length and direction
- if(leaf.bone->parent) sub_v3_v3v3(vec, leaf.bone->parent->tail, leaf.bone->parent->head);
+ if (leaf.bone->parent) sub_v3_v3v3(vec, leaf.bone->parent->tail, leaf.bone->parent->head);
copy_v3_v3(leaf.bone->tail, leaf.bone->head);
add_v3_v3v3(leaf.bone->tail, leaf.bone->head, vec);
std::map<COLLADAFW::UniqueId, Object*>::iterator arm;
for (arm = unskinned_armature_map.begin(); arm != unskinned_armature_map.end(); arm++) {
- if(arm->first == node->getUniqueId() )
+ if (arm->first == node->getUniqueId() )
return arm->second;
}
return NULL;
char *bc_CustomData_get_layer_name(const struct CustomData *data, int type, int n)
{
int layer_index = CustomData_get_layer_index(data, type);
- if(layer_index < 0) return NULL;
+ if (layer_index < 0) return NULL;
return data->layers[layer_index+n].name;
}
{
/* get the layer index of the active layer of type */
int layer_index = CustomData_get_active_layer_index(data, type);
- if(layer_index < 0) return NULL;
+ if (layer_index < 0) return NULL;
return data->layers[layer_index].name;
}
switch(RNA_property_enum_get(&unit_settings, system)) {
case USER_UNIT_NONE:
case USER_UNIT_METRIC:
- if(linearmeasure == 0.001f) {
+ if (linearmeasure == 0.001f) {
unitname = "millimeter";
}
- else if(linearmeasure == 0.01f) {
+ else if (linearmeasure == 0.01f) {
unitname = "centimeter";
}
- else if(linearmeasure == 0.1f) {
+ else if (linearmeasure == 0.1f) {
unitname = "decimeter";
}
- else if(linearmeasure == 1.0f) {
+ else if (linearmeasure == 1.0f) {
unitname = "meter";
}
- else if(linearmeasure == 1000.0f) {
+ else if (linearmeasure == 1000.0f) {
unitname = "kilometer";
}
break;
case USER_UNIT_IMPERIAL:
- if(linearmeasure == 0.0254f) {
+ if (linearmeasure == 0.0254f) {
unitname = "inch";
}
- else if(linearmeasure == 0.3048f) {
+ else if (linearmeasure == 0.3048f) {
unitname = "foot";
}
- else if(linearmeasure == 0.9144f) {
+ else if (linearmeasure == 0.9144f) {
unitname = "yard";
}
break;
asset.setUnit(unitname, linearmeasure);
asset.setUpAxisType(COLLADASW::Asset::Z_UP);
- if(U.author[0] != '\0') {
+ if (U.author[0] != '\0') {
asset.getContributor().mAuthor = U.author;
}
else {
asset.add();
// <library_cameras>
- if(has_object_type(sce, OB_CAMERA)) {
+ if (has_object_type(sce, OB_CAMERA)) {
CamerasExporter ce(&sw, this->export_settings);
ce.exportCameras(sce);
}
// <library_lights>
- if(has_object_type(sce, OB_LAMP)) {
+ if (has_object_type(sce, OB_LAMP)) {
LightsExporter le(&sw, this->export_settings);
le.exportLights(sce);
}
me.exportMaterials(sce);
// <library_geometries>
- if(has_object_type(sce, OB_MESH)) {
+ if (has_object_type(sce, OB_MESH)) {
GeometryExporter ge(&sw, this->export_settings);
ge.exportGeom(sce);
}
// <library_controllers>
ArmatureExporter arm_exporter(&sw, this->export_settings);
- if(has_object_type(sce, OB_ARMATURE)) {
+ if (has_object_type(sce, OB_ARMATURE)) {
arm_exporter.export_controllers(sce);
}
return false;
}
- if(errorHandler.hasError())
+ if (errorHandler.hasError())
return false;
/** TODO set up scene graph and such here */
void DocumentImporter::finish()
{
- if(mImportStage!=General)
+ if (mImportStage!=General)
return;
/** TODO Break up and put into 2-pass parsing of DAE */
// transformation matrix and apply it to the newly instantiated
// object to account for node hierarchy transforms in
// .dae
- if(source_node) {
+ if (source_node) {
COLLADABU::Math::Matrix4 mat4 = source_node->getTransformationMatrix();
COLLADABU::Math::Matrix4 bmat4 = mat4.transpose(); // transpose to get blender row-major order
float mat[4][4];
\return The writer should return true, if writing succeeded, false otherwise.*/
bool DocumentImporter::writeVisualScene ( const COLLADAFW::VisualScene* visualScene )
{
- if(mImportStage!=General)
+ if (mImportStage!=General)
return true;
// this method called on post process after writeGeometry, writeMaterial, etc.
\return The writer should return true, if writing succeeded, false otherwise.*/
bool DocumentImporter::writeLibraryNodes ( const COLLADAFW::LibraryNodes* libraryNodes )
{
- if(mImportStage!=General)
+ if (mImportStage!=General)
return true;
Scene *sce = CTX_data_scene(mContext);
\return The writer should return true, if writing succeeded, false otherwise.*/
bool DocumentImporter::writeGeometry ( const COLLADAFW::Geometry* geom )
{
- if(mImportStage!=General)
+ if (mImportStage!=General)
return true;
return mesh_importer.write_geometry(geom);
\return The writer should return true, if writing succeeded, false otherwise.*/
bool DocumentImporter::writeMaterial( const COLLADAFW::Material* cmat )
{
- if(mImportStage!=General)
+ if (mImportStage!=General)
return true;
const std::string& str_mat_id = cmat->getName().size() ? cmat->getName() : cmat->getOriginalId();
}
}
- if(ef->getOpacity().isTexture()) {
+ if (ef->getOpacity().isTexture()) {
COLLADAFW::Texture ctex = ef->getOpacity().getTexture();
mtex = create_texture(ef, ctex, ma, i, texindex_texarray_map);
- if(mtex != NULL) {
+ if (mtex != NULL) {
mtex->mapto = MAP_ALPHA;
mtex->tex->imaflag |= TEX_USEALPHA;
i++;
bool DocumentImporter::writeEffect( const COLLADAFW::Effect* effect )
{
- if(mImportStage!=General)
+ if (mImportStage!=General)
return true;
const COLLADAFW::UniqueId& uid = effect->getUniqueId();
Material *ma = uid_effect_map[uid];
std::map<COLLADAFW::UniqueId, Material*>::iterator iter;
- for(iter = uid_material_map.begin(); iter != uid_material_map.end() ; iter++ )
+ for (iter = uid_material_map.begin(); iter != uid_material_map.end() ; iter++ )
{
if ( iter->second == ma ) {
this->FW_object_map[iter->first] = effect;
\return The writer should return true, if writing succeeded, false otherwise.*/
bool DocumentImporter::writeCamera( const COLLADAFW::Camera* camera )
{
- if(mImportStage!=General)
+ if (mImportStage!=General)
return true;
Camera *cam = NULL;
\return The writer should return true, if writing succeeded, false otherwise.*/
bool DocumentImporter::writeImage( const COLLADAFW::Image* image )
{
- if(mImportStage!=General)
+ if (mImportStage!=General)
return true;
// XXX maybe it is necessary to check if the path is absolute or relative
\return The writer should return true, if writing succeeded, false otherwise.*/
bool DocumentImporter::writeLight( const COLLADAFW::Light* light )
{
- if(mImportStage!=General)
+ if (mImportStage!=General)
return true;
Lamp *lamp = NULL;
TagsMap::iterator etit;
ExtraTags *et = 0;
etit = uid_tags_map.find(light->getUniqueId().toAscii());
- if(etit != uid_tags_map.end())
+ if (etit != uid_tags_map.end())
et = etit->second;
la_id = light->getOriginalId();
}
// if we find an ExtraTags for this, use that instead.
- if(et && et->isProfile("blender")) {
+ if (et && et->isProfile("blender")) {
et->setData("type", &(lamp->type));
et->setData("flag", &(lamp->flag));
et->setData("mode", &(lamp->mode));
lamp->b = col.getBlue();
}
- if(IS_EQ(linatt, 0.0f) && quadatt > 0.0f) {
+ if (IS_EQ(linatt, 0.0f) && quadatt > 0.0f) {
att2 = quadatt;
d = sqrt(1.0f/quadatt);
}
// linear light
- else if(IS_EQ(quadatt, 0.0f) && linatt > 0.0f) {
+ else if (IS_EQ(quadatt, 0.0f) && linatt > 0.0f) {
att1 = linatt;
d = (1.0f/linatt);
}
lamp->type = LA_SPOT;
lamp->att1 = att1;
lamp->att2 = att2;
- if(IS_EQ(att1, 0.0f) && att2 > 0)
+ if (IS_EQ(att1, 0.0f) && att2 > 0)
lamp->falloff_type = LA_FALLOFF_INVSQUARE;
- if(IS_EQ(att2, 0.0f) && att1 > 0)
+ if (IS_EQ(att2, 0.0f) && att1 > 0)
lamp->falloff_type = LA_FALLOFF_INVLINEAR;
lamp->spotsize = light->getFallOffAngle().getValue();
lamp->spotblend = light->getFallOffExponent().getValue();
lamp->type = LA_LOCAL;
lamp->att1 = att1;
lamp->att2 = att2;
- if(IS_EQ(att1, 0.0f) && att2 > 0)
+ if (IS_EQ(att1, 0.0f) && att2 > 0)
lamp->falloff_type = LA_FALLOFF_INVSQUARE;
- if(IS_EQ(att2, 0.0f) && att1 > 0)
+ if (IS_EQ(att2, 0.0f) && att1 > 0)
lamp->falloff_type = LA_FALLOFF_INVLINEAR;
}
break;
// this function is called only for animations that pass COLLADAFW::validate
bool DocumentImporter::writeAnimation( const COLLADAFW::Animation* anim )
{
- if(mImportStage!=General)
+ if (mImportStage!=General)
return true;
// return true;
// called on post-process stage after writeVisualScenes
bool DocumentImporter::writeAnimationList( const COLLADAFW::AnimationList* animationList )
{
- if(mImportStage!=General)
+ if (mImportStage!=General)
return true;
// return true;
// this is called on postprocess, before writeVisualScenes
bool DocumentImporter::writeController( const COLLADAFW::Controller* controller )
{
- if(mImportStage!=General)
+ if (mImportStage!=General)
return true;
return armature_importer.write_controller(controller);
ExtraTags* DocumentImporter::getExtraTags(const COLLADAFW::UniqueId &uid)
{
- if(uid_tags_map.find(uid.toAscii())==uid_tags_map.end()) {
+ if (uid_tags_map.find(uid.toAscii())==uid_tags_map.end()) {
return NULL;
}
return uid_tags_map[uid.toAscii()];
while(base) {
Object *ob= base->object;
int a;
- for(a = 0; a < ob->totcol; a++)
+ for (a = 0; a < ob->totcol; a++)
{
Material *ma = give_current_material(ob, a+1);
void EffectsExporter::exportEffects(Scene *sce)
{
- if(hasEffects(sce)) {
+ if (hasEffects(sce)) {
this->scene = sce;
openLibrary();
MaterialFunctor mf;
ep.setProfileType(COLLADASW::EffectProfile::COMMON);
ep.openProfile();
// set shader type - one of three blinn, phong or lambert
- if(ma->spec>0.0f) {
+ if (ma->spec>0.0f) {
if (ma->spec_shader == MA_SPEC_BLINN) {
writeBlinn(ep, ma);
}
}
}
else {
- if(ma->diff_shader == MA_DIFF_LAMBERT) {
+ if (ma->diff_shader == MA_DIFF_LAMBERT) {
writeLambert(ep, ma);
}
else {
// ambient
/* ma->ambX is calculated only on render, so lets do it here manually and not rely on ma->ambX. */
- if(this->scene->world)
+ if (this->scene->world)
cot = getcol(this->scene->world->ambr*ma->amb, this->scene->world->ambg*ma->amb, this->scene->world->ambb*ma->amb, 1.0f);
else
cot = getcol(ma->amb, ma->amb, ma->amb, 1.0f);
Image *ima = t->tex->ima;
// Image not set for texture
- if(!ima) continue;
+ if (!ima) continue;
std::string key(id_name(ima));
key = translate_id(key);
Image *ima = t->tex->ima;
// Image not set for texture
- if(!ima) continue;
+ if (!ima) continue;
// we assume map input is always TEXCO_UV
{
char buf[1024];
- if(currentElement.length() == 0 || currentExtraTags == 0) return false;
+ if (currentElement.length() == 0 || currentExtraTags == 0) return false;
BLI_snprintf(buf, textLength+1, "%s", text);
currentExtraTags->addTag(currentElement, std::string(buf));
const char* profileName,
const unsigned long& elementHash,
const COLLADAFW::UniqueId& uniqueId ) {
- if(BLI_strcaseeq(profileName, "blender")) {
+ if (BLI_strcaseeq(profileName, "blender")) {
//printf("In parseElement for supported profile %s for id %s\n", profileName, uniqueId.toAscii().c_str());
currentUid = uniqueId;
ExtraTags *et = dimp->getExtraTags(uniqueId);
- if(!et) {
+ if (!et) {
et = new ExtraTags(std::string(profileName));
dimp->addExtraTags(uniqueId, et);
}
int ExtraTags::asInt( std::string tag, bool *ok)
{
- if(tags.find(tag) == tags.end()) {
+ if (tags.find(tag) == tags.end()) {
*ok = false;
return -1;
}
float ExtraTags::asFloat( std::string tag, bool *ok)
{
- if(tags.find(tag) == tags.end()) {
+ if (tags.find(tag) == tags.end()) {
*ok = false;
return -1.0f;
}
std::string ExtraTags::asString( std::string tag, bool *ok)
{
- if(tags.find(tag) == tags.end()) {
+ if (tags.find(tag) == tags.end()) {
*ok = false;
return "";
}
{
bool ok = false;
int tmp = asInt(tag, &ok);
- if(ok)
+ if (ok)
*data = (short)tmp;
}
void ExtraTags::setData(std::string tag, int *data)
{
bool ok = false;
int tmp = asInt(tag, &ok);
- if(ok)
+ if (ok)
*data = tmp;
}
void ExtraTags::setData(std::string tag, float *data)
{
bool ok = false;
float tmp = asFloat(tag, &ok);
- if(ok)
+ if (ok)
*data = tmp;
}
void ExtraTags::setData(std::string tag, char *data)
{
bool ok = false;
int tmp = asInt(tag, &ok);
- if(ok)
+ if (ok)
*data = (char)tmp;
}
// XXX slow
if (ob->totcol) {
- for(int a = 0; a < ob->totcol; a++) {
+ for (int a = 0; a < ob->totcol; a++) {
createPolylist(a, has_uvs, has_color, ob, geom_id, norind);
}
}
while(base) {
Object *ob= base->object;
int a;
- for(a = 0; a < ob->totcol; a++)
+ for (a = 0; a < ob->totcol; a++)
{
Material *ma = give_current_material(ob, a+1);
void ImagesExporter::exportImages(Scene *sce)
{
- if(hasImages(sce)) {
+ if (hasImages(sce)) {
openLibrary();
MaterialFunctor mf;
mf.forEachMaterialInScene<ImagesExporter>(sce, *this, this->export_settings->selected);
void InstanceWriter::add_material_bindings(COLLADASW::BindMaterial& bind_material, Object *ob)
{
- for(int a = 0; a < ob->totcol; a++) {
+ for (int a = 0; a < ob->totcol; a++) {
Material *ma = give_current_material(ob, a+1);
COLLADASW::InstanceMaterialList& iml = bind_material.getInstanceMaterialList();
constatt = 1.0f;
- if(la->falloff_type==LA_FALLOFF_INVLINEAR) {
+ if (la->falloff_type==LA_FALLOFF_INVLINEAR) {
linatt = 1.0f / d;
quadatt = 0.0f;
}
void MaterialsExporter::exportMaterials(Scene *sce)
{
- if(hasMaterials(sce)) {
+ if (hasMaterials(sce)) {
openLibrary();
MaterialFunctor mf;
while(base) {
Object *ob= base->object;
int a;
- for(a = 0; a < ob->totcol; a++)
+ for (a = 0; a < ob->totcol; a++)
{
Material *ma = give_current_material(ob, a+1);
void UVDataWrapper::getUV(int uv_index, float *uv)
{
int stride = mVData->getStride(0);
- if(stride==0) stride = 2;
+ if (stride==0) stride = 2;
switch(mVData->getType()) {
case COLLADAFW::MeshVertexData::DATA_TYPE_FLOAT:
COLLADAFW::Polygons *mpvc = (COLLADAFW::Polygons*)mp;
COLLADAFW::Polygons::VertexCountArray& vca = mpvc->getGroupedVerticesVertexCountArray();
- for(unsigned int j = 0; j < vca.getCount(); j++){
+ for (unsigned int j = 0; j < vca.getCount(); j++){
int count = vca[j];
if (count < 3) {
fprintf(stderr, "Primitive %s in %s has at least one face with vertex count < 3\n",
}
}
- else if(type != COLLADAFW::MeshPrimitive::TRIANGLES && type!= COLLADAFW::MeshPrimitive::TRIANGLE_FANS) {
+ else if (type != COLLADAFW::MeshPrimitive::TRIANGLES && type!= COLLADAFW::MeshPrimitive::TRIANGLE_FANS) {
fprintf(stderr, "Primitive type %s is not supported.\n", type_str);
return false;
}
// vertices
COLLADAFW::MeshVertexData& pos = mesh->getPositions();
int stride = pos.getStride(0);
- if(stride==0) stride = 3;
+ if (stride==0) stride = 3;
me->totvert = mesh->getPositions().getFloatValues()->getCount() / stride;
me->mvert = (MVert*)CustomData_add_layer(&me->vdata, CD_MVERT, CD_CALLOC, NULL, me->totvert);
size_t setindex = ctexture.getSetIndex();
std::string uvname = ctexture.getSemantic();
- if(setindex==-1) return NULL;
+ if (setindex==-1) return NULL;
const CustomData *data = &me->fdata;
int layer_index = CustomData_get_layer_index(data, CD_MTFACE);
- if(layer_index == -1) return NULL;
+ if (layer_index == -1) return NULL;
CustomDataLayer *cdl = &data->layers[layer_index+setindex];
std::multimap<COLLADAFW::UniqueId, COLLADAFW::UniqueId>::iterator it;
it=materials_mapped_to_geom.find(*geom_uid);
while(it!=materials_mapped_to_geom.end()) {
- if(it->second == ma_uid && it->first == *geom_uid) return NULL; // do nothing if already found
+ if (it->second == ma_uid && it->first == *geom_uid) return NULL; // do nothing if already found
it++;
}
// first time we get geom_uid, ma_uid pair. Save for later check.
// loop through geom's materials
for (unsigned int i = 0; i < mat_array.getCount(); i++) {
- if(mat_array[i].getReferencedMaterial().isValid()) {
+ if (mat_array[i].getReferencedMaterial().isValid()) {
texture_face = assign_material_to_geom(mat_array[i], uid_material_map, ob, geom_uid,
&color_texture, layername, texture_face,
material_texture_mapping_map, i);
Object *ob = base->object;
if (!ob->parent) {
- if(sce->lay & ob->lay) {
+ if (sce->lay & ob->lay) {
switch(ob->type) {
case OB_MESH:
case OB_CAMERA:
// empty object
else if (ob->type == OB_EMPTY) { // TODO: handle groups (OB_DUPLIGROUP
- if((ob->transflag & OB_DUPLIGROUP) == OB_DUPLIGROUP && ob->dup_group) {
+ if ((ob->transflag & OB_DUPLIGROUP) == OB_DUPLIGROUP && ob->dup_group) {
GroupObject *go = NULL;
Group *gr = ob->dup_group;
/* printf("group detected '%s'\n", gr->id.name+2); */
- for(go = (GroupObject*)(gr->gobject.first); go; go=go->next) {
+ for (go = (GroupObject*)(gr->gobject.first); go; go=go->next) {
printf("\t%s\n", go->ob->id.name);
}
}
}
- for(std::list<Object*>::iterator i= child_objects.begin(); i != child_objects.end(); ++i)
+ for (std::list<Object*>::iterator i= child_objects.begin(); i != child_objects.end(); ++i)
{
writeNodes(*i, sce);
}
*/
/* Using parentinv should allow use of existing curves */
- if(ob->parent)
+ if (ob->parent)
{
// If parentinv is identity don't add it.
bool add_parinv = false;
- for(int i = 0; i < 16; ++i)
+ for (int i = 0; i < 16; ++i)
{
float f = (i % 4 == i / 4) ? 1.0f : 0.0f;
add_parinv |= (ob->parentinv[i % 4][i / 4] != f);
}
- if(add_parinv)
+ if (add_parinv)
{
double dmat[4][4];
UnitConverter converter;
int collada_import(bContext *C, const char *filepath)
{
DocumentImporter imp (C, filepath);
- if(imp.import()) return 1;
+ if (imp.import()) return 1;
return 0;
}
export_settings.filepath = (char *)filepath;
/* annoying, collada crashes if file cant be created! [#27162] */
- if(!BLI_exists(filepath)) {
+ if (!BLI_exists(filepath)) {
BLI_make_existing_file(filepath); /* makes the dir if its not there */
- if(BLI_file_touch(filepath) == 0) {
+ if (BLI_file_touch(filepath) == 0) {
return 0;
}
}
{
id_translated[i] = translate_name_map[(unsigned int)id_translated[i]];
}
- // It's so much workload now, the if() should speed up things.
+ // It's so much workload now, the if () should speed up things.
if (id_translated != id)
{
// Search duplicates
{
/* test if 'ob' is a parent somewhere in par's parents */
- if(par == NULL) return 0;
- if(ob == par) return 1;
+ if (par == NULL) return 0;
+ if (ob == par) return 1;
return bc_test_parent_loop(par->parent, ob);
}
/* what about resolu == 2? */
bp= nu->bp+u;
for (v=0; v<nu->pntsv-1; v++, bp+=nu->pntsu) {
- if (v) if(bp->f1 & SELECT) return 1;
+ if (v) if (bp->f1 & SELECT) return 1;
}
return 0;
bp->vec[0]+= fac*grid;
fac= (float)b -1.5f;
bp->vec[1]+= fac*grid;
- if (a==1 || a==2) if(b==1 || b==2) {
+ if (a==1 || a==2) if (b==1 || b==2) {
bp->vec[2]+= grid;
}
mul_m4_v3(mat,bp->vec);
/* avoid unneeded calls to ui_get_but_val */
#define UI_BUT_VALUE_UNSET DBL_MAX
-#define UI_GET_BUT_VALUE_INIT(_but, _value) if(_value == DBL_MAX) { (_value)= ui_get_but_val(_but); }
+#define UI_GET_BUT_VALUE_INIT(_but, _value) if (_value == DBL_MAX) { (_value)= ui_get_but_val(_but); }
/*
* a full doc with API notes can be found in bf-blender/trunk/blender/doc/guides/interface_API.txt
glGetFloatv(GL_CURRENT_COLOR, color);
/* 'shade' defines strength of shading */
- coltop[0]= color[0]+shadetop; if(coltop[0]>1.0f) coltop[0]= 1.0f;
- coltop[1]= color[1]+shadetop; if(coltop[1]>1.0f) coltop[1]= 1.0f;
- coltop[2]= color[2]+shadetop; if(coltop[2]>1.0f) coltop[2]= 1.0f;
- coldown[0]= color[0]+shadedown; if(coldown[0]<0.0f) coldown[0]= 0.0f;
- coldown[1]= color[1]+shadedown; if(coldown[1]<0.0f) coldown[1]= 0.0f;
- coldown[2]= color[2]+shadedown; if(coldown[2]<0.0f) coldown[2]= 0.0f;
+ coltop[0]= color[0]+shadetop; if (coltop[0]>1.0f) coltop[0]= 1.0f;
+ coltop[1]= color[1]+shadetop; if (coltop[1]>1.0f) coltop[1]= 1.0f;
+ coltop[2]= color[2]+shadetop; if (coltop[2]>1.0f) coltop[2]= 1.0f;
+ coldown[0]= color[0]+shadedown; if (coldown[0]<0.0f) coldown[0]= 0.0f;
+ coldown[1]= color[1]+shadedown; if (coldown[1]<0.0f) coldown[1]= 0.0f;
+ coldown[2]= color[2]+shadedown; if (coldown[2]<0.0f) coldown[2]= 0.0f;
glShadeModel(GL_SMOOTH);
glBegin(mode);
glGetFloatv(GL_CURRENT_COLOR, color);
/* 'shade' defines strength of shading */
- colLeft[0]= color[0]+shadeLeft; if(colLeft[0]>1.0f) colLeft[0]= 1.0f;
- colLeft[1]= color[1]+shadeLeft; if(colLeft[1]>1.0f) colLeft[1]= 1.0f;
- colLeft[2]= color[2]+shadeLeft; if(colLeft[2]>1.0f) colLeft[2]= 1.0f;
- colRight[0]= color[0]+shadeRight; if(colRight[0]<0.0f) colRight[0]= 0.0f;
- colRight[1]= color[1]+shadeRight; if(colRight[1]<0.0f) colRight[1]= 0.0f;
- colRight[2]= color[2]+shadeRight; if(colRight[2]<0.0f) colRight[2]= 0.0f;
+ colLeft[0]= color[0]+shadeLeft; if (colLeft[0]>1.0f) colLeft[0]= 1.0f;
+ colLeft[1]= color[1]+shadeLeft; if (colLeft[1]>1.0f) colLeft[1]= 1.0f;
+ colLeft[2]= color[2]+shadeLeft; if (colLeft[2]>1.0f) colLeft[2]= 1.0f;
+ colRight[0]= color[0]+shadeRight; if (colRight[0]<0.0f) colRight[0]= 0.0f;
+ colRight[1]= color[1]+shadeRight; if (colRight[1]<0.0f) colRight[1]= 0.0f;
+ colRight[2]= color[2]+shadeRight; if (colRight[2]<0.0f) colRight[2]= 0.0f;
glShadeModel(GL_SMOOTH);
glBegin(mode);
dir1 &= (UI_TOP|UI_DOWN);
}
- if (dir2==0) if(dir1==UI_LEFT || dir1==UI_RIGHT) dir2= UI_DOWN;
- if (dir2==0) if(dir1==UI_TOP || dir1==UI_DOWN) dir2= UI_LEFT;
+ if (dir2==0) if (dir1==UI_LEFT || dir1==UI_RIGHT) dir2= UI_DOWN;
+ if (dir2==0) if (dir1==UI_TOP || dir1==UI_DOWN) dir2= UI_LEFT;
/* no space at all? don't change */
if (left || right) {
// if there are problems because of this, then rna needs changed update functions.
//
// object_test_constraints(ob);
- // if(ob->pose) update_pose_constraint_flags(ob->pose);
+ // if (ob->pose) update_pose_constraint_flags(ob->pose);
if (ob->type==OB_ARMATURE) DAG_id_tag_update(&ob->id, OB_RECALC_DATA|OB_RECALC_OB);
else DAG_id_tag_update(&ob->id, OB_RECALC_OB);
CTX_DATA_BEGIN(C, Base*, base, selected_bases) {
- /* if(base->object->type==OB_LAMP) islamp= 1; */
+ /* if (base->object->type==OB_LAMP) islamp= 1; */
/* deselect object -- it could be used in other scenes */
base->object->flag &= ~SELECT;
base->object->lay= lay;
base->object->flag &= ~SELECT;
base->flag &= ~SELECT;
- /* if(base->object->type==OB_LAMP) islamp= 1; */
+ /* if (base->object->type==OB_LAMP) islamp= 1; */
}
CTX_DATA_END;
}
local= base->lay & 0xFF000000;
base->lay= lay + local;
base->object->lay= lay;
- /* if(base->object->type==OB_LAMP) islamp= 1; */
+ /* if (base->object->type==OB_LAMP) islamp= 1; */
}
CTX_DATA_END;
}
/* currently editmode isn't supported by mesh so
* ignore here for now too */
- /* if(lt->editlatt) lt= lt->editlatt->latt; */
+ /* if (lt->editlatt) lt= lt->editlatt->latt; */
for (w=0; w<lt->pntsw; w++) {
for (v=0; v<lt->pntsv; v++) {
#define KEY_K PTCacheEditKey *key; int k
#define POINT_P PTCacheEditPoint *point; int p
#define LOOP_POINTS for (p=0, point=edit->points; p<edit->totpoint; p++, point++)
-#define LOOP_VISIBLE_POINTS for (p=0, point=edit->points; p<edit->totpoint; p++, point++) if(!(point->flag & PEP_HIDE))
-#define LOOP_SELECTED_POINTS for (p=0, point=edit->points; p<edit->totpoint; p++, point++) if(point_is_selected(point))
-#define LOOP_UNSELECTED_POINTS for (p=0, point=edit->points; p<edit->totpoint; p++, point++) if(!point_is_selected(point))
-#define LOOP_EDITED_POINTS for (p=0, point=edit->points; p<edit->totpoint; p++, point++) if(point->flag & PEP_EDIT_RECALC)
-#define LOOP_TAGGED_POINTS for (p=0, point=edit->points; p<edit->totpoint; p++, point++) if(point->flag & PEP_TAG)
+#define LOOP_VISIBLE_POINTS for (p=0, point=edit->points; p<edit->totpoint; p++, point++) if (!(point->flag & PEP_HIDE))
+#define LOOP_SELECTED_POINTS for (p=0, point=edit->points; p<edit->totpoint; p++, point++) if (point_is_selected(point))
+#define LOOP_UNSELECTED_POINTS for (p=0, point=edit->points; p<edit->totpoint; p++, point++) if (!point_is_selected(point))
+#define LOOP_EDITED_POINTS for (p=0, point=edit->points; p<edit->totpoint; p++, point++) if (point->flag & PEP_EDIT_RECALC)
+#define LOOP_TAGGED_POINTS for (p=0, point=edit->points; p<edit->totpoint; p++, point++) if (point->flag & PEP_TAG)
#define LOOP_KEYS for (k=0, key=point->keys; k<point->totkey; k++, key++)
-#define LOOP_VISIBLE_KEYS for (k=0, key=point->keys; k<point->totkey; k++, key++) if(!(key->flag & PEK_HIDE))
-#define LOOP_SELECTED_KEYS for (k=0, key=point->keys; k<point->totkey; k++, key++) if((key->flag & PEK_SELECT) && !(key->flag & PEK_HIDE))
-#define LOOP_TAGGED_KEYS for (k=0, key=point->keys; k<point->totkey; k++, key++) if(key->flag & PEK_TAG)
+#define LOOP_VISIBLE_KEYS for (k=0, key=point->keys; k<point->totkey; k++, key++) if (!(key->flag & PEK_HIDE))
+#define LOOP_SELECTED_KEYS for (k=0, key=point->keys; k<point->totkey; k++, key++) if ((key->flag & PEK_SELECT) && !(key->flag & PEK_HIDE))
+#define LOOP_TAGGED_KEYS for (k=0, key=point->keys; k<point->totkey; k++, key++) if (key->flag & PEK_TAG)
#define KEY_WCO (key->flag & PEK_USE_WCO ? key->world_co : key->co)
hkey= pa->hair;
LOOP_KEYS {
- while(key->flag & PEK_TAG && hkey < pa->hair + pa->totkey) {
+ while (key->flag & PEK_TAG && hkey < pa->hair + pa->totkey) {
key++;
hkey++;
}
/* remove tagged particles - don't do mirror here! */
remove_tagged_particles(ob, psys, 0);
totremoved += removed;
- } while(removed);
+ } while (removed);
if (totremoved == 0)
return OPERATOR_CANCELLED;
newpa->fuv[1]= pa->fuv[1];
newpa->fuv[2]= pa->fuv[0];
newpa->fuv[3]= pa->fuv[3];
- while(rotation-- > 0)
+ while (rotation-- > 0)
if (me->mface[pa->num].v4) {
SHIFT4(float, newpa->fuv[0], newpa->fuv[1], newpa->fuv[2], newpa->fuv[3]);
}
for (i=0; i<number; i++) {
if (number>1) {
dmx=dmy=size;
- while(dmx*dmx+dmy*dmy>size2) {
+ while (dmx*dmx+dmy*dmy>size2) {
dmx=(short)((2.0f*BLI_frand()-1.0f)*size);
dmy=(short)((2.0f*BLI_frand()-1.0f)*size);
}
if (!edit) return;
/* remove all undos after (also when curundo==NULL) */
- while(edit->undo.last != edit->curundo) {
+ while (edit->undo.last != edit->curundo) {
undo= edit->undo.last;
BLI_remlink(&edit->undo, undo);
free_PTCacheUndo(undo);
/* and limit amount to the maximum */
nr= 0;
undo= edit->undo.last;
- while(undo) {
+ while (undo) {
nr++;
if (nr==U.undosteps) break;
undo= undo->prev;
}
if (undo) {
- while(edit->undo.first!=undo) {
+ while (edit->undo.first!=undo) {
PTCacheUndo *first= edit->undo.first;
BLI_remlink(&edit->undo, first);
free_PTCacheUndo(first);
if (edit==NULL) return;
undo= edit->undo.first;
- while(undo) {
+ while (undo) {
free_PTCacheUndo(undo);
undo= undo->next;
}
oneselected= 0;
while (se) {
if (se->v1->flag + se->v2->flag==1) {
- if (dir=='h') if(se->v1->vec.y==se->v2->vec.y) {
+ if (dir=='h') if (se->v1->vec.y==se->v2->vec.y) {
se->v1->flag= se->v2->flag= 1;
oneselected= 1;
}
- if (dir=='v') if(se->v1->vec.x==se->v2->vec.x) {
+ if (dir=='v') if (se->v1->vec.x==se->v2->vec.x) {
se->v1->flag= se->v2->flag= 1;
oneselected= 1;
}
h[1]= (co[1] - view[1])*2.0f/view[3] - 1;
h[2]= 1.0f;
- /* solve for(w1,w2,w3)/perspdiv in:
+ /* solve for (w1,w2,w3)/perspdiv in:
* h * perspdiv = Project * Model * (w1 * v1 + w2 * v2 + w3 * v3) */
wmat[0][0]= pv1[0]; wmat[1][0]= pv2[0]; wmat[2][0]= pv3[0];
static int console_insert_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
- // if(!RNA_struct_property_is_set(op->ptr, "text")) { /* always set from keymap XXX */
+ // if (!RNA_struct_property_is_set(op->ptr, "text")) { /* always set from keymap XXX */
if (!RNA_string_length(op->ptr, "text")) {
/* if alt/ctrl/super are pressed pass through */
if (event->ctrl || event->oskey) {
/*ConsoleLine *ci= */ console_history_verify(C);
if (scrollback) { /* last item in mistory */
- while(sc->scrollback.first)
+ while (sc->scrollback.first)
console_scrollback_free(sc, sc->scrollback.first);
}
if (history) {
- while(sc->history.first)
+ while (sc->history.first)
console_history_free(sc, sc->history.first);
}
{ /* add a duplicate of the new arg and remove all other instances */
ConsoleLine *cl;
- while((cl= console_history_find(sc, ci->line, ci)))
+ while ((cl= console_history_find(sc, ci->line, ci)))
console_history_free(sc, cl);
console_history_add(C, (ConsoleLine *)sc->history.last);
if (rem_dupes) {
ConsoleLine *cl;
- while((cl= console_history_find(sc, ci->line, ci)))
+ while ((cl= console_history_find(sc, ci->line, ci)))
console_history_free(sc, cl);
if (strcmp(str, ci->line)==0) {
buf_step= buf_str;
- while((buf_next=buf_step) && buf_next[0] != '\0') {
+ while ((buf_next=buf_step) && buf_next[0] != '\0') {
buf_step= strchr(buf_next, '\n');
if (buf_step) {
*buf_step= '\0';
id= lb->first;
filelist->numfiles= 0;
- while(id) {
+ while (id) {
if (!filelist->hide_dot || id->name[2] != '.') {
filelist->numfiles++;
}
id= lb->first;
totlib= totbl= 0;
- while(id) {
+ while (id) {
ok = 1;
if (ok) {
if (!filelist->hide_dot || id->name[2] != '.') {
if (!image_record_composite_init(C, op))
return OPERATOR_CANCELLED;
- while(image_record_composite_apply(C, op))
+ while (image_record_composite_apply(C, op))
;
image_record_composite_exit(C, op);
tvc->iter_index++;
- } while(tvc->step(tvc));
+ } while (tvc->step(tvc));
}
tvc->end(tvc);
for (a=0; a<obcount; a++) {
ob= (Object *)idar[a];
prop= ob->prop.first;
- while(prop) {
+ while (prop) {
names[nr++]= prop->name;
prop= prop->next;
}
sens= ob->sensors.first;
- while(sens) {
+ while (sens) {
names[nr++]= sens->name;
sens= sens->next;
}
cont= ob->controllers.first;
- while(cont) {
+ while (cont) {
names[nr++]= cont->name;
cont= cont->next;
}
act= ob->actuators.first;
- while(act) {
+ while (act) {
names[nr++]= act->name;
act= act->next;
}
if (val>0) {
/* now find out which object has this ... */
base= FIRSTBASE;
- while(base) {
+ while (base) {
sens= base->object->sensors.first;
- while(sens) {
+ while (sens) {
if (sens == sens_to_delete) break;
sens= sens->next;
}
if (val>0) {
/* now find out which object has this ... */
base= FIRSTBASE;
- while(base) {
+ while (base) {
cont= base->object->controllers.first;
- while(cont) {
+ while (cont) {
if (cont == controller_to_del) break;
cont= cont->next;
}
if ( val==1 && cont->prev) {
/* locate the controller that has the same state mask but is earlier in the list */
tmp = cont->prev;
- while(tmp) {
+ while (tmp) {
if (tmp->state_mask & cont->state_mask)
break;
tmp = tmp->prev;
}
else if ( val==2 && cont->next) {
tmp = cont->next;
- while(tmp) {
+ while (tmp) {
if (tmp->state_mask & cont->state_mask)
break;
tmp = tmp->next;
if (val>0) {
/* now find out which object has this ... */
base= FIRSTBASE;
- while(base) {
+ while (base) {
act= base->object->actuators.first;
- while(act) {
+ while (act) {
if (act == actuator_to_move) break;
act= act->next;
}
case B_CHANGE_SENS:
for (ob=bmain->object.first; ob; ob=ob->id.next) {
sens= ob->sensors.first;
- while(sens) {
+ while (sens) {
if (sens->type != sens->otype) {
init_sensor(sens);
sens->otype= sens->type;
case B_DEL_SENS:
for (ob=bmain->object.first; ob; ob=ob->id.next) {
sens= ob->sensors.first;
- while(sens) {
+ while (sens) {
if (sens->flag & SENS_DEL) {
BLI_remlink(&(ob->sensors), sens);
free_sensor(sens);
case B_CHANGE_CONT:
for (ob=bmain->object.first; ob; ob=ob->id.next) {
cont= ob->controllers.first;
- while(cont) {
+ while (cont) {
if (cont->type != cont->otype) {
init_controller(cont);
cont->otype= cont->type;
case B_DEL_CONT:
for (ob=bmain->object.first; ob; ob=ob->id.next) {
cont= ob->controllers.first;
- while(cont) {
+ while (cont) {
if (cont->flag & CONT_DEL) {
BLI_remlink(&(ob->controllers), cont);
unlink_controller(cont);
case B_CHANGE_ACT:
for (ob=bmain->object.first; ob; ob=ob->id.next) {
act= ob->actuators.first;
- while(act) {
+ while (act) {
if (act->type != act->otype) {
init_actuator(act);
act->otype= act->type;
case B_DEL_ACT:
for (ob=bmain->object.first; ob; ob=ob->id.next) {
act= ob->actuators.first;
- while(act) {
+ while (act) {
if (act->flag & ACT_DEL) {
BLI_remlink(&(ob->actuators), act);
unlink_actuator(act);
didit= 0;
for (ob=bmain->object.first; ob; ob=ob->id.next) {
act= ob->actuators.first;
- while(act)
+ while (act)
{
if (act->type==ACT_SOUND)
{
break;
}
- while(sound)
+ while (sound)
{
if (nr==sa->sndnr)
break;
bActuator *act;
cont= ob->controllers.first;
- while(cont) {
+ while (cont) {
cont->mynew= (bController *)ob;
cont= cont->next;
}
act= ob->actuators.first;
- while(act) {
+ while (act) {
act->mynew= (bActuator *)ob;
act= act->next;
}
if (scene==NULL) return NULL;
ob= bmain->object.first;
- while(ob) {
+ while (ob) {
ob->scavisflag= 0;
set_sca_ob(ob);
ob= ob->id.next;
lay= scene->lay;
base= FIRSTBASE;
- while(base) {
+ while (base) {
if (base->lay & lay) {
if (base->flag & SELECT) {
if (scavisflag & BUTS_SENS_SEL) base->object->scavisflag |= OB_VIS_SENS;
/* BUTS_XXX_STATE are similar to BUTS_XXX_LINK for selecting the object */
if (scavisflag & (BUTS_SENS_LINK|BUTS_CONT_LINK|BUTS_ACT_LINK|BUTS_SENS_STATE|BUTS_ACT_STATE)) {
doit= 1;
- while(doit) {
+ while (doit) {
doit= 0;
ob= bmain->object.first;
- while(ob) {
+ while (ob) {
/* 1st case: select sensor when controller selected */
if ((scavisflag & (BUTS_SENS_LINK|BUTS_SENS_STATE)) && (ob->scavisflag & OB_VIS_SENS)==0) {
sens= ob->sensors.first;
- while(sens) {
+ while (sens) {
for (a=0; a<sens->totlinks; a++) {
if (sens->links[a]) {
obt= (Object *)sens->links[a]->mynew;
/* 2nd case: select cont when act selected */
if ((scavisflag & BUTS_CONT_LINK) && (ob->scavisflag & OB_VIS_CONT)==0) {
cont= ob->controllers.first;
- while(cont) {
+ while (cont) {
for (a=0; a<cont->totlinks; a++) {
if (cont->links[a]) {
obt= (Object *)cont->links[a]->mynew;
/* 3rd case: select controller when sensor selected */
if ((scavisflag & BUTS_CONT_LINK) && (ob->scavisflag & OB_VIS_SENS)) {
sens= ob->sensors.first;
- while(sens) {
+ while (sens) {
for (a=0; a<sens->totlinks; a++) {
if (sens->links[a]) {
obt= (Object *)sens->links[a]->mynew;
/* 4th case: select actuator when controller selected */
if ( (scavisflag & (BUTS_ACT_LINK|BUTS_ACT_STATE)) && (ob->scavisflag & OB_VIS_CONT)) {
cont= ob->controllers.first;
- while(cont) {
+ while (cont) {
for (a=0; a<cont->totlinks; a++) {
if (cont->links[a]) {
obt= (Object *)cont->links[a]->mynew;
/* now we count */
ob= bmain->object.first;
- while(ob) {
+ while (ob) {
if ( ob->scavisflag ) (*count)++;
ob= ob->id.next;
}
nr++;
}
- while(ob) {
+ while (ob) {
if ( (ob->scavisflag) && (ob != obact)) {
idar[nr]= (ID *)ob;
nr++;
for (a=0; a<count; a++) {
ob= (Object *)idar[a];
sens= ob->sensors.first;
- while(sens) {
+ while (sens) {
if (event==2) sens->flag |= SENS_SHOW;
else if (event==3) sens->flag &= ~SENS_SHOW;
sens= sens->next;
for (a=0; a<count; a++) {
ob= (Object *)idar[a];
cont= ob->controllers.first;
- while(cont) {
+ while (cont) {
if (event==2) cont->flag |= CONT_SHOW;
else if (event==3) cont->flag &= ~CONT_SHOW;
cont= cont->next;
for (a=0; a<count; a++) {
ob= (Object *)idar[a];
act= ob->actuators.first;
- while(act) {
+ while (act) {
if (event==2) act->flag |= ACT_SHOW;
else if (event==3) act->flag &= ~ACT_SHOW;
act= act->next;
/* clean ACT_LINKED and ACT_VISIBLE of all potentially visible actuators so that we can determine which is actually linked/visible */
act = ob->actuators.first;
- while(act) {
+ while (act) {
act->flag &= ~(ACT_LINKED|ACT_VISIBLE);
act = act->next;
}
/* same for sensors */
sens= ob->sensors.first;
- while(sens) {
+ while (sens) {
sens->flag &= ~(SENS_VISIBLE);
sens = sens->next;
}
/* mark the linked and visible actuators */
cont= ob->controllers.first;
- while(cont) {
+ while (cont) {
flag = ACT_LINKED;
/* this controller is visible, mark all its actuator */
for (a=0; a<count; a++) {
ob= (Object *)idar[a];
act= ob->actuators.first;
- while(act) {
+ while (act) {
act->flag &= ~(ACT_LINKED|ACT_VISIBLE);
act = act->next;
}
/* same for sensors */
sens= ob->sensors.first;
- while(sens) {
+ while (sens) {
sens->flag &= ~(SENS_VISIBLE);
sens = sens->next;
}
/* note that some of these actuators could be from objects that are not in the display list.
* It's ok because those actuators will not be displayed here */
cont= ob->controllers.first;
- while(cont) {
+ while (cont) {
for (iact=0; iact<cont->totlinks; iact++) {
act = cont->links[iact];
if (act)
&n