PDA

View Full Version : Target Distance Undefined?


Teriander
08-20-2008, 07:09 PM
I'll make this simple to understand:

1. Create a "Free Camera"
2. Open MaxScript Listener
3. In the Modify tab of max, change your target distance to another number (example 6.506").

Your MaxScript Listener will display in the pink zone:
$.targetDistance = 6.50628

But if you type:
$.targetDistance

You will recieve:
undefined

My question is, why does targetDistance respond with undefined? If I type in other properties like .fov, I get the correct response of 45.0. But .targetDistance is undefined, why??

holycause
08-20-2008, 07:18 PM
a free cam don't have any target ;)

edit: if u want a target cam, u should use this targetCamera

ZeBoxx2
08-20-2008, 09:54 PM
a free cam don't have any target ;)

That's not to say that a freeCamera doesn't have a target distance property; in fact, manipulating that value in a freeCamera allows you to control the reach of the view frustrum in the viewports, for example - and the Depth of Field by default uses the target distance as well.

Which doesn't answer the original question, but...


$
$Free_Camera:Camera01 @ [37.269371,0.000001,-26.199263]
$.targetDistance
undefined
$.targetDistance = 10
10 -- but it's not actually set to 10
$.target_distance -- subAnim value accessor
96.0 -- see?
$.target_distance = 10
10
$.target_distance
10.0 -- now it is


No idea why .targetDistance returns undefined and can't be set, though; I do suspect it's related to the freeCamera vs targetCamera thing (as you can't particularly set it when you are using an actual target), but that's just a wild guess.

Bobo
08-20-2008, 10:04 PM
DIRECT QUOTE FROM THE HELP:

NOTE:

In 3ds Max, all node-level properties are searched before base-object-level properties. If a base-object property has the same name as a node-level property, you need to search in the base object for the base object property.

This affects the following properties of freeCamera:



<freeCamera>.baseObject.targetDistance

Get/Set the target distance of the Free Camera.

Every node in 3ds Max has a node property .targetDistance which contains the distance to an eventual target the node is looking at using a LookAt controller. (you can assign a node to the .lookAt property and the controller will be assigned automatically).

Thus, a Free Camera has such a node property but it is set to undefined, and a baseobject property with the same name which contains the actual target distance value shown in the User Interface. If the Free Camera gets converted to a Target camera, the node-level property will be displayed in the User Interface and should be accessed via MAXScript.

ZeBoxx2
08-20-2008, 11:00 PM
well, that explains that :>
/me tells self to rtfm

CGTalk Moderation
08-20-2008, 11:00 PM
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.