Repository: three.js
Issue: Feature suggestion: Support Maya's PBR material in FBXLoader
Labels: Enhancement,Loaders

PBR materials are exported to FBX from Maya using a proprietary extension ( `Maya|xxxx`). 

A couple of these were added in #15844 which was a good start but doesn't take into account the fact that the `Maya|` prefix in FBX denotes that it's a PBR material, which should be used to create a `MeshStandardMaterial`. 

According to this issue: https://github.com/assimp/assimp/issues/1504, this is a complete list of the materials that can be exported from Maya to FBX:

``` js
Material: 2967359479536, "Material::StingrayPBS2", "" {
		Version: 102
		ShadingModel: "unknown"
		MultiLayer: 0
		Properties70:  {
			P: "Maya", "Compound", "", ""
			P: "Maya|TypeId", "int", "Integer", "",1166017
			P: "Maya|TEX_global_diffuse_cube", "Vector3D", "Vector", "",0,0,0
			P: "Maya|TEX_global_specular_cube", "Vector3D", "Vector", "",0,0,0
			P: "Maya|TEX_brdf_lut", "Vector3D", "Vector", "",0,0,0
			P: "Maya|use_normal_map", "float", "", "",0
			P: "Maya|uv_offset", "Vector2D", "Vector2", "",0,0
			P: "Maya|uv_scale", "Vector2D", "Vector2", "",1,1
			P: "Maya|TEX_normal_map", "Vector3D", "Vector", "",0,0,0
			P: "Maya|use_color_map", "float", "", "",0
			P: "Maya|TEX_color_map", "Vector3D", "Vector", "",0,0,0
			P: "Maya|base_color", "Vector3D", "Vector", "",1,0,0
			P: "Maya|use_metallic_map", "float", "", "",0
			P: "Maya|TEX_metallic_map", "Vector3D", "Vector", "",0,0,0
			P: "Maya|metallic", "float", "", "",0
			P: "Maya|use_roughness_map", "float", "", "",0
			P: "Maya|TEX_roughness_map", "Vector3D", "Vector", "",0,0,0
			P: "Maya|roughness", "float", "", "",0.33
			P: "Maya|use_emissive_map", "float", "", "",0
			P: "Maya|TEX_emissive_map", "Vector3D", "Vector", "",0,0,0
			P: "Maya|emissive", "Vector3D", "Vector", "",0,0,0
			P: "Maya|emissive_intensity", "float", "", "",0
			P: "Maya|use_ao_map", "float", "", "",0
			P: "Maya|TEX_ao_map", "Vector3D", "Vector", "",0,0,0
		}
	}
	Material: 2967565876448, "Material::phong2", "" {
		Version: 102
		ShadingModel: "phong"
		MultiLayer: 0
		Properties70:  {
			P: "AmbientColor", "Color", "", "A",0,0,0
			P: "DiffuseColor", "Color", "", "A",1,0,0
			P: "DiffuseFactor", "Number", "", "A",0.800000011920929
			P: "TransparencyFactor", "Number", "", "A",1
			P: "SpecularColor", "Color", "", "A",0.5,0.5,0.5
			P: "ReflectionFactor", "Number", "", "A",0.5
			P: "Emissive", "Vector3D", "Vector", "",0,0,0
			P: "Ambient", "Vector3D", "Vector", "",0,0,0
			P: "Diffuse", "Vector3D", "Vector", "",0.800000011920929,0,0
			P: "Specular", "Vector3D", "Vector", "",0.5,0.5,0.5
			P: "Shininess", "double", "Number", "",20
			P: "Opacity", "double", "Number", "",1
			P: "Reflectivity", "double", "Number", "",0
		}
	}
	Material: 2967588203904, "Material::lambert2", "" {
		Version: 102
		ShadingModel: "lambert"
		MultiLayer: 0
		Properties70:  {
			P: "AmbientColor", "Color", "", "A",0,0,0
			P: "DiffuseColor", "Color", "", "A",1,0,0
			P: "DiffuseFactor", "Number", "", "A",0.800000011920929
			P: "TransparencyFactor", "Number", "", "A",1
			P: "Emissive", "Vector3D", "Vector", "",0,0,0
			P: "Ambient", "Vector3D", "Vector", "",0,0,0
			P: "Diffuse", "Vector3D", "Vector", "",0.800000011920929,0,0
			P: "Opacity", "double", "Number", "",1
		}
	}
```

Note: As far as I can see all PBR materials that are supported by the Maya FBX exporter use this extension, which is at least the Stingray and Arnold shaders.

I've come across a couple of mentions that other apps besides Maya may have also adopted the `maya|` extension for PBR materials, but I haven't verified this. However, 3D Max uses it's own proprietary extension, which should be trivial to add once we've set up Maya's extension. . 

Adding support for this will require some refactoring of the material system in the `FBXLoader`, but should be fairly straightforward. 

If nobody else takes this on, I'll get round to it... someday 😁  In the meantime I'm putting the information up here so that if somebody else needs this they it will be as easy as possible for them to implement.