can you find modifier copy code erro ?

i made this code
but there is problem

if i selct many object , error message " unable to conver : undefined to type : modifier
what problem ?

S=#()
tst = #()
sel=selection as array

for z in sel do

(

for h in z.modifiers do

(if classof h == uvwmap then
(
append tst h

)

)

for o in geometry do

(

if o.name == z.name then

(

if tst.count != 0 then
(

tmp = copy z.modifiers[#UVW_Mapping]

deleteModifier z z.uvw_mapping

addmodifier o tmp

)

else
(
--tmp = copy z.modifiers[#UVW_Mapping]

)

)

)

Comments

Comment viewing options

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

I'm trying to solve your

I'm trying to solve your other post ... below is part of your problem.
example...

modCp = #()
for z in selection do
(
	if z.modifiers != 0 then (
	for h = 1 to z.modifiers.count do 
	(if classof z.modifiers[h] == uvwmap do (insertItem (copy z.modifiers[h]) modCp h))
	)
)

kimarotta.com.br
3d Artist  

dussla's picture

there is 1 more problem

your code is very good
but i can't understand well still

i made code again
work is good
but there is problem . that is to be copy many uvwmaps in 1 object
i would like to be copy 1 times

in advance , thank you

S=#()
tst = #()
sel=selection as array

modCp = #()

for z in sel do

(

for o in geometry do

(

if z.name == o.name then

(

if z.modifiers != 0 then (
for h = 1 to z.modifiers.count do
(if classof z.modifiers[h] == uvwmap do

tmp = copy z.modifiers[#UVW_Mapping]
addmodifier o tmp
--deleteModifier o o.uvw_mapping

)

)

else
(

)

)

)

)

kimarotta's picture

I do not understand...

I do not understand...

kimarotta.com.br
3d Artist  

dussla's picture

work is good

at any way thank you

Comment viewing options

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