WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 06-06-2012, 11:35 AM
kovitch kovitch is offline
Member
 
Join Date: Sep 2010
Posts: 30
TexQuad FadeOut/FadeIn issue

Hi,

I'm experiencing some kind of a problem, when using fadein/fadeout on viz.SCREEN. Despite the code I use there's no fadeOut. The image justa appears after 1 sec.

The code I use is:

Code:
    def drawTrainingList(self,prod_list):

        products_per_column = 8

        image_y_position = 0.75225
        image_x_position = 0.125

        background_x_inc = 0.125

        image_y_pos_inc = 0.097 
        image_x_pos_inc = 0.3335 

        number_x_pos_inc = 0.07
        number_y_pos_inc = 0.05

        text_x_pos_inc = 0.01
        text_y_pos_inc = 0.05

        if len(prod_list) < 9:
            image_x_position += image_x_pos_inc
        elif len(prod_list) > 8 and len(prod_list) < 17:
            image_x_position += image_x_pos_inc/2
  
        product_index = 0
        
        self.background_texture_list =  []
        self.product_texture_list = []
        self.product_text_list = []
        self.seq_numbers_list = []

        fadeOut = vizact.sequence( vizact.method.visible(1), vizact.fadeTo(1.0,speed=1.0) )

        self.background_wallpaper = viz.addTexQuad(viz.SCREEN,align=viz.TEXT_LEFT_BOTTOM,pos=(0,-0.1,0),scale=(12.8,11.725,1))
        self.background_wallpaper_texture = viz.add(config.SCREEN_PATH + 'background.png')
        self.background_wallpaper.texture(self.background_wallpaper_texture)

        self.title_text = viz.addText('Ingredients', parent = viz.SCREEN,align=viz.TEXT_CENTER_CENTER,pos=(0.5,0.92,0),scale=(0.85,1,1))

        while product_index < len(prod_list):
            if product_index % products_per_column == 0 and product_index != 0:
                image_x_position += image_x_pos_inc
                image_y_position = 0.75225
    
            self.background_texture_list.append(viz.addTexQuad(viz.SCREEN,align=viz.TEXT_LEFT_BOTTOM,pos=(image_x_position-background_x_inc,image_y_position,0)))
            self.background_texture_list[product_index].texture(prod_list[product_index].background)
            self.background_texture_list[product_index].setScale(4.275,1.0)
            self.background_texture_list[product_index].alpha(0)
            self.background_texture_list[product_index].visible(0)
            
            self.product_texture_list.append(viz.addTexQuad(viz.SCREEN,align=viz.TEXT_RIGHT_BOTTOM,pos=(image_x_position,image_y_position,0)))
            self.product_texture_list[product_index].texture(prod_list[product_index].texture)
            self.product_texture_list[product_index].setScale(0.775,1.0)
            self.product_texture_list[product_index].alpha(0)
            self.product_texture_list[product_index].visible(0)            
    
            self.product_text_list.append(viz.addText(prod_list[product_index].name,viz.SCREEN,align=viz.TEXT_LEFT_CENTER,pos=(image_x_position+text_x_pos_inc,image_y_position+text_y_pos_inc,0),scale=[0.35,0.4,0.4]))
            self.product_text_list[product_index].alpha(0)
            self.product_text_list[product_index].visible(0)

            self.seq_numbers_list.append(viz.addText(str(product_index+1)+'.',viz.SCREEN,align=viz.TEXT_RIGHT_CENTER,pos=(image_x_position-number_x_pos_inc,image_y_position+number_y_pos_inc,0)))
            self.seq_numbers_list[product_index].alpha(0)
            self.seq_numbers_list[product_index].visible(0)
            self.seq_numbers_list[product_index].setScale(0.3,0.4)            
            
            self.background_texture_list[product_index].runAction(fadeOut)
            self.product_texture_list[product_index].runAction(fadeOut)
            self.product_text_list[product_index].runAction(fadeOut)
            self.seq_numbers_list[product_index].runAction(fadeOut)

            image_y_position -= image_y_pos_inc
            product_index += 1
            
            yield viz.waittime(config.DRAW_LIST_ELEMENT_INTERVAL)
What is the problem with the desired effect? Am I missing something?

I've arealdy tried something like this to 3d models and everything runs smoothly.

Best regars,

Alex.
Reply With Quote
  #2  
Old 06-06-2012, 02:51 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
What is the value of the config.DRAW_LIST_ELEMENT_INTERVAL variable? You are passing this value to viz.waittime, which will block rendering for the specified amount of seconds. If the value of the variable is around 1 second, then you are stalling the frame for a second and it when it continues, the fade action will be complete.

I noticed you are yielding the value of viz.waittime. Were you intending to use viztask.waitTime instead?
Reply With Quote
  #3  
Old 06-07-2012, 12:25 PM
kovitch kovitch is offline
Member
 
Join Date: Sep 2010
Posts: 30
You're totaly right i wanted to use viztask instead, my bad. Thanks!
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
Using a texquad to cover a window Enlil Vizard 4 02-07-2012 03:13 PM
Multiple Textures for Diffuse and Specularity Shader Issue shivanangel Vizard 1 05-11-2009 10:44 AM
Cal3D texture issue from Max shivanangel Vizard 5 10-17-2008 12:17 PM
vizard 2.5 compatability issue shai Vizard 3 08-10-2005 04:35 PM
texquad shai Vizard 1 02-23-2005 01:09 PM


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


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