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

    Bodypaint Bitmap Dirty status

    Scheduled Pinned Locked Moved PYTHON Development
    8 Posts 0 Posters 1.2k 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 13/12/2014 at 09:42, xxxxxxxx wrote:

      Hello,

      has anyone made experiences with Bodypaint Bitmaps.
      If I check the dirty state of a bitmap like:

        
        Tex = bodypaint.PaintTexture.GetSelectedTexture()  
        actlay= Tex.GetActive()  
        if actlay.IsInstanceOf(c4d.OBJECT_PAINTLAYERBMP) == True:  
              
            bmp = actlay.ToPaintLayerBmp()  
            bmp.GetDirty()  
      

      I´ll get this error message:

      SystemError: /perforce_buildsystem_osx/c4d_mx_buildsystem_osx/release/16.0/modules/python/source/i_getargs.cpp:1616: bad argument to internal function

      I´m not allowed to set a zero flag as it is suggested in the docs:
      ``PaintBitmap.GetDirty( _flags_ )[URL-REMOVED]

      Thanks in advance
      Martin


      [URL-REMOVED] @maxon: This section contained a non-resolving link which has been removed.

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

        On 13/12/2014 at 11:19, xxxxxxxx wrote:

        You've created  a paint layer bitmap. Which doesn't have a GetDirty() method.
        You'll need to convert it to a BaseBitmap() type using GetPixelCnt() to loop through it and copy the color values to a new BaseBitmap with SetPixelCnt().

        Then you should be able to use GetDirty() on it.

        -ScottA

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

          On 13/12/2014 at 12:34, xxxxxxxx wrote:

          Hello Scott,

          yes thanks! I see.
          But it doesn´t make sense to me as im able to use the other members of the class with
          bmp = actlay.ToPaintLayerBmp()

          I want to avoid recalculating the Bitmaps on every event message in my plugin.
          I copied the  BP layer structure to a treeviewcustomgui and an userarea in my dialogplugin.
          That´s why I was searching for a fast indicator that the user changed something at the PaintBitmap
          and I thought GetDirty should be good enough.
          Do you have an idea to solve this in fast manner.

          Thanks in advance
          Martin

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

            On 13/12/2014 at 13:19, xxxxxxxx wrote:

            No idea.
            I've never tried using the layer images in other GUI's.

            Sorry.

            -ScottA

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

              On 13/12/2014 at 15:23, xxxxxxxx wrote:

              ok.
              By the way the treeviewcustom gui on your website was a good resource to begin with.Thanks
              Martin

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

                On 15/12/2014 at 07:03, xxxxxxxx wrote:

                Hello,

                if I try to follow along with Scotts suggestion.

                Originally posted by xxxxxxxx

                You'll need to convert it to a BaseBitmap() type using GetPixelCnt() to loop through it and copy the color values to a new BaseBitmap with SetPixelCnt().

                Then you should be able to use GetDirty() on it.

                my dirty status is always 1, as expected.
                Because I have to initialise the bitmap in the first place or load it from a path to use GetPixelCnt()/SetPixelCnt()

                So is my assuption right that the dirty status of a bitmap only reflects the count of how often a bitmap was saved with c4d and therefore it is not possible to detect if a bitmap has changed without saving it to disc?

                Could someone please throw light on this issue?
                Thanks in advance
                Martin

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

                  On 15/12/2014 at 10:45, xxxxxxxx wrote:

                  Hello,

                  the dirty count is increased every time a part of the bitmap is changed. Unfortunately there is a bug in PaintBitmap.GetDirty(). A bug report was filed.

                  Best wishes,
                  Sebastian

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

                    On 15/12/2014 at 13:46, xxxxxxxx wrote:

                    Hello Sebastian,

                    thanks for the bug report,
                    I hope we can use it soon.

                    Best wishes
                    Martin

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