mhdmhd
12-21-2009, 01:16 AM
I just started to learn maxscript 2 weeks ago, so go easy on me.
I have a bunch of renderelements and a bunch of selectionsets both with certain names,
It is a finalrender RE so it has this function : addnode which adds objects to it.
So I want to match between REs and selsets so that certain REs gets the objects in certain selsets
(
for i=0 to ((re.NumRenderElements())-1)
where (matchPattern ((re.getrenderelement i).elementname) pattern:("*_light*" ))
do
(
For o =1 to selectionSets.count
where (matchpattern (getNamedSelSetName o) pattern:("fr_*"))
do o=(
for j in (getNamedSelSetItem o (for x=1 to getNamedSelSetItemCount o do x))
do
(
el = re.getrenderelement i
el.setmode(1)
el.addnode(j)
)
)
)
)
The problem in x, I think, it gives ok instead of numbers when i tried it alone with print it gives me the numbers then ok
I cann't get a certain selset as objects why the result of selectionsets [1] for example equal selectionset:xxx and not xxx which is an array,isn't it??
I have a bunch of renderelements and a bunch of selectionsets both with certain names,
It is a finalrender RE so it has this function : addnode which adds objects to it.
So I want to match between REs and selsets so that certain REs gets the objects in certain selsets
(
for i=0 to ((re.NumRenderElements())-1)
where (matchPattern ((re.getrenderelement i).elementname) pattern:("*_light*" ))
do
(
For o =1 to selectionSets.count
where (matchpattern (getNamedSelSetName o) pattern:("fr_*"))
do o=(
for j in (getNamedSelSetItem o (for x=1 to getNamedSelSetItemCount o do x))
do
(
el = re.getrenderelement i
el.setmode(1)
el.addnode(j)
)
)
)
)
The problem in x, I think, it gives ok instead of numbers when i tried it alone with print it gives me the numbers then ok
I cann't get a certain selset as objects why the result of selectionsets [1] for example equal selectionset:xxx and not xxx which is an array,isn't it??
