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

    Assign a standard icon to a script automatically

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

      THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

      On 11/09/2012 at 03:25, xxxxxxxx wrote:

      C4D Ver. 13
      Lang: python

      Hi Everyone, 
      this is probably a noob question but I can't figure it out. I created some (very basic) scripts that simply add a c4d tag to an object. I made it for xpresso tag, target, and some other tags I use frequently, to have them docked in the interface. The code is this simple:

      import c4d
      from c4d import gui
      #Welcome to the world of Python
        
        
      def main() :
         obj = doc.GetActiveObject()
         if obj is None :
            gui.MessageDialog('Nessun oggetto selezionato')
            return
         doc.StartUndo()
         xtag = c4d.BaseTag(c4d.Texpresso)
         obj.InsertTag(xtag)
         c4d.EventAdd()
         doc.AddUndo(c4d.UNDOTYPE_NEW, xtag)
         doc.EndUndo()      
         
        
      if __name__=='__main__':
          main()
      

      The script by default has the generic python icon, is possible to have it assigned one of the standard C4D icons that represent the tag is going to be created ?

      Thank for any advice !
      Max

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

        THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

        On 11/09/2012 at 05:32, xxxxxxxx wrote:

        Hi, create an icon file (*.tif) and put it with the same name as the script in the same folder.

        test.py
        test.tif

        Cheers, Seb

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

          THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

          On 11/09/2012 at 06:12, xxxxxxxx wrote:

          Hi, and thanks for your reply !
          I kinda knew this method, but still it requires me to generate an icon file each time/script. 
          What I would like to do is to fetch an icon from (already registered) standard c4d icons in the script, and assign it to the script itself. For standard icons I mean this: http://chicagoc4d.com/C4DPythonSDK/modules/c4d.bitmaps/

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