Materials from Face Mesh not showing up in preview - spark-ar-studio

I have an issue with a material on a second facemesh not showing in app but they do show up in spark AR.
I am super new with Spark (As in started today) and I did some face distortion in Blender and created a new Face mesh. This works fine however I also wanted to try creating freckles. I added a new face mesh for that and added a material and custom texture. This shows up in Spark AR but when I try it out in IG and FB only the face distortion and skin smoothing show up. Anyone know what I am doing incorrectly?
I already tried creating a new facemesh, creating a canvas and rectangle and connecting the mesh to that but it does not work.
As the freckles show up in SPARK AR i expect them to show up in app too, but this is not the case.

Related

How to set material on node in libgdx?

I want to set material on node in libgdx.
My cube is completely filled with one texture and I want one texture to be on one face, and another texture on another face like that.
I set it with model.materials.get(0).set(TextureAttribute.createDiffuse(new Texture("one.png")));
Also i tried set material model.getNode("plane1").parts.get(0).material.set(TextureAttribute.createDiffuse(new Texture("one.png")));, but in this case the game crashes on startup with NullPointerException
Tell me please how you can solve this problem.
Full project https://github.com/D0niL19/Project2
File with a problem
https://github.com/D0niL19/Project2/blob/main/core/src/com/mygdx/game/Screens/PlayScreen.java

Tiled map not rendered fully

I'm using cocos2d-x 3.17. When I run a Follow action on a sprite, the tiled map can't render fully. The map looks exactly the same as the screen record shows in posts below
https://discuss.cocos2d-x.org/t/1-5b2-tiled-map-not-rendered-fully/36661
https://discuss.cocos2d-x.org/t/solved-tilemap-rotation-clipping/37114
But they were using Cocos Creator and can fix it by setting ENABLE_TILEDMAP_CULLING = false.
Is there any equivalent settings in C++ api?
Found out the root cause is that the Scene has been moved by Follow action. It seems in cocos2d-x, Scene is not supposed to move.

Material turns white when using the option setDisplayEdges(true)

I recently discovered a strange behaviour using the autodesk forge viewer.
While viewing a model, i executed following code to add a red cube into my scene:
const mat = new THREE.MeshBasicMaterial({color: 0xff0000});
const geom = new THREE.BoxGeometry(50,50,50);
const cube = new THREE.Mesh(geom, mat);
NOP_VIEWER.impl.createOverlayScene('testOverlay', mat, mat);
NOP_VIEWER.impl.addOverlay('testOverlay', cube);
Regularly, the result would look as intended like this:
Adding a colored cube as intended
However, in the application I'm working in, the option setDisplayEdges is set to true as standard.
This seems to have the effect that any custom material used within the viewer is displayed as white, as seen in this example:
The same cube turned white without any change to the code itself
I was able to reproduce this in multiple models.
Glad to report that this has been fixed with the latest version 7.18

Blender-exported JSON model shows wrong animations in THREE.js

I have a basic walk animation in Blender that I´m trying to export to THREE.js. It looks nice in Blender playback:
Now, after being exported with the THREE.js exporter, it looks like this on the browser:
The geometry is broken, not in all the body parts, but certainly has some problems. I´m not sure what to do now, I tried exporting with several options checked/unchecked, with no luck.
I also read the explanations in this posts, I think I followed all the required steps but still getting this weird animations:
http://unboring.net/workflows/animation.html#preview
https://github.com/mrdoob/three.js/pull/8412#issuecomment-210675561
https://github.com/mrdoob/three.js/issues/6050
The code I´m currently using to load the JSON model/animations is like this:
var loader = new THREE.JSONLoader();
var action = {}, mixer;
loader.load(path + '/dino.json', function (geometry, materials) {
materials.forEach(function (material) {
material.skinning = true;
});
character = new THREE.SkinnedMesh(
geometry,
new THREE.MeshFaceMaterial(materials)
);
scene.add(character);
/* ANIMATION */
mixer = new THREE.AnimationMixer(character);
action.walk = mixer.clipAction(geometry.animations[ 3 ]);
action.walk.setEffectiveWeight(1);
action.walk.enabled = true;
/* Update/render functions */
onUpdateFcts.push(function(delta, now){
mixer.update(delta);
});
action.walk.play();
});
I´m using Blender 2.78c and THREE.js r84, with the Blender exporter tool including in this revision.
I found some interesting links about similar animation problems:
Model with bones animation (blender export) animating incorrectly in three.js
http://dev.mothteeth.com/2012/10/threejs-blender-exporting-skeletal-animations/
Blender exports a three.js animation - bones rotate strangely
After reading all of these advices, I had successfully exported the animated mesh without visual artifacts following this workflow:
Create the armature bone by bone around the mesh. When done and in object mode, select first the mesh, then the armature, press CTRL+P > With automatic weights. This generates an armature modifier on the mesh. Against what I read, the armature modifier doesn´t need to be deleted before exporting.
You must have a default pose like the rest position. This must be the one selected on Blender. Also, the playback frame 0 must be selected in that default pose.
I created keyframes at the start and end of every pose for all the bones involved, this seems important.
You must unselect everything and only select the mesh, not the armature. This must be done in object mode.
My export settings:
Note: I must say that this is the same workflow I was following with no luck. This time the difference was that I first deleted every vertex group, also the armature modifier (not the armature itself) and recreated all the steps from the first one. Now, once exported the animated mesh worked fine enough!

Triangle edges in CanvasRenderer

I am a newbie regarding three.js and I have a problem with imported geometry (js-file from 3dsmax inclusive all material and textures) and the CanvasRenderer. The CanvasRenderer displays the triangle edges of imported geometry, the WebGLRenderer works well.
Canvas example:
http://der-n.square7.ch/threejs/examples/teapot_canvas.html
WebGL example:
http://der-n.square7.ch/threejs/examples/teapot_webgl.html
In the three.js library I have found the option "overdraw: true" for a material to fix this behaviour but obviously the material+textures are defined by the above mentioned exported 3dsmax js-file.
For the tests I use the "misc_camera_trackball" example with small changes (I have added a JSONLoader, changed some camera and trackball parameters, changed some light colors, added a CanvasRenderer)
Any hints how to solve this?
Thanks for your help.
Best regards
Oggy
In the loader callback, you have all of the loaded materials in an array geometry.materials. You could loop over those materials and set the overdraw property to true for each.
As far as I know, THREE.MeshFaceMaterial is just a pass-through material that indicates "faces have an index that points to a material instance to use from the geometry's materials array", so setting properties for MeshFaceMaterial won't have any effect.