ScriptSpot home

Forum topic · Scripts Wanted

Small script required

By trueman · 2013-09-20

Description

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 (6)
Branko Živković

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)

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

Reply to trueman
Branko Živković

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

Reply to trueman
Branko Živković


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())
)
)
)