vizinfo in multiple scenes
hi, im trying to use the vizinfo module but the boxes only seem to appear in scene 1.
how can I add an info box to a different scene (while in another one)? or how can I make a box appear after calling viz.scene(#>1) ? thanks |
Hi,
Do you want the same box in different scenes? If so, try the following: Code:
info = vizinfo.add(....) Code:
info.group.duplicate(2) |
how should i do it if I want to add multiple vizinfos into different scenes (at least 2 per scene).
also, is there a way I can check the version number of vizard so i can send an error message if the user tries to run a script in an older version? |
Hi,
To add the vizinfo box to a different scene try the following: Code:
#Place info box in scene 2 Code:
version = viz.version() |
so i tried what you suggested, but it doesn't seem to work. i even made a little test script:
Code:
import viz |
My bad, it should be:
Code:
info._group.parent(viz.SCREEN, scene) |
ok, so the parent trick works (maybe this should be added as a feature in future versions?). now i get an error when i try to scale vizinfo. what i have is this:
Code:
INFO_SIZE = [0.5,0.5] Code:
Traceback (most recent call last): |
The older version of vizinfo didn't support passing lists to the scale function. You will have to pass each value individually:
Code:
info.scale(INFO_SIZE[0],INFO_SIZE[1]) Code:
info.scale(*INFO_SIZE) |
i have both 2.5 and the previous version (2.1?) installed. I was getting that error while using 2.5. Is it possible vizard was grabbing the vizinfo from the older version?
also, random python question. is there a python equivalent to: x = (isBoolean)? y:z i have a lot of checks, and i'm tired of repeating the 4 line if/else template ;) |
It might be possible. Startup 2.5 and check the value of the following in the interactive window:
Code:
viz._WIN_VIZ_PATH Python doesn't support the one line if/else. If you can guarentee that the value of the boolean will always be either 0 or 1 you could do the following: Code:
x = [z,y][isBoolean] Code:
def ifelse(boolean,trueVal,falseVal): |
All times are GMT -7. The time now is 12:37 PM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC