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
Mugen87
October 21, 2019, 12:32pm
2
Can you please share the entire 3MF file with textures in this topic?
Mugen87
October 21, 2019, 12:42pm
4
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” />
Mugen87
October 21, 2019, 12:58pm
6
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
but must load like this image
In fact, the file cannot be read correctly
looeee
October 22, 2019, 1:01am
8
@Mugen87 the file loads correctly (with wood texture) in Paint 3D, so the texture is embedded.
However, the 3MFLoader doesn’t support textures:
* @author Mugen87 / https://github.com/Mugen87
*
* 3D Manufacturing Format (3MF) specification: https://3mf.io/specification/
*
* The following features from the core specification are supported:
*
* - 3D Models
* - Object Resources (Meshes and Components)
* - Material Resources (Base Materials)
*
* 3MF Materials and Properties Extension (e.g. textures) are not yet supported.
*
*/
import {
BufferAttribute,
BufferGeometry,
FileLoader,
Group,
Loader,
LoaderUtils,
@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?
looeee
October 22, 2019, 8:44am
10
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
Mugen87
October 22, 2019, 9:05am
11
Many thanks for this information! I was not aware that 3MF allows embedding textures.
That sounds like a good workaround to me.
Mugen87
October 22, 2019, 9:41am
12
I’ve reopen your issue at github and turn it into a feature request.
opened 08:24AM - 21 Oct 19 UTC
closed 10:36AM - 28 Oct 19 UTC
Enhancement
Loaders
i load 3mf file
```js
var loader2 = new ThreeMFLoader();
con… sole.log(loader2);
loader2.load('./Pile.3mf', function (object) {
console.log(object.traverse);
object.quaternion.setFromEuler(new THREE.Euler(-Math.PI / 2, 0, 0));
//object.position.x = 0;
//object.position.y = -250;
//object.position.z = 0;
scene.add(object);
render();
});
```
don't show 3md color and image