diff --git a/makepanda/makepandacore.py b/makepanda/makepandacore.py index f738d8affa..76dec39406 100644 --- a/makepanda/makepandacore.py +++ b/makepanda/makepandacore.py @@ -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"), diff --git a/pandatool/src/maya/mayaShader.h b/pandatool/src/maya/mayaShader.h index 41c9bdf77f..34ff13a808 100644 --- a/pandatool/src/maya/mayaShader.h +++ b/pandatool/src/maya/mayaShader.h @@ -21,7 +21,6 @@ #include "lmatrix.h" #include "namable.h" -class MObject; /** * Corresponds to a single "shader" in Maya. This extracts out all the diff --git a/pandatool/src/maya/mayaShaderColorDef.cxx b/pandatool/src/maya/mayaShaderColorDef.cxx index 73d2978d7c..cbaa82d5b7 100644 --- a/pandatool/src/maya/mayaShaderColorDef.cxx +++ b/pandatool/src/maya/mayaShaderColorDef.cxx @@ -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 diff --git a/pandatool/src/maya/mayaShaderColorDef.h b/pandatool/src/maya/mayaShaderColorDef.h index ca2d532f13..2609f2bb43 100644 --- a/pandatool/src/maya/mayaShaderColorDef.h +++ b/pandatool/src/maya/mayaShaderColorDef.h @@ -21,8 +21,6 @@ #include "pmap.h" #include "pvector.h" -class MObject; -class MPlug; class MayaShader; class MayaShaderColorDef; typedef pvector MayaShaderColorList; diff --git a/pandatool/src/maya/mayaShaders.h b/pandatool/src/maya/mayaShaders.h index f1c107a755..5428ab5f73 100644 --- a/pandatool/src/maya/mayaShaders.h +++ b/pandatool/src/maya/mayaShaders.h @@ -21,7 +21,6 @@ #include "mayaShaderColorDef.h" class MayaShader; -class MObject; /** * Collects the set of MayaShaders that have been encountered so far. diff --git a/pandatool/src/maya/maya_funcs.h b/pandatool/src/maya/maya_funcs.h index 2966fef9e3..ad0a7210b3 100644 --- a/pandatool/src/maya/maya_funcs.h +++ b/pandatool/src/maya/maya_funcs.h @@ -28,7 +28,6 @@ #include #include "post_maya_include.h" -class MObject; bool get_maya_plug(MObject &node, const std::string &attribute_name, MPlug &plug); diff --git a/pandatool/src/maya/pre_maya_include.h b/pandatool/src/maya/pre_maya_include.h index 0244ec7ba4..85442c1e7b 100644 --- a/pandatool/src/maya/pre_maya_include.h +++ b/pandatool/src/maya/pre_maya_include.h @@ -43,4 +43,21 @@ #if MAYA_API_VERSION < 201600 #include #endif +#else +// This defines MAYA_API_VERSION +#include +#endif + +#if MAYA_API_VERSION >= 20180000 +#include +#else +class MObject; +class MDagPath; +class MFloatArray; +class MFnDagNode; +class MFnMesh; +class MFnNurbsCurve; +class MFnNurbsSurface; +class MPlug; +class MPointArray; #endif diff --git a/pandatool/src/mayaegg/mayaToEggConverter.cxx b/pandatool/src/mayaegg/mayaToEggConverter.cxx index 7943f07f03..747c8ac279 100644 --- a/pandatool/src/mayaegg/mayaToEggConverter.cxx +++ b/pandatool/src/mayaegg/mayaToEggConverter.cxx @@ -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); diff --git a/pandatool/src/mayaegg/mayaToEggConverter.h b/pandatool/src/mayaegg/mayaToEggConverter.h index 3e3782a601..c2266e0096 100644 --- a/pandatool/src/mayaegg/mayaToEggConverter.h +++ b/pandatool/src/mayaegg/mayaToEggConverter.h @@ -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. diff --git a/pandatool/src/mayaprogs/mayaCopy.cxx b/pandatool/src/mayaprogs/mayaCopy.cxx index 247e0b43ad..d10ed8e0aa 100644 --- a/pandatool/src/mayaprogs/mayaCopy.cxx +++ b/pandatool/src/mayaprogs/mayaCopy.cxx @@ -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 #include "post_maya_include.h" +#include "mayaShader.h" + using std::endl; using std::string; diff --git a/pandatool/src/mayaprogs/mayaCopy.h b/pandatool/src/mayaprogs/mayaCopy.h index 90ceddfbc0..38f0aef9de 100644 --- a/pandatool/src/mayaprogs/mayaCopy.h +++ b/pandatool/src/mayaprogs/mayaCopy.h @@ -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 +#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. diff --git a/pandatool/src/mayaprogs/mayapath.cxx b/pandatool/src/mayaprogs/mayapath.cxx index ae9ad39ac2..441a22c0e2 100644 --- a/pandatool/src/mayaprogs/mayapath.cxx +++ b/pandatool/src/mayaprogs/mayapath.cxx @@ -105,6 +105,7 @@ struct MayaVerInfo maya_versions[] = { { "MAYA2016", "2016"}, { "MAYA20165", "2016.5"}, { "MAYA2017", "2017"}, + { "MAYA2018", "2018"}, { 0, 0 }, };