PDA

View Full Version : Controling Material via Yes/No



cstarr
2006-09-19, 03:58 PM
I would like to say: If the 'ER' parameter is checked, then make material red, if not checked, make material white.

I can't seem to be able to add any formula of that nature to my material parameter.

Any suggestions?

Thanks.

robert.manna
2006-09-19, 05:03 PM
Would something like this work?


parameter (y/n) - Material Choice
parameter (material) - Material 1 - set to red
parameter (material) - Material 2 - set to white
parameter (material) - Final Choice = Material Choice, Material Red, Material White

I always screw up the syntax for evaulating yes/no parameters. Basically, you want to say, if Material Choice is true (checked) then equal material 1, if false (un-checked) then equal material 2. Your object's material would de derived from "Final Choice"

If material parameters can use conditionals this theory should work. I suppose a "not" would too.

HTH,
-R

mschroeder
2006-09-19, 05:26 PM
Unfortunately, materials cannot be derived by a formula. :(

robert.manna
2006-09-19, 05:33 PM
Unfortunately, materials cannot be derived by a formula. :(
Serious bummer, I hadn't tried it, it was just the logic that came to me quickly. <sigh> oh well, someday....

-R

hand471037
2006-09-19, 06:09 PM
You can make a nested family, with two different types, that use the two different Materials.

Then you could access which one was shown parametrically.

Not idea, but it's something.

cstarr
2006-09-19, 07:06 PM
Thanks all,

I wound up just creating new types with the family i.e 'Switch - white' and 'Switch - red' assigning the material accordingly. It works fine, I was just trying to avoid doubling the amount of types...alas.

Thanks again.

Ning Zhou
2010-02-18, 07:04 PM
looks like you still cannot define materials by formula, any good workaround?