Note: this is in response to this thread.
This is a proposal to add a new !DATA meta-command that can be used to embed texture data into model files (for use with unofficial parts in an OMR model). The proposed specification for the new meta-statement follows. Please discuss.
Purpose
This document describes the !DATA meta-statement, which contains a set of commands for embedding binary data into LDraw files.
New meta-statement token
!DATA
This is the main data-embedding meta-command.
Reuse of existing meta-statement token
!:
This will be used to specify a BASE-64 encoded data stream. This token was introduced with the !TEXMAP meta-statement, and will be reused here for three reasons: its reuse will not interfere with its use in !TEXMAP; it is useful for the same reasons that it was useful in !TEXMAP; and !DATA is only useful right now for embedding texture data for use with !TEXMAP, so the two meta-statements are related to each other.
Syntax
0 !DATA START
0 !: <data1>
0 !: <data2>
...
0 !: <datan>
0 !DATA END
Description
This meta-statement allows for BASE-64 encoded data to be used inside a multi-part-dat (MPD) file. The decoded binary data replaces of the embedded MPD sub-file.
0 FILE main.ldr
0 Author: Roland Melkert
1 15 -40 -20 0 1 0 0 0 0 1 0 1 0 plane.dat
0 FILE plane.dat
0 plane texmap test
0 UNOFFICIAL PART
0 BFC NOCERTIFY
0 !TEXMAP START PLANAR 0 0 0 40 0 0 0 0 40 checker123yyz.png
4 16 0 0 0 40 0 0 40 0 40 0 0 40
0 !TEXMAP END
0 FILE checker123yyz.png
0 !DATA START
0 !:iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAAABmJLR0QA/wD/AP+gvaeTAAAACXBI
0 !:WXMAAC4jAAAuIwF4pT92AAAAB3RJTUUH3gcbDhUzUyNxeQAAArVJREFUeNrt3cENwzAMBMFjoM7d
0 !:p6vIX2lBeRECZzo4GFjIL9ZOdhpVeu3dOj9VZb/9bT4BxhIAEABAAAABAAQAEABAAAABAAQAEABA
0 !:AAABAAQAEABAAAABAAQAEABAAAABAAQAEABAAAABAAQAEABAAAABAAQAEADgX5Wk9UC6+/T22+8F
0 !:AAgAIACAAAACAAgAIACAAAACAAgAIACAAAACAAgAIACAAAACAAgACAAgAIAAAAIACAAgAIAAAAIA
0 !:CAAgAIAAAAIACABwgeU+u/32z93vBQB+AQABAAQAEABAAAABAAQAEABAAAABAAQAEABAAAABAAQA
0 !:EABAAAABAAQAEABAAAABAAQAEABAAAABAAQAEABAAAABAI4t99l79z9p3v/6/pP3ewGAXwBAAAAB
0 !:AAQAEABAAAABAAQAEABAAAABAAQAEABAAAABAAQAEABAAAABAAQAEABAAAABAAQAEABAAAABAAQA
0 !:EABAAIBjy3324fu/8f0H7/cCAL8AgAAAAgAIACAAgAAAAgAIACAAgAAAAgAIACAAgAAAAgAIACAA
0 !:gAAAAgAIACAAgAAAAgAIACAAgAAAAgAIACAAgAAAxypJ64H06ffZ7bffCwAQAEAAAAEABAAQAEAA
0 !:AAEABAAQAEAAAAEABAAQAEAAAAEABAAQABAAQAAAAQAEABAAQAAAAQAEABAAQAAAAQAEABAA4ArL
0 !:fXb77Z+73wsA/AIAAgAIACAAgAAAAgAIACAAgAAAAgAIACAAgAAAAgAIACAAgAAAAgAIACAAgAAA
0 !:AgAIACAAgAAAAgAIACAAgAAAAgAcqyStB9Ldp7fffi8AQAAAAQAEABAAQAAAAQAEABAAQAAAAQAE
0 !:ABAAQAAAAQAEABAAQABAAAABAAQAEABAAAABAAQAEABAAAABAAQAEABAAIAL/AB/0mJQmotO+gAA
0 !:AABJRU5ErkJggg==
0 !DATA END
This is a proposal to add a new !DATA meta-command that can be used to embed texture data into model files (for use with unofficial parts in an OMR model). The proposed specification for the new meta-statement follows. Please discuss.
Purpose
This document describes the !DATA meta-statement, which contains a set of commands for embedding binary data into LDraw files.
New meta-statement token
!DATA
This is the main data-embedding meta-command.
Reuse of existing meta-statement token
!:
This will be used to specify a BASE-64 encoded data stream. This token was introduced with the !TEXMAP meta-statement, and will be reused here for three reasons: its reuse will not interfere with its use in !TEXMAP; it is useful for the same reasons that it was useful in !TEXMAP; and !DATA is only useful right now for embedding texture data for use with !TEXMAP, so the two meta-statements are related to each other.
Syntax
0 !DATA START
0 !: <data1>
0 !: <data2>
...
0 !: <datan>
0 !DATA END
Description
This meta-statement allows for BASE-64 encoded data to be used inside a multi-part-dat (MPD) file. The decoded binary data replaces of the embedded MPD sub-file.
- This meta-statement must come after the 0 FILE meta-statement signifying a sub-file in a multi-part-dat (MPD) file.
- The FILE that the DATA belongs to must not contain any geometry.
- The FILE must contain one and only one DATA section.
- The FILE may contain header information.
- All characters after 0 !: that are not valid BASE-64 characters must be ignored. (This is intended to allow white-space characters to be placed in the line, but still applies to all other characters that are not valid BASE-64 characters.)
- Each 0 !: line except for the last must contain exactly 76 encoded characters.
- The last 0 !: line must contain no more than 76 encoded characters.
0 FILE main.ldr
0 Author: Roland Melkert
1 15 -40 -20 0 1 0 0 0 0 1 0 1 0 plane.dat
0 FILE plane.dat
0 plane texmap test
0 UNOFFICIAL PART
0 BFC NOCERTIFY
0 !TEXMAP START PLANAR 0 0 0 40 0 0 0 0 40 checker123yyz.png
4 16 0 0 0 40 0 0 40 0 40 0 0 40
0 !TEXMAP END
0 FILE checker123yyz.png
0 !DATA START
0 !:iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAAABmJLR0QA/wD/AP+gvaeTAAAACXBI
0 !:WXMAAC4jAAAuIwF4pT92AAAAB3RJTUUH3gcbDhUzUyNxeQAAArVJREFUeNrt3cENwzAMBMFjoM7d
0 !:p6vIX2lBeRECZzo4GFjIL9ZOdhpVeu3dOj9VZb/9bT4BxhIAEABAAAABAAQAEABAAAABAAQAEABA
0 !:AAABAAQAEABAAAABAAQAEABAAAABAAQAEABAAAABAAQAEABAAAABAAQAEADgX5Wk9UC6+/T22+8F
0 !:AAgAIACAAAACAAgAIACAAAACAAgAIACAAAACAAgAIACAAAACAAgACAAgAIAAAAIACAAgAIAAAAIA
0 !:CAAgAIAAAAIACABwgeU+u/32z93vBQB+AQABAAQAEABAAAABAAQAEABAAAABAAQAEABAAAABAAQA
0 !:EABAAAABAAQAEABAAAABAAQAEABAAAABAAQAEABAAAABAI4t99l79z9p3v/6/pP3ewGAXwBAAAAB
0 !:AAQAEABAAAABAAQAEABAAAABAAQAEABAAAABAAQAEABAAAABAAQAEABAAAABAAQAEABAAAABAAQA
0 !:EABAAIBjy3324fu/8f0H7/cCAL8AgAAAAgAIACAAgAAAAgAIACAAgAAAAgAIACAAgAAAAgAIACAA
0 !:gAAAAgAIACAAgAAAAgAIACAAgAAAAgAIACAAgAAAxypJ64H06ffZ7bffCwAQAEAAAAEABAAQAEAA
0 !:AAEABAAQAEAAAAEABAAQAEAAAAEABAAQABAAQAAAAQAEABAAQAAAAQAEABAAQAAAAQAEABAA4ArL
0 !:fXb77Z+73wsA/AIAAgAIACAAgAAAAgAIACAAgAAAAgAIACAAgAAAAgAIACAAgAAAAgAIACAAgAAA
0 !:AgAIACAAgAAAAgAIACAAgAAAAgAcqyStB9Ldp7fffi8AQAAAAQAEABAAQAAAAQAEABAAQAAAAQAE
0 !:ABAAQAAAAQAEABAAQABAAAABAAQAEABAAAABAAQAEABAAAABAAQAEABAAIAL/AB/0mJQmotO+gAA
0 !:AABJRU5ErkJggg==
0 !DATA END