PDA

View Full Version : Edit mesh,select Polygon by ID


falchun
10-16-2005, 01:31 AM
I have a script that extrude some shapes one by one. And I want to had a thing to it. See the comment :
sel = selection as array
for i in 1 to sel.count do (
if superclassof sel[i] == shape do (
print sel[i].name
addModifier sel[i] (extrude amount:9)
addModifier sel[i] (Edit_Mesh ())
sel[i].name = "House"
sel[i].wirecolor = color 38 200 0
-- THEN .....
-- Open the edit Mesh Panel
-- Select the POLYGON sub-menu
-- select the Polygon by his Smoothing Groups ID that I know is "5"
-- and extrude this Polygon by an amount of my choice
)
)
Is there a way to do that ?

Which function should I use ?

Thanks in advance.

Falchun

falchun
10-17-2005, 01:34 AM
I've found my way with the following script. In fact I want to extrude by x the top of of an extruded spline. How can I extrude a selection of faces ?
for i in selection do (
if superclassof i == shape do (
addmodifier i (extrude())
i.modifiers[#Extrude].amount = 6
i.modifiers[#Extrude].mapCoords = on
i.modifiers[#Extrude].matIDs = on
i.modifiers[#Extrude].smooth = on
i.modifiers[#Extrude].capType = 0
i.modifiers[#Extrude].capStart = on
i.modifiers[#Extrude].capEnd = on

addmodifier i (edit_mesh())
print i.numfaces
-- In a cube, so I select the two last faces
setFaceSelection i i.modifiers[#Edit_Mesh] #(11,12)
-- there I want to extrude this selection !!!
)
)

CGTalk Moderation
10-17-2005, 01:34 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.