[Bf-docboard] Python API addEdgesData

Joe Eagar joeedh at gmail.com
Tue Mar 28 06:35:16 CEST 2006


McCracken, Andrew wrote:
> Hi, I've compiled blender 2.41 from source, and I have been unable to use the NMesh data addEdgesData method as documented in the current blender python API 
>  
>  here is my (very sloppy) script. 
>  
>  it works using blender 2.37a but not 2.41 
>  
>  import Blender 
>  
>  def hack(source, target): 
>  target[0] = source[0] 
>  target[1] = source[1] 
>  target[2] = source[2] 
>  
>  def differentiate3d(v1, v2): 
>  v = v2.co - v1.co 
>  Blender.Mathutils.Vector.new(v3) 
>  l = v.length 
>  v.normalize() 
>  return l, v 
>  
>  
>  roadobj = Blender.Object.GetSelected()[0] 
>  
>  roadgroup = roadobj.getData() 
>  
>  scene = Blender.Scene.getCurrent() 
>  droadobj = Blender.Object.New('Mesh') 
>  droadgroup = Blender.NMesh.New('droad') 
>  
>  droadobj.link(droadgroup) 
>  scene.link(droadobj) 
>  print droadgroup.edges, type(droadgroup.edges) 
>  
>  droadgroup.addEdgesData() 
>  
>  for point in roadgroup.verts: 
>  droadgroup.verts.append(point) 
>  nv = Blender.NMesh.Vert() 
>  hack(point.co, nv.co) 
>  droadgroup.verts.append(nv) 
>  droadgroup.addEdge(point, nv) 
>  
>  roadgroup.update(1,1,1) 
>  
>  
>  droadgroup.update(1,1,1) 
>  Blender.Redraw()
>
>   
Your in the wrong mailing list; you should post this in bf-python.  
Also, try to include some more info about what happens.  And you may 
want to try compiling blender from CVS, too.

joeedh


More information about the Bf-docboard mailing list