Merge pull request #1820 from mesilliac/blender_fbx_opacity_fix
Fix default opacity of materials exported to FBX by Blender.pull/1823/head^2
commit
887f78bc36
|
@ -54,6 +54,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include "FBXProperties.h"
|
#include "FBXProperties.h"
|
||||||
#include <assimp/ByteSwapper.h>
|
#include <assimp/ByteSwapper.h>
|
||||||
|
|
||||||
|
#include <algorithm> // std::transform
|
||||||
|
|
||||||
namespace Assimp {
|
namespace Assimp {
|
||||||
namespace FBX {
|
namespace FBX {
|
||||||
|
|
||||||
|
@ -82,11 +84,12 @@ Material::Material(uint64_t id, const Element& element, const Document& doc, con
|
||||||
|
|
||||||
std::string templateName;
|
std::string templateName;
|
||||||
|
|
||||||
const char* const sh = shading.c_str();
|
// lower-case shading because Blender (for example) writes "Phong"
|
||||||
if(!strcmp(sh,"phong")) {
|
std::transform(shading.begin(), shading.end(), shading.begin(), ::tolower);
|
||||||
|
if(shading == "phong") {
|
||||||
templateName = "Material.FbxSurfacePhong";
|
templateName = "Material.FbxSurfacePhong";
|
||||||
}
|
}
|
||||||
else if(!strcmp(sh,"lambert")) {
|
else if(shading == "lambert") {
|
||||||
templateName = "Material.FbxSurfaceLambert";
|
templateName = "Material.FbxSurfaceLambert";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
Loading…
Reference in New Issue