我正在尝试创建接收MFnMesh
指针并在其上执行操作的函数。
问题是我无法将 my 转换MFnMesh
为指针,我认为问题不仅在这个类上,而且在MFnBaseClass
因为我收到这个错误。
/usr/autodesk/maya2015-x64/include/maya/MFnBase.h:168:14: error: ‘MFnMesh* MFnMesh::operator&() const’ is private
MFnClass * operator& () const
^
/usr/autodesk/maya2015-x64/include/maya/MFnDagNode.h:237:2: note: in expansion of macro ‘declareMinimalMFn’
declareMinimalMFn( MFnClass ); \
^
/usr/autodesk/maya2015-x64/include/maya/MFnMesh.h:243:2: note: in expansion of macro ‘declareDagMFn’
declareDagMFn(MFnMesh, MFnDagNode);
^
/home/k.masson/Documents/maya/km_extendedColorSet/src/km_particlesToColorSet.cpp:159:9: error: within this context
test(&meshFn);
^
这是函数测试,它somefile.h
包含在调用函数的文件中。
void test(MFnMesh * meshFn){
MStatus status = MS::kSuccess;
MString csName("YOLOSWAQDAZD");
status = meshFn->createColorSetDataMesh(csName);
MCheckStatus(status,"Error creating new color set");
}
这是我在调用test
函数之前所做的。
// Get the out mesh data
MDataHandle outMeshHandle = data.outputValue(aOutGeometry, &status);
MCheckStatus(status,"ERROR getting aOutGeometry");
// Copy the in mesh to the output
outMeshHandle.copy(inMeshData);
// Create a function set for the out mesh
MFnMesh meshFn(outMeshHandle.asMesh());
test(&meshFn);
我没有找到将 my 转换MFnMesh
为指针的任何方法,因此我尝试将其直接称为对象,而不是像这样的指针。
test(meshFn);
void test(MFnMesh meshFn){
MStatus status = MS::kSuccess;
MString csName("YOLOSWAQDAZD");
status = meshFn.createColorSetDataMesh(csName);
MCheckStatus(status,"Error creating new color set");
}
我明白了:
/usr/autodesk/maya2015-x64/include/maya/MFnMesh.h:243:16: error: ‘MFnMesh::MFnMesh(const MFnMesh&)’ is private
declareDagMFn(MFnMesh, MFnDagNode);
^
/usr/autodesk/maya2015-x64/include/maya/MFnBase.h:166:9: note: in definition of macro ‘declareMinimalMFn’
MFnClass( const MFnClass &rhs ); \
^
/usr/autodesk/maya2015-x64/include/maya/MFnMesh.h:243:2: note: in expansion of macro ‘declareDagMFn’
declareDagMFn(MFnMesh, MFnDagNode);
^
/home/k.masson/Documents/maya/km_extendedColorSet/src/km_particlesToColorSet.cpp:159:14: error: within this context
test(meshFn);
^
In file included from /home/k.masson/Documents/maya/km_extendedColorSet/src/km_particlesToColorSet.cpp:29:0:
/home/k.masson/Documents/maya/km_extendedColorSet/src/kmColorSetTool.h:29:6: error: initializing argument 1 of ‘void test(MFnMesh)’
void test(MFnMesh meshFn){
那么您知道是否有办法创建一个以时尚方式作用于类的函数,MFnBase
甚至是具有MFnBase
属性的类?我不知道我们不能做这种真正流行的过程。
我是 C++ 新手,所以我可能犯了一个愚蠢的错误。