SPARKS/ScriptV8Spark/Script sample files/script.js
// Character3DSpark with every new rendered frame
Character3DSpark with every new rendered frame
Character3DSpark with every new rendered frame
function notifyFrameEvent(){
	if (movingLips){		
		setFaceExpressionRequired(component,"vis-eh_ShapeKey",alfa);
		if (alfa == 0.0){
			alfa=0.5;
		}
		else if (alfa == 0.5){
			alfa=1;
		}
		else if (alfa == 1){
			alfa=0;
		}
	}
	else{
		setFaceExpressionRequired(component,"vis-eh_ShapeKey",0.0);
	}
	conteo = conteo + 0.2;
	if(conteo>100){
		if(!animationLaunched){
			playAnimationRequired(component,"mi-mocap.anim");
			animationLaunched = true;
		}
		else if(!firstMove){
			print("1");
			rotateHeadRequired(component,0,50);
			firstMove = true;
		}
		else if(!secondMove){
			print("2");
			rotateHeadRequired(component,20,0);			
			secondMove = true;
		}
		else{
			print("3");
			rotateHeadRequired(component,0,-50);
			firstMove = false;
			secondMove = false;
		}
	}
	else
		setCameraPositionRequired(component,0,150,conteo+30);
}
function notifyFrameEvent ( ) { if ( movingLips ) { setFaceExpressionRequired ( component , "vis-eh_ShapeKey" , alfa ) ; if ( alfa == 0.0 ) { alfa = 0.5 ; } else if ( alfa == 0.5 ) { alfa = 1 ; } else if ( alfa == 1 ) { alfa = 0 ; } } else { setFaceExpressionRequired ( component , "vis-eh_ShapeKey" , 0.0 ) ; } conteo = conteo + 0.2 ; if ( conteo > 100 ) { if ( ! animationLaunched ) { playAnimationRequired ( component , "mi-mocap.anim" ) ; animationLaunched = true ; } else if ( ! firstMove ) { print ( "1" ) ; rotateHeadRequired ( component , 0 , 50 ) ; firstMove = true ; } else if ( ! secondMove ) { print ( "2" ) ; rotateHeadRequired ( component , 20 , 0 ) ; secondMove = true ; } else { print ( "3" ) ; rotateHeadRequired ( component , 0 , - 50 ) ; firstMove = false ; secondMove = false ; } } else setCameraPositionRequired ( component , 0 , 150 , conteo + 30 ) ; }
Character3DSpark with every new rendered frame
Character3DSpark with every new rendered frame
/* VoiceStartSpark functionality implemented */ /* END ** VoiceStartSpark functionality implemented */ //checkEyesBlinking() /* Basic example to check animations */ /* END ** Basic example to check animations */