物体父子关系

When modeling a complex object, such as a watch, you may choose to model the different parts as separate objects. To make all the parts move as one (“the watch”), you can designate one object as the parent of all the other parts. These other parts become its children, and any translation, rotation, or scale of the parent will also affects its children.

Contrary to most biological lifeforms, each object or bone in Blender has at most one parent. If an object already has a parent object and you give it another parent then Blender will remove the previous parent relationship. When the plural “parents” is used in this chapter, it references the hierarchy of parents, so the parent, the grandparent, great grandparent, and so on, of an object.

创建父级

参考

模式

物体模式

菜单

物体(Object) ‣ 父级(Parent)

快捷键

Ctrl-P

To parent objects, select at least two objects (select the child objects first, and select the parent object last), and press Ctrl-P. The Set Parent To menu will pop up allowing you to select from one of several possible different parenting types. Selecting one of the entries in Set Parent To confirms, and the child/children to parent relationship is created. The selected objects will have their ‘parent’ set to the active object, and as a result will be ‘siblings’.

弹出的 设定父级目标 菜单是上下文相关(语境)的菜单,这意味着它显示的条目数量是根据使用 Ctrl-P 快捷方式时选择的物体不同而不同。

Moving, rotating or scaling the parent will also usually transform the child/children. Yet transforming the child/children of the parent will not affect the parent. In other words, the direction of influence is from parent to child and not child to parent.

父级反校正

Blender can assign a parent without moving the child object. This is achieved via a hidden matrix called the Parent Inverse matrix, which sits between the transform of the parent and the child.

When objects are parented with Ctrl-P, Parent Inverse matrix is updated. Depending on the choice in the Set Parent menu, the object’s local location, rotation, and scale are also updated. For more details, see Object Parent.

The Parent Inverse matrix can be cleared by using Clear Parent Inverse.

Note

When setting the parent via the Object Properties panel, the Parent Inverse matrix is always reset. This can cause an unexpected jump in the object’s position. To avoid this, use Ctrl-P to set the new parent.

父级类型

Blender支持许多不同类型的父子关系,如下所示:

  • 物体

  • 骨骼

  • 顶点

  • 顶点 (基于三点)

设置

除了选择的物体父子关系之外,它还为子级物体添加了一个修改器或约束,并将父级作为目标物体或激活父级属性,例如 跟随路径

物体父级

Object Parent is the most general form of parenting that Blender supports. It will take selected objects and make the active object the parent object of all the selected objects. Each child object will inherit the transformations of the parent. The parent object can be of any type.

There are three operators that allow you to set an object parent. They differ in the way they compute the Parent Inverse matrix and the local transform of the object.

Set Parent to Object

If the object has a pre-existing parent, that is cleared first. This moves the object to its own location, rotation and scale, without its parent’s influence. Regardless of whether it had a parent before, Blender proceeds to do the same as “Keep Transform” below.

Set Parent to Object (Keep Transform)

The object’s current world transform (so its absolute location, rotation and scale in the world) is computed. The new parent is set, and then the Parent Inverse matrix is computed such that after setting the new parent the object is still at its previous world transform.

Set Parent to Object (Without Inverse)

This sets the parent, and then resets the Parent Inverse matrix and the object’s local location. As a result, the object will move to the location of the parent, but keep its rotation and scale.

Example: Object (Keep Transform) Parent

物体(保持变换)父级 工作方式非常类似于 物体父级。 主要的区别在于子级物体是否会记住之前父级物体应用于它们的任何先前变换。

假设有一个由三个物体组成的场景,它们是名为“EmptyA”和“EmptyB”的两个空物体,以及一个猴头物体。图 没有父子关系的场景。 显示了三个没有父子关系的物体。

../../../_images/scene-layout_object_editing_parent_keep-transform-a.png

没有父子关系的场景。

If you select the Monkey object by LMB click and then Shift-LMB click “EmptyA” object and press Ctrl-P and finally select Object from the Set Parent To pop-up menu. This will result in “EmptyA” object being the parent object of the Monkey object. With only “EmptyA” selected rotating/scaling/moving it will result in the Monkey object being altered respectively.

缩放“EmptyA”物体,使猴头变小并向左移动一点。

../../../_images/scene-layout_object_editing_parent_keep-transform-b.png

猴头是“EmptyA”的子级物体。

If you select only the Monkey object by LMB click and then Shift-LMB click “EmptyB” object and press Ctrl-P and select Object from the Set Parent To pop-up menu. This will result in “EmptyB” object being the parent object of the Monkey object. Notice that when you change the parent of the Monkey the scale of the Monkey changed.

../../../_images/scene-layout_object_editing_parent_keep-transform-c.png

猴头是“EmptyB”的子级物体。

发生这种情况是因为猴头物体从来没有直接改变其缩放,之所以变化是因为它是“EmptyA”的子级物体,跟随其缩放发生了变化。由于“EmptyB”没有改变其缩放,因此将猴头的父级更改为“EmptyB”导致这些间接的缩放变化被移除。

This is often the required behavior, but it is also sometimes useful that if you change your parent object that the child object keep any previous transformations it got from the old parent object; If instead when changing the parent object of the Monkey from “EmptyA” to “EmptyB” we had chosen parenting type Object (Keep Transform), the Monkey would keep its scale information it obtained from the old parent “EmptyA” when it is assigned to the new parent “EmptyB”.

../../../_images/scene-layout_object_editing_parent_keep-transform-d.png

物体(保持变换)父级方法。

如果想继续了解上面的描述,这里是用于描述 物体(保持变换) 父级方法的blend文件:

文件:设置物体(保持变换)父级(演示).blend_(Demo_File).blend) 。

骨骼父级

骨骼父子关系允许将骨架上的某些骨骼设为另一个物体的父级物体。这意味着,当变换一个骨架时,子物体只会跟随着特定的骨骼移动。

../../../_images/scene-layout_object_editing_parent_bone1.png

有四个骨骼的骨架的三个图片。

在图 有四个骨骼的骨架的三个图片。 中,第二个骨骼是立方体物体的父级。立方体只有在第一或第二块骨骼的情况下才会变形。注意改变第三和第四根骨头对立方体没有影响。

To use bone parenting, you must first select all the child objects you wish to parent to a specific armature bone, then Shift-LMB select the armature object and switch it into Pose Mode and then select the specific bone you wish to be the parent bone by LMB selecting it. Once done press Ctrl-P and select bone from the Set Parent To pop-up menu.

现在在姿态模式下变换骨骼会导致子物体也会发生变换。

相对父子关系

骨骼相对父子关系是你可以为每个骨骼切换的选项。这和骨骼父子一样,但有一点不同。

使用骨骼父级时,如果将骨骼作为某些子物体的父级并选择该骨骼,然后将其切换为编辑模式并移动该骨骼,当在该骨骼上切换回姿态模式时,作为该骨骼的子物体将在姿态模式中吸附回骨骼的位置。

../../../_images/scene-layout_object_editing_parent_bone2.png

使用骨骼父级方法具有子级立方体物体的单个骨架骨骼。

在图 使用骨骼父级方法具有子级立方体物体的单个骨架骨骼。 中,第一张图片显示骨骼在编辑模式下移动之前立方体和骨架的位置。第二张照片显示了在编辑模式中选择骨骼,移动并切换回姿势模式后立方体和骨架的位置。注意,子级物体移动到姿态骨骼的新位置。

骨骼相对父子关系的工作方式则不同:如果在编辑模式下移动父级骨骼,当切换回姿势模式时,子物体将不会移动到姿势骨骼的新位置。

../../../_images/scene-layout_object_editing_parent_bone3.png

立方体使用相对父子链接到单一骨骼。

在图 立方体使用相对父子链接到单一骨骼。 中,第一张图片显示骨骼在编辑模式下移动之前立方体和骨架的位置。第二张照片显示了在编辑模式中选择骨骼后,移动并切换回姿势模式后立方体和骨架的位置。请注意,子物体不会移动到姿势骨骼的新位置。

Note

当使用 Ctrl-P 来设置父级时,选择”骨骼”或”相对骨骼”将分别清除和设置骨骼的”相对父子关系”选项。由于”相对父子关系”是每个骨骼设置的选项,这会同时影响该骨骼的所有子物体。

顶点父级

对于曲线、曲面、网格和晶格类型的物体,可以将其顶点或点用作其他物体的父级。你可以将一个物体设置父级到一个顶点或一组的三个顶点,这样,当父网格变形时,子级将会随之移动。

来自编辑模式的顶点父级

物体模式 中,选择子级,然后选择父级物体。 Tab 切换到 编辑模式 并在父物体上选择一个定义单个点的顶点,或者选择三个顶点定义一个区域(三个顶点不必形成一个完整的面;它们可以是父物体的任意三个顶点),然后按下 Ctrl-P 并确认。

此时,如果选择了单个顶点,则将从顶点向子级绘制关系/父子线。如果选择了三个顶点,则从(父级物体的)三个点的平均中心向子级绘制关系/父子线。现在,当父级网格形变并且所选父顶点移动时,子级也将移动。

来自物体模式的顶点父级

可以在物体模式下执行顶点父级,方法类似普通物体父级。在物体模式中按 Ctrl-P 并选择 顶点顶点(基于三点)

将从每个物体使用最近的顶点,这通常也是您想要的。

顶点父级示例。
../../../_images/scene-layout_object_editing_parent_object-mode-example-1.png

使用设置父级上下文菜单中的“顶点(基于三点)”,每个小立方体都可以自动设置父级为棱角球上附近顶点三元组。

../../../_images/scene-layout_object_editing_parent_object-mode-example-2.png

在编辑模式下重新塑造物体,意味着每个立方体都分别跟随其顶点父级变换。

../../../_images/scene-layout_object_editing_parent_object-mode-example-3.png

Scaling the parent icosphere in Object Mode means the child cubes are also scaled as expected.

设定父级上下文菜单项意味着用户可以快速设置大量顶点父级关系,并避免单独建立每个父——子顶点关系的繁琐工作。

Note

它实际上是一种“反转”的 钩挂

选项

移动子级

通过清除它的原点,你可以将一个子物体 移动 到它的父物体上。父级与子级之间的关系不受影响。选择子物体并按下 Alt-O。通过确认子物体将吸附到父级的位置。使用 大纲 视图来验证子物体是否仍然存在父级。

清空父级

参考

模式

物体模式

菜单

物体(Object) ‣ 父级(Parent)

快捷键

Alt-P

你可以通过 Alt-P 方式 删除 父级 - 子级关系。

清空父级

如果只选择组中的父级,则不做任何事情。如果选择了一个子级或多个子级,他们就会与父级分离,或者被释放,并且他们会返回他们原来的位置,旋转和大小。

清除并保持变换结果

从父级那里解散子级,但 保留 父级给他们的位置、旋转和大小。

参见 非均匀缩放 可能适用于这里。

清除父级反校正

与剔除父子层级关系不同,此选项是从选择的物体中清理掉 父级反校正 矩阵。有了这个清空的矩阵,子物体的位置、旋转、缩放属性可以在父物体的世界坐标里表现。

Hint

使用大纲视图

There is another way to see the parent-child relationship in groups and that is to use the Outliner view of the Outliner editor.

已知局限

非均匀缩放

与其子级相比,父级的缩放和旋转不均匀可能会导致 剪切 效应。

虽然父子关系支持这种做法,但是当父级被清除后,剪切将会丢失,因为它不能用位置,缩放和旋转。

如果 清除并保持变换结果 移动物体,则非均匀缩放是最可能的原因。