Skip to content

Commit

Permalink
finalize maya plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
Ninjajie committed May 2, 2018
1 parent 7044172 commit a69dd74
Show file tree
Hide file tree
Showing 9 changed files with 708 additions and 267 deletions.
487 changes: 366 additions & 121 deletions ERODENode.cpp

Large diffs are not rendered by default.

42 changes: 34 additions & 8 deletions ERODENode.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,51 @@ class ERODENode :
ERODENode();
virtual ~ERODENode();
virtual MStatus compute(const MPlug& plug, MDataBlock& data);
void populateTestImage(float * pixels, unsigned int w, unsigned int h);
MStatus load(MImage & image, unsigned int);
static void* creator();
static MStatus initialize();

static MTypeId nodeID;
static MObject time;

static MObject dfAngle;
static MObject dfStepsize;
static MObject grammar;
//erode
static MObject carve;
static MObject smooth;
static MObject outputPath;
static MObject inputPath;
//
static MString grammarPath;
//parameters
static MObject branchLength;
static MObject elevationPercentile;
static MObject distanceRatio;
static MObject probabilityS;
static MObject probabilityA;
static MObject riverWidth;
static MObject riverHeight;
static MObject branchWidth;

static MObject elevationRange;
//parameters for initial nodes creation

static MObject mouthOnFirstEdge;
static MObject firstMouthRatio;
static MObject mouthOnSecondEdge;
static MObject secondMouthRatio;
static MObject mouthOnThirdEdge;
static MObject thirdMouthRatio;
static MObject mouthOnFourthEdge;
static MObject fourthMouthRatio;

protected:
void computeImage(std::string& carved, std::string& carvedSmoothed);
void computeImage(std::string originFile,
std::string& altered,
std::string& carved,
std::string& carvedSmoothed,
double branchLength, double elevationPercentile, double distanceRatio,
double probabilityS, double probabilityA,
double riverWidth, double riverHeight, double branchWidth,
double elevationRange,
bool mouth1, double ratio1,
bool mouth2, double ratio2,
bool mouth3, double ratio3,
bool mouth4, double ratio4);
};

Binary file added Erode.mll
Binary file not shown.
Binary file modified LSystem.mll
Binary file not shown.
2 changes: 1 addition & 1 deletion MyPlugin.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@
<Link>
<AdditionalOptions>/export:initializePlugin /export:uninitializePlugin %(AdditionalOptions)</AdditionalOptions>
<AdditionalDependencies>odbc32.lib;odbccp32.lib;OpenMaya.lib;OpenMayaRender.lib;Foundation.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>.\LSystem.mll</OutputFile>
<OutputFile>.\Erode.mll</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<AdditionalLibraryDirectories>C:\Program Files\Autodesk\Maya2016\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<ProgramDatabaseFile>.\Release/MyPlugin.pdb</ProgramDatabaseFile>
Expand Down
4 changes: 1 addition & 3 deletions PluginMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
MStatus initializePlugin( MObject obj )
{
MStatus status = MStatus::kSuccess;
MFnPlugin plugin( obj, "MyPlugin", "1.0", "Any");
MFnPlugin plugin( obj, "ErodePlugin", "1.0", "Any");

// Register Command
// status = plugin.registerCommand( "ERODECmd", ERODECmd::creator );
Expand All @@ -39,8 +39,6 @@ MStatus initializePlugin( MObject obj )
status = plugin.registerNode("ERODENode", ERODENode::nodeID,
ERODENode::creator, ERODENode::initialize);

ERODENode::grammarPath = plugin.loadPath();

if (!status) {
status.perror("registerNode");
return status;
Expand Down
Loading

0 comments on commit a69dd74

Please sign in to comment.