Maya: break joint connections through api?

hi

my plugin is importing some animation data onto an existing rig

I have the MObject for a joint - I get the rotateX plug and find that it’s currently connected to something

if I try to construct an MfnAnimCurve for that plug it returns kNotImplemented - which indicates that the attribute is currently connected to more than one curve

  MObject obj_joint = ...;

  MFnDependencyNode fn_dep_node( obj_joint );

  MPlug plug = fn_dep_node.findPlug( "rotateX", false, &stat );

  if ( plug.isConnected() )
  {
    MFnAnimCurve fn_curve( plug, &stat );

    if ( stat == MStatus::kNotImplemented )
    {
      // the attribute is connected to more than one curve
      ... <- !?
    }
  }
  • is it possible for me to break those connections through the api ?

thanks

Jonny

I don’t know the real answer to your question, whether it is possible to break the connections using the API. But if it turns out it is not possible, you can use MGlobal::executeCommand() and pass it a MEL command to do what you want.

After a little more digging, it looks like what you want may be MDGModifier::disconnect().

thanks! - I’ll give that a go

Jonny