Mhairmaterial
Attributes
-
ENGLISH NAME : HairMaterial
-
NAME : Mhairmaterial
-
INCLUDE : Mpreview
-
INCLUDE : Mbase
-
PATH : hair/description/mhairmaterial.res
-
PLUGIN : hair
-
MAXON online help (may not exist): MHAIRMATERIAL
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():
material = c4d.BaseMaterial(c4d.Mhairmaterial)
#You can set parameters two different ways.
#First way
material[c4d.HAIRMATERIAL_USE_COLOR] = True
material[c4d.HAIRMATERIAL_USE_BACK_COLOR] = True
material[c4d.HAIRMATERIAL_USE_LIGHTING] = True
material[c4d.HAIRMATERIAL_USE_TRANSPARENCY] = True
material[c4d.HAIRMATERIAL_USE_THICKNESS] = True
material[c4d.HAIRMATERIAL_USE_LENGTH] = True
material[c4d.HAIRMATERIAL_USE_SCALE] = True
material[c4d.HAIRMATERIAL_USE_FRIZZ] = True
material[c4d.HAIRMATERIAL_USE_KINK] = True
material[c4d.HAIRMATERIAL_USE_DENSITY] = True
material[c4d.HAIRMATERIAL_USE_CLUMP] = True
material[c4d.HAIRMATERIAL_USE_TIGHTEN] = True
material[c4d.HAIRMATERIAL_USE_DISPLACE] = True
material[c4d.HAIRMATERIAL_USE_BEND] = True
material[c4d.HAIRMATERIAL_USE_CURL] = True
material[c4d.HAIRMATERIAL_USE_TWIST] = True
material[c4d.HAIRMATERIAL_USE_WAVE] = True
material[c4d.HAIRMATERIAL_USE_STRAIGHTEN] = True
material[c4d.HAIRMATERIAL_PAGE_ASSIGNMENT] = True
material[c4d.HAIRMATERIAL_MATERIAL_PAGE_ILLUMINATION] = True
material[c4d.HAIRMATERIAL_COLOR_BRIGHTNESS] = 0.1
material[c4d.HAIRMATERIAL_COLOR_BLEND] = c4d.HAIRMATERIAL_BLENDMODE_AVERAGE
material[c4d.HAIRMATERIAL_COLOR_MIX] = 0.1
material[c4d.HAIRMATERIAL_H_VAR] = 0.1
material[c4d.HAIRMATERIAL_S_VAR] = 0.1
material[c4d.HAIRMATERIAL_V_VAR] = 0.1
material[c4d.HAIRMATERIAL_ROOTS_COLOR_BLEND] = c4d.HAIRMATERIAL_BLENDMODE_AVERAGE
material[c4d.HAIRMATERIAL_ROOTS_COLOR_MIX] = 0.1
material[c4d.HAIRMATERIAL_COLOR_HAIR_TIPS_LINK] = True
material[c4d.HAIRMATERIAL_TIPS_COLOR_BLEND] = c4d.HAIRMATERIAL_BLENDMODE_AVERAGE
material[c4d.HAIRMATERIAL_TIPS_COLOR_MIX] = 0.1
material[c4d.HAIRMATERIAL_MUTANT_LEVEL] = 0.1
material[c4d.HAIRMATERIAL_MUTANT_BLEND] = c4d.HAIRMATERIAL_BLENDMODE_AVERAGE
material[c4d.HAIRMATERIAL_MUTANT_MIX] = 0.1
material[c4d.HAIRMATERIAL_COLOR_SURFACE] = True
material[c4d.HAIRMATERIAL_COLOR_SURFACE_COLOR] = True
material[c4d.HAIRMATERIAL_COLOR_SURFACE_ILLUMINATION] = True
material[c4d.HAIRMATERIAL_COLOR_SURFACE_SHADOW] = True
material[c4d.HAIRMATERIAL_SURFACE_BLEND] = c4d.HAIRMATERIAL_BLENDMODE_AVERAGE
material[c4d.HAIRMATERIAL_SURFACE_MIX] = 0.1
material[c4d.HAIRMATERIAL_BACK_FRONT_COLOR_BLEND] = c4d.HAIRMATERIAL_BLENDMODE_AVERAGE
material[c4d.HAIRMATERIAL_BACK_FRONT_COLOR_MIX] = 0.1
material[c4d.HAIRMATERIAL_BACK_COLOR_BRIGHTNESS] = 0.1
material[c4d.HAIRMATERIAL_BACK_COLOR_BLEND] = c4d.HAIRMATERIAL_BLENDMODE_AVERAGE
material[c4d.HAIRMATERIAL_BACK_COLOR_MIX] = 0.1
material[c4d.HAIRMATERIAL_BACK_H_VAR] = 0.1
material[c4d.HAIRMATERIAL_BACK_S_VAR] = 0.1
material[c4d.HAIRMATERIAL_BACK_V_VAR] = 0.1
material[c4d.HAIRMATERIAL_ROOTS_BACK_COLOR_BLEND] = c4d.HAIRMATERIAL_BLENDMODE_AVERAGE
material[c4d.HAIRMATERIAL_ROOTS_BACK_COLOR_MIX] = 0.1
material[c4d.HAIRMATERIAL_BACK_COLOR_HAIR_TIPS_LINK] = True
material[c4d.HAIRMATERIAL_TIPS_BACK_COLOR_BLEND] = c4d.HAIRMATERIAL_BLENDMODE_AVERAGE
material[c4d.HAIRMATERIAL_TIPS_BACK_COLOR_MIX] = 0.1
material[c4d.HAIRMATERIAL_BACK_MUTANT_BLEND] = c4d.HAIRMATERIAL_BLENDMODE_AVERAGE
material[c4d.HAIRMATERIAL_BACK_MUTANT_MIX] = 0.1
material[c4d.HAIRMATERIAL_BACK_COLOR_SURFACE] = True
material[c4d.HAIRMATERIAL_BACK_COLOR_SURFACE_COLOR] = True
material[c4d.HAIRMATERIAL_BACK_COLOR_SURFACE_ILLUMINATION] = True
material[c4d.HAIRMATERIAL_BACK_COLOR_SURFACE_SHADOW] = True
material[c4d.HAIRMATERIAL_BACK_SURFACE_BLEND] = c4d.HAIRMATERIAL_BLENDMODE_AVERAGE
material[c4d.HAIRMATERIAL_BACK_SURFACE_MIX] = 0.1
material[c4d.HAIRMATERIAL_LIGHTING_SPECULAR_STRENGTH] = 0.1
material[c4d.HAIRMATERIAL_LIGHTING_SPECULAR_POWER] = 0.1
material[c4d.HAIRMATERIAL_LIGHTING_SPECULAR_BLEND] = c4d.HAIRMATERIAL_BLENDMODE_AVERAGE
material[c4d.HAIRMATERIAL_LIGHTING_SPECULAR_MIX] = 0.1
material[c4d.HAIRMATERIAL_LIGHTING_ISPECULAR_STRENGTH] = 0.1
material[c4d.HAIRMATERIAL_LIGHTING_ISPECULAR_POWER] = 0.1
material[c4d.HAIRMATERIAL_LIGHTING_ISPECULAR_BLEND] = c4d.HAIRMATERIAL_BLENDMODE_AVERAGE
material[c4d.HAIRMATERIAL_LIGHTING_ISPECULAR_MIX] = 0.1
material[c4d.HAIRMATERIAL_LIGHTING_SPECULAR_BACK] = 0.1
material[c4d.HAIRMATERIAL_LIGHTING_TRANSPARENCY] = 0.1
material[c4d.HAIRMATERIAL_LIGHTING_TRANSPARENCY_INVERT] = True
material[c4d.HAIRMATERIAL_LIGHTING_TRANSPARENCY_BLEND] = c4d.HAIRMATERIAL_BLENDMODE_AVERAGE
material[c4d.HAIRMATERIAL_LIGHTING_TRANSPARENCY_MIX] = 0.1
material[c4d.HAIRMATERIAL_THICKNESS_ROOT] = 0.1
material[c4d.HAIRMATERIAL_THICKNESS_TIP] = 0.1
material[c4d.HAIRMATERIAL_THICKNESS_VAR] = 0.1
material[c4d.HAIRMATERIAL_LENGTH] = 0.1
material[c4d.HAIRMATERIAL_LENGTH_VAR] = 0.1
material[c4d.HAIRMATERIAL_LENGTH_AMOUNT] = 0.1
material[c4d.HAIRMATERIAL_SCALE] = 0.1
material[c4d.HAIRMATERIAL_SCALE_VAR] = 0.1
material[c4d.HAIRMATERIAL_SCALE_AMOUNT] = 0.1
material[c4d.HAIRMATERIAL_FRIZZ] = 0.1
material[c4d.HAIRMATERIAL_FRIZZ_VAR] = 0.1
material[c4d.HAIRMATERIAL_FRIZZ_SCALE_X] = 0.1
material[c4d.HAIRMATERIAL_FRIZZ_SCALE_Y] = 0.1
material[c4d.HAIRMATERIAL_FRIZZ_AMOUNT] = 0.1
material[c4d.HAIRMATERIAL_KINK] = 0.1
material[c4d.HAIRMATERIAL_KINK_VAR] = 0.1
material[c4d.HAIRMATERIAL_KINK_SCALE_X] = 0.1
material[c4d.HAIRMATERIAL_KINK_SCALE_Y] = 0.1
material[c4d.HAIRMATERIAL_KINK_AMOUNT] = 0.1
material[c4d.HAIRMATERIAL_DENSITY] = 0.1
material[c4d.HAIRMATERIAL_DENSITY_LEVELS] = 1
material[c4d.HAIRMATERIAL_CLUMP_NUMBER] = 0.1
material[c4d.HAIRMATERIAL_CLUMP] = 0.1
material[c4d.HAIRMATERIAL_CLUMP_VAR] = 0.1
material[c4d.HAIRMATERIAL_CLUMP_RADIUS] = 0.1
material[c4d.HAIRMATERIAL_CLUMP_RADIUS_VAR] = 0.1
material[c4d.HAIRMATERIAL_CLUMP_TWIST] = 0.1
material[c4d.HAIRMATERIAL_CLUMP_TWIST_VAR] = 0.1
material[c4d.HAIRMATERIAL_CLUMP_MAX] = 1
material[c4d.HAIRMATERIAL_CLUMP_INC_ROOTS] = True
material[c4d.HAIRMATERIAL_CLUMP_RETAIN_LENGTH] = True
material[c4d.HAIRMATERIAL_TIGHTEN] = 0.1
material[c4d.HAIRMATERIAL_TIGHTEN_VAR] = 0.1
material[c4d.HAIRMATERIAL_TIGHTEN_AMOUNT] = 0.1
material[c4d.HAIRMATERIAL_DISPLACE_DIRECTION] = c4d.HAIRMATERIAL_DISPLACE_DIRECTION_WORLD
material[c4d.HAIRMATERIAL_DISPLACE_RELATIVE] = True
material[c4d.HAIRMATERIAL_DISPLACE_ABS] = 0.1
material[c4d.HAIRMATERIAL_DISPLACE_ABS_VAR] = 0.1
material[c4d.HAIRMATERIAL_DISPLACE] = 0.1
material[c4d.HAIRMATERIAL_DISPLACE_VAR] = 0.1
material[c4d.HAIRMATERIAL_DISPLACE_AMOUNT] = 0.1
material[c4d.HAIRMATERIAL_DISPLACE_ROOT] = True
material[c4d.HAIRMATERIAL_DISPLACE_ADDITIVE] = True
material[c4d.HAIRMATERIAL_DISPLACE_SCALE_SEGMENTS] = True
material[c4d.HAIRMATERIAL_BEND] = 0.1
material[c4d.HAIRMATERIAL_BEND_VAR] = 0.1
material[c4d.HAIRMATERIAL_BEND_AMOUNT] = 0.1
material[c4d.HAIRMATERIAL_BEND_DIRECTION] = c4d.HAIRMATERIAL_BEND_DIRECTION_WORLD
material[c4d.HAIRMATERIAL_BEND_DN_VAR] = 0.1
material[c4d.HAIRMATERIAL_BEND_DIRECTION_AXIS] = c4d.HAIRMATERIAL_BEND_DIRECTION_AXIS_X
material[c4d.HAIRMATERIAL_BEND_ROOT] = True
material[c4d.HAIRMATERIAL_CURL] = 0.1
material[c4d.HAIRMATERIAL_CURL_VAR] = 0.1
material[c4d.HAIRMATERIAL_CURL_AMOUNT] = 0.1
material[c4d.HAIRMATERIAL_CURL_DIRECTION] = c4d.HAIRMATERIAL_CURL_DIRECTION_WORLD
material[c4d.HAIRMATERIAL_CURL_DN_VAR] = 0.1
material[c4d.HAIRMATERIAL_CURL_DIRECTION_AXIS] = c4d.HAIRMATERIAL_CURL_DIRECTION_AXIS_X
material[c4d.HAIRMATERIAL_TWIST_AROUND] = c4d.HAIRMATERIAL_TWIST_AROUND_NORMAL
material[c4d.HAIRMATERIAL_TWIST_KEEP_LENGTH] = True
material[c4d.HAIRMATERIAL_TWIST] = 0.1
material[c4d.HAIRMATERIAL_TWIST_VAR] = 0.1
material[c4d.HAIRMATERIAL_TWIST_AMOUNT] = 0.1
material[c4d.HAIRMATERIAL_WAVE] = 0.1
material[c4d.HAIRMATERIAL_WAVE_VAR] = 0.1
material[c4d.HAIRMATERIAL_WAVE_X] = 0.1
material[c4d.HAIRMATERIAL_WAVE_Y] = 0.1
material[c4d.HAIRMATERIAL_WAVE_AMOUNT] = 0.1
material[c4d.HAIRMATERIAL_WAVE_PHASE_X] = 0.1
material[c4d.HAIRMATERIAL_WAVE_PHASE_Y] = 0.1
material[c4d.HAIRMATERIAL_WAVE_FREQ_X] = 0.1
material[c4d.HAIRMATERIAL_WAVE_FREQ_Y] = 0.1
material[c4d.HAIRMATERIAL_STRAIGHTEN_TOWARDS] = c4d.HAIRMATERIAL_STRAIGHTEN_TOWARDS_ROOT
material[c4d.HAIRMATERIAL_STRAIGHTEN_AMOUNT] = 0.1
material[c4d.HAIRMATERIAL_STRAIGHTEN_STRENGTH] = 0.1
material[c4d.HAIRMATERIAL_STRAIGHTEN_STRENGTH_VAR] = 0.1
material[c4d.HAIRMATERIAL_MATERIAL_GLOBALILLUM_RECEIVE] = True
material[c4d.HAIRMATERIAL_MATERIAL_GLOBALILLUM_RECEIVE_STRENGTH] = 0.1
material[c4d.HAIRMATERIAL_LIGHTING_DIFFUSE_STRENGTH] = 0.1
material[c4d.HAIRMATERIAL_LIGHTING_ROUGHNESS] = 0.1
material[c4d.HAIRMATERIAL_LIGHTING_ROUGHNESS_VAR] = 0.1
material[c4d.HAIRMATERIAL_LIGHTING_REFLECT] = 0.1
material[c4d.HAIRMATERIAL_LIGHTING_TRANSMIT] = 0.1
material[c4d.HAIRMATERIAL_LIGHTING_SHADOWDENSITY] = 0.1
material[c4d.HAIRMATERIAL_LIGHTING_SHADOW] = 0.1
material[c4d.HAIRMATERIAL_LIGHTING_SELF_SHADOW] = 0.1
material[c4d.HAIRMATERIAL_LIGHTING_BACK_SHADOW] = 0.1
#Second way, using the base container.
bc = material.GetDataInstance()
bc.SetBool(c4d.HAIRMATERIAL_USE_COLOR,True)
bc.SetBool(c4d.HAIRMATERIAL_USE_BACK_COLOR,True)
bc.SetBool(c4d.HAIRMATERIAL_USE_LIGHTING,True)
bc.SetBool(c4d.HAIRMATERIAL_USE_TRANSPARENCY,True)
bc.SetBool(c4d.HAIRMATERIAL_USE_THICKNESS,True)
bc.SetBool(c4d.HAIRMATERIAL_USE_LENGTH,True)
bc.SetBool(c4d.HAIRMATERIAL_USE_SCALE,True)
bc.SetBool(c4d.HAIRMATERIAL_USE_FRIZZ,True)
bc.SetBool(c4d.HAIRMATERIAL_USE_KINK,True)
bc.SetBool(c4d.HAIRMATERIAL_USE_DENSITY,True)
bc.SetBool(c4d.HAIRMATERIAL_USE_CLUMP,True)
bc.SetBool(c4d.HAIRMATERIAL_USE_TIGHTEN,True)
bc.SetBool(c4d.HAIRMATERIAL_USE_DISPLACE,True)
bc.SetBool(c4d.HAIRMATERIAL_USE_BEND,True)
bc.SetBool(c4d.HAIRMATERIAL_USE_CURL,True)
bc.SetBool(c4d.HAIRMATERIAL_USE_TWIST,True)
bc.SetBool(c4d.HAIRMATERIAL_USE_WAVE,True)
bc.SetBool(c4d.HAIRMATERIAL_USE_STRAIGHTEN,True)
bc.SetBool(c4d.HAIRMATERIAL_PAGE_ASSIGNMENT,True)
bc.SetBool(c4d.HAIRMATERIAL_MATERIAL_PAGE_ILLUMINATION,True)
bc.SetFloat(c4d.HAIRMATERIAL_COLOR_BRIGHTNESS,0.1)
bc.SetInt32(c4d.HAIRMATERIAL_COLOR_BLEND,c4d.HAIRMATERIAL_BLENDMODE_AVERAGE)
bc.SetFloat(c4d.HAIRMATERIAL_COLOR_MIX,0.1)
bc.SetFloat(c4d.HAIRMATERIAL_H_VAR,0.1)
bc.SetFloat(c4d.HAIRMATERIAL_S_VAR,0.1)
bc.SetFloat(c4d.HAIRMATERIAL_V_VAR,0.1)
bc.SetInt32(c4d.HAIRMATERIAL_ROOTS_COLOR_BLEND,c4d.HAIRMATERIAL_BLENDMODE_AVERAGE)
bc.SetFloat(c4d.HAIRMATERIAL_ROOTS_COLOR_MIX,0.1)
bc.SetBool(c4d.HAIRMATERIAL_COLOR_HAIR_TIPS_LINK,True)
bc.SetInt32(c4d.HAIRMATERIAL_TIPS_COLOR_BLEND,c4d.HAIRMATERIAL_BLENDMODE_AVERAGE)
bc.SetFloat(c4d.HAIRMATERIAL_TIPS_COLOR_MIX,0.1)
bc.SetFloat(c4d.HAIRMATERIAL_MUTANT_LEVEL,0.1)
bc.SetInt32(c4d.HAIRMATERIAL_MUTANT_BLEND,c4d.HAIRMATERIAL_BLENDMODE_AVERAGE)
bc.SetFloat(c4d.HAIRMATERIAL_MUTANT_MIX,0.1)
bc.SetBool(c4d.HAIRMATERIAL_COLOR_SURFACE,True)
bc.SetBool(c4d.HAIRMATERIAL_COLOR_SURFACE_COLOR,True)
bc.SetBool(c4d.HAIRMATERIAL_COLOR_SURFACE_ILLUMINATION,True)
bc.SetBool(c4d.HAIRMATERIAL_COLOR_SURFACE_SHADOW,True)
bc.SetInt32(c4d.HAIRMATERIAL_SURFACE_BLEND,c4d.HAIRMATERIAL_BLENDMODE_AVERAGE)
bc.SetFloat(c4d.HAIRMATERIAL_SURFACE_MIX,0.1)
bc.SetInt32(c4d.HAIRMATERIAL_BACK_FRONT_COLOR_BLEND,c4d.HAIRMATERIAL_BLENDMODE_AVERAGE)
bc.SetFloat(c4d.HAIRMATERIAL_BACK_FRONT_COLOR_MIX,0.1)
bc.SetFloat(c4d.HAIRMATERIAL_BACK_COLOR_BRIGHTNESS,0.1)
bc.SetInt32(c4d.HAIRMATERIAL_BACK_COLOR_BLEND,c4d.HAIRMATERIAL_BLENDMODE_AVERAGE)
bc.SetFloat(c4d.HAIRMATERIAL_BACK_COLOR_MIX,0.1)
bc.SetFloat(c4d.HAIRMATERIAL_BACK_H_VAR,0.1)
bc.SetFloat(c4d.HAIRMATERIAL_BACK_S_VAR,0.1)
bc.SetFloat(c4d.HAIRMATERIAL_BACK_V_VAR,0.1)
bc.SetInt32(c4d.HAIRMATERIAL_ROOTS_BACK_COLOR_BLEND,c4d.HAIRMATERIAL_BLENDMODE_AVERAGE)
bc.SetFloat(c4d.HAIRMATERIAL_ROOTS_BACK_COLOR_MIX,0.1)
bc.SetBool(c4d.HAIRMATERIAL_BACK_COLOR_HAIR_TIPS_LINK,True)
bc.SetInt32(c4d.HAIRMATERIAL_TIPS_BACK_COLOR_BLEND,c4d.HAIRMATERIAL_BLENDMODE_AVERAGE)
bc.SetFloat(c4d.HAIRMATERIAL_TIPS_BACK_COLOR_MIX,0.1)
bc.SetInt32(c4d.HAIRMATERIAL_BACK_MUTANT_BLEND,c4d.HAIRMATERIAL_BLENDMODE_AVERAGE)
bc.SetFloat(c4d.HAIRMATERIAL_BACK_MUTANT_MIX,0.1)
bc.SetBool(c4d.HAIRMATERIAL_BACK_COLOR_SURFACE,True)
bc.SetBool(c4d.HAIRMATERIAL_BACK_COLOR_SURFACE_COLOR,True)
bc.SetBool(c4d.HAIRMATERIAL_BACK_COLOR_SURFACE_ILLUMINATION,True)
bc.SetBool(c4d.HAIRMATERIAL_BACK_COLOR_SURFACE_SHADOW,True)
bc.SetInt32(c4d.HAIRMATERIAL_BACK_SURFACE_BLEND,c4d.HAIRMATERIAL_BLENDMODE_AVERAGE)
bc.SetFloat(c4d.HAIRMATERIAL_BACK_SURFACE_MIX,0.1)
bc.SetFloat(c4d.HAIRMATERIAL_LIGHTING_SPECULAR_STRENGTH,0.1)
bc.SetFloat(c4d.HAIRMATERIAL_LIGHTING_SPECULAR_POWER,0.1)
bc.SetInt32(c4d.HAIRMATERIAL_LIGHTING_SPECULAR_BLEND,c4d.HAIRMATERIAL_BLENDMODE_AVERAGE)
bc.SetFloat(c4d.HAIRMATERIAL_LIGHTING_SPECULAR_MIX,0.1)
bc.SetFloat(c4d.HAIRMATERIAL_LIGHTING_ISPECULAR_STRENGTH,0.1)
bc.SetFloat(c4d.HAIRMATERIAL_LIGHTING_ISPECULAR_POWER,0.1)
bc.SetInt32(c4d.HAIRMATERIAL_LIGHTING_ISPECULAR_BLEND,c4d.HAIRMATERIAL_BLENDMODE_AVERAGE)
bc.SetFloat(c4d.HAIRMATERIAL_LIGHTING_ISPECULAR_MIX,0.1)
bc.SetFloat(c4d.HAIRMATERIAL_LIGHTING_SPECULAR_BACK,0.1)
bc.SetFloat(c4d.HAIRMATERIAL_LIGHTING_TRANSPARENCY,0.1)
bc.SetBool(c4d.HAIRMATERIAL_LIGHTING_TRANSPARENCY_INVERT,True)
bc.SetInt32(c4d.HAIRMATERIAL_LIGHTING_TRANSPARENCY_BLEND,c4d.HAIRMATERIAL_BLENDMODE_AVERAGE)
bc.SetFloat(c4d.HAIRMATERIAL_LIGHTING_TRANSPARENCY_MIX,0.1)
bc.SetFloat(c4d.HAIRMATERIAL_THICKNESS_ROOT,0.1)
bc.SetFloat(c4d.HAIRMATERIAL_THICKNESS_TIP,0.1)
bc.SetFloat(c4d.HAIRMATERIAL_THICKNESS_VAR,0.1)
bc.SetFloat(c4d.HAIRMATERIAL_LENGTH,0.1)
bc.SetFloat(c4d.HAIRMATERIAL_LENGTH_VAR,0.1)
bc.SetFloat(c4d.HAIRMATERIAL_LENGTH_AMOUNT,0.1)
bc.SetFloat(c4d.HAIRMATERIAL_SCALE,0.1)
bc.SetFloat(c4d.HAIRMATERIAL_SCALE_VAR,0.1)
bc.SetFloat(c4d.HAIRMATERIAL_SCALE_AMOUNT,0.1)
bc.SetFloat(c4d.HAIRMATERIAL_FRIZZ,0.1)
bc.SetFloat(c4d.HAIRMATERIAL_FRIZZ_VAR,0.1)
bc.SetFloat(c4d.HAIRMATERIAL_FRIZZ_SCALE_X,0.1)
bc.SetFloat(c4d.HAIRMATERIAL_FRIZZ_SCALE_Y,0.1)
bc.SetFloat(c4d.HAIRMATERIAL_FRIZZ_AMOUNT,0.1)
bc.SetFloat(c4d.HAIRMATERIAL_KINK,0.1)
bc.SetFloat(c4d.HAIRMATERIAL_KINK_VAR,0.1)
bc.SetFloat(c4d.HAIRMATERIAL_KINK_SCALE_X,0.1)
bc.SetFloat(c4d.HAIRMATERIAL_KINK_SCALE_Y,0.1)
bc.SetFloat(c4d.HAIRMATERIAL_KINK_AMOUNT,0.1)
bc.SetFloat(c4d.HAIRMATERIAL_DENSITY,0.1)
bc.SetInt32(c4d.HAIRMATERIAL_DENSITY_LEVELS,1)
bc.SetFloat(c4d.HAIRMATERIAL_CLUMP_NUMBER,0.1)
bc.SetFloat(c4d.HAIRMATERIAL_CLUMP,0.1)
bc.SetFloat(c4d.HAIRMATERIAL_CLUMP_VAR,0.1)
bc.SetFloat(c4d.HAIRMATERIAL_CLUMP_RADIUS,0.1)
bc.SetFloat(c4d.HAIRMATERIAL_CLUMP_RADIUS_VAR,0.1)
bc.SetFloat(c4d.HAIRMATERIAL_CLUMP_TWIST,0.1)
bc.SetFloat(c4d.HAIRMATERIAL_CLUMP_TWIST_VAR,0.1)
bc.SetInt32(c4d.HAIRMATERIAL_CLUMP_MAX,1)
bc.SetBool(c4d.HAIRMATERIAL_CLUMP_INC_ROOTS,True)
bc.SetBool(c4d.HAIRMATERIAL_CLUMP_RETAIN_LENGTH,True)
bc.SetFloat(c4d.HAIRMATERIAL_TIGHTEN,0.1)
bc.SetFloat(c4d.HAIRMATERIAL_TIGHTEN_VAR,0.1)
bc.SetFloat(c4d.HAIRMATERIAL_TIGHTEN_AMOUNT,0.1)
bc.SetInt32(c4d.HAIRMATERIAL_DISPLACE_DIRECTION,c4d.HAIRMATERIAL_DISPLACE_DIRECTION_WORLD)
bc.SetBool(c4d.HAIRMATERIAL_DISPLACE_RELATIVE,True)
bc.SetFloat(c4d.HAIRMATERIAL_DISPLACE_ABS,0.1)
bc.SetFloat(c4d.HAIRMATERIAL_DISPLACE_ABS_VAR,0.1)
bc.SetFloat(c4d.HAIRMATERIAL_DISPLACE,0.1)
bc.SetFloat(c4d.HAIRMATERIAL_DISPLACE_VAR,0.1)
bc.SetFloat(c4d.HAIRMATERIAL_DISPLACE_AMOUNT,0.1)
bc.SetBool(c4d.HAIRMATERIAL_DISPLACE_ROOT,True)
bc.SetBool(c4d.HAIRMATERIAL_DISPLACE_ADDITIVE,True)
bc.SetBool(c4d.HAIRMATERIAL_DISPLACE_SCALE_SEGMENTS,True)
bc.SetFloat(c4d.HAIRMATERIAL_BEND,0.1)
bc.SetFloat(c4d.HAIRMATERIAL_BEND_VAR,0.1)
bc.SetFloat(c4d.HAIRMATERIAL_BEND_AMOUNT,0.1)
bc.SetInt32(c4d.HAIRMATERIAL_BEND_DIRECTION,c4d.HAIRMATERIAL_BEND_DIRECTION_WORLD)
bc.SetFloat(c4d.HAIRMATERIAL_BEND_DN_VAR,0.1)
bc.SetInt32(c4d.HAIRMATERIAL_BEND_DIRECTION_AXIS,c4d.HAIRMATERIAL_BEND_DIRECTION_AXIS_X)
bc.SetBool(c4d.HAIRMATERIAL_BEND_ROOT,True)
bc.SetFloat(c4d.HAIRMATERIAL_CURL,0.1)
bc.SetFloat(c4d.HAIRMATERIAL_CURL_VAR,0.1)
bc.SetFloat(c4d.HAIRMATERIAL_CURL_AMOUNT,0.1)
bc.SetInt32(c4d.HAIRMATERIAL_CURL_DIRECTION,c4d.HAIRMATERIAL_CURL_DIRECTION_WORLD)
bc.SetFloat(c4d.HAIRMATERIAL_CURL_DN_VAR,0.1)
bc.SetInt32(c4d.HAIRMATERIAL_CURL_DIRECTION_AXIS,c4d.HAIRMATERIAL_CURL_DIRECTION_AXIS_X)
bc.SetInt32(c4d.HAIRMATERIAL_TWIST_AROUND,c4d.HAIRMATERIAL_TWIST_AROUND_NORMAL)
bc.SetBool(c4d.HAIRMATERIAL_TWIST_KEEP_LENGTH,True)
bc.SetFloat(c4d.HAIRMATERIAL_TWIST,0.1)
bc.SetFloat(c4d.HAIRMATERIAL_TWIST_VAR,0.1)
bc.SetFloat(c4d.HAIRMATERIAL_TWIST_AMOUNT,0.1)
bc.SetFloat(c4d.HAIRMATERIAL_WAVE,0.1)
bc.SetFloat(c4d.HAIRMATERIAL_WAVE_VAR,0.1)
bc.SetFloat(c4d.HAIRMATERIAL_WAVE_X,0.1)
bc.SetFloat(c4d.HAIRMATERIAL_WAVE_Y,0.1)
bc.SetFloat(c4d.HAIRMATERIAL_WAVE_AMOUNT,0.1)
bc.SetFloat(c4d.HAIRMATERIAL_WAVE_PHASE_X,0.1)
bc.SetFloat(c4d.HAIRMATERIAL_WAVE_PHASE_Y,0.1)
bc.SetFloat(c4d.HAIRMATERIAL_WAVE_FREQ_X,0.1)
bc.SetFloat(c4d.HAIRMATERIAL_WAVE_FREQ_Y,0.1)
bc.SetInt32(c4d.HAIRMATERIAL_STRAIGHTEN_TOWARDS,c4d.HAIRMATERIAL_STRAIGHTEN_TOWARDS_ROOT)
bc.SetFloat(c4d.HAIRMATERIAL_STRAIGHTEN_AMOUNT,0.1)
bc.SetFloat(c4d.HAIRMATERIAL_STRAIGHTEN_STRENGTH,0.1)
bc.SetFloat(c4d.HAIRMATERIAL_STRAIGHTEN_STRENGTH_VAR,0.1)
bc.SetBool(c4d.HAIRMATERIAL_MATERIAL_GLOBALILLUM_RECEIVE,True)
bc.SetFloat(c4d.HAIRMATERIAL_MATERIAL_GLOBALILLUM_RECEIVE_STRENGTH,0.1)
bc.SetFloat(c4d.HAIRMATERIAL_LIGHTING_DIFFUSE_STRENGTH,0.1)
bc.SetFloat(c4d.HAIRMATERIAL_LIGHTING_ROUGHNESS,0.1)
bc.SetFloat(c4d.HAIRMATERIAL_LIGHTING_ROUGHNESS_VAR,0.1)
bc.SetFloat(c4d.HAIRMATERIAL_LIGHTING_REFLECT,0.1)
bc.SetFloat(c4d.HAIRMATERIAL_LIGHTING_TRANSMIT,0.1)
bc.SetFloat(c4d.HAIRMATERIAL_LIGHTING_SHADOWDENSITY,0.1)
bc.SetFloat(c4d.HAIRMATERIAL_LIGHTING_SHADOW,0.1)
bc.SetFloat(c4d.HAIRMATERIAL_LIGHTING_SELF_SHADOW,0.1)
bc.SetFloat(c4d.HAIRMATERIAL_LIGHTING_BACK_SHADOW,0.1)
if __name__=='__main__':
main()
C++
#include "c4d.h"
#include "../hair/description/mhairmaterial.h"
void SampleFunction()
{
BaseDocument *pDoc = GetActiveDocument();
BaseMaterial *pMaterial = BaseMaterial::Alloc(Mhairmaterial);
//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;
pMaterial->SetParameter(DescID(HAIRMATERIAL_USE_COLOR),GeData(true),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_USE_BACK_COLOR),GeData(true),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_USE_LIGHTING),GeData(true),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_USE_TRANSPARENCY),GeData(true),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_USE_THICKNESS),GeData(true),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_USE_LENGTH),GeData(true),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_USE_SCALE),GeData(true),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_USE_FRIZZ),GeData(true),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_USE_KINK),GeData(true),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_USE_DENSITY),GeData(true),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_USE_CLUMP),GeData(true),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_USE_TIGHTEN),GeData(true),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_USE_DISPLACE),GeData(true),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_USE_BEND),GeData(true),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_USE_CURL),GeData(true),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_USE_TWIST),GeData(true),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_USE_WAVE),GeData(true),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_USE_STRAIGHTEN),GeData(true),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_PAGE_ASSIGNMENT),GeData(true),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_MATERIAL_PAGE_ILLUMINATION),GeData(true),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_COLOR_BRIGHTNESS),GeData(0.1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_COLOR_BLEND),GeData(HAIRMATERIAL_BLENDMODE_AVERAGE),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_COLOR_MIX),GeData(0.1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_H_VAR),GeData(0.1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_S_VAR),GeData(0.1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_V_VAR),GeData(0.1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_ROOTS_COLOR_BLEND),GeData(HAIRMATERIAL_BLENDMODE_AVERAGE),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_ROOTS_COLOR_MIX),GeData(0.1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_COLOR_HAIR_TIPS_LINK),GeData(true),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_TIPS_COLOR_BLEND),GeData(HAIRMATERIAL_BLENDMODE_AVERAGE),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_TIPS_COLOR_MIX),GeData(0.1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_MUTANT_LEVEL),GeData(0.1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_MUTANT_BLEND),GeData(HAIRMATERIAL_BLENDMODE_AVERAGE),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_MUTANT_MIX),GeData(0.1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_COLOR_SURFACE),GeData(true),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_COLOR_SURFACE_COLOR),GeData(true),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_COLOR_SURFACE_ILLUMINATION),GeData(true),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_COLOR_SURFACE_SHADOW),GeData(true),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_SURFACE_BLEND),GeData(HAIRMATERIAL_BLENDMODE_AVERAGE),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_SURFACE_MIX),GeData(0.1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_BACK_FRONT_COLOR_BLEND),GeData(HAIRMATERIAL_BLENDMODE_AVERAGE),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_BACK_FRONT_COLOR_MIX),GeData(0.1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_BACK_COLOR_BRIGHTNESS),GeData(0.1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_BACK_COLOR_BLEND),GeData(HAIRMATERIAL_BLENDMODE_AVERAGE),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_BACK_COLOR_MIX),GeData(0.1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_BACK_H_VAR),GeData(0.1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_BACK_S_VAR),GeData(0.1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_BACK_V_VAR),GeData(0.1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_ROOTS_BACK_COLOR_BLEND),GeData(HAIRMATERIAL_BLENDMODE_AVERAGE),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_ROOTS_BACK_COLOR_MIX),GeData(0.1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_BACK_COLOR_HAIR_TIPS_LINK),GeData(true),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_TIPS_BACK_COLOR_BLEND),GeData(HAIRMATERIAL_BLENDMODE_AVERAGE),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_TIPS_BACK_COLOR_MIX),GeData(0.1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_BACK_MUTANT_BLEND),GeData(HAIRMATERIAL_BLENDMODE_AVERAGE),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_BACK_MUTANT_MIX),GeData(0.1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_BACK_COLOR_SURFACE),GeData(true),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_BACK_COLOR_SURFACE_COLOR),GeData(true),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_BACK_COLOR_SURFACE_ILLUMINATION),GeData(true),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_BACK_COLOR_SURFACE_SHADOW),GeData(true),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_BACK_SURFACE_BLEND),GeData(HAIRMATERIAL_BLENDMODE_AVERAGE),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_BACK_SURFACE_MIX),GeData(0.1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_LIGHTING_SPECULAR_STRENGTH),GeData(0.1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_LIGHTING_SPECULAR_POWER),GeData(0.1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_LIGHTING_SPECULAR_BLEND),GeData(HAIRMATERIAL_BLENDMODE_AVERAGE),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_LIGHTING_SPECULAR_MIX),GeData(0.1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_LIGHTING_ISPECULAR_STRENGTH),GeData(0.1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_LIGHTING_ISPECULAR_POWER),GeData(0.1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_LIGHTING_ISPECULAR_BLEND),GeData(HAIRMATERIAL_BLENDMODE_AVERAGE),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_LIGHTING_ISPECULAR_MIX),GeData(0.1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_LIGHTING_SPECULAR_BACK),GeData(0.1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_LIGHTING_TRANSPARENCY),GeData(0.1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_LIGHTING_TRANSPARENCY_INVERT),GeData(true),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_LIGHTING_TRANSPARENCY_BLEND),GeData(HAIRMATERIAL_BLENDMODE_AVERAGE),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_LIGHTING_TRANSPARENCY_MIX),GeData(0.1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_THICKNESS_ROOT),GeData(0.1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_THICKNESS_TIP),GeData(0.1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_THICKNESS_VAR),GeData(0.1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_LENGTH),GeData(0.1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_LENGTH_VAR),GeData(0.1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_LENGTH_AMOUNT),GeData(0.1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_SCALE),GeData(0.1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_SCALE_VAR),GeData(0.1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_SCALE_AMOUNT),GeData(0.1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_FRIZZ),GeData(0.1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_FRIZZ_VAR),GeData(0.1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_FRIZZ_SCALE_X),GeData(0.1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_FRIZZ_SCALE_Y),GeData(0.1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_FRIZZ_AMOUNT),GeData(0.1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_KINK),GeData(0.1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_KINK_VAR),GeData(0.1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_KINK_SCALE_X),GeData(0.1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_KINK_SCALE_Y),GeData(0.1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_KINK_AMOUNT),GeData(0.1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_DENSITY),GeData(0.1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_DENSITY_LEVELS),GeData(1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_CLUMP_NUMBER),GeData(0.1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_CLUMP),GeData(0.1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_CLUMP_VAR),GeData(0.1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_CLUMP_RADIUS),GeData(0.1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_CLUMP_RADIUS_VAR),GeData(0.1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_CLUMP_TWIST),GeData(0.1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_CLUMP_TWIST_VAR),GeData(0.1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_CLUMP_MAX),GeData(1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_CLUMP_INC_ROOTS),GeData(true),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_CLUMP_RETAIN_LENGTH),GeData(true),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_TIGHTEN),GeData(0.1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_TIGHTEN_VAR),GeData(0.1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_TIGHTEN_AMOUNT),GeData(0.1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_DISPLACE_DIRECTION),GeData(HAIRMATERIAL_DISPLACE_DIRECTION_WORLD),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_DISPLACE_RELATIVE),GeData(true),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_DISPLACE_ABS),GeData(0.1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_DISPLACE_ABS_VAR),GeData(0.1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_DISPLACE),GeData(0.1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_DISPLACE_VAR),GeData(0.1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_DISPLACE_AMOUNT),GeData(0.1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_DISPLACE_ROOT),GeData(true),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_DISPLACE_ADDITIVE),GeData(true),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_DISPLACE_SCALE_SEGMENTS),GeData(true),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_BEND),GeData(0.1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_BEND_VAR),GeData(0.1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_BEND_AMOUNT),GeData(0.1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_BEND_DIRECTION),GeData(HAIRMATERIAL_BEND_DIRECTION_WORLD),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_BEND_DN_VAR),GeData(0.1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_BEND_DIRECTION_AXIS),GeData(HAIRMATERIAL_BEND_DIRECTION_AXIS_X),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_BEND_ROOT),GeData(true),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_CURL),GeData(0.1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_CURL_VAR),GeData(0.1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_CURL_AMOUNT),GeData(0.1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_CURL_DIRECTION),GeData(HAIRMATERIAL_CURL_DIRECTION_WORLD),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_CURL_DN_VAR),GeData(0.1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_CURL_DIRECTION_AXIS),GeData(HAIRMATERIAL_CURL_DIRECTION_AXIS_X),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_TWIST_AROUND),GeData(HAIRMATERIAL_TWIST_AROUND_NORMAL),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_TWIST_KEEP_LENGTH),GeData(true),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_TWIST),GeData(0.1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_TWIST_VAR),GeData(0.1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_TWIST_AMOUNT),GeData(0.1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_WAVE),GeData(0.1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_WAVE_VAR),GeData(0.1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_WAVE_X),GeData(0.1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_WAVE_Y),GeData(0.1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_WAVE_AMOUNT),GeData(0.1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_WAVE_PHASE_X),GeData(0.1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_WAVE_PHASE_Y),GeData(0.1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_WAVE_FREQ_X),GeData(0.1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_WAVE_FREQ_Y),GeData(0.1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_STRAIGHTEN_TOWARDS),GeData(HAIRMATERIAL_STRAIGHTEN_TOWARDS_ROOT),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_STRAIGHTEN_AMOUNT),GeData(0.1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_STRAIGHTEN_STRENGTH),GeData(0.1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_STRAIGHTEN_STRENGTH_VAR),GeData(0.1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_MATERIAL_GLOBALILLUM_RECEIVE),GeData(true),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_MATERIAL_GLOBALILLUM_RECEIVE_STRENGTH),GeData(0.1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_LIGHTING_DIFFUSE_STRENGTH),GeData(0.1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_LIGHTING_ROUGHNESS),GeData(0.1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_LIGHTING_ROUGHNESS_VAR),GeData(0.1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_LIGHTING_REFLECT),GeData(0.1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_LIGHTING_TRANSMIT),GeData(0.1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_LIGHTING_SHADOWDENSITY),GeData(0.1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_LIGHTING_SHADOW),GeData(0.1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_LIGHTING_SELF_SHADOW),GeData(0.1),flags);
pMaterial->SetParameter(DescID(HAIRMATERIAL_LIGHTING_BACK_SHADOW),GeData(0.1),flags);
pMaterial->Message(MSG_UPDATE);
//Second way, using the base container.
BaseContainer *bc = pMaterial->GetDataInstance();
bc->SetBool(HAIRMATERIAL_USE_COLOR,true);
bc->SetBool(HAIRMATERIAL_USE_BACK_COLOR,true);
bc->SetBool(HAIRMATERIAL_USE_LIGHTING,true);
bc->SetBool(HAIRMATERIAL_USE_TRANSPARENCY,true);
bc->SetBool(HAIRMATERIAL_USE_THICKNESS,true);
bc->SetBool(HAIRMATERIAL_USE_LENGTH,true);
bc->SetBool(HAIRMATERIAL_USE_SCALE,true);
bc->SetBool(HAIRMATERIAL_USE_FRIZZ,true);
bc->SetBool(HAIRMATERIAL_USE_KINK,true);
bc->SetBool(HAIRMATERIAL_USE_DENSITY,true);
bc->SetBool(HAIRMATERIAL_USE_CLUMP,true);
bc->SetBool(HAIRMATERIAL_USE_TIGHTEN,true);
bc->SetBool(HAIRMATERIAL_USE_DISPLACE,true);
bc->SetBool(HAIRMATERIAL_USE_BEND,true);
bc->SetBool(HAIRMATERIAL_USE_CURL,true);
bc->SetBool(HAIRMATERIAL_USE_TWIST,true);
bc->SetBool(HAIRMATERIAL_USE_WAVE,true);
bc->SetBool(HAIRMATERIAL_USE_STRAIGHTEN,true);
bc->SetBool(HAIRMATERIAL_PAGE_ASSIGNMENT,true);
bc->SetBool(HAIRMATERIAL_MATERIAL_PAGE_ILLUMINATION,true);
bc->SetFloat(HAIRMATERIAL_COLOR_BRIGHTNESS,0.1);
bc->SetInt32(HAIRMATERIAL_COLOR_BLEND,HAIRMATERIAL_BLENDMODE_AVERAGE);
bc->SetFloat(HAIRMATERIAL_COLOR_MIX,0.1);
bc->SetFloat(HAIRMATERIAL_H_VAR,0.1);
bc->SetFloat(HAIRMATERIAL_S_VAR,0.1);
bc->SetFloat(HAIRMATERIAL_V_VAR,0.1);
bc->SetInt32(HAIRMATERIAL_ROOTS_COLOR_BLEND,HAIRMATERIAL_BLENDMODE_AVERAGE);
bc->SetFloat(HAIRMATERIAL_ROOTS_COLOR_MIX,0.1);
bc->SetBool(HAIRMATERIAL_COLOR_HAIR_TIPS_LINK,true);
bc->SetInt32(HAIRMATERIAL_TIPS_COLOR_BLEND,HAIRMATERIAL_BLENDMODE_AVERAGE);
bc->SetFloat(HAIRMATERIAL_TIPS_COLOR_MIX,0.1);
bc->SetFloat(HAIRMATERIAL_MUTANT_LEVEL,0.1);
bc->SetInt32(HAIRMATERIAL_MUTANT_BLEND,HAIRMATERIAL_BLENDMODE_AVERAGE);
bc->SetFloat(HAIRMATERIAL_MUTANT_MIX,0.1);
bc->SetBool(HAIRMATERIAL_COLOR_SURFACE,true);
bc->SetBool(HAIRMATERIAL_COLOR_SURFACE_COLOR,true);
bc->SetBool(HAIRMATERIAL_COLOR_SURFACE_ILLUMINATION,true);
bc->SetBool(HAIRMATERIAL_COLOR_SURFACE_SHADOW,true);
bc->SetInt32(HAIRMATERIAL_SURFACE_BLEND,HAIRMATERIAL_BLENDMODE_AVERAGE);
bc->SetFloat(HAIRMATERIAL_SURFACE_MIX,0.1);
bc->SetInt32(HAIRMATERIAL_BACK_FRONT_COLOR_BLEND,HAIRMATERIAL_BLENDMODE_AVERAGE);
bc->SetFloat(HAIRMATERIAL_BACK_FRONT_COLOR_MIX,0.1);
bc->SetFloat(HAIRMATERIAL_BACK_COLOR_BRIGHTNESS,0.1);
bc->SetInt32(HAIRMATERIAL_BACK_COLOR_BLEND,HAIRMATERIAL_BLENDMODE_AVERAGE);
bc->SetFloat(HAIRMATERIAL_BACK_COLOR_MIX,0.1);
bc->SetFloat(HAIRMATERIAL_BACK_H_VAR,0.1);
bc->SetFloat(HAIRMATERIAL_BACK_S_VAR,0.1);
bc->SetFloat(HAIRMATERIAL_BACK_V_VAR,0.1);
bc->SetInt32(HAIRMATERIAL_ROOTS_BACK_COLOR_BLEND,HAIRMATERIAL_BLENDMODE_AVERAGE);
bc->SetFloat(HAIRMATERIAL_ROOTS_BACK_COLOR_MIX,0.1);
bc->SetBool(HAIRMATERIAL_BACK_COLOR_HAIR_TIPS_LINK,true);
bc->SetInt32(HAIRMATERIAL_TIPS_BACK_COLOR_BLEND,HAIRMATERIAL_BLENDMODE_AVERAGE);
bc->SetFloat(HAIRMATERIAL_TIPS_BACK_COLOR_MIX,0.1);
bc->SetInt32(HAIRMATERIAL_BACK_MUTANT_BLEND,HAIRMATERIAL_BLENDMODE_AVERAGE);
bc->SetFloat(HAIRMATERIAL_BACK_MUTANT_MIX,0.1);
bc->SetBool(HAIRMATERIAL_BACK_COLOR_SURFACE,true);
bc->SetBool(HAIRMATERIAL_BACK_COLOR_SURFACE_COLOR,true);
bc->SetBool(HAIRMATERIAL_BACK_COLOR_SURFACE_ILLUMINATION,true);
bc->SetBool(HAIRMATERIAL_BACK_COLOR_SURFACE_SHADOW,true);
bc->SetInt32(HAIRMATERIAL_BACK_SURFACE_BLEND,HAIRMATERIAL_BLENDMODE_AVERAGE);
bc->SetFloat(HAIRMATERIAL_BACK_SURFACE_MIX,0.1);
bc->SetFloat(HAIRMATERIAL_LIGHTING_SPECULAR_STRENGTH,0.1);
bc->SetFloat(HAIRMATERIAL_LIGHTING_SPECULAR_POWER,0.1);
bc->SetInt32(HAIRMATERIAL_LIGHTING_SPECULAR_BLEND,HAIRMATERIAL_BLENDMODE_AVERAGE);
bc->SetFloat(HAIRMATERIAL_LIGHTING_SPECULAR_MIX,0.1);
bc->SetFloat(HAIRMATERIAL_LIGHTING_ISPECULAR_STRENGTH,0.1);
bc->SetFloat(HAIRMATERIAL_LIGHTING_ISPECULAR_POWER,0.1);
bc->SetInt32(HAIRMATERIAL_LIGHTING_ISPECULAR_BLEND,HAIRMATERIAL_BLENDMODE_AVERAGE);
bc->SetFloat(HAIRMATERIAL_LIGHTING_ISPECULAR_MIX,0.1);
bc->SetFloat(HAIRMATERIAL_LIGHTING_SPECULAR_BACK,0.1);
bc->SetFloat(HAIRMATERIAL_LIGHTING_TRANSPARENCY,0.1);
bc->SetBool(HAIRMATERIAL_LIGHTING_TRANSPARENCY_INVERT,true);
bc->SetInt32(HAIRMATERIAL_LIGHTING_TRANSPARENCY_BLEND,HAIRMATERIAL_BLENDMODE_AVERAGE);
bc->SetFloat(HAIRMATERIAL_LIGHTING_TRANSPARENCY_MIX,0.1);
bc->SetFloat(HAIRMATERIAL_THICKNESS_ROOT,0.1);
bc->SetFloat(HAIRMATERIAL_THICKNESS_TIP,0.1);
bc->SetFloat(HAIRMATERIAL_THICKNESS_VAR,0.1);
bc->SetFloat(HAIRMATERIAL_LENGTH,0.1);
bc->SetFloat(HAIRMATERIAL_LENGTH_VAR,0.1);
bc->SetFloat(HAIRMATERIAL_LENGTH_AMOUNT,0.1);
bc->SetFloat(HAIRMATERIAL_SCALE,0.1);
bc->SetFloat(HAIRMATERIAL_SCALE_VAR,0.1);
bc->SetFloat(HAIRMATERIAL_SCALE_AMOUNT,0.1);
bc->SetFloat(HAIRMATERIAL_FRIZZ,0.1);
bc->SetFloat(HAIRMATERIAL_FRIZZ_VAR,0.1);
bc->SetFloat(HAIRMATERIAL_FRIZZ_SCALE_X,0.1);
bc->SetFloat(HAIRMATERIAL_FRIZZ_SCALE_Y,0.1);
bc->SetFloat(HAIRMATERIAL_FRIZZ_AMOUNT,0.1);
bc->SetFloat(HAIRMATERIAL_KINK,0.1);
bc->SetFloat(HAIRMATERIAL_KINK_VAR,0.1);
bc->SetFloat(HAIRMATERIAL_KINK_SCALE_X,0.1);
bc->SetFloat(HAIRMATERIAL_KINK_SCALE_Y,0.1);
bc->SetFloat(HAIRMATERIAL_KINK_AMOUNT,0.1);
bc->SetFloat(HAIRMATERIAL_DENSITY,0.1);
bc->SetInt32(HAIRMATERIAL_DENSITY_LEVELS,1);
bc->SetFloat(HAIRMATERIAL_CLUMP_NUMBER,0.1);
bc->SetFloat(HAIRMATERIAL_CLUMP,0.1);
bc->SetFloat(HAIRMATERIAL_CLUMP_VAR,0.1);
bc->SetFloat(HAIRMATERIAL_CLUMP_RADIUS,0.1);
bc->SetFloat(HAIRMATERIAL_CLUMP_RADIUS_VAR,0.1);
bc->SetFloat(HAIRMATERIAL_CLUMP_TWIST,0.1);
bc->SetFloat(HAIRMATERIAL_CLUMP_TWIST_VAR,0.1);
bc->SetInt32(HAIRMATERIAL_CLUMP_MAX,1);
bc->SetBool(HAIRMATERIAL_CLUMP_INC_ROOTS,true);
bc->SetBool(HAIRMATERIAL_CLUMP_RETAIN_LENGTH,true);
bc->SetFloat(HAIRMATERIAL_TIGHTEN,0.1);
bc->SetFloat(HAIRMATERIAL_TIGHTEN_VAR,0.1);
bc->SetFloat(HAIRMATERIAL_TIGHTEN_AMOUNT,0.1);
bc->SetInt32(HAIRMATERIAL_DISPLACE_DIRECTION,HAIRMATERIAL_DISPLACE_DIRECTION_WORLD);
bc->SetBool(HAIRMATERIAL_DISPLACE_RELATIVE,true);
bc->SetFloat(HAIRMATERIAL_DISPLACE_ABS,0.1);
bc->SetFloat(HAIRMATERIAL_DISPLACE_ABS_VAR,0.1);
bc->SetFloat(HAIRMATERIAL_DISPLACE,0.1);
bc->SetFloat(HAIRMATERIAL_DISPLACE_VAR,0.1);
bc->SetFloat(HAIRMATERIAL_DISPLACE_AMOUNT,0.1);
bc->SetBool(HAIRMATERIAL_DISPLACE_ROOT,true);
bc->SetBool(HAIRMATERIAL_DISPLACE_ADDITIVE,true);
bc->SetBool(HAIRMATERIAL_DISPLACE_SCALE_SEGMENTS,true);
bc->SetFloat(HAIRMATERIAL_BEND,0.1);
bc->SetFloat(HAIRMATERIAL_BEND_VAR,0.1);
bc->SetFloat(HAIRMATERIAL_BEND_AMOUNT,0.1);
bc->SetInt32(HAIRMATERIAL_BEND_DIRECTION,HAIRMATERIAL_BEND_DIRECTION_WORLD);
bc->SetFloat(HAIRMATERIAL_BEND_DN_VAR,0.1);
bc->SetInt32(HAIRMATERIAL_BEND_DIRECTION_AXIS,HAIRMATERIAL_BEND_DIRECTION_AXIS_X);
bc->SetBool(HAIRMATERIAL_BEND_ROOT,true);
bc->SetFloat(HAIRMATERIAL_CURL,0.1);
bc->SetFloat(HAIRMATERIAL_CURL_VAR,0.1);
bc->SetFloat(HAIRMATERIAL_CURL_AMOUNT,0.1);
bc->SetInt32(HAIRMATERIAL_CURL_DIRECTION,HAIRMATERIAL_CURL_DIRECTION_WORLD);
bc->SetFloat(HAIRMATERIAL_CURL_DN_VAR,0.1);
bc->SetInt32(HAIRMATERIAL_CURL_DIRECTION_AXIS,HAIRMATERIAL_CURL_DIRECTION_AXIS_X);
bc->SetInt32(HAIRMATERIAL_TWIST_AROUND,HAIRMATERIAL_TWIST_AROUND_NORMAL);
bc->SetBool(HAIRMATERIAL_TWIST_KEEP_LENGTH,true);
bc->SetFloat(HAIRMATERIAL_TWIST,0.1);
bc->SetFloat(HAIRMATERIAL_TWIST_VAR,0.1);
bc->SetFloat(HAIRMATERIAL_TWIST_AMOUNT,0.1);
bc->SetFloat(HAIRMATERIAL_WAVE,0.1);
bc->SetFloat(HAIRMATERIAL_WAVE_VAR,0.1);
bc->SetFloat(HAIRMATERIAL_WAVE_X,0.1);
bc->SetFloat(HAIRMATERIAL_WAVE_Y,0.1);
bc->SetFloat(HAIRMATERIAL_WAVE_AMOUNT,0.1);
bc->SetFloat(HAIRMATERIAL_WAVE_PHASE_X,0.1);
bc->SetFloat(HAIRMATERIAL_WAVE_PHASE_Y,0.1);
bc->SetFloat(HAIRMATERIAL_WAVE_FREQ_X,0.1);
bc->SetFloat(HAIRMATERIAL_WAVE_FREQ_Y,0.1);
bc->SetInt32(HAIRMATERIAL_STRAIGHTEN_TOWARDS,HAIRMATERIAL_STRAIGHTEN_TOWARDS_ROOT);
bc->SetFloat(HAIRMATERIAL_STRAIGHTEN_AMOUNT,0.1);
bc->SetFloat(HAIRMATERIAL_STRAIGHTEN_STRENGTH,0.1);
bc->SetFloat(HAIRMATERIAL_STRAIGHTEN_STRENGTH_VAR,0.1);
bc->SetBool(HAIRMATERIAL_MATERIAL_GLOBALILLUM_RECEIVE,true);
bc->SetFloat(HAIRMATERIAL_MATERIAL_GLOBALILLUM_RECEIVE_STRENGTH,0.1);
bc->SetFloat(HAIRMATERIAL_LIGHTING_DIFFUSE_STRENGTH,0.1);
bc->SetFloat(HAIRMATERIAL_LIGHTING_ROUGHNESS,0.1);
bc->SetFloat(HAIRMATERIAL_LIGHTING_ROUGHNESS_VAR,0.1);
bc->SetFloat(HAIRMATERIAL_LIGHTING_REFLECT,0.1);
bc->SetFloat(HAIRMATERIAL_LIGHTING_TRANSMIT,0.1);
bc->SetFloat(HAIRMATERIAL_LIGHTING_SHADOWDENSITY,0.1);
bc->SetFloat(HAIRMATERIAL_LIGHTING_SHADOW,0.1);
bc->SetFloat(HAIRMATERIAL_LIGHTING_SELF_SHADOW,0.1);
bc->SetFloat(HAIRMATERIAL_LIGHTING_BACK_SHADOW,0.1);
pMaterial->Message(MSG_UPDATE);
}
Gradients
This node has gradients. Gradients can manually be edited by calling the following code
Python
C++
#include "customgui_gradient.h"
HAIRMATERIAL_COLOR_GRADIENT
GeData data;
pMaterial->GetParameter(DescID(HAIRMATERIAL_COLOR_GRADIENT),data,DESCFLAGS_GET_PARAM_GET));
Gradient *pGradient = (Gradient*)data.GetCustomDataType(CUSTOMDATATYPE_GRADIENT);
if(pGradient)
{
//must be set before any knot is set
pGradient->SetData(GRADIENT_MODE, GeData(GRADIENTMODE_ALPHA));
GradientKnot k1, k2;
k1.col = Vector(0.0, 0.0, 1.0);
k1.pos = 0.0;
k2.col = 1.0;
k2.pos = 1.0;
pGradient->InsertKnot(k1);
pGradient->InsertKnot(k2);
}
pMaterial->SetParameter(DescID(HAIRMATERIAL_COLOR_GRADIENT),data,DESCFLAGS_SET_PARAM_SET));
HAIRMATERIAL_BACK_COLOR_GRADIENT
pMaterial->GetParameter(DescID(HAIRMATERIAL_BACK_COLOR_GRADIENT),data,DESCFLAGS_GET_PARAM_GET));
HAIRMATERIAL_LIGHTING_TRANSPARENCY_GRADIENT
pMaterial->GetParameter(DescID(HAIRMATERIAL_LIGHTING_TRANSPARENCY_GRADIENT),data,DESCFLAGS_GET_PARAM_GET));