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
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    MatAssignData Message? [SOLVED]

    SDK Help
    0
    2
    258
    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
      Helper
      last edited by

      On 06/11/2016 at 10:00, xxxxxxxx wrote:

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

      ---------
      Hello,

      Is there a message that gets sent/fired when a MatAssignData object gets updated (ex: InsertObject or DeleteObject gets called)? Tried looking through the SDK examples, but it seems no examples use MatAssignData.

      I'm hoping my MaterialData plugin can do something when its MatAssignData gets updated.

      Thanks,
      Ian

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

        On 08/11/2016 at 13:43, xxxxxxxx wrote:

        Hi Ian, thanks for writing us.

        Actually a plausible workaround to get acknowledged about a material assignment to an object is to override in your MaterialData-derived class the Message() method and filter for:

        • MSG_MATERIALDRAGANDDROP - which occurs when a material is assigned to an object by drag 'n drop in the viewport or my using click on Apply on the contextual menu reached by RMB-clicking on a material thumbnail -;
        • MSG_DRAGANDDROP - which occurs when a the material is dragged on an Object or on an existing Texture Tag.

        Last but not least, it's also relevant to know that if an object is dragged 'n dropped from the Object Manager to the Material Assignment list in your material "Assign" tab neither MSG_MATERIALDRAGANDDROP nor MSG_DRAGANDDROP are  fired and you would be able to detect the assignment (at least from the test I run)

        Feel free to come back if any  further detail is required.

        Best, Riccardo

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