Ghostkeeper / Blender3mfFormat

Blender add-on to import/export 3MF files
GNU General Public License v2.0
202 stars 25 forks source link

Diffuse texture maps not supported on Import or Export #31

Open mattby opened 3 years ago

mattby commented 3 years ago

This plug-in would be a lot more useful if it could import/export (diffuse) texture maps. (Suggestion: the implementation of obj import/export of texture maps and uv's is pretty easy to follow.)

One of many example test files from 3MF consortium's test suite: https://github.com/3MFConsortium/test_suites/blob/master/suite2_core_prod_matl/positive_test_cases/P_XPM_0104_01.3mf

This would require support for the materials extension, so this is more of a feature request than a bug: <model ... xmlns:m="http://schemas.microsoft.com/3dmanufacturing/material/2015/02" ... > This is pretty easy to add with ElementTree which you're using.

and texture2d: <m:texture2d ...>

and texture2dgroup: <m:texture2dgroup ...> There is a 1:1 mapping to the OBJ uv's in texture2dgroup if you're following the obj implementation.

Ghostkeeper commented 3 years ago

In my opinion, the use case for the Materials & Properties extension is pretty slim for the purpose of 3D manufacturing. There are very few full-colour 3D printers out there, and those that are do not use 3MF as interchange format. That's why it was left out of scope for this version explicitly. It already took several months to get to this point.

This feature request is asking for the implementation of a whole new spec, which is just about as lengthy as the core spec itself. I don't think it needs a whole new 400 commits but if the architecture is to be set up okay (read: not all in import_3mf.py) then it's certainly going to take a few months again to implement. I will most likely create feature tickets for the individual features of the spec rather than the whole spec at once. But first I'd need to figure out what features it would need (and I need to maintain other projects at the moment).

mattby commented 3 years ago

I think this is really great add-on, thanks for doing it. By the way, I'm pretty sure the HP JetFusion 580 is full-color and uses 3MF.

I don't think the whole extension is equally important for 3D printing and could be prioritized into individual features like you say. Chapter 7 (display properties) is screen only, not for printing, and is a big chunk of the spec. Chapter 4 (composite materials) isn't supported well by any 3d printers to my knowledge. Chapter 5 (multiproperties) is interesting with layered textures/color, but I think it would be difficult to integrate this into Blender for display (it isn't well supported in most other software for the same reason). Chapter 1 is just reference. That leaves chapters 2 (colorgroup/color, aka vertex/triangle color), 3 (texture uv maps, like “vt” in obj files), and 6 (texture images and wrap styles).

So in a nutshell, the important parts are: diffuse-texture-mapping (3 & 6) triangle/vertex color (chapter 2) If I had a wish for order, it would be diffuse-texture-mapping first (3 & 6), followed by triangle/vertex color (2), then the rest at much lower priority.

calvin-young commented 2 years ago

As a regular user of the HP JetFusion 580, I would very much love to see color support for this addon! Blender, in general, is poised to be the perfect software for prepping 3D printing files--and this extension would go a long way towards that.

pgrandin commented 2 years ago

The ability to import 3MF files with materials or appearances would make this plugin the perfect bridge between SolidWorks and Blender.

Screenshot 2021-12-02 144352

In this example, all of the parts have the proper material (plastics, metals, etc) assigned and the appearance is correct. But after being imported in Blender all of that is lost.

Screenshot 2021-12-02 144648

gravit22 commented 2 years ago

That would be great feature.