Inside Sabertooth
Learn how Sabertooth uses 3ds Max to create 3D interactive projects, including HBO Go’s Game of Thrones interactive experience
  • 1/3
You are here: Forum Home / Autodesk® Maya® / Materials / Connecting Ramp texture Selected Position?
  RSS 2.0 ATOM  

Connecting Ramp texture Selected Position?
Rate this thread
 
35519
 
Permlink of this thread  
avatar
  • Manutara
  • Posted: 13 October 2009 01:57 AM
  • Total Posts: 47
  • Joined: 18 June 2007 11:06 PM

Where and how can I use the Selected position of a ramp texture, for example in a SDK. SDK is available with rClik but gives an error. Done it before but can’t remenber how!



Replies: 0
avatar
  • n8skow
  • Posted: 13 October 2009 08:55 AM

What are you wanting to connect the ramp color to?



n8skow [FA]

Replies: 1
/userdata/avatar/avatar_124105.jpg

To any attribute by SDK. Example: I want that when I move tx a cube from 0 to 5, the Selected position of colorEntryList[0] of ramp1 changes from 0 to 0.5.

I know that I can connect them in Connection Editor and MEL but how can I do it with Set Driven Keys

Author: Manutara

Replied: 13 October 2009 10:36 AM  
avatar
  • n8skow
  • Posted: 14 October 2009 09:10 AM

Well, you could create a custom attribute in the channel editor - and use it to drive your translation and ramp shader. If you could explain more specifically what your wanting to do, it’d be a little easier to help with.



n8skow [FA]

Replies: 1
/userdata/avatar/avatar_124105.jpg

I want to drive the “Selected position” attribute from the ramp. But that attribute is not available in the SDK window for the ramp texture node.

I assume that is not available because there are more than 1 colorEntry. 3 by default.

Author: Manutara

Replied: 14 October 2009 09:45 AM  
avatar
  • n8skow
  • Posted: 14 October 2009 10:54 AM

With the ramp selected in the Connection Editor, you should see ‘colorEntryList’ 0,1,2 by default - click the little plus signs and you can access ramp position.



n8skow [FA]

Replies: 1
/userdata/avatar/avatar_124105.jpg

Yes thanks but how can I drive the colorEntryList with Set Diven Keys

Author: Manutara

Replied: 18 October 2009 01:41 PM  
avatar

I understand your frustration that you cannot get the Color Entry list stuff to show up in the SDK menu. You can get some more items to show up by unchecking “List Keyable Driven Attributes” in the Options Menu of the SDK panel. But while position does show up I don’t think it is quite what you are looking for. My suggestion in your case, especially since the math is so clean, would be to connect the two attributes with a Multiply/Divide node in between.
To do this, open the hypershade window. In the viewport, select the object and then in the Hypershade click the Textures tab and shift select the ramp texture you want to use. With both the Object and the Ramp selected, click GRAPH - Input and Output Connections
You should see the selected objects appear in the work area below.
Then click CREATE - General Utilities - Multiply Divide. This should be added to the work area.
Now using the Connection Editor, connect the TranslateX of the Object to the input 1X of the Mult/Div node. Then use the Connection Editor to connect the OutputX of the Mult/Div node to the desired color entry list position. The last, and most important step in to select the Mult/Div node and enter a value (in your case I would suggest .1) in the input 2X. Just to be safe confirm that the Operation of the node is set to Multiply and you should be all set. When the translate X of the object is at 5 then the color entry position will be at .5.
Change the math to taste and best of luck.
~Ben



Replies: 0