Notifications
Clear all

[Closed] max sdk ,Beginner, please advise

How to give diffusemap specified on a map?

	if (mtl->ClassID()==Class_ID(DMTL_CLASS_ID,0))
	{
		Texmap* pDiTexMap = mtl->GetSubTexmap(ID_DI);
		if (pDiTexMap==NULL)
		{
                            


			//When there is no map, specify a map for him
		}
	}

1 Reply

if i understand correct, you wnat to specify a diffuse-bitmap, if there is none…

if(mtl->ClassID()==Class_ID(DMTL_CLASS_ID,0))
  {
      	Texmap* pDiTexMap = mtl->GetSubTexmap(ID_DI);
      	if(pDiTexMap==NULL)
      	{
      		// When there is no map, specify a map for him
      		[color=DarkOrange]TCHAR mapDiffuse[] = _T("the_diffuse_texture.tga");
      
      		BitmapTex* bmDiffuse = NewDefaultBitmapTex();
      		bmDiffuse->SetMapName(mapDiffuse);
      		mtl->SetSubTexmap(ID_DI, bmDiffuse);[/color]
      	}
 }