Blender.Mesh.New() question

I want to know how to:

  • set the name of the newly created mesh,
    -change the name of the mesh once I linked it to the current scene

cheers

Hi,

This bit of code may point you in the right direction (from a script I’m working on - I found out how to do the name bit from somewhere on the web ).


# make a new mesh (called eachwp)
eachwp = Blender.NMesh.GetRaw()

# add the verts/faces etc

#specific a name for the new mesh
name = "foo"

# send the new object out into blender world
Blender.NMesh.PutRaw(eachwp,name)

#Since the newly created object is the first object in the getselected list
#we can link to it using this:
Blender.Object.GetSelected()[0].name = name

# Reaquire the object and check all is where it should be!
newwp = Blender.Object.Get(name)
newwp.Layer = 8

Hope that helps

Stephen

I hopefully will have a complete Sportscar GT

Track export script pack out later in Jan 2003