maya spread sheet 一問

各Maya用戶可在這裡交流問題和分享制作經驗

版主: h2o, stantang

maya spread sheet 一問

文章風之谷 » 5日 6月 2008年, 23:11

我想問下,如果我想一次過 set 一百個object 的 setting

例如: object 的 shape node 入面的 mentay ray 入面的 final gather cast

可唔可以呢。

因為 我只知道,
spread sheet editor 入面好似只可以有限地一次過set 某d attribute
例如: 一次過set多過一個object 的 casts shadows 做OFF
等等。

............................

但想一次過set 一d 特別的attribute,
我又可以點做呢,希望我唔會講得太含糊啦。
風之谷
CGV討論區會員
CGV討論區會員
 
文章: 276
註冊時間: 25日 7月 2006年, 02:20
外號: 呀峰

Share On:

Share on Facebook Facebook Share on Twitter Twitter

文章macrossmo » 5日 6月 2008年, 23:41

string $objname[] , $attr, $command;
int $count, $i, $v;

$objname = `ls -sl`;
$count = size($objname);

for ($i=0; $i<$count; $i=$i+1)
{ select -cl;
$attr = ".smoothShading"; //改做你要既attr,如cast shadow;
$v = 0; //改做你要既value;
$command = $objname[$i] + $attr;
setAttr $command $v;
}


你做一次你想做既野,之後睇返句script 佢做左d咩(多數都會系setAttr掛我諗), 之後select 曬你要obj,改返上面句script,run 下睇下得唔得......唔得call me!
頭像
macrossmo
CGV討論區會員
CGV討論區會員
 
文章: 186
註冊時間: 27日 10月 2004年, 22:36
來自: Softimage | XSI
外號: 無陳

文章stantang » 5日 6月 2008年, 23:43

Just select your objects and run a simple mel like this:

代碼: 選擇全部
string $sel[] = `ls -sl`;
   for ($each in $sel)
   {
      setAttr ($each + "." + "miFinalGatherCast") 1;
   }


You can change "miFinalGatherCast" to any other attribute that u want. The "1" at the end is the value you want to set for that attribute. Let's say you want to turn off the Final Gather cast then you should set it to 0.
dig deep, think deeper
頭像
stantang
討論區主持
討論區主持
 
文章: 1566
註冊時間: 8日 11月 2001年, 08:00
來自: Groom Lake

文章macrossmo » 5日 6月 2008年, 23:48

同埋我系公司試過用attr spreak "shit" set 野的話....一次過set 唔到好多obj......不過我在家用8.5好似又無呢個問題
頭像
macrossmo
CGV討論區會員
CGV討論區會員
 
文章: 186
註冊時間: 27日 10月 2004年, 22:36
來自: Softimage | XSI
外號: 無陳

文章macrossmo » 5日 6月 2008年, 23:50

stantang 寫:Just select your objects and run a simple mel like this:

代碼: 選擇全部
string $sel[] = `ls -sl`;
   for ($each in $sel)
   {
      setAttr ($each + "." + "miFinalGatherCast") 1;
   }


You can change "miFinalGatherCast" to any other attribute that u want. The "1" at the end is the value you want to set for that attribute. Let's say you want to turn off the Final Gather cast then you should set it to 0.



小弟不才,想問 for ($each in $sel) 系咪會計少d數?!
頭像
macrossmo
CGV討論區會員
CGV討論區會員
 
文章: 186
註冊時間: 27日 10月 2004年, 22:36
來自: Softimage | XSI
外號: 無陳

文章stantang » 5日 6月 2008年, 23:53

macrossmo 寫:同埋我系公司試過用attr spreak "shit" set 野的話....一次過set 唔到好多obj......不過我在家用8.5好似又無呢個問題


The problem with attribute spread sheet is it has to load all the values of every objects you selected so it's got to be slow when you have many objects selected. And you have to find the attribute that you need to change even if you're luck that the attribute is included in the sheet.
dig deep, think deeper
頭像
stantang
討論區主持
討論區主持
 
文章: 1566
註冊時間: 8日 11月 2001年, 08:00
來自: Groom Lake

文章stantang » 5日 6月 2008年, 23:58

macrossmo 寫:小弟不才,想問 for ($each in $sel) 系咪會計少d數?!


It works the same as your mel but just more direct. May be a little faster when dealing with huge amount of objects... I don't know :lol:

In fact, I had a simple interface for this mel so I can easily change the attribute name and value.
dig deep, think deeper
頭像
stantang
討論區主持
討論區主持
 
文章: 1566
註冊時間: 8日 11月 2001年, 08:00
來自: Groom Lake

文章h2o » 6日 6月 2008年, 03:19

macrossmo 寫:同埋我系公司試過用attr spreak "shit" set 野的話....一次過set 唔到好多obj......不過我在家用8.5好似又無呢個問題


maya 6.0 之前好似系冇限制, 但唔記得 6.0 or 6.5 開始, maya 好"聰明地" limit 左 1024 個 objects, 直至 8.0 先解禁 :wink:
FB
My Lab
CG guy + Researcher + Educator
頭像
h2o
討論區主持
討論區主持
 
文章: 4945
註冊時間: 7日 4月 2002年, 08:00
來自: Dark Side
外號: 水水

文章風之谷 » 6日 6月 2008年, 12:39

在此多謝3位先,又知多o左野。

我本來諗可能要寫個mel先得,
不過比我真系寫唔到咁短。 :(


2 個寫法都試o左work 到呀,
(我諗你地一定test o左先放上來 :wink: )

spread shit 雖然可以"show selected columns only"
但系好似唔可以 hide o左第2個tab 的attribute,

結果只系方便睇唔方便load-_-。
風之谷
CGV討論區會員
CGV討論區會員
 
文章: 276
註冊時間: 25日 7月 2006年, 02:20
外號: 呀峰

文章風之谷 » 6日 6月 2008年, 12:45

stantang 寫:
macrossmo 寫:小弟不才,想問 for ($each in $sel) 系咪會計少d數?!


It works the same as your mel but just more direct. May be a little faster when dealing with huge amount of objects... I don't know :lol:

In fact, I had a simple interface for this mel so I can easily change the attribute name and value.


呵,等我當呢個當系一個mel 的功課都唔錯。 :D
風之谷
CGV討論區會員
CGV討論區會員
 
文章: 276
註冊時間: 25日 7月 2006年, 02:20
外號: 呀峰


回到 Autodesk Maya

誰在線上

正在瀏覽這個版面的使用者:沒有註冊會員 和 12 位訪客