dumb setUserProps question

Hi -
Hoping it's not forbidden to as novice questions here.

I'm trying to set a bunch of user defined properties on a selection list of objects but those user properties need to be slightly different for each member of the selection set. The

for obj in $ do

syntax works great for cycling thru the selected objects, but the only way the setUserProp function seems to work is with the $ node argument. Result is that each time through the for loop ALL the objects in the $ selection set get the most recently composed user properties.

Is there a way to set user properties for objects in a selection set, one member at a time - as I cycle through using the above for loop?

Thanks for any advice.

Mike

Comments

Comment viewing options

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

dumb setUserProps question

Excellent! Thanks Anubis. That does just what i need.

coyote808

Anubis's picture

...

Somehow you answer yourself. An example code w'd help us to see what you try to do. Next code for example will set uni-id prop to each object in selection:

for id = 1 to selection.count do
setUserProp selection[id] "ID" id

my recent MAXScripts RSS (archive here)

TsveTan's picture

" "

Hi,
I just registered to the side.
I think you need a 2d array.
You can use the get/setinisettings (or another writing method) to capture the user's options to a file (as a 2d array) or only change the array without saving.

-- 1st member = option1, 2nd member = option2 ... --subarray members
it should look something like:
useroptions = #(#(true,false,true ..),#(false,false,false ..),#(true,false,false ..))
To change the n - member in the k - subarray the syntax is useroptions[k][n] = ...
If needed you can use also a 2d looping.

Comment viewing options

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