WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 08-20-2009, 03:38 AM
jaclyn.bill jaclyn.bill is offline
Member
 
Join Date: Oct 2007
Posts: 42
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.
Reply With Quote
  #2  
Old 08-20-2009, 03:58 AM
jaclyn.bill jaclyn.bill is offline
Member
 
Join Date: Oct 2007
Posts: 42
p.s the cone.visible(viz.OFF) command only hides one cone also.
Reply With Quote
  #3  
Old 08-20-2009, 09:51 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
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.
Reply With Quote
Reply

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
removing multiple objects durf Vizard 7 08-05-2009 09:15 AM
removing and obj with a timer durf Vizard 0 06-04-2009 07:16 AM
Removing Vertices from an On-The-Fly Object shivanangel Vizard 1 11-05-2008 01:38 PM
executable - removing models Dave Vizard 2 05-13-2008 02:58 AM


All times are GMT -7. The time now is 03:59 PM.


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