Trying to trigger AFRAME.GLTFModelPlus.registerComponent from a custom glb file #4769
-
Q: I am trying to trigger AFRAME.GLTFModelPlus.registerComponent with a custom glb model exported from Blender Task: I would like to understand how the "click" event is added to the default Duck via the chat message. I have in the past cloned out the sections and files that write the duck to use a different model, but I finally figured out that I can't add a click event to the models aframe component cause I can't trigger AFRAME.GLTFModelPlus.registerComponent So I put a debugger on the original Duck AFRAME.GLTFModelPlus.registerComponent("duck"... Depending on how I export this I can either get a 3d model to load but not hit the debugger, or the model loads as a broken link. I have checked if the file is a real file in glTF viewer, but I don't know of an app that can view glb files metadata other then reimporting into blender Sample code
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Answer. Blender converts object literal in the Custom Properties edit screen with Ok button into a string. |
Beta Was this translation helpful? Give feedback.
Answer. Blender converts object literal in the Custom Properties edit screen with Ok button into a string.
You need to assign the object in the python console
bpy.context.selected_objects[0]["components"] = {'duck': {'a': 1}}
then when checking it with bpy.context.selected_objects[0]["components"]["duck"]
You'll get an object. But if you check that with it being a string you get an error