LDraw.org Discussion Forums
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


RE: New Blender Importer/Exporter for Blender 2.82 - Jose Alfonso - 2022-07-30

I forgot to say that I used Blender 3.2.1.


RE: New Blender Importer/Exporter for Blender 2.82 - Matthew Morrison - 2022-07-31

(2022-07-30, 8:03)Jose Alfonso Wrote: I forgot to say that I used Blender 3.2.1.

Try now. That python error was a logic error on my part. I've added an LDraw panel to simplify export. I will add more detailed instructions soon.

https://github.com/cuddlyogre/ExportLDraw/releases/tag/2022-07-31-00


RE: New Blender Importer/Exporter for Blender 2.82 - Jose Alfonso - 2022-08-01

(2022-07-31, 22:40)Matthew Morrison Wrote: Try now. That python error was a logic error on my part. I've added an LDraw panel to simplify export. I will add more detailed instructions soon.

https://github.com/cuddlyogre/ExportLDraw/releases/tag/2022-07-31-00

When I enable the new script:

Code:
addon_utils.disable: ExportLDraw-2022-07-31-00 not disabled
Modules Installed (ExportLDraw-2022-07-31-00) from 'C:\\Users\\JA\\Documents\\ExportLDraw-2022-07-31-00.zip' into 'C:\\Users\\JA\\AppData\\Roaming\\Blender Foundation\\Blender\\2.83\\scripts\\addons'
[Errno 2] No such file or directory: 'C:\\Users\\JA\\AppData\\Roaming\\Blender Foundation\\Blender\\2.83\\scripts\\addons\\ExportLDraw-2022-07-31-00\\config\\ImportOptions.json'
Traceback (most recent call last):
  File "C:\Program Files\blender-2.83\2.83\scripts\modules\addon_utils.py", line 351, in enable
    mod = __import__(module_name)
  File "C:\Users\JA\AppData\Roaming\Blender Foundation\Blender\2.83\scripts\addons\ExportLDraw-2022-07-31-00\__init__.py", line 56, in <module>
    _modules_loaded = [_namespace[name] for name in _modules]
  File "C:\Users\JA\AppData\Roaming\Blender Foundation\Blender\2.83\scripts\addons\ExportLDraw-2022-07-31-00\__init__.py", line 56, in <listcomp>
    _modules_loaded = [_namespace[name] for name in _modules]
KeyError: 'operator_panel_ldraw'



RE: New Blender Importer/Exporter for Blender 2.82 - Matthew Morrison - 2022-08-01

(2022-08-01, 8:31)Jose Alfonso Wrote: When I enable the new script:

Code:
addon_utils.disable: ExportLDraw-2022-07-31-00 not disabled
Modules Installed (ExportLDraw-2022-07-31-00) from 'C:\\Users\\JA\\Documents\\ExportLDraw-2022-07-31-00.zip' into 'C:\\Users\\JA\\AppData\\Roaming\\Blender Foundation\\Blender\\2.83\\scripts\\addons'
[Errno 2] No such file or directory: 'C:\\Users\\JA\\AppData\\Roaming\\Blender Foundation\\Blender\\2.83\\scripts\\addons\\ExportLDraw-2022-07-31-00\\config\\ImportOptions.json'
Traceback (most recent call last):
  File "C:\Program Files\blender-2.83\2.83\scripts\modules\addon_utils.py", line 351, in enable
    mod = __import__(module_name)
  File "C:\Users\JA\AppData\Roaming\Blender Foundation\Blender\2.83\scripts\addons\ExportLDraw-2022-07-31-00\__init__.py", line 56, in <module>
    _modules_loaded = [_namespace[name] for name in _modules]
  File "C:\Users\JA\AppData\Roaming\Blender Foundation\Blender\2.83\scripts\addons\ExportLDraw-2022-07-31-00\__init__.py", line 56, in <listcomp>
    _modules_loaded = [_namespace[name] for name in _modules]
KeyError: 'operator_panel_ldraw'

I accidentally pushed a release that was missing a file. Please download the most current release again and tell me if you are still getting the error.


RE: New Blender Importer/Exporter for Blender 2.82 - Jose Alfonso - 2022-08-01

(2022-08-01, 9:11)Matthew Morrison Wrote: I accidentally pushed a release that was missing a file. Please download the most current release again and tell me if you are still getting the error.

It works. Cool In the LDraw panel I have checked "Export polygons" to export a part. Blender system console still shows an error about "config\\ImportOptions.json". And when exporting it just says "list index out of range" before the text "Export complete".

I miss the lines type 2 and 5 in the exported part. For type 2 I will use the edges of two faces whose normals are more than 30º apart (same value as EdgeSplit Modifier). Type 5 would be the rest of the edges: the two first points are from the edge and the other two are the other vertex of the faces (triangle) or just choose between two (quadrilateral).


RE: New Blender Importer/Exporter for Blender 2.82 - Matthew Morrison - 2022-08-01

(2022-08-01, 16:01)Jose Alfonso Wrote: It works. Cool In the LDraw panel I have checked "Export polygons" to export a part. Blender system console still shows an error about "config\\ImportOptions.json". And when exporting it just says "list index out of range" before the text "Export complete".

I miss the lines type 2 and 5 in the exported part. For type 2 I will use the edges of two faces whose normals are more than 30º apart (same value as EdgeSplit Modifier). Type 5 would be the rest of the edges: the two first points are from the edge and the other two are the other vertex of the faces (triangle) or just choose between two (quadrilateral).

If you mark an edge sharp, it will export as line type 2. I'll see if I can make it work automatically like you suggested.

There is no line type 5 handling at the moment, mostly because Blender doesn't have any good way to display them. I'll try what you suggested with them too.


RE: New Blender Importer/Exporter for Blender 2.82 - Ming Zhang - 2022-09-26

I export the monkey-head.blender, but the ldr file only have 140byte. Partdesigner can open the ldr file, but there's nothing in it.

please tell me where's wrong. thx


RE: New Blender Importer/Exporter for Blender 2.82 - Matthew Morrison - 2022-09-26

(2022-09-26, 15:53)Ming Zhang Wrote: I export the monkey-head.blender, but the ldr file only have 140byte. Partdesigner can open the ldr file, but there's nothing in it.

please tell me where's wrong. thx

It sounds like you’re not exporting as geometry. 

 Would you mind sharing the blend file you’re working with? Or share a screenshot of your export settings?


RE: New Blender Importer/Exporter for Blender 2.82 - willson - 2022-10-05

(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.

I thought that ldraw_export_polygons=1 meant ldraw_filename is not required. Huh 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.

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 - Matthew Morrison - 2022-10-05

(2022-10-05, 13:07)willson 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!

It’s possible to export ldr files and parts, but the workflow is a bit unrefined. I’ll put together a video explaining how to do common tasks and post a link here when it’s done.


RE: New Blender Importer/Exporter for Blender 2.82 - Sam Potter - 2023-02-09

when i try to export a imported ldraw file I get this error

Python: Traceback (most recent call last):
  File "C:\Users\*\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\ExportLDraw-2023-02-02\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.4\scripts\addons\ExportLDraw-2023-02-02\ldraw_export.py", line 54, in do_export
    ldraw_file.parse_header(hline)
AttributeError: 'LDrawFile' object has no attribute 'parse_header'


RE: New Blender Importer/Exporter for Blender 2.82 - Matthew Morrison - 2023-02-09

(2023-02-09, 4:38)Sam Potter Wrote: when i try to export a imported ldraw file I get this error

Python: Traceback (most recent call last):
  File "C:\Users\*\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\ExportLDraw-2023-02-02\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.4\scripts\addons\ExportLDraw-2023-02-02\ldraw_export.py", line 54, in do_export
    ldraw_file.parse_header(hline)
AttributeError: 'LDrawFile' object has no attribute 'parse_header'

I've pushed a fix. Please update to the newest version and let me know if it is still happening.

https://github.com/cuddlyogre/ExportLDraw/releases/tag/2023-02-09


RE: New Blender Importer/Exporter for Blender 2.82 - Sam Potter - 2023-02-10

(2023-02-09, 8:35)Matthew Morrison Wrote: I've pushed a fix. Please update to the newest version and let me know if it is still happening.

https://github.com/cuddlyogre/ExportLDraw/releases/tag/2023-02-09

thanks for the quick fix it works, but the orientation of the pieces don't stay


RE: New Blender Importer/Exporter for Blender 2.82 - Matthew Morrison - 2023-02-10

(2023-02-10, 4:17)Sam Potter Wrote: thanks for the quick fix it works, but the orientation of the pieces don't stay

Would you mind sharing the blend file file you are working with so that I can troubleshoot?


RE: New Blender Importer/Exporter for Blender 2.82 - Sam Potter - 2023-02-10

(2023-02-10, 7:11)Matthew Morrison Wrote: Would you mind sharing the blend file file you are working with so that I can troubleshoot?

thanks for your quick response. I dont think it's specific to any blend file but if you want here it is.

fyi, if the "Active Object" is a ldraw object it exports screwy


RE: New Blender Importer/Exporter for Blender 2.82 - Matthew Morrison - 2023-02-11

(2023-02-10, 7:59)Sam Potter Wrote: thanks for your quick response. I dont think it's specific to any blend file but if you want here it is.

fyi, if the "Active Object" is a ldraw object it exports screwy

Please try the new release.
https://github.com/cuddlyogre/ExportLDraw/releases/tag/2023-02-11-02

I'm going to write up a proper tutorial eventually, but here is a basic checklist for exporting.

Make sure all your objects are set to -90,0,0 rotation and color code is filled in in the LDraw panel.
In the LDraw panel, make sure your active object has all of its header lines filled in.
If Export polygons is not checked, make sure the filename is filled out for the object.


RE: New Blender Importer/Exporter for Blender 2.82 - Sam Potter - 2023-02-12

(2023-02-11, 3:04)Matthew Morrison Wrote: Please try the new release.
https://github.com/cuddlyogre/ExportLDraw/releases/tag/2023-02-11-02

I'm going to write up a proper tutorial eventually, but here is a basic checklist for exporting.

Make sure all your objects are set to -90,0,0 rotation and color code is filled in in the LDraw panel.
In the LDraw panel, make sure your active object has all of its header lines filled in.
If Export polygons is not checked, make sure the filename is filled out for the object.

it seems to be fixed. thanks a lot


RE: New Blender Importer/Exporter for Blender 2.82 - Matthew Morrison - 2023-02-13

(2023-02-12, 7:36)Sam Potter Wrote: it seems to be fixed. thanks a lot

Thank you for reporting the bug! This part of the plugin really benefited from it.


RE: New Blender Importer/Exporter for Blender 2.82 - Sam Potter - 2023-08-04

can you add the ability to export edges?