View Full Version : nCloth: Rest Shapes rock, but.... ;)
HowardM 11-12-2008, 09:56 AM OMG, love the power of Rest Shapes for adding wrinkles and details, or just having control over the cloth during sim times! Using Blend shapes to change Rest Shapes is a great way to go between different shapes for more control.
My only question and request is, can we have a setting more like Input Mesh Attract (with Weights too!) for control over how much the cloth wants to conform to the Rest Shape? Not really having total control by just tweaking Stretch, Compression, Bend, and Restitution Angle. Or is this already in nCloth and Im missing something?
I think adding this would make RS perfect!
Cheers guys! :)
|
|
Castius
11-12-2008, 06:24 PM
Welcome to attach to matching mesh constraint.
Set up as many mesh object you want to control your cloth. I setup control rigs with copies of the original nCloth mesh and then i can weight map where i want to influence the mesh. It allows you as many controlling influences mesh as you want. I almost always avoid the input mesh attrib and use these constrains. So i can always use the input attract if i decide to move the cache to the input mesh. Using animated ramp textures to drive constraints is awesome!
The only problem is there is a bug in nComponent. It will loose connection with the input into the nComponent node. Even though the connection is still there. So if you use texture or weight maps for drive constraints. On scene load you can loose your input sometimes. I have not been able to make a test scene to submit the bug. But the workaround is fairly easy. You just need to force an update to the nComponent node. It should work again after the update.
HowardM
11-13-2008, 08:22 AM
hehe, it just keeps getting better :)
thanks man!
HowardM
11-13-2008, 11:38 AM
Ah no wait, you basically explained how to use better methods than input mesh attract...which is cool, more control with Attract to Mesh Constraints.
But Im talking about Rest Shape! lol, dont start confusing me Scott! ;)
Input and Attract Constraints are great to match perfect vertex positions, but Rest Shape doesnt care where in space the verts are, and is a great way to just add some details such as wrinkles to a model anywhere in space... so I dont need to worry about a rigged model. So Id love something like Attatch to Mesh or Input Attract controls for Rest Shape... at moment there is only Stretch, Compress, Bend, etc...
A simple Rest Shape Strength would be nice...
Duncan
11-13-2008, 06:25 PM
The rest shape strength is essentially the bend/stretch/compression resistance. The rest shape sets the rest lengths used by the stretch/compression computations and the bend angles used by the bend resistance. You might prefer something like the rigidity attribute, although currently rigidity is relative to the start shape, rather than the current rest shape. Also note that to be more rigid in terms of the rest shape one needs not only high bend/stretch/compression resistance, but also high substeps.
We could add an attribute that multiplies the bend/stretch/compression values, but my feeling is that we should only add new attributes when they bring a new functionality(given how many there already are).
Duncan
HowardM
11-13-2008, 08:23 PM
Thanks for joining in Duncan ;)
Well as always, more control even if too much, is always better ;)
Would be nice to be able to set Stretch, Compress, Bend to something that works well with the overall cloth, and then use a multiplier to make the cloth try to conform to the Rest Shape... but I can understand how that may not be possible based on the way it works.
I just like how you can make a mesh try to form to another mesh without worrying about where its vertices are in space like with Input Attract or Mesh Attract.
Seems to me a nice way to be able to sculpt or mold the cloth while its simming compared to Input...
Perhaps I just dont know enough about the other Constraints or Methods, coming from Syflex which is much more simple. Any chance of a tips and tricks writeup for nCloth?
Castius! Get on those tutorial DVDs! :)
Duncan
11-13-2008, 09:05 PM
If you really want that control then just add 4 custom attributes to your cloth node:
myStretch
myCompression
myBend
myMultiplier (or whatever)
(they will appear under extra attributes)
Then in an expression:
float $m = nClothShape.myMultiplier;
nClothShape.stretchResistance = nClothShape.myStretch * $m;
nClothShape.compressionResistance = nClothShape.myCompression * $m;
nClothShape.bendResistance = nClothShape.myBend * $m;
You then set your stretch/bend/compression as you like on your custom attribute instead of the normal ones then adjust the multiplier to scale the degree it tries to achieve the rest shape.
(frankly I would just key the 3 values myself)
Duncan
HowardM
11-13-2008, 10:50 PM
Nice one!
I guess what I was getting at and hoping, but obviously based on the way rest shape works it wont work, is that we could have settings for S, C, and B that were set, so the cloth reacted a certain way, then we could use a Rest Shape Strength of some sort to simply make the cloth try to conform to the RS, just like Input Mesh, without having to worry where the verts were in space, and without changing the way the cloth reacts.
So again am I missing something with maybe a constraint or some other way to do this?
Input Attract without having to go exactly where the verts are. The ability to shape the cloth while its simming and moving, without making it move to a certain place...
Duncan
11-14-2008, 04:10 PM
With the rest shape you should be able to do what you want by increasing the stretch/bend/compression resistance, although you may also need more collide iterations or substeps. The problem is that for a dense mesh the values required to make it really stiff might be very high and long solve times. The other problem is that if the rest shape is quite different from the current one that folding into that shape may not be possible... parts might have to scrunch and compress or turn inside out to get to the other state( for example a shirt sleeve pushed inside out ). In some of these cases it might help to use a little pressure if the cloth represents a closed object( like inflating a rubber glove where some of the fingers are inside out).
By contrast the attributes deform resistance, rigidity and input attract work globally rather than locally, so they can pull the cvs into position with fewer iterations. Rigidity might do what you want if the shape we used for the rigidity were to update each frame to the current rest position. There have been many occasions when I've wanted that ability. Perhaps at some point we might add a toggle "useRestForRigidity"( figuring out a naming and UI that people can understand can be as hard as coding the feature in some cases )
Duncan
Duncan
11-14-2008, 04:23 PM
You might be able to get close to what you want with constraints, but the workflow would be tedious. One could create a component to component constraint between the cloth and a restShape that has been turned into a cloth(turn off collisions and enble ignoreGravity on this second cloth). The rest shape cloth would have high rigidity. Initially the weight attributes on the two component nodes for the constraint would be set such that the rest shape cloth is pulled by, but does not pull on the cloth (0,1). When you want the cloth to deform to the rest shape you could key the weight attributes... either to (1,1) or (1,0).
However you should first investigate the workflow where your input mesh is animated where you want it, such that input attract will do what you want. For example one can keyframe the position of the cloth node to be in the location you wish it to be in. This will not affect the motion of the cloth normally, but will affect the location of the input mesh. In a similar fashion for cloth the typical workflow is to do the bind skin on clothing meshes before making them cloth. In this fashion one can attract the cloth to poses using input attract.
Duncan
HowardM
11-17-2008, 09:18 AM
thanks again duncan!
i am already using input mesh attract with skinned/bind input mesh for clothing, so my cloth follows the overall movement of the skinned cloth, etc.
im even making blendshapes for the input mesh (as some of the cloth needs to match a backplate wrinkle for wrinkle (hell!)) but what Ive been talking about in this Thread is using Rest Shapes to add wrinkles or deform the cloth, but again not having to worry if its skinned or binded to the rig or where it is in world space. because I would like to be able to add a few details such as a wrinkle here or there, but I dont want the cloth to match it perfectly, in that position, etc. I want the cloth to move about as it would normally, but want to add some wrinkles in general on the arm.
so, yes I can take a shirt, which isnt skinned, out in space anywhere, buldge it, wrinkle it, etc and then tell my cloth, while simming to try to wrinkle or look like the Rest shape but not its position. its convientient in regards to not having to bind it, wrap it, etc to the input mesh to follow the skeleton.
what is not convienient (and my reason for this thread) is the way to control it.
tweaking stretch, compression and bend resistance will change the overall settings of the cloth, so lets say - ive got them set to 40,20,1 respectively, and the cloth sims fine, looks like the material its suppose to be. but now i want to make it wrinkle in certain places, based on a rest shape, well to get that, i now have to jack up the settings to 100,100,10 or whatever it takes to change those 3 settings to get it to conform... but now the cloth doesnt act or feel like the original material, because something like Stretch is stronger or lower than the original material before Rest Shaping. so what i was hoping is, some way to leave the resistance settings alone, yet have a Rest Shape Strength attribute to attract the mesh to the RS, just like Input Attract but again without worrying about cv space.
but again from the way you are saying Rest Shapes work, it seems like you MUST tweak the Resitances for it to work, so maybe my thinking of how to use this is wrong.
I guess the bottom line question is, Is there a way to do something like an Input Mesh Attract but more like Rest Shape, where you dont need to have the cloth match it perfectly in space, but just adds details from the Rest Shape to the Output Mesh, and doesnt change the Stretch, Compress, etc?
LOL, sorry for the long winded explanaition....
Cheers!
Duncan
11-17-2008, 08:44 PM
If you want to attract to a particular wrinkled state then in general you will need a fair bit of bend/stretch resistance. It sounds like you really want the local stiffness as opposed the global one, because your shape will be significantly deformed at the points you wish to add the local wrinkling. One thing that might help is if the rest shape is at least close to the current shape(shape not position). Where it wrinkles it will have an easier time matching the wrinkles on the rest shape if the collisions with the mesh are not deforming it too much from the wrinkled rest shape. As long as you have lots of stretch/compression resistance then a little bend resistance might go a long way. Normal cloth wrinkles are more a product of the lack of stretch/compression on the cloth. The rest shape sets both the rest length and bend angles for the cloth. When you make the rest shape more wrinkled you are essentially adding more cloth and increasing the rest lengths, which will force it to wrinkle even without bend resistance( although a little bend can help persuade it to bend in the direction you want ). Of course it will also help if your wrinkles are realistic for the current shape. As cloth is normally not very stretchy having high stretch/compression should generally only improve your simulation behavior. Perhaps you could just momentarily key the bend up when needed to better hit a rest pose. One other thing you could do is just paint bend stiffness in the areas you most need it.
Duncan
CGTalk Moderation
11-17-2008, 08:44 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.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.