ScriptSpot home

Forum topic · General Scripting

3ds Max to CSV file

By poaul · 2023-07-27

Downloads
Description

"Hi, is there a way to export a CSV file in 3ds Max using a script? The CSV should have two columns: '3D Object Name' and 'Material Name', listing only the file names of the selected 3D objects along with their corresponding material names." Thank you in Advance

CSV example screenshot.

Comments (3)
miauu

.

A bit late, but:


(
	csvFilePath = @"D:\myCSVFile.csv"
	outFile = createFile csvFilePath
	for o in selection do
	(
		format "%,%\n" o.name (if (mat = o.mat) != undefined then o.mat.name else "NO MATERIAL") to:outFile
	)
	close outFile
)
Reply to miauu
poaul

How about if the Object has multiple material names on it.

Hi, thank you very much.

However, what if the object has multiple material names on it, like the example screenshot I provided? Currently, the script lists the multi/sub-object materials, which shouldn't be included in the CSV.

Is it possible to create a CSV format similar to the one in the screenshot I provided? I really appreciate your help in advance.

Attachments
Reply to poaul
poaul

NVM! I got it working Thank you so much

I got it working