Send Message to Weight Tag

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

    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

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

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

    Thanks Andreas.

Log in to reply