Notifications
Clear all

[Closed] Cube Map exportation

Hello everybody! I’m new to 3DS Max SDK and I’m trying to develope a scene exporter plugin. I want it to be capable to manage cube maps. I’d like to get the six images involved in Cube Map creation but I don’t know exactly if there are any specific functions to do that or I have to get all the textures one by one, how do I know if I’m exporting a normal texture or a cubemap texture, is there an ID or something like this to identify each kind of texture? how do I access Reflect/Refract parameters?..

Can anybody guide me, tell me which functions could be useful or show me an example? I know I’ve made many questions but any kind of guidance will be useful…

Thanks a lot!

7 Replies

Well, now I know how to get class of texture… any idea on getting the 6 textures involved in the Cube Map? I suppose I must access to the values contained in the corresponding param block but I don’t know exactly how to do it…

Ok, now I can get all texture names from the corresponding IParamBlock2, using GetValue method, I’ve seen that I can also get the Bitmaps itself using GetValue but I don’t know exactly which parameter IDs I have to use… maybe the texture file names? I only want to put these textures in a Bitmap object, does IParamBlock2 provide any method to get this Bitmaps or I have to read them from disk when I have its paths? please help

Thanks a lot!

OK, It’s me again, now I’m accessing bitmaps but I don’t know why I can’t get the correct paths… let me explain it, if I’ve got the following code:

for (unsigned i = 0; i < lNumCubeMaps; ++i)
    {
         char *lName;
         lPBlock->GetValue(acubic_bitmap_names, lTime, lName, lInterval, i);
      
       lBitmapID.push_back(res::IDHnd(sal::io::CFileId(lName).GetFileName().GetName().GetStr()));                    
                                 
         PBBitmap *lBMap;
             
         lPBlock->GetValue(acubic_bitmap_names, lTime, lBMap, lInterval, i);
       
         lBitMap = lBMap->bm;
       
         mCubeMaps.push_back(lBitMap);
    }
            

… the first GetValue works fine and I get the correct file path but in the second one if you take a look at lBMap->bi->device tha path is incomplete… I should get C:\SourceSafe\scenary\cupula\cubemap_X.bmp but I get eSafe\scenary\cupula\cubemap_X.bmp… I don’t know what’s happening… please help!

Thanks again!

acubic_bitmap_names is of type TYPE_FILENAME_TAB but in your second GetValue you try to retrieve the tab element as a PBBitmap.
If you want to get the bitmap values, just create a new bitmap from its filename with the bitmap manager.

First of all thanks Yannick for your help. I’ve done this but it doesn’t work:


 BitmapInfo bi;
 
 TheManager->GetImageInfo(&bi, lName);
 
 Bitmap *lBiMap = TheManager->Create(&bi);
 

… is this correct? lName contains the entire path, “C:\SourceSafe\scenary\cupula\Cubemap_X.bmp” in this case.

1 Reply
(@ypuech)
Joined: 11 months ago

Posts: 0

I think you should use Load() instead ’cause the bitmap already exists.:
Bitmap *lBiMap = TheManager->Load(&bi);

Oops! you’re right, what a silly mistake… a thing that confused me a lot was that using VS debugger I couldn’t visualize BitmapInfo contents but I think that now works fine because if I try to get Bitmap attributes, width and height for example, I get the correct ones (512×512 in this case).

Thanks a lot Yannick!