Camera rename

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

Comment viewing options

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

About Class

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

.

for o in objects do ...
for o in objects where classOf o == FreeCamera do ...
miauu's picture

.

(
	for c in cameras where classOf c == FreeCamera do c.name = "Camera"
)
Any's picture

Thank you MIAUUU

Thank you MIAUUU

Comment viewing options

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