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

    Send Message to Weight Tag

    Scheduled Pinned Locked Moved PYTHON Development
    3 Posts 0 Posters 334 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

      On 05/11/2016 at 18:35, xxxxxxxx wrote:

      Hello Forum,

      I'm writing a script to resize a rig and would like to send c4d.ID_CA_WEIGHT_TAG_SET to a weigh tag.

      I found this C++ link:
      https://developers.maxon.net/forum/topic/5222/5217_reset-bind-pose&KW=set+bind+pose&PID=21410#21410

      This does not work:

      tag.Message(c4d.MSG_DESCRIPTION_COMMAND, c4d.DescID(c4d.DescLevel(c4d.ID_CA_WEIGHT_TAG_SET)))
      

      Python Error:

      Traceback (most recent call last) :
        File "'active-layer.pypv'", line 515, in CoreMessage
        File "'active-layer.pypv'", line 176, in ActiveLayerIsOn
      TypeError: C4DAtom.Message expected dict, not c4d.DescID
      

      So I made a guess and this seems to work:

      tag = op.GetTag(c4d.Tweights)
      data = dict()
      data['id'] = c4d.ID_CA_WEIGHT_TAG_SET
      tag.Message(c4d.MSG_DESCRIPTION_COMMAND, data)
      

      Is this the correct way to Message() a C4DAtom with a script?

      Thank you,

      Joe Buck

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

        On 07/11/2016 at 02:38, xxxxxxxx wrote:

        Hi Joe,

        there's nothing wrong with your solution.
        A bit shorter, the same could be achieved by using CallButton(), but there's really no difference otherwise.

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

          On 07/11/2016 at 07:00, xxxxxxxx wrote:

          Thanks Andreas.

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