LibGDX fbx-conv from Blender not passing specular color to G3DJ - libgdx

I have a model in blender 2.8 with a specular value of 0 using the Pricipled BSDF node. I export as an fbx file and then convert it using fbx-conv (https://github.com/libgdx/fbx-conv). When looking at the g3dj file, the material always has a specular color of .800000. I'm using the latest fbx-conv
Blender Set up
fbx-conv inacurate G3DJ results
In Blender 2.76 I was able to set the specular color of a model, and after running the fbx-conv, it would have an appropriate specular color in the G3DJ file.
Blender 2.76 setup (note specular color is black)
G3DJ results from blender 2.7
I'm guessing I'm setting something up incorrectly in Blender 2.8 or the fbx-conv needs to be updated. I'd really appreciate any help with why the specular value is not being converted correctly.
*Note - After playing around with Blender 2.8 a bit more I discovered that by setting the base color before setting the texture will set the diffuse and specular color in the g3dj file (even though applying a texture looks like it overwrites the color). I'm still trying to figure it out, but I'd appreciate any help!

Related

aframe Animations with OBJ

I've successfully loaded my model in aframe. I have animations with a bone. I wanted to load that. Or maybe just key frames.
How can I export my blender bone animations for aframe? How do I call those animations?
The OBJ format does not support animation, so you'll need to export to a different format if you want to play your animations.
My advice, if you're exporting from Blender to A-Frame, would be to use the Three.js JSON format. Three.js provides a Blender exporter for this. Once you have a JSON glTF file, including your animations, you can load the file in A-Frame using the json-model (or perhaps object-model) gltf-model component, and animation-mixer from A-Frame Extras.
Example syntax:
<a-entity scale="0.01 0.01 0.01"
animation-mixer
gltf-model="src: url(./my-model.glb);">
</a-entity>
UPDATE(11/7/2019): With A-Frame 0.7.0+, the glTF 2.0 format (supported in Blender 2.8 and other tools) is the recommended choice with A-Frame. Usage is the same as above, using the gltf-model component.
Hello You Cant Get Animated Model In Obj Format. In A-frame If You Want to Animate Its Better To User JSON Or Gltf File To Animate. Go Through This Code

Gephi 0.9.1. Issues in exporting edges color with sigma.js

I'm having troubles when exporting my graph with the sigma.js module from Gephi. The JSON format doesn't store the colors of the edges. I'd like to export the color of the parent node for each edge of my graph, instead of that, I have a "color":"rgb(0,0,0)"
Thanks in advance for your answer

three.js 71 load a json model with texture and skeleton animation

I can't find the code snippet in three.js documentation to load a json model from Blender with texture and skeleton animation (and play it).
And it's wrong if i take old examples or answers because it's for old versions of three.js.
Here is a basic model :
http://www.lesmaudits.org/three/
proj.blend with text.jpg
So can you show me the code please ?

UV mapping not working on imported obj file

I have exported an .obj file (along with .mtl and a .png) from Blender to import into a libgdx project. The file contains both UV and normal data.
I am pulling the file into the app like this:
ModelLoader loader = new ObjLoader();
model = loader.loadModel(Gdx.files.internal("data/car.obj"));
The object should look like this: (Yes, I'm not an artist)
But it ends up looking like this:
What happened to my UV mapping?
Use loader.loadModel(Gdx.files.internal("data/car.obj"), true); to flip the vertical texture coordinates. You can also flip vertical textures coordinates while converting to the g3dx file format: fbx-conv -f car.obj (-f is for flip vertical texture coordinates), which will give you a file called car.g3db and is more suitable for rendering. More info on how to load and convert models (and flip texture coordinates) etc. can be found here: http://blog.xoppa.com/.
Just flip the texture vertically and load the texture it will work fine.
You can do it using photoshop.

Away3d 4, creating a flat shaded material

I'm currently trying to create a "flat" shaded ColorMaterial inside of Away3d 4 to use as a mesh on a loaded .obj file.
This is a screenshot of what I'm trying to achieve. The flat shaded model is on the left.
I loaded the same .obj file I’m working with in Away into a program called MeshLab. MeshLab has two settings for Render Mode, flat or smooth.
The Flat render mode is on the left and smooth is on the right. When I load my .obj into Away3D the result looks exactly like MeshLab’s smooth render mode.
In order to get a flat result I’ve tried to set the smooth flag on my ColorMaterial to false but that doesn’t seem to change anything.
http://away3d.com/livedocs/away3d/4.0/away3d/materials/MaterialBase.html
I’m now starting to look into the materials shadowMethod because I was able to find a smooth boolean on ShadingMethodBase although I’m honestly not sure if this is where you would handle this.
http://away3d.com/livedocs/away3d/4.0/away3d/materials/DefaultMaterialBase.html#shadowMethod
http://away3d.com/livedocs/away3d/4.0/away3d/materials/methods/ShadingMethodBase.html
Below is the code for creating my light and light picker,
dL = new DirectionalLight();
dL.diffuse = 20;
dL.ambient=.6;
dL.specular=15
scene.addChild(dL);
lightPicker= new StaticLightPicker([dL]);
dL.direction = new Vector3D(0,1,-2);
And this is my material, I've tried playing around with most of it's properties:
primitiveMaterial = new ColorMaterial(0xcccccc);
primitiveMaterial.smooth = false;
primitiveMaterial.bothSides = false;
//primitiveMaterial.gloss = 800;
//primitiveMaterial.diffuseLightSources = LightSources.LIGHTS;
primitiveMaterial.diffuseMethod.alphaThreshold = .3;
primitiveMaterial.ambient =.2;
primitiveMaterial.lightPicker=lightPicker;
Can anyone help point me in the right direction?
Thanks!
ColorMaterial has no smooth attribute because it hasn't texture and smooth indicates whether or not any used textures should use smoothing. Most likely smooth attribute is inherited from MaterialBase and have no affect.
Your problem is in the normal vectors when surface is flat they are normals, when it is smoothed they are blended so it appears smoother.
Im guessing the problem might be in obj file. If it has no normals Away3d might generate them by it self ass well as MeshLab but Away3d apparently doing it only in smoothed mode by default. Or obj file contain smoothed normals and MeshLab overriding them in flat mode.
Open obj file with text editor and look for normals, try another obj file with flat surface.
But i might be wrong.
Here is smoothed obj
And this one is flat
What you are looking for is probably the Explode class.
Call Explode.apply(<your loaded mesh>) to remove the smoothed normals.