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 23/03/2015 at 09:27, xxxxxxxx wrote:
User Information: Cinema 4D Version: R16 Platform: Mac OSX ; Language(s) : C++ ;
--------- Hi,
I'm working on an object-plugin. I have implemented the method Command, but it seems it doesn't get called. Here is my method:
Bool MyPluginData::Command(Int32 id, const BaseContainer &msg) { if (id == HIPNULLPTR_POS_Y) { GePrint("The slider is pressed!"); }
return true; }
Did I do something wrong here? Or did I simply forget something? I've looked for hours on the internet, in the SDK, but still found no answer.
Thanks for your help and time! Greetings, Casimir Smets
On 23/03/2015 at 11:46, xxxxxxxx wrote:
Mainly only buttons really trigger Command(). For other controls, you need to use Message().
On 23/03/2015 at 17:44, xxxxxxxx wrote:
And actually Command() is not a method of the ObjectData class, but GeDialog. If you want to notice when a value was changed, override Message() and catch the MSG_DESCRIPTION_* message that matches your needs.
Best Niklas
On 24/03/2015 at 06:31, xxxxxxxx wrote:
Hi,
Well, that did it, especially the MSG_DESCRIPTION. With my slider I needed the MSG_DESCRIPTION_CHECKUPDATE inside Message.
You can mark this as closed!! Thanks for your help guys!!
Greetings, Casimir Smets
On 24/03/2015 at 06:52, xxxxxxxx wrote:
Well, it worked when I had a simple GePrint. Now with some additional methods it doesn't work anymore. Here is my code in Message:
if (type == MSG_DESCRIPTION_CHECKUPDATE) { BaseObject* op = (BaseObject* )node; BaseDocument* doc = (BaseDocument* )data; EditHipNullptr(op, doc); GePrint("The slider is pressed! - CheckUpdate"); }
And the code from EditHipNullptr:
BaseObject* CharacterCreatorData::EditHipNullptr(BaseObject* op, BaseDocument* doc) { BaseObject* hipNullPtr = doc->SearchObject("Hip_Nullptr"); BaseContainer* bb = op->GetDataInstance(); hipNullPtr->SetRelPos(Vector(0, bb->GetInt32(HIPNULLPTR_POS_Y), 0)); hipNullPtr->Message(MSG_UPDATE); return hipNullPtr; }
When I change the slider in Cinema 4D, the application doesn't respond anymore. Does somebody have an idea what could be the problem here?
On 24/03/2015 at 07:52, xxxxxxxx wrote:
Hello,
the data of MSG_DESCRIPTION_CHECKUPDATE is not a BaseDocument but of the type DescriptionCheckUpdate. In that structure you will find a pointer to the document.
Also, you don't have any nullptr-checks in your code, so when SearchObject() fails it must crash.
Best wishes, Sebastian
On 24/03/2015 at 08:10, xxxxxxxx wrote:
Hi Sebastian,
That did it! Thank you very much! I also changed my method for nullptr-checks. You can surely mark this as closed now!