ScriptSpot

Forum topic · General Scripting

Camera rename

By Any · 2023-11-22

Description

Hi all.

I haven’t used Maxscript in my work for a long time, I forgot a lot...
There is a camera in the scene. It is known that the camera class is Freecamera. I want to rename it using a script.

But that doesn't happen

\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
for v in geometry do (
if (classof v == Freecamera) then
(
select v
$.name = "Camera"
)
)
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

Comments (4)

About Class

Any · 2023-11-22

I understood the reason. The camera does not belong to the Geometry class. How to go through all classes of objects in the scene?

.

miauu · 2023-11-23



for o in objects do ...



for o in objects where classOf o == FreeCamera do ...

.

miauu · 2023-11-22


(
	for c in cameras where classOf c == FreeCamera do c.name = "Camera"
)

Any · 2023-11-22

Thank you MIAUUU