Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware 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
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    Detect tool button pressed - outside tool plugin

    Cinema 4D SDK
    r20 python c++
    2
    5
    736
    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.
    • C4DSC
      C4DS
      last edited by

      Hi again,
      I know this is quite a strange request, but is there a way to detect the press of a tool's description button, outside of the Message() of that tool plugin?

      Let's say I am wanting to add a button to the Modeling Axis tab of the Live Selection tool. For this I edited the toolmodelingaxis.h, .res, .str files.
      Since I cannot add functionality to the original Modeling Axis tool, I am looking for a way to detect the press of the additional button.
      Can this be detected via a c4d.plugins.MessageData's CoreMessage() ? Or do I need a C++ SceneHook for this?

      An alternative solution would be to implement a CommandData, with dialog containing the button, and dock the dialog somewhere in the layout.
      But I would prefer to have that button inside of the original tool's description, next to the other attributes.

      ferdinandF 1 Reply Last reply Reply Quote 0
      • ferdinandF
        ferdinand @C4DS
        last edited by

        Hello @c4ds,

        thank you for reaching out to us. What you could technically do, is use AddEventNotification which usually must be used in tandem with BaseList2D::FindEventNotification and ::RemoveEventNotification to handle the attached notifications. This would then cause MSG_NOTIFY_EVENT to be broadcasted to whatever node you attached the notifications.

        But these methods are marked as private intentionally, so we cannot provide any support on them. We also must point out that we do not condone modifying the resources of Cinema 4D. While extending the resource of some entity will be likely without consequence for Cinema 4D or your plugin at the moment, there is no guarantee that this will hold true in the future. You cannot modify the resources of Cinema 4D.

        The closest you could get in a conformant manner to do what you want to do, is to wrap around the modelling axis tool. I.e., provide a button to execute the tool and set the tool data container before to the values which are fitting for your usage. And then do something after that.

        We understand that this might not be the answer you wanted but modifying the resources of Cinema 4D is really off limits.

        Cheers,
        Ferdinand

        MAXON SDK Specialist
        developers.maxon.net

        C4DSC 1 Reply Last reply Reply Quote 0
        • C4DSC
          C4DS @ferdinand
          last edited by

          @ferdinand

          I had searched the forums earlier and found quite some references to AddEventNotification used over the years.
          However, using that technique requires a "host" to be available.
          In my case I don't see a scenario with a mandatory BaseList2D always available, except for the active document.
          But still worth a shot ...

          The reason I was experimenting with the Cinema4D resources was because this is for personal use only (exclusively within R20), and not meant as a plugin to be made public. As such, I would be future-safe, since no further development will be released for R20.

          ferdinandF 1 Reply Last reply Reply Quote 0
          • ferdinandF
            ferdinand @C4DS
            last edited by

            Hello @C4DS,

            unless I am overlooking something here, you cannot use a BaseDocument since you need access to the Message implementation of the node you are adding to the message stream of the 'other' node. Which you should not have for BaseDocument.

            So, the implication of my last posting was that you have some kind of NodeData derived plugin to which the tool data message would be rerouted. And the reason why we deem AddEventNotification public is that you can easily crash Cinema 4D with it when you are not careful. Again, I am sorry, but I cannot go any further here, because AddEventNotification is private and we cannot condone what you are trying to do in the first place.

            Cheers,
            Ferdinand

            MAXON SDK Specialist
            developers.maxon.net

            1 Reply Last reply Reply Quote 0
            • C4DSC
              C4DS
              last edited by

              As I won't be spending more time on this project there is no need for delving further into the subject. As such I am setting the status of the topic to "solved".

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