Inside Sabertooth
Learn how Sabertooth uses 3ds Max to create 3D interactive projects, including HBO Go’s Game of Thrones interactive experience
  • 1/3
You are here: Forum Home / Autodesk 3ds® Max® / SDK / Applying a bitmap image to a texture
  RSS 2.0 ATOM  

Applying a bitmap image to a texture
Rate this thread
 
62462
 
Permlink of this thread  
avatar
  • Seggaeman
  • Posted: 02 December 2011 06:18 AM
  • Total Posts: 16
  • Joined: 01 December 2011 01:20 AM

Hi

I am using the following code in a SceneImport plugin.

BitMapTextheTexNewDefaultBitmapTex();
 
BitmapInfo bi;
 
Bitmapbmap;
 
bi.SetName(longFileName);
 
bmapTheManager->Load(&bi);
 
theTex->SetBitmapInfo(bi); //set Bitmap info first 
 
theTex->SetBitmap(bmap);

Subsequently this texture is applied to a material. The appropriate bitmaps are initially visible on the scene materials in the material editor (as well as on the imported model when I use the “Standard display with maps” option on the menu), but the “view image” button in the material editor does nothing. And if I click “Reload” the texture disappears. It’s obvious one or more extra function calls are missing; what could they be?

Btw I could have skipped creating a Bitmap and BitmapInfo and just used “SetMapName”. Works fine at times but this occasionally causes crashes (probably because of invalid Bitmap* pointer).



Replies: 0