Notifications
Clear all

[Closed] Get all available of type x

I know how to do this in C#, but not in C++. I’d like to get every available BitmapIO plugin so I can list available bitmap export formats. How do I do that?

2 Replies

something like this ?

#include "bitmap.h"
         
         for(int i = 0; i < TheManager->ioList.Count(); i++)
         {
         	   TSTR shortdesc = TheManager->ioList[i].ShortDescription();
         	   TSTR longdesc = TheManager->ioList[i].LongDescription();
         	   // do something with the descriptions
         }
   it's a bit of a bugger  to find because the reference doesn't actually mention that [b]BMM_IOList[/b] inherits from a  [linked list class]( http://docs.autodesk.com/3DSMAX/15/ENU/3ds-Max-SDK-Programmer-Guide/index.html?url=cpp_ref/class_linked_list_t.html,topicNumber=cpp_ref_class_linked_list_t_html)  of [b]BMM_IOHandler[/b] objects you need to look into bitmap.h to see whats actually going on.

for an example this defines an mxs function which returns an array of strings for all available bitmapIO formats


   def_visible_primitive(getSupportedBitmapIO, "getSupportedBitmapIO");
   
    Value* getSupportedBitmapIO_cf(Value **arg_list, int count)
   {
   	check_arg_count(getSupportedBitmapIO, 0, count);
   	one_typed_value_local(Array* result);
   	vl.result = new Array (TheManager->ioList.Count());
   
   	  for(int i = 0; i < TheManager->ioList.Count(); i++)
 		vl.result->append(new String(TheManager->ioList[i].ShortDescription()));
   	return_value(vl.result);
   }

edit: happily they’ve corrected that omission in the 2013 online help

Brilliant! Thanks