Jump to content


Photo

"track One Frame" Script


  • Please log in to reply
9 replies to this topic

#1 fry

fry

    Flying Pig

  • Adv Members
  • PipPipPipPipPip
  • 86 posts

Posted 26 August 2009 - 11:55 AM

Finally! My very first (working) LUA / Fusion script!

What it does? It tracks only one frame forward or reverse according to your current position in time.

It all started as an exercise to get into scripting so there are definitely bugs.

Remove the .txt and place in Scripts/Comp

regards, Fry

edit: for the sake of better overview version 1.1 was added to this post
- Fry

Attached Files



#2 Gringo

Gringo

    Associate Administrator

  • Adv Members
  • PipPipPipPipPip
  • 1,455 posts

Posted 26 August 2009 - 01:38 PM

Very useful for complicated tracking script, thank you!

And welcome to the Script Index!

#3 theajo

theajo

    Advanced Pig

  • Adv Members
  • PipPipPip
  • 31 posts

Posted 03 September 2009 - 11:34 AM

Thats a cool script..
It's strange.. I have always wanted this function in Fusion and I recently wrote a python script to do this.
Nice to have the Eyeonscript.. handy..
The only issue with your script is, it kind of locks the comp.. i am able to add or delete nodes, but..
None of the save or close functions are working.
The "save new version" script is not helping either.
The fusion console does not work too.
It feels like the script is still running in the background or something.
I am using Fusion 5.3 build 74.
It will be nice if you can fix this problem.

Cheers and gud luck..
-T
P.S.. My Python Version(doesn't update the Tracked center point..)
from Tkinter import *
import PeyeonScript as eyeon
import random


def tracker(val):
    print 'Hello',val

    fu = eyeon.scriptapp("Fusion")
    comp = fu.GetCurrentComp()
    tools =comp.GetToolList()

    Tl_List=comp.GetToolList(True)

    attrs=comp.GetAttrs()

    st = attrs['COMPN_GlobalStart']
    en = attrs['COMPN_GlobalEnd']
    r_st = attrs['COMPN_RenderStartTime']
    r_end = attrs['COMPN_RenderEndTime']
    Crt=attrs['COMPN_CurrentTime']

    if len(Tl_List) > 1 :
        print 'Select one Tracker only'

    elif len(Tl_List) <1:
        print 'Select A tracker'

    else:

        for i in Tl_List:
            tool=Tl_List[i]
            Tl_attr=tool.GetAttrs()
            nam = Tl_attr['TOOLS_Name']
            if Tl_attr['TOOLS_RegID'] == 'Tracker' and val==1:
                print 'TRUE'
                comp.SetAttrs({
                'COMPB_HiQ':          True,
                'COMPN_RenderStart':   Crt-1,
                'COMPN_RenderEnd':   Crt+1,
            
                })
                
                comp.Lock()
                tool['TrackForward']=1
                comp.Unlock()

            elif Tl_attr['TOOLS_RegID'] == 'Tracker' and val==0:
                print 'Truee'
                comp.SetAttrs({
                'COMPB_HiQ':          True,
                'COMPN_RenderStart':   Crt+1,
                'COMPN_RenderEnd':   Crt-1,
            
                })                
                comp.Lock()
                tool['TrackReverse']=1
                comp.Unlock()
            else:
                
                print 'Select A Tracker'


class App:
    def __init__(self, master):
        
        fm = Frame(master, width=800, height=500,borderwidth=2, relief=GROOVE)
        Label(fm, text='Track By Frame', width=20).pack(side=TOP)
        Button(fm, text='  <  ',command=lambda : tracker(0)).pack(side=LEFT)
        Button(fm, text='  >  ',command=lambda : tracker(1)).pack(side=RIGHT)
        fm.pack()

root = Tk()
root.option_add('*font', ('verdana', 12, 'bold'))
root.title("Pack - Example 4")
display = App(root)
root.mainloop()






#4 fry

fry

    Flying Pig

  • Adv Members
  • PipPipPipPipPip
  • 86 posts

Posted 04 September 2009 - 09:09 AM

You have to close the "Track One Frame" window - otherwise it will lock script execution and some Fusion functions. On the other hand you can modify some settings while the script is active (e.g. pattern center, adaptive mode, ...) but it will not stay on top of your current window.

#5 fry

fry

    Flying Pig

  • Adv Members
  • PipPipPipPipPip
  • 86 posts

Posted 04 September 2009 - 09:49 AM

Here is a small bugfix. Now the window will stay always on top and visible.

Attached Files



#6 theajo

theajo

    Advanced Pig

  • Adv Members
  • PipPipPip
  • 31 posts

Posted 07 September 2009 - 06:53 AM

Here is a small bugfix. Now the window will stay always on top and visible.


It's very convenient with the Window staying on top.
Regarding the other bug in Fusion 5.3 build 74.. the problem exists even after closing the window.
It works fine in build 55 tho..

#7 fry

fry

    Flying Pig

  • Adv Members
  • PipPipPipPipPip
  • 86 posts

Posted 09 September 2009 - 04:52 AM

Regarding the other bug in Fusion 5.3 build 74.. the problem exists even after closing the window.
It works fine in build 55 tho..


Interesting! It seems to be a build 74 only issue. I've tested it with build 78 (32 & 64bit) and it works.

I have no build 74 installed, so we have to make some sort of remote debugging session here.

Could you please comment the
comp:Lock()
and
comp:Unlock()
lines out? Does it still behave abnormal?

#8 theajo

theajo

    Advanced Pig

  • Adv Members
  • PipPipPip
  • 31 posts

Posted 10 September 2009 - 05:54 AM


Regarding the other bug in Fusion 5.3 build 74.. the problem exists even after closing the window.
It works fine in build 55 tho..


Interesting! It seems to be a build 74 only issue. I've tested it with build 78 (32 & 64bit) and it works.

I have no build 74 installed, so we have to make some sort of remote debugging session here.

Could you please comment the
comp:Lock()
and
comp:Unlock()
lines out? Does it still behave abnormal?


Hi,
Yep.. I have tried... it still behaves the same.
It's a bit strange..
It behaves normally with Fusion 6 in the same PC..

#9 fry

fry

    Flying Pig

  • Adv Members
  • PipPipPipPipPip
  • 86 posts

Posted 17 September 2009 - 07:21 AM

Looks like it's a build 74 issue only - maybe something with IUP or the tracking node itself. Does the script work properly and lock only the script execution or does it break at some point? Is there a render complete message in the script log? Sorry theajo but my debugging skills are like my scripting - limited and crappy :D

Fry

#10 theajo

theajo

    Advanced Pig

  • Adv Members
  • PipPipPip
  • 31 posts

Posted 20 September 2009 - 12:05 PM

Looks like it's a build 74 issue only - maybe something with IUP or the tracking node itself. Does the script work properly and lock only the script execution or does it break at some point? Is there a render complete message in the script log? Sorry theajo but my debugging skills are like my scripting - limited and crappy :D

Fry


No it doesn't show the render complete message in the log.
That's fine fry.. don't worry..
The script works fine in general and it doesn't have any probs with Fu6.:-)

Thanks
-T




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users