WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 07-16-2014, 11:12 AM
The SundanceKid The SundanceKid is offline
Member
 
Join Date: May 2014
Posts: 4
Resetting the Color and Alpha of Nodes

Hi,

I'm trying to make nodes 'blink' in Vizard 5. I wrote the following code to make a given node blink:

Code:
fadeColor = vizact.fadeTo(node.getColor(), time=0.333)
fadeWhite = vizact.fadeTo([1,1,1], time=0.333)
fadeSequence = vizact.sequence(fadeWhite,fadeColor,viz.FOREVER)
node.addAction(fadeSequence)
This code works. My problem arises when I want a given node to stop blinking. If I have its node.getColor() values, I can just fade the node back to those values. But this works only for one-color nodes; some nodes, for example those composed of one green node and one black node, will return values that represent a diffusion of green and black when I call node.getColor(). This means I can only reset nodes to a mix of their original colors — I can't set all of their children back to each of their respective original colors.

Of course, I could recurse through each child and each child of each child for all of the nodes, save all the color values to a list, and then access those values when resetting their colors and alphas. Surely, there's an easier way to do this, right? Isn't there some built-in function that I can call to reset a node to its original state/color/alpha?

Last edited by The SundanceKid; 07-16-2014 at 11:15 AM.
Reply With Quote
 

Tags
alpha, color, getcolor(), reset, vizard 5.0

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


All times are GMT -7. The time now is 06:17 AM.


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