M2m Posted December 1, 2020 Posted December 1, 2020 I finished a Proof-of-Concept. That means a couple of things are working. But quite allot of things still to-do: LDD and Blender have different axis, Flex parts are floating around, correct grouping of subparts (g, g1, g2, .... files), materials, textures, testing on macOS Anyway this is the state so far: Quote
M2m Posted December 2, 2020 Author Posted December 2, 2020 (edited) Aligning LDD and Blenders different axis: ✔️ Address Flex parts floating around: ✔️ Preliminary Testing on Windows 10 & maxOS 10.13 ✔️ grouping of parts and subparts (g, g1, g2, .... files) ✔️ brick seams (preliminary) ✔️ Logo-on-bricks ✔️ Hosting on public repository ✔️ Pending: grouping of parts and subparts (g, g1, g2, .... files) correct normals materials textures brick seams Logo-on-bricks testing on different OSes (macOS, Linux) Hosting on public repository Edited December 3, 2020 by M2m Quote
M2m Posted December 3, 2020 Author Posted December 3, 2020 (edited) OK I opened the Repo now for public: sttng/ImportLDD: A Blender plug-in for importing LEGO Digital Designer file format (lxf, lxfml) LEGO models. (github.com) Bear in mind this is basically still very, very unpolished and dirty code. I will still continue to commit code randomly. This also means that currently I can't give too much helpful tips and support - if any at all. importldd.py is the file you need, and to "install" via Prefernces -> Add-ons. Or you can run the code via the Scripting Tab / Workspace. Still missing features: reading of normals from .g files (even so Blender seems to do a very good Normal calculation by itselft) materials textures testing on different OSes (Linux) Anyway feel free to try it, clone it or come up with suggestions or wishes. Edited December 4, 2020 by M2m Quote
MrLuWillBeLive Posted December 5, 2020 Posted December 5, 2020 In Fact,that have a blender Plugin for Import LDraw https ://github.com/ TobyLobster/ImportLDraw Quote
M2m Posted December 5, 2020 Author Posted December 5, 2020 (edited) Yeah. The LDraw Plugin for Blender is great. But it can't handle (so far) the new LDD Mod Parts, unless there are LDraw Parts Ports of them. My Plugin reads the Geometry directly from the .g files, so it can handle every LDD Parts (including mod parts.) But it is lacking nice materials (that's where the LDraw Plugin really shines) and of course many other features. On the other hand the LDraw Plugin existed for years, and this one only since a week Edited December 5, 2020 by M2m Quote
MrLuWillBeLive Posted December 11, 2020 Posted December 11, 2020 On 12/5/2020 at 2:54 PM, M2m said: Yeah. The LDraw Plugin for Blender is great. But it can't handle (so far) the new LDD Mod Parts, unless there are LDraw Parts Ports of them. My Plugin reads the Geometry directly from the .g files, so it can handle every LDD Parts (including mod parts.) But it is lacking nice materials (that's where the LDraw Plugin really shines) and of course many other features. On the other hand the LDraw Plugin existed for years, and this one only since a week If you creat the LDD-Mod-Parts model into a .DAT file,then copy it to the Plugin's LDraw Parts Library booooom,now you can import the new model to the BLENDER also,you can from stu.dio's new part copy the .dat file to the same file address,then it will work when you export a .ldr file from stu.dio with some mod part Quote
M2m Posted December 11, 2020 Author Posted December 11, 2020 I don't think all the new LDD-Mod parts are available in either Ldraw or Stud.io. And as you say you have to create a dat part of the mod-file. If you have done that already, I think you should share with the community. There seems people are questioning on how to do it in the thread about new Unity Lego parts. Maybe you can give some helpful input there :) Quote
MrLuWillBeLive Posted December 12, 2020 Posted December 12, 2020 21 hours ago, M2m said: I don't think all the new LDD-Mod parts are available in either Ldraw or Stud.io. And as you say you have to create a dat part of the mod-file. If you have done that already, I think you should share with the community. There seems people are questioning on how to do it in the thread about new Unity Lego parts. Maybe you can give some helpful input there :) For example,you can use the Part Designer,click the "Import",selcet the "STUDIO PART",then selcet and export a "new" part(It's same of the stu.dio part,if it only exists in the stu.dio part library) but in this way to make a new .dat part,it is not simple and elegant as a part from ldraw part library Quote
Jason C. Hand Posted January 6, 2021 Posted January 6, 2021 How do you install this onto Blender? Quote
M2m Posted January 6, 2021 Author Posted January 6, 2021 (edited) 2 hours ago, Jason C. Hand said: How do you install this onto Blender? Also on Windows you can go to Edit -> Prefernces -> Add-ons and choose the install button. Then browse and select importldd.py. Then you have to activate it with the checkbox in front of it. It's my 1st ever Blender plugin. Anyway you can also run it by going to the "Scripts" Workspace and load / run importldd.py. Then you will be present with an import dialogue. It should auto-detect your db.lif (or extracted db folder) - you can see at the upper right. Let me know your success rate or of course any potential errors. As I'm a little occupied with work recently I unfortunately didn't have time to focus on this as much as I would like. For example lack of importing of decals info is what is bugging myself. Cheers ! Edited January 6, 2021 by M2m Quote
Jason C. Hand Posted January 6, 2021 Posted January 6, 2021 49 minutes ago, M2m said: Also on Windows you can go to Edit -> Prefernces -> Add-ons and choose the install button. Then browse and select importldd.py. Then you have to activate it with the checkbox in front of it. It's my 1st ever Blender plugin. Anyway you can also run it by going to the "Scripts" Workspace and load / run importldd.py. Then you will be present with an import dialogue. It should auto-detect your db.lif (or extracted db folder) - you can see at the upper right. Let me know your success rate or of course any potential errors. As I'm a little occupied with work recently I unfortunately didn't have time to focus on this as much as I would like. For example lack of importing of decals info is what is bugging myself. Cheers ! Firstly, thanks again for your reply to my query. Second, I received an error message that boils down to, <DOCTYPE html> File "\importldd.py", line 7 Python script failed, check the message in the system console. See photos below. Quote
M2m Posted January 6, 2021 Author Posted January 6, 2021 (edited) 13 minutes ago, Jason C. Hand said: Firstly, thanks again for your reply to my query. Second, I received an error message that boils down to, <DOCTYPE html> File "\importldd.py", line 7 Python script failed, check the message in the system console. See photos below. Seem somehow the file saved was in HTML: Can you try to download this file ? https://raw.githubusercontent.com/sttng/ImportLDD/main/importldd.py Thanks again ! Edited January 6, 2021 by M2m Quote
Jason C. Hand Posted January 6, 2021 Posted January 6, 2021 Just now, M2m said: Seem somehow the file saved was in HTML: Can you try to download this file ? https://raw.githubusercontent.com/sttng/ImportLDD/main/importldd.py Thanks again ! Ok friend, it seems to have registered. Thank you! Quote
Jason C. Hand Posted June 17, 2022 Posted June 17, 2022 (edited) Hello @M2m, I have run into some new trouble with the ImportLDD plugin for Blender. Screencap below for some elucidation: https://flic.kr/p/2nsxrZE I am using Blender 2.93.7. Any suggestions?? Edited June 17, 2022 by Jason C. Hand Quote
andardbricks Posted June 17, 2022 Posted June 17, 2022 hello i have this problem when i'm trying to activate the addon im using blender 3.0 Traceback (most recent call last): File "C:\Program Files\Blender Foundation\Blender 3.0\3.0\scripts\modules\addon_utils.py", line 387, in enable mod.register() File "C:\Users\ASUS\AppData\Roaming\Blender Foundation\Blender\3.0\scripts\addons\ImportLDD-main\__init__.py", line 27, in register bpy.utils.register_class(ImportLDDOps) NameError: name 'ImportLDDOps' is not defined Quote
Jason C. Hand Posted June 18, 2022 Posted June 18, 2022 On 6/16/2022 at 11:49 PM, Jason C. Hand said: Hello @M2m, I have run into some new trouble with the ImportLDD plugin for Blender. Screencap below for some elucidation: https://flic.kr/p/2nsxrZE I am using Blender 2.93.7. Any suggestions?? Never mind, got it to work now. Sorry for the mix-up. @andardbricks, please use this link. This should get ImportLDD to work: https://raw.githubusercontent.com/sttng/ImportLDD/main/importldd.py. Hope this helps, friend. Quote
andardbricks Posted June 21, 2022 Posted June 21, 2022 On 6/18/2022 at 9:21 PM, Jason C. Hand said: Never mind, got it to work now. Sorry for the mix-up. @andardbricks, please use this link. This should get ImportLDD to work: https://raw.githubusercontent.com/sttng/ImportLDD/main/importldd.py. Hope this helps, friend. i'm using that version you suggested but i come up with this error now, i want to import this big head piece to blender Python: Traceback (most recent call last): File "C:\Users\ASUS\AppData\Roaming\Blender Foundation\Blender\3.0\scripts\addons\importldd.py", line 1454, in execute return convertldd_data(context, self.filepath, self.lddLIFPath, self.useLogoStuds, self.useLDDCamera) File "C:\Users\ASUS\AppData\Roaming\Blender Foundation\Blender\3.0\scripts\addons\importldd.py", line 1394, in convertldd_data converter.Export(filename=filepath, useLogoStuds=useLogoStuds, useLDDCamera=useLDDCamera) File "C:\Users\ASUS\AppData\Roaming\Blender Foundation\Blender\3.0\scripts\addons\importldd.py", line 989, in Export geo = Geometry(designID=pa.designID, database=self.database) File "C:\Users\ASUS\AppData\Roaming\Blender Foundation\Blender\3.0\scripts\addons\importldd.py", line 376, in __init__ primitive = Primitive(data = database.filelist[os.path.normpath(PRIMITIVEPATH + designID + '.xml')].read()) File "C:\Users\ASUS\AppData\Roaming\Blender Foundation\Blender\3.0\scripts\addons\importldd.py", line 502, in __init__ self.comment = node[0].nodeValue TypeError: 'Comment' object is not subscriptable location: <unknown location>:-1 Quote
JGuy Posted December 19, 2022 Posted December 19, 2022 Hey @M2m, I am getting this error whenever I try to run it: "Traceback (most recent call last): File "\importldd.py", line 1455, in execute File "\importldd.py", line 1395, in convertldd_data File "\importldd.py", line 953, in Export AttributeError: 'Converter' object has no attribute 'scene' location: <unknown location>:-1" I am using Blender 2.9.0 and am trying to run the script directly from the scripting tab. It will pull up a file selector and let me select a file but then it gives me that error. It also gives me the same error when I try to install it as an add-on. Any ideas? Quote
M2m Posted December 23, 2022 Author Posted December 23, 2022 On 12/20/2022 at 1:44 AM, JGuy said: Hey @M2m, I am getting this error whenever I try to run it: "Traceback (most recent call last): File "\importldd.py", line 1455, in execute File "\importldd.py", line 1395, in convertldd_data File "\importldd.py", line 953, in Export AttributeError: 'Converter' object has no attribute 'scene' location: <unknown location>:-1" I am using Blender 2.9.0 and am trying to run the script directly from the scripting tab. It will pull up a file selector and let me select a file but then it gives me that error. It also gives me the same error when I try to install it as an add-on. Any ideas? Are you on Windows or macOS or Linux ? In fact i don't maintain the plugin anymore. But I might check on your error. Quote
JGuy Posted December 24, 2022 Posted December 24, 2022 On 12/23/2022 at 6:24 AM, M2m said: Are you on Windows or macOS or Linux ? In fact i don't maintain the plugin anymore. But I might check on your error. With this specific error readout i was on Windows 11, but i’ve also tried it on macOS Monterey and gotten similar if not the same errors Quote
Garry_rocks Posted January 6, 2023 Posted January 6, 2023 I'd say I'm really interested in LDD to Blender converter, but I don't think it's usable for me in the current state. I wish there was a way to recreate LDD2POV-Ray functionality for next-gen rendering... Quote
The_Fiery_Rooster Posted January 10, 2023 Posted January 10, 2023 On 6/21/2022 at 1:16 AM, andardbricks said: i'm using that version you suggested but i come up with this error now, i want to import this big head piece to blender Python: Traceback (most recent call last): File "C:\Users\ASUS\AppData\Roaming\Blender Foundation\Blender\3.0\scripts\addons\importldd.py", line 1454, in execute return convertldd_data(context, self.filepath, self.lddLIFPath, self.useLogoStuds, self.useLDDCamera) File "C:\Users\ASUS\AppData\Roaming\Blender Foundation\Blender\3.0\scripts\addons\importldd.py", line 1394, in convertldd_data converter.Export(filename=filepath, useLogoStuds=useLogoStuds, useLDDCamera=useLDDCamera) File "C:\Users\ASUS\AppData\Roaming\Blender Foundation\Blender\3.0\scripts\addons\importldd.py", line 989, in Export geo = Geometry(designID=pa.designID, database=self.database) File "C:\Users\ASUS\AppData\Roaming\Blender Foundation\Blender\3.0\scripts\addons\importldd.py", line 376, in __init__ primitive = Primitive(data = database.filelist[os.path.normpath(PRIMITIVEPATH + designID + '.xml')].read()) File "C:\Users\ASUS\AppData\Roaming\Blender Foundation\Blender\3.0\scripts\addons\importldd.py", line 502, in __init__ self.comment = node[0].nodeValue TypeError: 'Comment' object is not subscriptable location: <unknown location>:-1 I also encountered this error, and I figured out it actually has to do with the piece itself rather than the plugin. I ended up using the LDD part modifier to get a file of just the geometry, and put it into blender to find out the faces weren't actually attached to one another. Spent a while unifying all the vertices, but I managed to create a version that works. Sadly, the file is too large to attach here, but hopefully my description is good enough to help you figure it out. Quote
M2m Posted February 4, 2023 Author Posted February 4, 2023 On 6/21/2022 at 1:16 PM, andardbricks said: i'm using that version you suggested but i come up with this error now, i want to import this big head piece to blender Python: Traceback (most recent call last): File "C:\Users\ASUS\AppData\Roaming\Blender Foundation\Blender\3.0\scripts\addons\importldd.py", line 1454, in execute return convertldd_data(context, self.filepath, self.lddLIFPath, self.useLogoStuds, self.useLDDCamera) File "C:\Users\ASUS\AppData\Roaming\Blender Foundation\Blender\3.0\scripts\addons\importldd.py", line 1394, in convertldd_data converter.Export(filename=filepath, useLogoStuds=useLogoStuds, useLDDCamera=useLDDCamera) File "C:\Users\ASUS\AppData\Roaming\Blender Foundation\Blender\3.0\scripts\addons\importldd.py", line 989, in Export geo = Geometry(designID=pa.designID, database=self.database) File "C:\Users\ASUS\AppData\Roaming\Blender Foundation\Blender\3.0\scripts\addons\importldd.py", line 376, in __init__ primitive = Primitive(data = database.filelist[os.path.normpath(PRIMITIVEPATH + designID + '.xml')].read()) File "C:\Users\ASUS\AppData\Roaming\Blender Foundation\Blender\3.0\scripts\addons\importldd.py", line 502, in __init__ self.comment = node[0].nodeValue TypeError: 'Comment' object is not subscriptable location: <unknown location>:-1 I got this part working. The issue was that this parts .xml file has a comment and the plugin didn't parse xml comments correctly. Updated version here (and tested with Blender 3.4): https://raw.githubusercontent.com/sttng/ImportLDD/main/importldd.py You have to un-install the plugin 1st, afterwards restart blender, then install again. Hope this fixed the issue. On 12/20/2022 at 1:44 AM, JGuy said: Hey @M2m, I am getting this error whenever I try to run it: "Traceback (most recent call last): File "\importldd.py", line 1455, in execute File "\importldd.py", line 1395, in convertldd_data File "\importldd.py", line 953, in Export AttributeError: 'Converter' object has no attribute 'scene' location: <unknown location>:-1" I am using Blender 2.9.0 and am trying to run the script directly from the scripting tab. It will pull up a file selector and let me select a file but then it gives me that error. It also gives me the same error when I try to install it as an add-on. Any ideas? Maybe you can send the LDD file so I can check ? Quote
MixedMocs Posted March 4, 2024 Posted March 4, 2024 Hello! First of all, THANK YOU FOR MAKING THIS! I've been searching for days for a way to finally render my LDD mocs with the modded parts, and your plugin (mostly) works like an absolute charm for that! Compared to bluerender, which doesn't accept the new lif file that LIFCreator gives me, or importing into Stud.io, which rotates half the pieces wrong, your plugin is definitely the best option for me right now. That being said, I have been getting a few smaller issues with some of my complex models. First of all, it seems that the plugin doesn't like decorated bricks a lot. When I try to import something with a brick that has a print on it, i get the following error: Python: Traceback (most recent call last): File "C:\Users\[my name]\AppData\Roaming\Blender Foundation\Blender\4.0\scripts\addons\importldd.py", line 1454, in execute return convertldd_data(context, self.filepath, self.lddLIFPath, self.useLogoStuds, self.useLDDCamera) File "C:\Users\[my name]\AppData\Roaming\Blender Foundation\Blender\4.0\scripts\addons\importldd.py", line 1394, in convertldd_data converter.Export(filename=filepath, useLogoStuds=useLogoStuds, useLDDCamera=useLDDCamera) File "C:\Users\[my name]\AppData\Roaming\Blender Foundation\Blender\4.0\scripts\addons\importldd.py", line 1144, in Export texImage.image = bpy.data.images.load(os.path.normpath(decofilename)) RuntimeError: Error: Cannot read '\Decorations\101321.png': No such file or directory It will then stop importing, so I'll have only half a model or nothing at all in blender. If I go back into LDD and remove the decoration from the part, the model is imported without issue. Apparently it just can't find the decoration files, I've tried it with both the new and old decorations, same issue. Second of all, on some models, some brick faces will show up pink when imported. I'll attach a screenshot. I have no idea why this happens, but at least it seems to be constistent per brick: the sand-yellow 1x1 bricks in the screenshot all consistently have 3 pink faces (some of them are just rotated apparently). The import doesn't throw any errors for this issue. I'm sorry about the shoddy screenshot compression. I would love to attach more screenshots, but I'm only allowed a max total size of 0.1mb, which isn't enough for much of anything if we're honest (does this get better if I post more? This is my first forum contribution after all). I can also send you some of my "incriminating" model files if you want, just tell me through which channel you'd like to receive them. Be aware that I do use the new modded LDD parts from the key topic on here, though I think I can also find some with just the "vanilla" parts. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.