[Bf-docboard] Python API addEdgesData
McCracken, Andrew
ajm87 at waikato.ac.nz
Tue Mar 28 00:04:47 CEST 2006
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()
http://www.blender3d.org/forum/viewtopic.php?t=8488&sid=032c244db0755fc6586a31d0f628bfd3
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/ms-tnef
Size: 3010 bytes
Desc: not available
Url : http://projects.blender.org/pipermail/bf-docboard/attachments/20060328/39d9750a/attachment.bin
More information about the Bf-docboard
mailing list