Skip to content

Commit

Permalink
[QUAL] - Flexible mask helper - add possibility to specify geometry n…
Browse files Browse the repository at this point in the history
…ame for load_geometryFromGLTF() - see #1
  • Loading branch information
xavierjs committed Sep 8, 2020
1 parent 69df4f9 commit 4736773
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion demos/flexibleMask/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ function build_scene(threeInstances){
//WebARRocksFaceHelper.add_threejsOccluderFromFile('assets/occluder.glb', null, threeLoadingManager);

// build and add the flexible mask:
_flexibleMaskHelper.load_geometryFromGLTF(threeLoadingManager, _spec.flexibleMaskURL).then(function(geom){
_flexibleMaskHelper.load_geometryFromGLTF(threeLoadingManager, _spec.flexibleMaskURL, null).then(function(geom){
const face3DKeypoints = (_spec.flexibleMaskPoints) ? _spec.flexibleMaskPoints : WebARRocksFaceHelper.get_facePointPositions();
_flexibleMaskMesh = _flexibleMaskHelper.build_flexibleMask(geom, face3DKeypoints, {
kpInfluenceDecay: _spec.kpInfluenceDecay // [ distance from the keypoint where decay start, distance from the keypoint where decay ends ]
Expand Down
4 changes: 2 additions & 2 deletions helpers/WebARRocksFaceFlexibleMaskHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,10 @@ const WebARRocksFaceFlexibleMaskHelper = (function(){
// END MISC HELPERS

const that = {
load_geometryFromGLTF: function(loadingManager, GLTFUrl){
load_geometryFromGLTF: function(loadingManager, GLTFUrl, flexibleGeometryName){
return new Promise(function(resolve, reject){
new THREE.GLTFLoader(loadingManager).load(GLTFUrl, function(model){
const geom = that.extract_flexibleMaskGeometry(model.scene, null);
const geom = that.extract_flexibleMaskGeometry(model.scene, flexibleGeometryName);
resolve(geom);
}); //end GLTF loading
}); //end return new Promise
Expand Down

0 comments on commit 4736773

Please sign in to comment.