Low-filesize DNM files

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

Low-filesize DNM files

Post by decaff_42 » Sat Dec 12, 2015 3:02 am

So with the MRJ aircraft recently highlighted in the Spying on Other Addons topic, I noticed a few things.

(1) DNMs can be made by listing a filepath for the appropriate SRFs.

Code: Select all

SRF "0000"
FIL parts/body_ANA.srf 
CLA 0
NST 1
STA 0.0000 0.0000 0.0000 0 0 0 1
POS 0.0000 0.0000 0.0000 0 0 0 1
CNT 0.0000 0.0000 0.0000
REL DEP
NCH 0
END
Parent Child relationships can be controlled by this line in the code for each SRF:

Code: Select all

NCH 1
CLD "0042"
END
This has the potential to create really low-file size models as most parts are identical on aircraft with different paint schemes.

The MRJ aircraft have a DNM filesize of 12kb for a 14000 vertex aircraft which exported normally from blender is 1.4 mb. All said the four models have a total file size of 4.6 mb which comes to 1.15mb per aircraft. For a larger pack this would result in dramatic savings. For an additional aircraft would drop to 1mb per 14k of vertices. While the 767 may be a bit complicated for something like this, I believe it would be worth attempting for such savings! It appears that it would relatively simply and require the removal of the SRF section of the DNM file which would be replaced with a filepath in the FIL line of the CLA and STA definition section for that SRF.
Check out my website YSDecaff for all my tutorials and addon releases.
Visit by Bitbucket page for Python codes: https://bitbucket.org/decaff42/

Civilian Aviation Server Flight Log

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: 1608 times
Been thanked: 1727 times
Contact:

Re: Low-filesize DNM files

Post by Neocon » Sat Dec 12, 2015 4:06 am

decaff_42 wrote:FIL parts/body_ANA.srf
I've been using a similar system for a while with things like logos and lights, only I leave them in the same folder as the .dnm/.dat/etc. I learned that trick from GAC. I've never used it for things like gear, but I have used it for props once or twice. It's really great if you want to modify the same part identically for multiple aircraft without having to do a lot of copy/paste work.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest