PDA

View Full Version : Xpresso and materials


tnunez
03-13-2007, 03:35 AM
Hi CGtalk,

Is it possible to have objects blend between two fixed materials through xpresso?

I have 10 identical objects, and one Xpression making it so each object's size scales according to distance from a certain null object. I have created two materials - let's say wood and marble. What I'd ike to do is have each object smoothly blend from wood to marble as they get closer to the null object.

As you can see, just changing values in the material itself won't work right because it will affect all objects at the same time, and creating one special material for each object is not a solution. The idea is to have two master materials that objects blend in and out of according to a certain distance range.

I keep wishing there was a "material mix" operator or tag :(

Ay help appreciated it. Thank you!

Aurety
03-13-2007, 10:49 AM
Just key a color shader in alpha channel on the second texture, from black to white or inverse.

tnunez
03-13-2007, 03:34 PM
Thanks Aurety, however, that would make all objects change materials as well, not each individually, wouldn't it?

Darter
03-14-2007, 01:38 PM
Here's a solution using a COFFEE expression.

User Data are on the COFFEE tag. MinScale Distance and MaxScale Distance give the upper and lower thresholds for the Min Scale and Max Scale values. The Max Frame is simply the Maximum frame as found in the Project Settings.

tnunez
03-15-2007, 01:57 AM
Darter, thanks so much for this. However, this doesn't work on my C4D for some reason. I load the scene and hit play, and the objects don't scale, and the material changes are out of order. Your movie however looks perfect. I'm running C4D R10 on Windows... am I missing something?

Again thanks much for your help.

Per-Anders
03-15-2007, 02:01 AM
There is a material max and a tag, it's the Texture Tag. Just animate the material in the material slot and it will blend the material over time (during render) on that object.

Alternatively simply use the alpha channel and a proximal or 3d gradient to fade in/out one material on the top of another, or you can blend in the layers shdaer of a material, and you can do the same using MoGraph if you have it.

Darter
03-15-2007, 03:52 AM
Darter, thanks so much for this. However, this doesn't work on my C4D for some reason. I load the scene and hit play, and the objects don't scale, and the material changes are out of order. Your movie however looks perfect. I'm running C4D R10 on Windows... am I missing something?

Again thanks much for your help.

Each texture tag has 2 keyframes on the Material field, one for each material. At a given frame, the expression will independently change the second keyframe on each tag so that the relative blend between materials is proportional to the host object's distance value.

The expression was created in R9.6 and I suspect that it's broken in R10 due to revamping of the timeline. I'll have a look and see whether I can fix it to work in R10.

Otherwise, there are good alternatives as suggested by Per.

CGTalk Moderation
03-15-2007, 03:52 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.