WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #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
Reply

Tags
grouping, objects, sightlab, vizard

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Motion Builder + Vizard Objects ForeverBound Vizard 1 04-01-2015 03:49 AM
Grouping Objects javadi Vizard 3 09-17-2013 07:14 AM
Picking up Vizard Objects on mouse down with collisions pwsnow Vizard 2 09-17-2012 02:02 AM
Vizard 4 Beta Testing farshizzo Announcements 0 02-01-2011 10:46 AM
Vizard tech tip: Using the Python Imaging Library (PIL) Jeff Vizard 0 03-23-2009 11:13 AM


All times are GMT -7. The time now is 10:32 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2026, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC