WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   How to remove a modifier (https://forum.worldviz.com/showthread.php?t=2053)

Joran 05-27-2009 01:54 AM

How to remove a modifier
 
Hello,

After running this piece of code:

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:
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)



All times are GMT -7. The time now is 08:42 AM.

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