• Daz 3D
  • Shop
  • 3D Software
    • Daz Studio Premier
    • Daz Studio
    • Install Manager
    • Partnerships
    • AI Training data
    • Exporters
    • Daz to Roblox
    • Daz to Maya
    • Daz to Blender
    • Daz to Unreal
    • Daz to Unity
    • Daz to 3ds Max
    • Daz to Cinema 4D
  • 3D Models
    • Genesis 9
    • Genesis 8.1
    • Free 3D Models
  • Community
    • Gallery
    • Forums
    • Blog
    • Press
    • Help
  • Memberships
    • Daz Premier
    • Daz Plus
    • Daz Base
    • Compare
  • Download Studio
ADVANCED SEARCH
  • Menu
  • Daz 3D
ADVANCED SEARCH
Add image
  • Shop
  • 3d Software
    • Daz Studio Premier
    • Daz Studio
    • Install Manager
    • Partnerships
    • AI Training data
    • Exporters
    • Daz to Roblox
    • Daz to Maya
    • Daz to Blender
    • Daz to Unreal
    • Daz to Unity
    • Daz to 3ds Max
    • Daz to Cinema 4D
  • 3D Models
    • Genesis 9
    • Genesis 8.1
    • Free 3D Models
  • Community
    • Our Community
    • Gallery
    • Forums
    • Blog
    • Press
    • Help
  • Memberships
    • Daz Premier
    • Daz Plus
    • Daz Base
    • Compare

Notifications

You currently have no notifications.

Loading...
    • Categories
    • Recent Discussions
Daz 3D Forums > 3rd Party Software > Unity Discussion

How would you change from facial expression to facial expression every few Seconds?

nokoteb99nokoteb99 Posts: 931
May 2021 edited May 2021 in Unity Discussion

I know that i'll have to export facial morphs of facial expressions when sending my chracters with DAZ to Unity bridgee,  but then in Scripting in Unity how would i control the Blendshapes to change and animate or not animate but just animate the little transition from one to the other? and then stay on one facial expression for random number of seconds

Post edited by nokoteb99 on May 2021

Comments

  • ArtiniArtini Posts: 10,307
    May 2021

    It is easy, if you know, how to write scripts in C# in Unity by yourself.

    I am not at that level yet, so I cannot help, right know.

    Maybe try this free Bolt visual language in Unity, if you do not know, how to write scripts.

    Post your results, here, please.

     

  • nokoteb99nokoteb99 Posts: 931
    May 2021

    Thanks i kind of found the solution, from the Unity manual wanna see it?

     

    using UnityEngine;using System.Collections;public class BlendShapeExample : MonoBehaviour{    int blendShapeCount;    SkinnedMeshRenderer skinnedMeshRenderer;    Mesh skinnedMesh;    float blendOne = 0f;    float blendTwo = 0f;    float blendSpeed = 1f;    bool blendOneFinished = false;    void Awake ()    {        skinnedMeshRenderer = GetComponent<SkinnedMeshRenderer> ();        skinnedMesh = GetComponent<SkinnedMeshRenderer> ().sharedMesh;    }	void Start ()    {    blendShapeCount = skinnedMesh.blendShapeCount; 	}	void Update ()    {    if (blendShapeCount > 2) {      if (blendOne < 100f) {      skinnedMeshRenderer.SetBlendShapeWeight (0, blendOne);			         blendOne += blendSpeed;       } else {         blendOneFinished = true;       }       if (blendOneFinished == true && blendTwo < 100f) {          skinnedMeshRenderer.SetBlendShapeWeight (1, blendTwo);           blendTwo += blendSpeed;       }     } }

    So ok this example gives me everythign i need to know now to move and animate and change blendshapes. you can use it too. basically. Here they using blendSpeed to contrrol how fast the aninimation of the blenshape will move so lke going from 0% to 100% of a smile from 0 smile to full smile.

    Etcetera im glad they gave this good example

  • ArtiniArtini Posts: 10,307
    May 2021

    Thanks for posting it. There are so many sides with the documentation available, so if you find somthing else useful, please post it as well.

  • nokoteb99nokoteb99 Posts: 931
    May 2021

    I extended my script now with that example. Now my script has like 8 blendshapes(the basic DAZ expressions HD). And switches between them every few seconds. While also talking with a lipsync product i applied. The lipsync product doesn't do anything to change the expressions, i did that all by my self. i was getting it wrong but yestreday i fixed it all. Now it's awesome

     

Sign In or Register to comment.
Adding to Cart…

Daz 3D is part of Tafi

Connect

DAZ Productions, Inc.
7533 S Center View Ct #4664
West Jordan, UT 84084

HELP

Contact Us

Tutorials

Help Center

Sell Your 3D Content

Affiliate Program

Documentation Center

Open Source

Consent Preferences

JOIN DAZ

Memberships

Blog

About Us

Press

Careers

Bridges

Community

In the Studio

Gallery

Forum

DAZ STORE

Shop

Freebies

Published Artists

Licensing Agreement | Terms of Service | Privacy Policy | EULA

© 2025 Daz Productions Inc. All Rights Reserved.