Daz Script IDE - Remove Keyframe

krakensurfkrakensurf Posts: 26
edited December 1969 in Daz Studio Discussion

Hello,

I'm pulling my hair out. I can't seem to remove keyframe via Script.

function clearKeys() {

var ticks = 4800; // ticks per second
var fps = 30; // frames per second
var maxFrames = 90; // total length of frames
var currentFrame = 0;

for(var I= 0; I {

currentFrame = I * ticks / fps;

Scene.setTime(currentFrame);
Scene.clearKeyframe();


}

-----------


Clearly this function wont work because there is nothing called clearKeyframe() in the Dz Libraries..
I've search high and low, and I can't find any reference to the timeline object. So how could this be done?


Thanks.

James


}

Comments

  • Richard HaseltineRichard Haseltine Posts: 102,253
    edited December 1969

    According to the (DS3) docs, clearing keys is done at the property level. However, I was trying to do that recently and clearing one key on a property seemed to clear all keys on the node's properties. I haven't had time to finish up a big report.

  • krakensurfkrakensurf Posts: 26
    edited December 1969

    Thanks for the quick response. Could you please provide a snippet of what you did. I need a starting point.

    Cheers,
    James

  • Richard HaseltineRichard Haseltine Posts: 102,253
    edited December 1969

    If you want to clear all keys from a node's property something like this is overkill but works:

     prop = node.getZScaleControl(); // or whatever property you want
     if ( prop] ) {
      prop].deleteAllKeys();
     }
Sign In or Register to comment.