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

    GetBitmap ?

    Scheduled Pinned Locked Moved PYTHON Development
    6 Posts 0 Posters 1.1k 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 26/03/2011 at 06:03, xxxxxxxx wrote:

      Hi

      I want to get the pixel size of textures used in the scene.
      "BaseChan-> GetBitmap ()" I found it looking like functionality.
      To do a similar thing can I do?

      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 26/03/2011 at 06:32, xxxxxxxx wrote:

        import c4d  
          
        def main() :  
          mat = op.GetTag(c4d.Ttexture)[c4d.TEXTURETAG_MATERIAL]  
          if not mat:  
              print "No Tag"  
              return  
          try:  
              print mat[c4d.MATERIAL_COLOR_SHADER].GetSize()  
          except:  
              print "No Texture"  
          return  
          
        if __name__=='__main__':  
          main()
        

        I hope this snippet helps you.

        Cheers, nux

        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 26/03/2011 at 15:01, xxxxxxxx wrote:

          Thanks nux.
          However, "mat" is "c4d.BaseList2D object" so "GetSize ()"function does not seem to have.

          def main() :    mat = doc.GetActiveMaterial()    print mat[c4d.MATERIAL_LUMINANCE_SHADER].GetSize()
          

          "GetSize ()" function when l is a good idea to use should I do?

          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 27/03/2011 at 16:04, xxxxxxxx wrote:

            You can't get the pixelsize of shaders since they do not have such one.

            Cheers,
            nux

            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 28/03/2011 at 16:33, xxxxxxxx wrote:

              Here's an example of using the BaseBitmap class to get the size of an image:

              import c4d,os  
              from c4d import gui, bitmaps  
                
              def main() :  
                path = os.path.join("/Users", "user", "Desktop", "MyImage.jpg")# <-- Use you own path here  
                bmp = bitmaps.BaseBitmap(path)   
                bmp.InitWith(path)   
                
                
                x, y = bmp.GetSize() #Gets the X and Y dimensions of the image   
                
                print(x)  
                print(y)  
                
              if __name__=='__main__':  
                main()  
              

              -ScottA

              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 29/03/2011 at 04:23, xxxxxxxx wrote:

                Thanks ScottA.
                I was able to get the pixel size !

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