MCPcopy Create free account
hub / github.com/KhronosGroup/OpenCOLLADA / parsePlug

Method parsePlug

COLLADAMaya/src/COLLADAMayaAttributeParser.cpp:109–179  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

107 };
108
109 void AttributeParser::parsePlug(MPlug & plug)
110 {
111 AutoOnAfterPlug(*this, plug);
112
113 if (!onBeforePlug(plug)) {
114 // Skip plug
115 return;
116 }
117
118 MStatus status;
119
120 MObject attr = plug.attribute(&status);
121 if (!status) return;
122
123 MFnAttribute fnAttr(attr, &status);
124 if (!status) return;
125
126 MString attrName = fnAttr.name(&status);;
127 if (!status) return;
128
129 // First handle numeric compound types
130 MFnNumericData::Type type;
131 if (IsNumericCompoundAttribute(attr, type))
132 {
133 parseNumeric(plug, type);
134
135 // Mark children as parsed
136 //MFnCompoundAttribute fnCompoundAttribute(attr, &status);
137 //if (!status) return;
138
139 //unsigned int numChildren = fnCompoundAttribute.numChildren(&status);
140 //if (!status) return;
141
142 //for (unsigned int i = 0; i < fnCompoundAttribute.numChildren(); ++i)
143 //{
144 // MObject child = fnCompoundAttribute.child(i, &status);
145 // if (!status) return;
146
147 // MFnAttribute childFnAttr(child);
148 // //parsedAttributes.insert(childFnAttr.name().asChar());
149 //}
150 }
151 // Other cases
152 else if (attr.hasFn(MFn::kCompoundAttribute)) {
153 parseCompoundPlug(plug);
154 }
155 else if (attr.hasFn(MFn::kEnumAttribute)) {
156 parseEnumPlug(plug);
157 }
158 else if (attr.hasFn(MFn::kGenericAttribute)) {
159 parseGenericPlug(plug);
160 }
161 else if (attr.hasFn(MFn::kLightDataAttribute)) {
162 parseLightDataPlug(plug);
163 }
164 else if (attr.hasFn(MFn::kMatrixAttribute)) {
165 parseMatrixPlug(plug);
166 }

Callers 1

parseAttributesMethod · 0.80

Calls 3

AutoOnAfterPlugClass · 0.85
attributeMethod · 0.80
nameMethod · 0.45

Tested by

no test coverage detected