trevorsandy / lpub3d

An LDraw™ editor for LEGO® style digital building instructions.
https://trevorsandy.github.io/lpub3d/
130 stars 19 forks source link

Support MPD model file imbedded image with !DATA meta command #722

Closed trevorsandy closed 1 year ago

trevorsandy commented 1 year ago

Subject

Support multi-part document imbedded image blocks using the !DATA meta command.

Blocks starting with the 0 !DATA statement contain png image binary data encoded using a multitude of 0 !: lines. Each of those lines contain a chunk of base64 encoded data which a parser must combine before decoding. No other LDraw statements may be used inside a !DATA block.

See Multi-Part Document (MPD) and Image Embedding (!DATA) Language Extension for MPD and !DATA LDraw specifications.

Environment

Version of LPub3D - 2.4.7 Operating system - All

Solution

On LDraw model file load, detect, decode and write png image file from imbedded image blocks to the LPub3D <customParts>/parts/textures folder. If the image files are not archived, add them to the LPub3D unofficial archive library.

Cheers,

trevorsandy commented 1 year ago

This behaviour has been implemented.

File load status Data_01

Preview PLI sticker Data_02

Sticker Base 64 content in command editor and sticker file in MPD drop-down list Data_03

Cheers,