Notifications
Clear all

[Closed] Tessellate

Trying to make a script that tessellates NGONS automatically. Now Ive been trying all day to get it to work in polyop.tessellatebyface script, but when that didnt work, I decided to just use the tessellate modifier.
But here it doesnt keep the faceselection when I add the modifier.


  for o in selection do
  	(
  	   theMod = tessellate facetype: 1 type:1 iterations:0
  	   addmodifier o theMod
     )

ive tried to add a edit poly modifier and keep subobjectlevel = 4 open, but even then it just closes the subobjectlevel and tessellates the entire object.

If anyone could help me.

Preferably with polyop.TessellatebyFace thnx.

6 Replies

I found online that if you add a meshselect or turn to mesh modifier that would help with keeping the subobject level selected. But it doesnt

whats wrong with polyop.tessellatebyface?

you want to tesselate the currently selected face of a poly?

this works for me:

polyop.tessellatebyface $ #selection
1 Reply
(@papigiulio)
Joined: 2 years ago

Posts: 0

ahhhhhhhh forgot the bloody #. was using only ‘selection’ pfff. But yeah works perfect right now. Muchos gracias.

PixelMonkey, Thanks for the info, didnt know that. Learned something new

Addmodifier will never do what you want, you need to use modPanel.addModToSelection. From the Maxscript Help on addmodifier():

A limitation of the addModifier() function is that it cannot generally apply modifiers to sub-object selections, and so it disables any current sub-object levels. To apply a modifier to a sub-object selection in the same manner that 3ds Max applies modifiers, use the modPanel.addModToSelection(). This function correctly observes the currently selected sub-object level in the Modify panel.
-Eric

Hmmm I ended up using the addmodifier function because:

polyop.tessellatebyface $ #selection

tesselated it by EDGE instead of face. Not sure why. Also cant find any info on tessellatebyface on the net on how to edit settings for edge/face and tension amount. .

If you look up polyop.tesselatebyface in the maxscript reference you will find:
“Uses the tesselateBy and tessTension properties of the editable poly.”

If you’re not sure if certain UI actions are exposed to maxscript, you can use the macro recorder, in this case you will find the properties with it.

I know it can be hard to find things in the helpfile, but most of the time it’s there.


poly=$
poly.tesselateBy=0	--switch to tesselate by edge mode
poly.tesselateBy=1	--switch to tesselate by face mode
poly.tessTension = 10.0	--tension only works for edge mode, as with the UI?

--polyOp Methods Sub-Object Arguments
--#all - all Sub-Object elements of that type
--#selection - the current Sub-Object selection of that type
--#none - none of the Sub-Object elements of that type

polyOp.tessellatebyface poly #selection	--selected face

polyOp.tessellatebyface poly #{1,2,3}	--faces 1, 2,3