Edit Guides Operator 

Edit Guides shape gives you the ability to tweak the hair guides by hand. You can plant new guides, delete guides, change their shape in various ways, brush them, and perform other operations which are done by hand instead of parametrically.

This operator is broken down into three main sections (or levels) of guide editing. Using these three methods together should allow you to produce any arbitrary hair volume shape, which can then be fine-tuned using hair state modifiers.

 

Getting started 

Select your hair shape and show the hair stack. Use Ornatrix shelf to find the Edit Guides operator button. Click this button to add the Edit Guides operator at the current position of the hair operator stack.

 

General parameters 

These parameters are present in all editing modes or if no editing mode is selected. In other words, they are always displayed in the Attribute Editor.

 

Edit Guides 

 

Three edit mode buttons 

These buttons will set the operator into its Strand, Control Point, or Brushing mode. In each editing mode you will have different ways to interact with and modify the strands.

 

Apply Amount 

In the Edit Guides section you will find the Amount parameters. Those parameter will blend the changes made by the current Edit Guides operator using a slider, a ramp curve or a texture map. It can be used to dial the changes down and can be animated to achieve blending effects or isolate the changes to a particular Strand Channel. Multiple Edit Guides operators can be stacked on top of each other for strand change layering.

 

Re-target Changes 

Normally, if the amount of guides is changed by inserting, deleting them or changing the guide interpolation the changes made in Edit Guides will be destroyed. You can mitigate that by using the Re-Target function after you made those changes. Ornatrix will try to blend the new guides with the rest, preserving any existing Strand Groups in the process.

 

Selection 

When using the selection tool, the amount of selected guides will be shown under the Edit Guides section.

 

Skip Hair Update While Dragging 

When on, only guide edits will be displayed while mouse is down and hair will be updated only when mouse is released. Use this option to speed up guide editing for very dense hair.

 

Guide Options 

This section contains several options related to guide visualization and interaction:

 

Ignore Back-facing Strands 

When on, any guides which are facing away from viewport camera will not be selectable or affected by the brushes.

 

Show Vertex Ticks 

When ON, points making up the guides will be displayed.

 

Show Color Guides 

When on, a different color is assigned to each guide based on the strand groups previously created.

 

Guides Width 

This parameter is used to change the width of the guides for better visualization.

 

Import Curves 

Use this section to import curves into the current hair object.

 

Import Multiple 

Opens up a list with all the curve objects in the scene, then you can select and import groups of curves to use as guides in the current hair object.

 

Distance Threshold 

If imported curves are further than this value from existing guides they will be added as new guides. Otherwise, existing guides will be updated will their shape.

 

Custom Point Count 

When ON, imported curves will have a specific number of points, otherwise they will have the same number of points as the rest of the existing guides.

 

Root editing mode 

 

Guide Operations 

This section include some functions for guide management:

 

Hide 

This button will hide the selected guides.

 

Unhide All 

Use this button to reveal the hidden guides.

 

Freeze 

This function is very useful when dealing with a lot of guides and you want to isolate which guides are affected by the brush tools without selecting or hiding them every time.

 

Unfreeze All 

Used to Unfreeze all guides after you are done editing.

 

Push Away From Mesh 

Used to prevent guide intersection with surface.

 

Adopt From Stack Top 

Captures the current guide shape from the top of the stack into this modifier. Guides will be edited to look like current modifier stack result.

 

Planting new roots 

You can use the Plant Guide Tool to add additional guides to your hair object. After clicking it, click on top of the distribution mesh surface to plant new roots at these locations.

To exit root planting switch to Maya's selection mode by pressing the Q button. Note that the options for this tool are available in Maya's tool settings dialog

 

Adopt shape 

When this option is on newly planted guides will use the same shape as the closest guide to the location where mouse was clicked.
The closest strands will only be looked up from current strand selection. For example, if only one strand is selected then its shape will always be copied for the newly planted strands. If you want to always have the closest strand shape used then select all strands before planting new strands.

Newly created strands are not selected by default.

 

Guide length 

When Adopt shape option is off newly planted guides will be straight. This option controls the length of newly planted guides.

 

Additional Information 

  • Any strand data such as strand channels and strand groups will be inherited from the source strand into the planted strand when Adopt Shape option is used.
  • The unique strand id for the planted strands will be generated based on the surface dependency information (mesh face index and barycentric coordinate)
 

Rotate Strands 

Allows you to manually rotate a strand or a group of strands.

 

Deleting roots 

To remove guides from your groom first select them inside the viewport and then press the Delete Selected Strands button. Using keyboard Delete button will not work because Ornatrix has a custom way of handling element deletion in shapes. Therefore, you need to use this button instead.

 

Strand Groups 

In the Strand Groups roll out you can quickly create and assign groups to the hair guides. Strand groups allow you to sort your strands into distinct regions which can then be used to selectively apply operators down the evaluation pipeline.

Select some guides and press the Assign Unique button, a new Strand Group will be created and identified with a color and a number starting from 0. You can also assign or select a particular strand value by selecting a value in the Strand Group slider and pressing Assign or Select. A Group Channel is automatically created and this groups will be passed to other operators in the hair stack, including other Edit Guides operators. Use the "Select By Group" option to select the group to which the selected guide belongs.

 

Focusing on selected roots 

If you have one or more hair strands selected press F button at any time to focus the view on their roots.

 

Control Point mode 

Use the middle icon in the main Edit Guides rollout to switch to control point mode. Here you can select and drag control points, originally placed at strand tips, to modify the shape of the strands. You can move control points along the strands and also change the influence of control points over the length of the strands.

 

Focusing on selected control points 

If you have one or more hair strands selected press F button at any time to focus the view on their control points.

 

Brushing 

Brushing allows you to modify multiple guides at the same time in an intuitive paint-like manner. Various operations are performed this way such as combing the hair, cutting it, and painting its channels.

To enter brush mode select the Edit Guides operator in the hair stack. In the attribute editor use the brush button to enter the brushing mode. Then select the brush you want and move your mouse over to the viewport area. Brushing is then done by clicking and dragging inside the viewport.

 

Brush Types 

You can choose between three brush types that give you a different feel and control over the brush. Use a brush with a Circular or Rectangular shape for general editing, or use the Line Brush type to brush or edit the hair in a straight line.

In the next example the Cut brush is used in combination with the Line Brush type to cut the guides in a straight line:

 

Changing brush size 

The size of the brush determines the guides which this brush will affect. Only those guides inside the radius of the brush as displayed inside the viewport will be affected.

There are two ways to change the size of the brush:
  1. While mouse is inside a viewport, hold down B button, click and drag the mouse cursor. This is the standard way in Maya to change brush sizes.
  2. Inside the Maya attribute editor there is a brush size slider. Use it to change the brush size.
 

Changing brush strength 

The strength of the brush determines the amount of the effect brush has on the guides. The stronger the setting the more effect the brush will have.

There are two ways to change the strength of the brush
  1. While mouse is inside a viewport, hold down M button, click and drag the mouse cursor. This is the standard way in Maya to change brush strength.
  2. Inside the Maya attribute editor there is a strength slider. Use it to change the brush strength.
 

Mirror Brush Changes 

As the name said, when this checkbox is active the changes made in one side of the hair will be reflected in the oposite side in real-time. This feature works the same with all the brush types. This is very useful when you need a symmetrical hair or fur.

You can change the symmetry axis to X, Y and Z Using the Brush Mirror Axis roll-out.

 

Mirror Brush in World Space 

When on brush mirroring will be done in world space, otherwise it will be local to the object

 

Brush Max/Min Limiter 

Use the Brush Max/Min Limiter parameters to determine the maximum and minimum length applied to the guides by the length brush. This allows for a more precise control over the guide length.

 

Keyboard shortcuts for brushes 

You can switch quickly between brushes using the keys Ctrl+[0-9,-]

When Ctrl+0 is the Selection Brush and Ctrl+(-) is the Pull Brush.

 

Using Selection Brush 

When using Selection Brush (Ctrl+0) simply left-clicking and dragging inside the viewport will select only those strands which intersect the brush region. Selection is always replaced when you create a new stroke.

 

Add and remove brush selection 

  • To add strands to existing selection hold down Ctrl+Shift keys during a brush stroke.
  • To remove strands from existing selection hold down Ctrl key during a brush stroke.
 

Using tablet pressure when brushing 

If you use a touch display or a tablet as an input device you can use this device's pressure to control brush strength. To enable this, check the Use Tablet Pressure option in global Brushes settings rollout available in the Attribute Editor. This option is on by default.

 

Brushing along surface 

There are two ways a brush in Ornatrix can be used:
  1. To brush in current screen space (default), where your strokes will modify the hair strands in the screen direction
  2. To brush along surface, where the brush strokes are projected onto the distribution surface. This mode can be used to constrain the brushing changes to make hair or fur flow along the character's mesh surface.

To enable surface brushing hold down Ctrl key. You can also permanently enable surface brushing with Use Surface Brush option (see below).

 

Brushing options 

 

Use Surface Brush 

When this option is on brushing along mesh surface will be on by default. Holding Ctrl when this option is on will switch to screen-space brushing.

 

Use Tablet Pressure 

This option will enable or disable pressure from screen or tablet, if your hardware supports it.

 

Affect Selected Only 

When on, only currently selected strands will be modified during brushing

 

Affect by Roots Only 

When on, only those hairs whose roots are inside the brush region will be affected

 

Preserve Strand Length 

When on, strands will not be stretched or compressed during brushing

 

Optimize Strand Geometry 

When on, a special algorithm is used for comb, grab, and smooth brushes which affects the whole strand alone its length by calculating the best fit to current stroke while minimizing changes to the strand shapes.

 

Resample Strands 

When on the points on strands will be re-positioned to be equidistant after each brush stroke. This can be useful to retain strands smoothness.

 

Preventing guides intersection with surface 

It is generally desirable for guides not to penetrate the surface from which they are originating. However, during editing it is easily possible for such intersections to happen, especially if many guides are edited en-masse. Use the Push away from mesh button in the attribute editor to solve this problem, the Auto option will perform this action automatically at every brush stroke. A separate parameter to the right of this button allows you to control the distance at which the guides should be away from the mesh. You can use this option many times throughout editing and you can undo its effects.

 

Managing guide channels 


Guide channels tutorial

Guide channels in Ornatrix are special per-strand or per-vertex attributes which you can add to a guides shape. These attributes will flow up the evaluation pipeline with the guides and, eventually, into the hair as well. These attributes can control various parameters in Ornatrix operators. For example, they can drive the length of the guides, or specify the magnitude used for curling. You can define as many guide channels as you need and reference them by name.

You can manage the guide channels in an Edit Guides shape by expanding the Channels rollout.
  • To add a new channel click the Add button and name the channel
  • To remove a channel select it from the list and click the Delete button
  • To rename a channel select it from the list and click the Rename button

When a new channel is created all strands get assigned a value of 0 for that channel. You can set a channel value for specific strands by selecting them in root mode, selecting the channel in the list, and then using the Channel Value slider to set their value. You can also use the Set Value button alternatively.

When you have created a channel you can see it in the Channel drop-downs for parameters in various Ornatrix operators. Select the channel you created from the drop-down to assign it to said parameter.

 

Per-Strand and Per-Vertex channels 

The guide channel list in Edit Guides operator will contain both per-strand and per-vertex channels within it. Each list is preceded by either a ---Per-Strand Channels--- or ---Per-Vertex Channels--- line. For example, a channel list can look something like this:

---Per-Strand Channels---
Selection
StrandChannel1
---Per-Vertex Channels---
VertexChannel1

In this case Selection and StrandChannel1 are per-strand channels and VertexChannel1 is a per-vertex channel.

To add a new per-vertex channel select an existing per-vertex channel or the ---Per-Vertex Channels--- item before clicking on the Add button.

 

Ensuring consistent results 

Edit Guides operator works by referencing individual guides in your hair structure by their internal index. As such, it is important that once you perform edits with Edit Guides the count and order of input guides below in the operator stack remains the same.

The following could change guide count and order and cause your guide edits to become invalid:

It is therefore a good practice to use the "remember root positions" option prior to making changes in the Edit Guides operator,

 

Scripting 

 

MEL access 

Use these functions to work with an instance of an Edit Guides shape:

// Prompts a dialog to add a new guide channel to specified guides shape
global proc OxAddRootChannel( string $attributeName );

// Deletes currently selected guides channel from specified guides shape
global proc OxDeleteRootChannel( string $attributeName );

// Prompts a dialog to rename selected guide channel in specified guides shape
global proc OxRenameRootChannel( string $attrName );

// Sets value for selected guide channel and currently selected guides
global proc OxSetSelectedRootChannelValues( string $attrName, float $value );

// Prompts a dialog to set values of selected guide channel in specified guides shape
global proc OxSetRootChannelValues( string $attrName );

// Deselects all guide channels
global proc OxDeselectRootChannel( string $nodeName );
 

OxEditGuides command 

OxEditGuides MEL command can be used to perform various operations on a selected instance of EditGuidesShape in the scene. The command accepts one or more flags, which determine how the command edits the selected shape. The detailed syntax of the command is as follows:

OxEditGuides [-flag(s)]

 

Command flags 

  • -help
    Prints a message containing the information found below
  • -init (-initialize) [int guideCount] [int perStrandChannelCount]
    Initializes the change "delta" with specified guide and strand channel count. This is optional.
  • -eg (-edit) [int shapeChangeCount] For each change: [int strandId] [int pointCount] For each point: [Vector3 point]
    Records a change to one or more guide shapes in form of an array of points
  • -eg2 (-edit2) [int shapeChangeCount] For each change: [int strandId] [int meshSurfaceFaceIndex] [Vector3 meshSurfaceBarycentricCoordinate] [int pointCount] For each point: [Vector3 point]
    Records a change to one or more guide shapes in form of an array of points, at specified mesh surface coordinates. This separate function is needed to account for orientation of the strand during editing. This ensures subsequent edits will respect the same surface orientation.
  • -crc (-createRootChannels) [int count] For each: [string channelName]
    Creates one or more per-strand channels with specified names
  • -drc (-deleteRootChannels) [int channelCount] For each: [int onFlag]
    Deletes all per-strand channels which have the on flag set
  • -rcd (-changeRootChannelData) [int channelCount] [int strandCount] For each channel: For each strand: [float value]
    Modifies per-strand channel data for all strands
  • -rcn (-renameRootChannels) [int channelCount] For each: [int channelIndex] [string newChannelName]
    Renames specified per-strand channels to specified new names
  • -cvc (-createVertexChannels) [int count] For each: [string channelName]
    Creates one or more per-vertex channels with specified names
  • -rvc (-renameVertexChannels) [int channelCount] For each: [int channelIndex] [string newChannelName]
    Renames specified per-vertex channels to specified new names
  • -dvc (-deleteVertexChannels) [int channelCount] For each: [int onFlag]
    Deletes all per-vertex channels which have the on flag set
  • -cg (-createGuides) [int count] For each: [int meshFaceIndex] [int firstVertexIndex] [int pointCount] [Vector3 meshBarycentricCoordinate]
    Adds one or more new guides to specified surface position, using specified vertices. New vertices can be added prior to this command or existing vertices can be reused.
  • -cv (-createVertices) [int count] For each: [Vector3 position]
    Appends specified vertices to the strands vertex array. These can be used in conjunction with -createGuides flag to add new strands.
  • -rm (-modifyRoots) [int count] For each: [int guideId] [bool isFaceIndexChanged] ([int faceIndex]) [bool isBarycentricCoordinateChanged] ([Vector3 barycentricCoordinate])
    Changes the surface coordinate for one or more strand roots. Whether face index or barycentric coordinates has been changed needs to be specified. If they are not changed then their new values don't need to be specified.
    Examples:
    OxEditGuides -rm 1 0 1 0.3 0.3 0.3
    OxEditGuides -rm 1 1 25 0
  • -ds (-deleteStrands) [int strandCount] For each: [int onFlag]
    Deletes strands based on whether their on flag is set
    Examples:
    OxEditGuides -ds 10 0 0 0 0 1 1 0 0 1 0
  • -dg (-deleteStrands2) [int count] For each: [int strandId]
    Deletes strands by their strand id
    Example (delete strands 15 and 16):
    OxEditGuides -ds 2 15 16
  • -vcd (-changeVertexChannelData) [int changeCount] For each change: [int strandId] [int changedChannelCount] For each channel: [int channelIndex] [int pointCount] For each point: [float value]
    Modifies per-vertex channel data for one or more strands and channels
    Examples:
    OxEditGuides -vcd 1 15 1 0 2 0.5 0.6
  • -s (-selectStrands) [int count] For each: [int strandId]
    Selects one or more strands by their id
    Example (select strands 15 and 16):
    OxEditGuides -s 2 15 16
  • -h (-hideStrands) [int count] For each: [int strandId]
    Hides one or more strands by their id
    Example (hide strands 15 and 16):
    OxEditGuides -h 2 15 16
  • -f (-freezeStrands) [int count] For each: [int strandId]
    Freezes one or more strands by their id
    Example (freeze strands 15 and 16):
    OxEditGuides -f 2 15 16
  • -sd (-changeStrandData) [int count] For each: [int strandId] [int channelCount] For each channel: [int channelIndex] [float value]
    Sets per-strand channel data for specified strands and channels
    Example (sets a value of 0.5 for 0th channel of strand 15):
    OxEditGuides -sd 1 15 1 0 0.5
  • -sg (-changeStrandGroups) [int count] For each: [int strandId] [int strandGroup]
    Sets strand groups to specified strands
    Example (assigns group 5 to strand 15):
    OxEditGuides -sg 1 15 5
  • -sr (-strandRotation) [int count] For each: [int strandId] [float rotationValue]
    Sets strand rotations (twists around their stem) for specified strands
    Example (assigns rotation of 0.2 to strand 15):
    OxEditGuides -sr 1 15 0.2
  • -cid (-chunkId) [int chunkId]
    For internal usage. Executes an internally defined command "chunk", for example during brushing operations. Chunks are used to reduce command size and thus speed up user interactions.
  • -q
    Use in conjunction with chunkId flag to query the "full" version of the command for a specific chunk.
  • -cc
    Commits accumulated editing changes. This may be required after multiple previous calls to finalize any changes.
  • -v (-version) [int value]
    Specifies the current version of the command syntax. Should be absent if not sure (latest version will be assumed). Only some older flags require this flag for backward compatibility.
 

Calling OxEditGuides command from Pymel 

There are multiple ways to call OxEditGuides command from Pymel:

  1. Using a string containing the MEL command invocation:
    import pymel.core as pm
    pm.mel.eval( "OxEditGuides -vcd 1 1 1 0 2 0.2 0.1;" )
  2. Using Pymel direct command invocation. Note that command arguments need to go first, and the command flag(s) need to go last:
    pm.mel.OxEditGuides( 1, 1, 1, 0, 2, 0.2, 0.1, vcd = True )
  3. Alternatively you can also list the flags as string arguments:
    pm.mel.OxEditGuides( "vcd", 1, 1, 1, 0, 2, 0.2, 0.1 )
 

Writing custom brushes with Python 

Aside from stock set of brushes Ornatrix allows you to easily create your own custom brushes through Python scripts. This is described at detail in user brushes document.

 

Troubleshooting 

 

Roots and/or control points cannot be moved 

  • Problem: When in Strand or Control Point editing mode selecting one or more strands and using transform tool has no effect
  • Cause: Maya's soft selection mode is on, which is incompatible with strand selection
  • Solution: Use Ctrl/Command + B key shortcut to toggle off the soft selection mode
 

Guides are corrupt and jumbled 

  • Problem: After making edits and other operations within the scene Edit Guides messes up all of the guides
  • Cause: The order and/or count of input guides has changed. Edit made to guides are being applied to incorrect guides.
  • Solution: Make sure that you restore the same input guides parameters as they were when you made guide edits. See Ensuring consistent results section for more details.