Home Technical Talk

Xgen expression confusion

montressor
polycounter lvl 2
Offline / Send Message
montressor polycounter lvl 2
Dear All,

I have a little confusion with xgen expression editor. I saw a lot of example, and read the autodesk pages but I don't understand how is it works. I would like to color the hair by primitives, but I can not find any variable in related to the color of the primitives. I expected something like this:
$id.color=rand(1,1,1)

I can see an example in xgen:
$a=[rand( 0, 1 ,$id),rand( 0, 1 ,$id+1),rand( 0, 1 ,$id+2)];#-1.0,1.0
$a

However it makes a random colored 'map'(?) in the expression editor, I don't understand what is the $a?

Also an expression from the end of an another example:
mix($Cs,$Cnew,$Strength)

In which:
float mix ( float a, float b, float alpha )  #Blend of a and b according to alpha.  Defined as a*(1-alpha) + b*alpha.

But where does the result go? Why/how does it became to a color map?

And how does color assignment work for hair? At render time when render computes the hair pixel's color it runs the expression for each pixels?


thank you very much

Replies

Sign In or Register to comment.