Blender YASim import: Difference between revisions

From FlightGear wiki
Jump to navigation Jump to search
m (Update forum links)
m (→‎XML Elements: change img order)
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
[[File:Dhc6-fdm-real.png|thumb|YASim FDM and aircraft model, overlayed in Blender.]]
[[File:Dhc6-fdm-real.png|thumb|YASim FDM and aircraft model, overlayed in Blender.]]


Load and visualize YASim FDM geometry in Blender 2.5/6.
Load and visualize YASim FDM geometry in Blender 2.5/6/7.


Due to the major changes in Blender, from version 2.4 to 2.5, the original script, by M. Franz, had to be ported. For Blender versions prior to 2.5 please see the original script.<ref>See: [[YASim#Visualization]]
Due to the major changes in Blender, from version 2.4 to 2.5, the original script, by M. Franz, had to be ported. For Blender versions prior to 2.5 please see the original script.<ref>See: [[YASim#Visualization]]
Line 8: Line 8:
== Installation ==
== Installation ==


'''Direct download''' (save link as...): https://raw.github.com/rebootl/simple_yasim_import-git/master/simple_yasim_import.py
'''Download:''' https://github.com/rebootl/simple_yasim_import-git/releases


'''Install it as blender addon'''<ref>For more information see: http://wiki.blender.org/index.php/Doc:2.6/Manual/Extensions/Python/Add-Ons
'''Install it as blender addon'''<ref>For more information see: https://www.blender.org/manual/extensions/python/add_ons.html
</ref>:
</ref>:


Download the script from the above link.
Download and unzip the script on your local computer.


Start Blender and go to ''File --&gt; User Preferences... --&gt; Addons''.
Start Blender and go to ''File --&gt; User Preferences... --&gt; Addons''.


Click on ''Install from File...'' (at the bottom) and select the downloaded script.
Click on ''Install from File...'' (at the bottom) and select the downloaded script <code>simple_yasim_import.py</code>.


Tick the checkbox to enable the script.
Tick the checkbox to enable the script.
Line 77: Line 77:
* YASim item names are shown by default in the viewport. (Controllable by a checkbox.)
* YASim item names are shown by default in the viewport. (Controllable by a checkbox.)
* Every item get's a material assigned. Materials are reused.
* Every item get's a material assigned. Materials are reused.
* As of version 0.6 material transparency is enabled by default.


=== XML Elements ===
=== XML Elements ===
Line 83: Line 84:
</ref>.
</ref>.


* The &lt;dir&gt; element is not supported for now.
* The '''&lt;dir&gt;''' element is not supported for now.
* &lt;propeller&gt; The propeller is always vertical and it's thrust vector always points along the x-Axis.


[[File:Propeller-1-marked-small.png|Imported propeller item, in Blender, marked.]]
[[File:Propeller-1-marked-small.png|thumb|Imported propeller item, in Blender, marked.]]


== Nice to have ==
* '''&lt;propeller&gt;''' The propeller is always vertical and it's thrust vector always points along the x-Axis.
 
* '''&lt;rotor&gt;''' One blade is shown, where the initial angle ''phi0'' is ignored.
: The incidence is shown at the blade root, where ''chord'' is simply used for the length. The blade tip is always flat (at a zero degree incidence). When ''ccw'' = 0 the incidence angle is currently inverted. However, it is unclear wheter this is correct (?).
: The entire rotor is rotated according to the normal vector (pointing "up").
: Finally, the forward vector is drawn as it is defined.
 
== Bugs / Nice to have ==


* Calculate and draw the aircraft center of gravity by click (through the standalone YASim).
* Calculate and draw the aircraft center of gravity by click (through the standalone YASim).
* Currently no custom error handling is implemented.
* Suggestions ?
* Suggestions ?
== Bugs ==
* The rotor element should be reworked, currently no material/locking is assigned.


Please report any bugs, questions or suggestions to the forum topic.<ref>http://forum.flightgear.org/viewtopic.php?f=4&amp;t=17267
Please report any bugs, questions or suggestions to the forum topic.<ref>http://forum.flightgear.org/viewtopic.php?f=4&amp;t=17267
Line 103: Line 107:


<references />
<references />
[[Category:Modeling]]

Revision as of 10:32, 14 October 2015

YASim FDM and aircraft model, overlayed in Blender.

Load and visualize YASim FDM geometry in Blender 2.5/6/7.

Due to the major changes in Blender, from version 2.4 to 2.5, the original script, by M. Franz, had to be ported. For Blender versions prior to 2.5 please see the original script.[1]

Installation

Download: https://github.com/rebootl/simple_yasim_import-git/releases

Install it as blender addon[2]:

Download and unzip the script on your local computer.

Start Blender and go to File --> User Preferences... --> Addons.

Click on Install from File... (at the bottom) and select the downloaded script simple_yasim_import.py.

Tick the checkbox to enable the script.

To make this persistent you have to click on Save User Settings at the bottom left.

Usage

Interaction

YASim FDM and aircraft model, overlayed in Blender. Addon interface marked.

An instance called YASim XML Importer should appear at the bottom of the User Interface Panel. This is the panel that get's called by pressing "n", when in the viewport (see image).
Usage is pretty much self-explanatory. However some notes:

When loading the Pivot center for rotation/scaling should not be set to "3D Cursor", or your cockpit, tanks, ballasts etc. will get messed up. I'd suggest Median Point but I think any other works. [3]

The clear button simply deletes all items named YASim_* in the current context.

When reloading the clear function get's executed first, then the last opened file is reimported.

Loading of multiple FDMs at the same time is not supported.

Always use the same Blender layer when operating the FDM interface.

Comparing to your aircraft model

You can use separate layers for your "real" aircraft model, of course.

Specifying an offset, in the form of <!-- offsets: x=3.45 z=-0.4 p=5 --> is no longer supported.

If your aircraft model is displaced with respect to the FDM you have to manually correct this offset.

Example workflow:

  1. Open your "real" aircraft model and save it as a "compare" model. Move the aircraft to layer two.
  2. Remove unneccessary objects. Make it transparent or display it as wireframe, as you wish.
  3. Correct the offset by moving your model, if necessary.
  4. Save this compare model.
  5. Go to layer one and load the YASim FDM XML.
  6. Now you can enable both layers and comfortably compare them.
  7. When you're adapting your FDM, select the FDM layer, and click on Reload to make the changes effective.

Coordinate Systems

FG: The coordinate system FlightGear uses for it's 3-D aircraft models.[4]

YASim: The YASim coordinate system. This matches what is specified in the FDM XML file.[5]

By default the FG coordinate system is used.

You can switch the coordinate systems at any time. The FDM elements are loaded/adapted accordingly.

Imported items

  • Imported items are locked by default, to prevent accidental transformations (location, rotation, scale).
  • YASim item names are shown by default in the viewport. (Controllable by a checkbox.)
  • Every item get's a material assigned. Materials are reused.
  • As of version 0.6 material transparency is enabled by default.

XML Elements

Mostly, the elements are displayed as in the original script[6].

  • The <dir> element is not supported for now.
Imported propeller item, in Blender, marked.
  • <propeller> The propeller is always vertical and it's thrust vector always points along the x-Axis.
  • <rotor> One blade is shown, where the initial angle phi0 is ignored.
The incidence is shown at the blade root, where chord is simply used for the length. The blade tip is always flat (at a zero degree incidence). When ccw = 0 the incidence angle is currently inverted. However, it is unclear wheter this is correct (?).
The entire rotor is rotated according to the normal vector (pointing "up").
Finally, the forward vector is drawn as it is defined.

Bugs / Nice to have

  • Calculate and draw the aircraft center of gravity by click (through the standalone YASim).
  • Currently no custom error handling is implemented.
  • Suggestions ?

Please report any bugs, questions or suggestions to the forum topic.[7]

References