Cloth Creator Plugin for Maya (Using Python)

I coded a plugin/shelf tool that allows the user create tablecloth, curtain and ribbon bows more easily.

It creates a Maya nCloth with the setup of being tablecloth, curtains or as ribbon bows. If the user chooses to create a tablecloth, it also has the option to automatically set the tablecloth on a makeshift table or selecting an object as the table. The cloth could be elliptic or rectangular, and the user inputs the length and width they wish the cloth to be. If creating a curtain, the plugin provides the option to tie the curtain, and if so, then the added option of tying it with a bow.

It also gives the user the option to apply a material, with the options of cotton, velvet, satin, plaid, and a fun material (which is iridescent). These materials could be applied to any of the cloth options, tablecloth, curtain or ribbon bow and no add-ons are used. The materials are created solely with default Maya nodes.

Renders with the material applied (and manually added lights to scene):

materials showcase

The plaid material utilizes layers of nodes with a combination of color ramps based on the color the user picks. A complementing color is created using that saturation, a value of 1, and a hue that is the main color + 50. A lighter color based on the main color is created with the hue remaining the same, saturation decreased from the original hue by 0.2 and a value that the increased by 0.4 from the original value. A varying color is selected at random by selecting a random green and random blue value. This system has proven to produce colors that work in harmony with the plaid pattern with the plaid pattern made up of that main color, the complement, the lighter color, and the random color. Shown in the image below are examples. The first color is the main color the user picks, the first and second tablecloth use the same main color, while the third and fourth tablecloth share the same color. With the addition of the random color, the plugin can produce more unique results.

plaid

Code here: https://github.com/raefu22/clothCreator