View Single Post
  #1  
Old 12-02-2025, 02:44 PM
josie_icoglab josie_icoglab is offline
Registered User
 
Join Date: Dec 2025
Posts: 1
Question Grouping Objects from SightLab in Vizard

I am creating a 3d flanker task using sightlab and vizard. I added the environment and objects (flanker and target arrows) in sightlab, and am now finetuning the trials and manipulating the positioning of arrows in vizard.

I want to link the 4 flanker arrows as a group so they move as one from trial to trial, as they will always be manipulated in the same way at the same time per trial. I am a beginner with python and don't have much experience coding. I tried to use the sightlab AI to create code to do this, but was unsuccessful. This is the code that sightlab VR assistant gave me:

#position flankers and target at same depth and height:

import vizfx

#group flankers so they move and rotate as one, keep target separate:

flankerNames = ['L1_group', 'L2_group', 'R1_group', 'R2_group']
targetName = 'C_group'

flankerArrows = [vizfx.addChild(name) for name in flankerNames]
targetArrow = [vizfx.addChild(targetName)]

flankerGroup = vizfx.addGroup()

for arrow in flankerArrows:
arrow.setParent(flankerGroup)

#arrange flankers and a target in a line

spacing = 0.4

positions = {
'L2': -2*spacing,
'L1': -spacing,
'R1': spacing,
'R2': 2*spacing,
}

for arrow in flankerArrows:
arrow.setPosition(positions[arrow.getName()], 0, 0, mode=viz.REL_LOCAL)

#position of flankers relative to participant
depthZ = 2.0
heightY = 1.5
centerX = 0

flankerGroup.setPosition(centerX, heightY, depthZ)
targetArrow.setPosition(centerX, heightY, depthZ)

#face participant
flankerGroup.setEuler(0,0,0)
targetArrow.setEuler(0,0,0)

The error code I am getting is: AttributeError: module 'vizfx' has no attribute 'addGroup'.

Just wondering if anyone has any idea how I could group objects as one, or how to adjust this code so that it runs?
Reply With Quote