Load 3mf file by materials

i have a .3mf file
file have 3dmodel.model
in the 3dmodel.model file have <m:texture2d id=“3” path="/3D/Texture/CMC_LOGO_COLOR.png" contenttype=“image/png” tilestyleu=“wrap” tilestylev=“wrap” />

i loading .3mf file to my project by this code

 var loader2 = new ThreeMFLoader();
                loader2.load('./Pile.3mf', function (object) {
                    console.log(object);
                    object.quaternion.setFromEuler(new THREE.Euler(-Math.PI / 2, 0, 0));
                    object.traverse(function (child) {
                        if (child.isMesh) {
                            child.castShadow = true;
                            console.log(child);
                            scene.add(child);

                        }
                    });
                });

but the project don’t show texture2d or materials image

Can you please share the entire 3MF file with textures in this topic?

this is my 3mf

It looks like so when loading it with ThreeMFLoader:

Can you please also share the textures?

this is true
materials not load

<m:texture2d id=“3” path="/3D/Texture/CMC_LOGO_COLOR.png" contenttype=“image/png” tilestyleu=“wrap” tilestylev=“wrap” />

Sorry, I can’t debug the issue if you are unable to share the mentioned textures.

this is my code

var loader2 = new ThreeMFLoader();
            loader2.load('./Pile.3mf', function (object) {
                console.log(object);
                object.quaternion.setFromEuler(new THREE.Euler(-Math.PI / 2, 0, 0));
                object.traverse(function (child) {
                    if (child.isMesh) {
                        child.castShadow = true;
                        console.log(child);
                        scene.add(child);

                    }
                });
            });

and this is my 3mf file


the tree.js load my file like this image
9bbb391b2c16955ceec9670c6f1d4daeaf5ead4a_2_690x494

but must load like this image

In fact, the file cannot be read correctly

@Mugen87 the file loads correctly (with wood texture) in Paint 3D, so the texture is embedded.

However, the 3MFLoader doesn’t support textures:

@omid_amin_javaheri as a workaround you will need to load the texture separately to the model.

Do you have a solution that I can do individually?

You need to extract the wood texture file, or otherwise get a hold of it, and load it seperately to the 3mf file.

I’m not familiar with 3mf format so I can’t help you with that. Once you have the texture, if you need help loading it then ask here.

1 Like

Many thanks for this information! I was not aware that 3MF allows embedding textures.

That sounds like a good workaround to me.

I’ve reopen your issue at github and turn it into a feature request.

Some progress: