KeyframeSelection on Bend Deformer?



  • 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()
    


  • 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()
    


  • 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() 
      
    
    


  • 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()
    


  • 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



  • 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


Log in to reply