magicien / gltfscenekit Goto Github PK
View Code? Open in Web Editor NEWglTF loader for SceneKit
License: MIT License
glTF loader for SceneKit
License: MIT License
Is there anyway to load .gltf which is compressed by draco?
My project runs on xcode 10.1 with Swift version 4.2
After integrating library i am getting following error:
error: The following binaries use incompatible versions of Swift:
/project-path/GLTFSceneKit_v0.1.3/iOS/GLTFSceneKit.framework/GLTFSceneKit
/project-pathr/project-name.app/project-name
I also tried with Swift version v4.0 but no success.
I was able to render the glb file using gltfscenekit framework and wanted to know how to trigger a particular animation within a glb.
Everytime glb loads in scene it plays the last animation in the glb, glb has multiple animations baked in it.
Any help will be appreciated.
I have a model where attributes
on line
GLTFSceneKit/Source/Common/GLTFUnarchiver.swift
Line 1066 in 32a6c9a
JOINTS_0
and JOINTS_1
and WEIGHTS_0
and WEIGHTS_1
, but it seems GLTFSceneKit only supports JOINTS_0
and WEIGHTS_0
.
Is this a shortcoming of SceneKit itself? Or of GLTFSceneKit?
App crashes on GLTFUnarchiver.swift, line 1036 with a message: "Fatal error: Unexpectedly found nil while unwrapping an Optional value".
An older app built using xcode 9.x was working, but threw the same error when built on xcode 10.
The model is stretched when Load the glb with animations use GLTFSceneKit
Need support for Joints_2 and Weights_2. Could you please update the library for the same?
Materials created are nameless. Is there a way to retain the material names from GLTF file?
Would you mind putting this project on the https://github.com/KhronosGroup/glTF read.me under the languages section for swift
(I can try to do that too if you want)
that way it gets more visibility! its a good project.
First off, incredible project! I'm blown away by the concise code structure and the broad support the library provides. However, I'm getting the following error trying to load a glTF file with many empty morph targets (due to using fbx2gltf
):
DataInconsistent: loadWeightAnimationsSampler: data count mismatch: 3 != 25
The model I'm using is monster.glb.txt. I know the model isn't ideal but there are the right number of accessors for each morph target and nothing seems too out of place in that regard. Any thoughts on what could be the issue?
Models having geometry element primitive types other "Triangles" are not handled. Is there any plan to support these. Thanks in advance.
How To change Gltf morph target
Upon discovering that setting the options
parameter in GLTFSceneSource.init
or GLTFSceneSource.scene
didn't affect the output, I checked the source only to realize that these options don't appear to be used anywhere by GLTFKit.
Is this intentional? Is there any plan to support these? If not I might suggest to simply remove the parameter from those functions because as it stands right now it's misleading.
Thanks for your time. The library is greatly appreciated.
Is there a way to use a GLTFSceneSource as the source for an SCNReferenceNode? I'm using SCNRferenceNode.unload/.load to manage the memory consumption of other models and I'd like to also use it for GLTF models. Thanks!
Hi
I'm trying to show .glb file on swift.
I read the sample file and attached it on my Xcode project with same Assets.
But I encountered error like this.
Any help??
[SceneKit] Error: FATAL ERROR : failed compiling shader: Error Domain=MTLLibraryErrorDomain Code=3 "program_source:3718:1: error: C++ requires a type specifier for all declarations , constant float& metallicFactor ^ " UserInfo={NSLocalizedDescription=program_source:3718:1: error: C++ requires a type specifier for all declarations , constant float& metallicFactor ^ }
Hey, thanks for the great library! I have been experimenting with some models from Sketchfab with the sample macOS app and I've found a few models that have problems.
The following models have no texture:
https://sketchfab.com/models/d237537968c8474abfd43a258c415304
https://sketchfab.com/models/5f28af46bb6b42de8a1045d92300f771
https://sketchfab.com/models/fd8fc2a6e9d9441c9b5338cf384b4b6b
The following model crashes:
https://sketchfab.com/models/c2bd67e2fc644dfb9a80def2f773a5e5
It would be great if we could figure out what's going on.
Thanks in advance!
https://github.com/cx20/gltf-test
I've been running the tests found at that github project on the model viewer and it seems like the normal tangent test is failing
https://github.com/cx20/gltf-test/tree/master/tutorialModels/NormalTangentTest
we are supposed to get something like
this is from http://sandbox.babylonjs.com/
but we end up getting something like this.
the two "spheres" should be exactly the same, but they arent' I haven't looked into it too much, but it seems like the way the tangent vectors that are read from the GLB are being calculated incorrectly
How to move and Rotet GLTF model in ARview.
My model is showing correctly on the threejs-based Web browser, but GLTFSceneKit shows a white texture.
What's wrong?
error log
GLTFSceneKitSample[9058:612984] [SceneKit] Error: unsupported conversion uchar4 -> float4
There doesn't appear to be environment map supplied, so I believe that is why metals are basically black.
Is there a way to add a studio or outdoor HDR env. map?
related to Issue#15 (#15) ?
Hi,
We tried different approaches to add shadows to the AR object converted from GLB files, but none of them worked, and the only way that we could do it, done by adding the fake shadows, which is a pretty expensive approach at the CPU level.
Any idea how we can do it and what is the issue?
Thanks
I want to render .gtlf files on a tvOS app. Currently this library is not compatible with tvOS?
Can you please update the podspec
file and specify deployment target for tvOS?
Reference: http://blog.cocoapods.org/CocoaPods-0.39/
Hi,
We are converting the .babylon file to .gltf format and are trying to load this converted model on the iOS application. The model is getting rendered correctly barring the material color of certain objects which we added to the .babylon file before converting.
The converted model is showing all the material color properties on the .babylonSandbox for the gltf file. Attached are the screenshots of the sandbox and on the iPhone device respectively.
Any pointers regarding this issue would be really helpful.
Its not accessing the .gltf file when I using it through url like:
do { let sceneSource = GLTFSceneSource(url: scenePath) scene = try sceneSource.scene() } catch { print("\(error.localizedDescription)") return }
its saying : The file “Box0.bin” couldn’t be opened because there is no such file.
I have a *.gltf file with KHR_draco_mesh_compression extension.
So, I tried to load this file, but I cannot find loaded file in my phone screen.
And My log is here.
2020-01-22 18:20:05.273470+0900 arkit_gltf_test2[8239:2291248] Metal GPU Frame Capture Enabled
2020-01-22 18:20:05.273613+0900 arkit_gltf_test2[8239:2291248] Metal API Validation Enabled
The operation couldn’t be completed. (NSURLErrorDomain error -1100.)
Is this kit not available to this file? Then, Can you make this feature?
Running into an issue while rendering a gltf file through GLTFSceneKit. I've verifed that the file loads and animates through Bablyon.js, Cesium, Three.js but it is not working with SceneKit. more specifically I am getting this error on this line:
let skinner = SCNSkinner(baseGeometry: baseGeometry, bones: joints, boneInverseBindTransforms: boneInverseBindTransforms, boneWeights: boneWeights, boneIndices: boneIndices)
in GLTFUnarchiver.swift
Any ideas how to fix it ?
Hi
I am working on playing , pausing my animations attached in the GLTF file but I am facing certain issue with Pivot and the axis for the nodes I am trying to apply the animations to.
Is there any sample which illustrates the playing and pausing of animations attached to respective nodes or any pointers for the same would be really helpful.
Thanks & Regards
Ashutosh
I realized when I use SCNScene.lightingEnvironment, some models are rendered wrongly.
Fortunately, I can get the full shader source with Metal debugger. Let's check what is wrong.
Glb with animations is not working so does anyone have solutions ??
When models are getting imported their hierarchy is getting created like above.
where the water bottle only defines one submesh called water bottle
So instead of loading the gltf like we do know.
WaterBottle
-WaterBottleEmptyNode
-WaterBottleMesh
we should do this
WaterBottle
-WaterBottleMesh
because to access the materials of these nodes, we right now have to do something like
node.childNodes[0].childNodes[0].geometry?.firstMaterial
Would it be possible to load a custom vertex property from a .glb file and map a custom colour to it?
Thanks
Spider_3_scaled.glb.zip
gltf with animation not loading , failing with error : Error Domain=AGXMetalA9 Code=3 "Cannot convert attribute from MTLAttributeFormatShort4 to an unsigned integer type" UserInfo={NSLocalizedDescription=Cannot convert attribute from MTLAttributeFormatShort4 to an unsigned integer type}
attached the glb I am trying to load
Hi there! Thanks for the great work here!
I've been doing some test with the loader and I ended up loading distant files with http protocol, and it actually works.
Using Data(contentsOf:)
is synchronous and it doesn't give any room for customization (headers, authentication, ...) at least none that I know of.
I was wondering if we could make some changes to make resource loading async. This would allow on-demand fetching of glTF files over http, and we could even create an interface to give customization for requests.
I have a gltf model with an extenal .bin and .png file, but it seems thet the png file is not loaded.
I've looked into the code and I see these lines which is not good news I guess...
So basically it doesn't work on iOS when you have an texture image to load along with the .gltf ?
#if SEEMS_TO_HAVE_PNG_LOADING_BUG
// FIXME: this workaround doesn't work for iOS...
return UIImage(cgImage: cgImage)
Can someon tell me how to load UV maps(jpg) to a node from phone's file system?
So I have saved images and I want to apply them to a specific node inside my scene...
Thank you
Hello there,
We have a humanoid character
We dont know how to add animation in Glb file. Can anyone let us know how to play animations in iOS for Glb
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.