powroupi / blender_mmd_tools

mmd_tools is a blender addon for importing Models and Motions of MikuMikuDance.
GNU General Public License v3.0
1.81k stars 277 forks source link

A bug in the viewport of blender 2.91 #317

Closed Bancho29 closed 3 years ago

Bancho29 commented 3 years ago

I often use blender_mmd_tools, but I will report a bug found in 2.91.

When exporting an MMD model with the exporter of blender_mmd_tools (0.7.1, December 8, 2020 version) in blender 2.91, screen fraud was confirmed in "solid mode" of viewport. (It did not occur in 2.90)

画像1(2 91エクスポート) Image 1 (2.91 export)

画像2(2 90エクスポート) Image 2(2.90 export)

画像3(モデル移動) Image 3 (when moving the model)

OS used is windows 10 20H2 x64,GPU used is RADEON RX560 (4GB), and the drivers are Radeon Pro Software for Enterprise 20.Q4 and Radeon Software 20.11.1

Currently, there is no choice but to take the following measures.

画像4(対処法1) Image 4 (Countermeasure 1)

画像5(対処法2) Image 5 (Countermeasure 2) - "X-RAY" to On 

Please correct it.

Bancho29 commented 3 years ago

(日本語版) blender_mmd_toolsをよく利用していますが、2.91にてバグが発見されたので報告します。

blender 2.91にてblender_mmd_tools(0.7.1、2020年12月8日版)のエクスポーターでMMDモデルをエクスポートした時、viewportの「ソリッドモード」で画面の不正が確認されました。 (2.90では発生しませんでした)

画像1(2 91エクスポート) 画像1(2.91エクスポート)

画像2(2 90エクスポート) 画像2(2.90エクスポート)

画像3(モデル移動) 画像3(モデルを移動する場合)

使用OSはwindows10 20H2 x64、使用GPUはRADEON RX560(4GB)、ドライバはRadeon Pro Software for Enterprise 20.Q4 及びRadeon Software 20.11.1 です

現状では下記の対処方法を取るしかありません。

画像4(対処法1) 画像4(対処方法1)

画像5(対処法2) 画像5(対処方法2)-「X線」をオン

修正お願いします。

powroupi commented 3 years ago

Thanks for reporting this issue. :smile:

I can not reproduce this issue on my computer, so I think it's an issue of graphic card (driver).

Additionally, you might try 'Load Factory Settings' (blender.exe --factory-startup) to identify the issue:

  1. Import/Export any FBX model without enabling any other addons.
  2. Import/Export any MMD model (PMD/PMX) with only mmd_tools enabled.

It should be an issue of mmd_tools if it only happens in case 2. Thank you. :smile:

(Google Translated) この問題を報告していただきありがとうございます。:smile:

この問題は自分のコンピューターでは再現できないので、グラフィックカード(ドライバー)の問題だと思います。

さらに、「初期設定を読み込み」(blender.exe --factory-startup)を試して、問題を特定することもできます。

  1. 他のアドオンを有効にせずに、FBXモデルをインポート/エクスポートします。
  2. mmd_toolsのみが有効になっているMMDモデル(PMD / PMX)をインポート/エクスポートします。

ケース2でのみ発生する場合は、 mmd_toolsの問題になるはずです。ありがとうございます。:smile:

Bancho29 commented 3 years ago

Thank you for your reply. First of all, the "export" in the above report was a mistake of "import" ...

I tried powroupi's reply, but it was as follows.

  1. Import / export FBX model without enabling other add-ons. 画像6(初期設定でFBXインポート) Image 6 (FBX import by default)/画像6(初期設定でFBXインポート) 画像7(移動2) Image 7 (when moving the model)/画像7(モデルを移動する場合)

    It didn't happen here.

  2. Import / export MMD models (PMD / PMX) with only mmd_tools enabled. 画像8(初期設定でpmxインポート) Image 8 (pmx import by default)/画像8(初期設定でpmxインポート)

    It happened here.

(日本語版) 返答ありがとうございます。

まず訂正ですが、上記の報告の「エクスポート」は「インポート」の間違いでした…

powroupi 様の返答を試しましたが、以下の通りでした。

  1. 他のアドオンを有効にせずに、FBXモデルをインポート/エクスポートします。

  こちらでは発生しませんでした。

  1. mmd_toolsのみが有効になっているMMDモデル(PMD / PMX)をインポート/エクスポートします。

  こちらでは発生しました。

nagadomi commented 3 years ago

I can not reproduce this issue on my computer too. (Linux, GTX1080, Blender 2.91.0) If you get glitches when you change Cube > Material Properties Tab > Viewport Display > Metallic/Roughness, it's not an issue of mmd_tools. It may be due to mmd_tools changing the viewport display for each material when importing the model (It is used when type=SOLID and color_type=MATERIAL).

私の環境でも再現できません。(Linux, Blender 2.91.0) Cube > マテリアルプロパティタブ > ビューポート表示 > メタリック/粗さを変更したときにグリッチする場合はmmd_toolsの問題ではありません。 mmd_toolsがモデルインポート時に各マテリアルのビューポート表示を変更していることに起因しているかもしれません(それはソリッドモードのカラー=マテリアルのときに使用されます)。

nagadomi commented 3 years ago

Maybe this issue is related to the following blender's issue. https://developer.blender.org/T82856 There have been various reports of viewport rendering issues with AMD GPU. Looks like a similar problem: https://developer.blender.org/T83022

Bancho29 commented 3 years ago

Thank you for your reply, nagadomi.

I can not reproduce this issue on my computer too. (Linux, GTX1080, Blender 2.91.0) If you get glitches when you change Cube > Material Properties Tab > Viewport Display > Metallic/Roughness, it's not an issue of mmd_tools. It may be due to mmd_tools changing the viewport display for each material when importing the model (It is used when type=SOLID and color_type=MATERIAL).

In this environment, the display was normal even if I changed Cube> Material Properties tab> Viewport Display> Metallic / Roughness,

Maybe this issue is related to the following blender's issue. https://developer.blender.org/T82856 There have been various reports of viewport rendering issues with AMD GPU. Looks like a similar problem: https://developer.blender.org/T83022

What was mentioned in was exactly the defect that was mentioned here.

I knew it wasn't a problem with mmd_tools, but I also understood that it was a problem with the driver or Blender itself ...

(日本語版) nagadomi様、返答ありがとうございます。

私の環境でも再現できません。(Linux, Blender 2.91.0) Cube > マテリアルプロパティタブ > ビューポート表示 > メタリック/粗さを変更したときにグリッチする場合はmmd_toolsの問題ではありません。 mmd_toolsがモデルインポート時に各マテリアルのビューポート表示を変更していることに起因しているかもしれません(それはソリッドモードのカラー=マテリアルのときに使用されます)。

こちらの環境ではCube > マテリアルプロパティタブ > ビューポート表示 > メタリック/粗さを変更しても表示は正常でしたが、

Maybe this issue is related to the following blender's issue. https://developer.blender.org/T82856 There have been various reports of viewport rendering issues with AMD GPU. Looks like a similar problem: https://developer.blender.org/T83022

で挙げられたのは、まさしくこちらの挙げた不具合そのものでした。

mmd_toolsの問題でないのは分かりましたが、むしろドライバかBlender本体の問題ということも理解しました…

powroupi commented 3 years ago

Currently, there is no choice but to take the following measures....

@Bancho29 Looks like it is an issue of Viewport alpha/transparency of Blender 2.91 on some graphic cards. If there is no issues with rendering, you can disable the following code of mmd_tools/core/material.py to prevent this issue of mmd_tools. :smile:

        if hasattr(mat, 'alpha'):
            mat.alpha = mmd_mat.alpha
        elif len(mat.diffuse_color) > 3:
            mat.diffuse_color[3] = mmd_mat.alpha

to

        #if hasattr(mat, 'alpha'):
        #    mat.alpha = mmd_mat.alpha
        #elif len(mat.diffuse_color) > 3:
        #    mat.diffuse_color[3] = mmd_mat.alpha

Or reset alpha value of every material from Blender Console Window.

>>> for m in D.materials: m.diffuse_color[-1]=1
...
>>>

(Google Translated) @Bancho29 一部のグラフィックカードでのBlender2.91のビューポートアルファ/透明度の問題のようです。 レンダリングに問題がない場合は、mmd_tools/core/material.py のコードを無効にして、この mmd_toolsの問題を防ぐことができます。:smile:

        if hasattr(mat, 'alpha'):
            mat.alpha = mmd_mat.alpha
        elif len(mat.diffuse_color) > 3:
            mat.diffuse_color[3] = mmd_mat.alpha

このように変更します

        #if hasattr(mat, 'alpha'):
        #    mat.alpha = mmd_mat.alpha
        #elif len(mat.diffuse_color) > 3:
        #    mat.diffuse_color[3] = mmd_mat.alpha

または、Blenderコンソールウィンドウからすべてのマテリアルのアルファ値をリセットします。

>>> for m in D.materials: m.diffuse_color[-1]=1
...
>>>
Bancho29 commented 3 years ago

Thank you for your reply, powroupi.

Looks like it is an issue of Viewport alpha/transparency of Blender 2.91 on some graphic cards. If there is no issues with rendering, you can disable the following code of mmd_tools/core/material.py to prevent this issue of mmd_tools. 😄

        if hasattr(mat, 'alpha'):
            mat.alpha = mmd_mat.alpha
        elif len(mat.diffuse_color) > 3:
            mat.diffuse_color[3] = mmd_mat.alpha

to

        #if hasattr(mat, 'alpha'):
        #    mat.alpha = mmd_mat.alpha
        #elif len(mat.diffuse_color) > 3:
        #    mat.diffuse_color[3] = mmd_mat.alpha

I confirmed that it was dealt with by the above correction. I want you to set it as an option.

Thank you very much.

(日本語版) powroupi様、返答ありがとうございます。

一部のグラフィックカードでのBlender2.91のビューポートアルファ/透明度の問題のようです。 レンダリングに問題がない場合は、mmd_tools/core/material.py のコードを無効にして、この mmd_toolsの問題を防ぐことができます。😄

        if hasattr(mat, 'alpha'):
            mat.alpha = mmd_mat.alpha
        elif len(mat.diffuse_color) > 3:
            mat.diffuse_color[3] = mmd_mat.alpha

このように変更します

        #if hasattr(mat, 'alpha'):
        #    mat.alpha = mmd_mat.alpha
        #elif len(mat.diffuse_color) > 3:
        #    mat.diffuse_color[3] = mmd_mat.alpha

上記の修正で対処されたのを確認しました。 オプションとして設定してほしいぐらいです。

ありがとうございました。

powroupi commented 3 years ago

I confirmed that it was dealt with by the above correction. I want you to set it as an option.

Sorry, I am not going to add an option for that. It may be fixed by Blender or graphic card driver since Blender 2.90 works normally on your system. There would be lots of options if we want to meet everyone's request, and I would not be able to maintain it. :cry:

(Google Translated) 申し訳ありませんが、そのためのオプションを追加するつもりはありません。 Blender 2.90はシステム上で正常に動作するため、Blenderまたはグラフィックカードドライバによって修正される可能性があります。 皆様のご要望にお応えしたいのであれば、選択肢はたくさんあり、メンテナンスはできません。:cry:

Bancho29 commented 3 years ago

Sorry, I am not going to add an option for that. It may be fixed by Blender or graphic card driver since Blender 2.90 works normally on your system. There would be lots of options if we want to meet everyone's request, and I would not be able to maintain it. 😢

I understand.

(日本語版)

申し訳ありませんが、そのためのオプションを追加するつもりはありません。 Blender 2.90はシステム上で正常に動作するため、Blenderまたはグラフィックカードドライバによって修正される可能性があります。 皆様のご要望にお応えしたいのであれば、選択肢はたくさんあり、メンテナンスはできません。😢

了解しました。