monitoring GoTo Start into script



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

    On 15/02/2011 at 14:14, xxxxxxxx wrote:

    User Information:
    Cinema 4D Version:   r12 
    Platform:      
    Language(s) :   C.O.F.F.E.E  ;

    ---------
    language c.o.f.f.e.e
    Hi,
    I would need to "monitor/get the info from" the  Goto Start command (CallCommand(12501)  into my script.
    I need to made an action (SetSelection) when going back to frame 0.
    Is this possible?
    Thanks a lot,
    Jean



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

    On 16/02/2011 at 01:45, xxxxxxxx wrote:

    The only way to do this in COFFEE is by writing an ExpressionPluginTag plugin. The tag will be called if you step through the frames. You can then check at which frame you are and react accordingly. There are some limitations to tags though. File access and scene structure modifications are forbidden for instance.

    cheers,
    Matthias



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

    On 16/02/2011 at 10:06, xxxxxxxx wrote:

    Thanks a lot Matthias!



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

    On 17/02/2011 at 00:01, xxxxxxxx wrote:

    Hmm I am not sure what your problem exactly is.
    Like Matthias said, a way to "leave a skript in the scene" is an ExpressionTagPlugin.
    But you could also use a NonModalDialog.

    To check for the frame:

      
    var time = doc->GetTime();  
    var frame = time->GetFrame(doc->GetFps());  
      
    if(frame == 0) {  
      //Do stuff since frame 0 is active  
    }  
    

    If you only want it being executed *once* in frame 0, you have to use a second variable.

      
    var time = doc->GetTime();  
    var frame = time->GetFrame(doc->GetFps());  
    var executed;  
    if(!executed || frame != 0) { executed = false; }  
      
    if(frame == 0 && executed != true) {  
      //Do stuff since frame 0 is active  
    }  
    

    Cheers, nux


Log in to reply