WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #4  
Old 10-16-2013, 01:26 AM
Frank Verberne Frank Verberne is offline
Member
 
Join Date: Mar 2008
Location: Netherlands
Posts: 148
Okay, I'm pretty sure the eyelids are not moved by bones. I've tried recording a little piece of one of the standard animations of the sample HD character, with blinking included. Uncomment vizact.onexit(saveTrackingData) to enable saving. Warning: the resulting file gets big (for a .log file) fast:
Code:
import viz
import vizact
import cPickle

viz.go()

avatar = viz.add('vcc_male2.cfg', pos = [0,.15,.25], euler = [180,0,0])
avatar.state(1)
boneList = []
boneNameList = []

for bone in avatar.getBoneList():
	boneList.append(bone)
	boneNameList.append(bone.getName())

global bone_info, total_info
bone_info = []
total_info = []

def updateBoneInfo():
	global bone_info, total_info
	for bone in boneList:
		bone_info.append(bone.getName())
		bone_info.append(bone.getEuler())
	total_info.append(bone_info)
	bone_info = []

vizact.ontimer(viz.FASTEST_EXPIRATION, updateBoneInfo)

BONE_DATA = open("Recording_of_bones.log", 'w+') 

def saveTrackingData(): 
	global total_info
	cPickle.dump(total_info, BONE_DATA) 
	BONE_DATA.flush() 
	BONE_DATA.close() 

#vizact.onexit(saveTrackingData)
Then, I played back the recordings on the same avatar, and the whole animation is played back, EXCEPT for the blinking (press the b-key for playback if the previous code is used to create a short recording):
Code:
import viz
import vizact
import viztask
import cPickle
from collections import deque 

viz.go()

avatar = viz.add('vcc_male2.cfg', pos = [0,.15,.25], euler = [180,0,0])
boneList = []
boneNameList = []

for bone in avatar.getBoneList():
	boneList.append(bone)
	boneNameList.append(bone.getName())

for bone in boneList:
	bone.lock()
	
BONE_DATA = open("Recording_of_bones.log", 'r') 

def setBones():
	total_info = deque(cPickle.load(BONE_DATA)) 
	yield viztask.waitDraw()
	while len(total_info) > 0:
		line = line = deque(total_info.popleft())
		while len(line) > 0:
			boneName = line.popleft()
			boneOrientation = line.popleft()
			if boneName in boneNameList:
				index = boneNameList.index(boneName)
				boneList[index].setEuler(boneOrientation)
			else:
				print 'bone not found on character!'
		yield viztask.waitDraw()

def onKeyDown(key):
	if key in 'bB':
		viztask.schedule(setBones)

viz.callback(viz.KEYDOWN_EVENT,onKeyDown)
So that would rule out any bone involvement in blinking of the eyes. Any other suggestions?
Reply With Quote
 

Tags
blinking, hd complete characters

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom head on HD Complete Character Frank Verberne Vizard 3 06-18-2013 05:18 PM
Moving, blinking eyes for Complete Character Set Frank Verberne Vizard 4 09-14-2012 05:42 AM
making a Complete Character Set character speak Frank Verberne Vizard 4 05-25-2012 08:47 PM
New Complete Character morph targets for facial animation? Deltcho Vizard 2 07-26-2010 04:26 PM
How to make avatar's eyes to blink when speaking michelcm3 Vizard 12 01-15-2008 08:48 AM


All times are GMT -7. The time now is 05:52 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC