Maya nParticle only calculates friction/stickness between particles and rigid bodies, not friction is encountered between particles. My guess is the algorithm complexity is too high. Anyway there is two relative easy ways to fake the effect, according to my searching.
想要用一个一包糖粒堆在物体(对又是它..)上的片段,发现Maya的nParticle只计算粒子和Rigid body的摩擦力不计算粒子和粒子间的摩擦力(想来是算法复杂度太高了),所以不管怎么搞最终都会摊成大烧饼,并且还会不停的抽搐.. 查了下大概有两个相对简单的方法
1. hold particles with a invisible rigid body. 2. Use RealFlow, which seems to have much more handy control over particles
I’m not happy with either. 1 is lame. 2 too much trouble, have to get hang of another environment. If I must do scripting, I choose to learn mel.

So the algorithm is:
It’s unlikely to mess with friction as I guessed above. I tried to modify per particle mass to let them stuck in the space. Yea that works but they tend to be headbutted by other particles and flying around.. for science. Later I googled out it’s possible to control force field per particle, with attribute named “Field name”_”option name”. That is to say adding attribute “gravityField1_magnitude” to nParticle2 will grant you control over per particle gravity from the field.
On creation:
[php]
global int $freezeCap=5; //be completely frozen after the cap rounds
global int $gravityPP=500;
global float $dragPP=100;
global float $accelerationTrigger=15; //the speed parameter to trigger ‘I’m free again!", which leads to free droping.
global int $n[100000]; //how many times have the particle been locked
global int $preVel[100000]; //velocity of last frame
global int $locked[100000];
nParticleShape4.dragField1_magnitude=0;
nParticleShape4.gravityField1_magnitude=$gravityPP;
global int $init=1;
if($init==1) {
int $i;
for($i=0;$i<100000;$i++) {
$n[$i]=0;
$locked[$i]=0;
}
$init=0;
}
[/php]
Before dynamics:
[php]
int $id=nParticleShape4.particleId;
float $vel=abs(nParticleShape4.velocity);
//print("nParticleShape2.velocity "+$nParticleShape2.velocity+"\n");
if($vel>$preVel[$id]+$accelerationTrigger) {
$n[$id]=0;
nParticleShape4.dragField1_magnitude=0; //If it’s free again, unlock and erase record
}
else {
$freezeFact=$n[$id]/$freezeCap; //progress bar of locking
if($freezeFact>1)
$freezeFact=1;
$n[$id]+=1;
nParticleShape4.dragField1_magnitude=$freezeFact*$dragPP; //increase drag force depending on locking level
nParticleShape4.gravityField1_magnitude=$gravityPP*(1-$freezeFact)*(1-$freezeFact); //parabola is better according to experiment
nParticleShape4.velocity=<<0,0,0>>;
}
$preVel[$id]=nParticleShape4.velocity;
[/php]
The script is not bad to me.. adjustable parameters are handy. Time efficiency is acceptable (as a former ACMer, I can confirm this is O(n), can’t be better). 20 million particles * 100 frames cost my i7 half an hour. Not perfect but enough for bragging.
1. 弄个透明的动画的rigid body来把粒子圈起来。 2. 用RealFlow,我只用RealFlow模拟水,但是显然那它对粒子的控制比Maya厉害得多。
两个方法我都不高兴,1太不屌爆,2太麻烦,要做很多熟悉另一个环境的工作,且要写脚本,所以不如来学下mel。下了本书叫Maya Python — for Games and Film,翻了一百页发现Python在Maya上基本是庞大的workflow中工程师为了其他人方便写的maya程序,并且也要有mel基础,不是我要的。

总之,思路是:
想要计算摩擦力显然是不现实的,说过了。我先通过改质量的途径让粒子满足条件时失去质量以停在原地不受重力影响,停是能停住但是会被别的particle撞飞.. 非常科学。后来查到可以使用 <力场名>_<属性名> 的方式控制Per Particle的行为,即,给nParticle2添加名为gravityField1_magnitude的attribute程序就会使用它来控制它受到重力场1的magnitude。然后通过DragField让particle稳定。我在注释里详细说。
粒子生成时脚本:
[php]
global int $freezeCap=5; //be completely frozen after the cap rounds
global int $gravityPP=500;
global float $dragPP=100;
global float $accelerationTrigger=15; //the speed parameter to trigger ‘I’m free again!", which leads to free droping.
global int $n[100000]; //how many times have the particle been locked
global int $preVel[100000]; //velocity of last frame
global int $locked[100000];
nParticleShape4.dragField1_magnitude=0;
nParticleShape4.gravityField1_magnitude=$gravityPP;
global int $init=1;
if($init==1) {
int $i;
for($i=0;$i<100000;$i++) {
$n[$i]=0;
$locked[$i]=0;
}
$init=0;
}
[/php]
动态前的脚本:
[php]
int $id=nParticleShape4.particleId;
float $vel=abs(nParticleShape4.velocity);
//print("nParticleShape2.velocity "+$nParticleShape2.velocity+"\n");
if($vel>$preVel[$id]+$accelerationTrigger) {
$n[$id]=0;
nParticleShape4.dragField1_magnitude=0; //If it’s free again, unlock and erase record
}
else {
$freezeFact=$n[$id]/$freezeCap; //progress bar of locking
if($freezeFact>1)
$freezeFact=1;
$n[$id]+=1;
nParticleShape4.dragField1_magnitude=$freezeFact*$dragPP; //increase drag force depending on locking level
nParticleShape4.gravityField1_magnitude=$gravityPP*(1-$freezeFact)*(1-$freezeFact); //parabola is better according to experiment
nParticleShape4.velocity=<<0,0,0>>;
}
$preVel[$id]=nParticleShape4.velocity;
[/php]
个人感觉这个还不错,有很多参数可以控制,效率也还行(前ACMer表示这个就是O(n)..不能再低了),200万粒子100帧i7跑半个小时。显然不完美,蒙人没问题。
Naprawdę dobry materiał. Mnóstwo przydatnych inspiracji.
Pozdrawiam że dzielisz się wiedzą. Polecam innym.
Dokładnie – temat doboru mebli potrafi być wymagająca.
Wreszcie konkrety.
Bardzo przydatne. Szukałem takich informacji właśnie tego.
Super robota!
my page … http://Stroi.Cokznanie.Ru
Pretty nice post. I just stumbled upon your blog and wished to say that
I’ve really enjoyed browsing your blog posts. In any case I will be subscribing to your
feed and I hope you write again soon!
Wirklich guter Inhalt. Jede Menge hilfreiche Tipps.
Super für diesen Inhalt. Ich empfehle die Seite gerne weiter.
Du hast recht – die Sache der Einrichtung kann anspruchsvoll.
Gut, dass es jemand erklärt.
Aufrichtig hilfreich. Ich war schon nach solchen Informationen seit Wochen gesucht.
Super Arbeit!
Also visit my web-site … Kathie
Unquestionably believe that which you stated. Your favorite reason seemed to be
on the net the easiest thing to be aware of. I say to
you, I certainly get annoyed while people consider worries that they just do not know about.
You managed to hit the nail upon the top as well as
defined out the whole thing without having side effect ,
people can take a signal. Will likely be back to get more.
Thanks
Here is my homepage … iptv braga – Dirk –
Does your site have a contact page? I’m having a tough time locating
it but, I’d like to send you an email. I’ve got some creative ideas for your
blog you might be interested in hearing. Either way,
great blog and I look forward to seeing it grow over
time.
Thanks for some other informative blog. The place else could I
get that kind of info written in such an ideal method?
I’ve a venture that I’m simply now working on, and I have been on the look out for such info.
โพสต์นี้ อ่านแล้วได้ความรู้เพิ่ม ค่ะ
ผม เพิ่งเจอข้อมูลเกี่ยวกับ ข้อมูลเพิ่มเติม
ดูต่อได้ที่ ทางเข้า betflix9s
ลองแวะไปดู
มีการยกตัวอย่างที่เข้าใจง่าย
ขอบคุณที่แชร์ บทความคุณภาพ นี้
และอยากเห็นบทความดีๆ แบบนี้อีก
hello!,I love your writing so much! percentage we
communicate extra approximately your article on AOL?
I need an expert in this area to resolve my problem.
Maybe that’s you! Having a look ahead to see you.
Wirklich guter Inhalt. Reichlich nützliche Hinweise.
Danke für die Mühe. Ich werde öfter reinschauen.
Sehe ich genauso – der Bereich der Wohnungsgestaltung wird
oft herausfordernd. Endlich mal Klartext.
Wirklich hilfreich. Ich war schon nach genau so einem
Beitrag lange gesucht. Super Arbeit!
My webpage: http://hopmann.nrw
Hello.This article was extremely interesting, particularly since I was searching for thoughts on this subject last couple of days.
Bedankt voor het bericht! Deze site is een goede site en helpt lezers.
the narcissistic personality tends to be relationally antagonistic.and oppressively controlling.ラブドール エロ
Thanks for one’s marvelous posting! I truly enjoyed reading it, you are a great author.I will always
bookmark your blog and will come back from now on. I want to encourage yourself
to continue your great work, have a nice day!
Hi there, for all time i used to check web site posts here early in the break of day, for the reason that i like
to learn more and more.
Link exchange is nothing else but it is just placing the other person’s
web site link on your page at proper place and other person will also do same for you.
Cabinet IQ
8305 Stage Hwy 71 #110, Austin,
TX 78735, United Ⴝtates
254-275-5536
Organization
I am lucky that I discovered this website , precisely the right info that I was searching for! .
I would like to thank you for the efforts you’ve put in writing this blog.
I am hoping to check out the same high-grade content by you in the future as well.
In fact, your creative writing abilities has encouraged me to get
my own, personal website now 😉
Thanks , I have recently been looking for information approximately this topic for a while and yours is
the greatest I’ve discovered till now. But,
what concerning the bottom line? Are you positive in regards to the source?
Hey there! Do you use Twitter? I’d like to follow you if that
would be okay. I’m undoubtedly enjoying your blog and look forward to
new updates.
長年気になっていたテーマで 、今回詳しく解説していただきありがとうございます。実際に自分で試したときは 多かったので、記事を読んでスッキリしました。専門的すぎず一般人にも分かりやすい
点がとても良いと感じました。 また新しい情報があれば確認しに来ます。
all the time i used to read smaller articles which as well clear their motive, and
that is also happening with this piece of writing which I am reading here.
You certainly deserve a round of applause for your post and more specifically, your blog in general. Very high quality material!
Good day very cool web site!! Guy .. Beautiful .. Superb ..
I’ll bookmark your blog and take the feeds additionally?
I am glad to seek out a lot of useful info here in the
submit, we want develop extra techniques in this regard, thank
you for sharing. . . . . .
Hi, i read your blog occasionally and i own a similar one and
i was just curious if you get a lot of spam feedback? If
so how do you protect against it, any plugin or anything you
can recommend? I get so much lately it’s driving me crazy so any assistance is very much appreciated.
It maintains the stability of the pelvic body organs and permits the pelvic organs to have a certain level of activity [52]
With havin so much content and articles do you ever run into any problems
of plagorism or copyright violation? My website has a lot of
completely unique content I’ve either written myself or outsourced
but it appears a lot of it is popping it up all over the internet without my permission. Do you know
any techniques to help protect against content from
being stolen? I’d definitely appreciate it.
However if you want to smooth out (or “shape”) a certain part
of your body, it’s a good choice.
Hi it’s me, I am also visiting this web page daily, this web site is genuinely pleasant and the users are truly sharing nice
thoughts.
Hmm it looks like your blog ate my first comment (it was super long) so I guess I’ll just sum it up what I submitted and
say, I’m thoroughly enjoying your blog. I as well am
an aspiring blog writer but I’m still new to everything.
Do you have any helpful hints for novice blog writers?
I’d definitely appreciate it.
Thanks for a Interesting item; I enjoyed it very much. Regards Sang Magistrale
This is a very informative post about online casinos and betting platforms.
I especially liked how it explains the importance of choosing
a secure site before signing up.
Many players often ask where they can find reliable gaming platforms with fair odds and smooth payouts.
From what I’ve seen, checking platforms like vn22vip helps
users compare features, bonuses, and overall experience.
Thanks for sharing these insights — they’re helpful for both beginners and experienced bettors.
Socolive là điểm đến lý tưởng dành cho những người yêu thích cá cược
bóng đá và thể thao. Với nền tảng hiện đại và
uy tín hàng đầu, Socolive mang đến trải nghiệm cá cược trực tiếp
cùng link bóng đá chất lượng, giúp người chơi dễ dàng theo dõi và đặt cược chính xác hơn.
My brother suggested I might like this websiteHe was once totally rightThis post truly made my dayYou can not imagine simply how a lot time I had spent for this information! Thanks!
This article provides clear idea for the new people of blogging, that
truly how to do blogging.
If you would like to take a good deal from this post then you
have to apply these methods to your won weblog.
Wow, marvelous blog format! How lengthy have you ever been running a blog for?
you made blogging look easy. The full look of your web site is great, let alone the content material!
Postingan yang sangat informatif! Ulasan ini sangat membantu bagi para pemain yang sedang mencari referensi situs dengan performa terbaik.
Memang benar, memilih platform dengan **RTP
Tinggi** seperti **WIN1131** adalah langkah cerdas untuk mendapatkan pengalaman bermain yang maksimal.
Ditambah lagi dengan dukungan **Livechat 24 Jam** yang stand by, kita jadi merasa lebih aman saat
bermain. Terima kasih sudah berbagi! Kunjungi WIN1131 Sekarang
Howdy! I could have sworn I’ve been to this blog before but after reading through
some of the post I realized it’s new to me. Anyhow, I’m definitely glad I found it and I’ll be book-marking and checking back frequently!
Afterr I orriginally comented I seewm tto have clickesd tthe -Notjfy mme wen nnew commenfs
aree added- checkox annd nnow eafh tme a commnt is aded I recieve fouyr emjails with tthe exat
same comment. Ther has tto bee a means youu aree abvle tto remove mme from that service?
Thanks!
Also vissit myy blog: cnhub.xyz
After reducing weight, everything is more comfortable,
being in my body and my clothes.
It’s going to be end of mine day, however before finish I am reading this great
piece of writing to increase my experience.
It’s very effortless to find out any matter on web as compared to
textbooks, as I found this piece of writing at this
site.
I know this web page gives quality depending articles or reviews and extra data, is there any other website which gives such things in quality?
Do you have a spam issue on this site; I also am a blogger,
and I was wondering your situation; many of us have created some nice procedures and we are looking to
trade techniques with other folks, why not shoot me an e-mail
if interested.
Masya Allah ulasannya! Indonesia memang memiliki destinasi
wisata yang sangat memukau. Saya sangat setuju bahwa Pesona Alam Indonesia adalah keindahan yang tak tergantikan, mulai dari gunung hingga pantainya.
Terima kasih sudah berbagi informasi ini, sangat membantu saya merencanakan liburan berikutnya.
Mari jelajahi Wisata Alam Indonesia yang lainnya juga!
Wisata Alam Indonesia
References:
Hard rock casino hollywood https://undrtone.com/collarbolt40
Magnificent goods from you, man. I’ve understand your stuff previous to and you’re just extremely great.
I really like what you have acquired here, really
like what you are stating and the way in which you say it.
You make it entertaining and you still care for to keep
it smart. I cant wait to read much more from you. This is really a tremendous site.
my page :: خرید بک لینک
Heya i’m for the first time here. I found this board
and I find It really useful & it helped me out much. I hope to give something
back and aid others like you aided me.
Hi! I could have sworn I’ve been to this blog before but after checking
through some of the post I realized it’s new to me. Nonetheless, I’m definitely glad I found it and I’ll be bookmarking and
checking back often!