ScriptSpot

Forum topic · General Scripting

How to save the FOV values exported camera to a TXT file

By Any · 2023-01-18

Description

Good afternoon.

Now I studied the RPF format for exporting data from 3DS Max to After Effect.
I learned that from the sequence of RPF files, you can create a camera in After Effect,
via the "RPF camera import" command. But for such a camera, only its orientation is calculated.
And the change in FOV during the animation is not calculated. Of course there are third-party scripts,
that make up for this deficiency. But in such scripts, you need to make settings through the user interface, and by hand, and for me to work, I need to get only the camera parameters, and preferably in automatic mode. And the question arose how to save the FOV values
exported camera to a TXT file and then read it into After Effects. Can anyone
Are you familiar with this issue???

Comments (2)

.

miauu · 2023-01-19

Select the camera and in maxscript listener write this: show $

All properties of the camera will be printed. Find the FOV parameter and then you can save it like this:



(	
	outFilePath = "D:\ExportedCamsFOV.txt"
	outFile = createFile outFilePath
	
	--	"add only cam's fov"
	for o in objects where superclassof o == camera do
		format "%\n" o.fov to:outFile
	
	close outFile
	
	-----
	
	outFilePath = "D:\ExportedCamsNameAndFOV.txt"
	outFile = createFile outFilePath
	--	"add cam's name and fov"
	for o in objects where superclassof o == camera do
		format "%=%\n" o.name o.fov to:outFile
	
	close outFile
)

The code above is tested with Physical camera, where ".fov" gives you the fov of the camera.

Any · 2023-01-19

Thank you miauu