2015対応アドイン製品のご紹介(再度)と3ds Max 2014にてNitrous SDKを使用する際のご注意

Autodesk Developer Networkの工藤 暁です。先日伊勢崎よりご案内させて頂きました2015対応アドイン製品ですが、M&E製品として株式会社ピー・ソフトハウス様より

PSOFT Pencil+ 3 及び PSOFT Liquid+ プレリリースされました事を改めてご紹介させて頂きます。 詳しくは上記リンクをご参照ください。

 

さて、3ds Max 2014にてNitrous SDKを使用する際に問題が報告されましたので、回避方法と共にご紹介させて頂きます。

問題としては下記のコードに様にカスタムGeomObjectプラグインにてIObjectDisplay2を使用すると、常にsmoothにてビューポート(Nitrous)に描画されてしまいます。

 

<code_begin>

    virtual bool PrepareDisplay(const MaxContext&, const UpdateDisplayContext& displayContext) {

        const TimeValue t = displayContext.GetDisplayTime();

        GenerateMeshRenderItemsContext genContext;

        genContext.GenerateDefaultContext(displayContext);

        IMeshDisplay2pMeshDisplay = static_cast<IMeshDisplay2>(mesh.GetInterface(IMesh_DISPLAY2_INTERFACE_ID));

        if (pMeshDisplay == NULL) {

            return false;

        }

        pMeshDisplay->PrepareDisplay(genContext);

        return true;

    }

    virtual bool UpdatePerNodeItems(const MaxContext& maxContext,

                                                         const UpdateDisplayContext& displayContext,

                                                         UpdateNodeContext& nodeContext,

                                                         IRenderItemContainer& targetRenderItemContainer) {

        GenerateMeshRenderItemsContext genContext;

        genContext.GenerateDefaultContext(displayContext);

        genContext.RemoveInvisibleMeshElementDescriptions(nodeContext.GetRenderNode());

        IMeshDisplay2*pMeshDisplay = static_cast<IMeshDisplay2*>(mesh.GetInterface(IMesh_DISPLAY2_INTERFACE_ID));

        if (pMeshDisplay == NULL) {

            return false;

        }

        RenderItemHandleArray renderItems;

        pMeshDisplay->GetRenderItems(maxContext, genContext, nodeContext, renderItems);

        targetRenderItemContainer.ClearAllRenderItems();

        targetRenderItemContainer.AddRenderItems(renderItems);

        return true;

    }

<code_end>

 

残念ながら、2014にてこの問題を回避するにはIObjectDisplayを使用して頂く事となります。

尚、2015ではIObjectDisplay2をご利用頂けます。

 

ご迷惑をお掛け致しますが、宜しくお願い致します。

6a0167607c2431970b01a511b4361c970c-800wi


Comments

Leave a Reply

Discover more from Autodesk Developer Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading