Calling "Bake" Button in the Bake Texture Tag ?

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??

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?

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.