Comments (15)
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.
I'll take a look at this, it seems like it would be simple to fix.
from ldr-importer.
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.
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:
- Create a new object - >
- Parse the main file, then all sub files, and append to the sub file list - >
- 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.
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.
@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.
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:
- Create a new object - >
- Parse the main file, then all sub files, and append to the sub file list - >
- 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.
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.
Thats because self.report
has to be called inside a class that extends bpy.types.Operator
.
from ldr-importer.
Hm. I should be able to fix that. Will try either this afternoon or tonight, whenever I get the chance.
from ldr-importer.
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.
Still have this in my sights, been on vacation that past week.
from ldr-importer.
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.
I'm working on a script rewrite (and failing horribly), but thank you!
from ldr-importer.
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)
- Install errors on OS X with version 1, 3, 0 HOT 5
- Missing LDraw Search Path on Linux HOT 2
- problem: 'cannot find c:/Ldraw' HOT 3
- ldr-importer does not import all lego blocks HOT 19
- Can't install 1.3.1 HOT 3
- Incorrect Normals / Broken Normals with some random parts/bricks HOT 2
- Unexpected normals when cleanup disabled HOT 1
- Model file contents too short to extract header HOT 7
- 1.3.2 doesn't work - back to 1.2.0 HOT 4
- Using LDR-Importer from python API HOT 2
- "Basic Cleanup" function corrupts LEGO logo in open studs HOT 3
- FBX export is not supporting Cycles nodes HOT 1
- Problem: cannot find Ldraw installation at c:\ HOT 1
- Path's reset of LDraw Parts Library
- Cannot Find LDraw Installation at C:/Ldraw HOT 4
- Doesn't load model
- LDD to LDR, missing pieces, moved pieces HOT 1
- LDD-Importer-Exporter for the future HOT 1
- I can't use this addon
- Traceback call issue HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ldr-importer.