This tutorial shows how to use parent/child service. This allows to
control different meshes but following a relationship and changes as rotation
or translation which are applied on parent will be applied on children too.
Home address for source code of meditor is:
The idea is to use parent/child relationship as a hierarchy standard.
I used a simple example composed by 3 meshes. They are simple boxes but
they can have any shape. I numbered meshes in next image to make clear.
The selected mesh I use as my first parent. The mesh 2 will be child of
mesh 1 and parent of mesh 3. The mesh 3 will have no child. One should expect
that 2 and 3 follow changes applied on 1 because there is a ring of connections,
so If I rotate mesh 1, mesh 2 will rotate following same changes applied
on mesh 1. As mesh 2 changed due to 1, all child of mesh 2 will also change
due to changes applied on mesh 2, so the mesh 3 will also change. The idea
is to select _ONE_ mesh and enable it as parent using proper button. Same
idea for child.
Next image shows the command window with control button
enabled. Please, notice I indicated the buttons used to create the relationship
between the pair of meshes.
Once one applied the sequence of parent/child as (1/2)
and (2/3), if I select mesh 1 and rotate it a little, whole connected chain
of mesh 1,2, and 3 will change following the hierarchy as one can see in
next image. Please, notice the only selected mesh is #1.
Now I select the mesh 2 and I rotate it a little and one
should notice, the mesh 1 will not change and mesh 3 followed the rotation,
even it is not selected as previously noticed. Next image shows my change.
Now I rotate the #3 and nothing changes for #1 and #2.
Again I unselect all and I select #1 and I rotated it.
One should notice the whole chain is modified. Next image shows final configuration
with all meshes unselected.
That is all folks!
This tutorial show rotations but one could easily test
changes using 'm' (move) command. Same hierarchy changes should also appear.
If one noticed the idea, I created a very simple example to show a leg like
configuration. The thigh is mesh #1, leg is #2, and foot is #3. I didn't
care about intersection of different parts of meshes but one could
create a good model to test the service. If one selected two meshes with
parent/child relationship and applies changes as rotation, that group of
selected meshes will behave as simple meshes and this will discard parent/child
relationship. If more child exists and it is not selected, changes will follow
operation on group of meshes. In this example, if I select #1 and #2 and
I apply rotation, the group will move following center of rotation of the
group and unselected child in same chain will follow same center of rotation
of this selected group, so this has different behavior of hierarchy because
you tried to move connected components of the chain.