FlightGear Newsletter July 2017: Difference between revisions

From FlightGear wiki
Jump to navigation Jump to search
No edit summary
Line 91: Line 91:


{{See also|Canvas_Troubleshooting#Adding_draw_masks_for_Canvas}}
{{See also|Canvas_Troubleshooting#Adding_draw_masks_for_Canvas}}
=== FlightGear Headless ===


== In the hangar ==
== In the hangar ==
One of the more common feature requests is to provide a so called "headless" mode for troubleshooting purposes, this means that the main FlightGear window would be disabled (or hidden for starters) - this would also be one of the prerequisites for running FlightGear in an unattended fashion, e.g. on a server using a scripted flight or replaying a pre-recorded flight. For some time now, a number of end-users and long-term contributors have discussed that this would be an enormously useful "mode" to support, and a number of folks have provided patches to make this work (mainly based on feedback from FredB). More recently, Hooray has taken the most recent patch and turned the whole thing into a startup mode using <code>--enable-headless</code>.
See: [[FlightGear Headless]]


== Scenery corner ==
== Scenery corner ==

Revision as of 15:51, 16 July 2017

This newsletter is a draft.

Please feel free to add content that you think will be of interest to the FlightGear community.
You can read the latest newsletter at FlightGear Newsletter June 2017.


Magagazine.png
Enjoy reading the latest edition!
Please help us write the coming edition!
July 2017

Development news
In the hangar

Scenery Corner
Community News

Contributing
Translators required
FlightGear logos
Screenshots
Screenshot of the Month

Development news

Creating Canvas UI dialogs procedurally

1rightarrow.png See Draw masks for the main article about this subject.

FlightGear Draw masks GUI dialog procedurally created by the Canvas system.s

Most end-users will hardly be familiar with so called Draw masks, however one stated goal is to add more node bits (and a GUI dialog to control them) so various categories of objects can be disabled during the update pass.

This will mean the direct hit of, say, AI models vs particles vs random trees can be measured.

Of course it won't account for resources (memory, textures) burned by such things, but would still help different people identify slowness on their setups. [1]

The following snippet of Nasal/Canvas code (mostly based on code taken from Canvas Snippets demonstrates how easily such a dialog can be procedurally created using the Canvas system:

var (width,height) = (320,160);
var title = 'Draw Masks';

var window = canvas.Window.new([width,height],"dialog").set('title',title);

window.del = func()
{
  print("Cleaning up window:",title,"\n");
  call(canvas.Window.del, [], me);
};

# adding a canvas to the new window and setting up background colors/transparency
var myCanvas = window.createCanvas().set("background", canvas.style.getColor("bg_color"));

# creating the top-level/root group which will contain all other elements/group
var root = myCanvas.createGroup();

var drawMasks = props.globals.getNode("/sim/rendering/draw-mask").getChildren();

# create a new layout
window.Layout = canvas.VBoxLayout.new();

# assign it to the Canvas
myCanvas.setLayout(window.Layout);


foreach(var mask; drawMasks) {

(func() {
var m = mask;

# print("Found mask:", mask.getName(), "=", mask.getValue() );

var checkbox = canvas.gui.widgets.CheckBox.new(root, canvas.style, {wordWrap: 0})
.setText( "render "  ~ m.getName() )
.listen("toggled", func(e) {
			      setprop(m.getPath(), e.detail.checked);
                            })
.setChecked(  m.getValue() );
window.Layout.addItem(checkbox);

}) ();

}

This piece of code can now be easily dropped into $FG_ROOT/Nasal/canvas/gui/dialogs or just added to a nasal binding as part of the menubar.

Technically, there is no reason why the same piece of Nasal code could not be used to also support localized lookups of the corresponding checkbox labels, i.e. to provide a description and/or tooltip using a language other than English; all at the mere cost of adding the corresponding attributes to /sim/rendering/draw-mask in the form of "tooltip" and "label" attributes.

FlightGear Headless

In the hangar

One of the more common feature requests is to provide a so called "headless" mode for troubleshooting purposes, this means that the main FlightGear window would be disabled (or hidden for starters) - this would also be one of the prerequisites for running FlightGear in an unattended fashion, e.g. on a server using a scripted flight or replaying a pre-recorded flight. For some time now, a number of end-users and long-term contributors have discussed that this would be an enormously useful "mode" to support, and a number of folks have provided patches to make this work (mainly based on feedback from FredB). More recently, Hooray has taken the most recent patch and turned the whole thing into a startup mode using --enable-headless.

See: FlightGear Headless

Scenery corner

Community news

Contributing

Translators required

En.gif The FlightGear Wiki still needs help for translating it into various languages. If you are interested in making the FlightGear Wiki multilingual, you can start by looking at Help:Translate.
Fr.gif Le wiki de FlightGear a toujours besoin d'aide pour être traduit en différentes langues. Si vous êtes intéressé par le rendre multilingue, commencez par lire Help:Traduire.
De.gif Das FlightGear Wiki benötigt immer noch Hilfe bei der Übersetzung in verschiedene Sprachen. Wenn Du Interesse daran hast, das FlightGear Wiki mehrsprachig zu machen, dann fang mit dem Help:Übersetzen an.
Nl.gif De FlightGear Wiki kan nog steed hulp gebruiken bij het vertalen van artikelen. Als je interesse hebt om de wiki meertalig te maken, raden we je aan om een kijkje te nemen bij Help:Vertalen.
Es.gif La wiki de FlightGear todavía necesita ayuda para traducirla a varios lenguajes. Si estás interesado en hacer la FlightGear wiki multilingüe, entonces comienza en Help:Traducir.
Cat.gif La wiki de FlightGear encara necessita ajuda per traduir-la a diverses llengües. Si esteu interessat en fer la wiki de FlightGear multilingüe, llavors comenceu a Help:Traduir.
Pt.gif A wiki de FlightGear ainda necessita de ajuda para traduzi-la em vários idiomas. Se estás interessado em tornar a wiki de FlightGear multi-lingual, por favor começa em Help:Traduzir.
Zh.gif FlightGear 百科仍然需要志愿者将其翻译为各种语言。如果你有兴趣让FlightGear百科支持更多语言, 你可以查看 Help:Translate.

FlightGear logos

If you want some graphic elements for your FlightGear-related site (such as a hangar or YouTube channel), please feel free to visit FlightGear logos for a repository of logos. And if you have some art skills, please don't hesitate to contribute with your own design creations.

Screenshots

The FlightGear project always needs screenshots, which show features that were added since the last release. These should be of good quality, especially in content and technical image properties. It is therefore recommended to use the best viable filter settings (anti-aliasing, texture sharpening, etc.). More info at Howto:Make nice screenshots.

Screenshot of the Month

Entries for this month's best screenshot can be submitted to [ this] forum topic. Be sure to see the [ first post] for participation rules. For purposes of convenience and organization, after all the entries have been submitted, a new forum topic will be started containing all shots in an easy-to-view layout. The voting will then take place there. Once the voting has finished, the best screenshot will be presented on this page. -->




  1. James Turner  (Jul 19th, 2012).  Re: [Flightgear-devel] Rendering passes question .