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

    save PP layer [SOLVED]

    Scheduled Pinned Locked Moved PYTHON Development
    5 Posts 0 Posters 437 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 12/06/2015 at 12:41, xxxxxxxx wrote:

      Hi everyone,

      can anyone please tell me if it's possible to save 'projection paint layer' to specific location via Python? AFAIU I need to use c4d.modules.bodypaint.SendPainterCommand(command, doc, tex, bc) with pp layer as 'tex', but I have know idea how to get it (or what the other variables should be).

      if there's a way to do that?

      Thanks

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

        On 13/06/2015 at 04:43, xxxxxxxx wrote:

        Hello,

        could you please provide some more information on what exactly you want to do and what resources do you want to access?

        Best wishes,
        Sebastian

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

          On 13/06/2015 at 11:04, xxxxxxxx wrote:

          Sure,
          I'm trying to make a process of sending projection paint layer to Photoshop slightly faster. Most other software I used have 1 button for this, in C4d I have to 
          0) freeze 3d view for larger resolution in most cases

          1. select PP layer http://take.ms/KRqDM
          2. press save selected texture as http://take.ms/JSiZN
          3. chose file format http://take.ms/NxohL
          4. chose file destination
          5. manually switch to Photoshop and browse file from there
            it takes 20-40 sec and sometimes I spend more time on those buttons than on actual painting. And of course sending the projection back to C4D takes almost the same effort.

          I couldn't find any mentions of Freeze 3d View in SDK, but maybe at least I can save this PP layer with Python

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

            On 15/06/2015 at 08:51, xxxxxxxx wrote:

            Hello,

            it seems that the PP Layer can be accessed like any other BodyPaint texture using GetSelectedTexture(). Then you can use SendPainterCommand() and avoid any dialogs by setting the flags to zero. Something like this:

              
            tex = c4d.modules.bodypaint.PaintTexture.GetSelectedTexture()  
              
            if tex is not None:  
             bc = c4d.BaseContainer()  
                   
              # define flags here  
              bc[c4d.PAINTER_SAVETEXTURE_FLAGS] = 0  
                    
              c4d.modules.bodypaint.SendPainterCommand(c4d.PAINTER_SAVETEXTURE,doc,tex,bc)  
            

            This will update the existing texture file.

            Best wishes,
            Sebastian

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

              On 15/06/2015 at 10:07, xxxxxxxx wrote:

              This is perfect Sebastian, thank you!

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