Posted May 8, 20195 yr 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, 20195 yr by M2m
July 10, 20195 yr 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. Â
July 11, 20195 yr 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.
July 11, 20195 yr 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.
July 11, 20195 yr Author 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
July 11, 20195 yr 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.
July 11, 20195 yr Author did you get any output ? What do you get if you just put: python pyldd2obj.py
July 11, 20195 yr /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.
July 11, 20195 yr Author Are you sure the file pyldd2obj.py is in the same directory as where you currently in ?
July 11, 20195 yr 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.
July 12, 20195 yr 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
July 12, 20195 yr 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.
July 12, 20195 yr 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.
July 12, 20195 yr 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.
July 16, 20195 yr Author 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.Â
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.