Small script required

I need simple script, but I have no skill in scripting at all. Script should convert all selected objects to ed. Poly, then reset xForm, and finally add edit poly mod. (unique for every object). I will be very grateful for your help!

Comments

Comment viewing options

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

...

try(destroyDialog ::ctpRoll)catch()
rollout ctpRoll "convertToEP"
(
	button btn "Convert" pos:[5,5] width:90
	on btn pressed do
	(
		undo off with redraw off
		(
			if selection.count != 0 do for o in selection where canConvertto o editable_poly do
			(
				resetXForm o ; converttoPoly o ; addModifier o (Edit_Poly())
			)
		)
	)
)
createDialog ctpRoll 100 30 style:#(#style_titlebar, #style_sysmenu, #style_toolwindow)

bga

trueman's picture

Thanks for your attention to

Thanks for your attention to my issue. What should I modify in this script to:

  1. make it work without button "convert"
  2. apply resetXform after coverting to ed. poly
barigazy's picture

...

To works without rollout ei. button pressed you can run code from lestener or make simple macro. Which one do you prefere?
Also if I add resetXform after conversion then you will have two modifiers in modify panel: XForm and EditPoly

bga

trueman's picture

simple macro

simple macro
yes, it is exactly what I want

barigazy's picture

...

macroScript ConvertSelectionToEPoly category:"barigazy" buttonText:"CTEP" tooltip:"Convert Selection To EPoly"
(
	undo off with redraw off
	(
		max create mode
		if selection.count != 0 do for o in selection where canConvertto o editable_poly do
		(
			converttoPoly o ; resetXForm o ; addModifier o (Edit_Poly())
		)
	)
)

bga

trueman's picture

That's great, thank you!

That's great, thank you!

Comment viewing options

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