Hi Sergey, I think it's a bad idea to clear points during evaluation. It's unpredictable from a user point of view, and can give problems with the dependency graph and threading. Second, you still have to check it on evaluation because linked objects may change type (or the object itself may be linked), as well as old .blend files.
Brecht. On Tue, Mar 30, 2010 at 8:10 PM, Sergey Sharybin <g.ula...@gmail.com> wrote: > Revision: 27877 > > http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=27877 > Author: nazgul > Date: 2010-03-30 20:10:05 +0200 (Tue, 30 Mar 2010) > > Log Message: > ----------- > - Call DAG_id_flush_update for each object in convert operator if > keep_original > option is switched off. This fixes trouble when user converts curve which is > set as taper/bevel object to mesh (scene kept unchanged until object > recalculation). > - Moved checking of taper/bevel objects type to RNA property update handlers. > - Added resetting taper/bevel object in do_makeDispListCurveTypes it this > objects aren't curves. > > Modified Paths: > -------------- > trunk/blender/source/blender/blenkernel/intern/curve.c > trunk/blender/source/blender/blenkernel/intern/displist.c > trunk/blender/source/blender/editors/object/object_add.c > trunk/blender/source/blender/makesrna/intern/rna_curve.c > > Modified: trunk/blender/source/blender/blenkernel/intern/curve.c > =================================================================== > --- trunk/blender/source/blender/blenkernel/intern/curve.c 2010-03-30 > 17:57:09 UTC (rev 27876) > +++ trunk/blender/source/blender/blenkernel/intern/curve.c 2010-03-30 > 18:10:05 UTC (rev 27877) > @@ -1227,7 +1227,7 @@ > /* if a font object is being edited, then do nothing */ > // XXX if( ob == obedit && ob->type == OB_FONT ) return; > > - if(cu->bevobj && cu->bevobj!=ob && cu->bevobj->type==OB_CURVE) { > + if(cu->bevobj) { > bevcu= cu->bevobj->data; > if(bevcu->ext1==0.0 && bevcu->ext2==0.0) { > ListBase bevdisp= {NULL, NULL}; > > Modified: trunk/blender/source/blender/blenkernel/intern/displist.c > =================================================================== > --- trunk/blender/source/blender/blenkernel/intern/displist.c 2010-03-30 > 17:57:09 UTC (rev 27876) > +++ trunk/blender/source/blender/blenkernel/intern/displist.c 2010-03-30 > 18:10:05 UTC (rev 27877) > @@ -1657,6 +1657,15 @@ > float (*deformedVerts)[3]; > int numVerts; > > + /* Bevel and taper objects should always be curves */ > + if (cu->bevobj && cu->bevobj->type != OB_CURVE) { > + cu->bevobj = NULL; > + } > + > + if (cu->taperobj && cu->taperobj->type != OB_CURVE) { > + cu->taperobj = NULL; > + } > + > if(cu->editnurb) > nubase= cu->editnurb; > else > @@ -1755,10 +1764,8 @@ > bevp= (BevPoint > *)(bl+1); > for(a=0; a<bl->nr; > a++,bevp++) { > float fac=1.0; > - if > (cu->taperobj==NULL || > - > cu->taperobj->type != OB_CURVE || cu->taperobj == ob) { > - if ( > (cu->bevobj!=NULL && cu->bevobj->type == OB_CURVE) || > - > !((cu->flag & CU_FRONT) || (cu->flag & CU_BACK)) ) > + if > (cu->taperobj==NULL) { > + if ( > (cu->bevobj!=NULL) || !((cu->flag & CU_FRONT) || (cu->flag & CU_BACK)) ) > > fac = bevp->radius; > } else { > fac = > calc_taper(scene, cu->taperobj, a, bl->nr); > > Modified: trunk/blender/source/blender/editors/object/object_add.c > =================================================================== > --- trunk/blender/source/blender/editors/object/object_add.c 2010-03-30 > 17:57:09 UTC (rev 27876) > +++ trunk/blender/source/blender/editors/object/object_add.c 2010-03-30 > 18:10:05 UTC (rev 27877) > @@ -1424,6 +1424,10 @@ > basen= NULL; > } > > + if (!keep_original) { > + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); > + } > + > /* delete original if needed */ > if(basedel) { > if(!keep_original) > > Modified: trunk/blender/source/blender/makesrna/intern/rna_curve.c > =================================================================== > --- trunk/blender/source/blender/makesrna/intern/rna_curve.c 2010-03-30 > 17:57:09 UTC (rev 27876) > +++ trunk/blender/source/blender/makesrna/intern/rna_curve.c 2010-03-30 > 18:10:05 UTC (rev 27877) > @@ -219,10 +219,14 @@ > static void rna_Curve_update_taper(Main *bmain, Scene *scene, PointerRNA > *ptr) > { > Curve *cu= (Curve*)ptr->id.data; > - Object *obj= cu->taperobj; > + Object *ob= cu->taperobj; > > - if (obj && obj->type != OB_CURVE) { > - cu->taperobj = NULL; > + if (ob) { > + /* if taper object has got the save curve, as object, for > which it's */ > + /* set as taperobj, there could be infinity loop in displist > calculation */ > + if (ob->type != OB_CURVE || ob->data == cu) { > + cu->taperobj = NULL; > + } > } > > rna_Curve_update_deps(bmain, scene, ptr); > @@ -231,10 +235,14 @@ > static void rna_Curve_update_bevel(Main *bmain, Scene *scene, PointerRNA > *ptr) > { > Curve *cu= (Curve*)ptr->id.data; > - Object *obj= cu->bevobj; > + Object *ob= cu->bevobj; > > - if (obj && obj->type != OB_CURVE) { > - cu->bevobj = NULL; > + if (ob) { > + /* if bevel object has got the save curve, as object, for > which it's */ > + /* set as bevobj, there could be infinity loop in displist > calculation */ > + if (ob->type != OB_CURVE || ob->data == cu) { > + cu->bevobj = NULL; > + } > } > > rna_Curve_update_deps(bmain, scene, ptr); > > > _______________________________________________ > Bf-blender-cvs mailing list > bf-blender-...@blender.org > http://lists.blender.org/mailman/listinfo/bf-blender-cvs > > _______________________________________________ Bf-committers mailing list Bf-committers@blender.org http://lists.blender.org/mailman/listinfo/bf-committers