[C# MSCE]材质的几个参数设置

在读取材质的属性中遇到一个问题,如图所示。

材质属性前的选项值是通过material设置中的哪个属性值来设定的呢?或者说这是个枚举类型?

Parents Reply
  • 目前该设置.Net没有封装该接口,所以暂时不能通过.Net代码设置,但C++是有的,代码如下:

     

    MaterialSettingsCR settings = material.GetSettings ();
    MaterialMapP map = settings.GetMapsR ().GetMapP (MaterialMap::MAPTYPE_SpecularColor);
    
    if (settings.HasCustomSpecular ())   //SpecularColarState_Custom
    
        settings.SetHasCustomSpecular (true);
    
    else if (!settings.HasSpecularColor ())   //SpecularColarState_UseElement
    
        settings.SetHasSpecularColor (false);    
    
    else if (NULL != mapP && mapP->IsEnabled ())  //SpecularColarState_ColorMap
    
        map->SetIsEnabled (true);
    else if (settings.LockSpecularAndBase ())   //SpecularColarState_Metallic
    
        settings.SetLockSpecularAndBase (true);

     

    Answer Verified By: xz h 

Children
No Data