Message 1 of 12
Copy and paste modifier

Not applicable
05-28-2008
10:47 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi I am trying to create a script that will allow me to paste the same modifier to any number of selected meshes. I have written this:
theAdjuster = Edit_poly()
for i in selection do addModifier i theAdjuster
rollout test_buttons "select meshes"
(
button theButton "Press me!"
on theButton pressed do
(
for i in selection do addModifier i theAdjuster
)
)
createDialog test_buttons 150 50
The theory is that I can create an editpoly modifier to the first selected mesh and edit that mesh... then apply that same editpoly modifier other selected meshes. I know this process works manually but I cant figure out why scripting doesn't work. The above script works... but the modifiers applied to the the additional meshes... dont adjust the model like they should.
If I change this bit of code:
for i in selection do addModifier i.baseObject theAdjuster
to include the the .baseObject... I get an error:
-- No ""addModifier"" function for Editable Poly
I noticed that even if I manually copy and paste the modifier... then try to copy the code spit out by the listener and evaluate it to do the same thing I just did manually I get the above error.
Anybody out there have any ideas.
theAdjuster = Edit_poly()
for i in selection do addModifier i theAdjuster
rollout test_buttons "select meshes"
(
button theButton "Press me!"
on theButton pressed do
(
for i in selection do addModifier i theAdjuster
)
)
createDialog test_buttons 150 50
The theory is that I can create an editpoly modifier to the first selected mesh and edit that mesh... then apply that same editpoly modifier other selected meshes. I know this process works manually but I cant figure out why scripting doesn't work. The above script works... but the modifiers applied to the the additional meshes... dont adjust the model like they should.
If I change this bit of code:
for i in selection do addModifier i.baseObject theAdjuster
to include the the .baseObject... I get an error:
-- No ""addModifier"" function for Editable Poly
I noticed that even if I manually copy and paste the modifier... then try to copy the code spit out by the listener and evaluate it to do the same thing I just did manually I get the above error.
Anybody out there have any ideas.