PDA

View Full Version : How to remove a modifier


Joran
05-27-2009, 01:54 AM
Hello,

After running this piece of code:

toon = viz.add('toon.dlm')
ball = viz.add('ball.wrl')
ball.modify(toon)


How do you remove the toon modifier from the ball?

Greetings, Joran.

farshizzo
05-27-2009, 12:53 PM
You can apply the toon modifier to a group node and parent/unparent the ball from the group node to toggle toon shading. Here is some sample code:import viz
viz.go()

#Create group node for rendering in toon mode
toon = viz.add('toon.dlm')
toonGroup = viz.addGroup()
toonGroup.modify(toon)

#Create ball underneath toon node
ball = viz.add('ball.wrl',parent=toonGroup,pos=(0,1,5))

#Unparent ball from toon node when spacebar pressed
vizact.onkeydown(' ',ball.parent,viz.WORLD)