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跑半个小时。显然不完美,蒙人没问题。
Cześć, natknąłem się na ten temat i chcę powiedzieć, że dużo się dowiedziałem. Sam ostatnio zmieniam wystrój i szukam inspiracji. Pozdrawiam serdecznie.
Dobry temat. Moim zdaniem dobór mebli naprawdę robi różnicę. Polecam się nie spieszyć.
my web page … https://wiki.inclusivebytes.org/index.php?title=Jak_tanio_urz%C4%85dzi%C4%87_mieszkanie_i_nie_zwariowa%C4%87_przy_ma%C5%82ym_bud%C5%BCecie
Sehr guter Inhalt. Viele hilfreiche Informationen. Großes Lob fürs
Teilen. Ich warte auf mehr.
Sehe ich genauso – der Bereich der Wohnungsgestaltung kann anspruchsvoll.
Gut, dass es jemand erklärt.
Sehr hilfreich. Ich habe schon nach solchen Informationen lange gesucht.
Klasse gemacht!
Here is my website … https://Openmachinery.Net/Index.Php/Skandinavischer_Einrichtungsstil:_GemüTlichkeit_FüR_Kleine_Wohnungen
エロ ロボットNow you go into the parlor,and I’llsend ’em down to you,
It’s the best time to make some plans for the
future and it’s time to be happy. I have read this post and if I could I
wish to suggest you few interesting things or tips.
Perhaps you could write next articles referring to this article.
I desire to read even more things about it!
Świetny artykuł. Mnóstwo konkretnych porad. Pozdrawiam za podzielenie się.
Czekam na więcej.
Dokładnie – kwestia aranżacji bywa niełatwa. Dobrze, że ktoś
to wyjaśnia.
Naprawdę przydatne. Szukałam podobnych porad już jakiś czas.
Dziękuję!
Here is my blog post; Deanne
I just finished reading your latest post and I felt the need to show my
appreciation. Your engaging breakdown of the team makes this content
stand out from the rest.
The most valuable part is that you can feel the passion in your
writing. You gave me new insights to think about.
I’ll definitely be following your content! Your blog instantly became one of
my favorites.
Yes! Finally someone writes about yaarwin.
Hi there friends, nice piece of writing and fastidious urging commented here,
I am in fact enjoying by these.
Pretty nice post. I just stumbled upon your weblog and wanted to say that I’ve really enjoyed surfing around your blog posts. After all I’ll be subscribing in your feed and I am hoping you write again very soon!
Wartościowy artykuł. Dużo przydatnych wskazówek.
Pozdrawiam że dzielisz się wiedzą. Będę zaglądać częściej.
Trafnie napisane – temat aranżacji bywa wymagająca.
Przydatne podejście.
Szczerze pomocne. Szukałem czegoś takiego właśnie tego.
Pozdrawiam!
my web blog: Kimber
I’ve been surfing online more than 2 hours today, yet I never
found any interesting article like yours.
It’s pretty worth enough for me. Personally,
if all website owners and bloggers made good content as you did, the web will be much more useful than ever before.
Rzeczowy artykuł. Dużo wartościowych informacji. Dziękuję za podzielenie
się. Czekam na więcej.
Trafnie napisane – kwestia urządzania wnętrz jest wymagająca.
Wreszcie konkrety.
Naprawdę inspirujące. Szukałam takich informacji już jakiś czas.
Dziękuję!
my webpage :: Francisca
Dubai is song of the domain’s beat real manor investment destinations, sacrifice dues advantages, strong rental yields, and премиум lifestyle opportunities.
From sybaritism villas to high-rise apartments, buying means in Dubai provides unequalled budding as a
remedy for both profits and long-term major growth.
Hello my family member! I want to say that this post is amazing, great written and include approximately all important
infos. I would like to look more posts like this .
Also visit my web site :: 成人影片, Hildegarde,
Strong karaoke performers understand rhythm and phrasing.
A relaxed karaoke atmosphere encourages stronger audience participation..
origin and meaning of the word karaoke
What’s up to every one, the contents present at this site
are really awesome for people experience, well, keep up the nice work fellows.
I know this if off topic but I’m looking into starting my own weblog and was wondering what all is required to
get setup? I’m assuming having a blog like yours would cost a
pretty penny? I’m not very internet smart so I’m not 100%
certain. Any recommendations or advice would be greatly appreciated.
Appreciate it
I was able to find good advice from your content.
Incredible! This blog looks just like my old one! It’s on a entirely different subject but it has
pretty much the same page layout and design. Excellent choice of
colors!
Wonderful beat ! I wish to apprentice while you amend your site,
how can i subscribe for a blog site? The account aided me a acceptable deal.
I had been a little bit acquainted of this your broadcast provided
bright clear concept
This is a very informative post about online casinos and betting platforms.
I especially liked how it explains the importance of choosing a licensed 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.
Interessanter Beitrag. Jede Menge nützliche Informationen. Danke für diesen Inhalt.
Ich speichere mir die Seite ab.
Treffend formuliert – das Thema der Wohnungsgestaltung wird oft anspruchsvoll.
Hilfreicher Ansatz.
Sehr hilfreich. Ich suche schon nach ähnlichen Tipps seit Wochen gesucht.
Super Arbeit!
My web page … Arcadetimecapsule.com
راستش من این کامنت رو بیشتر از زاویه تجربه شخصی
مینویسم و نمیخوام چیزی رو قطعی معرفی کنم.
وقت بخیر، معمولاً فقط وقتی چیزی برام جالب باشه نظر میدم.
مدتی قبل وقتی دنبال مقایسه چند
سایت بودم اینجا برام جالبشد.
در نگاه اول حس کردم ساختارش بد نیست.
راستش برای من مهمه که نباید فقط به ظاهر سایت اعتماد کرد.
یکی از دوستام به اسم محسن قبلاً درباره بازی انفجار زیاد سوال میپرسید.
به همین خاطر چند بخش رو با حوصلهتر
خوندم. برداشت من این بود که چند بخشش برای مقایسه مفید بود.
بااین حال همیشه بهتره چند گزینه کنار هم مقایسه بشن.
برای آدمهایی که تازه با این فضا
آشنا شدن میخوان درباره
بازی انفجار بیشتر بدونن، بد نیست این صفحه رو هم ببینن.
وقتی این حوزه رو نگاه میکنی نمونههایی مثل enfejarоnline.net همراه با برند sibbet نشون میدن این حوزه چقدر گسترده شده.
یکی از بچهها که اسمش سامان بود، میگفت مشکل
خیلی از سایتها اینه که فقط شعار میدن ولی
توضیح درست نمیدن؛ برای همین من هم بیشتر به
متنها دقت کردم. در مجموع حداقل برای آشنایی اولیه میتونه مفید باشه.
فکر میکنم منطقیتره قبل از هر اقدامی شرایط و جزئیات رو
بررسی کنه. اگر بخوام ساده بگم، نه میشه با یک نگاه تأییدش کرد نه ردش؛ بهتره چند بخشش رو دید،
شرایط رو خوند و بعد نظر داد.
Feel free to surf to mmy web site; کلاس مجازی
Hello mates, its fantastic post on the topic of teachingand completely defined, keep it up all the time.
Review my homepage :: Sexpartnerin
This piece of writing gives clear idea in favor of the new visitors
of blogging, that actually how to do blogging and site-building.
Hello there! Would you mind if I share your blog with my facebook group?
There’s a lot of people that I think would really enjoy your content.
Please let me know. Thank you
Wertvoller Post. Zahlreiche wertvolle Inspirationen. Großes Lob
fürs Teilen. Ich empfehle die Seite gerne weiter.
Sehe ich genauso – die Sache der Wohnungsgestaltung kann
herausfordernd. Endlich mal Klartext.
Wirklich hilfreich. Ich suche schon nach so etwas seit einiger Zeit gesucht.
Klasse gemacht!
Have a look at my web page: Thao
به صورت جمعبندی
برای کاربرایی که در جستجو هستن
شرط آنلاین
در این زمینه مشغولن
این آدرس
میتونه یکی از گزینهها باشه
مفید واقع بشه
جالبه که
سرویسهایی مثل
еnfejaronline خوب
و
sibbet
باعث رشد این فضا شدن
به طور کلی
جذاب بود
و
احتمالاً
میام سراغش
My web blog … اخبار استارتاپ
I absolutely love your blog and find a lot of your post’s to be exactly
what I’m looking for. Does one offer guest
writers to write content for you personally? I wouldn’t mind creating a
post or elaborating on many of the subjects you write in relation to here.
Again, awesome web log!
Świetny tekst. Mnóstwo przydatnych informacji. Dzięki za ten materiał.
Polecam innym.
Masz rację – sprawa urządzania wnętrz potrafi być niełatwa.
Przydatne podejście.
Bardzo przydatne. Szukałem podobnych porad od dawna. Super robota!
Feel free to visit my blog: https://Srv1062422.Hstgr.cloud/
Interessanter Inhalt. Reichlich nützliche Informationen. Grüße fürs
Teilen. Ich speichere mir die Seite ab.
Sehe ich genauso – die Sache der Einrichtung wird oft schwierig.
Endlich mal Klartext.
Sehr inspirierend. Ich suche schon nach ähnlichen Tipps lange gesucht.
Viele Grüße!
Review my web-site – https://arizo-Kino.ru
Pretty! This was a really wonderful article. Thank you for supplying this
information.
Ciekawy materiał. Wiele konkretnych informacji. Dzięki za podzielenie
się. Zapisuję do ulubionych.
Zgadzam się – sprawa wystroju jest wymagająca.
Przydatne podejście.
Bardzo przydatne. Szukałem czegoś takiego właśnie tego.
Pozdrawiam!
My web-site; http://Www.P2SKY.Com
I just like the helpful info you supply for your articles.
I will bookmark your weblog and check once more right here frequently.
I am somewhat certain I’ll be told plenty of new stuff right here!
Good luck for the next!
I’m really impressed together with your writing talents as neatly as with the structure in your weblog.
Is this a paid theme or did you customize it your self? Anyway stay up the nice quality writing, it is rare to see a great blog like this one these
days..
I have fun with, result in I found just what I was having a look for.
You’ve ended my 4 day lengthy hunt! God Bless you man. Have a nice day.
Bye
It’s in fact very complex in this active life to listen news on Television, thus
I simply use the web for that reason, and obtain the latest news.
Wirklich guter Inhalt. Jede Menge wertvolle Inspirationen. Grüße dass du dein Wissen teilst.
Ich speichere mir die Seite ab.
Stimme zu – die Frage der Raumgestaltung ist
anspruchsvoll. Hilfreicher Ansatz.
Sehr praxisnah. Ich war schon nach genau so einem Beitrag seit Wochen gesucht.
Danke!
Feel free to visit my webpage – Leanne
Hello to all, as I am actually eager of reading this website’s post to be
updated daily. It contains fastidious stuff.
Hey there outstanding website! Does running a blog similar to this require a
great deal of work? I’ve no expertise in coding but
I was hoping to start my own blog soon. Anyway, if you have any suggestions or tips for new blog owners please share.
I know this is off topic nevertheless I simply had to ask.
Thanks!
My stress just melted away after visiting 수원여성전용마사지.
Gıda ürünleri temini işletmeler için sadece fiyatla
değerlendirilecek bir konu değil. Teslimat düzeni de en az fiyat kadar önemli.
Bu açıdan Timo Agro gibi kurumsal çalışan firmaların tercih edilmesi işletmeler için avantaj sağlayabilir.
If you are going for best contents like me, simply go to see this web site everyday since it presents quality
contents, thanks
Hi there, just became aware of your blog through
Google, and found that it’s truly informative.
I am gonna watch out for brussels. I’ll appreciate if you
continue this in future. Numerous people will be benefited from your writing.
Cheers!
Dubai is one of the world’s outstrip real caste investment destinations, gift dues advantages,
energetic rental yields, and premium lifestyle opportunities.
From self-indulgence villas to high-rise apartments,
buying acreage in Dubai provides nonpareil potential looking for both receipts
and long-term money growth.
I don’t know if it’s just me or if everybody else experiencing issues with your site. It appears as though some of the written text on your content are running off the screen. Can someone else please provide feedback and let me know if this is happening to them as well? This could be a problem with my web browser because I’ve had this happen before. Appreciate it
If you don’t mind, where do you host your weblog? I am looking for a very good web host and your webpage seams to be extremely fast and up most the time…
Most often since i look for a blog Document realize that the vast majority of blog pages happen to be amateurish. Not so,We can honestly claim for which you writen is definitely great and then your webpage rock solid.
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!
Some truly interesting info , well written and broadly user genial .