Ghostkeeper / Blender3mfFormat

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

Diffuse texture maps not supported on Import or Export #31

Open mattby opened 4 years ago

mattby commented 4 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 4 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 4 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 3 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 3 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.

ffli commented 5 days ago

Dose anyone have export the model with material in blender to 3mf type by this plugin?

mattby commented 5 days ago

I'm not sure I understand the question fully.

If you mean "has anyone exported a model with material in blender to 3mf using this plugin", I think the answer is no, as of 1.0.2 it doesn't support the 3mf materials extension.

If you are looking for 3mf materials test files, Jim's comprehensive suite is here on the official 3mf site: https://github.com/3MFConsortium/test_suites/tree/master/suite2_core_prod_matl

That said, I think several people have looked at modifiying the plugin to handle 3mf materials. One problem is that the 3mf materials spec has many features that would be difficult to represent in blender, particularly multiproperties. However, handling a subset of 3mf materials is doable, I've looked at it (and had some cases working on import and export) and I think @calvin-young has looked into it as well.

ffli commented 5 days ago

doable Thank you very much。I want to export the blender model with its material to a 3mf file. When i export the model with a material to a 3mf file, the result file only has mesh information, no material and color information.