Forum
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

Carbon For Maya - Getting only the Cloth Output Mesh under a transform 7 months 2 weeks ago #940

  • Sebastian
  • Sebastian's Avatar Topic Author
  • Offline
  • Administrator
  • Administrator
  • Posts: 172
  • Thank you received: 39
In some cases, you might want to further process or export a Carbon Cloth Output Mesh, but you do not want the Start Mesh under the same transform.
Deleting the Start Mesh from under the transform will invalidate the simulation, so we need to follow another approach.

There are a few steps to this:
  1. First, select the transform of the cloth mesh (not the Cloth Output Mesh under the transform), e.g. pPlane1.
  2. Then, press Ctrl + D on your keyboard. This duplicates the geometry.
  3. Now, delete the duplicated Start Mesh from under the new transform.
  4. Lastly, connect the Output Mesh plug from the Carbon Cloth node to the In Mesh plug of the duplicated Cloth Output Mesh.
You can then hide the original transform / meshes.

Since these are just a few well defined steps, you can also script this.

Here is the mel script:
First select the transform of the cloth mesh (not the Cloth Output Mesh under the transform), e.g. pPlane1.
Then run:

// Get selection
string $selection = `ls -sl`;
string $selChildren = `listRelatives -children $selection[0]`;
// Get Cloth Output Mesh
string $clothOutput = `listConnections -d off -p true ($selChildren[1] + ".inMesh")`;
// Duplicate selection
string $newOutput = `duplicate -rr`;
string $children = `listRelatives -children $newOutput[0]`;
// Delete static start mesh
delete $children[0];
// Connect to cloth output mesh.
connectAttr -f $clothOutput[0] ($children[1] + ".inMesh");

Please Log in or Create an account to join the conversation.

Last edit: by Sebastian.
  • Page:
  • 1
Time to create page: 0.062 seconds