Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.
Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).
On 03/11/2014 at 15:43, xxxxxxxx wrote:
User Information: Cinema 4D Version: 13+ Platform: Windows ; Language(s) : C++ ;
--------- I have checked _LookAtCamera example, and this thread https://plugincafe.maxon.net/topic/7716/9757_how-to-dynamically-add-description-elements&KW=GetDDescription
I understand how it works to some extent, but got some questions: 1- in _ _LookAtCamera example, there is this snippet:
const DescID* singleid = description->GetSingleDescID();
DescID cid = DescLevel(6001, DTYPE_GROUP, 0); if (!singleid || cid.IsPartOf(*singleid, nullptr)) // important to check for speedup c4d! {;//code here}
_GetSingleDescID() is not documented, so correct me at these points: a- I consider if it succeeds , it returns a value to singleid b- this if statement is entered only once at the first creation of the description elements, so it fits ONLY to non-changeable descriptions "similar to creating GUI using text files instead of C++ functions" , and I expect it to create garbage for a truly dynamic GUI c- initial values are 0 (because they are not set in the init function), so why using _SetBool(DESC_DEFAULT, true)
2- the seconds question is so simple, I want to put the GUI in columns, similar to when you startup Cinema 4D, in the Project settings: FPS.......................30 Project Time........... 0 f Minimum Time......0 f Maximum Time ...... 90 f
3- what if I want to create a whole command menu inside a "right click", so if the user did a right click on a specific "gui text" this command menu appears
_
On 04/11/2014 at 02:45, xxxxxxxx wrote:
for the ( 1-c ) question, I understand now how it works, it is the value of "reset to default" , other questions still need answers
edit: about question ( 2 ) , I know how to do it now, from this example: http://www.andrewnoske.com/wiki/Cinema_4D\_-\_my_C%2B%2B_plugins\_-\_object_converter
On 04/11/2014 at 05:44, xxxxxxxx wrote:
Sometimes, Cinema will ask you for the description of only a single element. If the singleid you get is not nullptr, you should fill the Description only for this DescID and leave everything else out (important for performance reasons)
On 04/11/2014 at 07:35, xxxxxxxx wrote:
thanks Niklas for clarification, so this function won't change the behavior of anything, just a performance check "so I can put it there and forget about it without worries"
what about question 3
On 04/11/2014 at 11:15, xxxxxxxx wrote:
Hi Mohamed, sorry, I wanted to get to your issues way earlier... To be honest, I'm not sure about question 3. I know, you can have your own popup menu (I think, that's what it is called in SDK docs) on a GeUserArea, when programming your own CustomGUI. But I don't think this is possible in normal descriptions. And I don't recall having seen this anywhere. Could you give me a pointer, if (and if, where) this is already done somewhere in C4D. There is an option to extend the existing popup menus in the same way, as normal menus (see Windows->Customization->Customize Menus to get an idea of the existing menus). Be aware: In this case your change will appear in every occasion this menu is used. I think, there should be very good reasons to go this road. User may not like, getting there popup menus changed.
On 04/11/2014 at 11:38, xxxxxxxx wrote:
Hi Andreas, I think with your reply I'm getting closer to what I need I'm creating a node based material system for my render engine, this material system will have also a tree view representation, this tree view should be able to do "right click" , then add nodes depending on the right click menu
I think you got now an idea about what I'm after, any simple example of GeUserArea and CustomGUI would be appreciated, plus your guidelines
On 04/11/2014 at 13:37, xxxxxxxx wrote:
I'll extend the asynctest SDK example tomorrow morning to have a small popup menu.
On 04/11/2014 at 23:00, xxxxxxxx wrote:
Mohamed,
in SDK examples AsyncTest.cpp add the following enumeration for some menu IDs (code for R15+) :
enum { MY_POPUP_ID_FIRST = FIRST_POPUP_ID, MY_POPUP_ID_SUBMENU, MY_POPUP_ID_SUBMENU_FIRST, };
Then in Bool SDKGradientArea::InputEvent(const BaseContainer& msg) add the following as last else if:
else if (chn == BFM_INPUT_MOUSERIGHT) { BaseContainer bcPopupMenu; BaseContainer bcSubmenu; Int32 mx = msg.GetInt32(BFM_INPUT_X); // of course you can use mouse position to have popup menu be position sensitive Int32 my = msg.GetInt32(BFM_INPUT_Y); Global2Local(&mx, &my); Local2Screen(&mx, &my); // instead of building the menu everytime, you may better have a prepared container ready bcPopupMenu.SetString(MY_POPUP_ID_FIRST, "First menu entry"); bcSubmenu.SetString(1, "A submenu"); bcSubmenu.SetString(MY_POPUP_ID_SUBMENU_FIRST, "Submenu entry"); bcPopupMenu.SetContainer(MY_POPUP_ID_SUBMENU, bcSubmenu); const Int32 menuId = ShowPopupMenu(nullptr, mx, my, bcPopupMenu); switch (menuId) { case MY_POPUP_ID_FIRST: GePrint("Execute first popupmenu entry"); break; case MY_POPUP_ID_SUBMENU_FIRST: GePrint("Execute first submenu entry"); break; case 0: GePrint("Menu got canceled"); break; default: DebugStop("Popup Menu: Forgot a new enum value?"); } // maybe use SendParentMessage() if need be }
The docs on this topic aren't that bad either: R16 SDK Docs: c4d_gui.h
On 05/11/2014 at 02:54, xxxxxxxx wrote:
thanks a lot , will test tonight and come back to you
On 05/11/2014 at 14:25, xxxxxxxx wrote:
Hi Andreas,
I have checked it!! , it is a very interesting example , this is really very helpful, thanks again for your support, keep the good work up
On 06/11/2014 at 02:13, xxxxxxxx wrote:
just need to confirm about question ( 1-a , 1-b ) , I use this if statement in all created description, or no need at all? need some discussion about what happens here
On 06/11/2014 at 02:17, xxxxxxxx wrote:
Can you show me a piece of your code? Will make discussion easier.
On 06/11/2014 at 03:00, xxxxxxxx wrote:
it is the example LookAtCamera , LookAtCamera::GetDDescription(), all of the written description are created the same way with a check for performance, need to understand how this works, if there is no specific explanation , is it safe to do the same with all created description? (so I just write them the same way and forget about them) , or this is written in specific situations
On 06/11/2014 at 03:43, xxxxxxxx wrote:
You mean the
if (!singleid ||...
part? Yes, you should do it exactly like it is done in the lookatcamera example. As Niklas said, it's a performance optimization, in case C4D is asking for a single description only.
On 06/11/2014 at 04:13, xxxxxxxx wrote:
yes ok thanks
On 17/11/2014 at 10:01, xxxxxxxx wrote:
sorry for asking again, but I found that I didn't know yet how to adjust the format of data "question (2)" , the above link that I posted was for Dialogs, didn't notice this, so hope you may reply with a simple example to question (2)
edit:I find that DESC_COLUMNS is doing the job, but what about putting stuff in an irregular way, like:
button1 button2 button3 button4 button5 button6 button7
edit2: I would love to know how to create something similar to this Dialog http://www.andrewnoske.com/wiki/Cinema_4D_-_my_C%2B%2B_plugins_-_add_text in GetDDescription() , the combo box, the radio group, etc..
On 17/11/2014 at 12:10, xxxxxxxx wrote:
nvm, I find the solution here: https://plugincafe.maxon.net/topic/7380/8990_getting-dynamically-added-long-cycle-string-value&KW=GetDDescription
On 17/11/2014 at 14:05, xxxxxxxx wrote:
Ah, you were too quick. I was just compiling an example for you... Nevertheless glad you found your solution.
On 11/01/2016 at 05:14, xxxxxxxx wrote:
as this is related to ShowPopupMenu() how to put icons in the menu?