View Single Post
  #2  
Old 09-01-2018, 01:55 AM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,460
The following code shows how to add a spinning model to a panel. Let us know if this helps to resolve the issue with your own code:

Code:
import viz
import vizinfo
import vizact
import vizdlg

viz.go()
viz.addChild('piazza.osgb')
avatarPanel = vizinfo.InfoPanel('Avatar Panel',align=viz.ALIGN_LEFT_BOTTOM,fontSize=22,icon=False)
avatarFiles = ['vcc_male.cfg','vcc_female.cfg','vcc_male2.cfg','pigeon.cfg']
    
for i,filename in enumerate(avatarFiles):
    
    if i == 3:
        scale = [130] * 3
    else:
        scale = [45] * 3
        
    avatar = viz.addAvatar(filename,scale=scale,euler=[i*90,0,0])
    avatar.addAction(vizact.spin(0,1,0,45))
    avatar.enable(viz.DEPTH_TEST,op=viz.OP_ROOT)
    avatar.state(1)
    subPanel = vizdlg.Panel(layout = vizdlg.LAYOUT_VERT_CENTER, border= False)
    subPanel.setMinSize([100,0])
    subPanel.addItem(avatar)
    avatarPanel.addItem(subPanel,align=viz.ALIGN_CENTER)
Reply With Quote