google-ar / sceneform-android-sdk

Sceneform SDK for Android
https://developers.google.com/sceneform/develop/
Apache License 2.0
1.23k stars 604 forks source link

GetName always returns "Node" #699

Open LeoAtreides opened 5 years ago

LeoAtreides commented 5 years ago

The following code when called on the supplied source file

myNode.callOnHierarchy(node -> { Log.d(TAG, "NodeName :: " + node.getName()); } );

alwyas logs this to logcat

Activity: NodeName :: Node Activity: NodeName :: Node Activity: NodeName :: Node Activity: NodeName :: Node

The source file is a gltf file converted in Android Studio with sceneform 1.9

The original heirachy should be

Untitled

source file gltf.zip

note that the source file does contain the correct node names

aurangzaibumer777 commented 5 years ago

set a name when creating your node object like CustomNode().apply { node = "Your node name" }

this one is kotlin snippet

LeoAtreides commented 5 years ago

No that is incorrect. The node name is in the gltf file and is correct at that time. I suggest you dont understand the problem.

tonilsz commented 5 years ago

You have to understand that Node and Renderable are two different things, a node contains a renderable.

If you want to get every mesh name you must do something like that: for (i in 0..(myNode.renderable.submeshCount - 1)) myNode.renderable.getSubmeshName(i)

hope that will help you

LeoAtreides commented 5 years ago

Again, this is not an answer to the issue. I explicitly want to access the node.

In the reported issue the node called locator1 is meshless. And its node name is returned from sceneview as 'Node'