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

    Select track and hide others

    Scheduled Pinned Locked Moved PYTHON Development
    4 Posts 0 Posters 317 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 05/09/2014 at 03:04, xxxxxxxx wrote:

      I want to simplify the timeline by seeing just one track. For example the animated x-coordinate track.
      I can do that by selecting the track and then do a "Hide Unselected Elements".

      So, to hide all other ctracks, I need to select the ctrack first.
      But I do not know how to select a track in the timeline?

      I can find the track and get all values, but selecting the track (highlight it) I do not know how.
      When the track is selected I can do a c4d.CallCommand(465001055) # Hide Unselected Elements

      -Pim

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

        On 08/09/2014 at 05:48, xxxxxxxx wrote:

        Still do know how to select a timeline track.

        A workaround is to use layers and the layer manager.
        So, set the tracks you want to isolate on a separate layer and all others on a different layer.
        Then solo that layer.

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

          On 08/09/2014 at 07:41, xxxxxxxx wrote:

          To get & select the tracks in the timeline use GetNBit() and ChangeNBit()

          import c4d  
          def main() :  
              
            obj = doc.GetActiveObject()  
            if obj is None: return False  
                  
            Ztrack = obj.FindCTrack(c4d.DescID(c4d.DescLevel(c4d.ID_BASEOBJECT_REL_POSITION,c4d.DTYPE_VECTOR,0), c4d.DescLevel(c4d.VECTOR_Z,c4d.DTYPE_REAL,0)))  
            if Ztrack:  
                   
                #Get the value of the Z track's selection bit    
                bit = Ztrack.GetNBit(c4d.NBIT_TL1_SELECT)  
                  
                #This will select the object's Z track if it's not currently selected  
                if bit == 0: Ztrack.ChangeNBit(c4d.NBIT_TL1_SELECT, c4d.NBITCONTROL_SET)          
            
                #If the track is aleady selected this code will execute  
                if bit == 1: print "The Z track is selected"  
               
            c4d.EventAdd()  
            
          if __name__=='__main__':  
            main()
          

          -ScottA

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

            On 09/09/2014 at 03:58, xxxxxxxx wrote:

            Great, exactly what I'm looking for!
            It also tells me how to init DescId.

            I did it directly in FindCTrack:
                #position = c4d.DescID([c4d.ID_BASEOBJECT_REL_POSITION,c4d.VECTOR_Z])    #not working???
                atrack = op.FindCTrack([c4d.ID_BASEOBJECT_REL_POSITION,c4d.VECTOR_Z])

            Pim

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