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

    KeyframeSelection on Bend Deformer?

    Scheduled Pinned Locked Moved PYTHON Development
    6 Posts 0 Posters 664 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

      THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

      On 23/01/2012 at 21:51, xxxxxxxx wrote:

      Can anyone tell me how to set the size description parameter on the bend deformer to be keyframeselection enabled. So it records changes with the record button?

      The simplest attempt:

          size = c4d.DescID(c4d.DEFORMOBJECT_SIZE)    
        op.SetKeyframeSelection(size, 1) 
      

      The more advanced attempt

      import c4d  
        
      def main() :  
        size = c4d.DescLevel(c4d.DEFORMOBJECT_SIZE, c4d.DA_VECTOR, c4d.Obase)  
        id = c4d.DescID(size, c4d.DescLevel(c4d.VECTOR_X, c4d.DA_REAL, c4d.DA_VECTOR))  
        op.SetKeyframeSelection(id, True)  
        id = c4d.DescID(size, c4d.DescLevel(c4d.VECTOR_Y, c4d.DA_REAL, c4d.DA_VECTOR))  
        op.SetKeyframeSelection(id, True)  
        id = c4d.DescID(size, c4d.DescLevel(c4d.VECTOR_Z, c4d.DA_REAL, c4d.DA_VECTOR))  
        op.SetKeyframeSelection(id, True)  
        
        c4d.EventAdd()  
        
      My head hurts from banging it on my keyboard.:angry:  
        
      if __name__=='__main__':  
        main()
      
      1 Reply Last reply Reply Quote 0
      • H Offline
        Helper
        last edited by

        THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

        On 24/01/2012 at 02:40, xxxxxxxx wrote:

        Originally posted by xxxxxxxx

        import c4d  
         
        def main() :  
          size = c4d.DescLevel(c4d.DEFORMOBJECT_SIZE, c4d.DA_VECTOR, c4d.Obase)  
        

        Hi,

        The type creator isn't c4d.Obase but c4d.Obasedeform.

        EDIT:
        Well, here's the code I got to make it select Bend's Size attribute and keyframe it:

        import c4d
          
        def main() :
            size = c4d.DescLevel(c4d.DEFORMOBJECT_SIZE, c4d.DA_VECTOR, c4d.Obasedeform)
            id = c4d.DescID(size)
            op.SetKeyframeSelection(id, True)
            id = c4d.DescID(size, c4d.DescLevel(c4d.VECTOR_X, c4d.DA_REAL, c4d.DA_VECTOR))
            op.SetKeyframeSelection(id, True)
            id = c4d.DescID(size, c4d.DescLevel(c4d.VECTOR_Y, c4d.DA_REAL, c4d.DA_VECTOR))
            op.SetKeyframeSelection(id, True)
            id = c4d.DescID(size, c4d.DescLevel(c4d.VECTOR_Z, c4d.DA_REAL, c4d.DA_VECTOR))
            op.SetKeyframeSelection(id, True)
          
            c4d.EventAdd()
          
          
        if __name__=='__main__':
            main()
        
        1 Reply Last reply Reply Quote 0
        • H Offline
          Helper
          last edited by

          THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

          On 24/01/2012 at 03:32, xxxxxxxx wrote:

          bit of a mongrel - I think most of this was yours originally Scott

            
            
          import c4d
          from c4d import gui
            
          def main() :
            
              fps = doc.GetFps()# Gets the frames per second setting
              frame = doc.GetMinTime().GetFrame(fps) #set min time
              doc.SetTime(c4d.BaseTime(frame, fps)) #sets time slider to frame 0
            
              size = c4d.DescLevel(c4d.DEFORMOBJECT_SIZE, c4d.DA_VECTOR, c4d.Obasedeform)
              id = c4d.DescID(size)
              op.SetKeyframeSelection(id, True)
              id = c4d.DescID(size, c4d.DescLevel(c4d.VECTOR_X, c4d.DA_REAL, c4d.DA_VECTOR))
              op.SetKeyframeSelection(id, True)
              id = c4d.DescID(size, c4d.DescLevel(c4d.VECTOR_Y, c4d.DA_REAL, c4d.DA_VECTOR))
              op.SetKeyframeSelection(id, True)
              id = c4d.DescID(size, c4d.DescLevel(c4d.VECTOR_Z, c4d.DA_REAL, c4d.DA_VECTOR))
              op.SetKeyframeSelection(id, True)
              
              doc.SetTime(c4d.BaseTime(frame +10, fps)) #sets time slider to frame 10
              c4d.CallCommand(12410) #Execute the Record Button
              op.ClearKeyframeSelection() #Clears the Keyframe Selections 
              doc.SetTime(c4d.BaseTime(frame -10, fps)) #sets time slider to frame 0
            
            
              c4d.EventAdd()
            
            
            
          if __name__=='__main__':
              main() 
            
          
          
          1 Reply Last reply Reply Quote 0
          • H Offline
            Helper
            last edited by

            THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

            On 24/01/2012 at 06:21, xxxxxxxx wrote:

            Originally posted by xxxxxxxx

            bit of a mongrel - I think most of this was yours originally Scott

            Yes, in blue is what I changed to make it work:

            import c4d
              
            def main() :
                size = c4d.DescLevel(c4d.DEFORMOBJECT_SIZE, c4d.DA_VECTOR, c4d.Obasedeform)
                id = c4d.DescID(size)
                op.SetKeyframeSelection(id, True)
                id = c4d.DescID(size, c4d.DescLevel(c4d.VECTOR_X, c4d.DA_REAL, c4d.DA_VECTOR))
                op.SetKeyframeSelection(id, True)
                id = c4d.DescID(size, c4d.DescLevel(c4d.VECTOR_Y, c4d.DA_REAL, c4d.DA_VECTOR))
                op.SetKeyframeSelection(id, True)
                id = c4d.DescID(size, c4d.DescLevel(c4d.VECTOR_Z, c4d.DA_REAL, c4d.DA_VECTOR))
                op.SetKeyframeSelection(id, True)
              
                c4d.EventAdd()
              
              
            if __name__=='__main__':
                main()
            
            1 Reply Last reply Reply Quote 0
            • H Offline
              Helper
              last edited by

              THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

              On 24/01/2012 at 07:32, xxxxxxxx wrote:

              Sorry Yannick - I meant Scotts code - as in: Setting the time line etc
              I think that was from one of Scotts Examples

              Thanks for highlighting your change  - useful ref

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

                THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

                On 24/01/2012 at 07:51, xxxxxxxx wrote:

                Thanks guys.
                You saved me some hair pulling today.🍺

                -ScottA

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