diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2011-01-05 13:40:38 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2011-01-05 13:40:38 +0300 |
commit | 64c3ea272e7be85c0f589a6f28eae28d7e7d0a9e (patch) | |
tree | 05372140ca547e1c9d2bccf90df528cf9da087dc /source/blender/editors | |
parent | 730634ca51d730630b083c8312b99c2b3fc7f49f (diff) |
Todo item: linked curve objects behaves incorrect with modifiers
Use object's displists for storing deformed tesselated curve. Was unable to
totally get rid of curve's displist because of how texture space is calculating.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/object/object_add.c | 15 | ||||
-rw-r--r-- | source/blender/editors/space_info/info_stats.c | 5 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/drawobject.c | 13 |
3 files changed, 18 insertions, 15 deletions
diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index fdf46ea19a7..696d8bc2c6f 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -1036,9 +1036,7 @@ static EnumPropertyItem convert_target_items[]= { static void curvetomesh(Scene *scene, Object *ob) { - Curve *cu= ob->data; - - if(cu->disp.first==0) + if(ob->disp.first==0) makeDispListCurveTypes(scene, ob, 0); /* force creation */ nurbs_to_mesh(ob); /* also does users */ @@ -1188,7 +1186,7 @@ static int convert_exec(bContext *C, wmOperator *op) cu= newob->data; - if (!cu->disp.first) + if (!newob->disp.first) makeDispListCurveTypes(scene, newob, 0); newob->type= OB_CURVE; @@ -1225,8 +1223,12 @@ static int convert_exec(bContext *C, wmOperator *op) for(nu=cu->nurb.first; nu; nu=nu->next) nu->charidx= 0; - if(target == OB_MESH) + if(target == OB_MESH) { curvetomesh(scene, newob); + + /* meshes doesn't use displist */ + freedisplist(&newob->disp); + } } else if(ELEM(ob->type, OB_CURVE, OB_SURF)) { ob->flag |= OB_DONE; @@ -1243,6 +1245,9 @@ static int convert_exec(bContext *C, wmOperator *op) newob->data= copy_curve(ob->data); } else { newob= ob; + + /* meshes doesn't use displist */ + freedisplist(&newob->disp); } curvetomesh(scene, newob); diff --git a/source/blender/editors/space_info/info_stats.c b/source/blender/editors/space_info/info_stats.c index 7a6e5dad017..b4185d1b958 100644 --- a/source/blender/editors/space_info/info_stats.c +++ b/source/blender/editors/space_info/info_stats.c @@ -91,13 +91,12 @@ static void stats_object(Object *ob, int sel, int totob, SceneStats *stats) case OB_SURF: case OB_CURVE: case OB_FONT: { - Curve *cu= ob->data; int tot= 0, totf= 0; stats->totcurve += totob; - if(cu->disp.first) - count_displist(&cu->disp, &tot, &totf); + if(ob->disp.first) + count_displist(&ob->disp, &tot, &totf); tot *= totob; totf *= totob; diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index e62b3c6746f..d17657f086a 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -3146,7 +3146,7 @@ static int drawDispList(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *bas case OB_CURVE: cu= ob->data; - lb= &cu->disp; + lb= &ob->disp; if(solid) { dl= lb->first; @@ -3193,7 +3193,7 @@ static int drawDispList(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *bas break; case OB_SURF: - lb= &((Curve *)ob->data)->disp; + lb= &ob->disp; if(solid) { dl= lb->first; @@ -5436,7 +5436,7 @@ static void drawObjectSelect(Scene *scene, View3D *v3d, ARegion *ar, Base *base) if (dm) { hasfaces= dm->getNumFaces(dm); } else { - hasfaces= displist_has_faces(&cu->disp); + hasfaces= displist_has_faces(&ob->disp); } if (hasfaces && boundbox_clip(rv3d, ob->obmat, ob->bb ? ob->bb : cu->bb)) { @@ -5444,7 +5444,7 @@ static void drawObjectSelect(Scene *scene, View3D *v3d, ARegion *ar, Base *base) if (dm) { draw_mesh_object_outline(v3d, ob, dm); } else { - drawDispListwire(&cu->disp); + drawDispListwire(&ob->disp); } draw_index_wire= 1; } @@ -5499,7 +5499,7 @@ static void drawWireExtra(Scene *scene, RegionView3D *rv3d, Object *ob) if (ob->derivedFinal) { drawCurveDMWired(ob); } else { - drawDispListwire(&cu->disp); + drawDispListwire(&ob->disp); } if (ob->type==OB_CURVE) @@ -5820,9 +5820,8 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag) /* bad exception, solve this! otherwise outline shows too late */ if(ELEM3(ob->type, OB_CURVE, OB_SURF, OB_FONT)) { - cu= ob->data; /* still needed for curves hidden in other layers. depgraph doesnt handle that yet */ - if (cu->disp.first==NULL) makeDispListCurveTypes(scene, ob, 0); + if (ob->disp.first==NULL) makeDispListCurveTypes(scene, ob, 0); } /* draw outline for selected objects, mesh does itself */ |