M2m Posted February 5, 2019 Share Posted February 5, 2019 Quickly threw this program together as my 1st python program. Maybe useful to some. It converts bricks (not models) from LDD into .obj files which can be opened with any standard 3D program. https://github.com/sttng/LDD Brightfall, Quisoves Potoo, Cyrem and 2 others 5 Link to comment Share on other sites More sharing options...
lol username Posted February 6, 2019 Share Posted February 6, 2019 Haven't had the chance to play around with it yet but looks promising! One quick thing, I glanced at the script and it looks like it uses Assets.lif - I'd recommend using the db.lif in AppData (C:\Users\USERNAME\AppData\Roaming\LEGO Company\LEGO Digital Designer\db.lif), or whatever the Mac equivalent is, as that's the file that's updated when LDD downloads a patch, and Assets.lif becomes out of date, so users would end up missing newer bricks: Quisoves Potoo 1 Link to comment Share on other sites More sharing options...
M2m Posted February 7, 2019 Author Share Posted February 7, 2019 Thanks for the feedback. I removed any reference to Assets.lif now and just refer to db.lif. Link to comment Share on other sites More sharing options...
M2m Posted February 8, 2019 Author Share Posted February 8, 2019 Is there any updated format spec for .g(X) files ? Specifically regarding the flags ? I know 0x01 is for textures (and vertices and normals) but what a about others ? Link to comment Share on other sites More sharing options...
lol username Posted February 8, 2019 Share Posted February 8, 2019 5 minutes ago, M2m said: Is there any updated format spec for .g(X) files ? Specifically regarding the flags ? I know 0x01 is for textures (and vertices and normals) but what a about others ? All I know off the top of my head is that the .g(x) files contain UV mapped portions of bricks for decals/printing. I wanna say @lcdr might have more documented but I might be wrong, I'm sure someone does though. Edit - I think there might be a flag involving definitions for borders/outlines on bricks too? Maybe? Don't quite remember, will try to dig through old chat logs and get back to when I'm home tonight. Link to comment Share on other sites More sharing options...
lol username Posted February 10, 2019 Share Posted February 10, 2019 Late update/not really an update - so the .g bricks in LEGO Universe have two flags disabled/lack some data compared to the LDD bricks. I think one of those is for brick outlines, dunno about the other. There was also some Technic-focused LEGO building instructions app some years back that had .g files with only one of the flags/data that LU lacked both of. That's about all the info I have unfortunately. Try asking @ProfessorBrickkeeper if you're curious about the building instruction app stuff. Link to comment Share on other sites More sharing options...
M2m Posted February 11, 2019 Author Share Posted February 11, 2019 Thanks alot. This helped me to come up with an enhanced version that correctly merges .g , .g1 , .g2, etc. https://github.com/sttng/LDD/blob/master/BrickReader.py Start it with: BrickReader.py <Brick No> For ex: BrickReader.py 99778 Link to comment Share on other sites More sharing options...
M2m Posted February 12, 2019 Author Share Posted February 12, 2019 Created a Renderman Converter: lol username 1 Link to comment Share on other sites More sharing options...
M2m Posted February 17, 2019 Author Share Posted February 17, 2019 Got some basics working. lol username 1 Link to comment Share on other sites More sharing options...
M2m Posted February 18, 2019 Author Share Posted February 18, 2019 Added colors lol username 1 Link to comment Share on other sites More sharing options...
Imagixel Posted March 8, 2019 Share Posted March 8, 2019 this is great. how your guys create this? i love to learn python. any suggestion where i should start? Link to comment Share on other sites More sharing options...
M2m Posted March 11, 2019 Author Share Posted March 11, 2019 Just look at some python programs and how other people do stuff. This helped me. Link to comment Share on other sites More sharing options...
TheDiplomat Posted March 11, 2019 Share Posted March 11, 2019 @Imagixel I highly recommend this online textbook for Python. It's one of the most enjoyable learning experiences I've ever had for a language:http://interactivepython.org/courselib/static/thinkcspy/index.html Aside from that, it's really good to just find small, cool stuff you'd want to create, then look up how to make it. I found that starting out learning programming just for the sake of learning programming was a horrible experience. My parents tried to teach me Java and Pascal when I was young, and demonstrated how it could be used to find the area of the various shapes, or perform simple calculations, etc. I didn't absorb very much of that. It wasn't until I wanted to make games using Unity, or do webscraping, that things actually clicked a bit for me. TL;DR: Find something simple yet cool you want to do (graphics, a small game, a bash script, etc.) and learn how to do that. Link to comment Share on other sites More sharing options...
M2m Posted March 16, 2019 Author Share Posted March 16, 2019 Got textures kind of working. But all really early. Link to comment Share on other sites More sharing options...
M2m Posted March 20, 2019 Author Share Posted March 20, 2019 Improved texture handling: Link to comment Share on other sites More sharing options...
Recommended Posts