Dear Users,

Now, we are seeking users who can give us a hand with expertise to evolve our software more dynamically.
If you are willing to help us, we’d like you to make a registration for “Live2D Creators Circle” via the link below.
Designers, programmers, translators are especially welcomed so far.
(More detailed explanation will be given to you before we ask you to do tasks)

https://docs.google.com/forms/d/1G5KK_GL3ozwPXtTHrpi_ktbsI8UZf8jlYRSlDworyBo/viewform?usp=send_form

RenderMode.DrawMeshNow error

Hi there, it's me again! :)

I uploaded a first version of my app for my testers and noticed in my exception logging that apparently an error is thrown without doing any harm. At least that's what I can see when testing.
Live2D Cubism 2.1 / RenderMode.DrawMeshNow Error live2dmodel.draw() must be called in OnPostRender() or OnRenderObject() . ------------------- 
  at live2d.     :drawLast()
I used the newest code from the Unity sample app provided with the SDK.

Comments

  • Yeah, this error basically tells you that ALive2DModel.draw() shouldn't be called from MonoBehaviour.Update() when you use RenderMode.DrawMeshNow. Could you recheck that the script for drawing the model calls ALive2DModel.draw() in MonoBehaviour.OnRenderObject() like this:
    private void OnRenderObject()
    {
        if (live2DModel == null) { return; }
    
    
        live2DModel.draw();
    }
  • edited June 2016
    The code in LAppModelProxy looks like this:
    
    void OnRenderObject()
    {
    	if(!isVisible) return;
    	if(model==null)return;
    
            if(model.GetLive2DModelUnity().getRenderMode() == Live2D.L2D_RENDER_DRAW_MESH_NOW)
    	{
                model.Draw();
    	}
    		
    	if (LAppDefine.DEBUG_DRAW_HIT_AREA)
    	{
    		model.DrawHitArea();
    	}
    }
    
    void Update()
    {
    	if(!isVisible) return;
            if (model == null) return;
    
            model.Update();
            if (model.GetLive2DModelUnity().getRenderMode() == Live2D.L2D_RENDER_DRAW_MESH)
            {
                model.Draw();
            }
    }
    
  • Which is correct :# . So you should be on the safe side :D .
  • So I can ignore that exception?
    It's a little bit weird to do so... :D
Sign In or Register to comment.