PDA

View Full Version : Where's the nCloth commands in the Maya command documentation? Does Duncan know?


NEO^AMiGA
09-13-2007, 01:16 PM
Is it just me... Or did they forget to put the nCloth commands in there? Can't find any of them in the command-documentation. Isn't that a bit odd?

NEO^AMiGA
09-13-2007, 02:30 PM
Since I am pretty certain Duncan will read this sooner or later I must add that there probably are some minor bugs in the createNCloth command. When I create a bunch, 30+, nCloth's in my script with this little snip from my code:


//create nCloth
for($j = 1; $j < ($inputCoins + 1); $j++){
select ("polyCoin" + $j);
createNCloth 0;

//parent to proxyCoin group
select -cl;
select ("nCloth" + $j);
select -add "proxyCoins";
parent;
}


Both nClothShape<number>.thickness and nClothShape<number>.pushOutRadius are randomised. Not that much of a difference on the values but I think it's enough for beeing visible.

Duncan
09-14-2007, 01:08 AM
The thickness and pushout are not randomized... rather they are based on the triangle density and size of your object. This is to try to provide an optimal default collision thickness and method. The nCloth creation methods are entirely mel scripts. They create the nCloth with calls like "createNode -type nCloth" and then do connectAttrs to manage all the connections and parenting. Other commands in Maya are frequently true c code calls with flags and options. These ones automatically get added to the command documentation, whereas the mel ones do not. However we probably should document them. You could submit a bug report on this if desired. (help menu:report a problem)


One thing you may consider if you have lots of coins: do poly combine on them before making nCloth. This will tend to solve much faster and will only need one cloth node. However this will not work if you plan on using rigidity( the entire mass of coins would become rigid ). One relatively efficient way of doing a lot of coins might be to make a bunch of circular poly faces, combine them, make that cloth with lots of bend stiffness and high substeps, then extrude the output mesh to give the coins thickness.


Duncan

NEO^AMiGA
09-14-2007, 04:50 AM
Morning Duncan!

Thanks for your answer! =)))

But if I with mel-script duplicate an object, then the triangle density and size would be identical on all those objects. Shouldn't the thickness and pushout then be identical if I make all those objects into nCloth objects?

Regarding the coins. I'm afraid they have to be rigid. This is mostly a test to see if I can recreate a setup that was made with rigidBodies. The thing is that it is scripted so at first maybe 5 coins falls down and creates a stack. Then maybe 10 coins falls down upon that. And after thay maybe just 4 coins falls down on the stack. So from a user interface one set how many coins that falls down and at what frame.
The old rigidBodies have not been the best for this. Have had some bad penetration problems (ehrm... with the objects that is ;)) wich kina forced me into splitting the whole dynamic simulation into several steps. So I was curious how nCloth would work in that case. But I do have to control the rigidity or some other atttribute so I know when the object dynamically simulates and when it's not. So I can controll when the individual coin fall and when they don't fall.

Regarding the documentation. Oh. I c. So then I can't create an nCloth object and set the attributes on the "nCloth call". However a better doumentation on those commands would be nice. I'll report a bug for i. =)

Thanks a million Duncan for taking your time and helping out on this wonderfull site.

The thickness and pushout are not randomized... rather they are based on the triangle density and size of your object. This is to try to provide an optimal default collision thickness and method. The nCloth creation methods are entirely mel scripts. They create the nCloth with calls like "createNode -type nCloth" and then do connectAttrs to manage all the connections and parenting. Other commands in Maya are frequently true c code calls with flags and options. These ones automatically get added to the command documentation, whereas the mel ones do not. However we probably should document them. You could submit a bug report on this if desired. (help menu:report a problem)


One thing you may consider if you have lots of coins: do poly combine on them before making nCloth. This will tend to solve much faster and will only need one cloth node. However this will not work if you plan on using rigidity( the entire mass of coins would become rigid ). One relatively efficient way of doing a lot of coins might be to make a bunch of circular poly faces, combine them, make that cloth with lots of bend stiffness and high substeps, then extrude the output mesh to give the coins thickness.


Duncan

Sphere♥
09-14-2007, 01:17 PM
Hi, perhaps you are not working on coins (as you mention this was just a test), but if you are, consider using Nima Physx, I did a test a while ago with hundreds of coins using Nima and it ran real-time: coin drop playblast (http://video.google.ca/videoplay?docid=7736675157639533157).

NEO^AMiGA
09-14-2007, 01:30 PM
Holy MOLY!!! WOW! But that is a HW/SW-solution...? Right?


Hi, perhaps you are not working on coins (as you mention this was just a test), but if you are, consider using Nima Physx, I did a test a while ago with hundreds of coins using Nima and it ran real-time: coin drop playblast (http://video.google.ca/videoplay?docid=7736675157639533157).

Sphere♥
09-14-2007, 01:37 PM
No, it's pure software and it's a free plugin!

stantang
09-14-2007, 01:42 PM
I want to add that you can bake the Physx simulation out for render. It's very fast for non-precise rigid body sim.

NEO^AMiGA
09-14-2007, 01:52 PM
Oh... I got the impression that I need a AGEIA PhysX card for it to work in realtime? But that is not the case then?

You say non precise animation? What I need to animate has to be precise in the meaning that I must have control over objects so I can key them to be rigid or not. I will take a look at this plugin. Looks great!

Sphere♥
09-14-2007, 02:10 PM
I don't think Nima even supports the PhysX card at this time... it is using the Ageia software physics engine, and it's just very fast and efficient.

I don't know what stantang means by "non-precise"? I find Nima precise, in fact it will hold up a lot better than Maya's rb solver, which will often just fail or give up under stress. Perhaps he means the way PhysX handles collisions, they are more like a hard spring collision, so there can be a minor degree of interpenetration (but it never fails like Maya rb solver's interpenetration errors), it looks very realistic to me. Just make sure your objects have realistic sizes and thickness, like don't use a 2D poly plane for a floor, use a block, or better yet, use a PhysX box primitive.

NEO^AMiGA
09-14-2007, 02:18 PM
I have started to test with it now. This is IMPRESSIVE! Though there ain't a 64bit version but at this speed I can live with two mayas installed. =)

To bad I started to test this 2 hours before the weekend. Now I will be glued infront of the computer all weekend! =) Have not looked at the documentation yet but I hope all commands are well described so it can be used in larget scripts. =)

I don't think Nima even supports the PhysX card at this time... it is using the Ageia software physics engine, and it's just very fast and efficient.

I don't know what stantang means by "non-precise"? I find Nima precise, in fact it will hold up a lot better than Maya's rb solver, which will often just fail or give up under stress. Perhaps he means the way PhysX handles collisions, they are more like a hard spring collision, so there can be a minor degree of interpenetration (but it never fails like Maya rb solver's interpenetration errors), it looks very realistic to me. Just make sure your objects have realistic sizes and thickness, like don't use a 2D poly plane for a floor, use a block, or better yet, use a PhysX box primitive.

Duncan
09-14-2007, 04:12 PM
I agree that you should be looking at dedicated rigid body solvers for this sort of thing. However for fun I created the following tutorial showing how nCloth can be used relatively efficiently for a large number of coins. A side benefit is that you can easily do things like bend or melt the coins. There is a file you can download and try out.
http://area.autodesk.com/blogs/blog/7/blogpost/5248/

Duncan

NEO^AMiGA
09-14-2007, 04:46 PM
WOW! Duncan... You are insane! And I mean that in a totaly good way. =))) Thanks a million. I will for sure take a closer look at that scene.

I agree that you should be looking at dedicated rigid body solvers for this sort of thing. However for fun I created the following tutorial showing how nCloth can be used relatively efficiently for a large number of coins. A side benefit is that you can easily do things like bend or melt the coins. There is a file you can download and try out.
http://area.autodesk.com/blogs/blog/7/blogpost/5248/

Duncan

Sphere♥
09-14-2007, 04:57 PM
[...]I created the following tutorial showing how nCloth can be used relatively efficiently for a large number of coins. A side benefit is that you can easily do things like bend or melt the coins.[...]Nice, thanks.

Als
09-15-2007, 04:55 PM
If you need thousands of coins, as I did, you might check this thread:

http://forums.cgsociety.org/showthread.php?p=4649912#post4649912

it will continue, how to bake it, when I get to it on monday...


Als

NEO^AMiGA
09-15-2007, 06:37 PM
Aaah... Cool. This is not as complicated as taht. But please, update your post there on your progress, Very interesting! Maybe also some playblast and so? =)

I'll hopefulle have something to show on my lil thingy later this week.

If you need thousands of coins, as I did, you might check this thread:

http://forums.cgsociety.org/showthread.php?p=4649912#post4649912

it will continue, how to bake it, when I get to it on monday...


Als

CGTalk Moderation
09-15-2007, 06:37 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.