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

    Xpresso Motion Graphics Data Can not add global matrix and color ports

    Cinema 4D SDK
    python
    2
    3
    136
    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.
    • J
      JoelJohera
      last edited by

      To whom it may concern,
      I am trying to create an Xpresso Motion Graphics Data node and add two ports, a Global Matrix and a Color, with a Python script.
      I have this code:

      import c4d
      
      def main():
          doc = c4d.documents.GetActiveDocument()
          null= doc.SearchObject("Null")
          xtag = c4d.BaseTag(c4d.Texpresso)
          null.InsertTag(xtag)
          gv = xtag.GetNodeMaster()
      
          motion_data_node = gv.CreateNode(gv.GetRoot(), 1019010)
          motion_data_node_in_index = motion_data_node.GetInPorts()[0]
          motion_data_node_in_object = motion_data_node.GetInPorts()[1]
          motion_data_node_out_global_matrix = motion_data_node.AddPort(c4d.GV_PORT_OUTPUT, c4d.GV_OBJECT_OPERATOR_GLOBAL_OUT)
          print(motion_data_node_out_global_matrix)
          motion_data_node_out_color = motion_data_node.AddPort(c4d.GV_PORT_OUTPUT, c4d.ID_BASEOBJECT_COLOR)
          print(motion_data_node_out_color)
      
          c4d.EventAdd()
      
      if __name__=='__main__':
          main()
      

      In the console I get:

      None
      None
      

      And the node:
      3a572591-ee41-418a-a756-320ac1898d61-image.png
      Also, I am using number 1019010 to create the node as I failed to find the name of the motion graphics data node type in Graph View Node Types.

      Thank you for your time.
      Joel Johera

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

        Hey @JoelJohera,

        you are using the wrong symbols you cannot just use the symbols for the object operator. I am not 100% sure what you are trying to do, but I think the symbols you are looking for are GV_MG_DATA_OGMATRIX and GV_MG_DATA_OCOLOR. See Motion Graphics Data for details.

        And you are right about the OP list, the Mograph stuff is missing. That is because this list, other than the rest, is not auto generated and we forgot to add them. I have fixed that for a future release. But that does not mean that the symbols do not exist. You are looking for ID_OPERATOR_MG_DATA.

        5821059f-5303-41bb-ac09-432e5fe445f4-image.png

        Cheers,
        Ferdinand

        e8a7ccf3-6255-4a4f-b9a7-240997fcac4d-image.png

        import c4d
        
        def main():
            doc = c4d.documents.GetActiveDocument()
            null= doc.SearchObject("Null")
            xtag = c4d.BaseTag(c4d.Texpresso)
            null.InsertTag(xtag)
            gv = xtag.GetNodeMaster()
        
            motion_data_node = gv.CreateNode(gv.GetRoot(), c4d.ID_OPERATOR_MG_DATA)
            motion_data_node_in_index = motion_data_node.GetInPorts()[0]
            motion_data_node_in_object = motion_data_node.GetInPorts()[1]
            motion_data_node_out_global_matrix = motion_data_node.AddPort(c4d.GV_PORT_OUTPUT, c4d.GV_MG_DATA_OGMATRIX)
            print(motion_data_node_out_global_matrix)
            motion_data_node_out_color = motion_data_node.AddPort(c4d.GV_PORT_OUTPUT, c4d.GV_MG_DATA_OCOLOR)
            print(motion_data_node_out_color)
        
            c4d.EventAdd()
        
        if __name__=='__main__':
            main()
        

        MAXON SDK Specialist
        developers.maxon.net

        1 Reply Last reply Reply Quote 0
        • J
          JoelJohera
          last edited by

          Thank you so much

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