Selected object in Timeline



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

    On 15/03/2012 at 11:37, xxxxxxxx wrote:

    Hi,

    I'm curious, how would I find the currently selected object in the Timeline window(s)? I've checked the various Bits and NBits but couldn't find anything that shows me which one is selected.

    What I'm trying to attempt is to find all currently selected keys on an f-curve, but only those that are basically in front of the user. The problem is that using the NBits I will find all keys that are selected even in not selected objects. I also can't rely on the active object from the object manager since that can differ from the timeline window as well. Any ideas?

    Cheers
    Michael



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

    On 15/03/2012 at 12:35, xxxxxxxx wrote:

    What version are you using?
    R13 has FindCTrack. But R12 doesn't.

    Here's an R13 example of finding the Z position track on an object.
    Then using GetNBit() to see if it's selected or not:

    import c4d  
      
    def main() :  
        
      obj = doc.GetActiveObject()  
            
      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:  
          bit = Ztrack.GetNBit(c4d.NBIT_TL1_SELECT) #TL1 is the main timeline window  
          if bit == 1: print "The Z track is selected"  
         
      c4d.EventAdd()  
      
    if __name__=='__main__':  
      main()
    

    -ScottA



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

    On 15/03/2012 at 15:50, xxxxxxxx wrote:

    Hi Scott,

    finding the track isn't the problem unfortunately, my problem is finding the correct object (maybe I'm missing something trivial here)

    Try the following scenario:

    -two objects, both have keyframes set
    -select object1 in OM, run doc.GetActiveObject(), it will say object1 is selected
    -select both objects and open their fcurve
    -select some keys on both objects (doesn't matter which)
    -now only select some curves of object2. internally keys in object1 are still marked as selected, but actively you're only interacting with the selected keys in object2. draging the keys with the mouse will only change those shown
    -while object2's curves are selected in the Timeline, notice that object1 is still selected in the OM. run doc.GetActiveObject() and it will say object1 is the active object, not object2, even though it's object2's curves you interact with.

    so my problem is how do I figure out which object is the currently selected/active one in the Timeline window, not in the object manager.

    Michael



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

    On 15/03/2012 at 16:30, xxxxxxxx wrote:

    This is the only thing that I can think of:
    owner = track.GetObject()           #Get the parent object that the track belongs to
    owner.SetBit(c4d.BIT_ACTIVE)    # Make it active in the OM

    Not sure if that's what you need.

    -ScottA



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

    On 16/03/2012 at 03:54, xxxxxxxx wrote:

    For that I'd need to find out which track(s) is/are selected in the fcurve editor. Basically, what I need is to find what is currently selected and visible in the Timeline/FCurve Editor.



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

    On 03/05/2012 at 11:36, xxxxxxxx wrote:

    Hi

    This is exactly what i am trying to figure out for some time now.
    i couldnt find any hint of how to access the active object in the timeline-window using python...
    i think its just not possible...

    if you got any news, please share...:)



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

    On 03/05/2012 at 12:58, xxxxxxxx wrote:

    No news, unfortunately. Seems like it's not possible?



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

    On 03/05/2012 at 13:36, xxxxxxxx wrote:

    yeah - i just spend another hour or so, but their seems no way to find out if the object is really shown in the timeline.

    one think i found out is that you can set the timeline to synch its object selection to the selection of the objectmanager

    if str(c4d.IsCommandChecked(465001132))=="False":
          c4d.CallCommand(465001132) # Link TL/OM Selection

    but still a object can be selected in objectmanager, but not shown in timeline

    a workarround could be to store the selection, select all, call "show tracks", deselect all, reselect original selection and activate TL/OM Selection

    but this way the content of the timeline changes/huge scenes with many tracks and keys would porbably crash your pc

    Edit: The GetBit and GetNBit functions looking like they maybe could do the job but i cant figure out what most of these bits should tell me...i am still not to deep into all this programming stuff...

    maybe someone could just tell us if its possible or not ? 😠


Log in to reply