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
path: root/source
diff options
context:
space:
mode:
authorKen Hughes <khughes@pacific.edu>2006-07-05 22:28:51 +0400
committerKen Hughes <khughes@pacific.edu>2006-07-05 22:28:51 +0400
commit64d0d62ddd2f9d320b0d221bfe4f13a973b8ed7b (patch)
tree236d886295ca7171daa27ffcc64fa3a302474120 /source
parentbe3c3a24b57c1f1d6c8c6fb0eb50047d10df2e1a (diff)
===Python API===
Bugfix #4605: mball_to_mesh() doesn't create edges for new mesh, so me.getFromObject() wouldn't display the new mesh until edit mode was entered. Added a call to displistmesh_add_edges() to calculate them and then insert into the new mesh.
Diffstat (limited to 'source')
-rw-r--r--source/blender/python/api2_2x/Mesh.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/source/blender/python/api2_2x/Mesh.c b/source/blender/python/api2_2x/Mesh.c
index 956de7e2504..a4ef5736bc0 100644
--- a/source/blender/python/api2_2x/Mesh.c
+++ b/source/blender/python/api2_2x/Mesh.c
@@ -5605,6 +5605,21 @@ static PyObject *Mesh_getFromObject( BPy_Mesh * self, PyObject * args )
ob = find_basis_mball( ob );
tmpmesh = add_mesh();
mball_to_mesh( &ob->disp, tmpmesh );
+
+ /*
+ * mball_to_mesh doesn't create edges, which confuses Blender in
+ * object mode. So this hack is necessary to quickly calculate the
+ * edges from the face list.
+ */
+
+ dlm = MEM_callocN( sizeof(DispListMesh), "tmp displist");
+ dlm->totface = tmpmesh->totface;
+ dlm->mface = tmpmesh->mface;
+ displistmesh_add_edges( dlm );
+ tmpmesh->totedge = dlm->totedge;
+ tmpmesh->medge = dlm->medge;
+ MEM_freeN( dlm );
+
break;
case OB_MESH:
/* copies object and modifiers (but not the data) */