New Blender Importer/Exporter for Blender 2.82 - Printable Version +- LDraw.org Discussion Forums (https://forums.ldraw.org) +-- Forum: LDraw Programs (https://forums.ldraw.org/forum-7.html) +--- Forum: LDraw File Processing and Conversion (https://forums.ldraw.org/forum-22.html) +--- Thread: New Blender Importer/Exporter for Blender 2.82 (/thread-24153.html) Pages:
1
2
|
New Blender Importer/Exporter for Blender 2.82 - Matthew Morrison - 2020-08-05 After months of work, I've released my Blender LDraw handler. https://github.com/cuddlyogre/ExportLdraw Download the project zip, and extract the contents to C:\Users\username\AppData\Roaming\Blender Foundation\Blender\2.83\scripts\addons\ExportLdraw, then in Blender, go to Edit > Preferences > Add-ons > search for LDraw and check the box next to Import-Export: Export LDraw. Menu options are in Import and Export. Please install it and show me what you can do. I need to write up proper instructions, but here's the readme : Code: LDraw Handler for Blender 2.82, written by Matthew Morrison [cuddlyogre] - [email protected] - www.cuddlyogre.com RE: New Blender Importer/Exporter for Blender 2.82 - Matthew Morrison - 2020-08-05 This thread should probably be moved to LDraw Editors and Viewers. RE: New Blender Importer/Exporter for Blender 2.82 - N. W. Perry - 2020-08-05 (2020-08-05, 5:19)Matthew Morrison Wrote: After months of work, I've released my Blender LDraw handler. https://github.com/cuddlyogre/ExportLdraw The equivalent path for MacOS would apparently be: /Applications/Blender.app/Contents/Resources/2.83/scripts/addons/ExportLdraw Can't wait to fiddle around with this. First I guess I need to learn Blender itself… ;-) RE: New Blender Importer/Exporter for Blender 2.82 - Travis Cobbs - 2020-08-05 (2020-08-05, 5:27)Matthew Morrison Wrote: This thread should probably be moved to LDraw Editors and Viewers. No, this is a converter. Blender is not an LDraw program, and a Blender importer definitely counts as "file processing and conversion". RE: New Blender Importer/Exporter for Blender 2.82 - Orion Pobursky - 2020-08-05 (2020-08-05, 19:17)Travis Cobbs Wrote: No, this is a converter. Blender is not an LDraw program, and a Blender importer definitely counts as "file processing and conversion". I moved the thread to this (Conversion) forum. I forget where it was (Parts authoring maybe?) RE: New Blender Importer/Exporter for Blender 2.82 - Matthew Morrison - 2020-08-05 (2020-08-05, 19:42)Orion Pobursky Wrote: I moved the thread to this (Conversion) forum. I forget where it was (Parts authoring maybe?) Thank you! RE: New Blender Importer/Exporter for Blender 2.82 - Manfred Schaefer - 2020-10-09 Hello, what is the difference or the advantage of this add-on compared to the "ImportLDraw" add-on? Regards Manfred RE: New Blender Importer/Exporter for Blender 2.82 - Rob Frydryck - 2020-12-16 (2020-10-09, 9:51)Manfred Schäfer Wrote: Hello, I guess the biggest advantage is that this exporter "exports" to a blender file (obviously), but the key difference is that the blender import plugin may only work for certain versions of Blender. So if the author does not keep up with the blender plugin it may not work in future Blender versions. Hence I believe this may be the better option. RE: New Blender Importer/Exporter for Blender 2.82 - Matthew Morrison - 2021-01-06 (2020-10-09, 9:51)Manfred Schäfer Wrote: Hello, Sorry for the delay in response. Life distracting me and whatnot. The primary advantages are performance and accuracy of the import. Models that take 60 seconds or more in the other plugin take about 10 seconds to import with mine. Parts that don't follow the spec correctly and shortcut parts will import correctly in my plugin. I found that the other plugin has problems in this area. You're also able to create whole models and new parts with my plugin. I need to write up the instructions on how to do so, but I've got parts in the official library that were made with this plugin. RE: New Blender Importer/Exporter for Blender 2.82 - Jose Alfonso - 2021-03-01 (2020-08-05, 5:19)Matthew Morrison Wrote: Please install it and show me what you can do. I just discovered this add-on and I am very interested on the export part, but all my attempts end with an empty file (just the two bytes of an end of line). My tests have been with Blender meshes: the monkey and the ico sphere. Could you give some brief instructions? Compared with ImportLdraw I miss the options that position the camera, add an environment and put the model on a ground plane. That makes rendering easier for people with little knowledge of Blender, not my case. RE: New Blender Importer/Exporter for Blender 2.82 - Matthew Morrison - 2021-03-12 (2021-03-01, 23:22)Jose Alfonso Wrote: I just discovered this add-on and I am very interested on the export part, but all my attempts end with an empty file (just the two bytes of an end of line). My tests have been with Blender meshes: the monkey and the ico sphere. Could you give some brief instructions?I'll work on getting a tutorial out soon. RE: New Blender Importer/Exporter for Blender 2.82 - Matthew Morrison - 2021-03-29 I've added some exporting instructions to the Readme and some examples in the example folder. RE: New Blender Importer/Exporter for Blender 2.82 - Willy Tschager - 2021-03-29 (2021-03-29, 13:47)Matthew Morrison Wrote: I've added some exporting instructions to the Readme and some examples in the example folder. Matthew, it would be best creating a page at the LDraw wiki with an exhaustive tutorial and additionally send me a description for the Third Party Page. w. RE: New Blender Importer/Exporter for Blender 2.82 - Jose Alfonso - 2021-03-29 (2021-03-29, 13:47)Matthew Morrison Wrote: I've added some exporting instructions to the Readme and some examples in the example folder. Sorry, but your instructions are a little messy. It is not clear in which tabs the different customs properties must go, but I have figured from your example how to export an object without subparts and predefined colors: just adding the custom property ldraw_export_polygons=1 in Object tab. For me that covers most situations. Maybe the extension should create a panel in the Sidebar to add that custom properties in the right tabs. In the exported file there is no header, but I have seen one in the Text Editor in your example. I think the header should be added automatically by the exporter, not creating a text file in Blender. You just have to add two new fields in the Export Panel: Author and Description. I think those two and Filename are the essential data for a header. Keywords could also be a field, but I am not sure about History because is a multiline info. RE: New Blender Importer/Exporter for Blender 2.82 - Anderson - 2021-04-13 (2020-12-16, 15:30)Rob Frydryck Wrote: I guess the biggest advantage is that this exporter "exports" to a blender file (obviously), but the key difference is that the blender import plugin may only work for certain versions of Blender. So if the author does not keep up with the blender plugin it may not work in future Blender versions. So can this export a model as a .ldr file or only single parts and if it can what setup is required? I'm asking because the README file didn't seem to say how only that you could export but didn't say exactly what! I would appreciate any information you can provide me! RE: New Blender Importer/Exporter for Blender 2.82 - Jose Alfonso - 2021-04-14 (2021-04-13, 23:40)Anderson Wrote: So can this export a model as a .ldr file or only single parts and if it can what setup is required? I'm asking because the README file didn't seem to say how only that you could export but didn't say exactly what! I would appreciate any information you can provide me! Maybe you can find helpful the comment I made in this same thread (https://forums.ldraw.org/thread-24153-post-40723.html#pid40723) after looking at the example files. RE: New Blender Importer/Exporter for Blender 2.82 - Matthew Morrison - 2021-04-16 Thank you for your comments. I'm working qol changes like panels to speed things up. I just have to learn the API for it and get the time together to do it. I also plan on writing up much better instructions and recording a tutorial when I have the time. This plugin was originally a tool for just me so I welcome as much input as I can get. RE: New Blender Importer/Exporter for Blender 2.82 - Matthew Morrison - 2021-04-25 (2021-03-29, 19:03)Jose Alfonso Wrote: Sorry, but your instructions are a little messy. It is not clear in which tabs the different customs properties must go, but I have figured from your example how to export an object without subparts and predefined colors: just adding the custom property ldraw_export_polygons=1 in Object tab. For me that covers most situations. Maybe the extension should create a panel in the Sidebar to add that custom properties in the right tabs. I'll add that to the list! RE: New Blender Importer/Exporter for Blender 2.82 - KristyB - 2021-08-22 (2021-04-25, 23:51)Matthew Morrison Wrote: I'll add that to the list! Whenever I try to import the preferences dialog looks funy, the headers for each section show up, but no options( https://i.imgur.com/6EfLmRB.png When I go to actually import a ldraw.dat part I am met with the following error: Code: Python: Traceback (most recent call last): I looked around for a bug-tracker but could not find one, sorry if this is not the right place to post this. I have tested in both Blender 2.92 and 2.82, same results on Windows 10. RE: New Blender Importer/Exporter for Blender 2.82 - Matthew Morrison - 2021-08-23 (2021-08-22, 10:58)KristyB Wrote: Whenever I try to import the preferences dialog looks funy, the headers for each section show up, but no options( https://i.imgur.com/6EfLmRB.png I had a wayward comma that I've fixed. Please download the plugin again and replace the existing ExportLdraw plugin folder with the new files. RE: New Blender Importer/Exporter for Blender 2.82 - Matthew Morrison - 2021-08-23 I've updated the plugin to save your chosen import options. Next time you run your import, it will reuse the previously chosen options. If you run across any errors, delete config/import_options.json from the plugin folder. The defaults are saved on the next import. RE: New Blender Importer/Exporter for Blender 2.82 - Milan Vančura - 2021-11-09 Thank you, Matthew, for this piece of SW. It works surprisingly well - at least for import. (I did not try any export yet.) With import, I must say I was impressed: the plugin speed, the correct handling of unofficial parts, LDCAD hoses and strings working perfectly. And steps converted to the animation is a wonderful addition! Also submodels converted to Blender groups - great idea, it helps in some situations like with models containing buffer exchange commands, see below. As usually, you know them - users :-) - I also have two things which do not work as I expected: 1. BUFFER EXCHANGE commands aren't supported. Is it even possible in blender? 2. Trans Black color (and maybe other transparent colors than Trans Clear) is almost opaque. I tried to debug the issue and cannot see any reason for this: the ALPHA parameter of the color is read correctly, I even tried to set it to some very low value like 10 or 4. It makes some effect but even then the Trans Black window is very opaque, like if alpha=160, my estimation. It might be that I'm too green greenhorn in blender but I'd say all the scene and lights are correct - other models are rendered correctly. RE: New Blender Importer/Exporter for Blender 2.82 - Matthew Morrison - 2021-12-16 (2021-11-09, 0:23)Milan Vančura Wrote: Thank you, Matthew, for this piece of SW. It works surprisingly well - at least for import. (I did not try any export yet.) With import, I must say I was impressed: the plugin speed, the correct handling of unofficial parts, LDCAD hoses and strings working perfectly. And steps converted to the animation is a wonderful addition! Also submodels converted to Blender groups - great idea, it helps in some situations like with models containing buffer exchange commands, see below. I'm sorry for the huge delay in response. The alerts for ldraw forum posts go to my spam so I miss them. Thank you for the kind words. I put a lot of work into the things you mentioned and it's great knowing people benefit from that work. Can you post a screenshot of the colors issue you're having? It's possible you have an older version of the plugin that was darkening everything too much due to a math/logic error. The colors are now much brighter and more in line with what other tools show. I'll have to read more into buffer exchange. That's the first I've heard of it. RE: New Blender Importer/Exporter for Blender 2.82 - N. W. Perry - 2021-12-16 I look forward to trying my hand at modeling some new parts in Blender. I have a long-term goal of maybe doing some of the HO-scale vehicles from the 50s-60s; they are necessary to make complete models of some early official sets. RE: New Blender Importer/Exporter for Blender 2.82 - Matthew Morrison - 2021-12-17 (2021-12-16, 21:43)N. W. Perry Wrote: I look forward to trying my hand at modeling some new parts in Blender. I have a long-term goal of maybe doing some of the HO-scale vehicles from the 50s-60s; they are necessary to make complete models of some early official sets.Do you have any resources or specifications for those parts? That sounds like an interesting project. RE: New Blender Importer/Exporter for Blender 2.82 - N. W. Perry - 2021-12-17 (2021-12-17, 4:28)Matthew Morrison Wrote: Do you have any resources or specifications for those parts? That sounds like an interesting project. Only the numerous websites and Flickr accounts about vintage Lego, but you can get quite good photos of many of them. However, I'm also considering the idea of buying a few broken specimens (so that they're cheap, but also so that I can see how the subparts go together). RE: New Blender Importer/Exporter for Blender 2.82 - Milan Vančura - 2021-12-19 (2021-12-16, 20:06)Matthew Morrison Wrote: I'm sorry for the huge delay in response. The alerts for ldraw forum posts go to my spam so I miss them. Thank you for the reply, Matthew. To make thing easier, hopefully, I summarized the problem of transparent colors as a github project issue where I included render results and more details. About buffer exchange: it would be GREAT if you found a way how to support it in your plugin because it affects the completed model, too - not only the step-by-step animation. So every model using buffer exchange is rendered incorrectly with all those submodels visible,even some of them should be hidden. RE: New Blender Importer/Exporter for Blender 2.82 - Matthew Morrison - 2021-12-20 (2021-12-19, 22:18)Milan Vančura Wrote: Thank you for the reply, Matthew. To make thing easier, hopefully, I summarized the problem of transparent colors as a github project issue where I included render results and more details. I'm looking into the material. The difference between Eevee and Cycles is very noticeable. Are you willing to share a file with an example of buffer exchange? It will help with implementation. RE: New Blender Importer/Exporter for Blender 2.82 - N. W. Perry - 2021-12-20 (2021-12-19, 22:18)Milan Vančura Wrote: About buffer exchange: it would be GREAT if you found a way how to support it in your plugin because it affects the completed model, too - not only the step-by-step animation. So every model using buffer exchange is rendered incorrectly with all those submodels visible,even some of them should be hidden. Biggest drawback with buffer exchange, if you haven't heard me say it before. ;-) Because it writes multiple type 1 lines for the same part(s) in a model, so pretty much any editor or other utility that deals with models needs to be adapted to support it. RE: New Blender Importer/Exporter for Blender 2.82 - Milan Vančura - 2021-12-21 (2021-12-20, 0:55)Matthew Morrison Wrote: I'm looking into the material. The difference between Eevee and Cycles is very noticeable. Thank you for your help with materials, Matthew. The result is impressive - as I already told you on github. I added new issue for buffer exchange command support, with a link to LPub3D page with ideas and with my file as an example. RE: New Blender Importer/Exporter for Blender 2.82 - Steffen - 2022-01-16 It would be much more helpful for everybody if you would model the missing parts in LDRAW and add them to our library instead of just doing them in Blender. RE: New Blender Importer/Exporter for Blender 2.82 - Fredrik Hareide - 2022-02-23 Hi Matthew, I was looking into a way of exporting Ldraw models from Blender and found your plugin. It works very well and has some great ideas. Anyway I have started working on a different version that only works for parts and subparts. This will be a batch exporter and will be a panel in Blender. So basically I want an importer and exporter that is as non-destructive as possible. Keeping the headers and all references intact. I also want it to be able to export with subfile references and also "protecting" parts from official and unoffical libraries. So this will not be the same as you plugin, but a different version that might be useful for parts authoring. My first mission is to be able to make patterns with it. I have not made anything available online yet and I first wanted to give you a heads up about it. I hope it's ok that I borrow your code for this. I will of course give you credit for it. I also wanted to know if you would be willing to help me understand your code better so this could become as good a plugin as possible. And hopefully serve the Ldraw community with yet another tool to do parts. Best regards, Fredrik RE: New Blender Importer/Exporter for Blender 2.82 - Matthew Morrison - 2022-03-04 (2022-02-23, 10:02)Fredrik Hareide Wrote: Hi Matthew, I'm happy to know I've inspired you! I can't wait to see what you come up with. RE: New Blender Importer/Exporter for Blender 2.82 - HaNNoveraNer - 2022-03-12 Hi where can I download a zip file? P.S. I found it under CODE. There is not the Source code but the ZIP Download. Regards Thomas RE: New Blender Importer/Exporter for Blender 2.82 - Matthew Morrison - 2022-03-13 (2022-03-12, 8:48)HaNNoveraNer Wrote: Hi I've added a Releases link to the right for the future. My most recent update includes BFC support, Stud.io decal support, and various bugfixes. Decal support is not fully implemented, but works for most applications. Please, check it out! RE: New Blender Importer/Exporter for Blender 2.82 - Cam's Bricks - 2022-04-26 Just found this plug in and installed it in the latest Blender 3.1 but I am not getting any geometry on import. Do I need to install 2.83 to get this to work? RE: New Blender Importer/Exporter for Blender 2.82 - Fredrik Hareide - 2022-04-26 (2022-04-26, 12:40)Cam's Bricks Wrote: Just found this plug in and installed it in the latest Blender 3.1 but I am not getting any geometry on import. You probably forgot to add the ldraw_export_polygons = 1 property to your geometry. He requires that to export anything. You can read more under "exporting" in the readme on github https://github.com/cuddlyogre/ExportLDraw RE: New Blender Importer/Exporter for Blender 2.82 - Matthew Morrison - 2022-04-26 Cam's BricksJust found this plug in and installed it in the latest Blender 3.1 but I am not getting any geometry on import. [quote pid="45923" dateline="1650976826"] Do I need to install 2.83 to get this to work? [/quote] That usually means it can't find the ldraw folder. I'm still working on a good way to warn the user when it can't be found. Make sure the ldraw path is correct in the import screen. If you are still having trouble, click "Window > Toggle System Console" and tell me what it says in there. RE: New Blender Importer/Exporter for Blender 2.82 - Cam's Bricks - 2022-04-26 (2022-04-26, 13:17)Matthew Morrison Wrote: That usually means it can't find the ldraw folder. I'm still working on a good way to warn the user when it can't be found. OK I got it loaded. I only had my complete.zip in my parts folder so unpacking that worked. How do I add other custom parts? I have the official and the unofficial but I have an additional library of custom parts for my models. Is there support to set a list of library locations? Also does the ldrawunf need to be in the ldraw folder to work? ie \ldraw\ldrawunf or will it recognize in the same top level folder. RE: New Blender Importer/Exporter for Blender 2.82 - Matthew Morrison - 2022-04-26 (2022-04-26, 13:28)Cam's Bricks Wrote: OK I got it loaded. I only had my complete.zip in my parts folder so unpacking that worked. Good to hear you got it working. The LDConfig file has to be in the root of the ldraw folder. The unofficial library has to be in a folder named "Unofficial" in the ldraw root using the same directory structure as the official library. I hadn't considered multiple library locations. I would have to figure out an interface for that, but it's not technically impossible. RE: New Blender Importer/Exporter for Blender 2.82 - Cam's Bricks - 2022-04-26 (2022-04-26, 14:43)Matthew Morrison Wrote: Good to hear you got it working. Would it be possible to just have a text file that could be added for additional library locations. "additional_library.txt" then each line is a new location. When you same same structure it has subfolders "p" and "parts"? Would that also be the same for additional libraries? I can work with all these little things just want to help if I can. As an aside, anyone have a suggestion for how to light a scene? I am getting over exposed colors when I try so I am sure I am doing something wrong. RE: New Blender Importer/Exporter for Blender 2.82 - Matthew Morrison - 2022-04-26 (2022-04-26, 15:00)Cam's Bricks Wrote: Would it be possible to just have a text file that could be added for additional library locations. "additional_library.txt" then each line is a new location. >>Would it be possible to just have a text file that could be added for additional library locations. "additional_library.txt" then each line is a new location. Certainly. >>When you same same structure it has subfolders "p" and "parts"? Correct. >>Would that also be the same for additional libraries? I can work with all these little things just want to help if I can. At import, just set the ldraw folder value to whichever library you want to use. You can even import multiple times in the same project from different ldraw paths. >>As an aside, anyone have a suggestion for how to light a scene? I am getting over exposed colors when I try so I am sure I am doing something wrong. Would you mind sharing a screenshot? RE: New Blender Importer/Exporter for Blender 2.82 - Cam's Bricks - 2022-04-26 (2022-04-26, 16:15)Matthew Morrison Wrote: >>Would it be possible to just have a text file that could be added for additional library locations. "additional_library.txt" then each line is a new location. I talk about some of what I did here: https://forums.ldraw.org/thread-23926-post-45835.html#pid45835 I also have this render in cycles that was done based on the settings in the last render of that post: Then using a similar light setup I get this using your default materials except changing the spectra to 0.25. I will see about getting some different models that I can share the blender files for soon. RE: New Blender Importer/Exporter for Blender 2.82 - Sam Potter - 2022-05-13 cant export get this error (v2022-04-01-00) Python: KeyError: 'bpy_prop_collection.get(key, ...): key must be a string or tuple, not NoneType' The above exception was the direct cause of the following exception: Traceback (most recent call last): File "C:\Users\*\AppData\Roaming\Blender Foundation\Blender\3.1\scripts\addons\ExportLDraw-2022-04-01-00\operator_export.py", line 124, in execute ldraw_export.do_export(bpy.path.abspath(self.filepath)) File "C:\Users\*\AppData\Roaming\Blender Foundation\Blender\3.1\scripts\addons\ExportLDraw-2022-04-01-00\ldraw_export.py", line 49, in do_export text = bpy.data.texts.get(filename) SystemError: <built-in method get of bpy_prop_collection object at 0x00000252AC2A6970> returned a result with an exception set location: <unknown location>:-1 RE: New Blender Importer/Exporter for Blender 2.82 - Matthew Morrison - 2022-05-14 (2022-05-13, 3:57)Sam Potter Wrote: cant export get this error (v2022-04-01-00) Are you able to share the file you are getting this error with? RE: New Blender Importer/Exporter for Blender 2.82 - Sam Potter - 2022-05-19 (2022-05-14, 20:31)Matthew Morrison Wrote: Are you able to share the file you are getting this error with?try exporting the cube, error. try exporting the Lego part (which I imported with the addon) nothing export. another bug, the import scale doesn't work, no matter the number, it import at scale "0.020" (fyi if trying to scale to real life, set scale to "0.0004" ). fyi version 2022-03-18-02 works p.s can you add a "Custom Properties" with the "PartDescription", for imported parts thanks for this addon RE: New Blender Importer/Exporter for Blender 2.82 - Francesca Casaretti - 2022-07-29 (2022-05-13, 3:57)Sam Potter Wrote: cant export get this error (v2022-04-01-00) Hi, I am having the same problem. It gives me the same error with any file I try to export RE: New Blender Importer/Exporter for Blender 2.82 - Matthew Morrison - 2022-07-29 (2022-07-29, 17:22)Francesca Casaretti Wrote: Hi, I am having the same problem. It gives me the same error with any file I try to export Hello! Sorry again for the delay. I don't reliably get thread notifications. I have pushed a new release. Please let me know if it fixes the problems you are having. https://github.com/cuddlyogre/ExportLDraw/releases/tag/2022-07-29-00 RE: New Blender Importer/Exporter for Blender 2.82 - Jose Alfonso - 2022-07-29 The error is the same with the last version, at line 49 in ldraw_export.py. It happens when no custom property is defined (ldraw_filename, ldraw_export_polygons...). When I create the custom property ldraw_export_polygons as integer 1 in the Objet tab, the error disappears but no file is exported. Next try: I create the custom property ldraw_filename, I asign the value "partname.dat", for example, and I also create in Scripting workspace a new file with that name and no content. Then the part is exported successfully. I thought that ldraw_export_polygons=1 meant ldraw_filename is not required. Instead changing ldraw_export_polygons to 0 makes the error reappear when ldraw_filename and the file in Scripting are missing. This behaviour is expected. RE: New Blender Importer/Exporter for Blender 2.82 - Matthew Morrison - 2022-07-30 (2022-07-29, 21:36)Jose Alfonso Wrote: The error is the same with the last version, at line 49 in ldraw_export.py. It happens when no custom property is defined (ldraw_filename, ldraw_export_polygons...). When I create the custom property ldraw_export_polygons as integer 1 in the Objet tab, the error disappears but no file is exported. Next try: I create the custom property ldraw_filename, I asign the value "partname.dat", for example, and I also create in Scripting workspace a new file with that name and no content. Then the part is exported successfully. That is odd. I'll take a look this weekend and see if I can fix it. |