Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware 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

    Create object with custom icon in Python

    Cinema 4D SDK
    python
    2
    3
    806
    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.
    • M
      mdr74
      last edited by r_gigante

      Hi,
      I'm trying to write a python script to create a Null with a custom icon (with the same icon ID of the PBR light, just for test)
      but I cannot modify the icon.
      it give me no error so I don't know what's wrong

      thanks

      nul = c4d.BaseObject(c4d.Onull)
      nul.SetName('New Test Icon')
      doc.InsertObject(nul)
          
      nul[c4d.ID_BASELIST_ICON_FILE] = 1021433
      c4d.EventAdd()
      
      1 Reply Last reply Reply Quote 0
      • M
        mdr74
        last edited by

        Found it

        I think it needs a string not an int

        nul = c4d.BaseObject(c4d.Onull)
        nul.SetName('New Test Icon')
        doc.InsertObject(nul)
            
        nul[c4d.ID_BASELIST_ICON_FILE] = "1021433"
        c4d.EventAdd()
        
        1 Reply Last reply Reply Quote 0
        • ManuelM
          Manuel
          last edited by

          hello,

          good you found out how to resolve your issue,

          for you next thread, please mark your thread as a question as follow

          • Q&A New Functionality.

          Cheers
          Manuel

          MAXON SDK Specialist

          MAXON Registered Developer

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