Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to load material or texture from js file of model without having any images? #2560

Closed
arunondeck opened this issue Oct 25, 2012 · 1 comment

Comments

@arunondeck
Copy link

Hi,

I used the blender threejs export and exported to js a model file. Upon loading however I am unable to set the material directly from it. I checked and found the "mapDiffuse" attribute missing. Is that an error? If so is there any other way to load the material from the js file?

P.S This was a collada model i downloaded, so texture images were provided with it, though blendor did not notice it.

A part of my js file is below:

"metadata" :
{
    "formatVersion" : 3.1,
    "generatedBy"   : "Blender 2.64 Exporter",
    "vertices"      : 1172,
    "faces"         : 2209,
    "normals"       : 736,
    "colors"        : 0,
    "uvs"           : [1722],
    "materials"     : 1,
    "morphTargets"  : 0,
    "bones"         : 0
},

"scale" : 1.000000,

"materials" : [ {
    "DbgColor" : 15658734,
    "DbgIndex" : 0,
    "DbgName" : "material_2_81_0",
    "blending" : "NormalBlending",
    "colorAmbient" : [0.6400000190734865, 0.6400000190734865, 0.6400000190734865],
    "colorDiffuse" : [0.6400000190734865, 0.6400000190734865, 0.6400000190734865],
    "colorSpecular" : [0.5, 0.5, 0.5],
    "depthTest" : true,
    "depthWrite" : true,
    "shading" : "Lambert",
    "specularCoef" : 50,
    "transparency" : 1.0,
    "transparent" : false,
    "vertexColors" : false
},
.
.
.
.
.

"vertices" : [1159.45,531.608,-1808.68,......]
"morphTargets" : [],
"normals" : [-0.101077,0,-0.994873,......]
"colors" : [],
"uvs" : [[0,0,1,0,0,1,....]
"faces" : [42,0,1,2,0,0,1,2,0,1,2,42,0...]

"bones" : [],

"skinIndices" : [],

"skinWeights" : [],

"animation" : {}
}
@mrdoob
Copy link
Owner

mrdoob commented Oct 25, 2012

#1979

@mrdoob mrdoob closed this as completed Oct 25, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants