EightBit
10-15-2009, 04:51 AM
Hi all:
I have been reverse engineering a Dynamic Bones script by Wade Ryer (http://www.ryerdesign.com/tutorials/dynamicBones/index.html).
Its a rig in which a bone chain is partially controlled by a dynamic hair curve.
Its a cool setup and I have it all figured out except this expression which controls the Hair System:
////// Live Update Expression /////////////////////
disconnectAttr time1.outTime (""+$SetUpName+"_HairSystemShape.currentTime");
string $DynUpdExp = (
"if (frame > "+$SetUpName+"_HairSystemShape.startFrame) { "+$SetUpName+"_HairSystemShape.currentTime += 1; float $refresh = "+$SetUpName+"MainDynLocUpdate.translateX;}\n"
+"else "+$SetUpName+"_HairSystemShape.currentTime = "+$SetUpName+"_HairSystemShape.startFrame;"
);
expression -n "DynamicUpdateExpr" -s $DynUpdExp;
I haven't worked with expressions too much, but it appears to me that the expression does the following:
1) Disconnects the Hair System from the Main timeline.
2) Set the currentTime of the HairSystem to be one frame less than the main timeline.
3) $refresh does not appear to be used.
4) Rewind the Hair System when the current time is set to 0.
2 Questions:
1. Is my analysis correct?
2. What is the purpose of the expression?
Thanks.
I have been reverse engineering a Dynamic Bones script by Wade Ryer (http://www.ryerdesign.com/tutorials/dynamicBones/index.html).
Its a rig in which a bone chain is partially controlled by a dynamic hair curve.
Its a cool setup and I have it all figured out except this expression which controls the Hair System:
////// Live Update Expression /////////////////////
disconnectAttr time1.outTime (""+$SetUpName+"_HairSystemShape.currentTime");
string $DynUpdExp = (
"if (frame > "+$SetUpName+"_HairSystemShape.startFrame) { "+$SetUpName+"_HairSystemShape.currentTime += 1; float $refresh = "+$SetUpName+"MainDynLocUpdate.translateX;}\n"
+"else "+$SetUpName+"_HairSystemShape.currentTime = "+$SetUpName+"_HairSystemShape.startFrame;"
);
expression -n "DynamicUpdateExpr" -s $DynUpdExp;
I haven't worked with expressions too much, but it appears to me that the expression does the following:
1) Disconnects the Hair System from the Main timeline.
2) Set the currentTime of the HairSystem to be one frame less than the main timeline.
3) $refresh does not appear to be used.
4) Rewind the Hair System when the current time is set to 0.
2 Questions:
1. Is my analysis correct?
2. What is the purpose of the expression?
Thanks.
