A-frame - glTF - Asset not found - aframe

I'm trying to import a gltf-model into my scene, but even with correct paths and references the console claims the "core:propertyTypes:warn "#model" asset not found. +0ms".
Tried with a gltf-model exported from Blender by me as well as a downloaded working model. I am not having this problem with any .obj-files in the scene. Any suggestions to what I could try to change?
<a-assets>
<a-asset-item id="monster" src="/monster.gltf"></a-asset-item>
<a-asset-item id="separaterunner" src="/separaterunner.gltf"></a-asset-item>
<item id="plane" src="/plane.glb"></item>
</a-assets>
<a-entity id="separaterunner" gltf-model="gltf: #separaterunner"></a-entity>
<a-entity id="plane" gltf-model="gltf: #plane"></a-entity>
<a-entity id="monster" gltf-model="#monster"></a-entity>
If I use the same code structure for .gltf-files as for .obj-files I no longer get the error about "asset not found" but instead an error about cross origin requests. Why is that for .gltf but not for .obj?
Thanks

There's a syntax error in how you're using the gltf-model component, in two of those examples: it should be gltf-model="#foo", not gltf-model="gltf: #foo". (OBJ/MTL files are a bit different because there are two files required).
If the assets are still not found after fixing that, you may need to include more information about where the models are in your working folder, and how you're starting the local server (if you're using one).

Related

Load glTF with instanced Meshs into Aframe

I've got a glTF file with instanced meshs exported from Blender. My Problem is, that Aframe does not accept the instancing and draws every piece without instancing, which causes the browser memory to crash. In the glTF viewer (https://gltf-viewer.donmccurdy.com/) it works without problems. How do I import this file properly, so that Aframe can visualize it?
I am using the standard a-gltf-model tag in Aframe.
Edit:
So basically I got something standard like this:
<a-scene>
<a-assets timeout="40000">
<a-asset-item id="r" src="path/to/my/model.gltf" ></a-asset-item>
</a-assets>
<a-gltf-model src="#r" scale="0.4 0.4 0.4" position="1 1 1">
</a-gltf-model>
<a-camera id="camera" cursor-visible="true" cursor-opacity="1" position="3.083 0.957 -1.607"></a-camera>
</a-scene>
Problem is now, that the model is created with instancing in blender and Aframe doesnt multiply the instanced versions of the model over and over. It starts to draw every instance as a single model, which causes the browser to crash. Its a model of a piece of gras, which should be spread over a plane, without drawing the 7k vertices for every single piece. In Don McCurdys glTF viewer its loading immediately and working as it should, looking like this:
The normal version looks like this in Aframe:
EDIT 2:
Here is a working Glitch example (somehow it doesn't crash). It loads, but as you can see in the Inspector the draw and triangle calls are rising, which they shouldn't.
https://glitch.com/edit/#!/instance-gltf
EDIT 3: So apparently glTF is capable of instancing and the from blender exported file should work, but doesn't. As we did it like this. Source.

How to use modules defined inside of a private package in Julia?

so I have the following:
A Private Package: PrivPack.jl
Within PrivPack.jl, I have 2 modules: mod1 and mod2.
In the PrivPack.jl file I do include("mod1.jl") and include("mod2.jl") which are the files that house the modules. However, when I try to access mod1 anywhere in my package, I do not seem to have access to it. I either need to include the file and do using .mod1 or I have to push the file into my loadpath using the startup.jl file.
What's the solution to fix this issue? I don't want to have to re-include the file every time.
If I'm understanding the question correctly, you should just do using .mod1, .mod2 after includeing the files. Otherwise, you just have modules floating around that haven't actually been loaded.

Why A-frame is not loading OBJ .png textures from Maya.

I created a Maya file when I export it to OBJ with the .obj the .mtl and the texture .png everything is loaded except the textures everything is black. Am I missing something while exporting to maya?
Here is the OBJ and the texture: https://www.dropbox.com/sh/3cxqacay9sao1bu/AADtArGP5Pu2qdPY3hJBJ3Yka?dl=0
Thank you!
<a-assets>
<a-asset-item id="object-obj" src="objects/ccentercables.obj"></a-asset-item>
<a-asset-item id="object-mtl" src="objects/ccentercables.mtl"></a-asset-item>
</a-assets>
<a-obj-model src="#object-obj" mtl="#object-mtl" material="src: #texture"></a-obj-model>
Although there is a component for the obj's, and .mtl's, the a-frame team recommends the .glTF format as it is designed for webGL.
A-frame's Don McCurdy's pointed out multiple times that .obj's differ from each other, and can be hard to interpret by the webGL engine.
You should try converting the model to glTF with this, or this exporter. Though they are created for blender...
That's why You should also check out Don's article on exporting .gltf models from maya.

Implementation of A-Frame Extras FBX loader

Seeking an example of FBX loading within A-frame. Aframe Extras docs say that the FBX loader is experimental and only ASCII format is supported. Now I've exported the correct format yet I cannot view the file in my scene. Any ideas?
<a-entity fbx-model="src: url(https://mannymeadows.github.io/Noosa/models/FBX-DEMO.fbx);" material="color: red" crossorigin="anonymous">
Demo - http://codepen.io/MannyMeadows/pen/mmaLWv
You're using the fbx-model component correctly. In the JS console you'll see an error thrown from: THREE.FBXLoader.parseMesh:
aframe-extras.min.js:1 Uncaught TypeError: Cannot use 'in' operator to search for '1926113552' in undefined
at e.exports.THREE.FBXLoader.parseMesh (aframe-extras.min.js:1)
at e.exports.THREE.FBXLoader.parseMeshes (aframe-extras.min.js:1)
at e.exports.THREE.FBXLoader.parse (aframe-extras.min.js:1)
at aframe-extras.min.js:1
at XMLHttpRequest.<anonymous> (three.js:29211)
To verify that your model is good, try opening it in FBX Review.
If that works, THREE.FBXLoader just can't read the file for some reason. It's not uncommon unfortunately: FBX is a complex format, and isn't easy to support on the web. You can file a bug on three.js, but may ultimately want to convert to another format like OBJ or glTF.

Use a Sketch Up 2016 Model with babylon JS

I'm looking for a path to be able to use a Sketch UP 3D Model in babylon JS on a simple web page.
I think I have to convert the .skp file to a babylon JS Compatible format but I don't find a solution.
The only solution I know is to use the blender->babylon exporter.
You can install blender from Here
Then you can install the exporter by following these instructions
And finally, from sketchup, you can export your component in collada format (.dae), import it in blender then export it to babylon format.
After that, you can drag& drop the generated .babylon file on this page to see if your model was correctly generated. For most objects, I had no problem...

Resources