rename camera problem

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

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
fajar's picture

local baseName = "my camera_"

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
)
Sen's picture

Try

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

Hope this help

dussla's picture

camera taget name is other

i made camera01

there is camera01 / camere01-target

i excute your code

result

cam1 cam2

i want

cam1 cam1-target

dussla's picture

really really rhank you

good work
really thank you always

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.