DNM File Structure

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

DNM File Structure

Post by decaff_42 » Sat Jan 09, 2016 1:34 am

So I'm working on my Blender book, and I want to explain the DNM structure when assigning information to each SRF. I'm only unsure about the CNT line. In all the DNMs I've looked at that line is 0 0 0.

Does anyone know if this does something/ what it means?

Code: Select all

SRF "Gear_latice"                       - SRF object name
FIL Mesh.004                            - SRF mesh (from inside DNM file)
CLA 0                                   - CLA number assigned to SRF
NST 3                                   - Number of STAs required
STA 0.0000 0.0000 -0.0000 0 0 0 1       - STA #1
STA 0.0000 -0.0000 0.0000 1820 0 0 1    - STA #2
STA 0.0000 -0.0000 0.0000 1820 0 0 1    - STA #3
POS 1.3060 0.0031 -0.0010 0 0 0 1       - Position of the object center
CNT 0.00 0.00 0.00
REL DEP                                 - Beginning of the Family Tree Section
NCH 1                                   - Number of Child objects
CLD "tires.004"                         - Name of 1st Child SRF
END
Check out my website YSDecaff for all my tutorials and addon releases.
Visit by Bitbucket page for Python codes: https://bitbucket.org/decaff42/

Server Flight Log
Addon Database

NightRaven
Senior Veteran
Senior Veteran
Posts: 1844
Joined: Tue Feb 07, 2012 10:00 am
Favorite Aircraft: .
OS: windoze 10 64-bit
Has thanked: 543 times
Been thanked: 608 times

Re: DNM File Structure

Post by NightRaven » Sat Jan 09, 2016 2:19 am

I've found that the HQPGAC A-6A dnm does employ the use of the CNT line. Its function is quite interesting: it shifts the vertices of the object without changing the object center.
Image
Here, with the original CNT line, the hook, hook centre and hook empty are where they should be: hinged around the bottom half surface of the fuselage, allowing the hook to rotate around that point.
Image
Here, with the CNT line reset to 0 0 0, the hook centre and hook empty are still in the same position, but the vertices themselves have moved by the amount specified by the CNT line.

Interestingly, the positions are flipped, meaning a negative value causes the vertices to move in the positive direction and vice versa.

User avatar
decaff_42
Staff
Staff
Posts: 3557
Joined: Sat Oct 29, 2011 7:23 pm
Favorite Aircraft: SR-71 Blackbird
Location: Eastern United States
OS: Mac OSX
Has thanked: 622 times
Been thanked: 1351 times
Contact:

Re: DNM File Structure

Post by decaff_42 » Sat Jan 09, 2016 2:24 am

Okay, so this is the offset of the vertices from the object center.

I assume it does not change how the hook rotates? i.e. the rotation point of the hook is still at the same position relative to the mesh itself.
Check out my website YSDecaff for all my tutorials and addon releases.
Visit by Bitbucket page for Python codes: https://bitbucket.org/decaff42/

Server Flight Log
Addon Database

NightRaven
Senior Veteran
Senior Veteran
Posts: 1844
Joined: Tue Feb 07, 2012 10:00 am
Favorite Aircraft: .
OS: windoze 10 64-bit
Has thanked: 543 times
Been thanked: 608 times

Re: DNM File Structure

Post by NightRaven » Sat Jan 09, 2016 2:30 am

Yes, the object center and position are unaffected by the CNT line.

User avatar
decaff_42
Staff
Staff
Posts: 3557
Joined: Sat Oct 29, 2011 7:23 pm
Favorite Aircraft: SR-71 Blackbird
Location: Eastern United States
OS: Mac OSX
Has thanked: 622 times
Been thanked: 1351 times
Contact:

Re: DNM File Structure

Post by decaff_42 » Sat Jan 09, 2016 2:31 am

So then there is zero difference between using CNT and changing the object center/ parent object position?
Check out my website YSDecaff for all my tutorials and addon releases.
Visit by Bitbucket page for Python codes: https://bitbucket.org/decaff42/

Server Flight Log
Addon Database

User avatar
Neocon
First Class Membership
First Class Membership
Posts: 3843
Joined: Wed Oct 19, 2011 5:01 am
Favorite Aircraft: Baron 58
Location: Tennessee
OS: Win 10
Has thanked: 1610 times
Been thanked: 1727 times
Contact:

Re: DNM File Structure

Post by Neocon » Sat Jan 09, 2016 3:13 am

Apparently Ctrl + R refreshes the page instead of opening a Find/Replace box. Very annoying, after a 300 word answer with one little mistake in several lines.

Ok, let's say you build your model and you have a tail hook. The rotation point of the tail hook is located at 00.00 -0.15 -5.25, and the .srf mesh for the hook is located in that position. You set the hook to rotate backwards from its down position by 120° backwards and up. If your entry has POS 0.00 0.00 0.00 0 0 0 1 and CNT 0.0 0.0 0.0, it will rotate from the CNT point, which will end up somewhere about 25 meters from where you wanted it. You have two options: You can move the mesh of the .srf so that it is lined up for the rotation point to actually be at 0 0 0 and POS 00.00 -0.15 -5.25 , or you can do this:
POS 00.00 -0.15 -5.25 0 0 0 1
CNT 00.00 -0.15 -5.25

"CNT 00.00 -0.15 -5.25" will tell YSF that the point 00.00 -0.15 -5.25 should be treated as 0 0 0, and the POS will then tell YSF to actually place the hook at 00.00 -0.15 -5.25 .

Or something like that.

EDIT: I think I just said what Nightraven posted in different words and without illustrations. :lol:

NightRaven
Senior Veteran
Senior Veteran
Posts: 1844
Joined: Tue Feb 07, 2012 10:00 am
Favorite Aircraft: .
OS: windoze 10 64-bit
Has thanked: 543 times
Been thanked: 608 times

Re: DNM File Structure

Post by NightRaven » Sat Jan 09, 2016 3:22 am

This is going to be quite difficult to explain in words...

You are correct in saying that CNT is a form of vertex offset. This also means that when you change the CNT line from 0 0 0 to 0 0 -1 you shift the object center 1m in the local negative Z-direction relative to the vertices. So CNT does change the object center relative to the mesh itself, but does not affect the object center's position itself.

^ extremely confusing explanation when I have no computer to work with

User avatar
Flake
Core Staff
Core Staff
Posts: 4354
Joined: Thu Feb 10, 2011 8:47 pm
Favorite Aircraft: Boeing F/A-18A
Location: Australia
OS: Windows 10 (x64)
Has thanked: 836 times
Been thanked: 1238 times
Contact:

Re: DNM File Structure

Post by Flake » Sat Jan 09, 2016 6:23 am

The truth is that the CNT defined the rotation center of the model. The vertecies are first moved opposite of the center, and the entire model is then shifted by the center... in otherwords no real apparant change, right? Except that the rotation point is different now. You have all pretty much got the right answer. There is no difference between using CNT and manually moving the vertecies yourself so as to rotate about 0,0,0 (In fact, this is the method I prefer!)
I am an accountant working full-time (and some). I'm not here as often as I would like to be. Send a message if you need me. There are a few people in the community who can get in contact with me urgently if you need - don't be afraid to ask. I just don't check here as frequently as I used to. Sorry!

User avatar
ysmajor
Contributor
Contributor
Posts: 169
Joined: Tue Apr 12, 2011 7:55 am
Favorite Aircraft: Curtiss P-40B Warhawk
Location: Shanghai
Has thanked: 6 times
Been thanked: 102 times
Contact:

Re: DNM File Structure

Post by ysmajor » Sat Jan 09, 2016 6:45 am

CNT is super useful.

Basically for modders: you can make your full model with all parts in the place where they are located on the plane.
for instance you draw the left main gear at -1,45 meters on the x-axis, and -1 meter to the back on z-axis (in Gepolyx).

Then you cut the part from the mesh and save it.
In DNM now, you add the gear SRF, but it rotates on 0,0,0 middle point, which gives a wrong animation.
So, you enter the exact coordinates of the SRF you just made in the CNT line (I think it means Counter or contra-location), in above example x=-1,45 y=0 z=-1
In DNM viewer the part has now moved to the middle of the plane.

Then you locate the part again on the place where it should be.
Result, the animation is seamless.

especially with geardoors and bombdoors this is very important as they close exact and you wont see any cracks.
Flaps and ailerons and the like are also easily made (in the wing) and they move much better.

Look at my later models for examples.
(Ho-229, A-12, C-119)

User avatar
decaff_42
Staff
Staff
Posts: 3557
Joined: Sat Oct 29, 2011 7:23 pm
Favorite Aircraft: SR-71 Blackbird
Location: Eastern United States
OS: Mac OSX
Has thanked: 622 times
Been thanked: 1351 times
Contact:

Re: DNM File Structure

Post by decaff_42 » Sat Jan 09, 2016 3:44 pm

I think I understand what this does now and from a blender perspective seems not that useful as the general method of moving animated parts is to move their parent object.

However from a DNMViewer point of view this seems really useful.

Thank you for the clarification!
Check out my website YSDecaff for all my tutorials and addon releases.
Visit by Bitbucket page for Python codes: https://bitbucket.org/decaff42/

Server Flight Log
Addon Database

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests