#include <maya/MIOStream.h>
#include <string.h>
#include <math.h>
#include <maya/MPxNode.h> 
#include <maya/MFnNumericAttribute.h>
#include <maya/MFnDependencyNode.h>
#include <maya/MFnPlugin.h>
#include <maya/MString.h> 
#include <maya/MTypeId.h> 
#include <maya/MPlug.h>
#include <maya/MPlugArray.h>
#include <maya/MVector.h>
#include <maya/MDataBlock.h>
#include <maya/MDataHandle.h>
 
{
public:
                        affects();
                    ~affects() override; 
    static  void*       creator();
};
affects::affects() {}
affects::~affects() {}
{
    fprintf(stderr,"affects::compute(), plug being computed is \"%s\"\n",
 
        
        
        
        MPlug pA = fnThisNode.findPlug( 
"A",  
true,  &status );
 
            fprintf(stderr,"\t\t... found dynamic attribute \"A\", copying its value to \"B\"\n");
            int value = inputData.
asInt();
 
            outputHandle.
set( value );
 
        }
    } else {
        return MS::kUnknownParameter;
    }
    return( MS::kSuccess );
}
void* affects::creator()
{
    return( new affects() );
}
{
    return( MS::kSuccess );
}
MStatus affects::setDependentsDirty( 
const MPlug &plugBeingDirtied,
 
{
        
        
        
        fprintf(stderr,"affects::setDependentsDirty, \"A\" being dirtied\n");
        MPlug pB = fnThisNode.findPlug( 
"B",  
true,  &status );
 
            fprintf(stderr,"\t\t... dirtying \"B\"\n");
        }
    }
    return( MS::kSuccess );
}
{ 
    MFnPlugin plugin( obj, PLUGIN_COMPANY , 
"6.0", 
"Any");
 
    status = plugin.registerNode( "affects", affects::id, affects::creator,
                                  affects::initialize );
    if (!status) {
        status.
perror(
"registerNode");
 
        return( status );
    }
    return( status );
}
{
    status = plugin.deregisterNode( affects::id );
    if (!status) {
        status.
perror(
"deregisterNode");
 
        return( status );
    }
    return( status );
}