Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Recent
    • Tags
    • Users
    • Login

    Tag Plugin and GetActiveObject()

    Scheduled Pinned Locked Moved SDK Help
    6 Posts 0 Posters 513 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H Offline
      Helper
      last edited by

      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

      1 Reply Last reply Reply Quote 0
      • H Offline
        Helper
        last edited by

        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.

        1 Reply Last reply Reply Quote 0
        • H Offline
          Helper
          last edited by

          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.

          1 Reply Last reply Reply Quote 0
          • H Offline
            Helper
            last edited by

            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

            1 Reply Last reply Reply Quote 0
            • H Offline
              Helper
              last edited by

              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.

              1 Reply Last reply Reply Quote 0
              • H Offline
                Helper
                last edited by

                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

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post