ScriptSpot

Forum topic · General Scripting

rename camera problem

By dussla · 2014-06-17

Description

i make 3 camera
and after , i would like to change name

camera01 + taget
camera02 + tager
camera03 + taget

select $camera

i = 1
for o in selection

(
o.name = cam + i as sting

i = i + 1
)

after result = camera01 -> cam01 camera01 taget -> cam02

what problem ?

always thank youy

Comments (4)

local baseName = "my camera_"

fajar · 2014-06-17


baseName = "my camera_"  -- change whatever you want.
-- also you can change cameras to selection on the line below

for i=1 to cameras.count where classof cameras[i]!=targetObject do 
(
num= i as string
	cameras[i].name  = baseName + num
	cameras[i].target.name = baseName+"target_" + num
)

Try

Sen · 2014-06-17

obj = $selection as array
for i = 1 to obj.count do
(
obj[i].name = ( "cam"+ i as string )
)

Hope this help

camera taget name is other

dussla · 2014-06-17

i made camera01

there is camera01 / camere01-target

i excute your code

result

cam1 cam2

i want

cam1 cam1-target

really really rhank you

dussla · 2014-06-18

good work
really thank you always