★お知らせ(2023/12/27)
いつもLive2D公式コミュニティをご利用いただき誠にありがとうございます。
本コミュニティは2023年12月27日 11:00をもって閉鎖いたしました。
今後の運営はすべて新Live2D公式クリエイターズフォーラムに移行します。
閉鎖に伴い、以下機能は利用不可となります。
・アカウントの新規作成
・トピック投稿、返信
たくさんのご利用誠にありがとうございました。

新Live2D公式クリエイターズフォーラムは以下バナーよりご利用いただけます。
Live2D公式クリエイターズフォーラム

なお、本コミュニティに投稿されたトピックはすべて残りますが、今後削除する可能性がございますので予めご了承ください。
閉鎖に関するお問い合わせにつきましてはLive2D公式クリエイターズフォーラムへご連絡ください。

NullPointerException when import and reimport model

So imported a model into the Assets folder of Unity and got a NullPointerException when a new object automatically generated
When I use the script init models nothing happened and the model load just fine


This is the exception:

コメント

  • Hi @namv22 ,

    As far as I can tell from checking the error, it seems to be failing to read the texture file.
    Since the path of the file read by Cubism SDK is obtained from the reference described in model3.json, if the file does not exist at the reference, it is unable to properly import the model.
    Please check if the texture file exists at the reference described in model3.json.

    Thank you in advance for your assistance.
  • 編集済: 9月 2019
    Hi @y_a_s_(Dev Staff) thank you for replying, I did a double-check and the texture file is still normal in the texture folder, as I said before too when I use the InitModel from here: https://docs.live2d.com/cubism-sdk-tutorials/initializemodel/
    the model loads up just fine, but if I use this one, I can't work with motions
  • Hi @y_a_s_(Dev Staff) sorry to bother you again, since my last message of the full error didn't appear, so I copy it to notepad and put it in here, can you please take a look, thank you
  • 編集済: 9月 2019
    Hi @namv22

    Thank you for checking the texture's folder hierarchy.

    I'd like to recreate your setup, so please let me know what version of Unity and Cubism SDK you are using.
    Also, if possible, could you provide some model data for testing?
    If you can, please send a message to my account, with the model data attached.

    Thank you in advance for your assistance.
  • Hi @namv22

    Thank you for providing the model data.

    .motion3.json was exported using an older version of the editor that had a problem with exporting.
    Please export motion3.json once again using the latest editor.

    Thanks.
  • Hi @y_a_s_(Dev Staff) , thanks for helping me with my error
    With the new version 2019.2.6f1, I have somewhat successfully imported the models, but a new problem arises with the textures
    So if it's not too much trouble, I hope you can help me with this again
    There is also a NullReferenceException: Object reference not set to an instance of an object error which I attach in the txt file
    Thank you in advance

  • Hi @namv22

    Probably the NullReferenceException is due to the specification of StreamingAssets.
    The provided data had been placed in the StreamingAssets folder, but in Unity, special processing is done to the folder with the name StreamingAssets.
    Assets under the StreamingAssets folder are not managed by Unity, so the texture does not get set, and a special method is required to load the assets.
    For this reason, Cubism SDK for Unity does not expect to import models under StreamingAssets.

    The breakdown of the drawing order of the displayed model can be corrected by organizing the drawing order by changing the Sorting setting of CubismRenderController.
    Please refer to the following page for the setting of Sorting.
    https://docs.live2d.com/cubism-sdk-tutorials/orderinlayer/?locale=en_us

    Thanks.
  • Hi @y_a_s_(Dev Staff) thank you for your help, I somehow manage to fix the error by changing the Order in Layer to 2 and Mode to Back To Front Order
コメントするにはサインインまたは登録して下さい。