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

    CallButton again

    Scheduled Pinned Locked Moved PYTHON Development
    5 Posts 0 Posters 472 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 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?

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

        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()
        
        1 Reply Last reply Reply Quote 0
        • H Offline
          Helper
          last edited by

          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

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

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

            or

            mat[c4d.MATERIAL_LUMINANCE_SHADER].Remove()
            
            1 Reply Last reply Reply Quote 0
            • H Offline
              Helper
              last edited by

              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.

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