MSG_DESCRIPTION_COMMAND does nothing [SOLVED]
-
On 08/05/2015 at 09:29, xxxxxxxx wrote:
check SDK example, MorphMixer.
-
On 08/05/2015 at 13:16, xxxxxxxx wrote:
For the test ObjectData you created, please post the entire .res file and the complete Message() function - presumably both are very short
Then we should be able to find the problem.
Steve
-
On 09/05/2015 at 06:57, xxxxxxxx wrote:
Hi,
Mohamed, I did follow the SKD example
Steve, here is my code:
My .res file:CONTAINER Omyplugin { NAME Omyplugin INCLUDE Obase; GROUP ID_OBJECTPROPERTIES { BUTTON MY_BUTTON { } } }
My Message method:
Bool MyPluginData::Message(GeListNode* node, Int32 type, void*data) { if (type == MSG_DESCRIPTION_COMMAND) { GePrint("A button has been pressed"); } return true; }
I hope this gives enough information.
And guys, I really really appreciate your help!!Greetings,
Casimir Smets -
On 10/05/2015 at 09:41, xxxxxxxx wrote:
When you run it in the debugger, what happens? If you click the button, is Message() called at all?
Steve
-
On 11/05/2015 at 06:52, xxxxxxxx wrote:
Hi,
It's kinda weird when I run it in the debugger. I go to my breakpoints inside Message() but it seems to ignore my GePrint.
I really don't know what is wrong :sGreetings,
Casimir Smets -
On 11/05/2015 at 07:28, xxxxxxxx wrote:
Okay,
To make it extra weird: I get my output (A button has been pressed) when I type a value in one of my REALs and press enter.
So, instead of calling MSG_DESCRIPTION_COMMAND when a button is actually pressed, it calls it when I change my REAL by pressing enter. (Even when I do not change it, when I just press enter to refresh).
If I, however, press my button, the whole debug goes nuts and I get this:
SocketIOWait cancelled because of timeout.
Also no output in the console when I press my button (which it should do).I hope this gives some useful information to solve this problem..
Thanks in advance for your help and time!
Greetings,
Casimir Smets -
On 11/05/2015 at 09:21, xxxxxxxx wrote:
Hi Casimir,
I'm sorry you are having such a hard time with this.
MSG_DESCRIPTION_COMMAND is such basic functionality and used in so many occasions inside C4D, that I can hardly believe there's a bug in C4D causing your problems. So I basically agree with Steve and Katachi, without looking at your code it will be hard to help.
Furthermore, while we are always willing to help, debugging user's code actually does not belong to the things we are supposed to do. So you may need to rely on help from the community in this case.
Maybe the article about debugging on our blog can also be of help and provide you with ideas, how to look for the cause of your problem:Debugging Cinema 4D Plugins Written in C++
[URL-REMOVED]
[URL-REMOVED] @maxon: This section contained a non-resolving link which has been removed.
-
On 11/05/2015 at 10:23, xxxxxxxx wrote:
Hi Andreas,
A few posts above is all the code related to my problem that I can give.
I also can't believe that it would be a bug, but I can't find what's the problem either.
I've tried it in my plugin, also in an empty plugin, and they both give me the same problem.
I looked inside my _BugReport.txt file to see what caused the crash, but that's just chinese to me, or kind of.Thanks for your help and time!
Greetings,
Casimir Smets -
On 11/05/2015 at 10:41, xxxxxxxx wrote:
Hi,
After some searching, I maybe found part of the problem.
After another bug splat error, I've looked inside my Problem Report for CINEMA 4D, and I found something like this:
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 c4dplugin.xlib 0x000000010be4319f 0x10bd8a000 + 758175
1 csb.dylib 0x000000011fb12b07 BaseDocument::SearchObject(String const&) + 55 (c4d_basedocument.cpp:261)
2 csb.dylib 0x000000011fb0d03f MyPluginData::Message(GeListNode*, int, void* ) + 287 (character.cpp:43)It seems like there is a problem with SearchObject, but I don't know what yet.
Does this say anything to someone?Thanks for your help and time!!
Greetings,
Casimir Smets -
On 12/05/2015 at 05:11, xxxxxxxx wrote:
Hi,
I've found my problem, but I really didn't expect this.
Later on in my code inside MSG_DESCRIPTION_COMMAND I call doc->SearchObject("MyPluginObject");
Apparentally, this gives a huge error, which even causes previous lines to not get executed, or something like that?
Of course I didn't think of that, because my method starts with a GePrint, and after that a check of which button has been pressed. Only after that check, it searches for an object.
In my logic, the GePrint should still be printed, regardless if it finds the object or not. Aparentally, that doesn't happen.
So changing SearchObject() to GetFirstObject() fixed my problem here.Thanks for all your help and time!
This post may be marked as solved.
Greetings,
Casimir Smets