This would be dependent on the Nuke settings for how often to autosave though, 
right?

 

From: nuke-python-boun...@support.thefoundry.co.uk 
[mailto:nuke-python-boun...@support.thefoundry.co.uk] On Behalf Of Hugo Léveillé
Sent: Thursday, September 22, 2011 10:53 AM
To: Nuke Python discussion
Subject: Re: [Nuke-python] detect idle time

 

Here is a part of the script I use for this very thing. It should get you 
started

 

All you have to to is to make a thread that run every X time. (I do 30 seconds)

 

Then, in the loop, you call the def above. This will return the idle time of 
each nuke session. Then you decide what you consider the idle time. If the def 
return a number higher then your desired idle time, you don;t add anything in 
the log. Else, you add the number to your log

 

 

Something like

 

if checkIdleScript() > 300 # meaning 5 minutes

     pass

else:

     mylog.add(x)

 

  

 

  def checkIdleScript(self):

        # This should be your script
        script = nuke.root()['name'].value()

        # If an autosave file exist, it compares the time diff between autosave 
and current time
        if os.path.isfile('%s.autosave' % script):
            creationTime = int(os.stat('%s.autosave' % script ).st_mtime)
            currentTime = int(time.time())
            return currentTime - creationTime

        # This is returned if there is no autosave file but the script is 
modified. Means the artist is working
        elif nuke.modified():
            if not os.path.isfile('%s.autosave' % script ):
                return 1

        # This is returned if there is no autosave
        elif not nuke.modified():
            creationTime = int(os.stat(script).st_mtime)
            currentTime = int(time.time())
            return currentTime - creationTime

        else:
            return 999

 

 

 

 

On Thursday, September 22, 2011 2:31 PM, "Howard Jones" 
<mrhowardjo...@yahoo.com> wrote:

        Dont know but I'd be interested to know how you will be able to log 
little things like creative thought, problem discussions and overall shot 
reflection time, which in my experience go a bit towards the actual result ;)

         

        Howard

        
________________________________


        From: Kasper Oerlemans <kasper.oerlem...@gmail.com>
        To: Nuke Python discussion <nuke-python@support.thefoundry.co.uk>
        Sent: Thursday, 22 September 2011, 14:02
        Subject: [Nuke-python] detect idle time

        Hi everyone, 

         

        Got a question, I'm thinking about making a script that logs the amount 
of time my artist are really working in a specific comp. So I need a way to 
detect if they are doing anything in the comp like changing parameters, moving 
nodes, moving vertices of roto etc.

         

        I've found that I can log some of these things by adding a function to 
updateUI but this one isn't triggered when you move to a new frame or move a 
node around. 

         

        Does anyone have an idea how to pull this off? Or if there are any 
other functions that can be useful?

         

        Thanks!

         

        Greetings!
        Kasper
        
        
        
        

        On Wed, Sep 14, 2011 at 11:34 PM, Javier Garcia <jav...@gmail.com> 
wrote:

        Hi, 

         

        I need to trigger the autolabel callback from other callback, for 
example:

         

         

        def onInputChangeCallback():

         

                nuke.frame( nuke.frame() + 1 )

                 

                # this line will trigger the autolabel callback but also will 
change the current frame, nuke.frame( nuke.frame() ) doesn´t work.

                 

                 

                 

        def autolabelCallback(): 

         

                if node_input == XX:

                 

                        return 'XXXX'

                         

                else:
                 

                        return 'YYYY'

                 

         

         

        thanks. 

         

        J

         

         

        
        _______________________________________________
        Nuke-python mailing list
        Nuke-python@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/
        http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
         

        
        _______________________________________________
        Nuke-python mailing list
        Nuke-python@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/
        http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
        
         

         
        _______________________________________________
        Nuke-python mailing list
        Nuke-python@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/
        http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
         

 

-- 

Hugo Léveillé

TD Compositing, Vision Globale

hu...@fastmail.net

_______________________________________________
Nuke-python mailing list
Nuke-python@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python

Reply via email to