Help with simple convert to Edit Poly and Quadrify all script

Hi Everyone

I am very new to max script and trying to build something that I feel should be extremely simple... i just can't seem to get it to work.

I am sure I am making some beginner mistake, but I am not getting any errors in the listener, and from the information in the help file I think I have it written correctly.

All I would like the script to do is convert the selection to an editable poly and then quadrify all. I often get heavily triangulated Imports from AutoCAD and this can be helpful when cleaning up the meshes.

Here is what I have currently. for some reason the quadrify does absolutely nothing.

For i in $ do
(
s=selection
ConvertTo s Editable_Poly
select s
PolyToolsModeling.Quadrify
)

If someone more experienced could help explain to me what is wrong and why this is incorrect I would greatly appreciate it. I am trying to learn how to script and would really like to understand so that I don't repeat the same mistakes in the future.

Thanks!

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Deadlift315's picture

Thank you!!!!!!

I get it now! I did not understand how to use the arguments correctly. When i was trying to write the script I attempted

PolyToolsModeling.Quadrify false withinSel false selectOnly

when it should have been

PolyToolsModeling.Quadrify false false

Thank you very much!

I am not even remotely a scripter or programmer so i really appreciate the help and explanation!I will keep on trying!

Deadlift315's picture

Thank you for the help

Thank you for the help Barigazy.

I just tried the script you wrote and it actually has the same issue as my attempt.

No error or anything, the listener even prints OK but the quadrify does nothing at all.

is there something wrong with the PolyToolsModeling.Quadrify ?

Thanks!

barigazy's picture

...

PolyToolsModeling.Quadrify have two more arguments "withinSel" and "selectOnly"
Read in mxs help explanation for this two argument.
BTW this works

if selection.count != 0 do
(
	with redraw off
	(
		for o in selection where canconvertto o Editable_Poly do
		(
			if not isKindOf o Editable_Poly do convertToPoly o
			PolyToolsModeling.Quadrify off off
		)
	)
)

bga

eyepiz's picture

Hi Barigazy, How do we get

Hi Barigazy,

How do we get this script to work on a selection?...it seems to only work on one object at a time.

I would appreciate any help!

Thanks!

barigazy's picture

...

Try like this

if selection.count != 0 do
(
	with redraw off
	(
		for o in selection where canconvertto o Editable_Poly do
		(
			if not isKindOf o Editable_Poly do convertToPoly o
			PolyToolsModeling.Quadrify
		)
	)
)

bga

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.