Code Monkey home page Code Monkey logo

Comments (15)

le717 avatar le717 commented on August 18, 2024

I got this partly fixed. It no longer crashes , but it kills the import process rather than skipping it (which is best). Even continue (which is supposed to skip the current loop and go on) doesn't work. Anything I do either kills it or gets stuck in an endless loop.

This may be something that can only be fixed by redoing the script to kill it's recursiveness, but I'm leaving the issue open because if it has to stop, it needs to say why. See around lines 180-184 for references to what I'm thinking.

from ldr-importer.

JoshTheDerf avatar JoshTheDerf commented on August 18, 2024

I'll take a look at this, it seems like it would be simple to fix.

from ldr-importer.

le717 avatar le717 commented on August 18, 2024

Go right ahead. I have already fixed the crash (as I said), but if you can get it to skip them, that's the best fix of them all.

from ldr-importer.

JoshTheDerf avatar JoshTheDerf commented on August 18, 2024

Can I have a file with missing bricks to test on? "Made" one myself >:D

I've tried several things, and it ultimately looks as if the locate function won't return False or all conditionals are passing it through O_o

How exactly does that loop even know when to move to the next brick?

UPDATE:
Okay wow.... Umm...
I'd replace the while True with recursive calls to parse() and have parse return something, but I cannot tell what on earth tells the loop to move to the next brick. The code is very cryptic, and I have no idea what tmpdate means. It is definitely not a date.

UPDATE2:
Ah, I see what is happening here. The variable names and comments are VERY misleading. XD
Now the trick is to cache the next line of the main file for reading in case the current part fails.

UPDATE3:
Progress made:
Now the main .ldr file is cached in memory while the process goes. Whenever a new part is started, the line in that ldr file is cached as well. If a part fails, the importer tries to resume working from wherever it left off on the main file.

In practice, more of the file gets loaded, but it's still pretty bad.

UPDATE 4:
Okay, I think this entire thing needs to be redone. Period.
If only I could understand it enough to get all the recursion right.

Currently the structure appears to be:

  1. Create a new object - >
  2. Parse the main file, then all sub files, and append to the sub file list - >
  3. go through the subfile list and create a new object for each subpart - > Step 1

It really needs to use functions, not while recursions, lists, and objects.
Going to go work on something else now, to refresh my brain.

from ldr-importer.

le717 avatar le717 commented on August 18, 2024

Wow, how did I miss all this?! Will comment tomorrow, time for sleep now + on GitHub android app, so commenting is not the best.

from ldr-importer.

le717 avatar le717 commented on August 18, 2024

@Banbury, do you see anything in Tribex's summaries that might enable skipping of nonexistent bricks, or is he right on the button that it may not be possible without the rewrite you said it badly needs (which I agree with).

from ldr-importer.

le717 avatar le717 commented on August 18, 2024

Ah, I see what is happening here. The variable names and comments are VERY misleading. XD
Then if you know what it really is, go right ahead and fix them! Or you can tell me the misleading variables and I'll change them.

Okay, I think this entire thing needs to be redone. Period.
If only I could understand it enough to get all the recursion right.

Currently the structure appears to be:

  1. Create a new object - >
  2. Parse the main file, then all sub files, and append to the sub file list - >
  3. go through the subfile list and create a new object for each subpart - > Step 1

It really needs to use functions, not while recursions, lists, and objects.

Banbury and I have already noted that. It needs to be rewritten to kill the (bad) recursion. It might still need a class, but there is a much better way to do all this, and the recursion is clearly hampering progress. I know we already have a few targets for v1.2, but I am going to suggest holding off on those for a rewrite in v1.2 (but I'll speak more on that later. No need to comment on this idea right now 😉).

from ldr-importer.

le717 avatar le717 commented on August 18, 2024

Since this can't seem to be fully fixed right now, at least we could have some sort of error message thrown if this happens. I tried adding self.report to the area in an attempt to trigger the pop-up error box, but I was getting an AttributeError.

from ldr-importer.

JoshTheDerf avatar JoshTheDerf commented on August 18, 2024

Thats because self.report has to be called inside a class that extends bpy.types.Operator.

from ldr-importer.

le717 avatar le717 commented on August 18, 2024

Hm. I should be able to fix that. Will try either this afternoon or tonight, whenever I get the chance.

from ldr-importer.

le717 avatar le717 commented on August 18, 2024

I tried this, and was unable to do it. In the mean time, the import will simply stop with a message in the readme starting this bug.

from ldr-importer.

JoshTheDerf avatar JoshTheDerf commented on August 18, 2024

Still have this in my sights, been on vacation that past week.

from ldr-importer.

le717 avatar le717 commented on August 18, 2024

Very well, Tribex. If you think you can pull off skipping bricks with all these loops, make a branch off the master and attempt it. However, I still think a script rewrite is in order to pull this off and to allow us to add new features (like MPD and Bricksmith models, the latter of I get asked about a lot).

Hope you had a good vacation!

from ldr-importer.

JoshTheDerf avatar JoshTheDerf commented on August 18, 2024

I'm working on a script rewrite (and failing horribly), but thank you!

from ldr-importer.

le717 avatar le717 commented on August 18, 2024

We will all work on the rewrite, Tribex. I'll try to get a proposition for doing now rather then later posted within a few days. 😉

from ldr-importer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.