#include <maya/MIOStream.h>
#include <stdio.h>
#include <stdlib.h>
#include <maya/MPxToolCommand.h>
#include <maya/MFnPlugin.h>
#include <maya/MArgList.h>
#include <maya/MGlobal.h>
#include <maya/MRichSelection.h>
#include <maya/MItSelectionList.h>
#include <maya/MPoint.h>
#include <maya/MVector.h>
#include <maya/MDagPath.h>
#include <maya/MItGeometry.h>
#include <maya/MWeight.h>
#include <maya/MFnComponent.h>
#include <maya/MFnSingleIndexedComponent.h>
#include <maya/MFnDoubleIndexedComponent.h>
#include <maya/MFnTripleIndexedComponent.h>
#define CHECKRESULT(stat,msg) \
if ( MS::kSuccess != stat ) { \
cerr << msg << endl; \
}
#define kVectorEpsilon 1.0e-3
#define COMMAND_NAME "listRichSelectionCmd"
#define DOIT 0
#define UNDOIT 1
#define REDOIT 2
{
public:
listRichSelectionCmd();
~listRichSelectionCmd() override;
public:
static void* creator();
void setVector( double x, double y, double z);
private:
};
listRichSelectionCmd::listRichSelectionCmd( )
{
setCommandString( COMMAND_NAME );
}
listRichSelectionCmd::~listRichSelectionCmd()
{}
void* listRichSelectionCmd::creator()
{
return new listRichSelectionCmd;
}
bool listRichSelectionCmd::isUndoable() const
{
return true;
}
void listRichSelectionCmd::setVector( double x, double y, double z)
{
delta.x = x;
delta.y = y;
delta.z = z;
}
MStatus listRichSelectionCmd::finalize()
{
command.
addArg( commandString() );
}
{
unsigned i = 0;
{
case 1:
break;
case 2:
break;
case 3:
break;
case 0:
default:
break;
}
delta = vector;
return action( DOIT );
}
MStatus listRichSelectionCmd::undoIt( )
{
return action( UNDOIT );
}
MStatus listRichSelectionCmd::redoIt( )
{
return action( REDOIT );
}
MStatus listRichSelectionCmd::action(
int flag )
{
switch( flag )
{
case UNDOIT:
break;
case REDOIT:
break;
case DOIT:
break;
default:
break;
}
for( int side = 0; side < 2; side++)
{
if( side)
else
{
if( side)
else
{
iter.getDagPath( mdagPath, mComponent );
{
if( componentFn.hasWeights())
{
int count = componentFn.elementCount();
if ( MS::kSuccess == stat )
{
for( int i = 0; i < count; i++)
{
MWeight weight = componentFn.weight( i);
}
}
if ( MS::kSuccess == stat )
{
for( int i = 0; i < count; i++)
{
MWeight weight = componentFn.weight( i);
int u, v;
doubleFn.getElement( i, u, v);
}
}
if ( MS::kSuccess == stat )
{
for( int i = 0; i < count; i++)
{
int u, v, w;
tripleFn.getElement( i, u, v, w);
MWeight weight = componentFn.weight( i);
}
}
}
}
}
}
}
return MS::kSuccess;
}
{
MFnPlugin plugin( obj, PLUGIN_COMPANY,
"9.0",
"Any" );
status = plugin.registerCommand( COMMAND_NAME, &listRichSelectionCmd::creator );
if (!status) {
status.
perror(
"registerCommand");
return status;
}
return status;
}
{
status = plugin.deregisterCommand( COMMAND_NAME );
if (!status) {
status.
perror(
"deregisterCommand");
return status;
}
return status;
}