|
@@ -46,10 +46,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
// no #ifdefing here, Cinema4D support is carried out in a branch of assimp
|
|
|
// where it is turned on in the CMake settings.
|
|
|
|
|
|
-#ifndef _MSC_VER
|
|
|
-# error C4D support is currently MSVC only
|
|
|
-#endif
|
|
|
-
|
|
|
#include "C4DImporter.h"
|
|
|
#include <memory>
|
|
|
#include <assimp/IOSystem.hpp>
|
|
@@ -111,7 +107,7 @@ C4DImporter::C4DImporter() = default;
|
|
|
C4DImporter::~C4DImporter() = default;
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
-bool C4DImporter::CanRead( const std::string& pFile, IOSystem* /*pIOHandler*/, bool /*checkSig*/) const {
|
|
|
+bool C4DImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool checkSig) const {
|
|
|
const std::string& extension = GetExtension(pFile);
|
|
|
if (extension == "c4d") {
|
|
|
return true;
|
|
@@ -305,7 +301,7 @@ void C4DImporter::RecurseHierarchy(BaseObject* object, aiNode* parent) {
|
|
|
|
|
|
// based on Cineware sample code
|
|
|
while (object) {
|
|
|
- const LONG type = object->GetType();
|
|
|
+ const Int32 type = object->GetType();
|
|
|
const Matrix& ml = object->GetMl();
|
|
|
|
|
|
aiNode* const nd = new aiNode();
|
|
@@ -368,8 +364,8 @@ aiMesh* C4DImporter::ReadMesh(BaseObject* object) {
|
|
|
PolygonObject* const polyObject = dynamic_cast<PolygonObject*>(object);
|
|
|
ai_assert(polyObject != nullptr);
|
|
|
|
|
|
- const LONG pointCount = polyObject->GetPointCount();
|
|
|
- const LONG polyCount = polyObject->GetPolygonCount();
|
|
|
+ const Int32 pointCount = polyObject->GetPointCount();
|
|
|
+ const Int32 polyCount = polyObject->GetPolygonCount();
|
|
|
if(!polyObject || !pointCount) {
|
|
|
LogWarn("ignoring mesh with zero vertices or faces");
|
|
|
return nullptr;
|
|
@@ -391,7 +387,7 @@ aiMesh* C4DImporter::ReadMesh(BaseObject* object) {
|
|
|
unsigned int vcount = 0;
|
|
|
|
|
|
// first count vertices
|
|
|
- for (LONG i = 0; i < polyCount; i++)
|
|
|
+ for (Int32 i = 0; i < polyCount; i++)
|
|
|
{
|
|
|
vcount += 3;
|
|
|
|
|
@@ -434,7 +430,7 @@ aiMesh* C4DImporter::ReadMesh(BaseObject* object) {
|
|
|
}
|
|
|
|
|
|
// copy vertices and extra channels over and populate faces
|
|
|
- for (LONG i = 0; i < polyCount; ++i, ++face) {
|
|
|
+ for (Int32 i = 0; i < polyCount; ++i, ++face) {
|
|
|
ai_assert(polys[i].a < pointCount && polys[i].a >= 0);
|
|
|
const Vector& pointA = points[polys[i].a];
|
|
|
verts->x = pointA.x;
|
|
@@ -511,7 +507,7 @@ aiMesh* C4DImporter::ReadMesh(BaseObject* object) {
|
|
|
if (tangents_src) {
|
|
|
|
|
|
for(unsigned int k = 0; k < face->mNumIndices; ++k) {
|
|
|
- LONG l;
|
|
|
+ Int32 l;
|
|
|
switch(k) {
|
|
|
case 0:
|
|
|
l = polys[i].a;
|