diff options
| author | Ben Marsh <[email protected]> | 2019-10-22 09:07:59 -0400 |
|---|---|---|
| committer | Ben Marsh <[email protected]> | 2019-10-22 09:07:59 -0400 |
| commit | bd0027e737c6512397f841c22786274ed74b927f (patch) | |
| tree | f7ffbdb8f3741bb7f24635616cc189cba5cb865c /mayaPlug/shaveBrushCtx.cpp | |
| download | archived-shave-and-a-haircut-bd0027e737c6512397f841c22786274ed74b927f.tar.xz archived-shave-and-a-haircut-bd0027e737c6512397f841c22786274ed74b927f.zip | |
Adding Shave-and-a-Haircut 9.6
Diffstat (limited to 'mayaPlug/shaveBrushCtx.cpp')
| -rw-r--r-- | mayaPlug/shaveBrushCtx.cpp | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/mayaPlug/shaveBrushCtx.cpp b/mayaPlug/shaveBrushCtx.cpp new file mode 100644 index 0000000..7dc4518 --- /dev/null +++ b/mayaPlug/shaveBrushCtx.cpp @@ -0,0 +1,62 @@ +// Shave and a Haircut +// (c) 2019 Epic Games +// US Patent 6720962 + +#include <iostream> +using namespace std; + +#include <maya/MPxContext.h> +#include <maya/MString.h> + +#include "shaveBrushCtx.h" +#include "shaveSDK.h" + +const MString shaveBrushCtx::mCtxTypeName = "shaveBrush"; + + +shaveBrushCtx::shaveBrushCtx() +: mBrushMode(kBrushTranslate) +{ + setTitleString("Shave Brush Tool"); + setImage("shaveBrush.xpm", MPxContext::kImage1); +} + + +shaveBrushCtx::~shaveBrushCtx() +{ +} + + +MStatus shaveBrushCtx::strokeBegin( + VERT& eyePoint, VERT& viewDir, VERT& upDir, VERT& screenPos, VERT& worldPos +) +{ + SHAVEsculpt_setup( + mBrushMode, + eyePoint, + viewDir, + upDir, + screenPos, + worldPos + ); + + return MS::kSuccess; +} + + +MStatus shaveBrushCtx::strokeDrag( + VERT& screenPos, VERT& worldPos, VERT& screenDelta, VERT& worldDelta +) +{ + SHAVEsculpt_iterate(screenPos, worldPos, screenDelta, worldDelta); + + return MS::kSuccess; +} + + +MStatus shaveBrushCtx::strokeEnd() +{ + SHAVEsculpt_finish(); + + return MS::kSuccess; +} |