WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   removing clones (https://forum.worldviz.com/showthread.php?t=2219)

jaclyn.bill 08-20-2009 03:38 AM

removing clones
 
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

Code:

def addcones():
        global cone
        ###########code for placing cones
        for place in (positionlistA,positionlistB,positionlistC,positionlistD,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.

Code:


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.


All times are GMT -7. The time now is 04:46 AM.

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