time to start making things

YSFlight addon development, questions, tutorials, & more!
User avatar
decaff_42
Staff
Staff
Posts: 3711
Joined: Sat Oct 29, 2011 7:23 pm
Favorite Aircraft: SR-71 Blackbird
Location: Eastern United States
OS: Mac OSX
Has thanked: 767 times
Been thanked: 1616 times
Contact:

Re: time to start making things

Post by decaff_42 » Wed Jun 30, 2021 9:56 pm

Copperhead wrote:
Wed Jun 30, 2021 2:46 pm
That's why most folks stick with separated and transparent lines.
Guess I'm a rebel. All my panel lines are solid.
Check out my website YSDecaff for all my tutorials and addon releases.
Visit my GitHub page for Python codes: https://github.com/decaff42?tab=repositories

YSFlight Addon Database - Find links to nearly every addon made for YSFlight!
Submit Addon To Database

Captain_Ahab
Newbie
Newbie
Posts: 15
Joined: Sun Jun 27, 2021 10:17 am
Favorite Aircraft: Cavalier Turbo-Mustang III
OS: linux
Has thanked: 1 time
Been thanked: 24 times

Re: time to start making things

Post by Captain_Ahab » Thu Jul 01, 2021 12:37 am

u2fly wrote:
Wed Jun 30, 2021 8:22 pm
There is some info about known modificators and I has collected some details in "YSFlight Handbook" (read "3D Visual Models" chapter)
now THAT is really helpful! thanks!
I don't know how I missed that.

looks like I'll be sacrificing some default cubes to see how it all works

Captain_Ahab
Newbie
Newbie
Posts: 15
Joined: Sun Jun 27, 2021 10:17 am
Favorite Aircraft: Cavalier Turbo-Mustang III
OS: linux
Has thanked: 1 time
Been thanked: 24 times

Re: time to start making things

Post by Captain_Ahab » Sun Aug 15, 2021 10:21 am

I finally decided to settle down and work out animating control surfaces without using Blender 2.49b
It was a confusing fall down a rabbit hole because YSFlight, Blender 2.49b scripts and Blender 2.79 scripts all use different orientations to a set of global axis which also probably led to a series of differences in documentation how coordinates are used.
Some docs say "x,y,z "
Some say "y,z,x"
Some say "x,z,y"
Some seem to match translations required between the Blender 2.49b and the .dnm's that ysflight wants

After much experimentation, I figured out the model orientation in blender 2.79 to match the script's output to the output that the Blender 2.49b script offers. In both versions, the script shifts the orientation from what YSFlight seems to expect and back again on export. For the 2.79 scripts to work nicely, the model needs to be oriented such that the model's front/nose is facing 'down' on the screen in Blender's top view ( numpad 7 ).
After I got import/export to work properly there, I knew I could do modelling and obtain info for the .dnm file in Blender 2.92, whose features concerning custom local axis make setting up hinge-lines for animations a snap.
While I can't load 2.92 files directly in 2.79, I can append them easily.
Then I snap empties to the control surface's forward edge with match rotation; this sets the empty's local z-axis to be parallel to the edge. I can then assign that empty to be a custom rotation axis so that the control surface always rotates on the empty's z-axis. Each control surface gets its own custom axis of rotation. Setting the object's rotation center to the empty's location also gives exact location, while rotations can be monitored in the global axis. Not parenting them together allows you to clear rotations easily and not have to translate the empty's global rotations for changes.... just monitor the object's rotations directly. Non-animated parts, I just set the position to 0,0,0 which should be at the airplane's center of gravity. I don't worry about parents/children until typing up the actual .dnm file.
All of that gives info needed to plug into the .dnm file directly in an editor ( I use Geany ), just be sure to multiply degrees by 182.04 to get the ysflight's units and be sure to translate to the axis that ysflight expects.

The x,y,z values in Blender have to be put in the order -x, z, -y for position and x-rot, y-rot, z-rot needs to be put in the order z-rot, -x-rot, y-rot so they rotate properly around the global axis within YSFlight.
I put the airplane's parts as .srf's in a separate folder and access them as external files in the .dnm so the file I spend most of my time on isn't stuffed with lists of thousands of numbers.
The positional stuff also works for info needed in .DAT files, such as gear locations, vapor trails, guns and hardpoints, etc.

Anyways, I've done this with a Blohm-Voss HA137 so far, so I know it works for control surfaces at least
Now to look into props ( especially contra-rotating props ) and landing gear ( focusing on gear door sequences, such as the P-51's )

Post Reply

Who is online

Users browsing this forum: No registered users and 11 guests