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跑半个小时。显然不完美,蒙人没问题。
Have you ever considered creating an ebook or guest authoring on other websites?
I have a blog based upon on the same information you discuss and would really like to
have you share some stories/information. I know my
readers would value your work. If you’re even remotely interested, feel free to shoot me an e mail.
Informative article, exactly what I wanted to find.
Hello to every body, it’s my first go to see of this blog;
this web site carries awesome and actually fine
data designed for readers.
magnificent points altogether, you just won a brand new reader.
What may you suggest in regards to your post that you simply made some
days in the past? Any certain?
This is a very good tip particularly to those new
to the blogosphere. Brief but very accurate info… Thank you for sharing this
one. A must read article!
Today, while I was at work, my cousin stole my
iPad and tested to see if it can survive a twenty five foot drop, just so she
can be a youtube sensation. My iPad is now broken and she has 83 views.
I know this is entirely off topic but I had to share it with someone!
Feel free to visit my homepage … HTN Support
This take on the classic 90s toys will really respond to swipes, tilts, shakes and her touch.
Also visit my web blog gifts jesus gave us
Now I am going to do my breakfast, afterward having my breakfast coming
yet again to read further news.
Sehr guter Artikel. Viele konkrete Inspirationen. Super dass du
dein Wissen teilst. Ab jetzt lese ich hier öfter mit.
Sehe ich genauso – das Thema der Wohnungsgestaltung kann nicht einfach.
Hilfreicher Ansatz.
Echt praxisnah. Ich war schon nach ähnlichen Tipps genau danach gesucht.
Super Arbeit!
Also visit my blog; http://Www.ti80.online.fr/
Cześć, przeglądałem forum i muszę przyznać, że temat jest świetnie opisany. Sama właśnie teraz zmieniam wystrój i każda wskazówka jest na wagę złota. Pozdrawiam forumowiczów.
Ciekawa dyskusja. Z mojego doświadczenia wybór kolorystyki to podstawa. Lepiej raz a dobrze.
Also visit my site … https://gratisafhalen.be/author/bettyedeari/
that I left upon the table in thesarvants-hall,エロ 人形when mistresses bell rung,
Hi, ich bin beim Stöbern hier gelandet und ich stelle fest, dass es hier viele wertvolle Inhalte gibt. Ich selbst renoviere seit kurzem meine Wohnung ein und ich suche nach Inspiration. Viele Grüße.
Wertvoller Beitrag. Meiner Meinung nach die richtige Farbgebung eine enorme Rolle spielt. Lieber einmal richtig als zweimal.
Hey! Do you use Twitter? I’d like to follow you if that would be
okay. I’m definitely enjoying your blog and look forward to new updates.
It’s not my first time to go to see this web site, i am browsing
this website dailly and obtain nice information from here daily.
It’s going to be end of mine day, except before ending
I am reading this enormous post to increase my knowledge.
For the reason that the admin of this website is working, no question very quickly it will be well-known, due to its feature contents.
Feel free to visit my webpage :: 線上A片
Manta Bridge explained well: https://mantabridge.gitbook.io/manta-bridge-docs
Guten Tag, ich habe nach Informationen zum Einrichten gesucht und ich stelle fest, dass man hier echt was mitnimmt. Ich richte seit einiger Zeit mein Zuhause neu zu gestalten und solche Tipps sind echt hilfreich. Liebe Grüße in die Runde.
Wertvoller Beitrag. Aus meiner Erfahrung die Auswahl der Möbel die Basis von allem ist. Lieber einmal richtig als zweimal.
Hey, ich habe nach Informationen zum Einrichten gesucht und ich stelle fest, dass es hier viele wertvolle Inhalte gibt. Ich selbst renoviere seit kurzem mein Haus und jeder Ratschlag hilft mir weiter. Grüße an die Forengemeinde.
Gutes Thema. Aus meiner Erfahrung die richtige Farbgebung eine enorme Rolle spielt. Ich empfehle, sich nicht zu hetzen.
Guten Tag, ich habe das Forum durchgeblättert und ich stelle fest, dass man hier echt was mitnimmt. Ich richte seit einiger Zeit mein Haus und ich suche nach Inspiration. Danke und viele Grüße.
Interessante Diskussion. Ich möchte hinzufügen, dass die Auswahl der Möbel eine enorme Rolle spielt. Ich empfehle, sich nicht zu hetzen.
Hallo, ich bin hier durch Zufall gelandet und ich muss zugeben, dass es hier viele wertvolle Inhalte gibt. Ich richte seit einiger Zeit die Einrichtung neu zu und solche Tipps sind echt hilfreich. Viele Grüße.
Wertvoller Beitrag. Ich kann aus eigener Erfahrung sagen, dass die Farbwahl eine enorme Rolle spielt. Lieber einmal richtig als zweimal.
Feel free to visit my blog; https://Coopspace.online/index.php?title=Stuck_in_der_Wohnung_%E2%80%93_wenn_die_eigenen_vier_W%C3%A4nde_pl%C3%B6tzlich_eng_werden
Many thanks. Excellent stuff!
Stop by my webpage; https://www.Strategyessays.com/
Great article. I really enjoyed reading the detailed football analysis and match statistics presented here.
The information is clear, informative, and helpful for anyone interested in following the latest football developments.
Heya just wanted to give you a quick heads up and let you know a
few of the pictures aren’t loading properly. I’m not sure
why but I think its a linking issue. I’ve tried it in two different browsers and both show the same
results.
my web-site night tour la fortuna
Klasse Inhalt. Zahlreiche nützliche Informationen. Vielen Dank
fürs Teilen. Ab jetzt lese ich hier öfter mit.
Du hast recht – der Bereich der Möbelauswahl ist anspruchsvoll.
Hilfreicher Ansatz.
Sehr inspirierend. Ich habe schon nach ähnlichen Tipps genau danach gesucht.
Danke!
Also visit my homepage … http://Cgi.www5b.biglobe.Ne.jp/~Akanbe/yu-betsu/joyful/joyful.cgi?Page=20
オナホ 高級ifgreater,we shall at once send cheque for difference on hearing fromyou.
Incredible story there. What happened after?
Good luck!
I’m not sure exactly why but this website is loading extremely slow for me.
Is anyone else having this issue or is it a
issue on my end? I’ll check back later and see if the problem still
exists.
Really enjoyed reading this! Samurai swords are truly fascinating.
Their craftsmanship is amazing. Keep up the great work.
I have always been interested in Japanese blades. They represent a rich cultural
heritage. Great read.
Nice share! Japanese blades are highly respected collectibles.
Exploring their origins is extremely interesting.
Looking forward to more content.
Thanks for this post! The beauty of Japanese swords has always fascinated collectors.
Great job.
Great website you have here but I was curious if you knew of any discussion boards that cover the same topics discussed here?
I’d really love to be a part of group where I can get feed-back
from other experienced people that share the same interest.
If you have any recommendations, please let me know.
Appreciate it!
Hello! Do you use Twitter? I’d like to follow you if that would be okay.
I’m definitely enjoying your blog and look forward to new posts.
my web blog – growth advisory
Hi! Do you know if they make any plugins to help with SEO?
I’m trying to get my blog to rank for some targeted keywords but I’m not seeing very good
results. If you know of any please share. Thanks!
Hey, ich bin beim Stöbern hier gelandet und ich möchte sagen, dass es hier viele wertvolle Inhalte gibt. Ich selbst bin gerade dabei, mein Haus und jeder Hinweis ist Gold wert. Grüße an die Forengemeinde.
Interessante Diskussion. Ich kann aus eigener Erfahrung sagen, dass die Farbwahl die Basis von allem ist. Ich empfehle, sich nicht zu hetzen.
A volume of Byron’s poems lay before him on the table.フィギュア オナホHe opened itcautiously with his left hand lest he should waken the child and beganto read the first poem in the book: Hushed are the winds and still the evening gloom,
Hey, ich habe nach Informationen zum Einrichten gesucht und ich stelle fest, dass das Thema hervorragend beschrieben ist. Ich renoviere seit kurzem die Einrichtung neu zu und ich suche nach Inspiration. Viele Grüße.
Wertvoller Beitrag. Ich kann aus eigener Erfahrung sagen, dass die Raumgestaltung nicht zu unterschätzen ist. Es lohnt sich, dafür Zeit zu nehmen.
Hej, szukałem informacji o aranżacji i chcę powiedzieć, że dużo się dowiedziałem. Sama właśnie teraz zmieniam wystrój i szukam inspiracji. Miłego dnia wszystkim.
Ciekawa dyskusja. Dorzucę od siebie, że wybór kolorystyki naprawdę robi różnicę. Warto poświęcić temu czas.
I pay a quick visit everyday a few web sites and sites to read posts, however this blog gives feature based content.
Servus, ich bin zufällig auf dieses Thema gestoßen und ich stelle fest, dass ich viel dazugelernt habe. Ich selbst richte seit einiger Zeit die Einrichtung neu zu und jeder Hinweis ist Gold wert. Grüße an die Forengemeinde.
Spannender Thread. Ich möchte hinzufügen, dass die Auswahl der Möbel wirklich einen Unterschied macht. Gut Ding will Weile haben.
Also visit my web page: https://coe-schule.de/index.php?title=Stimmungsbeleuchtung_f%C3%BCr_kleine_Wohnungen_%E2%80%93_wie_ich_aus_meinem_22-Quadratmeter-Lichtmangel_ein_Wohlf%C3%BChlparadies_gemacht_habe
Dzień dobry, przeglądałem forum i chcę powiedzieć, że temat jest świetnie opisany. Sama od jakiegoś czasu zmieniam wystrój i każda wskazówka jest na wagę złota. Miłego dnia wszystkim.
Wartościowy wątek. Moim zdaniem wybór kolorystyki naprawdę robi różnicę. Lepiej raz a dobrze.
Hello there! I know this is somewhat off topic but
I was wondering if you knew where I could find a captcha plugin for my comment form?
I’m using the same blog platform as yours and I’m having difficulty finding one?
Thanks a lot!
строительство кирпичных домов
Sehr guter Artikel. Viele praktische Anregungen. Danke dass du
dein Wissen teilst. Ich speichere mir die Seite ab.
Treffend formuliert – die Sache des Wohnstils ist herausfordernd.
Endlich mal Klartext.
Aufrichtig inspirierend. Ich habe schon nach genau so einem Beitrag lange gesucht.
Super Arbeit!
my blog post … http://Tanosimi-Net.Sakura.Ne.Jp/
Bardzo dobry wpis. Sporo przydatnych porad.
Dziękuję za ten materiał. Czekam na więcej.
Dokładnie – temat aranżacji potrafi być trudna. Wreszcie konkrety.
Naprawdę pomocne. Szukałam czegoś takiego już jakiś czas.
Dziękuję!
Also visit my blog Juliann
Witajcie, natknąłem się na ten temat i chcę powiedzieć, że dużo się dowiedziałem. Sama właśnie teraz remontuję dom i każda wskazówka jest na wagę złota. Miłego dnia wszystkim.
Ciekawa dyskusja. Z mojego doświadczenia wybór kolorystyki ma ogromne znaczenie. Polecam się nie spieszyć.
my web page – https://www.wiki.somosphm.net/index.php/Aran%C5%BCacja_biura_w_domu_%E2%80%93_jak_zmie%C5%9Bci%C4%87_prac%C4%99_i_go%C5%9Bci_w_jednym_pokoju%3F
Guten Tag, ich bin zufällig auf dieses Thema gestoßen und mir ist aufgefallen, dass das Thema hervorragend beschrieben ist. Ich gestalte gerade mein Haus und ich suche nach Inspiration. Viele Grüße.
Spannender Thread. Ich kann aus eigener Erfahrung sagen, dass die Farbwahl wirklich einen Unterschied macht. Ich empfehle, sich nicht zu hetzen.
My web page https://asteroidsathome.net/boinc/view_profile.php?userid=1261274
You actually stated this really well!
I’ll right away clutch your rss feed as I can not in finding your
e-mail subscription hyperlink or newsletter service.
Do you have any? Please allow me understand so
that I may subscribe. Thanks.
Karaoke singers should avoid overusing vibrato.
Proper posture improves breathing during karaoke singing..
http://www.chabad.edu)
Hey would you mind stating which blog platform you’re using?
I’m going to start my own blog in the near future but I’m
having a difficult time selecting between BlogEngine/Wordpress/B2evolution and Drupal.
The reason I ask is because your design seems different then most blogs and I’m looking for something completely unique.
P.S Sorry for getting off-topic but I had to ask!
hi!,I really like your writing very a lot! share we keep in touch extra about your article on AOL?
I need an expert on this house to solve my problem.
May be that is you! Having a look forward to peer you.
My blog post: 性爱片