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
Petition to add VRayMtl support to 3D Max exporter #893
Comments
I don't have anymore access to 3ds max. If anybody else wants to step in and maintain the exporter, feel free to do so. If you don't need vertex colors, anyways it's better to export OBJ from max and then use OBJ converter. |
I think I dont have enough knowledge to do this task. I'm just doing my first 3D project but maybe I can ask someone to help me. I guess you first developed the
Well, for my project, I have some texturized models in 3DS Max that use V-Ray. When I export to http://forums.sketchucation.com/viewtopic.php?f=18&t=31702 ...I tryed passing models from Max to Blender with In theory, when you load an By the way, with "OBJ converter" you mean "OBJ importer" in Blender? Thank you so much! |
I just learned enough max script to create exporter, I didn't use it before or after. I found official help files better than anything on the web (you know these CHM files on Windows that have whole hypertext document embedded into single file, 3ds max has some where they describe max script).
Nope. I meant first use 3ds max built-in OBJ exporter (which is pretty good) and then use Python script https://github.com/mrdoob/three.js/blob/master/utils/exporters/convert_obj_three.py BTW if you have troubles with textures, you may need to hack MTL files manually, sometimes paths get mangled up somewhere in the pipeline (best is to keep it simple, texture files without any path in the same folder as model). |
I have tried script By the way, somewhere has to be mentioned that to run this script (and maybe all other Three.js Python scripts) you need Python 2.X branch because Python 3.X branch gives error for this script. Thank you so much! |
Well, I have just discovered that there was another source for my export problems (apart from V-Ray plugin usage): textures were not UV mapped ( I don't know how my friend applied them) To demonstrate this I have used a simple UV maped cube that I did in Blender by viewing a YouTube tutorial. So I...
Of course, my initial blender model was exported to Three.js with Blender exporter a lot of days ago. And I also rendered it successfully. Hope this helps somebody else! |
Today I have discovered that if you have face material texturing in 3DS Max like me and then you export to Before newmtl wire_096160231
Ns 32
d 1
Tr 0
Tf 1 1 1
illum 2
Ka 0.0000 0.0000 0.0000
Kd 0.3765 0.6275 0.4059
Ks 0.3500 0.3500 0.3500 After newmtl wire_096160231
Ns 32
d 1
Tr 0
Tf 1 1 1
illum 2
Ka 0.0000 0.0000 0.0000
Kd 0.3765 0.6275 0.4059
Ks 0.3500 0.3500 0.3500
map_Kd YOUR_TEXTURE.jpg Don't forget to use |
URL to convert_obj_three.py: https://github.com/mrdoob/three.js/blob/master/utils/converters/obj/convert_obj_three.py |
Hello, I've tried it with convert_obj_three.py, but in the end my CubeTest.js just looks like this: {
"metadata" :
{
"formatVersion" : 3.1,
"sourceFile" : "CubeTest.obj",
"generatedBy" : "OBJConverter",
"vertices" : 8,
"faces" : 6,
"normals" : 15,
"colors" : 0,
"uvs" : 4,
"materials" : 1
},
"scale" : 1000.000000,
"materials": [ {
"DbgColor" : 15658734,
"DbgIndex" : 0,
"DbgName" : "wire_229166215",
"colorAmbient" : [0.898039, 0.65098, 0.843137],
"colorDiffuse" : [0.898039, 0.65098, 0.843137],
"colorSpecular" : [0.35, 0.35, 0.35],
"illumination" : 2,
"specularCoef" : 32.0,
"transparency" : 0.0
}],
"vertices": [-1865,-2815,0,-1865,3004,0,2985,3004,0,2985,-2815,0,-502,-8036,2306,2985,-2815,4594,2985,3004,4594,-1865,3004,4594],
"morphTargets": [],
"morphColors": [],
"normals": [0,0,-1,-0.24516,-0.12184,0.9618,-0.54844,0,0.83619,-0.12537,-0.16317,0.9786,0,-0.2029,0.9792,0.52986,-0.63735,-0.5595,0,-1,0,0.47567,-0.72212,-0.50228,0.68086,-0.13984,-0.71894,1,0,0,0,1,0,-0.99135,-0.10632,0.076915,-0.8609,0,0.50878,-0.97784,-0.080329,0.19334,-0.99247,-0.12252,0],
"colors": [],
"uvs": [[1,0,1,1,0,1,0,0]],
"faces": [43,0,1,2,3,0,0,1,2,3,0,0,0,0,43,4,5,6,7,0,3,0,1,2,1,2,3,4,43,0,3,5,4,0,3,0,1,2,5,6,7,8,43,3,2,6,5,0,3,0,1,2,9,9,9,9,43,2,1,7,6,0,3,0,1,2,10,10,10,10,43,1,0,4,7,0,3,0,1,2,11,12,13,14]
} But this doesn't work. I used Python 2.7. What is wrong here? Best Regards Roman |
For future reference: function ExportMaterials zmaterials zcolors =
(
// ...
if classof mat != BooleanClass then
(
useVertexColors = zcolors[i]
Format "\"DbgName\" : \"%\",\n" mat.name to:ostream
if classof mat != VRayMtl then
(
DumpColor mat.diffuse "colorDiffuse"
DumpColor mat.ambient "colorAmbient"
DumpColor mat.specular "colorSpecular"
// etc...
)
else
(
DumpColor mat.diffuse "colorDiffuse"
// this is needed to get texture mapping
DumpMap mat.texmap_diffuse "mapDiffuse"
)
// ...
) Tested and works for me. |
After some checkings, I found out that my export problems described here in issue 823 (#823) are finally related to
VRay library
usage on my models.So I would like to ask Three.js developers if they have planned to add support for
VRay materials
?In the other hand, does anyone know if I can modify models in 3DS Max to use normal materials instead of VRay one's?
I guess that this would change the function
ExportMaterials
inThreeJSExporter.ms
like this:VRayMtl properties: http://www.cgplusplus.com/online-reference/vray-properties/source/vraymtl-properties.html
Another interisting link: http://www.jamesshaw.co.nz/blog/?p=137
Thx!
The text was updated successfully, but these errors were encountered: