Compiling circleNode example plugin

Compiling circleNode example plugin

Anonymous
Not applicable
1,858 Views
4 Replies
Message 1 of 5

Compiling circleNode example plugin

Anonymous
Not applicable

I've just started playing around with maya plugin development today. I've got my environment setup and can compile a hello world command plugin. Running "HelloWorld" in the MEL commandline I see it prints out "Hello world!".

 

Now I'm trying to get one of the example plugins compiled but I'm having some issues. I'm using Visual Studio 2015 Update 3 for compiling the plugins. I don't see a visual studio project file for any of the example plugins, so I've created a new project using the MayaPluginWizard and called it circleNode. Inside that I copy and pasted the circleNode.cpp code into the cpp file automatically created for the project. Everything compiles without any errors and I copy it into a folder in my Maya plug-ins folder. I load it just the same as my hello world.

 

vs.png

 

The circleNode.cpp file has instructions at the top that state:

 

// Executing the command "source circleNode" will run the MEL script which will
// create a new "Circle" menu with a single item. Selecting this will build
// a simple model (a sphere which follows a circular path) which can be played back,
// by clicking on the "play" icon on the time slider.  Note: the circleNode
// plugin needs to be loaded before the "Circle" menu item can be executed
// properly.

I'm trying to run source circleNode in the MEL command line but it comes back with this error:

// Error: Line 1.18: Cannot find file "circleNode" for source statement.

 

As you can see I have the plugin loaded.

circlenode.jpg

 

I'm not to familiar with Maya, Ive done a little bit of it in the past but I'm going to be working on a plugin for a client so I'm trying to get back into it. Maybe I'm just running the example wrong. I think theres some parts of circleNode that I can use for the plugin I need to make so thats why I'm trying to get it running.

0 Likes
Accepted solutions (1)
1,859 Views
4 Replies
Replies (4)
Message 2 of 5

kevinvandecar
Community Manager
Community Manager

Hi, Although using the project wizard should work, I am not sure you have everything needed. I would suggest to read the "How to build plug-ins on Windows" topic. Maya devkit samples are using the command-line "cmake" tool to build. This helps to keep the devkit somewhat platform independent. To setup the devkit for Windows, see here: http://help.autodesk.com/view/MAYAUL/2019/ENU/?guid=__developer_Setting_up_your_build_Windows_enviro...

Then there is a intro that uses the circleNode as an example. See here: http://help.autodesk.com/view/MAYAUL/2019/ENU/?guid=__developer_ExamplesAndSamples_Building_Sample_P...

 

Also make sure to use the doc version appropriate for your version of Maya (above link is for 2019). Sometimes the compiler version may change for example.

 

hope it helps,

kevin

 


Kevin Vandecar
Developer Technical Services
Autodesk Developer Network



0 Likes
Message 3 of 5

Anonymous
Not applicable

Hi Kevin,

 

I should have been more specific, I'm trying to build a plugin for Maya 2018 so I've been following these documents:

 

I just redid everything from scratch, and I noticed this time I had .sln files in the plugins directory, so I opened that project for circleNode as stated in the first link. I built that (no build errors) and included it in Maya and same issue is happening where it says:

 

// Error: Line 1.18: Cannot find file "circleNode" for source statement.

 

For the 2018 devkit I don't see any cmake files, only the visual studio project files. I have a copy of the 2019 devkit downloaded and I see that has cmake files so I'm assuming cmake is the new way to build all the samples.

 

I loaded the Plugins.sln file to build all of the sample plugins, and 216 succeeded, 4 failed and 9 skipped. The ones that failed are shader ones so I think I'm just missing some external stuff that I'd need to install if I wanted those plugins.


I looked through the rest of the plugins and found that the translateCmd also includes things that I'll need to do so I imported that and it works perfect so I'm just going to go off of that. Eventually I'm going to be trying to hook up a custom serial USB device to move an object around, so this translateCmd is a good example to look at. 

 

I think I'm just going to give up on circleNode. I guess I'm just confused on the usage of it. Why does "source circleNode" need to be called? Doesn't "source" compile a script, but circleNode has already been compiled via Visual Studio?

 

 

 

 

0 Likes
Message 4 of 5

kevinvandecar
Community Manager
Community Manager
Accepted solution

Hi, Sorry for any confusion. yes you are correct, the Maya 2019 release uses a new cmake to build. I am new to Maya development, so did not realize that.


Regarding the 2018 version of the plugin, I was able to build it using the SLN as you mentioned. I then used the Maya plugin manager to load it, and that seemed to work without any error. Then following the cpp instructions, I tried "source circleNode" and see the same error you are getting. This essentially means that the accompanying MEL script is not being found directly. So depending on how you got Maya to load the plugin, you will have to tell Maya how to "find" this script as well. The easiest is to simply use the full path. You can do this for example:  source "<your install location>/devkit/plug-ins/circleNode/circleNode.mel". This should then work and show a new menu on the Maya menubar, and allow you to execute the plug-in functionality.

 

In short, I find it easier to start by using full paths to everything to ensure the files are being found. By using the plug-in manager to load the plugin, you know it is being loaded (or an error with that specifically). Then if MEL script is not found, again use full path to ensure it's being found and executed.

 

If you still have trouble,  I would suggest to double check  to make sure you have matching devkit and Maya update version. On the Maya developer center http://autodesk.com/developmaya you will find all the versions for 2018. Make sure to use the correct update devkit to match your Maya update.

 

Hope it helps, and again, sorry for any initial confusion.

kevin


Kevin Vandecar
Developer Technical Services
Autodesk Developer Network



Message 5 of 5

Anonymous
Not applicable

Hi Kevin,

 

Appending the full path worked for me. Thanks for helping me figure out my issue!

0 Likes