【问题标题】:3ds Max Programming Materials Category()3ds Max 编程材料类别()
【发布时间】:2021-04-13 11:07:06
【问题描述】:

这有点奇怪,但无论我尝试多少次,我创建的所有材质和贴图都会出现在 General 类别材质中。 这是我的材料类别代码。

const TCHAR* Category() { return NULL; }//_T(""); }//GetString(IDS_CATEGORY); }
const MCHAR* GetEntryName() const { return LuxMixMapFriendlyClassName; } //NULL; }
const MCHAR* GetEntryCategory() const {
    HINSTANCE hInst = GetModuleHandle(_T("sme.gup"));
    if (hInst) {
        //Extract a resource from the calling module's string table.
        static MSTR category(MaxSDK::GetResourceStringAsMSTR(hInst,
            IDS_3DSMAX_SME_MATERIALS_CATLABEL).Append(_T("\\Lux")));
        return category.data();
    }
    else
    {
        return _T("Maps\\Lux");
    }
}
enter code here

【问题讨论】:

    标签: c++ sdk shader 3dsmax


    【解决方案1】:

    最后,我解决了这个问题,老实说,3dsmax 需要更好的文档。 如果其他人是这种情况,只需编写解决方案即可。 所有代码都是完全正确的,但是为了应用,应该调用一个可选的类,但没有它就无法工作。此外,如果您不调用它,也不会出错。 (有点意思)

    首先,在 public classDesc2 我添加“public IMaterialBrowserEntryInfo”

    class Lux_AddClassDesc : public ClassDesc2, public IMaterialBrowserEntryInfo
    

    在类中添加。

    FPInterface* GetInterface(Interface_ID id) {
    if (IMATERIAL_BROWSER_ENTRY_INFO_INTERFACE == id) {
        return static_cast<IMaterialBrowserEntryInfo*>(this);
    }
        return ClassDesc2::GetInterface(id);
    }
    

    所有其他部分完全相同。

    【讨论】:

      猜你喜欢
      • 2012-12-02
      • 1970-01-01
      • 2019-04-10
      • 2010-10-26
      • 2017-09-05
      • 1970-01-01
      • 2014-10-18
      • 2016-08-13
      • 2021-04-19
      相关资源
      最近更新 更多