Ohair
Attributes
-
ENGLISH NAME : HairObject
-
NAME : Ohair
-
INCLUDE : Obase
-
PATH : hair/description/ohair.res
-
PLUGIN : hair
-
MAXON online help (may not exist): OHAIR
Elements
Example Code
The following code does not use the correct values when setting the data. You should check directly in C4D for the correct values that you should use in place of the ones that are shown.
This code is just to show you how to access the values for getting and setting the parameters.
Python
import c4d
from c4d import gui
def main():
obj = c4d.BaseObject(c4d.Ohair)
doc.InsertObject(obj)
c4d.EventAdd(c4d.EVENT_FORCEREDRAW)
#You can set parameters two different ways.
#First way
obj[c4d.HAIRSTYLE_COUNT] = 1
obj[c4d.HAIRSTYLE_SEGMENTS] = 1
obj[c4d.HAIRSTYLE_LENGTH] = 0.1
obj[c4d.HAIRSTYLE_ROOT_PLACEMENT] = c4d.HAIRSTYLE_ROOT_PLACEMENT_FACE
obj[c4d.HAIRSTYLE_ROOT_REMAPPING] = c4d.HAIRSTYLE_ROOT_REMAPPING_NEW
obj[c4d.HAIRSTYLE_UV_U_SPACING] = 0.1
obj[c4d.HAIRSTYLE_UV_V_SPACING] = 0.1
obj[c4d.HAIRSTYLE_UV_U_VAR] = 0.1
obj[c4d.HAIRSTYLE_UV_V_VAR] = 0.1
obj[c4d.HAIRSTYLE_GROWTH] = c4d.HAIRSTYLE_GROWTH_NORMALS
obj[c4d.HAIRSTYLE_GROWTH_DIRECTION_TYPE] = c4d.HAIRSTYLE_GROWTH_DIRECTION_X
obj[c4d.HAIRSTYLE_GROWTH_DIRECTION_LOCAL] = True
obj[c4d.HAIRSTYLE_ROOT_MIN_SPACING] = True
obj[c4d.HAIRSTYLE_ROOT_DISTANCE] = 0.1
obj[c4d.HAIRSTYLE_ROOT_DENSITY_LEVELS] = 1
obj[c4d.HAIRSTYLE_SHELL_SEGMENT] = 1
obj[c4d.HAIRSTYLE_SYMMETRY_ENABLE] = True
obj[c4d.HAIRSTYLE_SYMMETRY_PLANE] = c4d.HAIRSTYLE_SYMMETRY_PLANE_XY
obj[c4d.HAIRSTYLE_SYMMETRY_EDITOR] = True
obj[c4d.HAIRSTYLE_SYMMETRY_ROOT] = True
obj[c4d.HAIRSTYLE_UPDATE_AUTO] = True
obj[c4d.HAIRSTYLE_HAIR_COUNT] = 1
obj[c4d.HAIRSTYLE_HAIR_SEGMENTS] = 1
obj[c4d.HAIRSTYLE_HAIR_ROOT_PLACEMENT] = c4d.HAIRSTYLE_ROOT_PLACEMENT_AUTO
obj[c4d.HAIRSTYLE_ROOTS_ASNORMALS] = True
obj[c4d.HAIRSTYLE_HAIR_UV_U_SPACING] = 0.1
obj[c4d.HAIRSTYLE_HAIR_UV_V_SPACING] = 0.1
obj[c4d.HAIRSTYLE_HAIR_UV_U_VAR] = 0.1
obj[c4d.HAIRSTYLE_HAIR_UV_V_VAR] = 0.1
obj[c4d.HAIRSTYLE_ROOT_OFFSET] = 0.1
obj[c4d.HAIRSTYLE_ROOT_EXTEND] = 0.1
obj[c4d.HAIRSTYLE_HAIR_ROOT_NULL_INVALID] = True
obj[c4d.HAIRSTYLE_HAIR_ROOT_MIN_SPACING] = True
obj[c4d.HAIRSTYLE_HAIR_ROOT_DISTANCE] = 0.1
obj[c4d.HAIRSTYLE_HAIR_ROOT_DENSITY_LEVELS] = 1
obj[c4d.HAIRSTYLE_HAIR_ROOT_RESTICT] = True
obj[c4d.HAIRSTYLE_HAIR_ROOT_RESTRICT_DISTANCE] = 0.1
obj[c4d.HAIRSTYLE_HAIR_ROOT_RESTRICT_COUNT] = 0.1
obj[c4d.HAIRSTYLE_HAIR_ROOT_MULTIPLY] = 1
obj[c4d.HAIRSTYLE_HAIR_ROOT_MULTIPLY_SETROOTS] = True
obj[c4d.HAIRSTYLE_HAIR_ROOT_MULTI_ROOT] = 0.1
obj[c4d.HAIRSTYLE_HAIR_ROOT_MULTI_TIP] = 0.1
obj[c4d.HAIRSTYLE_HAIR_ROOT_MULTI_SCALE] = 0.1
obj[c4d.HAIRSTYLE_HAIR_ROOT_MULTI_SCALE_VAR] = 0.1
obj[c4d.HAIRSTYLE_INTERPOLATION_TYPE] = c4d.HAIRSTYLE_INTERPOLATION_TYPE_LINEAR
obj[c4d.HAIRSTYLE_INTERPOLATION_GUIDES] = 1
obj[c4d.HAIRSTYLE_INTERPOLATION_VARIATION] = 0.1
obj[c4d.HAIRSTYLE_INTERPOLATION_CLUMP] = True
obj[c4d.HAIRSTYLE_FUR] = True
obj[c4d.HAIRSTYLE_FUR_COUNT] = 1
obj[c4d.HAIRSTYLE_FUR_ONLY] = True
obj[c4d.HAIRSTYLE_FUR_SHADOWS] = True
obj[c4d.HAIRSTYLE_FUR_CACHE] = True
obj[c4d.HAIRSTYLE_FUR_SCALE] = 0.1
obj[c4d.HAIRSTYLE_FUR_SCALE_VAR] = 0.1
obj[c4d.HAIRSTYLE_FUR_THICKNESS] = 0.1
obj[c4d.HAIRSTYLE_FUR_THICKNESS_VAR] = 0.1
obj[c4d.HAIRSTYLE_FUR_CLUMP] = True
obj[c4d.HAIRSTYLE_PREVIEW] = c4d.HAIRSTYLE_PREVIEW_NONE
obj[c4d.HAIRSTYLE_PREVIEW_CACHE] = True
obj[c4d.HAIRSTYLE_BACKFACING] = True
obj[c4d.HAIRSTYLE_PREVIEW_NO_SHADING] = True
obj[c4d.HAIRSTYLE_PREVIEW_GPU_ENHANCED_SHADING] = True
obj[c4d.HAIRSTYLE_PREVIEW_GPU_ENHANCED_SHADING_SPECULAR] = 0.1
obj[c4d.HAIRSTYLE_PREVIEW_GPU_ENHANCED_SHADING_AO] = 0.1
obj[c4d.HAIRSTYLE_PREVIEW_DETAIL] = 0.1
obj[c4d.HAIRSTYLE_EDITOR_GENERATE] = c4d.HAIRSTYLE_EDITOR_GENERATE_NONE
obj[c4d.HAIRSTYLE_LOD_AFFECT] = c4d.HAIRSTYLE_LOD_AFFECT_NONE
obj[c4d.HAIRSTYLE_EDITOR_ASRENDER] = True
obj[c4d.HAIRSTYLE_EDITOR_COUNT] = 1
obj[c4d.HAIRSTYLE_EDITOR_SEGCOUNT] = 1
obj[c4d.HAIRSTYLE_RENDER_HAIR] = True
obj[c4d.HAIRSTYLE_GENERATE] = c4d.HAIRSTYLE_GENERATE_NONE
obj[c4d.HAIRSTYLE_GENERATE_PERFRAME] = True
obj[c4d.HAIRSTYLE_INSTANCE_AXIS] = c4d.HAIRSTYLE_INSTANCE_AXIS_X
obj[c4d.HAIRSTYLE_INSTANCE_SCALING] = c4d.HAIRSTYLE_INSTANCE_SCALING_UNIFORM
obj[c4d.HAIRSTYLE_INSTANCE_DEFORM] = c4d.HAIRSTYLE_INSTANCE_DEFORM_NONE
obj[c4d.HAIRSTYLE_INSTANCE_HIERARCHY] = c4d.HAIRSTYLE_INSTANCE_HIERARCHY_SINGLE
obj[c4d.HAIRSTYLE_INSTANCE_REPEAT] = 1
obj[c4d.HAIRSTYLE_INSTANCE_MATERIALS] = True
obj[c4d.HAIRSTYLE_INSTANCE_START] = 0.1
obj[c4d.HAIRSTYLE_INSTANCE_END] = 0.1
obj[c4d.HAIRSTYLE_ROTATION] = c4d.HAIRSTYLE_ROTATION_FREE
obj[c4d.HAIRSTYLE_ROTATION_LOCAL] = True
obj[c4d.HAIRSTYLE_ROTATION_INVERT] = True
obj[c4d.HAIRSTYLE_SINGLE_OBJECT] = True
obj[c4d.HAIRSTYLE_CAP_START] = True
obj[c4d.HAIRSTYLE_CAP_END] = True
obj[c4d.HAIRSTYLE_SLICES] = True
obj[c4d.HAIRSTYLE_SLICE_NORMAL] = c4d.HAIRSTYLE_SLICE_NORMAL_GUIDE
obj[c4d.HAIRSTYLE_DYNAMICS_ENABLE] = True
obj[c4d.HAIRSTYLE_DYNAMICS_COLLISIONS] = True
obj[c4d.HAIRSTYLE_DYNAMICS_EXTRA_STIFF] = True
obj[c4d.HAIRSTYLE_DYNAMICS_RADIUS] = 0.1
obj[c4d.HAIRSTYLE_DYNAMICS_FIXED_ROOTS] = True
obj[c4d.HAIRSTYLE_DYNAMICS_MASS] = 0.1
obj[c4d.HAIRSTYLE_DYNAMICS_DRAG] = 0.1
obj[c4d.HAIRSTYLE_DYNAMICS_ROOT_HOLD] = 0.1
obj[c4d.HAIRSTYLE_DYNAMICS_STIFFNESS] = 0.1
obj[c4d.HAIRSTYLE_DYNAMICS_REST_MIX] = 0.1
obj[c4d.HAIRSTYLE_DYNAMICS_REST_HOLD] = 0.1
obj[c4d.HAIRSTYLE_DYNAMICS_ELASTIC_LIMIT] = 0.1
obj[c4d.HAIRSTYLE_DYNAMICS_ELASTIC_DEFORM] = 0.1
obj[c4d.HAIRSTYLE_DYNAMICS_AUTOTIME] = True
obj[c4d.HAIRSTYLE_DYNAMICS_FRAMES] = 1
obj[c4d.HAIRSTYLE_DYNAMICS_APPLY] = c4d.HAIRSTYLE_DYNAMICS_APPLY_GUIDES
obj[c4d.HAIRSTYLE_DYNAMICS_CUSTOM] = True
obj[c4d.HAIRSTYLE_DYNAMICS_SEGMENTS] = 1
obj[c4d.HAIRSTYLE_DYNAMICS_SUBDIV] = 1
obj[c4d.HAIRSTYLE_DYNAMICS_ITERATIONS] = 1
obj[c4d.HAIRSTYLE_DYNAMICS_FORCES_HAIR] = True
obj[c4d.HAIRSTYLE_DYNAMICS_FORCES_OBJECTS] = True
obj[c4d.HAIRSTYLE_DYNAMICS_GRAVITY] = 0.1
obj[c4d.HAIRSTYLE_DYNAMICS_FORCES_RADIUS] = 0.1
obj[c4d.HAIRSTYLE_DYNAMICS_FORCES_STRENGTH] = 0.1
obj[c4d.HAIRSTYLE_DYNAMICS_FORCES_MAXSTRENGTH] = 0.1
obj[c4d.HAIRSTYLE_DYNAMICS_FORCES_FALLOFF] = c4d.HAIRSTYLE_DYNAMICS_FORCES_FALLOFF_CONSTANT
obj[c4d.HAIRSTYLE_DYNAMICS_FORCES_INCEXC] = c4d.HAIRSTYLE_DYNAMICS_FORCES_INCEXC_INCLUDE
obj[c4d.HAIRSTYLE_DYNAMICS_CACHE_ENABLE] = True
obj[c4d.HAIRSTYLE_DYNAMICS_CACHE_COMPRESSED] = True
obj[c4d.HAIRSTYLE_DYNAMICS_EDITABLE] = True
obj[c4d.HAIRSTYLE_DYNAMICS_CACHE_CACHE_LIMIT] = 1
obj[c4d.HAIRSTYLE_PARTINGS_AUTO] = True
obj[c4d.HAIRSTYLE_PARTINGS_DISTANCE] = 0.1
obj[c4d.HAIRSTYLE_PARTINGS_ANGLE] = 0.1
obj[c4d.HAIRSTYLE_GENERATE_CULL_BACKFACING] = True
obj[c4d.HAIRSTYLE_GENERATE_CULL_OFFSCREEN] = True
obj[c4d.HAIRSTYLE_GENERATE_CULL_DISTANCE] = True
obj[c4d.HAIRSTYLE_GENERATE_CULL_BACKFACING_FADE] = 0.1
obj[c4d.HAIRSTYLE_GENERATE_CULL_BACKFACING_FADE_END] = 0.1
obj[c4d.HAIRSTYLE_GENERATE_CULL_DISTANCE_NEARCLIP] = 0.1
obj[c4d.HAIRSTYLE_GENERATE_CULL_DISTANCE_NEARCLIP_FADE] = 0.1
obj[c4d.HAIRSTYLE_GENERATE_CULL_DISTANCE_FARCLIP] = 0.1
obj[c4d.HAIRSTYLE_GENERATE_CULL_DISTANCE_FARCLIP_FADE] = 0.1
obj[c4d.HAIRSTYLE_GENERATE_CULL_OFFSCREEN_PERCENT] = 0.1
obj[c4d.HAIRSTYLE_SEED] = 1
obj[c4d.HAIRSTYLE_ROOTS_GENERATE_ITERATIONS] = 1
obj[c4d.HAIRSTYLE_DEFORMERS_ENABLE] = True
obj[c4d.HAIRSTYLE_DEFORMERS_STRENGTH] = 0.1
#Second way, using the base container.
bc = obj.GetDataInstance()
bc.SetInt32(c4d.HAIRSTYLE_COUNT,1)
bc.SetInt32(c4d.HAIRSTYLE_SEGMENTS,1)
bc.SetFloat(c4d.HAIRSTYLE_LENGTH,0.1)
bc.SetInt32(c4d.HAIRSTYLE_ROOT_PLACEMENT,c4d.HAIRSTYLE_ROOT_PLACEMENT_FACE)
bc.SetInt32(c4d.HAIRSTYLE_ROOT_REMAPPING,c4d.HAIRSTYLE_ROOT_REMAPPING_NEW)
bc.SetFloat(c4d.HAIRSTYLE_UV_U_SPACING,0.1)
bc.SetFloat(c4d.HAIRSTYLE_UV_V_SPACING,0.1)
bc.SetFloat(c4d.HAIRSTYLE_UV_U_VAR,0.1)
bc.SetFloat(c4d.HAIRSTYLE_UV_V_VAR,0.1)
bc.SetInt32(c4d.HAIRSTYLE_GROWTH,c4d.HAIRSTYLE_GROWTH_NORMALS)
bc.SetInt32(c4d.HAIRSTYLE_GROWTH_DIRECTION_TYPE,c4d.HAIRSTYLE_GROWTH_DIRECTION_X)
bc.SetBool(c4d.HAIRSTYLE_GROWTH_DIRECTION_LOCAL,True)
bc.SetBool(c4d.HAIRSTYLE_ROOT_MIN_SPACING,True)
bc.SetFloat(c4d.HAIRSTYLE_ROOT_DISTANCE,0.1)
bc.SetInt32(c4d.HAIRSTYLE_ROOT_DENSITY_LEVELS,1)
bc.SetInt32(c4d.HAIRSTYLE_SHELL_SEGMENT,1)
bc.SetBool(c4d.HAIRSTYLE_SYMMETRY_ENABLE,True)
bc.SetInt32(c4d.HAIRSTYLE_SYMMETRY_PLANE,c4d.HAIRSTYLE_SYMMETRY_PLANE_XY)
bc.SetBool(c4d.HAIRSTYLE_SYMMETRY_EDITOR,True)
bc.SetBool(c4d.HAIRSTYLE_SYMMETRY_ROOT,True)
bc.SetBool(c4d.HAIRSTYLE_UPDATE_AUTO,True)
bc.SetInt32(c4d.HAIRSTYLE_HAIR_COUNT,1)
bc.SetInt32(c4d.HAIRSTYLE_HAIR_SEGMENTS,1)
bc.SetInt32(c4d.HAIRSTYLE_HAIR_ROOT_PLACEMENT,c4d.HAIRSTYLE_ROOT_PLACEMENT_AUTO)
bc.SetBool(c4d.HAIRSTYLE_ROOTS_ASNORMALS,True)
bc.SetFloat(c4d.HAIRSTYLE_HAIR_UV_U_SPACING,0.1)
bc.SetFloat(c4d.HAIRSTYLE_HAIR_UV_V_SPACING,0.1)
bc.SetFloat(c4d.HAIRSTYLE_HAIR_UV_U_VAR,0.1)
bc.SetFloat(c4d.HAIRSTYLE_HAIR_UV_V_VAR,0.1)
bc.SetFloat(c4d.HAIRSTYLE_ROOT_OFFSET,0.1)
bc.SetFloat(c4d.HAIRSTYLE_ROOT_EXTEND,0.1)
bc.SetBool(c4d.HAIRSTYLE_HAIR_ROOT_NULL_INVALID,True)
bc.SetBool(c4d.HAIRSTYLE_HAIR_ROOT_MIN_SPACING,True)
bc.SetFloat(c4d.HAIRSTYLE_HAIR_ROOT_DISTANCE,0.1)
bc.SetInt32(c4d.HAIRSTYLE_HAIR_ROOT_DENSITY_LEVELS,1)
bc.SetBool(c4d.HAIRSTYLE_HAIR_ROOT_RESTICT,True)
bc.SetFloat(c4d.HAIRSTYLE_HAIR_ROOT_RESTRICT_DISTANCE,0.1)
bc.SetFloat(c4d.HAIRSTYLE_HAIR_ROOT_RESTRICT_COUNT,0.1)
bc.SetInt32(c4d.HAIRSTYLE_HAIR_ROOT_MULTIPLY,1)
bc.SetBool(c4d.HAIRSTYLE_HAIR_ROOT_MULTIPLY_SETROOTS,True)
bc.SetFloat(c4d.HAIRSTYLE_HAIR_ROOT_MULTI_ROOT,0.1)
bc.SetFloat(c4d.HAIRSTYLE_HAIR_ROOT_MULTI_TIP,0.1)
bc.SetFloat(c4d.HAIRSTYLE_HAIR_ROOT_MULTI_SCALE,0.1)
bc.SetFloat(c4d.HAIRSTYLE_HAIR_ROOT_MULTI_SCALE_VAR,0.1)
bc.SetInt32(c4d.HAIRSTYLE_INTERPOLATION_TYPE,c4d.HAIRSTYLE_INTERPOLATION_TYPE_LINEAR)
bc.SetInt32(c4d.HAIRSTYLE_INTERPOLATION_GUIDES,1)
bc.SetFloat(c4d.HAIRSTYLE_INTERPOLATION_VARIATION,0.1)
bc.SetBool(c4d.HAIRSTYLE_INTERPOLATION_CLUMP,True)
bc.SetBool(c4d.HAIRSTYLE_FUR,True)
bc.SetInt32(c4d.HAIRSTYLE_FUR_COUNT,1)
bc.SetBool(c4d.HAIRSTYLE_FUR_ONLY,True)
bc.SetBool(c4d.HAIRSTYLE_FUR_SHADOWS,True)
bc.SetBool(c4d.HAIRSTYLE_FUR_CACHE,True)
bc.SetFloat(c4d.HAIRSTYLE_FUR_SCALE,0.1)
bc.SetFloat(c4d.HAIRSTYLE_FUR_SCALE_VAR,0.1)
bc.SetFloat(c4d.HAIRSTYLE_FUR_THICKNESS,0.1)
bc.SetFloat(c4d.HAIRSTYLE_FUR_THICKNESS_VAR,0.1)
bc.SetBool(c4d.HAIRSTYLE_FUR_CLUMP,True)
bc.SetInt32(c4d.HAIRSTYLE_PREVIEW,c4d.HAIRSTYLE_PREVIEW_NONE)
bc.SetBool(c4d.HAIRSTYLE_PREVIEW_CACHE,True)
bc.SetBool(c4d.HAIRSTYLE_BACKFACING,True)
bc.SetBool(c4d.HAIRSTYLE_PREVIEW_NO_SHADING,True)
bc.SetBool(c4d.HAIRSTYLE_PREVIEW_GPU_ENHANCED_SHADING,True)
bc.SetFloat(c4d.HAIRSTYLE_PREVIEW_GPU_ENHANCED_SHADING_SPECULAR,0.1)
bc.SetFloat(c4d.HAIRSTYLE_PREVIEW_GPU_ENHANCED_SHADING_AO,0.1)
bc.SetFloat(c4d.HAIRSTYLE_PREVIEW_DETAIL,0.1)
bc.SetInt32(c4d.HAIRSTYLE_EDITOR_GENERATE,c4d.HAIRSTYLE_EDITOR_GENERATE_NONE)
bc.SetInt32(c4d.HAIRSTYLE_LOD_AFFECT,c4d.HAIRSTYLE_LOD_AFFECT_NONE)
bc.SetBool(c4d.HAIRSTYLE_EDITOR_ASRENDER,True)
bc.SetInt32(c4d.HAIRSTYLE_EDITOR_COUNT,1)
bc.SetInt32(c4d.HAIRSTYLE_EDITOR_SEGCOUNT,1)
bc.SetBool(c4d.HAIRSTYLE_RENDER_HAIR,True)
bc.SetInt32(c4d.HAIRSTYLE_GENERATE,c4d.HAIRSTYLE_GENERATE_NONE)
bc.SetBool(c4d.HAIRSTYLE_GENERATE_PERFRAME,True)
bc.SetInt32(c4d.HAIRSTYLE_INSTANCE_AXIS,c4d.HAIRSTYLE_INSTANCE_AXIS_X)
bc.SetInt32(c4d.HAIRSTYLE_INSTANCE_SCALING,c4d.HAIRSTYLE_INSTANCE_SCALING_UNIFORM)
bc.SetInt32(c4d.HAIRSTYLE_INSTANCE_DEFORM,c4d.HAIRSTYLE_INSTANCE_DEFORM_NONE)
bc.SetInt32(c4d.HAIRSTYLE_INSTANCE_HIERARCHY,c4d.HAIRSTYLE_INSTANCE_HIERARCHY_SINGLE)
bc.SetInt32(c4d.HAIRSTYLE_INSTANCE_REPEAT,1)
bc.SetBool(c4d.HAIRSTYLE_INSTANCE_MATERIALS,True)
bc.SetFloat(c4d.HAIRSTYLE_INSTANCE_START,0.1)
bc.SetFloat(c4d.HAIRSTYLE_INSTANCE_END,0.1)
bc.SetInt32(c4d.HAIRSTYLE_ROTATION,c4d.HAIRSTYLE_ROTATION_FREE)
bc.SetBool(c4d.HAIRSTYLE_ROTATION_LOCAL,True)
bc.SetBool(c4d.HAIRSTYLE_ROTATION_INVERT,True)
bc.SetBool(c4d.HAIRSTYLE_SINGLE_OBJECT,True)
bc.SetBool(c4d.HAIRSTYLE_CAP_START,True)
bc.SetBool(c4d.HAIRSTYLE_CAP_END,True)
bc.SetBool(c4d.HAIRSTYLE_SLICES,True)
bc.SetInt32(c4d.HAIRSTYLE_SLICE_NORMAL,c4d.HAIRSTYLE_SLICE_NORMAL_GUIDE)
bc.SetBool(c4d.HAIRSTYLE_DYNAMICS_ENABLE,True)
bc.SetBool(c4d.HAIRSTYLE_DYNAMICS_COLLISIONS,True)
bc.SetBool(c4d.HAIRSTYLE_DYNAMICS_EXTRA_STIFF,True)
bc.SetFloat(c4d.HAIRSTYLE_DYNAMICS_RADIUS,0.1)
bc.SetBool(c4d.HAIRSTYLE_DYNAMICS_FIXED_ROOTS,True)
bc.SetFloat(c4d.HAIRSTYLE_DYNAMICS_MASS,0.1)
bc.SetFloat(c4d.HAIRSTYLE_DYNAMICS_DRAG,0.1)
bc.SetFloat(c4d.HAIRSTYLE_DYNAMICS_ROOT_HOLD,0.1)
bc.SetFloat(c4d.HAIRSTYLE_DYNAMICS_STIFFNESS,0.1)
bc.SetFloat(c4d.HAIRSTYLE_DYNAMICS_REST_MIX,0.1)
bc.SetFloat(c4d.HAIRSTYLE_DYNAMICS_REST_HOLD,0.1)
bc.SetFloat(c4d.HAIRSTYLE_DYNAMICS_ELASTIC_LIMIT,0.1)
bc.SetFloat(c4d.HAIRSTYLE_DYNAMICS_ELASTIC_DEFORM,0.1)
bc.SetBool(c4d.HAIRSTYLE_DYNAMICS_AUTOTIME,True)
bc.SetInt32(c4d.HAIRSTYLE_DYNAMICS_FRAMES,1)
bc.SetInt32(c4d.HAIRSTYLE_DYNAMICS_APPLY,c4d.HAIRSTYLE_DYNAMICS_APPLY_GUIDES)
bc.SetBool(c4d.HAIRSTYLE_DYNAMICS_CUSTOM,True)
bc.SetInt32(c4d.HAIRSTYLE_DYNAMICS_SEGMENTS,1)
bc.SetInt32(c4d.HAIRSTYLE_DYNAMICS_SUBDIV,1)
bc.SetInt32(c4d.HAIRSTYLE_DYNAMICS_ITERATIONS,1)
bc.SetBool(c4d.HAIRSTYLE_DYNAMICS_FORCES_HAIR,True)
bc.SetBool(c4d.HAIRSTYLE_DYNAMICS_FORCES_OBJECTS,True)
bc.SetFloat(c4d.HAIRSTYLE_DYNAMICS_GRAVITY,0.1)
bc.SetFloat(c4d.HAIRSTYLE_DYNAMICS_FORCES_RADIUS,0.1)
bc.SetFloat(c4d.HAIRSTYLE_DYNAMICS_FORCES_STRENGTH,0.1)
bc.SetFloat(c4d.HAIRSTYLE_DYNAMICS_FORCES_MAXSTRENGTH,0.1)
bc.SetInt32(c4d.HAIRSTYLE_DYNAMICS_FORCES_FALLOFF,c4d.HAIRSTYLE_DYNAMICS_FORCES_FALLOFF_CONSTANT)
bc.SetInt32(c4d.HAIRSTYLE_DYNAMICS_FORCES_INCEXC,c4d.HAIRSTYLE_DYNAMICS_FORCES_INCEXC_INCLUDE)
bc.SetBool(c4d.HAIRSTYLE_DYNAMICS_CACHE_ENABLE,True)
bc.SetBool(c4d.HAIRSTYLE_DYNAMICS_CACHE_COMPRESSED,True)
bc.SetBool(c4d.HAIRSTYLE_DYNAMICS_EDITABLE,True)
bc.SetInt32(c4d.HAIRSTYLE_DYNAMICS_CACHE_CACHE_LIMIT,1)
bc.SetBool(c4d.HAIRSTYLE_PARTINGS_AUTO,True)
bc.SetFloat(c4d.HAIRSTYLE_PARTINGS_DISTANCE,0.1)
bc.SetFloat(c4d.HAIRSTYLE_PARTINGS_ANGLE,0.1)
bc.SetBool(c4d.HAIRSTYLE_GENERATE_CULL_BACKFACING,True)
bc.SetBool(c4d.HAIRSTYLE_GENERATE_CULL_OFFSCREEN,True)
bc.SetBool(c4d.HAIRSTYLE_GENERATE_CULL_DISTANCE,True)
bc.SetFloat(c4d.HAIRSTYLE_GENERATE_CULL_BACKFACING_FADE,0.1)
bc.SetFloat(c4d.HAIRSTYLE_GENERATE_CULL_BACKFACING_FADE_END,0.1)
bc.SetFloat(c4d.HAIRSTYLE_GENERATE_CULL_DISTANCE_NEARCLIP,0.1)
bc.SetFloat(c4d.HAIRSTYLE_GENERATE_CULL_DISTANCE_NEARCLIP_FADE,0.1)
bc.SetFloat(c4d.HAIRSTYLE_GENERATE_CULL_DISTANCE_FARCLIP,0.1)
bc.SetFloat(c4d.HAIRSTYLE_GENERATE_CULL_DISTANCE_FARCLIP_FADE,0.1)
bc.SetFloat(c4d.HAIRSTYLE_GENERATE_CULL_OFFSCREEN_PERCENT,0.1)
bc.SetInt32(c4d.HAIRSTYLE_SEED,1)
bc.SetInt32(c4d.HAIRSTYLE_ROOTS_GENERATE_ITERATIONS,1)
bc.SetBool(c4d.HAIRSTYLE_DEFORMERS_ENABLE,True)
bc.SetFloat(c4d.HAIRSTYLE_DEFORMERS_STRENGTH,0.1)
if __name__=='__main__':
main()
C++
#include "c4d.h"
#include "../hair/description/ohair.h"
void SampleFunction()
{
BaseDocument *pDoc = GetActiveDocument();
BaseObject *pObject = BaseObject::Alloc(Ohair);
pDoc->InsertObject(pObject);
pDoc->StartUndo();
pDoc->AddUndo(UNDO_NEW,pObject);
pDoc->EndUndo();
EventAdd(EVENT_FORCEREDRAW);
//You can set parameters two different ways.
//First way
//Some objects do not store all their data in the container. You need to use GetParameter()/SetParameter() instead.
DESCFLAGS_SET flags = DESCFLAGS_SET_PARAM_SET;
pObject->SetParameter(DescID(HAIRSTYLE_COUNT),GeData(1),flags);
pObject->SetParameter(DescID(HAIRSTYLE_SEGMENTS),GeData(1),flags);
pObject->SetParameter(DescID(HAIRSTYLE_LENGTH),GeData(0.1),flags);
pObject->SetParameter(DescID(HAIRSTYLE_ROOT_PLACEMENT),GeData(HAIRSTYLE_ROOT_PLACEMENT_FACE),flags);
pObject->SetParameter(DescID(HAIRSTYLE_ROOT_REMAPPING),GeData(HAIRSTYLE_ROOT_REMAPPING_NEW),flags);
pObject->SetParameter(DescID(HAIRSTYLE_UV_U_SPACING),GeData(0.1),flags);
pObject->SetParameter(DescID(HAIRSTYLE_UV_V_SPACING),GeData(0.1),flags);
pObject->SetParameter(DescID(HAIRSTYLE_UV_U_VAR),GeData(0.1),flags);
pObject->SetParameter(DescID(HAIRSTYLE_UV_V_VAR),GeData(0.1),flags);
pObject->SetParameter(DescID(HAIRSTYLE_GROWTH),GeData(HAIRSTYLE_GROWTH_NORMALS),flags);
pObject->SetParameter(DescID(HAIRSTYLE_GROWTH_DIRECTION_TYPE),GeData(HAIRSTYLE_GROWTH_DIRECTION_X),flags);
pObject->SetParameter(DescID(HAIRSTYLE_GROWTH_DIRECTION_LOCAL),GeData(true),flags);
pObject->SetParameter(DescID(HAIRSTYLE_ROOT_MIN_SPACING),GeData(true),flags);
pObject->SetParameter(DescID(HAIRSTYLE_ROOT_DISTANCE),GeData(0.1),flags);
pObject->SetParameter(DescID(HAIRSTYLE_ROOT_DENSITY_LEVELS),GeData(1),flags);
pObject->SetParameter(DescID(HAIRSTYLE_SHELL_SEGMENT),GeData(1),flags);
pObject->SetParameter(DescID(HAIRSTYLE_SYMMETRY_ENABLE),GeData(true),flags);
pObject->SetParameter(DescID(HAIRSTYLE_SYMMETRY_PLANE),GeData(HAIRSTYLE_SYMMETRY_PLANE_XY),flags);
pObject->SetParameter(DescID(HAIRSTYLE_SYMMETRY_EDITOR),GeData(true),flags);
pObject->SetParameter(DescID(HAIRSTYLE_SYMMETRY_ROOT),GeData(true),flags);
pObject->SetParameter(DescID(HAIRSTYLE_UPDATE_AUTO),GeData(true),flags);
pObject->SetParameter(DescID(HAIRSTYLE_HAIR_COUNT),GeData(1),flags);
pObject->SetParameter(DescID(HAIRSTYLE_HAIR_SEGMENTS),GeData(1),flags);
pObject->SetParameter(DescID(HAIRSTYLE_HAIR_ROOT_PLACEMENT),GeData(HAIRSTYLE_ROOT_PLACEMENT_AUTO),flags);
pObject->SetParameter(DescID(HAIRSTYLE_ROOTS_ASNORMALS),GeData(true),flags);
pObject->SetParameter(DescID(HAIRSTYLE_HAIR_UV_U_SPACING),GeData(0.1),flags);
pObject->SetParameter(DescID(HAIRSTYLE_HAIR_UV_V_SPACING),GeData(0.1),flags);
pObject->SetParameter(DescID(HAIRSTYLE_HAIR_UV_U_VAR),GeData(0.1),flags);
pObject->SetParameter(DescID(HAIRSTYLE_HAIR_UV_V_VAR),GeData(0.1),flags);
pObject->SetParameter(DescID(HAIRSTYLE_ROOT_OFFSET),GeData(0.1),flags);
pObject->SetParameter(DescID(HAIRSTYLE_ROOT_EXTEND),GeData(0.1),flags);
pObject->SetParameter(DescID(HAIRSTYLE_HAIR_ROOT_NULL_INVALID),GeData(true),flags);
pObject->SetParameter(DescID(HAIRSTYLE_HAIR_ROOT_MIN_SPACING),GeData(true),flags);
pObject->SetParameter(DescID(HAIRSTYLE_HAIR_ROOT_DISTANCE),GeData(0.1),flags);
pObject->SetParameter(DescID(HAIRSTYLE_HAIR_ROOT_DENSITY_LEVELS),GeData(1),flags);
pObject->SetParameter(DescID(HAIRSTYLE_HAIR_ROOT_RESTICT),GeData(true),flags);
pObject->SetParameter(DescID(HAIRSTYLE_HAIR_ROOT_RESTRICT_DISTANCE),GeData(0.1),flags);
pObject->SetParameter(DescID(HAIRSTYLE_HAIR_ROOT_RESTRICT_COUNT),GeData(0.1),flags);
pObject->SetParameter(DescID(HAIRSTYLE_HAIR_ROOT_MULTIPLY),GeData(1),flags);
pObject->SetParameter(DescID(HAIRSTYLE_HAIR_ROOT_MULTIPLY_SETROOTS),GeData(true),flags);
pObject->SetParameter(DescID(HAIRSTYLE_HAIR_ROOT_MULTI_ROOT),GeData(0.1),flags);
pObject->SetParameter(DescID(HAIRSTYLE_HAIR_ROOT_MULTI_TIP),GeData(0.1),flags);
pObject->SetParameter(DescID(HAIRSTYLE_HAIR_ROOT_MULTI_SCALE),GeData(0.1),flags);
pObject->SetParameter(DescID(HAIRSTYLE_HAIR_ROOT_MULTI_SCALE_VAR),GeData(0.1),flags);
pObject->SetParameter(DescID(HAIRSTYLE_INTERPOLATION_TYPE),GeData(HAIRSTYLE_INTERPOLATION_TYPE_LINEAR),flags);
pObject->SetParameter(DescID(HAIRSTYLE_INTERPOLATION_GUIDES),GeData(1),flags);
pObject->SetParameter(DescID(HAIRSTYLE_INTERPOLATION_VARIATION),GeData(0.1),flags);
pObject->SetParameter(DescID(HAIRSTYLE_INTERPOLATION_CLUMP),GeData(true),flags);
pObject->SetParameter(DescID(HAIRSTYLE_FUR),GeData(true),flags);
pObject->SetParameter(DescID(HAIRSTYLE_FUR_COUNT),GeData(1),flags);
pObject->SetParameter(DescID(HAIRSTYLE_FUR_ONLY),GeData(true),flags);
pObject->SetParameter(DescID(HAIRSTYLE_FUR_SHADOWS),GeData(true),flags);
pObject->SetParameter(DescID(HAIRSTYLE_FUR_CACHE),GeData(true),flags);
pObject->SetParameter(DescID(HAIRSTYLE_FUR_SCALE),GeData(0.1),flags);
pObject->SetParameter(DescID(HAIRSTYLE_FUR_SCALE_VAR),GeData(0.1),flags);
pObject->SetParameter(DescID(HAIRSTYLE_FUR_THICKNESS),GeData(0.1),flags);
pObject->SetParameter(DescID(HAIRSTYLE_FUR_THICKNESS_VAR),GeData(0.1),flags);
pObject->SetParameter(DescID(HAIRSTYLE_FUR_CLUMP),GeData(true),flags);
pObject->SetParameter(DescID(HAIRSTYLE_PREVIEW),GeData(HAIRSTYLE_PREVIEW_NONE),flags);
pObject->SetParameter(DescID(HAIRSTYLE_PREVIEW_CACHE),GeData(true),flags);
pObject->SetParameter(DescID(HAIRSTYLE_BACKFACING),GeData(true),flags);
pObject->SetParameter(DescID(HAIRSTYLE_PREVIEW_NO_SHADING),GeData(true),flags);
pObject->SetParameter(DescID(HAIRSTYLE_PREVIEW_GPU_ENHANCED_SHADING),GeData(true),flags);
pObject->SetParameter(DescID(HAIRSTYLE_PREVIEW_GPU_ENHANCED_SHADING_SPECULAR),GeData(0.1),flags);
pObject->SetParameter(DescID(HAIRSTYLE_PREVIEW_GPU_ENHANCED_SHADING_AO),GeData(0.1),flags);
pObject->SetParameter(DescID(HAIRSTYLE_PREVIEW_DETAIL),GeData(0.1),flags);
pObject->SetParameter(DescID(HAIRSTYLE_EDITOR_GENERATE),GeData(HAIRSTYLE_EDITOR_GENERATE_NONE),flags);
pObject->SetParameter(DescID(HAIRSTYLE_LOD_AFFECT),GeData(HAIRSTYLE_LOD_AFFECT_NONE),flags);
pObject->SetParameter(DescID(HAIRSTYLE_EDITOR_ASRENDER),GeData(true),flags);
pObject->SetParameter(DescID(HAIRSTYLE_EDITOR_COUNT),GeData(1),flags);
pObject->SetParameter(DescID(HAIRSTYLE_EDITOR_SEGCOUNT),GeData(1),flags);
pObject->SetParameter(DescID(HAIRSTYLE_RENDER_HAIR),GeData(true),flags);
pObject->SetParameter(DescID(HAIRSTYLE_GENERATE),GeData(HAIRSTYLE_GENERATE_NONE),flags);
pObject->SetParameter(DescID(HAIRSTYLE_GENERATE_PERFRAME),GeData(true),flags);
pObject->SetParameter(DescID(HAIRSTYLE_INSTANCE_AXIS),GeData(HAIRSTYLE_INSTANCE_AXIS_X),flags);
pObject->SetParameter(DescID(HAIRSTYLE_INSTANCE_SCALING),GeData(HAIRSTYLE_INSTANCE_SCALING_UNIFORM),flags);
pObject->SetParameter(DescID(HAIRSTYLE_INSTANCE_DEFORM),GeData(HAIRSTYLE_INSTANCE_DEFORM_NONE),flags);
pObject->SetParameter(DescID(HAIRSTYLE_INSTANCE_HIERARCHY),GeData(HAIRSTYLE_INSTANCE_HIERARCHY_SINGLE),flags);
pObject->SetParameter(DescID(HAIRSTYLE_INSTANCE_REPEAT),GeData(1),flags);
pObject->SetParameter(DescID(HAIRSTYLE_INSTANCE_MATERIALS),GeData(true),flags);
pObject->SetParameter(DescID(HAIRSTYLE_INSTANCE_START),GeData(0.1),flags);
pObject->SetParameter(DescID(HAIRSTYLE_INSTANCE_END),GeData(0.1),flags);
pObject->SetParameter(DescID(HAIRSTYLE_ROTATION),GeData(HAIRSTYLE_ROTATION_FREE),flags);
pObject->SetParameter(DescID(HAIRSTYLE_ROTATION_LOCAL),GeData(true),flags);
pObject->SetParameter(DescID(HAIRSTYLE_ROTATION_INVERT),GeData(true),flags);
pObject->SetParameter(DescID(HAIRSTYLE_SINGLE_OBJECT),GeData(true),flags);
pObject->SetParameter(DescID(HAIRSTYLE_CAP_START),GeData(true),flags);
pObject->SetParameter(DescID(HAIRSTYLE_CAP_END),GeData(true),flags);
pObject->SetParameter(DescID(HAIRSTYLE_SLICES),GeData(true),flags);
pObject->SetParameter(DescID(HAIRSTYLE_SLICE_NORMAL),GeData(HAIRSTYLE_SLICE_NORMAL_GUIDE),flags);
pObject->SetParameter(DescID(HAIRSTYLE_DYNAMICS_ENABLE),GeData(true),flags);
pObject->SetParameter(DescID(HAIRSTYLE_DYNAMICS_COLLISIONS),GeData(true),flags);
pObject->SetParameter(DescID(HAIRSTYLE_DYNAMICS_EXTRA_STIFF),GeData(true),flags);
pObject->SetParameter(DescID(HAIRSTYLE_DYNAMICS_RADIUS),GeData(0.1),flags);
pObject->SetParameter(DescID(HAIRSTYLE_DYNAMICS_FIXED_ROOTS),GeData(true),flags);
pObject->SetParameter(DescID(HAIRSTYLE_DYNAMICS_MASS),GeData(0.1),flags);
pObject->SetParameter(DescID(HAIRSTYLE_DYNAMICS_DRAG),GeData(0.1),flags);
pObject->SetParameter(DescID(HAIRSTYLE_DYNAMICS_ROOT_HOLD),GeData(0.1),flags);
pObject->SetParameter(DescID(HAIRSTYLE_DYNAMICS_STIFFNESS),GeData(0.1),flags);
pObject->SetParameter(DescID(HAIRSTYLE_DYNAMICS_REST_MIX),GeData(0.1),flags);
pObject->SetParameter(DescID(HAIRSTYLE_DYNAMICS_REST_HOLD),GeData(0.1),flags);
pObject->SetParameter(DescID(HAIRSTYLE_DYNAMICS_ELASTIC_LIMIT),GeData(0.1),flags);
pObject->SetParameter(DescID(HAIRSTYLE_DYNAMICS_ELASTIC_DEFORM),GeData(0.1),flags);
pObject->SetParameter(DescID(HAIRSTYLE_DYNAMICS_AUTOTIME),GeData(true),flags);
pObject->SetParameter(DescID(HAIRSTYLE_DYNAMICS_FRAMES),GeData(1),flags);
pObject->SetParameter(DescID(HAIRSTYLE_DYNAMICS_APPLY),GeData(HAIRSTYLE_DYNAMICS_APPLY_GUIDES),flags);
pObject->SetParameter(DescID(HAIRSTYLE_DYNAMICS_CUSTOM),GeData(true),flags);
pObject->SetParameter(DescID(HAIRSTYLE_DYNAMICS_SEGMENTS),GeData(1),flags);
pObject->SetParameter(DescID(HAIRSTYLE_DYNAMICS_SUBDIV),GeData(1),flags);
pObject->SetParameter(DescID(HAIRSTYLE_DYNAMICS_ITERATIONS),GeData(1),flags);
pObject->SetParameter(DescID(HAIRSTYLE_DYNAMICS_FORCES_HAIR),GeData(true),flags);
pObject->SetParameter(DescID(HAIRSTYLE_DYNAMICS_FORCES_OBJECTS),GeData(true),flags);
pObject->SetParameter(DescID(HAIRSTYLE_DYNAMICS_GRAVITY),GeData(0.1),flags);
pObject->SetParameter(DescID(HAIRSTYLE_DYNAMICS_FORCES_RADIUS),GeData(0.1),flags);
pObject->SetParameter(DescID(HAIRSTYLE_DYNAMICS_FORCES_STRENGTH),GeData(0.1),flags);
pObject->SetParameter(DescID(HAIRSTYLE_DYNAMICS_FORCES_MAXSTRENGTH),GeData(0.1),flags);
pObject->SetParameter(DescID(HAIRSTYLE_DYNAMICS_FORCES_FALLOFF),GeData(HAIRSTYLE_DYNAMICS_FORCES_FALLOFF_CONSTANT),flags);
pObject->SetParameter(DescID(HAIRSTYLE_DYNAMICS_FORCES_INCEXC),GeData(HAIRSTYLE_DYNAMICS_FORCES_INCEXC_INCLUDE),flags);
pObject->SetParameter(DescID(HAIRSTYLE_DYNAMICS_CACHE_ENABLE),GeData(true),flags);
pObject->SetParameter(DescID(HAIRSTYLE_DYNAMICS_CACHE_COMPRESSED),GeData(true),flags);
pObject->SetParameter(DescID(HAIRSTYLE_DYNAMICS_EDITABLE),GeData(true),flags);
pObject->SetParameter(DescID(HAIRSTYLE_DYNAMICS_CACHE_CACHE_LIMIT),GeData(1),flags);
pObject->SetParameter(DescID(HAIRSTYLE_PARTINGS_AUTO),GeData(true),flags);
pObject->SetParameter(DescID(HAIRSTYLE_PARTINGS_DISTANCE),GeData(0.1),flags);
pObject->SetParameter(DescID(HAIRSTYLE_PARTINGS_ANGLE),GeData(0.1),flags);
pObject->SetParameter(DescID(HAIRSTYLE_GENERATE_CULL_BACKFACING),GeData(true),flags);
pObject->SetParameter(DescID(HAIRSTYLE_GENERATE_CULL_OFFSCREEN),GeData(true),flags);
pObject->SetParameter(DescID(HAIRSTYLE_GENERATE_CULL_DISTANCE),GeData(true),flags);
pObject->SetParameter(DescID(HAIRSTYLE_GENERATE_CULL_BACKFACING_FADE),GeData(0.1),flags);
pObject->SetParameter(DescID(HAIRSTYLE_GENERATE_CULL_BACKFACING_FADE_END),GeData(0.1),flags);
pObject->SetParameter(DescID(HAIRSTYLE_GENERATE_CULL_DISTANCE_NEARCLIP),GeData(0.1),flags);
pObject->SetParameter(DescID(HAIRSTYLE_GENERATE_CULL_DISTANCE_NEARCLIP_FADE),GeData(0.1),flags);
pObject->SetParameter(DescID(HAIRSTYLE_GENERATE_CULL_DISTANCE_FARCLIP),GeData(0.1),flags);
pObject->SetParameter(DescID(HAIRSTYLE_GENERATE_CULL_DISTANCE_FARCLIP_FADE),GeData(0.1),flags);
pObject->SetParameter(DescID(HAIRSTYLE_GENERATE_CULL_OFFSCREEN_PERCENT),GeData(0.1),flags);
pObject->SetParameter(DescID(HAIRSTYLE_SEED),GeData(1),flags);
pObject->SetParameter(DescID(HAIRSTYLE_ROOTS_GENERATE_ITERATIONS),GeData(1),flags);
pObject->SetParameter(DescID(HAIRSTYLE_DEFORMERS_ENABLE),GeData(true),flags);
pObject->SetParameter(DescID(HAIRSTYLE_DEFORMERS_STRENGTH),GeData(0.1),flags);
pObject->Message(MSG_UPDATE);
//Second way, using the base container.
BaseContainer *bc = pObject->GetDataInstance();
bc->SetInt32(HAIRSTYLE_COUNT,1);
bc->SetInt32(HAIRSTYLE_SEGMENTS,1);
bc->SetFloat(HAIRSTYLE_LENGTH,0.1);
bc->SetInt32(HAIRSTYLE_ROOT_PLACEMENT,HAIRSTYLE_ROOT_PLACEMENT_FACE);
bc->SetInt32(HAIRSTYLE_ROOT_REMAPPING,HAIRSTYLE_ROOT_REMAPPING_NEW);
bc->SetFloat(HAIRSTYLE_UV_U_SPACING,0.1);
bc->SetFloat(HAIRSTYLE_UV_V_SPACING,0.1);
bc->SetFloat(HAIRSTYLE_UV_U_VAR,0.1);
bc->SetFloat(HAIRSTYLE_UV_V_VAR,0.1);
bc->SetInt32(HAIRSTYLE_GROWTH,HAIRSTYLE_GROWTH_NORMALS);
bc->SetInt32(HAIRSTYLE_GROWTH_DIRECTION_TYPE,HAIRSTYLE_GROWTH_DIRECTION_X);
bc->SetBool(HAIRSTYLE_GROWTH_DIRECTION_LOCAL,true);
bc->SetBool(HAIRSTYLE_ROOT_MIN_SPACING,true);
bc->SetFloat(HAIRSTYLE_ROOT_DISTANCE,0.1);
bc->SetInt32(HAIRSTYLE_ROOT_DENSITY_LEVELS,1);
bc->SetInt32(HAIRSTYLE_SHELL_SEGMENT,1);
bc->SetBool(HAIRSTYLE_SYMMETRY_ENABLE,true);
bc->SetInt32(HAIRSTYLE_SYMMETRY_PLANE,HAIRSTYLE_SYMMETRY_PLANE_XY);
bc->SetBool(HAIRSTYLE_SYMMETRY_EDITOR,true);
bc->SetBool(HAIRSTYLE_SYMMETRY_ROOT,true);
bc->SetBool(HAIRSTYLE_UPDATE_AUTO,true);
bc->SetInt32(HAIRSTYLE_HAIR_COUNT,1);
bc->SetInt32(HAIRSTYLE_HAIR_SEGMENTS,1);
bc->SetInt32(HAIRSTYLE_HAIR_ROOT_PLACEMENT,HAIRSTYLE_ROOT_PLACEMENT_AUTO);
bc->SetBool(HAIRSTYLE_ROOTS_ASNORMALS,true);
bc->SetFloat(HAIRSTYLE_HAIR_UV_U_SPACING,0.1);
bc->SetFloat(HAIRSTYLE_HAIR_UV_V_SPACING,0.1);
bc->SetFloat(HAIRSTYLE_HAIR_UV_U_VAR,0.1);
bc->SetFloat(HAIRSTYLE_HAIR_UV_V_VAR,0.1);
bc->SetFloat(HAIRSTYLE_ROOT_OFFSET,0.1);
bc->SetFloat(HAIRSTYLE_ROOT_EXTEND,0.1);
bc->SetBool(HAIRSTYLE_HAIR_ROOT_NULL_INVALID,true);
bc->SetBool(HAIRSTYLE_HAIR_ROOT_MIN_SPACING,true);
bc->SetFloat(HAIRSTYLE_HAIR_ROOT_DISTANCE,0.1);
bc->SetInt32(HAIRSTYLE_HAIR_ROOT_DENSITY_LEVELS,1);
bc->SetBool(HAIRSTYLE_HAIR_ROOT_RESTICT,true);
bc->SetFloat(HAIRSTYLE_HAIR_ROOT_RESTRICT_DISTANCE,0.1);
bc->SetFloat(HAIRSTYLE_HAIR_ROOT_RESTRICT_COUNT,0.1);
bc->SetInt32(HAIRSTYLE_HAIR_ROOT_MULTIPLY,1);
bc->SetBool(HAIRSTYLE_HAIR_ROOT_MULTIPLY_SETROOTS,true);
bc->SetFloat(HAIRSTYLE_HAIR_ROOT_MULTI_ROOT,0.1);
bc->SetFloat(HAIRSTYLE_HAIR_ROOT_MULTI_TIP,0.1);
bc->SetFloat(HAIRSTYLE_HAIR_ROOT_MULTI_SCALE,0.1);
bc->SetFloat(HAIRSTYLE_HAIR_ROOT_MULTI_SCALE_VAR,0.1);
bc->SetInt32(HAIRSTYLE_INTERPOLATION_TYPE,HAIRSTYLE_INTERPOLATION_TYPE_LINEAR);
bc->SetInt32(HAIRSTYLE_INTERPOLATION_GUIDES,1);
bc->SetFloat(HAIRSTYLE_INTERPOLATION_VARIATION,0.1);
bc->SetBool(HAIRSTYLE_INTERPOLATION_CLUMP,true);
bc->SetBool(HAIRSTYLE_FUR,true);
bc->SetInt32(HAIRSTYLE_FUR_COUNT,1);
bc->SetBool(HAIRSTYLE_FUR_ONLY,true);
bc->SetBool(HAIRSTYLE_FUR_SHADOWS,true);
bc->SetBool(HAIRSTYLE_FUR_CACHE,true);
bc->SetFloat(HAIRSTYLE_FUR_SCALE,0.1);
bc->SetFloat(HAIRSTYLE_FUR_SCALE_VAR,0.1);
bc->SetFloat(HAIRSTYLE_FUR_THICKNESS,0.1);
bc->SetFloat(HAIRSTYLE_FUR_THICKNESS_VAR,0.1);
bc->SetBool(HAIRSTYLE_FUR_CLUMP,true);
bc->SetInt32(HAIRSTYLE_PREVIEW,HAIRSTYLE_PREVIEW_NONE);
bc->SetBool(HAIRSTYLE_PREVIEW_CACHE,true);
bc->SetBool(HAIRSTYLE_BACKFACING,true);
bc->SetBool(HAIRSTYLE_PREVIEW_NO_SHADING,true);
bc->SetBool(HAIRSTYLE_PREVIEW_GPU_ENHANCED_SHADING,true);
bc->SetFloat(HAIRSTYLE_PREVIEW_GPU_ENHANCED_SHADING_SPECULAR,0.1);
bc->SetFloat(HAIRSTYLE_PREVIEW_GPU_ENHANCED_SHADING_AO,0.1);
bc->SetFloat(HAIRSTYLE_PREVIEW_DETAIL,0.1);
bc->SetInt32(HAIRSTYLE_EDITOR_GENERATE,HAIRSTYLE_EDITOR_GENERATE_NONE);
bc->SetInt32(HAIRSTYLE_LOD_AFFECT,HAIRSTYLE_LOD_AFFECT_NONE);
bc->SetBool(HAIRSTYLE_EDITOR_ASRENDER,true);
bc->SetInt32(HAIRSTYLE_EDITOR_COUNT,1);
bc->SetInt32(HAIRSTYLE_EDITOR_SEGCOUNT,1);
bc->SetBool(HAIRSTYLE_RENDER_HAIR,true);
bc->SetInt32(HAIRSTYLE_GENERATE,HAIRSTYLE_GENERATE_NONE);
bc->SetBool(HAIRSTYLE_GENERATE_PERFRAME,true);
bc->SetInt32(HAIRSTYLE_INSTANCE_AXIS,HAIRSTYLE_INSTANCE_AXIS_X);
bc->SetInt32(HAIRSTYLE_INSTANCE_SCALING,HAIRSTYLE_INSTANCE_SCALING_UNIFORM);
bc->SetInt32(HAIRSTYLE_INSTANCE_DEFORM,HAIRSTYLE_INSTANCE_DEFORM_NONE);
bc->SetInt32(HAIRSTYLE_INSTANCE_HIERARCHY,HAIRSTYLE_INSTANCE_HIERARCHY_SINGLE);
bc->SetInt32(HAIRSTYLE_INSTANCE_REPEAT,1);
bc->SetBool(HAIRSTYLE_INSTANCE_MATERIALS,true);
bc->SetFloat(HAIRSTYLE_INSTANCE_START,0.1);
bc->SetFloat(HAIRSTYLE_INSTANCE_END,0.1);
bc->SetInt32(HAIRSTYLE_ROTATION,HAIRSTYLE_ROTATION_FREE);
bc->SetBool(HAIRSTYLE_ROTATION_LOCAL,true);
bc->SetBool(HAIRSTYLE_ROTATION_INVERT,true);
bc->SetBool(HAIRSTYLE_SINGLE_OBJECT,true);
bc->SetBool(HAIRSTYLE_CAP_START,true);
bc->SetBool(HAIRSTYLE_CAP_END,true);
bc->SetBool(HAIRSTYLE_SLICES,true);
bc->SetInt32(HAIRSTYLE_SLICE_NORMAL,HAIRSTYLE_SLICE_NORMAL_GUIDE);
bc->SetBool(HAIRSTYLE_DYNAMICS_ENABLE,true);
bc->SetBool(HAIRSTYLE_DYNAMICS_COLLISIONS,true);
bc->SetBool(HAIRSTYLE_DYNAMICS_EXTRA_STIFF,true);
bc->SetFloat(HAIRSTYLE_DYNAMICS_RADIUS,0.1);
bc->SetBool(HAIRSTYLE_DYNAMICS_FIXED_ROOTS,true);
bc->SetFloat(HAIRSTYLE_DYNAMICS_MASS,0.1);
bc->SetFloat(HAIRSTYLE_DYNAMICS_DRAG,0.1);
bc->SetFloat(HAIRSTYLE_DYNAMICS_ROOT_HOLD,0.1);
bc->SetFloat(HAIRSTYLE_DYNAMICS_STIFFNESS,0.1);
bc->SetFloat(HAIRSTYLE_DYNAMICS_REST_MIX,0.1);
bc->SetFloat(HAIRSTYLE_DYNAMICS_REST_HOLD,0.1);
bc->SetFloat(HAIRSTYLE_DYNAMICS_ELASTIC_LIMIT,0.1);
bc->SetFloat(HAIRSTYLE_DYNAMICS_ELASTIC_DEFORM,0.1);
bc->SetBool(HAIRSTYLE_DYNAMICS_AUTOTIME,true);
bc->SetInt32(HAIRSTYLE_DYNAMICS_FRAMES,1);
bc->SetInt32(HAIRSTYLE_DYNAMICS_APPLY,HAIRSTYLE_DYNAMICS_APPLY_GUIDES);
bc->SetBool(HAIRSTYLE_DYNAMICS_CUSTOM,true);
bc->SetInt32(HAIRSTYLE_DYNAMICS_SEGMENTS,1);
bc->SetInt32(HAIRSTYLE_DYNAMICS_SUBDIV,1);
bc->SetInt32(HAIRSTYLE_DYNAMICS_ITERATIONS,1);
bc->SetBool(HAIRSTYLE_DYNAMICS_FORCES_HAIR,true);
bc->SetBool(HAIRSTYLE_DYNAMICS_FORCES_OBJECTS,true);
bc->SetFloat(HAIRSTYLE_DYNAMICS_GRAVITY,0.1);
bc->SetFloat(HAIRSTYLE_DYNAMICS_FORCES_RADIUS,0.1);
bc->SetFloat(HAIRSTYLE_DYNAMICS_FORCES_STRENGTH,0.1);
bc->SetFloat(HAIRSTYLE_DYNAMICS_FORCES_MAXSTRENGTH,0.1);
bc->SetInt32(HAIRSTYLE_DYNAMICS_FORCES_FALLOFF,HAIRSTYLE_DYNAMICS_FORCES_FALLOFF_CONSTANT);
bc->SetInt32(HAIRSTYLE_DYNAMICS_FORCES_INCEXC,HAIRSTYLE_DYNAMICS_FORCES_INCEXC_INCLUDE);
bc->SetBool(HAIRSTYLE_DYNAMICS_CACHE_ENABLE,true);
bc->SetBool(HAIRSTYLE_DYNAMICS_CACHE_COMPRESSED,true);
bc->SetBool(HAIRSTYLE_DYNAMICS_EDITABLE,true);
bc->SetInt32(HAIRSTYLE_DYNAMICS_CACHE_CACHE_LIMIT,1);
bc->SetBool(HAIRSTYLE_PARTINGS_AUTO,true);
bc->SetFloat(HAIRSTYLE_PARTINGS_DISTANCE,0.1);
bc->SetFloat(HAIRSTYLE_PARTINGS_ANGLE,0.1);
bc->SetBool(HAIRSTYLE_GENERATE_CULL_BACKFACING,true);
bc->SetBool(HAIRSTYLE_GENERATE_CULL_OFFSCREEN,true);
bc->SetBool(HAIRSTYLE_GENERATE_CULL_DISTANCE,true);
bc->SetFloat(HAIRSTYLE_GENERATE_CULL_BACKFACING_FADE,0.1);
bc->SetFloat(HAIRSTYLE_GENERATE_CULL_BACKFACING_FADE_END,0.1);
bc->SetFloat(HAIRSTYLE_GENERATE_CULL_DISTANCE_NEARCLIP,0.1);
bc->SetFloat(HAIRSTYLE_GENERATE_CULL_DISTANCE_NEARCLIP_FADE,0.1);
bc->SetFloat(HAIRSTYLE_GENERATE_CULL_DISTANCE_FARCLIP,0.1);
bc->SetFloat(HAIRSTYLE_GENERATE_CULL_DISTANCE_FARCLIP_FADE,0.1);
bc->SetFloat(HAIRSTYLE_GENERATE_CULL_OFFSCREEN_PERCENT,0.1);
bc->SetInt32(HAIRSTYLE_SEED,1);
bc->SetInt32(HAIRSTYLE_ROOTS_GENERATE_ITERATIONS,1);
bc->SetBool(HAIRSTYLE_DEFORMERS_ENABLE,true);
bc->SetFloat(HAIRSTYLE_DEFORMERS_STRENGTH,0.1);
pObject->Message(MSG_UPDATE);
}
Buttons
This node has buttons. Buttons can manually be executed by calling the following code
Python
c4d.CallButton(obj,c4d.HAIRSTYLE_STATE_REROOT)
c4d.CallButton(obj,c4d.HAIRSTYLE_STATE_RESET)
c4d.CallButton(obj,c4d.HAIRSTYLE_STATE_STORE)
c4d.CallButton(obj,c4d.HAIRSTYLE_STATE_RESTORE)
c4d.CallButton(obj,c4d.HAIRSTYLE_STATE_CLEAR)
c4d.CallButton(obj,c4d.HAIRSTYLE_SYMMETRY_EDITABLE)
c4d.CallButton(obj,c4d.HAIRSTYLE_UPDATE)
c4d.CallButton(obj,c4d.HAIRSTYLE_DYNAMICS_RELAX)
c4d.CallButton(obj,c4d.HAIRSTYLE_DYNAMICS_CACHE_CALCULATE)
c4d.CallButton(obj,c4d.HAIRSTYLE_DYNAMICS_CACHE_DELETE)
c4d.CallButton(obj,c4d.HAIRSTYLE_DYNAMICS_CACHE_CACHE_FRAME)
c4d.CallButton(obj,c4d.HAIRSTYLE_DYNAMICS_CACHE_CACHE_LOAD)
c4d.CallButton(obj,c4d.HAIRSTYLE_DYNAMICS_CACHE_CACHE_SAVE)
C++
DescriptionCommand dc;
dc.id = DescID(HAIRSTYLE_STATE_REROOT);
pObject->Message(MSG_DESCRIPTION_COMMAND, &dc);
DescriptionCommand dc;
dc.id = DescID(HAIRSTYLE_STATE_RESET);
pObject->Message(MSG_DESCRIPTION_COMMAND, &dc);
DescriptionCommand dc;
dc.id = DescID(HAIRSTYLE_STATE_STORE);
pObject->Message(MSG_DESCRIPTION_COMMAND, &dc);
DescriptionCommand dc;
dc.id = DescID(HAIRSTYLE_STATE_RESTORE);
pObject->Message(MSG_DESCRIPTION_COMMAND, &dc);
DescriptionCommand dc;
dc.id = DescID(HAIRSTYLE_STATE_CLEAR);
pObject->Message(MSG_DESCRIPTION_COMMAND, &dc);
DescriptionCommand dc;
dc.id = DescID(HAIRSTYLE_SYMMETRY_EDITABLE);
pObject->Message(MSG_DESCRIPTION_COMMAND, &dc);
DescriptionCommand dc;
dc.id = DescID(HAIRSTYLE_UPDATE);
pObject->Message(MSG_DESCRIPTION_COMMAND, &dc);
DescriptionCommand dc;
dc.id = DescID(HAIRSTYLE_DYNAMICS_RELAX);
pObject->Message(MSG_DESCRIPTION_COMMAND, &dc);
DescriptionCommand dc;
dc.id = DescID(HAIRSTYLE_DYNAMICS_CACHE_CALCULATE);
pObject->Message(MSG_DESCRIPTION_COMMAND, &dc);
DescriptionCommand dc;
dc.id = DescID(HAIRSTYLE_DYNAMICS_CACHE_DELETE);
pObject->Message(MSG_DESCRIPTION_COMMAND, &dc);
DescriptionCommand dc;
dc.id = DescID(HAIRSTYLE_DYNAMICS_CACHE_CACHE_FRAME);
pObject->Message(MSG_DESCRIPTION_COMMAND, &dc);
DescriptionCommand dc;
dc.id = DescID(HAIRSTYLE_DYNAMICS_CACHE_CACHE_LOAD);
pObject->Message(MSG_DESCRIPTION_COMMAND, &dc);
DescriptionCommand dc;
dc.id = DescID(HAIRSTYLE_DYNAMICS_CACHE_CACHE_SAVE);
pObject->Message(MSG_DESCRIPTION_COMMAND, &dc);