-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathSeamsEasyCmd.h
100 lines (73 loc) · 2.5 KB
/
SeamsEasyCmd.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#pragma once
#include "SeamsEasyNode.h"
#include "SNode.h"
#include <maya/MPxCommand.h>
#include <maya/MDGModifier.h>
#include <maya/MDagModifier.h>
#include <maya/MDagPath.h>
#include <maya/MDistance.h>
#include <maya/MArgDatabase.h>
#include <maya/MPlugArray.h>
#include <map>
#define THICKNESS_FLAG_LONG "-thickness"
#define THICKNESS_FLAG "-th"
#define DIVISIONS_FLAG_LONG "-divisions"
#define DIVISIONS_FLAG "-div"
#define EXTRUDEALL_FLAG_LONG "-extrudeAllBoundaries"
#define EXTRUDEALL_FLAG "-eab"
#define GAP_FLAG_LONG "-gapWidth"
#define GAP_FLAG "-gw"
#define MODE_FLAG_LONG "-profileMode"
#define MODE_FLAG "-pm"
#define WIDTH_FLAG_LONG "-profileWidth"
#define WIDTH_FLAG "-pw"
#define DEPTH_FLAG_LONG "-profileDepth"
#define DEPTH_FLAG "-pd"
#define SUBDIVS_FLAG_LONG "-profileSubdivisions"
#define SUBDIVS_FLAG "-ps"
#define ADDLOOP_FLAG_LONG "-addLoop"
#define ADDLOOP_FLAG "-add"
#define SORT_FLAG_LONG "-sort"
#define SORT_FLAG "-srt"
#define DISTANCEMULTI_FLAG_LONG "-distanceMultiplier"
#define DISTANCEMULTI_FLAG "-dtm"
#define DEPTHMULTI_FLAG_LONG "-depthMultiplier"
#define DEPTHMULTI_FLAG "-dpm"
#define HARDEDGEANGLE_FLAG_LONG "-hardEdgeAngle"
#define HARDEDGEANGLE_FLAG "-hea"
class SeamsEasyCmd : public MPxCommand
{
public:
SeamsEasyCmd();
virtual ~SeamsEasyCmd();
static void* creator();
static MSyntax newSyntax();
virtual MStatus doIt(const MArgList& args);
virtual MStatus redoIt();
virtual MStatus undoIt();
virtual bool isUndoable() const { return true; }
MStatus queryAttrValue(MPlug& attrPlug);
MStatus setFlagAttr(MArgDatabase& argData, char *flag, MPlug& attrPlug);
private:
MDGModifier m_dgMod;
MDagModifier m_dagMod;
bool m_isCreation;
bool m_isDoIt = false;
MDagPath m_path;
MObject
m_intermediate,
m_node;
std::map <char*, MObject> m_attrFlags{
{ THICKNESS_FLAG, SeamsEasyNode::aExtrudeThickness },
{ DIVISIONS_FLAG, SeamsEasyNode::aExtrudeDivisions },
{ EXTRUDEALL_FLAG, SeamsEasyNode::aExtrudeAllBoundaries },
{ GAP_FLAG, SeamsEasyNode::aGap },
{ MODE_FLAG, SeamsEasyNode::aProfileMode },
{ WIDTH_FLAG,SeamsEasyNode::aProfileWidth },
{ DEPTH_FLAG, SeamsEasyNode::aProfileDepth },
{ SUBDIVS_FLAG, SeamsEasyNode::aProfileSubdivs },
{ DISTANCEMULTI_FLAG, SeamsEasyNode::aDistanceMultiplier },
{ DEPTHMULTI_FLAG, SeamsEasyNode::aDepthMultiplier },
{ HARDEDGEANGLE_FLAG, SeamsEasyNode::aHardEdgeAngle },
};
};