WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 10-15-2013, 09:20 AM
Frank Verberne Frank Verberne is offline
Member
 
Join Date: Mar 2008
Location: Netherlands
Posts: 148
Hi Jeff,

Sounds like a good idea! However, I've tried to print the eulers (also tried quaternions) of the eye related bones, while running one of the standard animations and was unable to detect changes in eulers (or quaternions) of those bones. So I don't know how the HD character blinks during the standard animations. In its cfg file, no blink morph is specified, so blinking is not accomplished through applying a moprh. Any suggestions?

Code:
import viz
import vizact

viz.go()

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

for bone in avatar.getBoneList():
	if 'Eye' in bone.getName() and not (('brow' in bone.getName()) or 'Nub' in bone.getName()):
		boneList.append(bone)

def printInfo():
	for bone in boneList:
		print bone.getName(), bone.getEuler()
	
vizact.ontimer(viz.FASTEST_EXPIRATION, printInfo)
Reply With Quote
  #2  
Old 10-16-2013, 02: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
Reply

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 06:18 PM
Moving, blinking eyes for Complete Character Set Frank Verberne Vizard 4 09-14-2012 06:42 AM
making a Complete Character Set character speak Frank Verberne Vizard 4 05-25-2012 09:47 PM
New Complete Character morph targets for facial animation? Deltcho Vizard 2 07-26-2010 05:26 PM
How to make avatar's eyes to blink when speaking michelcm3 Vizard 12 01-15-2008 09:48 AM


All times are GMT -7. The time now is 06:56 AM.


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