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
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    Automatically Press Button on Oobject Type

    Scheduled Pinned Locked Moved PYTHON Development
    3 Posts 0 Posters 361 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 14/03/2017 at 21:16, xxxxxxxx wrote:

      Hi Guys, 
      It's as been a while I haven't post anything. lol 
      But here's my problem, its setting or would say automatically press Flip Button on SYMMETRY OBJECT.
      c4d.CallButton don't work. Is  I'm using it in the wrong way.

      def main() :
        
          doc = c4d.documents.GetActiveDocument()
          Cube = doc.GetActiveObject()
        
          Sym = c4d.BaseObject(c4d.Osymmetry) # Symmetry 
          Sym[c4d.SYMMETRYOBJECT_AUTOFLIP]=True 
          Sym[c4d.SYMMETRYOBJECT_PLANE]=1 
          Sym.SetName("Python")
          Cube.InsertUnder(Sym)
        
          ### Problem ###	
          c4d.CallButton(Sym, c4d.SYMMETRYOBJECT_FLIP)
        
          doc.InsertObject(Sym) 
          c4d.EventAdd()
      if __name__=='__main__':
          main()
      

      Thanks in advance for any help.
      Cheers,
      Ashton

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

        On 15/03/2017 at 01:16, xxxxxxxx wrote:

        Hi,

        You are not wrong. but the order is wrong,try this:

          
            Cube = doc.GetActiveObject()
          
            Sym = c4d.BaseObject(c4d.Osymmetry) # Symmetry 
            Sym[c4d.SYMMETRYOBJECT_AUTOFLIP]=True 
            Sym[c4d.SYMMETRYOBJECT_PLANE]=1 
            Sym.SetName("Python")
            Cube.InsertUnder(Sym)
            doc.InsertObject(Sym)   
          
            c4d.CallButton(Sym, c4d.SYMMETRYOBJECT_FLIP)  
          
            c4d.EventAdd()  
          
        

        by the way ,doc = c4d.documents.GetActiveDocument() is not necessary.

        Best wishes!
        Ching

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

          On 15/03/2017 at 12:39, xxxxxxxx wrote:

          lol I feel so dumb lol 
          Thanks WeiChing

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