Edit Guides Modifier Access
NOTE: The contents of this document apply to Ornatrix 2.0 and later versions only.
Edit guides modifier (presented as "Ox Edit Guides" in the UI) exposes a good amount of its functionality to MaxScript. This allows a script writer to operate on hair in an automated manner.
To access the edit guides modifier of a selected object through MaxScript you can use the object's modifier array, for example:
$.modifiers[1]
The above code will give you access to the first modifier on the stack. If this modifier is edit guides you will see this returned in the listener:
Ox_Edit_Guides:Ox Edit Guides
Once you have access to the edit guides modifier you can operate on it using methods referenced in this document.
Function Reference
Following are the functions for Edit Guides accessible through MaxScript:
- CreateRoot
Puts Max into "Create Root" mode where user can plant new guides on top of the distribution object - ImportSpline
Puts Max into "Import Spline" mode where user can pick a spline object to be added as a guide - CPChange
Puts Max into "Control point change" mode where user can select where on a guide they want control points to be positioned - CutStrands
Cuts all selected strands at the current position of control points. The new tips will be at the control points. - BraidStrands
Creates a braid out of selected guides using the current braid configuration - AdoptFromStack
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. - [integer] GetBrushType
Gets the type of current brush. 0 - Select, 1 - Move, 2 - Rotate, 3 - Scale, 4 - Cut, 5 - Grow/Shrink, 6 - Paint, 7 - Grab, - SetBrushType [integer type]
Sets the type of current brush. 0 - Select, 1 - Move, 2 - Rotate, 3 - Scale, 4 - Cut, 5 - Grow/Shrink, 6 - Paint, 7 - Grab, - [float] GetBrushWidth
Gets the width or radius of the current brush - [float] GetBrushHeight
Gets the height of the current brush, when shape is rectangular - SetBrushSize [float width] [float height]
Sets the width and height of the current brush. Height parameter is only relevant when shape is rectangular. - [integer] GetBrushShape
Gets the shape of the current brush. 0 - Circle, 1 - Rectangle, 2 - Messy - SetBrushShape [integer shape]
Sets the shape of the current brush. 0 - Circle, 1 - Rectangle, 2 - Messy - [float] GetBrushStrength
Gets the affect strength of current brush - SetBrushStrength [float value]
Sets the affect strength of current brush - [boolean] GetAffectSelectedOnly
Gets whether only currently selected guides will be affected by brushing - SetAffectSelectedOnly [boolean value]
Sets whether only currently selected guides will be affected by brushing - [boolean] GetAffectByRootsOnly
Gets whether only guides whose roots are under the current brush will be affected - SetAffectByRootsOnly [boolean value]
Sets whether only guides whose roots are under the current brush will be affected - [boolean] GetRespectVertexWeights
Gets whether vertex weights will determine how much brushing affects each vertex - SetRespectVertexWeights [boolean value]
Sets whether vertex weights will determine how much brushing affects each vertex - [integer] GetSelectionLevel
Gets the current selection level. 0 - Normal, 1 - Root, 2 - Strand, 3 - Brush - SetSelectionLevel [integer level]
Sets the current selection level . 0 - Normal, 1 - Root, 2 - Strand, 3 - Brush - HideSelected [boolean unhidePrevious]
Hides selected roots, and unhides any previously hidden ones - HideRoots [BitArray selection] [boolean unhidePrevious]
Hides specified roots and unhides any previously hidden ones - UnhideAllRoots
Unhides all roots in this object - [BitArray] GetHidden
Gets an array specifying which roots are currently hidden - FreezeSelected [boolean unhidePrevious]
Freezes selected roots, and unfreezes any previously frozen ones - FreezeRoots [BitArray selection] [boolean unfreezePrevious]
Freezes specified roots, and unfreezes any previously frozen ones - UnfreezeAllRoots
Unfreezes all roots - [BitArray] GetFrozen
Gets an array specifying frozen roots - SelectRoots [BitArray selection]
Marks specified roots as selected - [BitArray] GetSelected
Gets an array specifying selected roots - [boolean] GetHideGuidesGizmo
Gets whether the guides gizmo is currently hidden or visible - SetHideGuidesGizmo [boolean hide]
Sets whether the guides gizmo is currently hidden or visible - [boolean] GetCullBackfacingRoots
Gets whether backfacing roots will be selectable - SetCullBackfacingRoots [boolean value]
Sets whether backfacing roots will be selectable - [boolean] GetHideBackfacingRoots
Gets whether backfacing roots are visible - SetHideBackfacingRoots [boolean hide]
Sets whether backfacing roots are visible - [boolean] GetShowVertexTicks
Gets whether each strand vertex is marked in viewport - SetShowVertexTicks [boolean hide]
Sets whether each strand vertex is marked in viewport - [boolean] GetAdditiveMode
- SetAdditiveMode [boolean]
- [boolean] GetScaleMode
- SetScaleMode [boolean]
- [integer] GetCurrentChannelIndex
- [boolean] GetCurrentChannelIndexIsRoot
- SetCurrentChannelIndex [integer index] [boolean isRootChannel]
- AddChannel
- DeleteCurrentChannel [boolean showConfirmDialog]
- [integer] GetChannelDisplayMode
- SetChannelDisplayMode [integer mode]
- SetChannelValueToSelection [boolean isRootChannel] [integer channelIndex] [float value]