Notifications
Clear all

[Closed] select camera target

what ai triying to do is and script that select the target of as camera and in a future i wil do one that select the arget of a light.

I tried the reference sytem as in sloft websirte www.sloft.com

refs.dependsOn $Camera01
it returns:
[size=1]#(Controller:Look_At, Target Camera, ReferenceTarget:BaseLayer)

[size=2]later i tried to do an array of cameras[/size]
[size=2][/size]
[size=1][size=1][color=blue]cameraArray = #()
for o in cameras do
(
append CameraArray o
)
cameraArray

so in the array the next object in the array of the camera is the target. but this sytem works but doesnt lok to clean to me.

Last thig i checked was that the transform controller is [color=#0000ff][size=2][color=red]Controller:Look_[color=red]At and i try the properties on it [size=1]showproperties $camera01[3].controller[/size][/color][/size][/color]
[size=2][color=#fffffe][size=1][color=#000080][/size][/color][/size][/color]
and got:
[size=1].UseTargetAsUpNode : bool

.Axis : integer

.Flip : boolean

.Position : point3

.Roll_Angle : float

.Scale : point3

[/size]on the motion panel i can acces look at target and select it but not via maxscript.

any help wil be apreciated.
[size=2][color=#fffffe][size=1][color=#000080][/size][/color][/size][/color]
[size=2][color=#fffffe][size=1][color=#000080][/size][/color][/size][/color]
[size=2][color=#fffffe][size=1][color=#000080]
[/size][/color][/size][/color][size=2][color=#fffffe]
[/size][/color]

[/color][/size][/color][/size][/size]

1 Reply

found the solution is anode propertie call target.

on genral node properties :Target/LookAt Related Properties

<node>.target Node default: undefined

Get or set the target node for <node>’s LookAt controller

I was trying to find lookat controller but couldnt find it

that the script that works.

selectArray =#()
for obj in selection do
(
if obj.target != undefined do
(
a = obj.target
append selectArray a
)
)
select selectArray