|
@@ -59,7 +59,7 @@ class Blendshape {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public function setBlendshapeAmount(blendshapeIdx: Int, amount: Float) {
|
|
|
+ public function setBlendshapeAmountByIndex(blendshapeIdx: Int, amount: Float) {
|
|
|
if (blendshapeIdx >= this.weights.length)
|
|
|
throw 'Blendshape at index ${blendshapeIdx} doesn\'t exist (there is only ${this.weights.length} blendshapes).';
|
|
|
|
|
@@ -67,6 +67,13 @@ class Blendshape {
|
|
|
uploadBlendshapeBytes();
|
|
|
}
|
|
|
|
|
|
+ public function setBlendShapeAmountByName(name: String, amount: Float) {
|
|
|
+ for (s in shapes)
|
|
|
+ if (s.name == name)
|
|
|
+ this.weights[shapes.indexOf(s)] = amount;
|
|
|
+ uploadBlendshapeBytes();
|
|
|
+ }
|
|
|
+
|
|
|
function getBlendshapeCount() {
|
|
|
if (hmdModel.lib.header.shapes == null)
|
|
|
return 0;
|