Jump to content
THIS IS THE TEST SITE OF EUROBRICKS!
THIS IS THE TEST SITE OF EUROBRICKS!

Featured Replies

Posted

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 by M2m

  • 2 months later...

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.
 

  • Author

Output should be in the same location as where the python script resides. 

  • Author

Strange. I do as follows

1) Download the python script (obviously) :wink:

2) Change python script to executable:

My-MBP:Downloads user$ chmod +x pyldd2obj.py

3) Execute Script
My-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

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.

  • Author

did you get any output ?

What do you get if you just put:

python pyldd2obj.py

/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.

  • Author

Are you sure the file pyldd2obj.py is in the same directory as where you currently in ?

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.

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

1698031672_runpyldd2obj.thumb.JPG.150af48067be6da673eddc3db043bb81.JPG

thats all

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.

  • 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.

Guest
Reply to this topic...

Recently Browsing 0

  • No registered users viewing this page.
Sponsored Links