Beginner question: pose editor - rotation

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:

const node = bone._linkedTransformNode;
bone.position = node.position;
if (node.rotationQuaternion) {
    bone.rotationQuaternion = node.rotationQuaternion;
} else {
    bone.rotation = node.rotation;
}
bone.scaling = node.scaling;
1 Like

thank you this works great (I made new objects before with the right type because I store pose data external)

as my little project comes to the end now I want to share some results :slightly_smiling_face:



2 Likes

cooool is it creating the body from the picture or the picture from the skeleton :slight_smile: ??? with AI those days we never know

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.

1 Like

One more question🙂 If I move the mesh the gizmos are not at the correct position anymore:

How to solve this?

Thank you!

A gizmo can normally not be attached to a bone so I guess it might be the reason why cc @Cedric

yes to mesh it seems to work and I can copy values from sphere

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 also tried to work with the sphere only: it shows the Gizmo at correct position but using it destroys it:

I am wondering how to add a boundingBox 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 )

Thank you!

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 made it with:

tn.rotationQuaternion=boundingBox.rotationQuaternion

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.

Any idea how to solve this?

Thank you!

Nop. It’s the local position of the bone to his parent. It’s 0,0,0 is bones are following/touching but it’s not mandatory.

I would use a proxy transformNode as a parent to the skeleton. Just to check and a rotation/position gizmo attached to that proxy.

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.