Tag Plugin and GetActiveObject()



  • 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:

    User Information:
    Cinema 4D Version:   11 
    Platform:    Mac  ;  
    Language(s) :     C++  ;

    ---------
    Hello,

    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.

    Example:
    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
    Macm



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 12/12/2008 at 06:19, xxxxxxxx wrote:

    Sorry, I see: the Draw function should do the trick.



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    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.



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 13/12/2008 at 07:27, xxxxxxxx wrote:

    Howdy,

    As Robert mentioned, if the object in question is the object the tag is on, you can also use:

    > \> if(op->GetBit(BIT_ACTIVE)) \>

    ... to determine if that object is selected.

    Adios,
    Cactus Dan



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    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.



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 15/12/2008 at 08:13, xxxxxxxx wrote:

    Howdy,

    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.

    Adios,
    Cactus Dan


Log in to reply