Code Monkey home page Code Monkey logo

Comments (30)

JoshTheDerf avatar JoshTheDerf commented on August 18, 2024

This is usually caused by a missing part. If the importer cannot find a part, it simply fails silently, leaving however much of the model had been imported previously. I am currently working (without success) on finding a way around this.

from ldr-importer.

Mrfuture avatar Mrfuture commented on August 18, 2024

Thanks, I was thinking what could have done this and removed the Lsynth hose. This time it nearly loaded the whole model.. But there is still something wrong.
A bit strange since all have been recently rebuildt with the current LDraw library.
I can understand the Lsynth parts since it is not a real part, but everything else should be normal lego parts from Ldraw library. I removed the only one currently in the model.

from ldr-importer.

JoshTheDerf avatar JoshTheDerf commented on August 18, 2024

Could you try running Blender from the command line (or terminal depending on what operating system you use), and posting the output here?

from ldr-importer.

Mrfuture avatar Mrfuture commented on August 18, 2024

I cant get the whole list but i think it it gves some file not found in the beginning before it start prosessing the file
Im running on windows 7

It starts with this

[LDR Importer] Attempting to import C:\Temp\DS Exp 2013_00001-1.ldr - 12:32:18

[LDR Importer] Could not find file Unknown - 12:32:18

[LDR Importer] File not found: Unknown - 12:32:18

and then a lot of

Info: Removed 909 vertices

until it ends with

[LDR Importer] C:\Temp\DS Exp 2013_00001-1.ldr successfully imported! - 12:30:13

If you want, I can send you the file?

from ldr-importer.

JoshTheDerf avatar JoshTheDerf commented on August 18, 2024

Yes please!

It would appear there's some part definitions that don't exist.

from ldr-importer.

Mrfuture avatar Mrfuture commented on August 18, 2024

How do i send it to you.? I cant attach it to ths message.
What i have seen is that there is the bottom (called back) and the front part of the model that is missing.in the main file. But the data is in the file but some how not processed.

from ldr-importer.

JoshTheDerf avatar JoshTheDerf commented on August 18, 2024

Paste the .ldr file in https://gist.github.com/ and give me the link?

from ldr-importer.

Mrfuture avatar Mrfuture commented on August 18, 2024

I hope i did ths the rigth way

https://gist.github.com/Mrfuture/c911c5aad896f9be8f2c

from ldr-importer.

JoshTheDerf avatar JoshTheDerf commented on August 18, 2024

Looking at that file, it would appear that there are multiple models in it (similar to a .mpd). I don't believe that that is well supported, although I may be wrong.

EDIT: The model looks pretty neat in LDView!

EDIT2:
@Mrfuture: The file appears to import correctly in the latest version of LDR-Importer and Blender 2.69 (running on Ubuntu 13.04)

There are some missing vertices (mainly on the engine dishes, but this is currently not fixable, and is related to the vertice definitions of some ldraw parts). As a rule of thumb (at least for me) refrain from trying to import parts that are round and concave.

Increasing the scale, turning on "Use High-Res Bricks" or switching Model Cleanup may help alleviate the problem a bit, but will also increase lag and require more memory.

from ldr-importer.

Mrfuture avatar Mrfuture commented on August 18, 2024

https://gist.github.com/Mrfuture/fe43635cf66058467dd0
Here is another example. This worked perfect.
Bouth models was something me and my friend created back in the 1990 something.
This one was his ship. and the first was mine. The MOCs still standing.
Now im soon 45 and still build with Lego from tme to time.

from ldr-importer.

le717 avatar le717 commented on August 18, 2024

Hello!

I have not yet tested your models, but from reading the code it seems they are indeed multi-part dat models as Tribex thought. LDR Importer does not currently support this format (see #7), but we do plan on eventually fixing this, most likely after we complete a much needed rewrite.

I have never tested how the script reacts to a multi-part dat, but your descriptions makes sense (if that makes any sense :P) to how it might treat one.

In the mean time, we will try to help you import your model. If it is possible you may want to start with splitting the multiple parts into separate files and referencing them in one large model. πŸ˜‰

from ldr-importer.

Mrfuture avatar Mrfuture commented on August 18, 2024

Hi
I can try over the weekend to split up the model in seperat files. If not i get caught up in christmas prep.
But why did the second model work and not the first one. The files looks the same but the second is more clean than the first one.
And it could always be an old problem coming back and haunt me. I had a problem with the file complaining about a non exixtent missing file when loading the file.. But since the main model missing the bottom and the front part it is a bit strange.

from ldr-importer.

Mrfuture avatar Mrfuture commented on August 18, 2024

New information. The problem has been solved. Beside for the problem with Lsynth that make the same problem.
I found one part in the file after loading it in LDview. It reported an unkown file at line 372. I checked the file in Notepad with line number turned on and found it. it was in the back11.ldr section of the file i removed that line and saved.
I did an new export to LDR files and then lmported it into Blender. This time the whole ship appeard.

Thanks for all help and good luck with the importer. I will keep a tab on this one. Have been looking for something like it for some time.

from ldr-importer.

JoshTheDerf avatar JoshTheDerf commented on August 18, 2024

Congrats on getting it to work! We'll try to make the importer more predictable in the future.

from ldr-importer.

Mrfuture avatar Mrfuture commented on August 18, 2024

Hi

Sorry to bother you again.

I have fixed some other problem and now was playing with the export to Blender again.
But suddenly I get these errors in the consol window in Blender

[LDR Importer] ERROR: Reason: UnicodeDecodeError. - 17:43:28

[LDR Importer] Attempting to import C:\temp\DS Exp 2013_00001.ldr - 17:43:42

[LDR Importer] ERROR: UnicodeDecodeError
Traceback (most recent call last):
File "C:\Users\Petter\AppData\Roaming\Blender Foundation\Blender\2.68\scripts\addons\import_ldraw.py", line 766, in create_model

LDrawFile(context, file_name, mat)

File "C:\Users\Petter\AppData\Roaming\Blender Foundation\Blender\2.68\scripts\ addons\import_ldraw.py", line 126, in init

self.parse(filename)

File "C:\Users\Petter\AppData\Roaming\Blender Foundation\Blender\2.68\scripts\addons\import_ldraw.py", line 244, in parse

lines = f_in.readlines()

File "C:\Program Files\Blender Foundation\Blender\2.68\python\lib\codecs.py", line 300, in decode (result, consumed) = self._buffer_decode(data, self.errors, final)

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf6 in position 92: invalid start byte

  • 17:43:42
    [LDR Importer] ERROR: Reason: UnicodeDecodeError. - 17:43:42

I have restarted blender, reexported the file but stil I get this problem right a way after select the file and start.

I also have got the Lsynth to work with the export. I needed to copy the Lsynth parts files to Ldraw\parts dir.
May be something for later that it check the unofficial\Lsynth catalog if it cant find the file in main Ldraw dirs ?

Petter

from ldr-importer.

le717 avatar le717 commented on August 18, 2024

Wow, GitHub broke that email formatting.

I've seen this error before in some of my personal projects. I occurs when a file with an Big or Little Endian encoding is read but the file is opened using UTF-8 encoding. LDR models are supposed to use UTF-8 (I believe NO-BOM), so that is how the script attempts to read them. Are one of the models you posted above the model you are importing? I'll look into fixing the issue this afternoon.

from ldr-importer.

le717 avatar le717 commented on August 18, 2024

@Mrfuture The issue should be fixed in #37. I thoroughly tested it myself. πŸ˜‰

And it could always be an old problem coming back and haunt me. I had a problem with the file complaining about a non exixtent missing file when loading the file.. But since the main model missing the bottom and the front part it is a bit strange.

New information. The problem has been solved. Beside for the problem with Lsynth that make the same problem. I found one part in the file after loading it in LDview. It reported an unkown file at line 372. I checked the file in Notepad with line number turned on and found it. it was in the back11.ldr section of the file i removed that line and saved.
I did an new export to LDR files and then lmported it into Blender. This time the whole ship appeard.

Yea, that is #11, Non-existent bricks crash script. This happens because of the way the script is written, and attempts to skip those bricks and move on have failed, same for trying to throw an error box rather than silently failing. I added a section in the Readme warning about this. Rest assured, we know about the error, and we ourselves (well, I know I do) get annoyed by it. πŸ˜‰

Hm, I'll have to look up these Lsynth bricks so I know what you are referring to and check compatibility.

from ldr-importer.

Mrfuture avatar Mrfuture commented on August 18, 2024

The ONE With The .ldr not The mpd. But that file is The one i export to ldr files
Petter

----- Opprinnelig melding -----
Fra: "Triangle717" [email protected]
Sendt: β€Ž21.β€Ž12.β€Ž2013 18:05
Til: "le717/LDR-Importer" [email protected]
Kopi: "Mrfuture" [email protected]
Emne: Re: [LDR-Importer] Wrong part of the model shows up (#36)

Wow, GitHub broke that email formatting.

I've seen this error before in some of my personal projects. I occurs when a file with an Big or Little Endian encoding is read but the file is opened using UTF-8 encoding. LDR models are supposed to use UTF-8 (I believe NO-BOM), so that is how the script attempts to read them. Are one of the models you posted above the model you are importing? I'll look into fixing the issue this afternoon.


Reply to this email directly or view it on GitHub:
#36 (comment)

from ldr-importer.

Mrfuture avatar Mrfuture commented on August 18, 2024

Lsynth is a part generator for bricks like hoses and wires for decoration,pneumatic or eletrick parts. You find it in MLCad.
Those have a set of basic "bricks" it use to emulate the hose or wire look.

from ldr-importer.

Mrfuture avatar Mrfuture commented on August 18, 2024

OK Now i have tested the updated importer but still has the error,
I have removed the importer and installed it again into blender.
I have tried the other way to try to save the file again in MLCad and edit it thete but it looks like if it has been edited
But what i strange is that if i delete the export and do a new export. It still gives the error even when i never have edit that file. But i can import other files.

from ldr-importer.

le717 avatar le717 commented on August 18, 2024

@Mrfuture What is the error you are getting now with the updated script? Can you upload the model to Dropbox or some place like that so I can examine the file directly and try to come up with a proper fix?

from ldr-importer.

Mrfuture avatar Mrfuture commented on August 18, 2024

Hi again

To me it looks like it is the same message.

Read new prefs: C:\Users\Petter\AppData\Roaming\Blender Foundation\Blender\2.68\

config\userpref.blend

found bundled python: C:\Program Files\Blender Foundation\Blender\2.68\python

[LDR Importer] Configuration file found at

C:\Users\Petter\AppData\Roaming\Blender Foundation\Blender\2.68\scripts\presets\

io_import_ldraw\config.py - 12:15:51

[LDR Importer] The LDraw Parts Library installation path to be used is

C:\Program Files (x86)\LDraw - 12:15:51

reloading addon: import_ldraw 1387665876.4707716 1387883962.689631 C:\Users\Pett

er\AppData\Roaming\Blender Foundation\Blender\2.68\scripts\addons\import_ldraw.p

y

Modules Installed from 'C:\Users\Petter\Desktop\LDR-Importer-v1.1\import_ld

raw.py' into 'C:\Users\Petter\AppData\Roaming\Blender Foundation\Blender\

2.68\scripts\addons' ()

trying to save userpref at C:\Users\Petter\AppData\Roaming\Blender Foundation\Bl

ender\2.68\config\userpref.blend ok

<!> event has invalid window

[LDR Importer] Attempting to import C:\temp\DS Exp 2013_00001.ldr - 12:20:04

[LDR Importer] ERROR: UnicodeDecodeError

Traceback (most recent call last):

File "C:\Users\Petter\AppData\Roaming\Blender Foundation\Blender\2.68\scripts\

addons\import_ldraw.py", line 766, in create_model

else:

File "C:\Users\Petter\AppData\Roaming\Blender Foundation\Blender\2.68\scripts\

addons\import_ldraw.py", line 126, in init

File "C:\Users\Petter\AppData\Roaming\Blender Foundation\Blender\2.68\scripts\

addons\import_ldraw.py", line 244, in parse

File "C:\Program Files\Blender Foundation\Blender\2.68\python\lib\codecs.py",

line 300, in decode

(result, consumed) = self._buffer_decode(data, self.errors, final)

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf6 in position 92: invalid

start byte

  • 12:20:04

[LDR Importer] ERROR: Reason: UnicodeDecodeError. - 12:20:04

I think it must be something with this file. Since if I use another model it works fine.
If I take this to LDView it does not report any error.
But what is strange is that it looks like it happened something to the main file since if I export it into Ldr files from MLCad it does not work anymore with the importer. Even if I do this or saving under a new name and do a new export it stil fail.

The file attached is an exported file. The mpd from earlier is the main model file,

But take your time. May be I going to complete the model before I try to import it into Blender again. But not today. It’s Christmas and family first :-)

Merry Christmas

From

Petter Lerdahl

Fra: Triangle717 [mailto:[email protected]]
Sendt: 24. desember 2013 00:21
Til: le717/LDR-Importer
Kopi: Mrfuture
Emne: Re: [LDR-Importer] Wrong part of the model shows up (#36)

What is the error you are getting now with the updated script? Can you upload the model to Dropbox so I can

β€”
Reply to this email directly or view it on GitHub #36 (comment) . https://github.com/notifications/beacon/6229698__eyJzY29wZSI6Ik5ld3NpZXM6QmVhY29uIiwiZXhwaXJlcyI6MTcwMzM3MzYzMywiZGF0YSI6eyJpZCI6MjI0MjU3NjR9fQ==--63d2bd29e4cce5cdff02caa2bb6a80909a02ea1a.gif

from ldr-importer.

JoshTheDerf avatar JoshTheDerf commented on August 18, 2024

But not today. It’s Christmas and family first :-)

Amen to that. :D

from ldr-importer.

Banbury avatar Banbury commented on August 18, 2024

Maybe you should us a different editor like Notepad++?

from ldr-importer.

Mrfuture avatar Mrfuture commented on August 18, 2024

The windows notepad have option to save as following format
Ansi (default), Unicode, Unicode big endian and UT-8
I have tried all exept the endian one. All fails.

But i shall try the other.

from ldr-importer.

le717 avatar le717 commented on August 18, 2024

@Mrfuture It looks like you are still on the v1.1 release rather than using the newest revision from the master. Do this:

  • Uninstall the current version of the plug-in from Blender.
  • Download the newest revision from the master branch and save it somewhere (like your Desktop).
  • Restart Blender, and install the revision you just downloaded. When you go to activate it, it should report as version 1.2 (though that is incorrect, it's actually a pre-release).
  • Try your model again and report back to me what happens. :)

I tested it myself using a model encoded in ANSI, UTF-8 NOBOM, UTF-8 BOM, UCS-2 BE and UCS-2 LE encoding, and every single time it imported.

from ldr-importer.

MinnieTheMoocher avatar MinnieTheMoocher commented on August 18, 2024

lsynth does not come with mlcad afaik.

it is a standalone addition to the ldraw library, comprising files for synthetisation of flexible parts
like hoses or cables.
its files need to be found by the importer.
usually, those files lie in a folder separate from the ldraw library,
so the importer will not find them.

example: my lsynth files are located in d:\lego\ldraw\lsynth,
i.e., in a sibling folder next to d:\lego\ldraw\p

my suggestion is to let the user specify additional pathes to look for files in.

this option should be a list, editable in the blender GUI options of the importer script.

in your case, you would add the path to your lsynth files to that list, so they will be found.

as a workaround, until that option is available, you could put the lsynth files
in the same folder where your model is
and use a version of LDR importer which contains a fix for #40

from ldr-importer.

Mrfuture avatar Mrfuture commented on August 18, 2024

I have now uninstalled v.1.1 (reported as v1.2 in blender 2.68
then exited and then downloaded the new file from the link ie717 provided. in the same folder as the old files and yes to overwrite.
Then started blender and selected the map from the app add on menu in settings.
Checked to activate it. The version was 1.2 save the new setup.
Exited blender and started again.
Then selected the file to import in the import ldraw.
then it happend again.
Read new prefs: C:\Users\Petter\AppData\Roaming\Blender Foundation\Blender\2.68
config\userpref.blend
found bundled python: C:\Program Files\Blender Foundation\Blender\2.68\python

[LDR Importer] Configuration file found at
C:\Users\Petter\AppData\Roaming\Blender Foundation\Blender\2.68\scripts\presets
io_import_ldraw\config.py - 17:59:34

[LDR Importer] The LDraw Parts Library installation path to be used is
C:\Program Files (x86)\LDraw - 17:59:34

[LDR Importer] Attempting to import C:\temp\DS Exp 2013-x1_00001.ldr - 17:59:57

[LDR Importer] ERROR: UnicodeDecodeError
Traceback (most recent call last):
File "C:\Users\Petter\AppData\Roaming\Blender Foundation\Blender\2.68\scripts
addons\import_ldraw.py", line 809, in create_model
LDrawFile(context, file_name, mat)
File "C:\Users\Petter\AppData\Roaming\Blender Foundation\Blender\2.68\scripts
addons\import_ldraw.py", line 162, in init
self.parse(filename)
File "C:\Users\Petter\AppData\Roaming\Blender Foundation\Blender\2.68\scripts
addons\import_ldraw.py", line 287, in parse
lines = f_in.readlines()
File "C:\Program Files\Blender Foundation\Blender\2.68\python\lib\codecs.py",
line 300, in decode
(result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf6 in position 92: invalid
start byte

  • 17:59:57

[LDR Importer] ERROR: Reason: UnicodeDecodeError. - 17:59:57

I have tried different files of the same model but it still fails.
Could it be the Blender version ?

from ldr-importer.

Mrfuture avatar Mrfuture commented on August 18, 2024

MinnieTheMoocher If you install the all in one installer for Ldraw you can choose if you want it or not. but i think the menu is in MLcad but it does not work if you not install it. (aka ithe add on not installed.) but i could be wrong :-)

I cheated a bit to copy the Lsynth files into ldraw parts catalog. but the best is if you can add aditional or it check in the lsynth map.

from ldr-importer.

Mrfuture avatar Mrfuture commented on August 18, 2024

I have been doing some searching for why the files does not work.
I splitted up the set to its sub models (export under multipart menu) and then tried to load ech part into blender.

  1. multisub part files (sub model with other sub models Created to make a bigger sub model.. This only load some parts. Maybe only those in the main file.
  2. The LSynth parts looks like not always working. If i'm correct, this made the strange file unicode error. But i have to check it a bit more.

But then again all this is not new to the things neede to be fixed. So im ether be waiting or make i way around.
I wil give an update if i get it to work,
This tests have been done with the v1.1 of the importer I have only that one on my work computer .
I wil try the same test at home also with v1.2

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.