CallButton again



  • On 01/12/2013 at 11:44, xxxxxxxx wrote:

    I have a good idea how to use callbutton.
    However, getting the id's is difficult. Especially when Agent Ransack does not find anything.

    In the material manager you can define Texture settings for each channel.
    E.g. Copy and Paste channel.

    But what are the id's for those "actions", how to give the "Paste Channel" command?



  • On 02/12/2013 at 01:10, xxxxxxxx wrote:

    Most likely impossible in Python. The CallButton() method is a python exclusive method. It is 
    there because the whole c4d message system is rather extensive with dozens of message 
    structs for specific message events. CallButton is just a wrapper for the c4datom.Message 
    DesciptionCommand, which does come with a specific message struct in cpp.

    But cloning a texture shouldn't be that difficult without the command :

    import c4d
    from c4d import gui
      
    def main() :
        mat = doc.GetActiveMaterial()
        if mat:
            colsha = mat[c4d.MATERIAL_COLOR_SHADER]
            if colsha:
                bumsha = colsha.GetClone()
                if bumsha:
                    bumsha.InsertUnderLast(mat)
                    mat[c4d.MATERIAL_BUMP_SHADER] = bumsha
        c4d.EventAdd()
      
    if __name__=='__main__':
        main()
    


  • On 02/12/2013 at 03:21, xxxxxxxx wrote:

    Thanks, a good approach.

    Then "Texture ... Clear" channel could be:
                mat[c4d.MATERIAL_LUMINANCE_SHADER] = None



  • On 02/12/2013 at 04:36, xxxxxxxx wrote:

    or

    mat[c4d.MATERIAL_LUMINANCE_SHADER].Remove()
    


  • On 02/12/2013 at 05:50, xxxxxxxx wrote:

    Thanks.

    I am doing this, because I see is that, when editing materials / channels and having the related textures open at the same time, gives a lot of issues.
    To "synchronize" get it right again, I must manually paste the lum channel, clear it and paste it again.
    I think the textures get initialized again doing this.

    Also, I can "Unload textures", this changes the pencil to a red cross again and then activate them again.


Log in to reply