ScriptSpot

Forum topic · General Scripting

3ds Max to CSV file

By polbolotsoro · 2023-07-27

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.

Attachments
Comments (3)

.

miauu · 2023-08-17

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
)

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

polbolotsoro · 2023-08-23

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

NVM! I got it working Thank you so much

polbolotsoro · 2023-08-23

I got it working