Hello all,
thanks to answers in prior posts and reading others here on the site I have made baby steps towards making a plugin. Please note, I haven't coded anything but javascript in a long long time and while I have coded java a decade ago, it's been even longer since I last touched c++. I haven't used any IDE other than Eclipse in that time. So please forgive me up front if I get terminology wrong in regards to Windows and Visual Studio.
My steps so far over the past several days:
- Downloaded the Daz SDK and looked through both the SDK and Qt docs to get a good idea of what's there. Confirmed I should be able to do what I need to for my project.
- Downloaded Visual Studio 2010 Express and many extra updates and installers per some posts here.
- Spent a day or two not getting any of it to work or get the plugins built, mostly due to not being to set the Configuration Manager to have an x64 option.
- Uninstalled Visual Studio 2010 Express, the SP1, and any Microsoft SDK I had installed as part of that effort.
- Installed Visual Studio 2019 Community and picked every c++ option available during the install
- Loaded the SDK samples.sln where it prompted me to change two items related to Visual Studio 2010; I selected the Windows 10 SDK and another option (sorry I forget what it was, but the value had something like v142 in it)
- Opened the Configuration Manager and saw there were x64 options so changed the values for Release to x64 in all the sample projects
- Right clicked AFirstPlugin project, hit build and saw that it looked to have worked.
- Located the sdk_afirstplugin.dll in the <daz install dir>\exec\Release\x64\plugins
- Copied the dll into <daz install dir>\DAZ 3D\DAZStudio4\plugins directory and started Daz Studio
- Dropped down the Edit menu and confirmed the 'Hello' option. Selected it and got the "Helo, World" dialog and additional dialogs when hitting Accept and Reject buttons
For my project I wanted to confirm that I could call code in a plugin from my Daz Script project. I see that the class DzAFirstPluginAction is public, so from the Script IDE I entered:
var afpa = new DzAFirstPluginAction();
afpa.executeAction();
and hit the Execute button. I was very happy to see the dialog open and work just as it had from the Edit menu. This confirms to me I can do what I was hoping in regards to making a plugin to handle low level QImage pixel by pixel manipulations and be able to call that from my Daz Scripting project.
I started by trying to copy the solution and project names into a new solution, then manually renaming the .cpp files, .h files, etc. I honestly can't recall what all I did other than royally screw everything up. I thought I had a whole different solution, but after renaming everything I could find in all the files there were still references to AFirstPlugin and nothinig would build. I decided to delete everything as it looked like not only had I messed up my new solution but also the original Samples.sln. So I deleted everything and re-installed the full SDK, samples, and Docs from scratch.
Right now as I put this post out I'm back to the the point where I verified the AFirstPluginAction dll builds and runs correctly in Daz.
In order to not repeat my Visual Studio Solution/project debacle I hope someone here can help guide or point me to the best and/or easiest way to make a new Solution and/or Project so that all the references, configurations, etc. are all there without stomping all over the initial sample code? Do I make a new project in the samples.sln itself? Or do I somehow copy or Save As the solution into something new and remove all the sample projects but one - and then somehow rename or refactor that?
Also, this may or may not be a seperate question, but I didn't see any obvious way to rename/refactor across the project. I saw a reference in googling to ctrl-r, ctrl-r but that does nothing in Visual Studio for me.
As always, any help and guidance is greatly appreciated!