PDA

View Full Version : locator controlled ramp texture


bluehonda
08-14-2010, 09:01 AM
hi guys, was wondering if there was a way to connect a locators translate values to a ramps input colors position??? so that if you move the locator say in Xaxis. ramo input1 color moves also.

i hope its possible.

Darksuit
08-14-2010, 05:24 PM
sure...
it's nothing more than connecting an attribute.

if you open up the script edior then create a ramp node or ramp shader. Two different things. (I tend to the node versus the shader just personal prefence). You can move the Color attribute and see the specific MEL target for that node.

for instance I did this with a Shader node.

I then move the green color and I get:


setAttr "ramp1.colorEntryList[1].position" 0.465;



If you want to be sure that you are only moving the locator within the bounds of the ramp shader itself then you can put limits on the locators

in the end you get the following:


connectAttr -f locator1.translateX ramp1.colorEntryList[0].position;

connectAttr -f locator1.translateY ramp1.colorEntryList[1].position;

connectAttr -f locator1.translateZ ramp1.colorEntryList[2].position;



This is going a bit overboard and connecting all three attributes of a ramp to a single locator but you get the idea. I use this method from time to time on eyes to adjust the iris of a character.

bluehonda
08-18-2010, 03:32 AM
Thats awesome! Darksuit. Thanks for sharing.

CGTalk Moderation
08-18-2010, 03:32 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.