how to use user custom area
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 26/08/2011 at 09:33, xxxxxxxx wrote:
Thanks Scott one more question:
how to get the instance of a controller inside a dialog?
I mean, if i want to add a new controller as custom area at a group controller how can i do?
Thanks -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 26/08/2011 at 10:16, xxxxxxxx wrote:
I'm not sure I understand your question.
When you say "controller". Are you talking about the various gizmos like: Buttons, textboxes, etc...Are you asking how to lay them out and arrange them in your dialog window?
-ScottA
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 26/08/2011 at 10:26, xxxxxxxx wrote:
yes please help me i can't figure out!
Another thing i can't do is how to call a function when a button is clicked or a textbox changes value.
Thanks and again thanks -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 26/08/2011 at 11:01, xxxxxxxx wrote:
There are two types of methods to layout the gizmos in your dialog. And they depend on which way you create your gizmos.
In both methods. You use Groups to layout your dialog items.
The Coffee SDK docs also have some information on using Groups.Method#1: The internal ("Add") method.
Where you add the gizmo's code to the same file as the code that executes something.Like this:
MyDialog::CreateLayout() { SetTitle("Scale Units"); AddGroupBeginV(1000, BFH_SCALE|BFV_SCALE, 1, "", 0); { AddGroupBorder(BORDER_GROUP_IN); AddGroupBorderSpace(4,4,4,4); AddGroupSpace(4,4); AddGroupBeginV(1001, BFH_SCALE|BFV_SCALE, 2, "", 0); { AddStaticText(1002, BFH_LEFT, 0,0, "X", 0); AddEditNumberArrows(2000, BFH_SCALE, 80, 0); AddStaticText(1003, BFH_LEFT, 0,0, "Y", 0); AddEditNumberArrows(2001, BFH_SCALE, 80, 0); AddStaticText(1004, BFH_LEFT, 0,0, "Z", 0); AddEditNumberArrows(2002, BFH_SCALE, 80, 0); } AddGroupEnd(); return; }
Method#2: The external (.res file) method
Where you use a .res file to layout the gizmos.
Here is another example plugin that uses the external layout method:https://sites.google.com/site/scottayersmedia/Coffee_ResBasedMenuPlugin.zipIt might be helpful if you went to my site and download the CoffeeBible. And watched the videos. They address some of the things you've been asking about:https://sites.google.com/site/scottayersmedia/scripting
Just a word of caution.
Coffee is fading away. And Python is becoming the better choice for scripting in C4D.
But learning Coffee will help you if you decide to transition into C++ later on.-ScottA
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 26/08/2011 at 11:15, xxxxxxxx wrote:
Yes i know already this but the problem is the group is created in design mode by resedit plugin and the custom area is added in a second time in the .cof code.
so i need to get the existing group inside the code and append the custom area.So i understand phyton is better then coffiee (someone could say that in some maxon page?? ) Now if i've to choose a new language it's better use c++ or phyton? And why?
I'm checking your website, thanks!
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 26/08/2011 at 12:09, xxxxxxxx wrote:
From my experience. If someone asks that question they usually aren't ready for C++ yet.
You'll probably want to use Python (or Coffee) for a while. Then if the unsupported things bother you. You can always switch to C++.
-ScottA
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 26/08/2011 at 13:40, xxxxxxxx wrote:
yes but c++ used in c4d has more feature then coffiee or python? That's the second question.
The first and more important for me was:
i need to get the existing group inside the code and append the custom area. -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 26/08/2011 at 14:35, xxxxxxxx wrote:
I'm not sure I understand what you're asking.
If you want to know how to add a CustomUserArea into a plugin using a .res file. Then you would need to do something like this:- Add this to one of the Groups in the .res file: USERAREA MYUSERAREA { SIZE 60, 60; }
- Add this to the .str file: IDS_MYUSERAREA " The User Area";
- Add this to your enum list in your .h file: MYUSERAREA,
The C++ SDK docs do a better job of describing these descriptions than the Coffee SDK does.
If you plan on using .res files. You'll probably want to download the C++ docs.To be honest. I don't even know if this will work properly in Coffee. I've never tried it before.
Coffee tends not to support things like CustomGUI's.
Which represents an example of how Coffee can quickly lead you into a dead end. Where using Python it should work just as well as in C++.Python in C4D isn't that far behind C++ in terms of supported options. That's it's big selling point.
If you want the maximum support. Then of course C++ is the best choice.
But with that comes the down sides of longer, more complicated code. And the need to use a compiler.
I'm not trying to talk you out of C++. I'm just saying you should see what Python can do for you first. You might be surprised how much it supports.
Then you can make an informed decision whether or not it's worth the extra time to use C++ and a compiler.-ScottA
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 26/08/2011 at 14:57, xxxxxxxx wrote:
now i can understand why c++ is best choose for coding plugin for c4d.
now yes.
I know pretty well c++ and i know it is very power language but i didn't knew if c++ was better then coffiee on the c4d plugin SDK or if this was perfectly the same for the 3 languages. I thought languages was just a feeling choose in the case of c4d SDK but you say me no, so my choose is c++ now becouse i already know this.
i preferred coffiee becouse seem to be more simple but with same power on c4d. the answer is no, and now i know. GOOD.Now i know that, just another question for you: how is possible to create the Dialog GUI in c++ if c++ doesn't use RES files? All programatically? Thanks
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 26/08/2011 at 15:28, xxxxxxxx wrote:
C++, Python, and Coffee all reference the .res files the same way.
In C++ you have the same choice whether to use the Add method in your .cpp files.
Or to use an external .res file.If you are familiar with C++ and want to pursue that direction. Then the first thing you'll need to do is download the C++ docs. Then compile the SDK found in your plugins folder.
The SDK has lots of examples you can learn from in it.If you have questions on compiling the SDK. The first part of my Intro to C++ tutorial shows how to compile the SDK.
Most of the guys in this forum are long time C++ users. And they can offer help on that better than I can.Good Luck,
-ScottA -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 26/08/2011 at 15:29, xxxxxxxx wrote:
thanks for your support