Notifications
Clear all

[Closed] Setup background image to viewport using 3ds max sdk

It’s simple to setup background image using max gui (Alt+B -> Background source -> Files, Display Background on). But I cannot find how to do this operation using c++ max sdk. I’ve tried to setup enviroment

Interface12* ip12 = GetCOREInterface12();
Bitmap* bmap;
BitmapInfo bmap_info(u->cam_list[id].full_name.c_str());
BMMRES status;
bmap = TheManager->Load(&bmap_info, &status);

BitmapTex *bmt = NewDefaultBitmapTex();
bmt->SetMap(bmap_info.GetAsset());
bmt->ReloadBitmapAndUpdate();
bmt->fnReload();
ip12->SetEnvironmentMap(bmt);
ip12->SetUseEnvironmentMap(true);

But in this case Use Environment Background checkbox in viewport background settings is off. Also if I check it manually on, image looks stretched (safe frame is on and appropriate aspect).

Is there any solution to setup background using max sdk?