WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 01-10-2017, 07:01 PM
nom nom nom nom is offline
Member
 
Join Date: Jan 2017
Posts: 2
vizconnect avatar manipulation

Hi,

I'm trying to manipulate an avatar after I added it through vizconnect, but I have few questions that I cannot solve by myself.

First question is to change its orientation. I tried to directly modify the vizconnect script.

Code:
 
_name = 'male_2'
	if vizconnect.isPendingInit('avatar', _name, initFlag, initList):
		#VC: init the raw object
		if initFlag&vizconnect.INIT_RAW:
			#VC: create the raw object
			avatar = viz.add('vcc_male2.cfg')
			avatar.setEuler(90,0,0)
			avatar._bodyPartDict = {}
			avatar._handModelDict = {}
			rawAvatar[_name] = avatar
but it didn't do anything. Though when I print the euler, it shows the right euler values. So I tried to call it in my script.

Code:
Avatar = vizconnect.getAvatar('male_2').getRaw()
Avatar.setEuler(90,0,0)
print Avatar.getEuler()
This also didn't do anything while the euler value's correct when I printed.


Second question is that I'd like to make the head of the avatar invisible, so I tried the following code.

Code:
Avatar = vizconnect.getAvatar('male_2').getRaw()
Avatar_head = Avatar.getBone('Bip01 head')
Avatar_head.setVisible(viz.OFF)
This gives an error:

** ERROR: Bone with name 'Bip01 head' does not exist
Traceback (most recent call last):
File "<string>", line 11, in <module>
File "C:\Users\User\Downloads\VR\Vizard script\Learning_PD_Day1_1.py", line 29, in <module>
Avatar_head.setVisible(viz.OFF)
AttributeError: 'VizBone' object has no attribute 'setVisible'

So i guess there is no bone object if I add an avatar through vizconnect.. or is there other way to grab it?

Thanks in advance!
Reply With Quote
  #2  
Old 01-11-2017, 12:54 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,446
Have you mapped any tracking data to the avatar through the animator in vizconnect? If so, then the tracking data may override the set command. You could:
  • Add a transport or group tracker above the avatar in the scenegraph and apply a 90 degree rotation to that.
  • Apply a 90 degree offset to the head tracking data.

Try the following to hide the avatar's head:

Code:
avatar.visible(0,'male_head.crfx')
Reply With Quote
  #3  
Old 02-08-2017, 12:29 PM
nom nom nom nom is offline
Member
 
Join Date: Jan 2017
Posts: 2
Thanks for the reply and sorry for my late reply I finally had some time to try that and your first solution indeed worked, but the problem was that because the group tracker is a parent of the tracking data, when I rotated the avatar, tracking data from other input source also rotate, which overall the result was the same.

Though, I found a solution which I rotated the torso of the avatar to my desired direction and it worked greatly!

For the second part, I tried that code, but the following error message is shown.

** WARNING: Could not find subchild with name: 'male_head.crfx'

Is the name you provided correct?

Thanks in advance!
Reply With Quote
  #4  
Old 02-10-2017, 03:44 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,446
The following works for me using the male_2 avatar from vizconnect:

Code:
avatar = vizconnect.getAvatar('male_2').getRaw()
avatar.visible(0,'male_head.crfx')
Reply With Quote
Reply

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
vizconnect optotrak sensors to avatar shashkes Vizard 8 03-14-2016 08:26 AM
Unexpected Avatar lookAt() behavior when using yield statements chris2307 Vizard 2 12-17-2013 03:58 AM
Collision of an avatar with a quad Frank Verberne Vizard 8 06-04-2008 10:44 AM
Looking through the eyes of an avatar Frank Verberne Vizard 2 04-01-2008 06:52 AM
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 03:55 AM.


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