Sceneform-android-sdk: Unable to find a child node or get a list of children nodes from an imported MULTINODE OBJ/FBX model

Created on 1 Jun 2018  路  4Comments  路  Source: google-ar/sceneform-android-sdk

In Apple's Scenekit when you load a COLLADA file it returns a SCNNode with all of the objects from that COLLADA file as child nodes. SCNNode maintains the heirachy structure of nodes and all the parent and child relationships as defined in an authoring tool like Blender. You can get the list of child nodes as well as get an individual child node by name.

Similarly Sceneform provides one method for finding nodes by name called _findByName_ (String name) which supposedly traverses the hierarchy to find the first node with a given name. Does it only work in finding a given node in a Scene as I am not able to find a child node in a multi node 3d OBJ/FBX model?

For example if I am importing a human anatomy FBX model, I would like to find a head node or a hand node individually and animate it.

At present calling _findByName_ upon both _Scene_ object and _TransformableNode_ object returns null.

Also if I call _getChildren_ upon _TransformableNode_ it returns an empty list.

Does Sceneform create a mulit node renderable as a heirachy of nodes to support skeletal animation? Will this be supported it future?

Does Google plan on providing a visual editor for Sceneform to manipulate 3D objects inside Android Studio?

feature request

Most helpful comment

findByName/getChildren only look for Sceneform nodes. V1.0 does not support skeletal animation and yes we are looking into this for the future.

Without skeletal animation you would have to split the model into smaller models and use property animation (or some other method) to control them.

Renderables do however have submeshes, see https://developers.google.com/ar/reference/java/com/google/ar/sceneform/rendering/Renderable#getSubmeshCount() but as of V1.0 you are only allowed to access the material on each submesh.

It might make sense to open an separate ticket to track progress on a 3D editor for assets.

All 4 comments

findByName/getChildren only look for Sceneform nodes. V1.0 does not support skeletal animation and yes we are looking into this for the future.

Without skeletal animation you would have to split the model into smaller models and use property animation (or some other method) to control them.

Renderables do however have submeshes, see https://developers.google.com/ar/reference/java/com/google/ar/sceneform/rendering/Renderable#getSubmeshCount() but as of V1.0 you are only allowed to access the material on each submesh.

It might make sense to open an separate ticket to track progress on a 3D editor for assets.

Can you attach a media player to a submesh.
I have a similar need to find a child node by name and play a video on that child node that is perfectly positioned to hold the video. However, I can see the node name in the GLTF file or GLB, but i can't access it in code can you provide any guidance here?

@rajaselvan I found a way to at least create a dummy mesh, attach my media player and then replace the material of the child node I was trying to attach to since I couldn't get a reference to it. So I found a workaround. I don't know if this will provide you any help at all, but if you feel like it would give you any hacky clues of things you can try, I could provide what I did to hack the HelloSceneForm sample project where I nested a multi-node 3d object in place of "andy" then I replaced the material of the nested node with a code created material that served my purpose.

I was essentially trying to find the sub node named "Screen" to attach a media player, that didn't seem to be possible, same thing you were seeing about getting children nodes. After much trial and error I found that I could get to these names via subMesh at least and that i could replace the material there. So I created a dummy material attached a media player to that and replaced the material of the subMesh named "Screen" aka the node that I couldn't touch in code and that solved my use case.

I know in your use case you are attempting to animate the node, so this is probably not helpful, but in the world of AR you never know what helps a light bulb go off of things to try. Goodluck and do share if you find a clever workaround or implementation.

@malik-at-work will there be any support for interacting with nested nodes in the coming versions? Is this expected soon?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

StevenOttoG picture StevenOttoG  路  4Comments

khonakr picture khonakr  路  3Comments

scolar picture scolar  路  4Comments

michaelvogt picture michaelvogt  路  4Comments

arilotter picture arilotter  路  3Comments