View Single Post
  #1  
Old 01-10-2017, 06:01 PM
nom nom nom nom is offline
Member
 
Join Date: Jan 2017
Posts: 3
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