Sign in to follow this  
M2m

[Software] LIFCreator.py - a tool to package folders and files into a lif file

Recommended Posts

@M2m

I have found one more thing regarding strings: https://waymoot.org/home/python_string/

Also tried MKL fix https://www.pugetsystems.com/labs/hpc/How-To-Use-MKL-with-AMD-Ryzen-and-Threadripper-CPU-s-Effectively-for-Python-Numpy-And-Other-Applications-1637/ but it didn't do anything.

 

Well, I have decompiled blueprint, found function that was returning an error, got general idea what it does (with my friends help), wrote simple 3d max script to search for possible culprit and found out that Blueprint doesn't like when there's a face squashed between 2 other faces (3 vertices on 2 3d space coordinates) hence the "Zero length vector" error.

Edited by Equilibrium

Share this post


Link to post
Share on other sites

Error in parts mesh, I was exporting LDraw parts into STL format then importing into 3D Max and heavily editing. I have corrected all of them and fix is ready to release.

Share this post


Link to post
Share on other sites
1 hour ago, Equilibrium said:

I have corrected all of them and fix is ready to release

I will also issue a new pack then.

Share this post


Link to post
Share on other sites

@Equilibrium I know this is a very specific favor but a couple questions - did you fix 38640, 38641, and 32803? And if so, is it possible to share your db.lif file with me since for some reason mine is not correctly repacking?

Share this post


Link to post
Share on other sites

Neither 38640 or 32803 was part of my update. 38641 from my parts wasn't causing any errors. I didn't fix/use any other custom bricks besides my own. And my upload is pretty slow.

Do you copy new db.lif back to C:\Users\xxx\AppData\Roaming\LEGO Company\LEGO Digital Designer ?

Share this post


Link to post
Share on other sites

@Equilibrium I did. That's when the problems occur with Blueprint 

The problem I'm having is that Blueprint won't even open (see my errors above). I'm also unable to re-extract the db.lif file that's been created; I have a feeling that although LDD is able to read the new db.lif file, there is something going wrong inside the file itself. When I try to use LIFExtractor on the new db.lif file, I extracts an empty folder. 

Share this post


Link to post
Share on other sites

OK Success Round One! @M2m I noticed you downloaded a newer Python script and I downloaded that one. I thought I had your most recent version but apparently not. That new version works for me and I'm able to extract the folder AND Blueprint opens!

The bad news is that one of my 3 needed parts is causing the "Zero length vector"; I just need to figure out which one. I'm going to try one at a time to figure it out. Will report back. 

Share this post


Link to post
Share on other sites

OK well, unfortunately the part that's causing the vector error is 32803.

I have confirmed that both 36840 and 36841 appear to work fine! 

@Stephan or @Equilibrium do you know who the author of 32803 is? Is this a relatively simple fix to make it work properly with Blueprint?

By the way - THANK YOU all so much for your help and patience answering my questions.  I've been on a bit of a MOC spree lately and appreciate the help trying to get these new parts to work.

EDIT: 198782 (Wheel Rim 11 x 18) also works!

Edited by Corellian Corvette

Share this post


Link to post
Share on other sites
10 hours ago, Equilibrium said:

@M2m

I have found one more thing regarding strings: https://waymoot.org/home/python_string/

Also tried MKL fix https://www.pugetsystems.com/labs/hpc/How-To-Use-MKL-with-AMD-Ryzen-and-Threadripper-CPU-s-Effectively-for-Python-Numpy-And-Other-Applications-1637/ but it didn't do anything.

 

Well, I have decompiled blueprint, found function that was returning an error, got general idea what it does (with my friends help), wrote simple 3d max script to search for possible culprit and found out that Blueprint doesn't like when there's a face squashed between 2 other faces (3 vertices on 2 3d space coordinates) hence the "Zero length vector" error.

Thanks for the support and suggestions. I replaced the string + concats with .join([a,b,c,...]) 

https://github.com/sttng/LDD/blob/master/LIFCreator.py

It takes on my Macbook booted into Win10 now around 800secs (for db folder including all the new parts).

On the other hand this drastically decreases the performance on macOS :(

 

43 minutes ago, Corellian Corvette said:

OK well, unfortunately the part that's causing the vector error is 32803.

@Stephan or @Equilibrium do you know who the author of 32803 is? Is this a relatively simple fix to make it work properly with Blueprint?
 

I guess this part was done by jester. Why don't you replace it with 2x 24201 for the time being ?

 

Edited by M2m

Share this post


Link to post
Share on other sites

@M2m I just downloaded and used the new script and it took about the same amount of time (1213 seconds) as the old one. Strange. 

I sent @jester a note about the part thank you.

I currently use 2x 24201 now for all my builds in LDD. As with all things Lego, it's functional but not quite right in the same way that 2 1x1 plates don't always work to replace a 2x2 plate; there are just some cases where you need it to be connected. I've also found that when I create instructions and I have a lot of them in a row, it's hard for me to tell which ones are supposed to be singles and which are doubles so creating the instructions have been frustrating. 

It totally does work and I've been using it, but there are a couple of pieces that would make the build and instruction process a little easier. 

Also, again, THANK YOU so much for doing this work. I do think this script + Equilibrium's discovery around creating the parts will really extend the life of LDD!

Share this post


Link to post
Share on other sites
3 hours ago, M2m said:

Thanks for the support and suggestions. I replaced the string + concats with .join([a,b,c,...]) 

https://github.com/sttng/LDD/blob/master/LIFCreator.py

It takes on my Macbook booted into Win10 now around 800secs (for db folder including all the new parts).

On the other hand this drastically decreases the performance on macOS :(

Unfortunately it didn't change anything, still slighty above 1000 s.

 

@Corellian Corvette I'm not going to fix others work so it is one time favour (didn't test myself but should be working now) https://gofile.io/d/Dtoh0n Also I don't like the direction this is going; bricks without collisions or modeled in a way so outlines aren't calculated. I wouldn't allow for any of this.

 

Share this post


Link to post
Share on other sites

@Equilibrium

Thanks for giving it a try. I'm honestly out of ideas. Anyway its open source so maybe a more gifted programmer picks it up.

Share this post


Link to post
Share on other sites
9 hours ago, Equilibrium said:

 

@Corellian Corvette I'm not going to fix others work so it is one time favour (didn't test myself but should be working now) https://gofile.io/d/Dtoh0n Also I don't like the direction this is going; bricks without collisions or modeled in a way so outlines aren't calculated. I wouldn't allow for any of this.

 

Thank you so much for doing that. I *really* appreciate it. It worked perfectly, and I now have all the bricks I need working great in Blueprint. I'll continue to add parts and see which ones are "safe"

I'm not sure about the 2nd comment - if that's directed at me or not - but again I do TRULY thank you for fixing that piece. 

Share this post


Link to post
Share on other sites

When Brick Studio is released we will be able to create outlines and collissions easier.

Share this post


Link to post
Share on other sites

I agree with Equilibrium.
Ok, I don't understand the necessary effort to create a good brick, but it is a good idea to don't allow bricks that lacks important things like collisions and outlines.

Share this post


Link to post
Share on other sites

Small update. I created an exe file of the python script for Windows users. It is still very very slow on Windows. Anyway you can get it in the same github repo:

sttng/LIF-Creator: LIF Creator - A tool to package files and folders into LEGO Digital Designer LIF files. (github.com)

 

Usage (mind the \ at the end !):

LIFCreator.exe "C:\Users\<YOUR USER>\AppData\Roaming\LEGO Company\LEGO Digital Designer\db"\

Output:

LIF Creator 1.1
Choosen directory: C:\Users\<YOUR USER>\AppData\Roaming\LEGO Company\LEGO Digital Designer\db
        PROCESSING: pes.xml
        COMPLETED: 12599 files in 8 directories processed. Writing db.lif now.
--- 1024.0340294837952 seconds ---

 

Edited by M2m

Share this post


Link to post
Share on other sites

I pushed some update in the .py script. Will test it on Windows later and then update the exe file, but on macOS I can definitely get new parts working in bluerender:

blurender2nd.jpg

Edited by M2m

Share this post


Link to post
Share on other sites

It works!!! As far as I can figure out, all that I did differently is adding ""'s at the beginning and end of the parameterstring and the backslash at the end.

Thanks M2m, you made my weekend!!!

Share this post


Link to post
Share on other sites
Just now, TonP said:

It works!!! As far as I can figure out, all that I did differently is adding ""'s at the beginning and end of the parameterstring and the backslash at the end.

Thanks M2m, you made my weekend!!!

Good to hear. Yeah files paths in Windows and macOS work differently (plus I have a bug that it expects a slash or backslash at the end). I' ll fix it and hope to make it working more flawless.

Share this post


Link to post
Share on other sites
9 hours ago, M2m said:

Small update. I created an exe file of the python script for Windows users. It is still very very slow on Windows. Anyway you can get it in the same github repo:

sttng/LIF-Creator: LIF Creator - A tool to package files and folders into LEGO Digital Designer LIF files. (github.com)

Hi M2m,

 

I recently downloaded this little software you put together. When I go to open it, it opens for a second, and then closes. May you please give me any suggestions on what may be going wrong?

Share this post


Link to post
Share on other sites
6 minutes ago, Jason C. Hand said:

Hi M2m,

 

I recently downloaded this little software you put together. When I go to open it, it opens for a second, and then closes. May you please give me any suggestions on what may be going wrong?

Hi there. You have to run it from the command line (cmd.exe under Windows)

Share this post


Link to post
Share on other sites

there is a thread of it... i didn't know... lol

anyway, thanks a lot to @M2m for his patience, with his help now i can use Bluerender and Blueprint, on Windows, with all new custom parts

you saved my life!

Edited by Rustinidiel

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.