diff options
Diffstat (limited to 'mayaPlug/shaveNodeCmd.h')
| -rw-r--r-- | mayaPlug/shaveNodeCmd.h | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/mayaPlug/shaveNodeCmd.h b/mayaPlug/shaveNodeCmd.h new file mode 100644 index 0000000..abafa14 --- /dev/null +++ b/mayaPlug/shaveNodeCmd.h @@ -0,0 +1,84 @@ +#ifndef shaveNodeCmd_h +#define shaveNodeCmd_h + +// Shave and a Haircut +// (c) 2019 Epic Games +// US Patent 6720962 + +#include <maya/MArgList.h> +#include <maya/MPxCommand.h> +#include <maya/MSyntax.h> +#include <maya/MString.h> + +#if MAYA_API_VERSION < 20180000 +class MArgDatabase; +class MDagModifier; +class MDGModifier; +#endif + +class shaveHairShape; + + +class shaveNodeCmd : public MPxCommand +{ +public: + shaveNodeCmd(); + virtual ~shaveNodeCmd(); + + static MStatus copyInputConnections( + MDGModifier& dgMod, + MObject srcNode, + MObject destNode, + MObject attr + ); + + static void* createCmd(); + MStatus doIt( const MArgList& args ); + bool isUndoable() const; + static MSyntax createSyntax(); + + + static const MString commandName; + +private: + void displayInputConnection( + MObject node, MObject attr, MString indent + ); + + MStatus doEditFlags( + const MArgDatabase& args, shaveHairShape* nodePtr + ); + + MStatus doQueryFlags( + const MArgDatabase& args, shaveHairShape* nodePtr + ); + + // Fills 'curves' with dag paths for all of the curves passed to + // the command using the '-curve' flag. If any of the curves are + // invalid then 'curves' will be empty and MS::kInvalidParameter will + // be returned. + MStatus getCurves(const MArgDatabase& args, MDagPathArray& curves); + + MDagPath getParentTransform( + const MArgDatabase& args, MDagModifier& dm, MStatus& st + ); + + shaveHairShape* getShaveNode(const MArgDatabase& args); + + static MVector interpolate( + const MVector& p1, + const MVector& p2, + const MVector& p3, + const MVector& p4, + double u + ); + + MString stripNode(MString plugName); +}; + + +inline bool shaveNodeCmd::isUndoable() const +{ return false; } + +#endif + |