Comments (10)
You are confusing me a bit. In #40 (comment) you said
(b) speed: the paths[] array construction should be moved out of the locate function. it is expensive and only needs to be done once.
It has been moved out of the locate()
function since f0037a7, so I'm quite sure where it needs to be now. It is already in the global namespace, so to initialize it any sooner it would have to be moved near the top of the script, around line 50 I'd imagine.
from ldr-importer.
It has been moved out of the locate() function since f0037a7
No, it hasn't. It gets initialized outside, but each call to locate appends more and more entries.
Look at the calls
paths.append(...)
which, even after that change all are inside the locate() function
and this way get executed each time that function gets called,
which is what this issue complains about.
from ldr-importer.
I think I get it now. You are talking about the multiple calls to locate()
that almost continually runs paths.append(...)
, right?
from ldr-importer.
No. The multiple calls to locate() are OK.
They happen each time the script tries to locate a required file.
The bug instead is that inside EACH of those calls, the variable paths gets its .append() calls.
They put more and more stuff into that variable each time the function locate() is running.
This is wrong.
Instead, the paths variable should only get filled ONE time, before starting all the loading action.
The locate() function should not tinker with that variable, just READ it.
from ldr-importer.
OK, I see what you mean now. Checking the length of the array produced a very large number. So the fix would be to initialize the paths locate()
appends with the paths
array, as you've been saying.
However, there still has to be some editing somewhere. Since the array starts out with the HighRes
and LowRes
paths present, the inverse will have to be removed from the array if either of those flags are True
. Appending them might work, but then we end up with the importer searching the folders in the wrong order, something we fixed in #52.
from ldr-importer.
come on, it is not that complicated. simply MOVE the paths.append() calls to the beginning of the script,
right after where the values for HighRes and LowRes are known.
The paths array then can stay as it is the whole lifetime of the script.
There is no need to modify it again.
Its search order will be correct and will be used for every file loaded.
The bug we talk about here is just that the PLACE of the paths.append() calls is wrong.
They ALL should simply be done BEFORE the first call to locate() and then never again.
The whole discussion here already took more time to EXPLAIN the problem than to FIX it... :ยด(
from ldr-importer.
Assigning to v1.1.5 milestone.
from ldr-importer.
ad87d66 should finally fix this. ๐
Apologies for not understanding the issue completely. I didn't mean to annoy you. Sometimes I have trouble understand what people are trying to explain (it probably stems from my inability to sometimes explain what I am taking about). ๐
from ldr-importer.
If everything looks good, I'll merge this and prepare the v1.1.5 release.
from ldr-importer.
This should be fixed by #56. Closing. ๐
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.