PDA

View Full Version : Problem with geometry in vzf objects


Enlil
02-02-2010, 09:40 AM
Hello,

I am having an odd problem when I try to grab geometry from objects made from .vzf files (heads, specifically). Look at the following piece of code:


male1 = viz.add('C:\AXE\Resource\Avatar\Eric\Body\casual01 _m_highpoly.cfg')
face1 = male1.face('C:\AXE\Resource\Avatar\Eric\Eric_122\E ric_122_morphs.vzf', 'Bip01 Head', 'Bip01 Neck')
eye1r = face1.getchild('geom_0')
eye1l = face1.getchild('geom_1')

male2 = viz.add('C:\AXE\Resource\Avatar\Eric\Body\casual01 _m_highpoly.cfg')
face2 = male2.face('C:\AXE\Resource\Avatar\Eric\Eric_122\E ric_122_morphs.vzf', 'Bip01 Head', 'Bip01 Neck')
male2.setPosition([1,0,1])
eye2r = face2.getchild('geom_0')
eye2l = face2.getchild('geom_1')

There doesn't seem to be anything too odd there, but if I run it, one of the heads will have no eyes! Both heads have eyes if I do not get the eyes, though. Any ideas on why?

Thanks,
Christian

Enlil
02-03-2010, 07:56 AM
I tried it again using the biohead with eyes included in the resources directory. I got the same result - one of the heads loses it's eyes! This version only uses things from the resources directory, so should be runnable by anyone. The script is as follows:
import viz
viz.go()

female1 = viz.add('vcc_female.cfg')

#male.state(1)
face1 = female1.face('biohead_eyes.vzf')

foo1r = face1.getchild('geom_0')
foo1l = face1.getchild('geom_1')

#male1.visible(viz.OFF)
#face1.visible(viz.OFF)


female2 = viz.add('vcc_female.cfg')


#male.state(1)
face2 = female2.face('biohead_eyes.vzf')

female2.setPosition([1,0,1])

foo2r = face1.getchild('geom_0')
foo2l = face1.getchild('geom_1')

Christian

Jeff
02-03-2010, 09:16 AM
Try using the following methods to add the face and apply it to the avatar.
import viz
viz.go()

face1 = viz.add('biohead_eyes.vzf')
face2 = viz.add('biohead_eyes.vzf')

female1 = viz.add('vcc_female.cfg', pos = [0.2,0.3,1], euler = [180,0,0])
female1.setFace(face1)

female2 = viz.add('vcc_female.cfg', pos = [-0.2,.3,1], euler = [180,0,0])
female2.setFace(face2)

f1_l_eye = face1.getChild('geom_0')
f1_r_eye = face1.getChild('geom_1')

f2_l_eye = face2.getChild('geom_0')
f2_r_eye = face2.getChild('geom_1')

female1.state(1)
female2.state(1)

Enlil
02-04-2010, 10:56 AM
That works, thanks.

Christian