mustan9
02-12-2007, 09:22 PM
This should be so simple, but I'm having trouble.
I want a very simple script that will do the following, but it keeps throwing errors.
I just want to do the following.
1) Object "b" is the selected object
2) Pick an object in the scene as "m"
3) Add an "Edit_Mesh" to "b"
4) Select all the faces in the Edit_Mesh and delete them.
5) Attach object "m" to the Edit_Mesh
That's it. I get as far as selecting the faces, but it keeps throwing an error when I try to delete them. I also couldn't get the meshop.attach command to work.
I'm doing something wrong?
b = $selection[1]
m = pickObject message:"Pick low-poly mesh" rubberBand:b.pos
if m == undefined then return()
em = Edit_Mesh()
addModifier b em
max modify mode
subobjectLevel = 3
f = for i = 1 to getNumFaces b collect i
setFaceSelection b f
meshOps.delete b.modifiers[1]
I want a very simple script that will do the following, but it keeps throwing errors.
I just want to do the following.
1) Object "b" is the selected object
2) Pick an object in the scene as "m"
3) Add an "Edit_Mesh" to "b"
4) Select all the faces in the Edit_Mesh and delete them.
5) Attach object "m" to the Edit_Mesh
That's it. I get as far as selecting the faces, but it keeps throwing an error when I try to delete them. I also couldn't get the meshop.attach command to work.
I'm doing something wrong?
b = $selection[1]
m = pickObject message:"Pick low-poly mesh" rubberBand:b.pos
if m == undefined then return()
em = Edit_Mesh()
addModifier b em
max modify mode
subobjectLevel = 3
f = for i = 1 to getNumFaces b collect i
setFaceSelection b f
meshOps.delete b.modifiers[1]
