Maya 2020 fundamentals - modelling the real world
Get halfway through a model and find it's an unworkable mess? Can't add edge loops where you need them? Can't subdivide a mesh properly? If any of this sounds familiar check this course out.
# 1 31-10-2004 , 08:36 PM
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

# 2 08-11-2004 , 05:34 AM
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!

# 3 15-01-2020 , 07:07 PM
Registered User
Join Date: Jan 2020
Posts: 3

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.

Posting Rules Forum Rules
You may not post new threads | You may not post replies | You may not post attachments | You may not edit your posts | BB code is On | Smilies are On | [IMG] code is On | HTML code is Off

Similar Threads