You can directly copy the position, rotation and scaling properties to the TransformNode’s corresponding properties. Then, to update the bone itself, here’s how Skeleton.prepare is doing it:
yes with newest AI - it is super cool to play with such things and bring both worlds together🙂 It is creating the body from the flat rendered skeleton version on black background + a prompt. This is called ControlNet/PoseNet. From body it would be also possible btw.
A gizmo can be attached to a bone. In the PG, it’s the mesh position.x that is changed. to get bone/gizmo in sync, you’ll have to move the skeleton instead.
thank you. But what is the best way to move a skeleton? there is no position there
I tried it with skeleton.bones[0].position but also does not change anything here.
found it: skeleton.bones[0].setPosition(…) works now.
I used the mesh again for MakeNotPickableAndWrapInBoundingBox because this features supports only meshes (tried root bone and transformNode of it already) but I am getting same gizmos position problem (and only one mesh is used, other is ignored of course)
the gizmo is using that boundingbox only (boundingBoxGizmo.attachedMesh = boundingBox )
position/rotation gizmo can be bound to a bone or a transformNode in general but a boundingbox gizmo will need a mesh. if you hook an observable, you can adapt and apply the same transform to anything
hmm shouldn’t be the vector of the position of bones and all meshes just (0,0,0)?
So I had another idea to use bounding-box gizmo on an invisible dummy of mesh (clone) and copy position information to skeleton (root bone).
And this works quite good (position only at the moment):
But bounding box is not at correct position now. Any idea to solve this?
I tried meshBlueClone.setBoundingInfo(meshBlue.getBoundingInfo()) already. Also I tried to add clone to TN of root bone.
Thank you!
Update: refreshBoundingInfo(true) also does not work
Update 2:
with
let abs=meshBlueClone.getAbsolutePosition().clone()
abs.y+=1
root.getTransformNode().setAbsolutePosition(abs)
the position now works:
.clone() is important because of next line
I added +1 to y. I cannot explain this but it solves the issue
I have a new question. I am still doing baby steps here - like 3 lines in a day with hours of research in documentation and this forum. This is still not easy to me.
I want to transfer the rotation to the character.
This version is not working:
I tried nearly everything in last hours but this makes most sense for me because the attached mesh seems to have 0 vector here. I guess because it is relative to the boundingBox.
So I used the boundingBox but rotation is totally wrong here.
I had this already… but for my project I also need resizing so the other one was perfect using boundingBox.
UPDATE: it is the glb file from test here which confuses everything. I made a manual new rigging in Blender and with that everything works like expected. I hade huge problems modify skeletons in Blender + export as gltif anyway. The only solution is to make a new one.