setting array attributes elements

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

Thread Tools Search this Thread Display Modes
Old 01 January 2008   #1
setting array attributes elements

Does anyone know if it is possible to set just one element of an array attribute on an object at a time? setAttr seems to only let you set the entire array at once which is very annoying.


Old 01 January 2008   #2
That depends on whether the attribute is a multi or an array type. (i.e. kDouble + setArray v.s. kDoubleArray). If the attr is a multi, then the [] brackets can be used to do it. If however it's an array type, then you have to set the whole array in one go....
Old 01 January 2008   #3
It's an array type, not a multi. Unfortunately that's what I suspected - guess I'll just have to do it the hard way!

Old 01 January 2008   #4
Just remembered a few things. Joojaa on highend3d was moaning about the inability of setAttr to set individual elements, but iirc there are the MFnDoubleArrayData function sets that do allow you to access the elements individually. I think he basicaly wrote an MPxCommand called setElemAttr or similar to set these from script. Might be worth a go maybe?
Old 01 January 2008   #5
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
Thread Closed share thread

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Society of Digital Artists

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump

All times are GMT. The time now is 05:31 AM.

Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.