Forum rules - please read before posting.

2D Texture animation on 3D models

I've applied lipsync textures to the character models mouth mesh and inputted the different textures for the phonemes, as well as setting the lip sync to from speech text in the speech manager. But for some reason, the textures are not appearing.

I'm using AC 1.69.0 and the textures are sprite sheets with the appropriate facial texture lined up at the bottom right. But when speech for that character plays, nothing moves or changes.

What am I missing?

Comments

  • The Speech Manager's Perform lipsync on field will need to be set to Game Object Texture. Is that the case, and are you getting any relevant messages in the Console?

  • Yes, It is set to Game Object Texture and I am not getting any messages.

  • Are you using a custom shader? Your Texture property name should likely be set to _MainTex otherwise, since this field references the shader code, not the name of the material or texture itself.

    Try switching to the Standard Shader and the default property name.

  • edited November 2019

    Found the issue.
    It was a slight issue with the shader I was using. An update to the shader fixed it.

    Since we are trying to create character models inspired by Fear Effect and Grim Fandango; we want to add jaw movement when the characters speak. Is there a way to add blend shapes and sync them to the lipsync texture changes?

  • You'd need a bit of scripting, but fairly simple.

    First you need to access the character's current lip-sync frame, which you can do with GetLipSyncFrame.

    Then you can use this to determine how to control your blendshape. You could even do this with AC's Shapeable component, for smooth blending. Something like:

    public Shapeable jawShapeable;
    void Update ()
    {
        int activeLipsyncFrame = GetComponent <Char>().GetLipSyncFrame ();
    
        float jawOpenSize = 0f; // 0% by default
        switch (activeLipsyncFrame)
        {
            case 1:
                jawOpenSize = 50f; // 50% for frame 1
                break;
    
            case 3:
                jawOpenSize = 100f;// 100% for frame 3
                break;
    
            default:
                break;
        }
    
        jawShapeable.SetActiveKey (0, 0, jawOpenSize, 0.1f, MoveMethod.Smooth, null);
    }
    
  • Hi Chris.

    Thanks for the response. My models don't have blend shapes but they do have jawbones. Is there a way to animate the jawbones so they open and close a certain amount from the script switch statement?

  • A LateUpdate function can animate a bone on top of however the Animator controls it.

    public Shapeable jawShapeable;
    public Transform jawBone;
    public float speed = 5f;
    public float intensity = 0.1f;
    void LateUpdate ()
    {
        int activeLipsyncFrame = GetComponent <Char>().GetLipSyncFrame ();
    
        float jawOpenSize = 0f; // 0% by default
        switch (activeLipsyncFrame)
        {
            case 1:
                jawOpenSize = 50f; // 50% for frame 1
                break;
    
            case 3:
                jawOpenSize = 100f;// 100% for frame 3
                break;
    
            default:
                break;
        }
    
        Vector3 angles = jawBone.localEulerAngles;
        angles.x += jawOpenSize * intensity; // Replace x with y or z depending on bone's orientation
        jawBone.localEulerAngles = Vector3.Lerp (jawBone.localEulerAngles, angles, Time.deltaTime * speed);
    }
    
  • Thanks. It works great!

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.