Add support for Maya 2018

This commit is contained in:
rdb 2018-08-10 14:28:02 +02:00
parent 4ff619b75f
commit be19411cf8
12 changed files with 50 additions and 29 deletions

View File

@ -102,7 +102,8 @@ MAYAVERSIONINFO = [("MAYA6", "6.0"),
("MAYA2015","2015"),
("MAYA2016","2016"),
("MAYA20165","2016.5"),
("MAYA2017","2017")
("MAYA2017","2017"),
("MAYA2018","2018"),
]
MAXVERSIONINFO = [("MAX6", "SOFTWARE\\Autodesk\\3DSMAX\\6.0", "installdir", "maxsdk\\cssdk\\include"),

View File

@ -21,7 +21,6 @@
#include "lmatrix.h"
#include "namable.h"
class MObject;
/**
* Corresponds to a single "shader" in Maya. This extracts out all the

View File

@ -367,15 +367,17 @@ find_textures_legacy(MayaShader *shader, MObject color, bool trans) {
if (li > -1) {
// found a blend mode
if (maya_cat.is_spam()) {
MString name = inputsPlug.name();
maya_cat.spam() << "*** Start doIt... ***" << endl;
maya_cat.spam() << "inputsPlug Name: " << inputsPlug.name() << endl;
maya_cat.spam() << "inputsPlug Name: " << name.asChar() << endl;
}
status = blendModePlug.selectAncestorLogicalIndex(li,inputsPlug);
blendModePlug.getValue(blendValue);
if (maya_cat.is_spam()) {
MString name = blendModePlug.name();
maya_cat.spam()
<< blendModePlug.name() << ": has value " << blendValue << endl;
<< name.asChar() << ": has value " << blendValue << endl;
}
MFnEnumAttribute blendModeEnum(blendModePlug);
@ -397,9 +399,13 @@ find_textures_legacy(MayaShader *shader, MObject color, bool trans) {
bt = BT_add;
break;
}
maya_cat.info() << layered_fn.name() << ": blendMode used " << blendName << endl;
if (maya_cat.is_spam()) {
maya_cat.spam() << "*** END doIt... ***" << endl;
if (maya_cat.is_info()) {
MString name = layered_fn.name();
maya_cat.info() << name.asChar() << ": blendMode used " << blendName.asChar() << endl;
if (maya_cat.is_spam()) {
maya_cat.spam() << "*** END doIt... ***" << endl;
}
}
// advance to the next plug, because that is where the shader info are

View File

@ -21,8 +21,6 @@
#include "pmap.h"
#include "pvector.h"
class MObject;
class MPlug;
class MayaShader;
class MayaShaderColorDef;
typedef pvector<MayaShaderColorDef *> MayaShaderColorList;

View File

@ -21,7 +21,6 @@
#include "mayaShaderColorDef.h"
class MayaShader;
class MObject;
/**
* Collects the set of MayaShaders that have been encountered so far.

View File

@ -28,7 +28,6 @@
#include <maya/MVector.h>
#include "post_maya_include.h"
class MObject;
bool
get_maya_plug(MObject &node, const std::string &attribute_name, MPlug &plug);

View File

@ -43,4 +43,21 @@
#if MAYA_API_VERSION < 201600
#include <maya/OpenMayaMac.h>
#endif
#else
// This defines MAYA_API_VERSION
#include <maya/MTypes.h>
#endif
#if MAYA_API_VERSION >= 20180000
#include <maya/MApiNamespace.h>
#else
class MObject;
class MDagPath;
class MFloatArray;
class MFnDagNode;
class MFnMesh;
class MFnNurbsCurve;
class MFnNurbsSurface;
class MPlug;
class MPointArray;
#endif

View File

@ -838,12 +838,14 @@ process_model_node(MayaNodeDesc *node_desc) {
// Extract some interesting Camera data
if (mayaegg_cat.is_spam()) {
MPoint eyePoint = camera.eyePoint(MSpace::kWorld);
MVector upDirection = camera.upDirection(MSpace::kWorld);
MVector viewDirection = camera.viewDirection(MSpace::kWorld);
mayaegg_cat.spam() << " eyePoint: " << eyePoint.x << " "
<< eyePoint.y << " " << eyePoint.z << endl;
mayaegg_cat.spam() << " upDirection: "
<< camera.upDirection(MSpace::kWorld) << endl;
mayaegg_cat.spam() << " viewDirection: "
<< camera.viewDirection(MSpace::kWorld) << endl;
mayaegg_cat.spam() << " upDirection: " << upDirection.x << " "
<< upDirection.y << " " << upDirection.z << endl;
mayaegg_cat.spam() << " viewDirection: " << viewDirection.x << " "
<< viewDirection.y << " " << viewDirection.z << endl;
mayaegg_cat.spam() << " aspectRatio: " << camera.aspectRatio() << endl;
mayaegg_cat.spam() << " horizontalFilmAperture: "
<< camera.horizontalFilmAperture() << endl;
@ -922,9 +924,12 @@ process_model_node(MayaNodeDesc *node_desc) {
mayaegg_cat.error() << "light extraction failed" << endl;
return false;
}
mayaegg_cat.info() << "-- Light found -- tranlations in cm, rotations in rads\n";
mayaegg_cat.info() << "\"" << dag_path.partialPathName() << "\" : \n";
if (mayaegg_cat.is_info()) {
MString name = dag_path.partialPathName();
mayaegg_cat.info() << "-- Light found -- tranlations in cm, rotations in rads\n";
mayaegg_cat.info() << "\"" << name.asChar() << "\" : \n";
}
// Get the translationrotationscale data
MObject transformNode = dag_path.transform(&status);

View File

@ -42,15 +42,6 @@ class EggPrimitive;
class EggXfmSAnim;
class MayaShaderColorDef;
class MObject;
class MDagPath;
class MFnDagNode;
class MFnNurbsSurface;
class MFnNurbsCurve;
class MFnMesh;
class MPointArray;
class MFloatArray;
/**
* This class supervises the construction of an EggData structure from a
* single Maya file, or from the data already in the global Maya model space.

View File

@ -16,7 +16,6 @@
#include "mayaCopy.h"
#include "config_maya.h"
#include "cvsSourceDirectory.h"
#include "mayaShader.h"
#include "dcast.h"
#include "pre_maya_include.h"
@ -32,6 +31,8 @@
#include <maya/MIntArray.h>
#include "post_maya_include.h"
#include "mayaShader.h"
using std::endl;
using std::string;

View File

@ -17,15 +17,19 @@
#include "pandatoolbase.h"
#include "cvsCopy.h"
#include "mayaApi.h"
#include "mayaShaders.h"
#include "dSearchPath.h"
#include "pointerTo.h"
#include "pset.h"
#include "pre_maya_include.h"
#include <maya/MObject.h>
#include "post_maya_include.h"
#include "mayaShaders.h"
class MayaShader;
class MayaShaderColorDef;
class MDagPath;
/**
* A program to copy Maya .mb files into the cvs tree.

View File

@ -105,6 +105,7 @@ struct MayaVerInfo maya_versions[] = {
{ "MAYA2016", "2016"},
{ "MAYA20165", "2016.5"},
{ "MAYA2017", "2017"},
{ "MAYA2018", "2018"},
{ 0, 0 },
};