Well, I have a simple shader plugin that does compile and work fine under Mac.
It compiles under VC, it is even initialized in Cinema - however: It is not available in the shader list.
No error messages in the terminal.
change your plugin id and check that all your res files are correct.
check in main , be sure it is returning true.
I double checked the plugin ID and the res files. I changed the Mac style line endings to DOS-style line endings in the res files. It's the only plugin installed.
Condidered that Cinema is showing "Initializing MyPlugin" I assume that the plugin is returning true - is that correct?
Since it works on the mac but not on the pc it's almost with 100% certainity a global object somewhere in your code, or a static object in a function. These will break the PC API, since they are initialized before the memory manager is ready.
yes, globals can stop a plugin from running.
the only globals you can use are those with a fixed size.
An easy work around is to build your own structure and put everything global in there. Make 1 global instance of your structure and access that instance from all your plugins / classes. This way you can use anything you like as a global and its also nice and clean.
That works, but to be clear you can only have a global pointer to that structure, not make the whole structure instance global. You can allocate the structure in your PluginStart() function and deallocate it in PluginEnd().
However, if you're using library code that makes use of its own static or global objects you have to use the other workaround/fix.
Mmmh, I don't have any globals - well, except the global struct that is used in exactly the way it is used in the SDK.
Thanks for any help in this frustrating situation.
What "global struct"? Did you try setting a breakpoint on the Register() function to see if the execution ever gets there?
Beside the line with the central algorithm and the plugin ID there is *no* (and I mean literally no) difference at all between the SDK Gradient example and my plugin. The same is true for the global struct. In fact, it all works when I copy/paste the code directly into the SDK example.
Adding a class always creates a new file. How to add a file that already contain the class definition? I'm completely lost with these f*#%ing assistants, and the German translation is so bad that I'm seriously thinking about getting the English version.
I'm just searching for a quick and solid way to set up a VC project, starting from the *.cpp and *.res files. I shouldn't have to do much more than to drop the source files, set the target name and compile.
Currently it looks like I have to learn a fubar system just to compile my files for Windows.
Now we're getting somewhere. Are you saying that you're trying to create the VC project from scratch? That will be hard. Do as I guess you did on the mac and base the project on the cinema4dsdk workspace. Then you just have to replace the files in the file view and change the linker output filename in the settings to yourplugin.cdl.
You shouldn't have to use the assistants. Just add the files and VC will find the classes.
However, the plugin doesn't show up in the shader list, and the plugin class doesn't show up in VC's class browser. Especially the latter is very disturbing and seems to point to an error - as in the SDK all the classes are shown with their methods in the class browser.
This is Visual C++ .net 2002, if that matters.
P.S.: Also there are 3 unused local variables in the class' output method, which throw a warning in MW - I don't know if they shouldn't do in VC as well.
Hmm, that's strange. Could you try placing breakpoints in PluginStart() and your Register() function to see if they are ever called?
What do you mean by "- Save Project map and Project under a new name"? I guess this is VC.NET terminology for Workspace and Project? I haven't done this from within VC, since I don't think it's possible in VC6. You could try doing this step by simply renaming the .dsw and .dsp files. VC should ask you to locate the new files when you open yourplugin.dsw.
I'll try renaming "Sterner Style" tomorrow.
P.S.: The unused variabled are needed in a line of code that's currently commented out... As the compiler doesn't do anything with an unused variable anyway - I leave them in there to remind me that there is some code that is meant to be included later in the release.