Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Converting Track Data to onscreen text readout?

  • Converting Track Data to onscreen text readout?

    Posted by Adam Taylor on January 8, 2009 at 10:34 am

    I want to create an effect to simulate some kind of electronic viewfinder.

    It needs to have various windows that display numeric readouts, and i would like to have the numbers be driven by motion taken from the live action element. Ideally, i want three separate numbers…elevation, pan and tilt.

    Obviously I can extract the motion using trackers but thats as far as i can get…i get stuck beyond that point, and i’m sure the answer will involve Expressions!

    How can i take data from a tracker, and apply it to a text element so that the text is in some way controlled by the data?

    thanks
    Adam

    Adam Taylor
    Video Editor/Audio Mixer/ Compositor/Motion GFX/Barista
    Character Options Ltd
    Oldham, UK

    http://www.sculptedbliss.co.uk

    Xavier Khonje replied 17 years, 4 months ago 3 Members · 7 Replies
  • 7 Replies
  • Adam Taylor

    January 8, 2009 at 12:37 pm

    I have worked out part of the answer and now have the data from a tracker x position appearing onscreen and animating with the track data….

    the only problem is the number being displayed is showing to 12 decimal places which is far too many digits!!.

    How do i tell AE to only display 3 decimal places?

    thanks
    Adam

    Adam Taylor
    Video Editor/Audio Mixer/ Compositor/Motion GFX/Barista
    Character Options Ltd
    Oldham, UK

    http://www.sculptedbliss.co.uk

  • Dan Ebberts

    January 8, 2009 at 2:12 pm

    Like this:

    thisComp.layer(“your movie”).motionTracker(“Tracker 1”)(“Track Point 1”).attachPoint[0].toFixed(3)

    Dan

  • Adam Taylor

    January 8, 2009 at 2:36 pm

    Many thanks Dan,

    i have tried that several times and keep getting an error message saying “…expression result must be of dimension 2, not 1.”

    Any idea what that means?

    regards
    Adam

    Adam Taylor
    Video Editor/Audio Mixer/ Compositor/Motion GFX/Barista
    Character Options Ltd
    Oldham, UK

    http://www.sculptedbliss.co.uk

  • Adam Taylor

    January 8, 2009 at 2:40 pm

    please ignore my stupidity Dan….just realised the expression was not working because i applied it to a different layer!!

    Pass the dunce hat…i’ll be in the corner!

    Adam Taylor
    Video Editor/Audio Mixer/ Compositor/Motion GFX/Barista
    Character Options Ltd
    Oldham, UK

    http://www.sculptedbliss.co.uk

  • Xavier Khonje

    January 9, 2009 at 5:19 am

    hey Adam am trying to figure out something like that two
    I hope you don’t mind but can you share what you did,
    thanks in advance

    xavier

  • Adam Taylor

    January 9, 2009 at 9:25 am

    certainly xavier…

    First, the track data was copied into a null object.
    i typed some text and placed it onscreen roughly where i needed it, then twirled down the layer properties, opened the Text properties and alt clicked the Source Text stopwatch. Then i dragged the pickwhip to the Null/Motion Trackers/Track Point 1/Attach Point and held it to the x coordinates and released.
    This then puts the current track data into the text file. The code that Dan gave was the finishing touch to truncate the numeric value to show only 3 numbers after the decimal point instead of 12 !!

    Repeat the process but using the y coordinate if you want to have 2 text layers showing the two different axis.
    regards
    Adam

    Adam Taylor
    Video Editor/Audio Mixer/ Compositor/Motion GFX/Barista
    Character Options Ltd
    Oldham, UK

    http://www.sculptedbliss.co.uk

  • Xavier Khonje

    January 14, 2009 at 5:16 pm

    thanks a bunch adam
    its like another key to a collection of my own

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy