ScriptSpot home

Forum topic · General Scripting

Select Camera and Target at the same time

By Mohamad Fawzi · 2020-07-30

Description

Hi there,
let say i am using vray camera and it is already selected, how can i + select the target also so i can move them up or forward while i am viewing from camera.

Normally i hit (P) and select the camera (Ctrl) select target and then hit (C) to get back to the camera view to move to accordingly to what i am seeing.

have been searching for along time, all i found is how to select Camera (OR) select target.
Thanks in advance

Comments (6)
Mohamad Fawzi

Thanks jahman it works fine, Thanks A LOT
can it be done without selecting the cam?

Reply to Mohamad Fawzi
Panteleev Sergey

.

sure


try
(
  cam = getActiveCamera(); if cam != undefined do
  (
    select (if cam.target != undefined then #( cam, cam.target ) else cam)
  )
)catch()
Reply to Panteleev Sergey
Mohamad Fawzi

it gives me this:

-- Syntax error: at ), expected
-- In line: )c

.. am i doing it wrong?

Reply to Mohamad Fawzi
Panteleev Sergey

.

this code works for me
most likely that one of the parenthesis is missing

Panteleev Sergey

.

try( selectMore $.target )catch()