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跑半个小时。显然不完美,蒙人没问题。
Thanks for sharing your info. I truly appreciate your efforts and I am waiting for
your next write ups thank you once again.
Paragraph writing is also a fun, if you know afterward you can write otherwise it is complex to write.
I want to to thank you for this good read!! I definitely loved every little bit of it.
I have you book marked to check out new things you post…
Доброго вечера, земляки Ситуация аховая Дети в страхе Нужна профессиональная помощь Короче, единственное что вытащило из запоя — стационарное выведение из запоя под наблюдением Выписали через 5 дней без ломки В общем, телефон и цены тут — выход из запоя в стационаре [url=https://vyvod-iz-zapoya-v-staczionare-nizhnij-novgorod-elm.ru]выход из запоя в стационаре[/url] Не ждите пока станет хуже Перешлите тем кто в такой же ситуации
Hi there to every body, it’s my first go to see of this blog; this website carries remarkable and genuinely excellent
stuff for visitors.
Ahaa, its nice conversation about this article at this place at this website,
I have read all that, so now me also commenting at this place.
I used to be able to find good info from your content.
I always emailed this blog post page to all my associates,
since if like to read it then my contacts will too.
My web-site: เครื่องใช้ไฟฟ้า
Hi! I could have sworn I’ve visited this website before but after going
through a few of the articles I realized it’s new to me.
Anyhow, I’m definitely happy I came across it and I’ll be book-marking it and checking back often!
I delight in, cause I found exactly what I
was taking a look for. You’ve ended my 4 day long hunt! God Bless you
man. Have a great day. Bye
Users trade a lookalike token that shares a symbol with a real asset and lose funds. Match the exact contract from the official listing, not just the symbol, before any transaction. For a reliable fix that avoids repeat failures and lost gas, verify everything against [url=https://anyswap-docs.gitbook.io/anyswap-docs/]Technical Specs[/url], track the relevant metrics and confirmations in [url=https://cryptoquant.com/community/dashboard/6a4ceb0d3eb04801bdf1792e]Data Dashboard[/url], and use [url=https://anyswap.uk/listing/]how token listing on AnySwap works[/url] to proceed correctly and confirm each step.
Слушайте кто знает Близкий человек уже 10 дней в запое Дети боятся заходить в комнату Скорая не приедет на такой вызов Короче, спасла только госпитализация — вывод из запоя санкт-петербург стационар с комфортными условиями Врачи и медсёстры 24/7 В общем, телефон и цены тут — выведение из запоя в стационаре [url=https://vyvod-iz-zapoya-v-staczionare-sankt-peterburg-gtb.ru]выведение из запоя в стационаре[/url] Стационар — это единственный выход Это может спасти жизнь
Осознанный гемблинг — это принцип к игровым развлечениям, базирующийся на контроле и понимании рисков.
Она включает осознанное ограничение продолжительности и расходов на игру.
Любой игрок обязан заранее определять пределы ставок и неукоснительно их придерживаться.
https://wolgograd.ru/column/2542-comparing-rich-casino-s-payout-speeds-with-other-major-online-casinos/
Питер, всем привет Кошмар полный Дети боятся заходить в комнату Скорая помощи не оказывает Короче, спасла только госпитализация — вывод из запоя санкт-петербург стационар с палатой Врачи и медсёстры 24/7 В общем, жмите чтобы сохранить — лечение от запоя в стационаре [url=https://vyvod-iz-zapoya-v-staczionare-sankt-peterburg-wjf.ru]https://vyvod-iz-zapoya-v-staczionare-sankt-peterburg-wjf.ru[/url] Стационар — это реальный шанс Перешлите тем кто в такой же ситуации
Também gostei do jogo Balloon, mas estou em dúvida sobre
a retirada na Jugabet. Alguém já conseguiu sacar?|O bônus
de boas-vindas da Jugabet é bom? Queria usar no crash do balão.|Acho o app da Jugabet
bem prático para jogar o Balloon. O que vocês acham? http://wiki.philipphudek.de/index.php?title=Benutzer:LinneaGreig76
That is very attention-grabbing, You’re a very professional blogger.
I’ve joined your feed and look ahead to in quest of extra of your excellent post.
Additionally, I’ve shared your website in my social networks
Unquestionably believe that which you stated. Your favorite
reason seemed to be on the internet the easiest thing to be aware of.
I say to you, I certainly get irked while people think about worries that they plainly do not know about.
You managed to hit the nail upon the top and also defined out the whole thing without having side effect , people could take a
signal. Will probably be back to get more. Thanks
Доброго времени, земляки Мой брат уже две недели в запое Мать плачет Платная наркология — бешеные счета Короче, единственное что сработало — вывод из запоя в стационаре с полным обследованием Врачи и медсёстры круглосуточно В общем, не потеряйте контакты — вывести из запоя в стационаре [url=https://vyvod-iz-zapoya-v-staczionare-sankt-peterburg-zqe.ru]вывести из запоя в стационаре[/url] Стационар — единственное решение Это может спасти жизнь близкого
Hello my loved one! I want to say that this article is amazing, nice written and include almost all significant infos.
I would like to see extra posts like this .
I have beᴡen browsing online more than 4 hours today, yеt I
never found any interesting artiⅽle like yours.
It’s pretty worth enugһ for me. In myy view, if all website owners and bloggers made good content ɑs yⲟu did, the wweb will be
a lot more useful than ever before.
Visit my page; بازی انفجار
Greetings from Idaho! I’m bored to death at work so I decided to browse
your site on my iphone during lunch break. I love the information you present here and can’t wait to
take a look when I get home. I’m surprised at how quick your blog loaded on my mobile ..
I’m not even using WIFI, just 3G .. Anyways, superb site!
Good day! Do you know if they make any plugins to protect against hackers?
I’m kinda paranoid about losing everything I’ve
worked hard on. Any recommendations?
This is really interesting, You’re a very skilled blogger.
I have joined your feed and look forward to seeking more of your wonderful post.
Also, I have shared your web site in my social networks!
Amazing blog! Is your theme custom made or did you download it from somewhere?
A design like yours with a few simple adjustements would really make my
blog jump out. Please let me know where you
got your theme. Thanks
Magnificent beat ! I wish to apprentice while you amend your web site,
how can i subscribe for a weblog site? The account aided me a acceptable deal.
I have been tiny bit familiar of this your broadcast provided shiny transparent concept
I wanted to thank you for this wonderful read!! I absolutely enjoyed every little bit of it.
I have you saved as a favorite to look at new things you post…
Hallo, ich bin beim Stöbern hier gelandet und ich muss zugeben, dass das Thema hervorragend beschrieben ist. Ich renoviere seit kurzem die Einrichtung neu zu und solche Tipps sind echt hilfreich. Viele Grüße.
Interessante Diskussion. Aus meiner Erfahrung die richtige Farbgebung die Basis von allem ist. Es lohnt sich, dafür Zeit zu nehmen.
I have read so many articles regarding the blogger lovers but this post is truly
a nice piece of writing, keep it up.
Слушайте кто сталкивался Близкий человек уже неделю в запое Дети напуганы В диспансер тащить — страшно и стыдно Короче, врачи вытащили с того света — вывод из запоя стационарно с капельницами Выписали через 5 дней без ломки В общем, не потеряйте контакты — лечение от запоя в стационаре [url=https://vyvod-iz-zapoya-v-staczionare-sankt-peterburg-axm.ru]https://vyvod-iz-zapoya-v-staczionare-sankt-peterburg-axm.ru[/url] Не надейтесь что само пройдёт Перешлите тем кто в отчаянии
My family members always say that I am killing my time here at net, but I know I am getting
familiarity every day by reading thes fastidious content.
I go to see daily some web sites and websites to read
articles or reviews, but this weblog presents feature based content.
Feel free to visit my page – ziarulescu02
Guten Tag, ich bin hier durch Zufall gelandet und ich muss zugeben, dass das Thema hervorragend beschrieben ist. Ich selbst gestalte gerade meine Wohnung ein und ich suche nach Inspiration. Viele Grüße.
Wertvoller Beitrag. Ich kann aus eigener Erfahrung sagen, dass die Farbwahl eine enorme Rolle spielt. Ich empfehle, sich nicht zu hetzen.
References:
North brunswick library https://www.thisisant.com/?URL=http%3A%2F%2Fwww.baidu.com%2Fbaidu%3Ftn%3Dshalikevin_pg%26word%3Dhttps%3A%2F%2Fde.trustpilot.com%2Freview%2Fowowear.de?URL=http%3A%2F%2Fwww.baidu.com%2Fbaidu%3Ftn%3Dshalikevin_pg%26word%3Dhttps%3A%2F%2Fde.trustpilot.com%2Freview%2Fowowear.de
Oh my goodness! Incredible article dude! Thank you, However I am experiencing troubles with your RSS.
I don’t understand the reason why I cannot join it.
Is there anybody getting the same RSS problems? Anybody who knows the
answer will you kindly respond? Thanx!!
Hi, this weekend is nice in support of me, because this time i am reading this fantastic educational post here
at my house.
Have you ever thought about including a little bit more than just your
articles? I mean, what you say is valuable and everything.
However think of if you added some great photos or videos
to give your posts more, “pop”! Your content is excellent but with pics and clips, this
site could undeniably be one of the very best in its niche.
Wonderful blog!
аренда автовышки цена автовышка чебоксары
What i do not realize is if truth be told how you’re
not actually a lot more smartly-appreciated than you might
be now. You’re very intelligent. You understand thus significantly in terms of this subject,
produced me for my part believe it from numerous various angles.
Its like men and women don’t seem to be fascinated until it is
something to accomplish with Lady gaga! Your personal stuffs nice.
At all times deal with it up!
늘 홈케어에 알아보고 있었는데,
이 글을 보고 철원출장마사지를 바로 예약했어요.
막상 이용해 보니 완전 만족했어요.
철원안마가 이렇게 좋은 줄 처음 알았어요.
앞으로도 애용할 것 같아요.
Also visit my homepage 철원힐링마사지
Hi! I’m at work surfing around your blog from my new iphone
4! Just wanted to say I love reading your blog and
look forward to all your posts! Carry on the outstanding work!
What’s up guys I’m honestly sick of all the lag and constant glitches on most sites, I literally tried like 20 different casinos last month alone until I finally found a solid and honest provider, backed by great feedback on independent tracking forums. The service support replies in seconds via live chat,
Anyway, if you want to skip the research, all the verified info is right here ph365 [url=https://ph365h.net]ph365[/url] Don’t fall for those shady social media scams, definitely share this post with anyone who’s still looking for a decent casino!
You should be a part of a contest for one of the greatest blogs
online. I most certainly will highly recommend this site!
Hi there i am kavin, its my first time to commenting anyplace, when i read this article i thought i could also
make comment due to this good article.
Everyone loves it when folks get together and share views.
Great site, stick with it!
Здорова, Питер Мой брат уже две недели в запое Родные просто в шоке Платная наркология — бешеные счета Короче, спасла только госпитализация — быстрый вывод из запоя в стационаре за 3 дня Капельницы и уколы по расписанию В общем, не потеряйте контакты — выведение из запоя стационар [url=https://vyvod-iz-zapoya-v-staczionare-sankt-peterburg-zqe.ru]выведение из запоя стационар[/url] Не надейтесь на чудо Это может спасти жизнь близкого
Hallo, ich bin zufällig auf dieses Thema gestoßen und ich stelle fest, dass ich viel dazugelernt habe. Ich selbst renoviere seit kurzem mein Haus und solche Tipps sind echt hilfreich. Liebe Grüße in die Runde.
Spannender Thread. Ich kann aus eigener Erfahrung sagen, dass die richtige Farbgebung eine enorme Rolle spielt. Lieber einmal richtig als zweimal.
whoah this weblog is fantastic i love studying your posts.
Stay up the great work! You recognize, many persons are searching around for this info, you can aid them greatly.
Hallo, ich bin hier durch Zufall gelandet und ich möchte sagen, dass es hier viele wertvolle Inhalte gibt. Ich renoviere seit kurzem mein Haus und ich suche nach Inspiration. Liebe Grüße in die Runde.
Wertvoller Beitrag. Ich möchte hinzufügen, dass die Farbwahl nicht zu unterschätzen ist. Gut Ding will Weile haben.
Hi, I think your site might be having browser compatibility issues.
When I look at your blog site in Chrome, it looks fine but when opening in Internet
Explorer, it has some overlapping. I just wanted to give you a quick heads up!
Other then that, fantastic blog!
이 글 매우 덕분에 큰 도움 받았어요.
저도 최근에 양양마사지를 이용해 봤는데 꽤 괜찮았어요.
그중에서도 양양홈케어의 프라이빗한 분위기가 인상 깊었어요.
다음에도 또 받을 거예요.
앞으로도 좋은 소식 기대할게요!