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

    How to access bitmap format from plugin id

    Scheduled Pinned Locked Moved PYTHON Development
    6 Posts 0 Posters 511 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 18/06/2015 at 11:00, xxxxxxxx wrote:

      Hello,

      Is there any ways to get the "text" of the plugin ID?
      formatID = rd[c4d.RDATA_FORMAT]

      this returns plugin id 1100, how do I get the text "FILTER_TIFF" from it?

      Thank you! 🙂
      Amy

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

        On 18/06/2015 at 11:38, xxxxxxxx wrote:

        Perhaps something like:

          
        formatID = rd[c4d.RDATA_FORMAT]   
        if formatID == c4d.FILTER_TIFF:   
            print "FILTER_TIFF"   
        

        "FILTER_TIFF" is a variable that points to the value 1100, the two are functionally equivalent.
        Cheers,

        Donovan

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

          On 18/06/2015 at 12:05, xxxxxxxx wrote:

          hmm, so I guess the lookup table has to be created manually to get the text of image format?

          Thanks for your reply, Donovan 🙂

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

            On 18/06/2015 at 12:16, xxxxxxxx wrote:

            You might be able to load the string shown in the Render Settings using LoadResource: https://developers.maxon.net/docs/py/2023_2//help/modules/c4d.plugins/GeResource/index.html?highlight=resource#GeResource.LoadString

            But my initial tests have been unsuccessful.

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

              On 18/06/2015 at 12:31, xxxxxxxx wrote:

              I also tried GetString, which was not working. I guess a lookup table is the only way for now.

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

                On 19/06/2015 at 06:33, xxxxxxxx wrote:

                Hi,

                You can get a bitmap format name from its ID using plugins.FindPlugin() to retrieve the bitmap loader/saver plugin instance:

                import c4d
                from c4d import plugins
                  
                ...
                formatPlug = plugins.FindPlugin(formatID)
                formatName = "UNKNOWN"
                if formatPlug is not None:
                  formatName = formatPlug.GetName()
                  print formatName
                

                plugins.FindPlugin() returns a BasePlugin instance which is also a BaseList2D that has the GetName() method.

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