Frayed Wallpaper Peeling Using nCloth, help

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

 
Thread Tools Search this Thread Display Modes
  03 March 2013
Frayed Wallpaper Peeling Using nCloth, help

Hi guys, im trying to recreate an effect using ncloth, but im kinda stuggling with it.
Heres the link: http://www.youtube.com/watch?v=_ELnEjFR81M
I've tried it two ways so far; using cut face tool to pre shatter the plane and have tried with animated maps to hold verts in place before the field arrives, but have had more success using Soup attribute transfer for glue strength per vertex. However i dont get the frayed edges this way.

The second way is using tearable surface constraint, however im applying it to the whole plane and it seems like there is a lot less control than pre shattering. And im struggling to immitate the fraying in the video, not sure what kind topology i should be using on the plane.
I can post results of either of these methods if it helps to see.
Thanks

Does anyone have any thoughts on how to achieve this effect?
 
  03 March 2013
I suppose it depends on exactly what you are after, but a simple technique would be to have no forces or gravity acting on a pre-shattered cloth then animate the position of a volume axis field so it encompasses the object. So for example it might be an upward force inside the volume axis field and you just move it so it intersects the parts you want to peel off.

The shattering could be done by selecting all the edges you wish to tear along then doing doing detach component before making the mesh cloth.

If you wanted to make it like something sticking to a surface that is peeling off then you could perhaps additionally collide with the original non-shattered mesh, making it a passive collider and on the nRigid node set the forceField to create a slight clinging force near the surface (keep fieldDistance small).



Another approach is to lock the cloth using inputAttract and then animate the inputAttract per vertex. This is a little tricky to do, but the following works:

1. Create a volumeAxis field affecting the cloth

2. Set inputAttract to 1.5 and set inputAttractMapType to Per-Vertex

3. Create a custom array attribute on the cloth (lets call it inputA):

addAttr -ln "inputA" -dt doubleArray nClothShape1;
setAttr -e-keyable true nClothShape1.inputA;

4. Set up a particle creation and runtime expression for the nCloth

dynExpression -s "inputA = 1;" -c nClothShape1;
dynExpression -s "if( inputForce[0] != 0 ){\n\tinputA = 0;\n}" -rbd nClothShape1;

One can use particle expressions in a limited fashion with nCloth, because it is derived from the particle class. These expressions set inputA to 1 at the start frame and zero when the field strength is not zero.

5. With a regular non-particle expression copy the array inputA to the inputAttractPerVertex array. We do this by connecting and disconnecting the attributes. We can't simply leave it connected or directly set the per vertex array inside the particle expression, as this leads to a dependency graph loop that blocks evaluation of the cloth.

expression -s "connectAttr nClothShape1.inputA nClothShape1.inputAttractPerVertex;\ndisconnectAtt r nClothShape1.inputA nClothShape1.inputAttractPerVertex;" -o pSphere1 -ae 1 -uc all ;

Once this is done the cloth will be locked to the input mesh position(even if it animates) until the volume axis field overlaps it, after which it is free to move with forces.
I've attached a simple scene showing this technique.

If you want to have smooth normals you could do a merge vertex followed by smooth normals on the output cloth mesh. (that's basically what the tearable constraint does)
Attached Files
File Type: zip clothInputAttractExpressionControl.zip (8.3 KB, 115 views)
 
  03 March 2013
Hi Duncan thanks for the response, Iv'e attempted to re-create your setup, but im having some trouble, i ran the lines you sent and everything connects giving me the two expressions
After running 4:
if( nClothShape1.inputForce[0] != 0 ){ 	nClothShape1.inputA = 0;

 }


And after running 5(I Changed the pSphere1 to to pPlane1):


connectAttr nClothShape1.inputA nClothShape1.inputAttractPerVertex;

 disconnectAtt r nClothShape1.inputA nClothShape1.inputAttractPerVertex;


However when simulating i get an execution error: 'nClothShape1.inputA' is already connected to 'nClothShape1.inputAttractPerVertex'.

I tried deleting the expressions on the scene you sent and re-running the code but i still get the execution error. I understand what the expressions are doing, but not why im getting this error, am i missing something?
 
  03 March 2013
Ha! there was an r offest from the 'disconnectAtt r' - syntax always the case!
So whats the best way of giving the ncloth that very ragged frayed look? I cant use terable surface constraint can i? - because all the pieces are shattered to begin with?
 
  03 March 2013
To make it more frayed: instead of detaching all vertices like my example you should select just the edges where you want it to tear and detach them. If necessary create more edges (subdivide faces along tear boundary ) if you need a finer tear.
 
  03 March 2013
I think thats what im currently doing, im using cut face to define where i want shatters to occur then selecting all edges and detaching, then smoothing to allow the mesh to curl and bend. But the edges that i have cut and detatched are just straight edges, how do i specify those edges for tearing when they are already detatched?
 
  03 March 2013
Originally Posted by Duncan: I suppose it depends on exactly what you are after, but a simple technique would be to have no forces or gravity acting on a pre-shattered cloth then animate the position of a volume axis field so it encompasses the object. So for example it might be an upward force inside the volume axis field and you just move it so it intersects the parts you want to peel off.

The shattering could be done by selecting all the edges you wish to tear along then doing doing detach component before making the mesh cloth.

If you wanted to make it like something sticking to a surface that is peeling off then you could perhaps additionally collide with the original non-shattered mesh, making it a passive collider and on the nRigid node set the forceField to create a slight clinging force near the surface (keep fieldDistance small).



Another approach is to lock the cloth using inputAttract and then animate the inputAttract per vertex. This is a little tricky to do, but the following works:

1. Create a volumeAxis field affecting the cloth

2. Set inputAttract to 1.5 and set inputAttractMapType to Per-Vertex

3. Create a custom array attribute on the cloth (lets call it inputA):

addAttr -ln "inputA" -dt doubleArray nClothShape1;
setAttr -e-keyable true nClothShape1.inputA;

4. Set up a particle creation and runtime expression for the nCloth

dynExpression -s "inputA = 1;" -c nClothShape1;
dynExpression -s "if( inputForce[0] != 0 ){\n\tinputA = 0;\n}" -rbd nClothShape1;

One can use particle expressions in a limited fashion with nCloth, because it is derived from the particle class. These expressions set inputA to 1 at the start frame and zero when the field strength is not zero.

5. With a regular non-particle expression copy the array inputA to the inputAttractPerVertex array. We do this by connecting and disconnecting the attributes. We can't simply leave it connected or directly set the per vertex array inside the particle expression, as this leads to a dependency graph loop that blocks evaluation of the cloth.

expression -s "connectAttr nClothShape1.inputA nClothShape1.inputAttractPerVertex;\ndisconnectAtt r nClothShape1.inputA nClothShape1.inputAttractPerVertex;" -o pSphere1 -ae 1 -uc all ;

Once this is done the cloth will be locked to the input mesh position(even if it animates) until the volume axis field overlaps it, after which it is free to move with forces.
I've attached a simple scene showing this technique.

If you want to have smooth normals you could do a merge vertex followed by smooth normals on the output cloth mesh. (that's basically what the tearable constraint does)


Dagnabit! Why didnt you post this years ago?!

Cheers for it now
__________________

.

Reel - 3DInk.com
Filmography -IMDB
R&D - VIMEO

*please read- cyanbsl.blogspot.com/*
 
  03 March 2013
Originally Posted by HowardM: Dagnabit! Why didnt you post this years ago?!

Cheers for it now


Hell Yeah... so right...its a bit like SouP.ing with bounding
object and getting initial Spin and dynamics on the shards...

How would that work when not using input attract but glue strength on
an nComponent Tearable Constraint ? or both of them input attract to bound
to the moving object and tearable glue strength to get nice fractured shards ?

the same procedure but connected to the nComponent gluestrength VertaxMap
Input ?
 
  03 March 2013
In that case i would have to create the tearable surface constraint on the input mesh after it has been made in to nCloth? and just forget about using the detatch tool before its nCloth because as you say those edges where it has been detatched are treated as a pre-split surface? is this right?
Would it be a better idea to create tearable surface around the cut edges, and then increase divisions, otherwise specifiying where tearing should occur would be kind of tricky due to all the divisions
 
  03 March 2013
Originally Posted by flares: In that case i would have to create the tearable surface constraint on the input mesh after it has been made in to nCloth? and just forget about using the detatch tool before its nCloth because as you say those edges where it has been detatched are treated as a pre-split surface? is this right?
Would it be a better idea to create tearable surface around the cut edges, and then increase divisions, otherwise specifiying where tearing should occur would be kind of tricky due to all the divisions


Ungh, Duncan, please removed Terrible Constraint from the arsenal, as we all know its pointless...

Never use it guys, its crap. Better workflow is to manually cut up your mesh or shatter it. Then make it cloth and use Weld Adjacent Borders... read up here, there are plenty of posts on the forum about it and how to do this.

Example - http://vimeo.com/16375110

As for specifying tearing, you can use ramps or textures on Input Mesh or Constraints, along with the method Duncan has shown you here to control what rips and where...
__________________

.

Reel - 3DInk.com
Filmography -IMDB
R&D - VIMEO

*please read- cyanbsl.blogspot.com/*
 
  12 December 2013
Originally Posted by Duncan: ....
Another approach is to lock the cloth using inputAttract and then animate the inputAttract per vertex. This is a little tricky to do, but the following works:

1. Create a volumeAxis field affecting the cloth

2. Set inputAttract to 1.5 and set inputAttractMapType to Per-Vertex

3. Create a custom array attribute on the cloth (lets call it inputA):

addAttr -ln "inputA" -dt doubleArray nClothShape1;
setAttr -e-keyable true nClothShape1.inputA;

4. Set up a particle creation and runtime expression for the nCloth

dynExpression -s "inputA = 1;" -c nClothShape1;
dynExpression -s "if( inputForce[0] != 0 ){\n\tinputA = 0;\n}" -rbd nClothShape1;

One can use particle expressions in a limited fashion with nCloth, because it is derived from the particle class. These expressions set inputA to 1 at the start frame and zero when the field strength is not zero.

5. With a regular non-particle expression copy the array inputA to the inputAttractPerVertex array. We do this by connecting and disconnecting the attributes. We can't simply leave it connected or directly set the per vertex array inside the particle expression, as this leads to a dependency graph loop that blocks evaluation of the cloth.

expression -s "connectAttr nClothShape1.inputA nClothShape1.inputAttractPerVertex;\ndisconnectAtt r nClothShape1.inputA nClothShape1.inputAttractPerVertex;" -o pSphere1 -ae 1 -uc all ;


How would one go about using this type of setup for nConstaints? Is it possible?
__________________

.

Reel - 3DInk.com
Filmography -IMDB
R&D - VIMEO

*please read- cyanbsl.blogspot.com/*
 
  12 December 2013
Yes. Instead of connecting and disconnecting the particle array attr from the inputAttractPerVertex, you could connect to strengthPerVertex on the nComponent node.

I think it may still have the same problem as inputAttract with a DG loop (but I've not tested it), so you would probably still have to connect then disconnect the attribute inside a normal (non-particle) expression to copy the array values. (rather than simply connecting once)
 
  12 December 2013
Cheers! I had tried something like that but it didnt seem to work. Will try again.

This is definitely something that should be documented and/or included as a feature.

Opens up a lot of control.
__________________

.

Reel - 3DInk.com
Filmography -IMDB
R&D - VIMEO

*please read- cyanbsl.blogspot.com/*
 
  12 December 2013
I cant seem to connect things correctly.

Do you mind explaining the process with nconstraints please?
I tried replacing nComponent2.glueStrengthMap or .strengthPerVertex where appropriate but I cant get it to work.

Thanks as always!
__________________

.

Reel - 3DInk.com
Filmography -IMDB
R&D - VIMEO

*please read- cyanbsl.blogspot.com/*
 
reply share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 10:51 PM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.