documentation: Weaver


CONTENTS

Install & Tutorial

1.0 Instructions
    1.1 Invoking Weaver
    1.2 Command Parameters
2.0 Notes
    2.1 Multiple Weaves
    2.2 Pattern Samples
    2.3 Documentation

Terms & Conventions

3.0 Weaver Definitions
   3.1 UV
   3.2 Strand
   3.3 Pattern
   3.4 Weave



INSTALL & TUTORIAL

1.0 Instructions

1.1 Invoking Weaver
  1. Locate the file "weaver.mel".
  2. Start Maya.
  3. Create any surface or surfaces you would like to apply a weave to.
  4. Create any profiles you would like to use to sweep along the strands of the weave. Any profiles you create should be closed curves. If you do not want any extrusion, just curves on a surface, you can skip this step. Set up a second layer and make active for weave.
  5. Select menu item "Windows->General Editors->Script editor..."
  6. Modify "weaver.mel" in Notepad or any text editor according to the explanations above and the instructions included in the file itself.
  7. Save "weaver.mel"
  8. Select "File->Source script..." from the "Script Editor" menus.
  9. Find and open "weaver.mel"
  10. Invoke weaver with the following parameters:

    weavePattern "surfaceName" UGrid VGrid $UPattern $VPattern "sweepCurve"

    You may do so by typing the command into the Script Editor, then hitting the Enter key in the numerical keypad. Make sure you have specified 2 strands U and V.



1.2 Command Parameters
    weavePattern "surfaceName" UGrid VGrid $UPattern $VPattern "sweepCurve"

   
"surfaceName" the name of the surface to be woven onto
UGrid the number of cells to divide the surface into in the U direction
VGrid the number of cells to divide the surface into in the V direction
$UPattern the name of the pattern to use in the U direction
$VPattern the name of the pattern to use in the V direction
"sweepCurve" the name of the curve to use as a sweep profile ("" for no sweep)


2.0 Notes

2.1 Multiple Weaves
    You can weave more than once onto the same surface. Changes made to the surface and the sweep profile after the weave has been run will be automatically updated. Putting the surface on one layer and weaving with another layer active will enable you to hide the original surface easily and keep the weave visible.

2.2 Pattern Samples
  • $StraightPattern
  • $CrossPattern
  • $UpPattern
  • $DownPattern


2.3 Documentation
    Weaver is script written in Maya's internal scripting language MEL. In order to use the basic functionality of Weaver, it is not necessary to edit the MEL script. If you would like to experiment further, it will be necessary to open the script file and edit it.




TERMS & CONVENTIONS

3.0 Weaver Definitions

3.1 UV
    Any surface you create in Maya, be it a deformed plane, a tube, or a cone is parameterized in two dimensions, which Maya labels U and V. It is somewhat arbitrary which direction is U and which is V. It is just as well to discover this by experimentation. Grid: In order to make discrete points on this UV map, Weaver places down a regular grid on top of it. Imagine a warped checkerboard. You will be asked to specify the granularity of this grid in order to run Weaver. Know that the higher the number of grid points, the tighter your weave will be and the smaller any strand-curving features will appear. You can specify different grid granularity for U and V. (Try starting with 15 x 15.)

3.2 Strand
    A strand is a collection of information that determines a path across a grid. A strand begins at one edge of the surface and follows rules in a cycle until it reaches the other side (or hits the top or bottom of the surface and stops). When a strand is woven, it must be woven in either the U or V direction. The meaning of the strand definition is based on the direction of the weave. For the remainder of this explanation we'll assume we're weaving in the U direction. (Everything is the same for the V direction, just swap the letters U and V.) Strands are specified in MEL with lines such as this:"$WiggleStrand = {0, 1, -1}; " Interpret this line as follows: We are creating a new kind of strand called "WiggleStrand". All variables in MEL must be preceded by a dollar sign, so we oblige. We then set the variable $WiggleStrand equal to the list 0, 1, -1. The first number in the specification of any strand is an offset into the V grid (Since we are weaving in the U direction). This value will be overwritten by the patterning process, so it is not important to deal with it here. Set it to zero. The rest of the numbers are a list of offsets that will be applied cyclically. As the weave proceeds across the U direction, one grid node at a time, the V value is changed by the amount of this number. Since there are two numbers here, 1 and -1, they will be applied alternately: Step up one in U, step up 1 in V; step up one in U, step down one in V. This creates the wiggling, characteristic of the "WiggleStrand." There can be any number of values, creating whatever periodicity you require.

3.3 Pattern
    A pattern is a collection of information that determines how strands will be aggregated. A pattern specification looks like this: $FakePattern = {"$DownStrand", "1", "0", "$UpStrand", "2", "1"}; The values in a pattern come in sets of three. For the purposes of this explanation, assume we are still weaving in the U direction. Each set of three values represents a repetition of a strand type. The first value is the name of the strand. The second value is the interval of repetition. Since we have specified "1" here, the pattern will weave a DownStrand starting at every V offset. Specifying "2" would weave one at every other offset. The final value in the set of three is the starting offset for the repetition. So these values can be read to say "A Downstrand, every 1 V offset, starting at V=0; an UpStrand every 2 V offsets, starting at V=1;" This way you can aggregate any number of strands in any pattern of repetition into a single pattern.

3.4 Weave
    Since a pattern still indicates a weave only along one axis (U or V), to weave both directions, we must specify two patterns. A weave is just a collection of two patterns, one for U, one for V. Frequently we use the same pattern for both directions, but that is not required.




home   |   media   |   files : documentation