Giter VIP home page Giter VIP logo

Comments (4)

kkarannn avatar kkarannn commented on September 24, 2024

//Use the following script on the gameobject with skinned mesh renderer component, along with blend shape driver script.
//Give it an empty animation clip to record animation.
//Hit Space key to record animation in play mode and hit space again to stop recording.
//Enjoy

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor.Experimental.Animations;

public class FaceRecorder : MonoBehaviour
{

public AnimationClip CurrentRecordingClip;
public bool m_Recording = false;
GameObjectRecorder m_FaceRecorder;

// Use this for initialization
void Start () {
    m_FaceRecorder = new GameObjectRecorder(this.gameObject);
    m_FaceRecorder.BindComponentsOfType<SkinnedMeshRenderer>(gameObject, false);

    
	
}

// Update is called once per frame
void Update () {
    if(Input.GetKeyDown(KeyCode.Space))
    {
        m_Recording = !m_Recording;
    }
	
}
private void LateUpdate()
{
    if(CurrentRecordingClip == null)
    {
        return;
    }
    if(m_Recording)
    {
        m_FaceRecorder.TakeSnapshot(Time.deltaTime);
    }
    else if(m_FaceRecorder.isRecording)
    {
        m_FaceRecorder.SaveToClip(CurrentRecordingClip);
        m_FaceRecorder.ResetRecording();
    }
}

}

from facial-ar-remote.

jonathan-unity avatar jonathan-unity commented on September 24, 2024

I think this might be this issue #17

from facial-ar-remote.

mtschoen-unity avatar mtschoen-unity commented on September 24, 2024

Hey there @polae. Have you tried using the latest version to see if this resolves your issue? Please let us know if this is still a problem, and re-open the issue. Otherwise, thanks for reporting! :)

from facial-ar-remote.

TheCarelessWhisper avatar TheCarelessWhisper commented on September 24, 2024

//Use the following script on the gameobject with skinned mesh renderer component, along with blend shape driver script.
//Give it an empty animation clip to record animation.
//Hit Space key to record animation in play mode and hit space again to stop recording.
//Enjoy

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor.Experimental.Animations;

public class FaceRecorder : MonoBehaviour
{

public AnimationClip CurrentRecordingClip;
public bool m_Recording = false;
GameObjectRecorder m_FaceRecorder;

// Use this for initialization
void Start () {
    m_FaceRecorder = new GameObjectRecorder(this.gameObject);
    m_FaceRecorder.BindComponentsOfType<SkinnedMeshRenderer>(gameObject, false);

    
	
}

// Update is called once per frame
void Update () {
    if(Input.GetKeyDown(KeyCode.Space))
    {
        m_Recording = !m_Recording;
    }
	
}
private void LateUpdate()
{
    if(CurrentRecordingClip == null)
    {
        return;
    }
    if(m_Recording)
    {
        m_FaceRecorder.TakeSnapshot(Time.deltaTime);
    }
    else if(m_FaceRecorder.isRecording)
    {
        m_FaceRecorder.SaveToClip(CurrentRecordingClip);
        m_FaceRecorder.ResetRecording();
    }
}

}

I know I'm grave digging but it's super important for me, is there a way you specifically add it? i often do this kind of thing wrong in unity, are we supposed to create an entire other script and apply it?

from facial-ar-remote.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.