Giter Site home page Giter Site logo

renanmsv / jsbsim2blender Goto Github PK

View Code? Open in Web Editor NEW
3.0 3.0 0.0 138 KB

Load and visualize aircraft FDM metrics from JSBSim XML files inside Blender

Home Page: https://wiki.flightgear.org/Blender_JSBSim_import

License: GNU General Public License v2.0

Python 100.00%
blender-addon flightgear jsbsim

jsbsim2blender's Introduction

Hi there ๐Ÿ‘‹


Renan-vscode Renan-roblox Renan-unity Renan-godot Renan-lua Renan-Csharp Renan-Python Renan-flask Renan-HTML Renan-CSS Renan-php Renan-nodejs Renan-wordpress Renan-woocommerce Renan-gif

github-snake

jsbsim2blender's People

Contributors

renanmsv avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

jsbsim2blender's Issues

Attribute Error on import of xml file

First, this is an extremely useful little utility that is most helpful in visualizing the critical metrics of the JSBSim model. Thank you for creating it.

When importing a JSBSim xml file, if the file does not contain any "external_reactions" tags, it will generate an "AttributeError: 'NoneType' object has no attribute 'final'". The dump is included in the attached screenshot. Based on my limited understanding here... I think the issue is the following code lines:

    def parse_external_reactions(self):
        external_reactions = self.root.find("external_reactions")
        for force in external_reactions.findall("force"):
            force_name = force.get("name")
            force_frame = force.get("frame")
            locations = self.get_locations(force)
            for _, location in locations.items():
                self.plot(f"{force_name} ({force_frame})", location["xyz"], "External Reactions")

In the above code, if the call to self.root.find("external_reactions") returns None because the tag is missing, then the call to external_reactions.findall("force") will fail. Given that the other tags are parsed in the same way, this error will probably also happen for any of the following function calls:

        self.parse_metrics()
        self.parse_mass_balance()
        self.parse_ground_reactions()
        self.parse_external_reactions()
        self.parse_propulsion()

A solution would be to add a return if find returns none in each of the above function calls. This exception is fatal, so any missing tags will result in the rest of the file not being processed. So in this case, if the file does not contain at least an empty external_reactions block, it will fail to parse the next tag, propulsion.

https://drive.google.com/file/d/1f4KanBXFz_GyYkdqHqphG1gp2dD_UHfq/view?usp=share_link

A workaround for this is to simply add an empty tag block for the missing tag like the following:

    <external_reactions>
    </external_reactions>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.