[Bf-committers] Really odd removedoublesflag() problem

Alexander Ewering blender at instinctive.de
Sun Mar 12 19:51:29 CET 2006


Hi,

maybe someone can help with this incredibly strange issue.

I'm trying to automate the removal of doubles after doing a radiosity solve
(as there are often thousands of doubles left). I'm using the following
sequence of calls on each new ob and me created inside rad_addmesh():

             set_active_object(ob);
             enter_editmode();
             EM_set_flag_all(1);
             countall();
             fprintf(stderr, "Removed %d on [%s]\n", removedoublesflag(1, (float)0.001), ob->id.name);
             countall();
             exit_editmode(1);

This gives very odd behaviour. If I use 0.001 as limit, no vertices get
removed at all (even though if applied from the UI after freeing the radio
data, they correctly get removed). 
On the other hand, if I use 0.01, *all* vertices get removed! (While when
called from the UI, only a couple more than with 0.001 (as expected) get
removed).
If I use 0.005, the mesh turns into garbage.

Can *anyone* imagine what's going on here and why removedoubles is confused
when called at this spot?

             cd= ((unsigned int *)face->v3+3);
             if( *cd < 0x1000000 ) *cd= coldata[*cd];
             if(face->v4) {
                 cd= ((unsigned int *)face->v4+3);
                 if( *cd < 0x1000000 ) *cd= coldata[*cd];
             }
         }

 	////// code goes here ///////

Thanks for any possible insight

| alexander ewering              instinctive mediaworks
| ae[@]instinctive[.]de   http://www[.]instinctive[.]de


More information about the Bf-committers mailing list