Jump to content

[SOLVED] WidgetSpriteViewport is always black


photo

Recommended Posts

I'm attempting to create a WidgetSpriteViewport using the cod from the example gui_02.cpp.  Cutting and pasting this script into my script gets me a viewport that is always black.  I can see the other bits of my GUI as well as the node in the editor but the viewport I've put into the gui is simply black.  Anybody have any ideas as to why this could be?

Link to comment

It's hard to tell without actually seeing your script, but at a guess it might be that you haven't set the modelview and/or projection matrices of the WidgetSpriteViewport correctly (i.e. the viewport isn't looking at or pointing at whatever you hope to see). Do you have much in your scene? (If you don't have much, you may simply be looking at empty space)

Link to comment

I have the default world where you have a sun and a sign post at origin.  I copied the sample script, <unigine_install_dir>\data\samples\objects\gui_02.cpp, and modified the include paths to find the includes they need.  I didn't even think of posting my code (which I deleted out of frustration) but there wasn't much too it.  What is frustrating is that the sample script works from the browser sample script but not when I move it.  In the editor I can see my signpost and I can see the viewport widget but the viewport widget is completely black on both sides.

Link to comment

Hi Joshua,

As Steve mentionited before, a little look at your code could help us a lot.

 

Please, check the attached modified sample. You can generate new project (with my_project name) from SDK Browser and replace files from <project>/data/my_project folder with files from the attached archive.

 

my_project.zip

 

Thanks!

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Link to comment
  • 2 weeks later...

Hi Joshua,

As Steve mentionited before, a little look at your code could help us a lot.

 

Please, check the attached modified sample. You can generate new project (with my_project name) from SDK Browser and replace files from <project>/data/my_project folder with files from the attached archive.

 

attachicon.gifmy_project.zip

 

Thanks!

 

Ok, followed your instructions and I have a revolving camera.  However, if I move that code to my current project and use it exclusively I get a black window.  Is there something you did with the world file or some options you set somewhere?

Link to comment

Ok, followed your instructions and I have a revolving camera.  However, if I move that code to my current project and use it exclusively I get a black window.  Is there something you did with the world file or some options you set somewhere?

 

OK, so I did a diff on your world file and mine.  Change a few parameters on my file and, most importanly, took out the XML tag setting game enabled to zero and guess what happened.  It worked.

The moral of this story is : Don't use engine.game functions if somebody in your group has disabled game.

Thanks for your replies Steve and Silent.

Link to comment
×
×
  • Create New...