![]() |
|
#1
|
|||
|
|||
|
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? |
![]() |
| Tags |
| grouping, objects, sightlab, vizard |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
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 |