CGTalk > Software Specific Forums > Autodesk Maya
To minimize the ads you see on this page create a CGTalk account and log in HERE
Thread Closed share thread « Previous Thread | Next Thread »  
 
Thread Tools Search this Thread Display Modes
Old 07-19-2013, 04:58 PM   #1
Nanannan
New Member
portfolio
Johan
Gothenburg, Sweden
 
Join Date: Dec 2010
Posts: 27
Linking 'Distance' value to a ramp color position

What I want to do is have the ramp.colorEntryList[1].position determined by my distanceDimensionShape1.distance value, the output from the .distance needs to be multiplied with 0.08 before connected to the ramp.

This is so frustrating because I know what values I need and where to get them I just don't know where and how to connect them. Please help me out I'm going crazy here
 
Old 07-20-2013, 10:54 AM   #2
Nanannan
New Member
portfolio
Johan
Gothenburg, Sweden
 
Join Date: Dec 2010
Posts: 27
Apparantly theres an expression editor for this sort of thing.
object:ramp2.colorEntryList[0].position = distanceDimensionShape1.distance*x seem to work. Now I just need to figure out whats wrong with my ramp, I get the right conversion from the distance input to the ramp but the actual rendered lenght is really weird, like this.

Max
Distance: 50, 40, 30, 20, 10
Ramp: 1, 0.8, 0.6, 0.4, 0.2 so far so good, but:
Actual 10.2, 10.2, 8.5, 5.7, 2.9
rendered
lenght:

I don't understand this
 
Old 07-21-2013, 05:03 PM   #3
Nanannan
New Member
portfolio
Johan
Gothenburg, Sweden
 
Join Date: Dec 2010
Posts: 27
I have no idea what went wrong with the first try but I remade everything and now it works as I intended. The expression editor is awesome, I should probably start using it more often.
 
Old 07-25-2013, 06:31 AM   #4
ristopuukko
Earthling
 
ristopuukko's Avatar
portfolio
Risto Puukko
Senior fx td
FrameStore
London, United%2BKingdom
 
Join Date: Nov 2003
Posts: 809
....or then you can get _really_ wacky and use the multiplyDivide - node between your distance and ramp.

Expressions are more flexible but nodes are ( tenths or even hundreds times ) faster .

/r
__________________
- Oh no, it's me -
 
Old 07-26-2013, 01:08 PM   #5
Nanannan
New Member
portfolio
Johan
Gothenburg, Sweden
 
Join Date: Dec 2010
Posts: 27
Hey, thanks for the reply! I did try that actually, but I couldn't figure out how to set it up, or maybe *where* to set it up. If you, or someone else, could talk me through in simple terms how to set that up that would be very helpful and appreciated .
 
Old 07-26-2013, 01:52 PM   #6
AlexSudnikov
Veteran
 
AlexSudnikov's Avatar
portfolio
Alex Sudnikov
RU
 
Join Date: Jul 2011
Posts: 79
What exactly is not working right ?
If you prefer expressions - ok , although i'm not sure if "performance" is something you really need to think about while doing stuff like that , i mean...unless you've got hundreads cycles of a job...

Here's what i can suggest ( node based though ):

- Go to Create-->Measure Tools --> Distance tool

- Open up Hypershade ( Window --> Rendering Editos-->Hypershade ) , navigate to it's Graph menu tab and click "Input and Output Connections" , this way your view will center on it.

-While in Hypershade , create "Multiply Divide" and "Ramp" node.

- With a middle mouse button pressed , drag your distance node on Multiply Divide node , release button and select "Other" option ( at the bottom)

- Connection editor will show up , on the left side select "distance" (at the very bottom) , on the right side select Input1-->Input1X. Now your distance is connected to the multiply/divide X input.

-Since you wanted to multiply your distance value by 0.08 , click on Multiply Divide node and type 0.08 in the Input2X.

- Middle drag your Multiply Divide node on the ramp , select "Other" again , and connect it's (M D node ) outputX to the uvCoord-->vCoord (or U depending on what ramp is used...) now your color will run through the ramp as the distance change...

Since ramp repeats itself , you may want to clamp your MD node output within [0,1].
 
Old 07-26-2013, 02:40 PM   #7
Nanannan
New Member
portfolio
Johan
Gothenburg, Sweden
 
Join Date: Dec 2010
Posts: 27
Hey Alex! Whats not working right is my knowledge of Maya; I'm entirely self-taught and so while I'm advanced in some aspects there are many obvious things I am entirely clueless about. I followed your walkthrough and I now understand alot more than I did before.

What I did not know was that you could load the distancetool entity into the hypershade by selecting Graph<Input and Output connections. Silly, right?

Huge thanks to you and ristopuukko for taking the time to write a respons and help me understand this tool Maya. I, really, appreciate it
 
Old 07-26-2013, 03:35 PM   #8
AlexSudnikov
Veteran
 
AlexSudnikov's Avatar
portfolio
Alex Sudnikov
RU
 
Join Date: Jul 2011
Posts: 79
No problems^^, since Maya is all about nodes - grab whatever you want and look at what's going on "behind the scenes" - it'll teach you a lot.
 
Old 07-26-2013, 03:35 PM   #9
CGTalk Moderation
Lord of the posts
CGTalk Forum Leader
 
Join Date: Sep 2003
Posts: 1,066,481
Thread automatically closed

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.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 09:14 AM.


Powered by vBulletin
Copyright ©2000 - 2016, Jelsoft Enterprises Ltd.