How To List Camera Names

How To List Camera Names

Anonymous
Not applicable
3,283 Views
8 Replies
Message 1 of 9

How To List Camera Names

Anonymous
Not applicable

Hi All,

 

I wonder if it is possible to list the camera names in the scene and save it to a .txt or .csv file on file system.

 

Can this be possible through Max Script or any other way? Even an external command without opening the scene will work.

 

 

Thanks in advance for your suggestions.

0 Likes
Accepted solutions (1)
3,284 Views
8 Replies
Replies (8)
Message 2 of 9

Steve_Curley
Mentor
Mentor
The quickest (and dirtiest) way would be to open the Maxscript Listener, enter the following all on one line and press Enter. Click in the output pane, Ctrl+A then Ctrl+C then paste the results into your favourite text editor and clean up the results.
Creating a proper script to ask for a filename etc etc would be relatively easy, but by the time you've done that you could already have the necessary results. Only worth the effort if you have to do this on many scenes.

for cam in cameras do (print cam.name)

Max 2016 (SP1/EXT1)
Win7Pro x64 (SP1). i5-3570K @ 4.4GHz, 8Gb Ram, DX11.
nVidia GTX760 (2GB) (Driver 430.86).

0 Likes
Message 3 of 9

Anonymous
Not applicable

Hi Steve,

 

I will need the same for a couple hundred scenes. Looks like I need to learn max script and somehow automate it.

 

Thank you for you suggestion.

 

 

0 Likes
Message 4 of 9

Steve_Curley
Mentor
Mentor
Well worth it in that case. I'll have a look when I get a moment or 3 😉 but learning the basics of Maxscript is well worth it in the long run - repetative jobs like this are pretty easy and can save an enormous amount of time.

Max 2016 (SP1/EXT1)
Win7Pro x64 (SP1). i5-3570K @ 4.4GHz, 8Gb Ram, DX11.
nVidia GTX760 (2GB) (Driver 430.86).

Message 5 of 9

Anonymous
Not applicable

Actually I will really appreciate that if you can take a look to suggest for a proper script.

 

I allready started to study on MaxScript but it is still different to hear from a pro.

 

 

Cheers...

0 Likes
Message 6 of 9

Steve_Curley
Mentor
Mentor
Not a "pro" by any stretch of the imagination, just know enough to do small tasks like this one (hopefully).

Max 2016 (SP1/EXT1)
Win7Pro x64 (SP1). i5-3570K @ 4.4GHz, 8Gb Ram, DX11.
nVidia GTX760 (2GB) (Driver 430.86).

0 Likes
Message 7 of 9

Steve_Curley
Mentor
Mentor
Accepted solution
(
Cams = for Cam in cameras where (superclassof Cam == camera) collect Cam
if Cams.count > 0 then
	(
	output_name = getSaveFileName caption:"Text File" types:"Text (*.txt)|*.txt|All Files (*.*)|*.*|"	
	if output_name != undefined then
		(
		output_file = createfile output_name
		if output_file != undefined then
			(
			for Cam in Cams do format "%\n" Cam.name to:output_file
			close output_file
			)
		)
	)
)
Load that into the Maxscript Editor (not the Listener), select all, drag the whole thing to a Toolbar - it will create a button for you which you can customise if you want. Attached it (zipped) in case copy/pasting from the forum doesn't work.

Max 2016 (SP1/EXT1)
Win7Pro x64 (SP1). i5-3570K @ 4.4GHz, 8Gb Ram, DX11.
nVidia GTX760 (2GB) (Driver 430.86).

0 Likes
Message 8 of 9

Anonymous
Not applicable

Hi Steve,

 

It works like a charm. You cant imagine how much time I will save with the help of this script.

 

Thank you very much for your interest and help.

 

Cheers.

0 Likes
Message 9 of 9

Steve_Curley
Mentor
Mentor
You're welcome. Just remember to take time out to look though it - it's pretty simple really. Everthing used in there is explained in the Maxscript help, often with examples.

Max 2016 (SP1/EXT1)
Win7Pro x64 (SP1). i5-3570K @ 4.4GHz, 8Gb Ram, DX11.
nVidia GTX760 (2GB) (Driver 430.86).

0 Likes