forked from ahmidou/SpliceMaya
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathFabricSpliceMayaData.cpp
139 lines (113 loc) · 3.83 KB
/
FabricSpliceMayaData.cpp
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
#include "FabricSpliceMayaData.h"
#include <maya/MGlobal.h>
const MTypeId FabricSpliceMayaData::id( 0x0011AE45 );
const MString FabricSpliceMayaData::typeName( "FabricSpliceMayaData" );
MString MFnFabricSpliceMayaData::classNameString ("MFnFabricSpliceMayaData") ;
FabricSpliceMayaData::FabricSpliceMayaData(){
}
FabricSpliceMayaData::~FabricSpliceMayaData(){
}
MStatus FabricSpliceMayaData::readASCII( const MArgList & argList, unsigned & index ){
return MS::kSuccess;
}
MStatus FabricSpliceMayaData::readBinary( std::istream & in, unsigned length ){
return MS::kSuccess;
}
MStatus FabricSpliceMayaData::writeASCII( std::ostream & out ){
return MS::kSuccess;
}
MStatus FabricSpliceMayaData::writeBinary( std::ostream & out ){
return MS::kSuccess;
}
void FabricSpliceMayaData::copy ( const MPxData & other ){
FabricSpliceMayaData &otherSpliceData = ( FabricSpliceMayaData &)other;
mValue = otherSpliceData.mValue;
}
MTypeId FabricSpliceMayaData::typeId() const{
return id;
}
MString FabricSpliceMayaData::name() const{
return typeName;
}
void * FabricSpliceMayaData::creator(){
return new FabricSpliceMayaData();
}
void FabricSpliceMayaData::setRTVal(const FabricCore::RTVal &value){
mValue = value;
}
FabricCore::RTVal FabricSpliceMayaData::getRTVal() const{
return mValue;
}
MFnFabricSpliceMayaData::MFnFabricSpliceMayaData (){
}
MFnFabricSpliceMayaData::MFnFabricSpliceMayaData (MObject &object, MStatus *ReturnStatus) : MFnPluginData (){
MStatus status =setObject (object) ;
if ( status != MS::kSuccess ){
if ( ReturnStatus )
*ReturnStatus =status ;
return ;
}
if ( ReturnStatus )
*ReturnStatus =MS::kSuccess ;
}
MFnFabricSpliceMayaData::~MFnFabricSpliceMayaData (){
}
MFn::Type MFnFabricSpliceMayaData::type () const {
return (MFn::kPluginData) ;
}
const char *MFnFabricSpliceMayaData::className (){
return (classNameString.asChar ()) ;
}
MStatus MFnFabricSpliceMayaData::setObject (MObject &object){
MStatus status ;
MObject oldObj =MFnPluginData::object () ;
status =MFnPluginData::setObject (object) ;
if ( status != MS::kSuccess )
return (status) ;
if ( MFnPluginData::typeId () != FabricSpliceMayaData::id ){
(void)MFnPluginData::setObject (oldObj) ;
return (MS::kInvalidParameter) ;
}
return (MS::kSuccess) ;
}
MStatus MFnFabricSpliceMayaData::setObject (const MObject &object){
MObject oldObj =MFnPluginData::object () ;
MStatus status =MFnPluginData::setObject (object) ;
if ( status != MS::kSuccess )
return (status) ;
if ( MFnPluginData::typeId () != FabricSpliceMayaData::id ){
(void)MFnPluginData::setObject (oldObj) ;
return (MS::kInvalidParameter) ;
}
return (MS::kSuccess) ;
}
FabricCore::RTVal MFnFabricSpliceMayaData::getRTVal () const{
if ( object ().isNull () )
return FabricCore::RTVal();
const FabricSpliceMayaData *myDataObj =static_cast<const FabricSpliceMayaData *>(this->constData ()) ;
return (myDataObj->getRTVal()) ;
}
MStatus MFnFabricSpliceMayaData::setRTVal (const FabricCore::RTVal &newVal){
if ( object ().isNull () )
return (MS::kFailure) ;
FabricSpliceMayaData *myDataObj =static_cast<FabricSpliceMayaData *>(this->data ()) ;
myDataObj->setRTVal (newVal) ;
return (MS::kSuccess) ;
}
MObject MFnFabricSpliceMayaData::create (MStatus *stat){
return (MFnPluginData::create (FabricSpliceMayaData::id, stat)) ;
}
MObject MFnFabricSpliceMayaData::create (const FabricCore::RTVal &in, MStatus *ReturnStatus){
MStatus status ;
MObject newObj =MFnPluginData::create (FabricSpliceMayaData::id, &status) ;
if ( status != MS::kSuccess ){
if ( ReturnStatus )
*ReturnStatus =status ;
return (MObject::kNullObj) ;
}
FabricSpliceMayaData *myDataObj =static_cast<FabricSpliceMayaData *>(this->data ()) ;
myDataObj->setRTVal (in) ;
if ( ReturnStatus )
*ReturnStatus =MS::kSuccess ;
return (newObj) ;
}