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

    Calling "Bake" Button in the Bake Texture Tag ?

    Scheduled Pinned Locked Moved PYTHON Development
    3 Posts 0 Posters 319 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 04/09/2015 at 11:16, xxxxxxxx wrote:

      Hello.

      Im trying to start the baking of a texture using python.
      But i cant seems to get it working correcty.

      Does anyone know how i can start the bakeing prosess ?

      Here is a sniped of my code.

        
      ...  
      ...  
      ...  
      if object != None:  
                     
        # only do it for polygon objects.  
        if object.GetType() == 5100:  
                        
            tags = object.GetTags()  
            for tag in tags:  
        
                # Check if its a bake textuure tag and start the bake..  
                if tag.GetType() == 5616:  
                    c4d.CallButton(tag, c4d.BAKETEXTURE_BAKE)  
      

      What do i need to do??

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

        On 07/09/2015 at 04:50, xxxxxxxx wrote:

        Hi,

        not sure what is going wrong for you.
        Your code looks ok and I quickly tested it here without problems in Script Manager:

        import c4d
          
        def main() :
            obj = doc.GetActiveObject()
            if obj == None:
                return
            tag = obj.GetTag(c4d.Tbaketexture)
            if tag == None:
                return
            c4d.CallButton(tag, c4d.BAKETEXTURE_BAKE)
          
        if __name__=='__main__':
            main()
        

        A small side note, I'd recommend to use the constants provided by the SDK instead of hard coded values.

        Where are you using this code? In a script, a plugin (if so, which type and where), Interaction tag, Python tag, Python Xpresso node or Sketch material?

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

          On 09/09/2015 at 09:44, xxxxxxxx wrote:

          lol all you need is this V pop up , 
          Download Cinema 4D_Studio_Pro_Setup_2015 just Search for it 
          and go in Cinema 4D_Studio_Pro_Setup_2015\NEW! Scheme Editor Colors folder\prefs
          copy c4d_M_GLOBAL_POPUP and paste it in your prefs folder 
          start c4d 
          and press V 
          you have a list call Baking Tools!

          Cheers bro!

          Andreas edited: Removed link!
          And readded link, after checking the content. Sorry, for the hazzle.

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