change default amount of frames on timeline

EdpaEdpa Posts: 46

Hi!

We have 30 frames as default on timeline in DAZ studio. How can I change number to example 200 frames by script?

Post edited by Edpa on

Comments

  • Richard HaseltineRichard Haseltine Posts: 100,749
    edited March 2017

    It would probably be just as simple to save a scene with the desired number of frames - you are going to have to load a file either way. However, to do it in script I think you would use

    Scene.setAnimRange( new DzTimeRange( starttime , endtime ) );
    Scene.setPlayRange( new DzTimeRange( starttime , endtime ) );

    where time is set in DzTime units - 1/4,800 of a second. So 200 frames at 30FPS would be 200 * 4800 / 30, or 32,000 (fortunately you don't have to use new DzTime( value ) - the script will, acording to the docs, accept a bare number instead of the DzTime constructor).

    Post edited by Richard Haseltine on
  • EdpaEdpa Posts: 46
    edited March 2017
    var tick = Scene.getTimeStep();//starttime=Scene.getFrame()var starttime=0var endtime=200*tick // 200 frames + zero frameScene.setAnimRange( new DzTimeRange( starttime , endtime ) );Scene.setPlayRange( new DzTimeRange( starttime , endtime ) );print(endtime) // Daz time =32000

     

    Again thanks :) 

    Post edited by Edpa on
  • EdpaEdpa Posts: 46

    No, I'm stupid :) I have to determine which is the last frame in my animation. The function getAnimRange() gives 2 digits - the initial frame and the end. How can I assign for  variable number of the last frame. Help me please 

  • Richard HaseltineRichard Haseltine Posts: 100,749

    Number of frames will be time interval in seconds * FPS - so FPS * endTime / 4800

  • EdpaEdpa Posts: 46
    edited April 2017

    Richard, hi. I did write about another things a little :) 

    Example -

    print (Scene.getAnimeRange())

    I'll have as result  - string [0, 36000]  to example. I have assign for variable digit 3600. How? What I have do with this string to take this digit?

    I tried to work with split and substring as in Javascript with array. But I had error

    Post edited by Edpa on
  • Richard HaseltineRichard Haseltine Posts: 100,749

    That's a DzTimeRange - once you have the animRange use the members .end and .start to get the values (those are variables, not functions, so no parentheses).

    var aR = Scene.getAnimRange();

    var endTime = aR.end / 4800;

    var startTime = aR.begin / 4800;

  • EdpaEdpa Posts: 46
    edited April 2017

    Ok. I didn't know about these  variables - end and begin. Thank you, Richard.

    Post edited by Edpa on
  • EdpaEdpa Posts: 46

    Richard, thanks

Sign In or Register to comment.