Explorar el Código

Merge branch 'fbx_convert_to_unit' of https://github.com/assimp/assimp into fbx_convert_to_unit

Kim Kulling hace 6 años
padre
commit
e1a0861556
Se han modificado 1 ficheros con 8 adiciones y 0 borrados
  1. 8 0
      code/FBXConverter.cpp

+ 8 - 0
code/FBXConverter.cpp

@@ -67,6 +67,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #include <sstream>
 #include <sstream>
 #include <iomanip>
 #include <iomanip>
 
 
+
 namespace Assimp {
 namespace Assimp {
     namespace FBX {
     namespace FBX {
 
 
@@ -1600,6 +1601,13 @@ namespace Assimp {
                 out_mat->AddProperty(&str, AI_MATKEY_NAME);
                 out_mat->AddProperty(&str, AI_MATKEY_NAME);
             }
             }
 
 
+            // Set the shading mode as best we can: The FBX specification only mentions Lambert and Phong, and only Phong is mentioned in Assimp's aiShadingMode enum.
+            if (material.GetShadingModel() == "phong")
+            {
+                aiShadingMode shadingMode = aiShadingMode_Phong;
+                out_mat->AddProperty<aiShadingMode>(&shadingMode, 1, AI_MATKEY_SHADING_MODEL);               
+            }
+
             // shading stuff and colors
             // shading stuff and colors
             SetShadingPropertiesCommon(out_mat, props);
             SetShadingPropertiesCommon(out_mat, props);
             SetShadingPropertiesRaw( out_mat, props, material.Textures(), mesh );
             SetShadingPropertiesRaw( out_mat, props, material.Textures(), mesh );