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

    How to create Python Node via Python Script?

    Scheduled Pinned Locked Moved PYTHON Development
    4 Posts 0 Posters 341 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 03/01/2016 at 15:20, xxxxxxxx wrote:

      How do I create a Python Node via a script in Python? I do not seem to see an ID for the node ala ID_OPERATOR_OBJECT but I was looking through the symbols and I didn't see one in Python in there.

      Is it possible to create a Python node via a python script?

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

        On 03/01/2016 at 18:01, xxxxxxxx wrote:

        import c4d  
        def main() :      
           
          obj = doc.GetActiveObject()  
            
          xTag = obj.GetTag(c4d.Texpresso) #Get the first xpresso tag on the object  
          
          nm = xTag.GetNodeMaster()  
          
          #Creates a python node  
          PyNode = nm.CreateNode(nm.GetRoot(), 1022471, insert=None, x=200, y=200)  
          
          c4d.EventAdd()  
          
        if __name__=='__main__':  
          main()
        

        -ScottA

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

          On 04/01/2016 at 00:31, xxxxxxxx wrote:

          Hello,

          the Python Node ID is defined as 1022471 in the gvpython.h header file.

          See also "python node".

          best wishes,
          Sebastian

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

            On 15/01/2016 at 09:21, xxxxxxxx wrote:

            Hello xfon5168,

            was your question answered?

            Best wishes,
            Sebastian

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