Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTon Roosendaal <ton@blender.org>2010-02-27 19:06:33 +0300
committerTon Roosendaal <ton@blender.org>2010-02-27 19:06:33 +0300
commita9e3e0e40f17fca00eeb5b3af9af20b6fcf5ada5 (patch)
treeb59a811c03fa96a4e03421ea9babd474f62f9988
parent7fca47e0cf3ca0d520bacc8f079f4e33d4521b71 (diff)
Patch #21267 by Sergey Sharybin
His log: There is a small typo in copy_curve(): there will be serious troubles if this functions is called for OB_FONT in edit mode (for my cases it is segmentation fault). I think we should set editfont to NULL for cloned curves (as it is made for edit nurb). This bug was found by trying to edit text with applied Cast modifier and while I was searching what's wrong, I've found that in castModifier_deformVerts() DerivedMesh is creating for all objects, but in castModifier_*_do() derived mesh is used only for OB_MESH objects. Maybe this place could be optimized a bit by skipping DM creation for non-meshes?
-rw-r--r--source/blender/blenkernel/intern/curve.c1
-rw-r--r--source/blender/blenkernel/intern/modifier.c8
2 files changed, 8 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c
index 9d33bc5ae11..fb27327c3be 100644
--- a/source/blender/blenkernel/intern/curve.c
+++ b/source/blender/blenkernel/intern/curve.c
@@ -191,6 +191,7 @@ Curve *copy_curve(Curve *cu)
cun->path= 0;
cun->editnurb= NULL;
+ cun->editfont= NULL;
#if 0 // XXX old animation system
/* single user ipo too */
diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c
index 65843c28402..146701f2976 100644
--- a/source/blender/blenkernel/intern/modifier.c
+++ b/source/blender/blenkernel/intern/modifier.c
@@ -4825,9 +4825,15 @@ static void castModifier_deformVerts(
ModifierData *md, Object *ob, DerivedMesh *derivedData,
float (*vertexCos)[3], int numVerts, int useRenderParams, int isFinalCalc)
{
- DerivedMesh *dm = get_dm(md->scene, ob, NULL, derivedData, NULL, 0);
+ DerivedMesh *dm = NULL;
CastModifierData *cmd = (CastModifierData *)md;
+ if (ob->type == OB_MESH) {
+ /* DerivedMesh is used only in case object is MESH */
+ /* so we could optimize modifier applying by skipping DM creation */
+ dm = get_dm(md->scene, ob, NULL, derivedData, NULL, 0);
+ }
+
if (cmd->type == MOD_CAST_TYPE_CUBOID) {
castModifier_cuboid_do(cmd, ob, dm, vertexCos, numVerts);
} else { /* MOD_CAST_TYPE_SPHERE or MOD_CAST_TYPE_CYLINDER */