Seems you did not look into the Maya developers help or into the devkit examples. It is all there. Buy the book you mentioned, it describes exactly how to create parameters except that it does not cover the python plugin part.
Seeking help in creating a maya plug-in
When I write the code for a plugin in C++, do I copy and paste the code in the Python tab in the script editor?
Do you really expect that C++ code works in python?
To be honest, I never tried if python can execute C++ code on the fly, but I really doubt it.
Do you have some experience with C++ at all?
c++ and python use completely different syntax. You cannot run c++ code in the maya script editor. You need to compile c++ code to create a .mll (windows) or .so (linux) which you load via the plugin manager.
Based on what I see in your questions, you are obviously starting with no coding knowlege. I would suggest you first learn how to write a script with basic python. Then after you are comfortable with basic python, including maya.cmds and pymel, have a look at the OpenMaya libraries. With the OpenMaya libraries you can write a python plugin, which you can develop in the maya script editor. And when you are comfortable with all that, you can start to learn c++. This is going to take you about a year and quite a bit of hard work.
David
I do have some coding knowledge, I’m already learning about C++ and Python. I just didn’t know how to import C++ code.
Did you check out the maya docs?
This section might give you some clues:
http://help.autodesk.com/view/MAYAUL/2017/ENU/?guid=__files_Maya_API_introduction_htm
David
I’ve put the circleNode.mll file in the plug-ins folder of the Maya 2016.5 folder and I’m able to load it in the Plug-Ins Manager but I can’t find it Maya.
Did you take a look at the devkit folder? There’s a MEL file in there showing you how to use it (https://github.com/autodesk-adn/Maya-devkit/blob/master/win/devkit/plug-ins/circleNode/circleNode.mel)
Besides that, when you load a plugin in the plugin manager, you can see the name of the dependency nodes and/or commands associated with that plugin.
I think the problem here is that you’re missing some of the fundamentals here, Don’t try to travel to Mars before you can crawl.
These are things you will learn as you do the basics, build a foundation first.
I put the mel file in the plug-ins folder of the Maya016.5 folder and it doesn’t appear in the Plug-Ins Manager in Maya. I have the MAYA_PLUG_IN_PATH variable that point to the plug-ins folder written in the Maya environment variables file and that didn’t help either.
Search for MAYA_SCRIPT_PATH and read the manuals how to load, write and find a mel script.
CircleNode did appear in the Plug-In-Manager but only with the mll file in the C:\Program Files\Autodesk\Maya2016.5\bin\plug-ins folder directory and I still can’t find the plug-in in Maya. I even put the mel file in the C:\Program Files\Autodesk\Maya2016.5\scripts folder directory.
Did you try this (from the docs):
Executing the command “source circleNode” 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.
I executed the command and I get this.
// Error: “source circleNode”; //
// Error: Line 1.19: Syntax error //
Which one is better for creating a plugin?
C++ or Python ?
I have tried python, and I think I need to dive into C++ because the API is written in C++.