import viz
import vizconnect
import vizfx
import vizact
viz.setMultiSample(8)
#Need to create and save vizconnect file in your main folder Tools- Vizconnect
vizconnect.go('vizconnect_config.py')
headlight= viz.MainView.getHeadLight()
headlight.disable()
#change name to the name of your model that is saved in your main folder
env = vizfx.addChild('warehouse.osgb')
#change name to the name of your avatar that is saved in your main folder
female = vizfx.addAvatar('female.osgb')
female.state(1)
#morph example
morph = vizact.morphTo(23,1,time=2)
def closeEyes():
female.addAction(morph)
vizact.onkeydown('1',closeEyes)
#Get a handle to the Neck bone
neck = female.getBone('NeckTwist01')
neck.lock() #Disable automatic animation so that we can manually animate it
#Lock the head bone so that manual movement of the neck bone also moves the child head bone
female.getBone('NeckTwist02').lock()
#Lock the head bone so that manual movement of the neck bone also moves the child head bone
head = female.getBone('Head').lock()
def faceView():
#Make head look at viewpoint
viewPOS = viz.MainView.getPosition()
neck.lookAt( viewPOS, mode=viz.AVATAR_WORLD )
neck.setEuler([180,-135,0],viz.REL_LOCAL)
#call function that updates Avatar orientation every frame
vizact.ontimer(0, faceView)
Replies to Reallusion to Vizard
{"html5":"htmlmixed","css":"css","javascript":"javascript","php":"php","python":"python","ruby":"ruby","lua":"text\/x-lua","bash":"text\/x-sh","go":"go","c":"text\/x-csrc","cpp":"text\/x-c++src","diff":"diff","latex":"stex","sql":"sql","xml":"xml","apl":"apl","asterisk":"asterisk","c_loadrunner":"text\/x-csrc","c_mac":"text\/x-csrc","coffeescript":"text\/x-coffeescript","csharp":"text\/x-csharp","d":"d","ecmascript":"javascript","erlang":"erlang","groovy":"text\/x-groovy","haskell":"text\/x-haskell","haxe":"text\/x-haxe","html4strict":"htmlmixed","java":"text\/x-java","java5":"text\/x-java","jquery":"javascript","mirc":"mirc","mysql":"sql","ocaml":"text\/x-ocaml","pascal":"text\/x-pascal","perl":"perl","perl6":"perl","plsql":"sql","properties":"text\/x-properties","q":"text\/x-q","scala":"scala","scheme":"text\/x-scheme","tcl":"text\/x-tcl","vb":"text\/x-vb","verilog":"text\/x-verilog","yaml":"text\/x-yaml","z80":"text\/x-z80"}