Maya Scripting

Maya Scripting

Scripting

To use Unwrella through MEL scripting in Autodesk Maya, use the command:

unwrella

Some previously available properties have been deprecated to simplify the plug-in. These properties can still be used for backwards compatibility and will not cause an error, but they no longer affect the plug-in operation.


Flags

The following flags can be used with the unwrella command to control the unwrap process.


Destination UV Set

-mapchannel (-mc) : string

Destination UV set. This is where the generated UV map will be stored.


Unwrap Type

-unwrap_type (-t) : int

Unwrap type used by Unwrella:

  • 0 — Standard unwrap type optimized for organic shapes
  • 1 — Unwrap type for hard-surface shapes
  • 2 — Pack existing UV data without unwrapping
  • 3 — Projection unwrap for directional area optimization

Stretch

-stretch (-st) : float

The amount of stretching allowed.

  • 0.0 means no stretching is allowed
  • 1.0 means any amount of stretching can be used

Padding

-padding (-pad) : int

Distance between charts in the texture.


Width

-width (-w) : int

Texture width of the UV and the baked map.


Height

-height (-h) : int

Texture height of the UV and the baked map.


Keep Seams

-keep_seams (-ks) : boolean

If True, the unwrapping process retains already existing borders as long as the given constraints allow.

If False, all existing borders are discarded and Unwrella places new borders automatically.


Use Grooves

-use_grooves (-ug) : boolean

If True, the unwrapping process automatically adds borders to edges at grooves between mesh faces.


Groove Angle

-groove_angle (-ga) : float

Defines the angle used for automatic groove borders.


Use Ridges

-use_ridges (-ur) : boolean

If True, the unwrapping process automatically adds borders to edges at ridges between mesh faces.


Ridge Angle

-ridge_angle (-ra) : float

Defines the angle used for automatic ridge borders.


Pack Mode

-pack_mode (-p) : int

Specifies the packing engine used:

  • 0 — Classic
  • 1 — Efficient
  • 2 — High Quality

Rescale

-rescale (-re) : boolean

If True, the individual charts are rescaled depending on the amount of mesh surface they cover.


Pre-Rotate

-pre_rotate (-pr) : boolean

Determines if each chart should be individually rotated into an optimized base rotation.


Rotation

-rotation (-ro) : int

Defines the angle steps that each chart gets rotated by.

The values 0 to 3 correspond to the buttons in the user interface.


Full Rotation

-full_rotation (-fr) : boolean

If True, counterparts for each rotation step that are rotated by 180 degrees will be considered.


Tile Number X

-tile_numx (-tx) : int

The number of horizontal tiles along the U coordinate.


Tile Number Y

-tile_numy (-ty) : int

The maximum number of tiles to be used. If more charts exist, they will be grouped together automatically.


Camera

-camera (-c) : string

The camera used to determine view location and direction.


Camera Angle

-cam_angle (-ca) : float

The view angle of the camera object.


Camera Extend

-cam_extend (-ce) : float

The tolerance angle for which backfacing polygons are included in the projection unwrap.


Camera Orthographic

-cam_ortho (-co) : boolean

When set to True, an orthogonal projection is used, ignoring the view angle.


Example Script

This example creates a sphere and unwraps it with a very small amount of stretching.

polySphere -r 10;
unwrella -st 0.01 -pad 1 -w 1000 -h 1000;