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

    cloner don't refresh

    Scheduled Pinned Locked Moved PYTHON Development
    11 Posts 0 Posters 1.8k 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 02/02/2017 at 10:34, xxxxxxxx wrote:

      Did you tried c4d.EventAdd()

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

        On 02/02/2017 at 19:48, xxxxxxxx wrote:

        sure , it is always in the end of my code

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

          On 03/02/2017 at 01:04, xxxxxxxx wrote:

          Maybe you should post a code because maybe I missunderstand waht you mean by type but here doing the following working correctly

          import c4d
          import random
            
            
          def main() :
              op[c4d.ID_MG_MOTIONGENERATOR_MODE] = random.randint(0,3)
              c4d.EventAdd()
            
          if __name__=='__main__':
              main()
          

          You could also try to setDirty

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

            On 03/02/2017 at 01:31, xxxxxxxx wrote:

            Originally posted by xxxxxxxx

            Maybe you should post a code because maybe I missunderstand waht you mean by type but here doing the following working correctly

            even in your code it is the same problem , check the pic :
            http://imgur.com/a/Ms0oi
            the cloner mode is set to grid array but the interface is for the object mode (the previous mode which I set manually )

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

              On 03/02/2017 at 01:57, xxxxxxxx wrote:

              For me is working correctly when I press the button execute. Everything is updated correctly.

              Maybe you tried it in a thread context?
              And I guess dev will as kyou your c4d version (My last code working on the last R17/R18)

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

                On 03/02/2017 at 02:08, xxxxxxxx wrote:

                Originally posted by xxxxxxxx

                For me is working correctly when I press the button execute. Everything is updated correctly.

                Maybe you tried it in a thread context?
                And I guess dev will as kyou your c4d version (My last code working on the last R17/R18)

                thanks for help , 
                the problem was weird , if my cloner don't have child then it doesn't update , but if I put an object under it it works fine .

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

                  On 03/02/2017 at 08:55, xxxxxxxx wrote:

                  Hi guys,

                  I'm sorry for chiming in so late. Are you really sure, it's solved on your end?
                  I still can reproduce the initial problem even with children here. I'll investigate further on Monday.

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

                    On 03/02/2017 at 09:39, xxxxxxxx wrote:

                    at the moment every thing is ok 
                    check this code if it working in your end or not (it is running fine with me )

                    import c4d
                    from c4d import gui , utils 
                      
                    def main() :
                        spline = doc.GetActiveObject() #you have to select and editable spline
                        if spline == None or spline.GetType() !=5101:
                            gui.MessageDialog("Select a spline to start !")
                            return
                        clo = c4d.BaseObject(1018544) # define cloner 
                        cir = c4d.BaseObject(5179) # define n-side spline 
                        cir.InsertUnder(clo)
                        doc.InsertObject(clo) # create cloner
                        clo[c4d.ID_MG_MOTIONGENERATOR_MODE]=0
                        clo[c4d.MG_OBJECT_LINK] = spline
                        clo[c4d.MG_SPLINE_MODE]=3
                        c4d.EventAdd()
                      
                    if __name__=='__main__':
                        main()
                      
                      
                    
                    
                    1 Reply Last reply Reply Quote 0
                    • H Offline
                      Helper
                      last edited by

                      On 06/02/2017 at 06:53, xxxxxxxx wrote:

                      Hi,

                      you are lucky as you create the cloner and set the mode just once.
                      If you were trying to implement a script, which for example toggles the mode between linear and radial, then you'd run into the same issue again (the AM interface not properly reflecting the mode change).
                      The problem is, that after a change of this parameter a MSG_DESCRIPTION_CHECKUPDATE is needed. Unfortunately this message is currently not supported in our Python SDK, so it's currently not possible to reliably switch the mode parameter of a MoGraph cloner from Python.
                      I have set this message type on the list of our Python todos.

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

                        On 06/02/2017 at 20:30, xxxxxxxx wrote:

                        Thanks for your help 🙂

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