maya instancer 一問

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

版主: h2o, stantang

maya instancer 一問

文章風之谷 » 8日 10月 2008年, 22:12

我create 了 emitter, particle

之後particle attach 了 instancer

"instanced object" 加了 object a ,object b

請問如何可以 play timeline 時

d particle random 地噴object a ,object b 出來呢?


(以前有人教過但忘記了又試不出來 :oops: )

thanks~
風之谷
CGV討論區會員
CGV討論區會員
 
文章: 276
註冊時間: 25日 7月 2006年, 02:20
外號: 呀峰

Share On:

Share on Facebook Facebook Share on Twitter Twitter

文章stantang » 9日 10月 2008年, 00:02

Add a custom PP attr named "object_rand" (or whatever name you like), make sure the data type is integer or float. The add a creation expression "object_rand = rand(0,1);", finally choose the new attr under the pull down menu in ObjectIndex with the instancer.
dig deep, think deeper
頭像
stantang
討論區主持
討論區主持
 
文章: 1566
註冊時間: 8日 11月 2001年, 08:00
來自: Groom Lake

文章WildSeven » 9日 10月 2008年, 04:44

The outline given by stantang is right, but there are something you may concern.

1) For the "object_rand" attribute, data type "float" should be used if you want to set it as per-particle attribute. Integer will not work.

2) Presumably, for 2 objects in the instancer list, the object index should be 0, and 1 respectively. Therefore, you need to set the random function to rand(0, 2) in order to output 0 or 1. rand(0,1) will always give you 0 in is case.
頭像
WildSeven
討論區新秀
討論區新秀
 
文章: 45
註冊時間: 13日 3月 2004年, 12:23
來自: 阿以卑斯山

文章stantang » 9日 10月 2008年, 08:58

Wildseven, thanks for pointing out the errors, I didn't have Maya opened and was late at night when replied, haha my mistake. Anyway, to add to the answer, you can't even choose integer when creating PP attr now (I think it used to be available...). Second, you can add trunc() function to the rand() to round up the float to integer if you want, but it won't make a different in this case.
dig deep, think deeper
頭像
stantang
討論區主持
討論區主持
 
文章: 1566
註冊時間: 8日 11月 2001年, 08:00
來自: Groom Lake

文章風之谷 » 9日 10月 2008年, 12:32

thx alot~

試到了~
風之谷
CGV討論區會員
CGV討論區會員
 
文章: 276
註冊時間: 25日 7月 2006年, 02:20
外號: 呀峰


回到 Autodesk Maya

誰在線上

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