[Closed] how to assign id to selected poly face?
use maxscript,
how to assign id to selected poly face?
does anyone know how to do ?
thank you!!!
curSelFace = getFaceSelection selection[1].mesh
for eachFace in curSelFace do
(
setFaceMatID selection[1] eachFace 4
)
where the ‘4’ in ‘setFaceMatID selection[1] eachFace 4’ is the material ID you want.
OR
local sel = selection[1].baseObject
polyOp.[b][b]setFaceMatID sel (polyOp.getFaceSelection sel) matID
Light
[/b][/b]
Thank you Impus and Lignt!!
I have a question ,I hope you can help me thank you
[left]curSelFace = getFaceSelection selection[1].mesh
for eachFace in curSelFace do
(
setFaceMatID selection[1] eachFace 4
)[/left]
This code ,when use mesh it can work but use poly ,it can’t work .why?
Because getFaceSelection & setFaceMatID are Editable Mesh fns. So you will need to use their Editable Poly correspondings in order to use Editable Polys.
You can make your code work for both of them by using the classOf method.
Light
Thank you Lignt
i know maxscript little
Can you help me write it
Thank you very very much!
OK, try this:
(
local sel = selection[1]
case classOf sel of
(
editable_poly: polyOp.setFaceMatID sel (polyOp.getFaceSelection sel) 7
editable_mesh: for i in (getFaceSelection sel) do setFaceMatID sel i 7
)
)