[MAX 2016][C#] Load bitmap as diffuse texture using MaxPlusDotNet

Hello,
I’m currently working on a project which I use MaxPlusDotNet assembly in a C# plugin, instead of Autodesk.Max one.
This assembly looks like the MaxPlus Python library, so it’s a bit higher level than the SDK and I can read the Python API to adapt it in C#.

Right now I didn’t find a right way to load a bitmap texture file as a BitmapTex and use it as a DiffuseMap in a StdMat.


using Autodesk.Max.MaxPlus;

INode node = SelectionManager.GetNode(0);
Asset asset = AssetManager.CreateAsset("myfile.png", AssetType.BitmapAsset);
BitmapTex texture = Factory.CreateDefaultBitmapTex();
texture.SetMap(asset);
StdMat mat = MaxPlus.Factory.CreateDefaultStdMat();
mat.SetEnableMap(1); // check the diffuse map checkbox in maps list


// Set the texture as DiffuseMap ?

node.Material = mat;

Maybe someone could explain me how to achieve that ?

Also, I had another question, is there a possibility with MaxPlus library to parent a Layer with another one ? The Layer and LayerManager classes didn’t help me.

Thank you.