Hello folks,
The current issue we want to resolve is:
If we open a maya file with non-existent abc-cache, we can't reconnect all nodes with another valid abc-cache successfully.
The error of "not compatible as a transform node" is occurred where we want to attach the MObject to
MFnNurbsCurve/MFnNurbsSurface in CreateSceneVisitor::operator().
The weird thing is that those MObjects are really match the desired type, but it's failed to be bound with the MFn*.
At first, we guess it might be the problem of missing handle of internal MObject, and we try to replace the MObject of each NURBS curve
by its MDagPath. Unfortunately, we got no luck with this modification. So, we use MObject.hasFn() for type checking process instead,
and it resolves the issues of "not compatible transform node".
For the re-connecting process, we found other strange problems in connectAttr() in NodeIteratorVisitorHelper.cpp:
First, we can't attach MFnNurbsCurve to the curveObj successfully (just like previous case).
But it's OK to use MFnDependencyNode to bind the curveObj!
Second, if the curveObj has a connection to its "create" plug, the modifier.doIt() would return MS::kFailure.
We have tried to use MEL command to connect plugs, but few curves' position data would not match their original data.
Therefore, we add a function to do the disconnection for curves in CreateSceneVisitor, and finally, the modifier.doIt() works fine (so far).
The attached files are the patches of our experiments, hope it helps someone who has ran into similar situations like us. :)
Shih-Chin
Sam Wu於 2012年5月18日星期五UTC+8上午9時18分41秒寫道: