THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 16/04/2012 at 08:09, xxxxxxxx wrote:
This can be a very confusing subject to people that have never used OOP file structures before.
"symbols.h" found in the "res" folder is not the same file as the description.h file found in the "description" folder.
symbols.h is not used in python plugins. But it is used with Coffee & C++ plugins.
So the place you want to put the ID's is the .h file that sits next to your .res file. inside of the description folder.
Now before you get all comfy with that and try to memorize it. Wait...
There will be times when you make a plugin that does not have a description.h file.
In that case. You could put your ID's at the top of your .pyp file.
*Just understand that these are then global variables that way. And while they work just fine in C4D plugins. Globals are generally considered bad practice in coding.
But you'll see lots of plugins supplied by Maxon and other people using globals in them. I use them myself from time to time when I feel lazy. They are not going to burn your house down.:joy:
So don't freak out about it. It's really the easiest option in some cases.
Just understand that you don't want to use them that way outside of C4D programming.
Think we're done yet? nope.:wink:
What happens if you want to create a resource based dialog plugin with Python?
There is no "description" folder in a plugin like that...Now what?
Instead. There is a "dialogs" folder. And inside of that folder is where you put the .res and .h files.
Sorry if this seems like a complicated answer to your simple question. But frankly. It is a rather complex thing to wrap your head around when you've never done it before.
This object oriented programming stuff, where files are spread out all over the place, can be very confusing.
The big point I'm trying to make is. Don't memorize any one way of doing things. Because it changes depending on what you're doing. There's no single one way that covers every situation.