Skip to content

Kami Hair Tools - Expressions - SeExpr

A centralized library of essential SeExpr snippets, allowing you to apply complex hair behaviors without leaving Maya interface or memorizing expression syntax.

Kami Hair Tools
Kami Hair Tools

Basic

  • Basic utilities to use across different modifiers:

Random

ruby
rand(0.4, 0.5)

Slider

ruby
$range = 0.5;#0.1,1.0
$range

Random Slider

ruby
$min=0.1;#0.00,1.00
$max=0.5;#0.00,1.00
rand($min,$max,$id)

Clumping

  • Preset expressions configured for Clumping modifiers, including masks and internal noise variations.

Clumping Mask

ruby
$percentage=95;#0,100
rand() < $percentage / 100.0 ? 1: 0

Clumping Noise

ruby
rand(0.4, 0.7)

Clumping Cut

ruby
 $min=0.1;#0.00,1.00
 $max=0.5;#0.00,1.00
 rand($min,$max,$id)

Random Noise

  • Standard modifiers to break up uniform silhouettes and add realism to the groom.
  • Tip: clicking the FX icon will open example snapshot on how to apply the expression within context.
Kami Hair Tools

Root Noise

ruby
1.5

Flyaway Noise

ruby
rand(6, 10, $id)

Stray Noise

ruby
$nonStrayValue = 0.0000;#0.0,1.0
$strayValue = 1.0000;#0.0,1.0
$percent = 92.3100;#0.0,100.0
$stray = hash($id) <= $percent/100.0 ? $strayValue : $nonStrayValue;
$stray

Random Cut

  • Cut the tip of the hair with randomize id, useful to make the hair natural and soften the pointed tip effect by clumping modifiers.

Random Cut

ruby
$cutMin=0.02;#0.00,1.00
$cutMax=0.1;#0.00,1.00
rand($cutMin,$cutMax)*$cLength

Advanced

  • Complex snippets for Random Sliders, Shared Noise, and Description Noise.
  • Useful for setting up attribute-driven expressions that control multiple modifiers at once.

Random ID

ruby
$min = 0.5;#0.1,10.0
$max = 0.5;#0.1,10.0
$mag = 1.0;#1.0,10.0
rand($min,$max,$id)*$mag

Random Noise

ruby
$seed=1;#0,10
$min=0.0047;#0.00,0.20
$max=0.5843;#0.20,10.00
$mag=rand($min,$max,$seed);
$strayMin=0.1000;#0.0,5.0
$strayMax=1.0000;#1.00,20.00
$strayNoise=rand($strayMin,$strayMax,8);
$noise=stray() ? $strayNoise : $mag; $fitMax=3.2941;#0.00,20.00
fit($noise,0,1,0,$fitMax)

Description Noise

ruby
$a=map('${DESC}/paintmaps/description_noise_map');#3dpaint,30.0
$b=float_noise();
$c=0.60802;#0.0,1.0;
$a*$b*$c

Comprehensive List

expressions.txt
ruby
# Random
rand(0.4, 0.5)


# Slider
$range=0.5;#0.1,1.0
$range


# Random Slider
$min=0.1;#0.00,1.00
$max=0.5;#0.00,1.00
rand($min, $max, $id)


# Clumping Mask
$percentage=95;#0,100
rand() < $percentage / 100.0 ? 1: 0


# Clumping Noise
rand(0.4, 0.7)


# Clumping Cut
$a=rand(0.0,0.2);
$a * $cLength


# Root Noise
1.5


# Flyaway Noise
rand(6, 10, $id)


# Stray Noise
$nonStrayValue=0.0000;#0.0,1.0
$strayValue=1.0000;#0.0,1.0
$percent=92.3100;#0.0,100.0
$stray=hash($id) <= $percent/100.0 ? $strayValue : $nonStrayValue;
$stray


# Random Cut
$cutMin=0.02;#0.00,1.00
$cutMax=0.1;#0.00,1.00
rand($cutMin, $cutMax) * $cLength


# Random ID
$min=0.5;#0.1,10.0
$max=0.5;#0.1,10.0
$mag=1.0;#1.0,10.0
rand($min,$max,$id)*$mag


# Random Noise
$seed=1;#0,10
$min=0.0047;#0.00,0.20
$max=0.5843;#0.20,10.00
$mag=rand($min,$max,$seed);
$strayMin=0.1000;#0.0,5.0
$strayMax=1.0000;#1.00,20.00
$strayNoise=rand($strayMin,$strayMax,8);
$noise=stray() ? $strayNoise : $mag;
$fitMax=3.2941;#0.00,20.00
fit($noise,0,1,0,$fitMax)


# Description Noise
$a=map('${DESC}/paintmaps/description_noise_map');#3dpaint,30.0
$b=float_noise();
$c=0.60802;#0.0,1.0;
$a*$b*$c