Javascript 将变换连接到混合形状权重SparkAR
我正在测试JavaScript以实现某种形式的自动化 该项目将以translateY的形式从Maya导出动画关键帧。现在我在Spark中导入fbx,我想将这些关键帧值连接到SparkAR中的变形中。有人知道我怎样才能做到吗?我已经得到了所有的信息,从混合形状,它的索引和价值观。我就是不知道如何连接它。我不想在修补程序中完成,但这是唯一的JavaScript。任何帮助都将不胜感激Javascript 将变换连接到混合形状权重SparkAR,javascript,c++,augmented-reality,Javascript,C++,Augmented Reality,我正在测试JavaScript以实现某种形式的自动化 该项目将以translateY的形式从Maya导出动画关键帧。现在我在Spark中导入fbx,我想将这些关键帧值连接到SparkAR中的变形中。有人知道我怎样才能做到吗?我已经得到了所有的信息,从混合形状,它的索引和价值观。我就是不知道如何连接它。我不想在修补程序中完成,但这是唯一的JavaScript。任何帮助都将不胜感激 // Load modules const Scene = require('Scene'); const Patch
// Load modules
const Scene = require('Scene');
const Patches = require('Patches');
const Reactive = require('Reactive');
const Animation = require('Animation');
const Diagnostics = require('Diagnostics');
const timeDriver = Animation.timeDriver({durationMilliseconds: 5000});
Scene.root.findFirst('Blue_Body').then(function(body) {
Diagnostics.watch("Name - ", body.name);
const blendshapeCount = body.blendShapes.count;
//Diagnostics.log(blendshapeCount);
//for (let i=0; i<blendshapeCount; i++){
for (let i=0; i<2; i++){
const blendshapeMesh = body.blendShapes.getAtIndex(i);
const blendshapeName = blendshapeMesh.name;
const blendshape = blendshapeMesh.weight.lastValue;
Scene.root.findFirst(blendshapeName).then(function(shape){
const transform = shape.transform;
// Here I need to set blendshapeMesh.weight = transform.y, HOW TO DO THIS?
Diagnostics.watch(blendshapeName, blendshapeMesh.weight.lastValue);
Diagnostics.watch(shape.name, transform.y);
});
}
});
//加载模块
const Scene=require(“场景”);
常量补丁=需要(“补丁”);
const Reactive=require(‘Reactive’);
常量动画=需要(“动画”);
常量诊断=需要(“诊断”);
const timeDriver=Animation.timeDriver({durationmillizes:5000});
Scene.root.findFirst('Blue_Body')。然后(function(Body){
Diagnostics.watch(“Name-”,body.Name);
const blendshapeCount=body.blendShapes.count;
//Diagnostics.log(blendshapeCount);
//例如(让i=0;我可以分享一些fbx示例。你没有玩过混合图形吗?你可以分享一些fbx示例。没有玩过混合图形吗?