WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   Loading Message (https://forum.worldviz.com/showthread.php?t=5560)

Seadna 11-25-2015 04:47 AM

Loading Message
 
Hi folks,

I'm trying to show a loading message when I load a model / point cloud. It should appear as soon as i click ok in the select file dialog box and disappear when the file has been loaded.

For some reason i can only get Vizard to display the message and load the file at the exact same time no matter what sequence i put it in the code. I have true using vizact.SEQUENCE and just putting the lines of code in the order i want them to run but the outcome is always the same.

Code:

MsgPanel = vizinfo.InfoPanel('Loading...',align=viz.ALIGN_CENTER,fontSize=25,icon=False,key=None)
MsgPanel.visible(False)       

skyactive = 0       
def LoadProcess():
        MsgPanel.visible(True)
        def LoadFile():
                global Cloud
                CloudFile = vizinput.fileOpen(filter=[('Point Cloud Files', '*.ply;*.3dc'),('Meshes', '*.fbx;*osg;*.osgb;*3ds')])
                Cloud = viz.addChild(CloudFile)
                if skyactive == 1:
                        sky.disable(viz.RENDERING)
        LoadFile()
        MsgPanel.visible(False)
vizpopup.onMenuItem(LoadItem, LoadProcess)

I'm new to Python so i'm sure its probably something simple.

Any help is much appreciated.

Jeff 12-02-2015 03:19 PM

You could load the model asynchronously and display a loading message until the async event is triggered.


All times are GMT -7. The time now is 01:54 AM.

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