PDA

View Full Version : removing clones


jaclyn.bill
08-20-2009, 03:38 AM
Dear users,

I'm running an experiment in which 2/3 trial require poles to be places in the scene, and one trial requires these to be removed.

Early on in my script I use

def addcones():
global cone
###########code for placing cones
for place in (positionlistA,positionlistB,positionlistC,positio nlistD,positionlistE):
pos = (place)
cone = viz.add('pole.wrl',cache=viz.CACHE_CLONE,pos=pos)
cone.color(0,1,0)
cone.setScale(2,0.05,2)
#cones.append(cone)
if place[3] >0:
cone.setPosition(1,0,0,viz.REL_LOCAL)
if place[3] <0:
cone.setPosition(-1,0,0,viz.REL_LOCAL)


to add the cones and in my trial selection function I use the same code but just remove the cones from the scene.



if trialtype ==0:
viz.MainScene.visible(viz.OFF,viz.WORLD)
yield viztask.waitTime(5)
trial.message('Heading')
yield viztask.waitTime(5)
trial.remove()
createpath()
cone.remove()
passiveheading()
yield viztask.waitTime(0.5)
viz.MainScene.visible(viz.ON,viz.WORLD)
yield viztask.waitTime(16.9)


to remove the cones before running the trial. However, it only removes one cone. My understanding is that clones should copy the original? Is this not the case?

I'd appreciate any pointers on this. Many Thanks in advance.

jaclyn.bill
08-20-2009, 03:58 AM
p.s the cone.visible(viz.OFF) command only hides one cone also.

farshizzo
08-20-2009, 09:51 AM
Removing an object will NOT remove clones of it. You will need to call remove() on each individual cloned object, just like any other object.