Digital Art Zone

 
     
DAZ Script: DSA file animation confusion…
Posted: 25 March 2013 10:19 AM   [ Ignore ]
Member
Avatar
Rank
Total Posts:  37
Joined  2010-03-19

Hi, everyone. I’m new to DAZ Scripting so please forgive my ignorance but I have a few specific questions to some code.

I’m attempted to examine and understand morph animation data when exported to a .DSA file. I understand the .DSA format is being retired but I believe my code questions relate to general DAZ scripting.

Anyway, here’s my project:

1) Start with a new scene
2) Used the built-in lip sync plugin on a default Genesis figure to have key framed facial animation.
3) I then exported the animation to a .DSA file, exporting only the visemes morphs, nothing else.

When I open the .DSA file in a text editor, I can find the section where the morphs are being animated (see below) but I do not understand how the file is making sense of the morph’s strength (0 to 1) as it relates to the frame number of the animation.

Here’s the relevant code:

g_oPresetHelper.checkAnimationRange18000 );
 for( var 
0this.m_aNodes.lengthi++ ){
  this
.setPropertiesthis.m_aNodes[ i ].getSkeleton(), this.m_aNodes[ i ]bRecurse );
 
}
 acceptUndo
String"\"%1\"" ).argg_sSCRIPT_NAME ) );
 
clearBusyCursor();
}

DsActions
.prototype.setProperties =function( oSkeletonoNodebRecurse ){
 
var sSkeleton "";
 if( 
oSkeleton ){
  this
.m_oSkeleton oSkeleton;
  
sSkeleton this.m_oSkeleton.name;
 
}
 this
.m_oElement oNode;
 
g_oPresetHelper.setTargetElementthis.m_oElement );
 switch( 
this.m_oElement.name ){
  
case "head":
    
g_oPresetHelper.setNumericProperty"CTRLVSMW",  [ 0, , 0, , 0, , 0, , 0, , 0, , 0, , 00,
 
1800076000100000116000158000180000 ] );
    
g_oPresetHelper.setNumericProperty"CTRLVSMUW",  [ 0, , 0, , 0, , 0, , 0, , 0, , 0, , 00,
 
1800076000100000116000158000180000 ] );
    
g_oPresetHelper.setNumericProperty"CTRLVSMTH",  [ 0, , 0, , 0, , 0, , 0, , 0, , 0, , 00,
 
1800076000100000116000158000180000 ] );
    
g_oPresetHelper.setNumericProperty"CTRLVSMT",  [ 0, , 0, , 0, , 0, , 0, , 0, , 0, , 00,
 
1800076000100000116000158000180000 ] );
    
g_oPresetHelper.setNumericProperty"CTRLVSMSH",  [ 0, , 0, , 0, , 0, , 0, , 0, , 0, , 00,
 
1800076000100000116000158000180000 ] );
    
g_oPresetHelper.setNumericProperty"CTRLVSMS",  [ 0, , 0, , 0, , 0, , 0, , 0, , 0, , 00,
 
1800076000100000116000158000180000 ] );
    
g_oPresetHelper.setNumericProperty"CTRLVSMOW",  [ 0, , 0, , 0, , 0, , 0, , 0, , 0, , 0, , 0, , 0, , 0, , 0, , 00,
 
1800032000380014400076000100000116000124001136000158000180000 ] );
    
g_oPresetHelper.setNumericProperty"CTRLVSMM",  [ 0, , 0, , 0, , 0, , 0, , 0, , 0, , 0, , 0, , 0, , 0, , 0, , 0, , 0, , 0, , 00,
 
1800024000320013800050000560016600076000100000108000116001124000158000180000 ] );
    
g_oPresetHelper.setNumericProperty"CTRLVSML",  [ 0, , 0, , 0, , 0, , 0, , 0, , 0, , 00,
 
1800076000100000116000158000180000 ] );
    
g_oPresetHelper.setNumericProperty"CTRLVSMK",  [ 0, , 0, , 0, , 0, , 0, , 0, , 0, , 00,
 
1800076000100000116000158000180000 ] );
    
g_oPresetHelper.setNumericProperty"CTRLVSMIY",  [ 0, , 0, , 0, , 0, , 0, , 0, , 0, , 00,
 
1800076000100000116000158000180000 ] );
    
g_oPresetHelper.setNumericProperty"CTRLVSMIH",  [ 0, , 0, , 0, , 0, , 0, , 0, , 0, , 00,
 
1800076000100000116000158000180000 ] );
    
g_oPresetHelper.setNumericProperty"CTRLVSMF",  [ 0, , 0, , 0, , 0, , 0, , 0, , 0, , 0, , 0, , 0, , 0, , 0, , 0, , 00,
 
1800038000440015000076000100000116000124000136001148000158000180000 ] );
    
g_oPresetHelper.setNumericProperty"CTRLVSMER",  [ 0, , 0, , 0, , 0, , 0, , 0, , 0, , 00,
 
1800076000100000116000158000180000 ] );
    
g_oPresetHelper.setNumericProperty"CTRLVSMEH",  [ 0, , 0, , 0, , 0, , 0, , 0, , 0, , 0, , 0, , 0, , 0, , 0, , 0, , 0, , 0, , 00,
 
18000240013200044000500015600076000100000108001116000136000148001158000180000 ] );
    
g_oPresetHelper.setNumericProperty"CTRLVSMAA",  [ 0, , 0, , 0, , 0, , 0, , 0, , 0, , 0, , 0, , 00,
 
18000560006600176000100000116000158000180000 ] );
    break;
  default:
   break;
 
}
 
if( bRecurse ){
  
var aStack [ oNode ];
  while( 
aStack.length ){
   
var oParent aStack.pop();
   var 
nNodes oParent.getNumNodeChildren();
   var 
oChild;
   for( var 
0nNodesn++ ){
    oChild 
oParent.getNodeChild);
    if( 
oChild.inherits"DzBone" ) ){
     
if( oChild.getNumNodeChildren() > ){
      aStack
.pushoChild );
     
}
     this
.setPropertiesoSkeletonoChildfalse );
    
}
   }
  }
 }

Can anyone help me make sense of the numbers to the left of the morph controller as it relates to the timing/frame of the animation?

 Signature 

—Artman009
http://cautiouslyoptimisticfilmmaking.blogspot.com/

Profile
 
 
Posted: 25 March 2013 02:02 PM   [ Ignore ]   [ # 1 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  14033
Joined  2003-10-09

The DS3 documentation isn’t exactly helpful, most of the DzPresetHelper functions are undefined. For trying to figure the details out like this it would probably be better to start with a simpler example, such as having a single morph go from 0 in frame 0 to .5 in frame 15 to 1 in frame 30 - that gives

g_oPresetHelper.setMorphProperty"FBMFaerie"[ 0, , 0, , 0, , 0024000.548001 ] ); 

So the second half of the array, after the 0s interspersed with empty entries, is the time index of the key (in 4,800ths of a second - see the entry for DzTime in the DS3 docs, according to which that’s a Tick and is what DS uses) followed by the keyed value of the morph. I don’t know what the first block of numbers is - I seem to recall Rob explaining it all once, presumably on the old forum - but I suspect that it may be a place-holder that would otherwise hold the type of key; however that’s a pretty wild guess.

 Signature 

DAZ Studio Frequently Asked Questions

Index of free DAZ Studio scripts and plugins list

Profile