-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathksUtils.h
52 lines (43 loc) · 1.15 KB
/
ksUtils.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
#ifndef INCLUDED_MAYAUTILS_H
#define INCLUDED_MAYAUTILS_H
#pragma once
#include <iostream>
#include <maya/MObject.h>
#include <maya/MStatus.h>
class MFloatArray;
class MString;
class MPlug;
class MDGModifier;
class MString;
class MItGeometry;
// Status Checking Macro - MReturnCheckStatus (Debugging tool)
#define MReturnCheckStatus(status,message) \
if( MS::kSuccess != status ) { \
cerr << message << "\n"; \
return status; \
}
#define MCheckStatus(status,message) \
if (MS::kSuccess != status) { \
cerr << message << " (" << status.errorString().asChar() << ")\n"; \
}
inline const MStatus& MReturnStatus(MStatus& ioStatus, const char* inErrorTxt=NULL)
{
if (inErrorTxt!=NULL)
ioStatus.perror(inErrorTxt);
return ioStatus;
}
inline const MStatus& MReturnSetFailure(MStatus& outStatus, const char* inErrorTxt=NULL)
{
outStatus = MStatus::kFailure;
if (inErrorTxt!=NULL)
outStatus.perror(inErrorTxt);
return outStatus;
}
inline MStatus MReturnFailure(const char* inErrorTxt=NULL)
{
MStatus status = MStatus::kFailure;
if (inErrorTxt!=NULL)
status.perror(inErrorTxt);
return status;
}
#endif