ScriptSpot home

Forum topic · General Scripting

Selecting Camera Target

By V-MOTION · 2011-10-04

Description

if i have a vray camera selected

i can do

select $'VRayPhysicalCamera01.Target'

to select the target,
but how do i change the code to select a target of a camera named differently?

Comments (4)
V-MOTION

ok and the answer for that was
select o.target

:)

Panayot Karabakalov

is this you ask for?

trg = selection[1].target
if trg != undefined do select trg
V-MOTION

so the question is rather, how i replace the string vrayphysicalcamera01 with a variable that is defined in the script


local theSel = lbx_VcamObjects.selection as array

this is what i use to get all vray cameras in scene,

and this is for example what i do when i want to turn clipping on, in any selected camera


on chk_onClip changed state do
					(
						for o in getSelectedVrayPhysicalCamera() do o.clip_on = state
						updateControls()
					)