Closed hemantkadamata closed 5 years ago
Please check your sfa file in particular the "recenter" attribute. If you want to export the original pos from the gtlf to the sfb this attribute should be set to false (more info).
@bobekos I am downloading the GLTF file and rendering it as I have multiple files which I can't include within the application
Then you can set the recenter attribute through the "setRecenterMode" function before rendering. It is the same thing.
still the same, adding my code below let me know if I am doing anything wrong here.
hair_render = ModelRenderable.builder()
.setSource(this, RenderableSource.builder().setSource(
this,
Uri.parse(hair_gltf),
RenderableSource.SourceType.GLTF2)
.setRecenterMode(RenderableSource.RecenterMode.NONE)
.build())
.setRegistryId(hair_gltf)
.build();
body_render = ModelRenderable.builder()
.setSource(this, RenderableSource.builder().setSource(
this,
Uri.parse(body_gltf),
RenderableSource.SourceType.GLTF2)
.setRecenterMode(RenderableSource.RecenterMode.NONE)
.build())
.setRegistryId(body_gltf)
.build();
top_render = ModelRenderable.builder()
.setSource(this, RenderableSource.builder().setSource(
this,
Uri.parse(top_gltf),
RenderableSource.SourceType.GLTF2)
.setRecenterMode(RenderableSource.RecenterMode.NONE)
.build())
.setRegistryId(top_gltf)
.build();
CompletableFuture.allOf(
body_render,
top_render,
hair_render)
.handle((notUsed, throwable) -> {
if (throwable != null) {
DemoUtils.displayError(this, "Unable to load renderable", throwable);
return null;
}
try {
body = body_render.get();
top = top_render.get();
hair = hair_render.get();
// Everything finished loading successfully.
hasFinishedLoading = true;
} catch (InterruptedException | ExecutionException ex) {
DemoUtils.displayError(this, "Unable to load renderable", ex);
}
return null;
});
It looks like top_render may be missing the call to setRecenterMode in your code snippet
do we have any workaround or shall I try any other specific approach? sharing my GLTF file for reference. FBA.zip FBAgarment.zip FBAhair.zip
Have you tried adding the call to setRecenterMode in the following code block?
top_render = ModelRenderable.builder()
.setSource(this, RenderableSource.builder().setSource(
this,
Uri.parse(top_gltf),
RenderableSource.SourceType.GLTF2)
.build())
It looks like the other renderables have their recenter mode set but not this one.
@dsternfeld7 yes I have tried it, same is with the Hair Style too. My bad actually copying the code I guess I missed adding the setRecenterMode.
Hi All, is there any workaround for this bug till we have an update for the issue.
For advice and general questions, please use the Sceneform
tag on
Stack Overflow: https://stackoverflow.com/questions/tagged/Sceneform
In addition, please see the Sceneform SDK developer documentation and API reference.
@fredsa Are you saying this is not a bug. but when I am using SFA and SFB and modifying the "recenter" attribute in SFA file as mention by @bobekos it works fine but the same is not for at runtime.
Guys any update on the bug
on loading GLTF files from the server, objects are not taking the origin but counting as position (0,0,0). but when the same file we check in blender all the objects are in correct order.