Notifications
Clear all

[Closed] getting a list of available image loaders?

Is there a way with maxscript to get a list of whatever bitmap loaders are available to use so I can create a filter?

Cheers,
Cg.

5 Replies
 lo1

Not quite, but you can make a list of all bitmap formats you’ve ever heard of and call

maxOps.canImportBitmap ("C:\\1" + typeStr)

on each type.

The SDK has better facilities for what you need, but they’re not exposed to maxscript.

(
	
	fn GetAllBitmapIO =
	(
		stream = "" as stringstream
		showclass "*:*BitmapIO" to:stream
		seek stream 0
		
		formats = #()
		while not eof stream do
		(
			append formats (trimright (filterstring (readline stream) ":")[1])
		)
	)
	
	GetAllBitmapIO()
	
)
3 Replies
 lo1
(@lo1)
Joined: 11 months ago

Posts: 0

Those are actually the names of the importers, not necessarily the extensions that they import.
Btw, you can more easily get this list using

bitmapio.classes
(@polytools3d)
Joined: 11 months ago

Posts: 0

Yes you are right. I though the task was to get the names to build a filter, possibly to be used in a Open File dialog.
But then you would need to get the extensions for items like “Portable_Network_Graphics”=“PNG”.

 lo1
(@lo1)
Joined: 11 months ago

Posts: 0

The SDK lets you get this using the ‘Ext’ method on BitmapIO.
I wonder if it’s exposed to the .NET SDK which would be accessible from maxscript.