sprockets TV Commercial by Matt Campbell Greeting of Christmas Past by Gerry Mooney and Holmes Bryant! Learn to keyframe animate chains of bones. Gerald's 2024 Advent Calendar! The Snowman is coming! Realistic head model by Dan Skelton Vintage character and mo-cap animation by Joe Williamsen
sprockets
Recent Posts | Unread Content
Jump to content
Hash, Inc. - Animation:Master

Recommended Posts

Posted

for fun trying to have random color changes in models but using a rand() expression in the color numbers causes AM to crash ..tried RGB(r,g,b ) with random numbers ..crash

 

 

 

played with x,y,z size expressions and tried to have those number go into color number slots...crash weird numbers do not need to be integers so rand()*255 should work

 

 

 

 

without color changes quick test front model has pose turned off

 

randomize.mov

  • Replies 10
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

  • Hash Fellow
Posted

Have you tried it with integers?

 

You might try a progressive test where R G and B are all constants, Dose that survive?

 

 

then try R getting a random number and see if that works.

 

then add G getting random...

  • Admin
Posted

John,

I'm not sure if this is what you are after but it appears to work on my end.

Try:

 

RGB(Rand()*255,Rand()*255,Rand()*255)

 

Where you seed each of the RGB values with a different random number.

Note that I don't know how to limit the Random value to a range between 1 and 255.

Anyone?

 

I've attached the project file with one groups surface property being altered and will post a few variations on the theme in order to explore more.

This technically is the first expression I've ever written that had an actual reason for being written.

 

 

Warning: Anyone prone to seizures due to rapid color change might want to forgo watching the .MOV.

RandomColorExpression.prj

randomcolorexpresssion.mov

Posted
RGB(Rand()*255,Rand()*255,Rand()*255)

 

Where you seed each of the RGB values with a different random number.

Note that I don't know how to limit the Random value to a range between 1 and 255.

Anyone?

 

Rand() generates a number between 0 and 1, so multiplying that number by 255 (as you have already done) will limit the result to between 0 and 255. The project worked fine on my end.

  • Admin
Posted

Here's the same thing extended to each of the RGB values separately (i.e to isolate colors to their linear... yes linear... paths within their respective Red, Green and Blue color spaces).

 

For the fun of it, I will note that linear color is an abstraction that allows us to interpret nonlinear color space.

While the numbers 1 through 255 are linear, color isn't normally isolated as such in the real world and any path traced through time will be influenced by many other factors, creating nonlinear paths through color space. In short, it's all about relativity. Sometimes these paths are smooth... as in a weighted arc... and sometimes... as in these psuedo-randomly generated expressions... erratic.

RandomColorExpressionRGB.prj

randomcolorexpresssionRGB.mov

  • Admin
Posted
Rand() generates a number between 0 and 1, so multiplying that number by 255 (as you have already done) will limit the result to between 0 and 255. The project worked fine on my end.

 

Outstanding.

 

Thanks David!

 

Edit: In looking back I see I would have to revise my words to state, 'a number between 0 and 255' as I'd need to account for the occurrence of multiplying by zero).

Posted

Thanks Rodney I guess I was over thinking this and trying to use one of the functions while setting up a pose

 

 

functions.jpg

  • Developer
Posted

From the doc for RGB expression

 

Creates a color by combining the three floating point values r, g, and b. These numbers should be expressed as 8 bit color, from 0 to 255.

 

Version 18e , will clamp the values between 0 and 255 self and using absolute values, so a translate propertie can used as example .

  • Admin
Posted
Version 18e , will clamp the values between 0 and 255 self and using absolute values, so a translate propertie can used as example .

 

That should prove to be useful and interesting. Thanks Steffen! :)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...