THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 12/12/2008 at 05:48, xxxxxxxx wrote:
Cinema 4D Version: 11
Platform: Mac ;
Language(s) : C++ ;
I am writing a Tag Plugin that changes the values of an object depending on its status (if it is selected or not selected).
I have the problem that when I call GetActiveDocument()->GetActiveObject() in the Execute function it doesn't return the current selection but the previous selection state.
Object Cube is deselected. I select the Cube in the editor. Execute is triggered but GetActiveDocument()->GetActiveObject() says the Object is not selected. Only as recently as next time Execute is triggered it says Cube is selected.
Thanks in advance
On 12/12/2008 at 06:19, xxxxxxxx wrote:
Sorry, I see: the Draw function should do the trick.
On 12/12/2008 at 09:18, xxxxxxxx wrote:
1. Use the BaseDocument* doc sent to Execute (!).
2. If the object in question will always be the one containing the tag, use the BaseObject* op sent to Execute. Otherwise, use doc->GetActiveObject().
3. Draw is for drawing elements of your plugin into the editor view.
On 13/12/2008 at 07:27, xxxxxxxx wrote:
As Robert mentioned, if the object in question is the object the tag is on, you can also use:
> \> if(op->GetBit(BIT_ACTIVE)) \>
\> if(op->GetBit(BIT_ACTIVE)) \>
... to determine if that object is selected.
On 15/12/2008 at 04:17, xxxxxxxx wrote:
Thanks for the replies,
maybe there is something wrong with my code but at the moment Execute is called, the selection is NOT yet set to the right value (regardless if I test with GetActiveObject() or BIT_ACTIVE) but the previous value.
On 15/12/2008 at 08:13, xxxxxxxx wrote:
Well, it may be that the object isn't active yet when the Execute() function is called the first time.
Try using the Message() function to check the object.