PDA

View Full Version : loop through columns and rows


dodgy
10-19-2006, 05:28 AM
Hi, I've never scripted much so my question is very simple

I need to setAttr on bunch of nodes.. basically textures arranged in rows and columns. Each node is named "texture_a1_node", "texture_a2_node"... "texture_e9_node"

basically

$row[]={"a","b","c","d","e"};
$column[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};

--
setAttr "texture_" row$ column$ "_node.filter" 0;
--

i assume that columns can be counted through i++ instead etc..

anyway.. what do i know.. thats why im asking:)

faultymoose
10-19-2006, 07:41 AM
I'm not sure what you're asking? Your procedure is sound, it'll do the job.



$row[]={"a","b","c","d","e"};

for ($r in $row){
for ($i = 1; $i < 10; $i++){
setAttr ("texture_"+$r+$i+"_node.filter") 0;
}
}

CGTalk Moderation
10-19-2006, 07:41 AM
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.