SimplyMaya Forums

Welcome to the forum, feel free to ask questions here.


SM Forums / Lounges / Maya Basics & Newbie Lounge / Connecting to "distance from camera"

Maya Basics & Newbie Lounge Please post in this section ONLY if your question doesn't fit in anywhere else on the forum, or if you're not sure which section it's relevant to. We also have Free streaming trial available.

Join the conversation. Reply to post
 
Thread Tools
31-10-2004, 08:36 PM   #1
discostu
Registered User
 
Join Date: Apr 2003
Posts: 37
Connecting to "distance from camera"
I want to link the focus distance on a camera to a locator's "distance from camera" attribute. I can't seem to find that in the Connection Editor. Basically what I want to do is be able to move the locator to the position I want to be in focus.

This way I can animate the locator and change what is in focus over time.

Any suggestions?

Thanks,
Stu
  Reply with quote
08-11-2004, 05:34 AM   #2
discostu
Registered User
 
Join Date: Apr 2003
Posts: 37
Solved
yay! I've solved my own problem! I created a Creat->Measure Tools->Distance Tool. This creates a tool that has two locators and measures the distance between them. I named one startLocator and the other endLocator. I connected the location of the startLocator to the location of the camera, so it will move with the camera. Then I put the endLocator and the part I want to be in focus (the f-stop value determines how much in front and behind the focus distance will be in focus. f:5.6 means a small distance, wher f:64 means practically everything is in focus). Then I connected the camera's focus distance to the Distance Tool's distance attribute. I had to do this in the script editor cause I couldn't find the options in the connection editor.
Code:
connectAttr -f distanceDimension1.distance cameraShape1.focusDistance;
And now it works. Yay!
  Reply with quote
15-01-2020, 07:07 PM   #3
johnnyboycage
Registered User
 
Join Date: Jan 2020
Posts: 1
Quote:
yay! I've solved my own problem! I created a Creat->Measure Tools->Distance Tool. This creates a tool that has two locators and measures the distance between them. I named one startLocator and the other endLocator. I connected the location of the startLocator to the location of the camera, so it will move with the camera. Then I put the endLocator and the part I want to be in focus (the f-stop value determines how much in front and behind the focus distance will be in focus. f:5.6 means a small distance, wher f:64 means practically everything is in focus). Then I connected the camera's focus distance to the Distance Tool's distance attribute. I had to do this in the script editor cause I couldn't find the options in the connection editor.
Code:
connectAttr -f distanceDimension1.distance cameraShape1.focusDistance;
And now it works. Yay!
I know it's a bit late, but this saved my life.
  Reply with quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
connecting floatFields and proc inputs bendingiscool Programming 0 26-10-2008 12:33 PM
connecting to polygons mtlgreatest Maya Basics & Newbie Lounge 1 11-05-2006 03:03 AM
Connecting body parts Clod Maya Basics & Newbie Lounge 6 22-01-2004 11:36 AM
... help with connecting 2 planes.. LSphinx Maya Basics & Newbie Lounge 9 28-11-2003 04:12 AM
Problems with connecting #simplymaya Kühl Maya Basics & Newbie Lounge 3 14-05-2003 01:56 AM