M2m Posted May 8, 2019 (edited) https://github.com/sttng/LDD/blob/master/pyldd2obj.py tested on macOS Mojave and Python 2.7 Usage: pyldd2obj.py test01.lxf out_obj_file Not by me but by jonnysp - I only did some backporting from Python 3 to 2.7 and added UTF-8 support. Converts LDD lxf files into Alias|Wavefront obj files including mtl files and png textures. Edited May 8, 2019 by M2m Share this post Link to post Share on other sites
Kalta the Noble Mind Posted July 10, 2019 from the previous thread: Quote /Users/[Username]/Library/Application Support/LEGO Company/LEGO Digital Designer/db.lif /Users/[Username]/liftmp/db.lif /Users/[Username]/Downloads/LIF2OBJ/Assets/db.lif [Username]MBP2:~ [Username]$ that's what I got when I searched for db.lif. got the actual file path as well as the ones I extracted. and i realized what i was doing wrong. i never put in the "out_obj_file" command. i did it and it seemed to work. but now i have no idea where the OBJs exported to. they aren't in the same folder as the test lxf. Share this post Link to post Share on other sites
M2m Posted July 11, 2019 Output should be in the same location as where the python script resides. Share this post Link to post Share on other sites
Kalta the Noble Mind Posted July 11, 2019 i would have thought so but i see no OBJ or a folder or anything. i ran the Test lxf and the only thing that was named "test" was that same lxf. Share this post Link to post Share on other sites
Kalta the Noble Mind Posted July 11, 2019 i put both the test lxf and the python script in the same folder and ran it. no new files show up in the folder nor does the lxf become an OBJ, no noticeable change at all. Share this post Link to post Share on other sites
M2m Posted July 11, 2019 Strange. I do as follows 1) Download the python script (obviously) 2) Change python script to executable: My-MBP:Downloads user$ chmod +x pyldd2obj.py 3) Execute ScriptMy-MBP:Downloads user$ ./pyldd2obj.py /Users/user/Documents/LEGO\ Creations/Models/Treasure_Chest.lxf test_out 4) Output:- - - pyldd2obj - - - _ [_] /| |\ ()'---' C | | | [=|=] - - - - - - - - - - - - DB Version: 2670 Database OK. Scene "Treasure_Chest" Brickversion: 2670 Progress: [##########------------------------------] 25.0% Progress: [####################--------------------] 50.0% Progress: [####################--------------------] 50.0% (4739) CHEST LID 2X Progress: [##############################----------] 75.0% Progress: [##############################----------] 75.0% (57503) GOLD COIN 1 Progress: [########################################] 100.0% - Progress: [########################################] 100.0% - (57503) GOLD COIN --- 0.0939090251923 seconds --- My-MBP:Downloads user$ 5) I get 2 files: test_out.mtl and test_out.obj Share this post Link to post Share on other sites
Kalta the Noble Mind Posted July 11, 2019 that must be it. i never made it an executable. does the actual .py script change after becoming executable? because i finally did the chmod without getting errors and i ran the script and still no OBJ. Share this post Link to post Share on other sites
M2m Posted July 11, 2019 did you get any output ? What do you get if you just put: python pyldd2obj.py Share this post Link to post Share on other sites
Kalta the Noble Mind Posted July 11, 2019 /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python: can't open file 'pyldd2obj.py': [Errno 2] No such file or directory thats what i got when i did the command. Share this post Link to post Share on other sites
M2m Posted July 11, 2019 Are you sure the file pyldd2obj.py is in the same directory as where you currently in ? Share this post Link to post Share on other sites
Kalta the Noble Mind Posted July 11, 2019 no i did not do that. i just wrote the command as is with no directory. but i moved the script to the desktop if it makes a difference. i am betting this is a tall order but maybe a video tutorial would help me. i dont think i understand written direction. Share this post Link to post Share on other sites
jonnysp Posted July 12, 2019 1. install LDD 2. copy the script and the lxf to a folder 3. open console 4. navigate to the folder 5. run "python pyldd2obj.py nameofyour.lxf nameoutputobj" 6. now you have nameoutputobj.obj at the folder thats all Share this post Link to post Share on other sites
Kalta the Noble Mind Posted July 12, 2019 that's it! i didnt put the file name in the output. i will try it now! nope i found the problem. i was originally told to write outpuobjt when i was supposed to be using exportobj. Share this post Link to post Share on other sites
Kalta the Noble Mind Posted July 12, 2019 maybe this is just a Maya issue but the OBJ objects seem to share faces so Maya has to merge them into one group. also, it comes with an mtl file but I see no PNGs that would be referenced in the shader. Share this post Link to post Share on other sites
Kalta the Noble Mind Posted July 12, 2019 okay I got it working now. it doesnt just make an OBJ but it gets the relevant PNGs as well. but the textures don't show up in Maya and I still have that grouping problem. Share this post Link to post Share on other sites
M2m Posted July 16, 2019 On 7/13/2019 at 12:08 AM, Kalta the Noble Mind said: maybe this is just a Maya issue but the OBJ objects seem to share faces so Maya has to merge them into one group. also, it comes with an mtl file but I see no PNGs that would be referenced in the shader. Is it different bricks overlapping and sharing faces ? I guess this is ‘normal’. The script just takes the 3D data as it comes from LDD. I guess one could add a scaling matrix to ‘shrink’ every brick by 1-2% to remove overlapping - if this is the overlapping problem you refer to. Share this post Link to post Share on other sites