#include <string.h>
#include <maya/MIOStream.h>
#include <math.h>
#include <maya/MPxNode.h>
#include <maya/MPxCommand.h>
#include <maya/MFnNumericAttribute.h>
#include <maya/MFnTypedAttribute.h>
#include <maya/MFnPlugin.h>
#include <maya/MFnNurbsCurve.h>
#include <maya/MFnNurbsSurface.h>
#include <maya/MFnNurbsCurveData.h>
#include <maya/MFnNurbsSurfaceData.h>
#include <maya/MPointArray.h>
#include <maya/MDoubleArray.h>
#include <maya/MString.h>
#include <maya/MTypeId.h>
#include <maya/MPlug.h>
#include <maya/MDataBlock.h>
#include <maya/MDataHandle.h>
#include <maya/MGlobal.h>
#include <maya/MItCurveCV.h>
#include <maya/MDagPath.h>
{
public:
simpleLoft() {};
~simpleLoft() override;
static void* creator();
public:
};
simpleLoft::~simpleLoft() {}
void* simpleLoft::creator()
{
return new simpleLoft();
}
{
inputCurve = typedAttr.
create(
"inputCurve",
"in",
if ( !stat ) {
stat.
perror(
"ERROR creating simpleLoft curve attribute");
return stat;
}
outputSurface = typedAttr.
create(
"outputSurface",
"out",
if ( !stat ) {
stat.
perror(
"ERROR creating simpleLoft surface attribute");
return stat;
}
stat = addAttribute( inputCurve );
if (!stat) { stat.
perror(
"addAttribute");
return stat;}
stat = addAttribute( outputSurface );
if (!stat) { stat.
perror(
"addAttribute");
return stat;}
stat = attributeAffects( inputCurve, outputSurface );
if (!stat) { stat.
perror(
"attributeAffects");
return stat;}
return MS::kSuccess;
}
{
if ( stat != MS::kSuccess )
{
cerr << "Error in getting CVs: " << stat << endl;
}
for ( i = 1; i < k-3; i ++ )
for ( i = 1; i < 4; i++ )
{
for ( j = 0; j < k; j++ )
{
}
}
cvs, ku, kv, 3, 3,
false, newSurfData, &stat );
if ( stat != MS::kSuccess )
{
cerr << "Error in creating surface: " << stat << endl;
}
return surf;
}
{
if ( plug == outputSurface )
{
if( stat != MS::kSuccess )
{
cerr << "ERROR getting data: " << stat << endl;
return stat;
}
if( stat != MS::kSuccess )
{
cerr << "ERROR creating curve function set:" << stat << endl;
return stat;
}
if( stat != MS::kSuccess )
{
cerr << "Error in getting data handle: " << stat << endl;
return stat;
}
if ( stat != MS::kSuccess ) {
cerr << "Error creating new nurbs surface data block: "
<< stat << endl;
return stat;
}
loft( curve, newSurfData, stat );
if( stat != MS::kSuccess )
{
cerr << "Error in creating surface: " << stat << endl;
return stat;
}
surfHandle.
set( newSurfData );
if( stat != MS::kSuccess )
{
cerr << "Error in cleaning outputSurface plug: "
<< stat << endl;
return stat;
}
}
else
{
return MS::kUnknownParameter;
}
return MS::kSuccess;
}
{
MFnPlugin plugin( obj, PLUGIN_COMPANY,
"3.0",
"Any");
status = plugin.registerNode( "simpleLoft", simpleLoft::id,
simpleLoft::creator, simpleLoft::initialize );
if (!status) {
status.
perror(
"registerNode");
return status;
}
return status;
}
{
status = plugin.deregisterNode( simpleLoft::id );
if (!status) {
status.
perror(
"deregisterNode");
return status;
}
return status;
}