Help!! C++ SDK, VS 2017 Community [SOLVED]
-
On 19/05/2017 at 03:07, xxxxxxxx wrote:
Hi Lawrence,
welcome to the Plugin Café forums
On your question in your first post:
Unable to start program
\ Program Files \ MAXON \ CINEMA 4D R18 \ plugins \ cinema4dsdk \ ProjectName.cdl64In the end a plugin is a library (dll), this can't be started directly. Instead you need to tell VisualStudio to call the Cinema 4D application, when you want to debug your plugin. See this page on Debugging Plugins, the screenshot in chapter 1.1.1 shows how to set this up.
And then I'd say, before setting up your own project you probably want to try to compile the example plugins (the cinema4dsdk.sln). If you run into any problems with this, don't hesitate to get back here. In this case try to provide as much details as possible, especially any messages in VisualStudio's console or output window can be helpful.
-
On 19/05/2017 at 03:11, xxxxxxxx wrote:
-
-
On 19/05/2017 at 04:07, xxxxxxxx wrote:
-
On 22/05/2017 at 08:39, xxxxxxxx wrote:
Hi Lorenzo, let's try to find a solution to this lengthy discussion, but first of all a few notes about posting in this forum:
- please avoid using bold characters or uppercase sentences which might be felt as shouting (ref at https://it.wikipedia.org/wiki/Netiquette (le regole importanti, point.3)
- try to be as much as possible clear and concise to avoid multiple posts in the same thread just one after the other (in case you can edit your post and add additional information)
With reference to the issue reported, please consider the following compatibility table:
Cinema 16 - Visual Studio 2012
Cinema 17 /18 - Visual Studio 2013First of all let's check that the development environment is properly configured.
- Remove any VisualStudio already installed and just keep only the VisualStudio based on the Cinema version you would like to develop on.
- Assuming you're developing for R18 open VS2013, and in order to be sure that everything works properly, try to load the cinema4dsdk.sln solution found in <drive to cinema installation>:<path to cinema R18 installation>\plugins\cinema4dsdk.
- If no error pops up during the loading process then set the Configuration to " Debug " and build the solution clicking " F7 "
- After the building process has properly ended, right click on the cinema4dsdk project and select "Properties".
- Under " Configuration Properties "->" Debugging " populate the " Command " field with the value "..\..\Cinema 4D.exe"
- Now clicking F5 Cinema should start and the cinema4dsdk examples should be running in debug mode.
If all the steps below have been successfully accomplished, you can be sure that your development environment is working properly.
- It's now the turn to duplicate the whole cinema4dsdk folder in a new folder named, for example, "MyFirstPlugin".
- After getting the folder duplicated enter the newly created folder and rename both cinema4dsdk.sln and cinema4dsdk.vcxproj respectively in "MyFirstPluginSolution.sln" and "MyFirstPluginProject.vcxproj"
- Now open the MyFirstPluginSolution in VS2013 and as soon as it gets opened you will see that in the Solution Explorer the cinema4dsdk project will have a bluish exclamation mark hinting to the fact that the project has not been found.
- Right click on the project and select " Remove " to remove the project from the MyFirstPluginSolution
- Right click on the solution and select " Add- >Existing Project…" then browse up to the folder containing the MyFirstPluginProject.vcxproj and add it.
- Build the solution to be sure that everything works properly and at the end of the building process you should found the "MyFirstPluginProject.cdl64" file in the solution folder. In the folder you should also find some other files starting with "cinema4dsdk" which can be now removed to make the room tidy and clean.
Now you can get rid of all the files contained in your MyFirstPluginProject, by selecting them from the Solution Explorer in VS2013 and deleting them. Simply select them all, right click and select " Remove ". At this stage you can add your own files and start having fun developing with Cinema 4D.
Hoping this short set of steps could lead you to get rid of all your issue, I warmly invite posting into this thread any further issue.
Best, Riccardo.
-
On 22/05/2017 at 10:28, xxxxxxxx wrote:
Thank you so much! Riccardo, I am solving ... If I'll have any problems, I'll let you know through the forum.
-
On 22/05/2017 at 15:18, xxxxxxxx wrote:
I have problems with the code ..
I've already created the dialog with ResEdit and, I have correctly configured the description files and the c4d_symbols.h file. But I get these bugs on the code ...
IDE | VISUAL STUDIO VS2013 For Plug-in Cinema 4D R18
MyPlugin.cpp
#include "c4d.h" #include "c4d_symbols.h" #include "MyPlugin.h" #define PLUGIN_TEMPLATE_ID 1039315 /***********************************************/ /* Plugin Template */ /***********************************************/ PluginTemplate::PluginTemplate() { } PluginTemplate::~PluginTemplate(void) { } Bool PluginTemplate::CreateLayout(void) { if (!GeDialog::CreateLayout())return FALSE; if (!LoadDialogResource(PLUGIN_TEMPLATE_ID, NULL, 0))return FALSE; return TRUE; } Bool PluginTemplate::InitValues(void) { if (!GeDialog::InitValues())return FALSE; this->SetReal(IDC_EDIT1, 200.0, 1, 1000, 10); this->SetReal(IDC_EDIT2, 200.0, 1, 1000, 10); this->SetReal(IDC_EDIT3, 200.0, 1, 1000, 10); return TRUE; } Bool PluginTemplate::Command(Int32 id, const BaseContainer &msg) { Real edit1 this->GetReal(IDC_EDIT1, edit1); Real edit2 this->GetReal(IDC_EDIT2, edit2); Real edit3 this->GetReal(IDC_EDIT3, edit3); return TRUE; } /***********************************************/ /* Template */ /***********************************************/ class PluginTemplateCommand : public CommandData { public: /* Constructor & Descriptor */ PluginTemplateCommand(); virtual ~PluginTemplateCommand(); virtual Bool Execute(BaseDocument *doc); virtual Bool RestoreLayout(void *secret); private: PluginTemplate *dlg; }; PluginTemplateCommand::PluginTemplateCommand() { dlg = NULL; } PluginTemplateCommand::~PluginTemplateCommand() { gDelete(dlg); } Bool PluginTemplateCommand::Execute(BaseDocument* doc) { if (!dlg) dlg = gNew PluginTemplate; if (!dlg) return FALSE; dlg->Open(DLG_TYPE_ASYNC, PLUGIN_TEMPLATE_ID); return TRUE; } Bool PluginTemplateCommand::RestoreLayout(void* secret) { if (!dlg) dlg = gNew PluginTemplate; if (!dlg) return FALSE; dlg->RestoreLayout(PLUGIN_TEMPLATE_ID, 0, secret); return TRUE; } /***********************************************/ /* Register Plugin */ /***********************************************/ Bool RegisterPluginTemplate() { return RegisterCommandPlugin(PLUGIN_TEMPLATE_ID, "Plugin Template", 0, AutoBitmap("Icon.png"), String(), gNew PluginTemplateCommand); }
-
On 22/05/2017 at 15:21, xxxxxxxx wrote:
I have problems with, gDelete, gNew, SetReal
Console Log Response ________1 IntelliSense: class "PluginTemplate" has no member "SetReal" c:\Program Files\MAXON\CINEMA 4D R18\plugins\PluginTemplate\source\MyPlugin\MyPlugin.cpp 32 8 PluginTemplate 2 IntelliSense: class "PluginTemplate" has no member "SetReal" c:\Program Files\MAXON\CINEMA 4D R18\plugins\PluginTemplate\source\MyPlugin\MyPlugin.cpp 33 8 PluginTemplate 3 IntelliSense: class "PluginTemplate" has no member "SetReal" c:\Program Files\MAXON\CINEMA 4D R18\plugins\PluginTemplate\source\MyPlugin\MyPlugin.cpp 34 8 PluginTemplate 4 IntelliSense: identifier "Real" is undefined c:\Program Files\MAXON\CINEMA 4D R18\plugins\PluginTemplate\source\MyPlugin\MyPlugin.cpp 42 2 PluginTemplate 5 IntelliSense: expected a ';' c:\Program Files\MAXON\CINEMA 4D R18\plugins\PluginTemplate\source\MyPlugin\MyPlugin.cpp 42 13 PluginTemplate 6 IntelliSense: identifier "Real" is undefined c:\Program Files\MAXON\CINEMA 4D R18\plugins\PluginTemplate\source\MyPlugin\MyPlugin.cpp 43 2 PluginTemplate 7 IntelliSense: expected a ';' c:\Program Files\MAXON\CINEMA 4D R18\plugins\PluginTemplate\source\MyPlugin\MyPlugin.cpp 43 13 PluginTemplate 8 IntelliSense: identifier "Real" is undefined c:\Program Files\MAXON\CINEMA 4D R18\plugins\PluginTemplate\source\MyPlugin\MyPlugin.cpp 44 2 PluginTemplate 9 IntelliSense: expected a ';' c:\Program Files\MAXON\CINEMA 4D R18\plugins\PluginTemplate\source\MyPlugin\MyPlugin.cpp 44 13 PluginTemplate 10 IntelliSense: identifier "gDelete" is undefined c:\Program Files\MAXON\CINEMA 4D R18\plugins\PluginTemplate\source\MyPlugin\MyPlugin.cpp 75 2 PluginTemplate 11 IntelliSense: identifier "gNew" is undefined c:\Program Files\MAXON\CINEMA 4D R18\plugins\PluginTemplate\source\MyPlugin\MyPlugin.cpp 81 18 PluginTemplate 12 IntelliSense: expected a ';' c:\Program Files\MAXON\CINEMA 4D R18\plugins\PluginTemplate\source\MyPlugin\MyPlugin.cpp 81 23 PluginTemplate 13 IntelliSense: identifier "gNew" is undefined c:\Program Files\MAXON\CINEMA 4D R18\plugins\PluginTemplate\source\MyPlugin\MyPlugin.cpp 93 18 PluginTemplate 14 IntelliSense: expected a ';' c:\Program Files\MAXON\CINEMA 4D R18\plugins\PluginTemplate\source\MyPlugin\MyPlugin.cpp 93 23 PluginTemplate 15 IntelliSense: identifier "gNew" is undefined c:\Program Files\MAXON\CINEMA 4D R18\plugins\PluginTemplate\source\MyPlugin\MyPlugin.cpp 108 107 PluginTemplate 16 IntelliSense: expected a ')' c:\Program Files\MAXON\CINEMA 4D R18\plugins\PluginTemplate\source\MyPlugin\MyPlugin.cpp 108 112 PluginTemplate
-
On 22/05/2017 at 15:23, xxxxxxxx wrote:
MyPlugin.h
#include "c4d_gui.h" ////////////////////////////////////////// class PluginTemplate : public GeDialog { public: PluginTemplate(); virtual ~PluginTemplate(); virtual Bool CreateLayout(void); virtual Bool InitValues(void); virtual Bool Command(Int32 id, const BaseContainer &msg); };
-
On 22/05/2017 at 15:24, xxxxxxxx wrote:
main.cpp
#include "c4d.h" #include <string.h> Bool RegisterPluginTemplate(); Bool PluginStart(void) { if (!RegisterPluginTemplate()) return FALSE; return true; } void PluginEnd(void) { } Bool PluginMessage(Int32 id, void* data) { if (!resource.Init()) return FALSE; if (!RegisterPluginTemplate()) return FALSE; return false; }
-
On 22/05/2017 at 15:38, xxxxxxxx wrote:
I started from the structure of your samples..
Here the Screen ..https://www.dropbox.com/s/qwbnsq8695ezezz/2017-05-23.png?dl=0
Thanks in advance for any help you are able to provide.
-
On 22/05/2017 at 17:22, xxxxxxxx wrote:
c4d_symbols.h
enum { // Dialog definitions of IDD_PLUGIN_TEMPLATE start here IDD_PLUGIN_TEMPLATE, IDC_EDIT1, IDC_EDIT2, IDC_EDIT3, // Dialog definitions of IDD_PLUGIN_TEMPLATE end here // End of symbol definition _DUMMY_ELEMENT_ };
-
On 22/05/2017 at 22:54, xxxxxxxx wrote:
Did you copy that code from somewhere else? It doesn't compile because R18 doesn't use 'Real' or 'SetReal', it uses Float and SetFloat instead. Likewise gNew and gDelete don't exist any longer. Correct those errors and the missing semicolons errors will go away.
If you're going to reuse old code fair enough, but you need to read about the changes in the SDK to get it to build.
Steve
-
On 23/05/2017 at 02:27, xxxxxxxx wrote:
Good morning Lorenzo,
with reference to your code, as already spotted out by Steve, make it compliant with the API you're supposed to use (in you case R18?) and beware of syntax errors.I warmly invite you to review the full set of examples shipped with Cinema 4D in the cinema4dsdk folder maybe starting with the C++ SDK - Example Dialog or maybe with something even simpler.
On top of that, i similarly invite to deep dive into our documentation to read about the supported types as well as the instances creation/destruction; all the content found under "Overviews" can be considered of invaluable help for Cinema 4D developers newbie.
Finally, as stated yesterday, please avoid posting multiple time adding small chips of information; collapse instead everything in a single post where all you questions are properly explained and use an external code dropping services in case you need to share code (rather than a snippet). This will dramatically community's improve issue understanding as well as topic readability.Best, Riccardo
-
On 23/05/2017 at 06:04, xxxxxxxx wrote:
Hi there Riccardo
I correctly configured the sdk sample. The problem when i go to build the project i get these errors ..Here My Settings ..
cinema4dsdk.snl fileMicrosoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2013 VisualStudioVersion = 12.0.30501.0 MinimumVisualStudioVersion = 10.0.40219.1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cinema4dsdk", "cinema4dsdk.vcxproj", "{21895B69-DE91-7035-0009-38CB8C5CDEA3}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cinema.framework", "C:\Program Files\MAXON\CINEMA 4D R18\frameworks\cinema.framework\project\cinema.framework.vcxproj", "{69BF9B7D-7EB2-7FC5-0009-38CB8C5CDEA3}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|x64 = Debug|x64 Intel|x64 = Intel|x64 Release|x64 = Release|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {21895B69-DE91-7035-0009-38CB8C5CDEA3}.Debug|x64.ActiveCfg = Debug|x64 {21895B69-DE91-7035-0009-38CB8C5CDEA3}.Debug|x64.Build.0 = Debug|x64 {21895B69-DE91-7035-0009-38CB8C5CDEA3}.Intel|x64.ActiveCfg = Intel|x64 {21895B69-DE91-7035-0009-38CB8C5CDEA3}.Intel|x64.Build.0 = Intel|x64 {21895B69-DE91-7035-0009-38CB8C5CDEA3}.Release|x64.ActiveCfg = Release|x64 {21895B69-DE91-7035-0009-38CB8C5CDEA3}.Release|x64.Build.0 = Release|x64 {69BF9B7D-7EB2-7FC5-0009-38CB8C5CDEA3}.Debug|x64.ActiveCfg = Debug|x64 {69BF9B7D-7EB2-7FC5-0009-38CB8C5CDEA3}.Debug|x64.Build.0 = Debug|x64 {69BF9B7D-7EB2-7FC5-0009-38CB8C5CDEA3}.Intel|x64.ActiveCfg = Intel|x64 {69BF9B7D-7EB2-7FC5-0009-38CB8C5CDEA3}.Intel|x64.Build.0 = Intel|x64 {69BF9B7D-7EB2-7FC5-0009-38CB8C5CDEA3}.Release|x64.ActiveCfg = Release|x64 {69BF9B7D-7EB2-7FC5-0009-38CB8C5CDEA3}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal
projectsettings file
<?xml version="1.0" encoding="utf-8"?> <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup Label="UserMacros"> <MAXON_ROOTDIR>..\..</MAXON_ROOTDIR> </PropertyGroup> <PropertyGroup> <_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion> </PropertyGroup> <ItemGroup> <BuildMacro Include="MAXON_ROOTDIR"> <Value>$(MAXON_ROOTDIR)</Value> </BuildMacro> </ItemGroup> </Project>
Debugger Error ...
Error 20 error C2065: 'COLOR' : undeclared identifier c:\program files\maxon\cinema 4d r18\plugins\cinema4dsdk\source\gui\gradientuserarea.cpp 336 1 cinema4dsdk Error 21 error C2065: 'COLOR' : undeclared identifier c:\program files\maxon\cinema 4d r18\plugins\cinema4dsdk\source\gui\gradientuserarea.cpp 337 1 cinema4dsdk Error 22 error C2065: 'COLOR' : undeclared identifier c:\program files\maxon\cinema 4d r18\plugins\cinema4dsdk\source\gui\gradientuserarea.cpp 338 1 cinema4dsdk Error 23 error C2065: 'COLOR' : undeclared identifier c:\program files\maxon\cinema 4d r18\plugins\cinema4dsdk\source\gui\gradientuserarea.cpp 361 1 cinema4dsdk Error 24 error C2065: 'COLOR' : undeclared identifier c:\program files\maxon\cinema 4d r18\plugins\cinema4dsdk\source\gui\gradientuserarea.cpp 362 1 cinema4dsdk Error 25 error C2065: 'COLOR' : undeclared identifier c:\program files\maxon\cinema 4d r18\plugins\cinema4dsdk\source\gui\gradientuserarea.cpp 363 1 cinema4dsdk 26 IntelliSense: identifier "COLOR" is undefined c:\Program Files\MAXON\CINEMA 4D R18\plugins\Cinema4DSDK\source\gui\gradientuserarea.cpp 336 30 cinema4dsdk 27 IntelliSense: identifier "COLOR" is undefined c:\Program Files\MAXON\CINEMA 4D R18\plugins\Cinema4DSDK\source\gui\gradientuserarea.cpp 361 21 cinema4dsdk
-
On 23/05/2017 at 06:38, xxxxxxxx wrote:
Ok I solved the problem, a question, I want to put a dialog box at bottom right in Cinema 4D . How can i do that?
-
On 23/05/2017 at 23:52, xxxxxxxx wrote:
Good morning Lorenzo,
the GeDialog::Open() method has the optional parameter xpos and ypos to specify the position of the dialog. As stated in the documentation if these parameters are left unset the dialog will be opened at the current mouse position. Beside this small hints please have a look at the User Interface Manuals where plenty of details are discussed.
Best, Riccardo
-
On 27/09/2017 at 23:25, xxxxxxxx wrote:
since i moved to a new pc i have visual studio 2017 installed (during the installation of unity3d). now i am having a hard time. is there a way to get things working with vs2017?
i am not able to find a download for vs2013.. they always lead me to newer versions.
any idea where i find it or a way to make things work in 2017?
cheers,
ello -
On 28/09/2017 at 01:20, xxxxxxxx wrote:
Hi Ello, thanks for writing us.
Please note that you can download previous version of VS at https://www.visualstudio.com/vs/older-downloads/.
Best, Riccardo
-
On 28/09/2017 at 06:11, xxxxxxxx wrote:
ah, thank you... finally gon it to install after renaming the installer now in need to port the plugin over, guess this will be a nightmare due to the changes