c4d.modules.hair.HairGuides¶
-
class
c4d.modules.hair.HairGuides¶ Helper class for guides/hair.
Overview¶
Coordinate Conversion |
|
Gets the global matrix. |
|
Sets the global matrix. |
|
Changes all the points for the guides into a local coordinate system. |
|
Changes all the points for the guides into the world coordinate system. |
|
Flags |
|
Gets the flags. |
|
Sets the flags. |
|
Geometry Conversion |
|
Create splines from the guides. |
|
Gets the tangent of guide at segment and t. |
|
Object And Copy Operations |
|
Copies the guide data from src to this instance. |
|
Gets the corresponding hair object. |
|
Point Editing |
|
Gets a list of points for the guides. |
|
Set the point p at index id. |
|
Root Placement |
|
Used when HNs have affected the guide roots. |
|
Gets the root axis of guide index. |
|
Gets the root UV at index. |
|
Gets the transformation matrix list. |
|
Inverse of |
|
Selection |
|
Converts the selection state. |
|
Gets the selection state. |
|
Sets the selection state. |
|
Structure |
|
Gets the number of guides. |
|
Gets the number of points per segment. |
|
Gets the number of points per guide. |
|
Gets the number of segments per guide (number of points is one more than this). |
|
Members¶
Coordinate Conversion¶
-
HairGuides.GetMg(self)¶ Gets the global matrix.
- Return type
- Returns
Global matrix.
-
HairGuides.SetMg(self, mg)¶ Sets the global matrix.
- Parameters
mg (c4d.Matrix) – New global matrix.
-
HairGuides.ToLocal(self)¶ Changes all the points for the guides into a local coordinate system.
-
HairGuides.ToWorld(self)¶ Changes all the points for the guides into the world coordinate system.
Flags¶
-
HairGuides.GetFlags(self)¶ Gets the flags.
- Return type
int
- Returns
Flags:
HAIR_GUIDE_FLAGS_LOCAL
Chains are in local object space.
HAIR_GUIDE_FLAGS_AS_GUIDES
Special case guides.
HAIR_GUIDE_FLAGS_INITIAL
Chains are in their original initial space (like a stick texture tag).
HAIR_GUIDE_FLAGS_HAIRS
Created for hairs.
HAIR_GUIDE_FLAGS_INITIALAXIS
Initial space and root axis aligned.
-
HairGuides.SetFlags(self, flags)¶ Sets the flags.
- Parameters
flags (int) –
New flags:
HAIR_GUIDE_FLAGS_LOCAL
Chains are in local object space.
HAIR_GUIDE_FLAGS_AS_GUIDES
Special case guides.
HAIR_GUIDE_FLAGS_INITIAL
Chains are in their original initial space (like a stick texture tag).
HAIR_GUIDE_FLAGS_HAIRS
Created for hairs.
HAIR_GUIDE_FLAGS_INITIALAXIS
Initial space and root axis aligned.
- Return type
int
- Returns
Old flags.
Geometry Conversion¶
-
HairGuides.CreateSpline(self)¶ Create splines from the guides.
- Return type
- Returns
Created splines.
-
HairGuides.GetTangent(self, guide, segment, t)¶ Gets the tangent of guide at segment and t.
- Parameters
guide (int:) – Guide index.
segment (int) – Segment index.
t (float) – T coordinate.
Object And Copy Operations¶
-
HairGuides.CopyFrom(self, src)¶ Copies the guide data from src to this instance.
- Parameters
src (c4d.BaseSelect) – Source.
- Return type
bool
- Returns
True if successful, otherwise False.
-
HairGuides.GetObject(self)¶ Gets the corresponding hair object.
- Return type
- Returns
Hair object.
Point Editing¶
-
HairGuides.GetPoints(self)¶ Gets a list of points for the guides.
- Return type
List[c4d.Vector]
- Returns
Point list.
-
HairGuides.SetPoint(self, id, p)¶ Set the point p at index id.
- Parameters
id (int) – The point index.
p (c4d.Vector) – The point.
- Raises
IndexError – If the point index id is out of range : 0<=id<
GetPointCount().
Root Placement¶
-
HairGuides.DisplaceRoots(self)¶ - Used when HNs have affected the guide roots.Call
HairGuides.DisplaceRoots()and it will ensure they are in the correct displaced state for HNs,HairGuides.UndisplaceRoots()will make sure they are not.Generally not needed if using ToInitial(), as the initial state is undisplaced.
-
HairGuides.GetRootAxis(self, index, bAlign=False, bLocal=True, bInitial=False, bZAxis=False)¶ Gets the root axis of guide index.
- Parameters
index (int) – Guide index.
bAlign (bool) – Aligned.
bLocal (bool) – Local.
bInitial (bool) – Initial
bLocal – If True then the alignment is done along the Z axis, otherwise it is Y.
- Return type
- Returns
The root axis.
-
HairGuides.GetRootUV(self, index)¶ Gets the root UV at index.
- Parameters
index (int) – Guide index.
- Return type
-
HairGuides.GetTransformMatrix(self, index)¶ Gets the transformation matrix list.
- Parameters
index (int) – Guide index.
- Return type
List[c4d.Matrix]
- Returns
The transformation matrix list.
-
HairGuides.UndisplaceRoots(self)¶ Inverse of
HairGuides.DisplaceRoots().
Selection¶
-
HairGuides.ConvertSelection(self, from_mode, to_mode, from_select, to_select)¶ Converts the selection state.
- Parameters
from_mode (int) –
Selection mode:
HAIR_MODE_LOCKED
Locked mode
HAIR_MODE_HIDDEN
Hidden mode.
HAIR_MODE_TIPS
Tips mode.
HAIR_MODE_POINTS
Points mode.
HAIR_MODE_GUIDES
Guides mode.
HAIR_MODE_ROOTS
Roots mode.
HAIR_MODE_VERTEX
Vertex mode.
to_mode (int) –
To mode.
HAIR_MODE_LOCKED
Locked mode
HAIR_MODE_HIDDEN
Hidden mode.
HAIR_MODE_TIPS
Tips mode.
HAIR_MODE_POINTS
Points mode.
HAIR_MODE_GUIDES
Guides mode.
HAIR_MODE_ROOTS
Roots mode.
HAIR_MODE_VERTEX
Vertex mode.
from_select (c4d.BaseSelect) – From selection.
to_select (c4d.BaseSelect) – To selection.
-
HairGuides.GetSelected(self, mode)¶ Gets the selection state.
- Parameters
mode (int) –
Selection mode:
HAIR_MODE_LOCKED
Locked mode
HAIR_MODE_HIDDEN
Hidden mode.
HAIR_MODE_TIPS
Tips mode.
HAIR_MODE_POINTS
Points mode.
HAIR_MODE_GUIDES
Guides mode.
HAIR_MODE_ROOTS
Roots mode.
HAIR_MODE_VERTEX
Vertex mode.
- Return type
Optional[c4d.BaseSelect]
- Returns
The selection or None.
-
HairGuides.SetSelected(self, mode, select)¶ Sets the selection state.
- Parameters
mode (int) –
Selection mode:
HAIR_MODE_LOCKED
Locked mode
HAIR_MODE_HIDDEN
Hidden mode.
HAIR_MODE_TIPS
Tips mode.
HAIR_MODE_POINTS
Points mode.
HAIR_MODE_GUIDES
Guides mode.
HAIR_MODE_ROOTS
Roots mode.
HAIR_MODE_VERTEX
Vertex mode.
select (c4d.BaseSelect) – The selection.
- Return type
bool
- Returns
True if successful, otherwise False.
Structure¶
-
HairGuides.GetCount(self)¶ Gets the number of guides.
- Return type
int
- Returns
Guide count.
-
HairGuides.GetGuidePointCount(self)¶ Gets the number of points per segment.
- Return type
int
- Returns
Number of points per segment.
-
HairGuides.GetPointCount(self)¶ Gets the number of points per guide. (One more than segments.)
- Return type
int
- Returns
Number of points per guide.
-
HairGuides.GetSegmentCount(self)¶ Gets the number of segments per guide (number of points is one more than this).
- Return type
int
- Returns
Number of segments per guide.