Files
godot-docs-l10n/classes/zh_CN/class_retargetmodifier3d.rst

262 lines
12 KiB
ReStructuredText

:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.4/doc/classes/RetargetModifier3D.xml.
.. _class_RetargetModifier3D:
RetargetModifier3D
==================
**继承:** :ref:`SkeletonModifier3D<class_SkeletonModifier3D>` **<** :ref:`Node3D<class_Node3D>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
修改器,能够将父骨架的姿势(或全局姿势)转移给在模型空间中具有不同放松姿势的子骨架。
.. rst-class:: classref-introduction-group
描述
----
获取模型空间中相对于父骨架放松姿势的姿势(或全局姿势)并将其转移给子 Skeleton。
修改器会在父骨架的更新过程中直接重写子骨架的姿势。这意味着它会覆盖目标骨架上正常处理过程中设置的映射骨骼姿势。如果你想要在重新定向后设置目标骨架的骨骼姿势,则需要向目标骨架添加一个 :ref:`SkeletonModifier3D<class_SkeletonModifier3D>` 子节点才能修改姿势。
\ **注意:**\ 启用 :ref:`use_global_pose<class_RetargetModifier3D_property_use_global_pose>` 时,即便是未映射的骨骼也可能导致视觉问题,因为\ **如果父骨骼存在映射的子骨骼**\ ,那么应用全局姿势时会忽略父骨骼的姿势。另见 :ref:`use_global_pose<class_RetargetModifier3D_property_use_global_pose>`\ 。
.. rst-class:: classref-reftable-group
属性
----
.. table::
:widths: auto
+---------------------------------------------------------------------------+---------------------------------------------------------------------------+-----------+
| |bitfield|\[:ref:`TransformFlag<enum_RetargetModifier3D_TransformFlag>`\] | :ref:`enable<class_RetargetModifier3D_property_enable>` | ``7`` |
+---------------------------------------------------------------------------+---------------------------------------------------------------------------+-----------+
| :ref:`SkeletonProfile<class_SkeletonProfile>` | :ref:`profile<class_RetargetModifier3D_property_profile>` | |
+---------------------------------------------------------------------------+---------------------------------------------------------------------------+-----------+
| :ref:`bool<class_bool>` | :ref:`use_global_pose<class_RetargetModifier3D_property_use_global_pose>` | ``false`` |
+---------------------------------------------------------------------------+---------------------------------------------------------------------------+-----------+
.. rst-class:: classref-reftable-group
方法
----
.. table::
:widths: auto
+-------------------------+----------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_position_enabled<class_RetargetModifier3D_method_is_position_enabled>`\ (\ ) |const| |
+-------------------------+----------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_rotation_enabled<class_RetargetModifier3D_method_is_rotation_enabled>`\ (\ ) |const| |
+-------------------------+----------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_scale_enabled<class_RetargetModifier3D_method_is_scale_enabled>`\ (\ ) |const| |
+-------------------------+----------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`set_position_enabled<class_RetargetModifier3D_method_set_position_enabled>`\ (\ enabled\: :ref:`bool<class_bool>`\ ) |
+-------------------------+----------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`set_rotation_enabled<class_RetargetModifier3D_method_set_rotation_enabled>`\ (\ enabled\: :ref:`bool<class_bool>`\ ) |
+-------------------------+----------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`set_scale_enabled<class_RetargetModifier3D_method_set_scale_enabled>`\ (\ enabled\: :ref:`bool<class_bool>`\ ) |
+-------------------------+----------------------------------------------------------------------------------------------------------------------------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
枚举
----
.. _enum_RetargetModifier3D_TransformFlag:
.. rst-class:: classref-enumeration
flags **TransformFlag**: :ref:`🔗<enum_RetargetModifier3D_TransformFlag>`
.. _class_RetargetModifier3D_constant_TRANSFORM_FLAG_POSITION:
.. rst-class:: classref-enumeration-constant
:ref:`TransformFlag<enum_RetargetModifier3D_TransformFlag>` **TRANSFORM_FLAG_POSITION** = ``1``
如果设置,则允许重定向位置。
.. _class_RetargetModifier3D_constant_TRANSFORM_FLAG_ROTATION:
.. rst-class:: classref-enumeration-constant
:ref:`TransformFlag<enum_RetargetModifier3D_TransformFlag>` **TRANSFORM_FLAG_ROTATION** = ``2``
如果设置,则允许重定向旋转。
.. _class_RetargetModifier3D_constant_TRANSFORM_FLAG_SCALE:
.. rst-class:: classref-enumeration-constant
:ref:`TransformFlag<enum_RetargetModifier3D_TransformFlag>` **TRANSFORM_FLAG_SCALE** = ``4``
如果设置,则允许重定向缩放。
.. _class_RetargetModifier3D_constant_TRANSFORM_FLAG_ALL:
.. rst-class:: classref-enumeration-constant
:ref:`TransformFlag<enum_RetargetModifier3D_TransformFlag>` **TRANSFORM_FLAG_ALL** = ``7``
如果设置,则允许重定向位置、旋转、位置。
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
属性说明
--------
.. _class_RetargetModifier3D_property_enable:
.. rst-class:: classref-property
|bitfield|\[:ref:`TransformFlag<enum_RetargetModifier3D_TransformFlag>`\] **enable** = ``7`` :ref:`🔗<class_RetargetModifier3D_property_enable>`
.. rst-class:: classref-property-setget
- |void| **set_enable_flags**\ (\ value\: |bitfield|\[:ref:`TransformFlag<enum_RetargetModifier3D_TransformFlag>`\]\ )
- |bitfield|\[:ref:`TransformFlag<enum_RetargetModifier3D_TransformFlag>`\] **get_enable_flags**\ (\ )
禁用 :ref:`use_global_pose<class_RetargetModifier3D_property_use_global_pose>` 时,用于单独控制变换元素过程的标志。
.. rst-class:: classref-item-separator
----
.. _class_RetargetModifier3D_property_profile:
.. rst-class:: classref-property
:ref:`SkeletonProfile<class_SkeletonProfile>` **profile** :ref:`🔗<class_RetargetModifier3D_property_profile>`
.. rst-class:: classref-property-setget
- |void| **set_profile**\ (\ value\: :ref:`SkeletonProfile<class_SkeletonProfile>`\ )
- :ref:`SkeletonProfile<class_SkeletonProfile>` **get_profile**\ (\ )
用于重定向与骨骼列表中名称匹配骨骼的 :ref:`SkeletonProfile<class_SkeletonProfile>`\ 。
.. rst-class:: classref-item-separator
----
.. _class_RetargetModifier3D_property_use_global_pose:
.. rst-class:: classref-property
:ref:`bool<class_bool>` **use_global_pose** = ``false`` :ref:`🔗<class_RetargetModifier3D_property_use_global_pose>`
.. rst-class:: classref-property-setget
- |void| **set_use_global_pose**\ (\ value\: :ref:`bool<class_bool>`\ )
- :ref:`bool<class_bool>` **is_using_global_pose**\ (\ )
如果为 ``false``\ ,则在目标骨架的骨骼数量少于源骨架时,源骨架父级的变换将被忽略。
这样可以在不同体型的模型之间进行重定向,位置、旋转和缩放都可以单独重定向。
如果为 ``true``\ ,则在重定向时会考虑全局姿势。
在目标骨架的骨骼数量少于源骨架的情况下,会考虑源骨架父级的变换。然而,骨架之间的骨骼长度必须完全匹配,否则骨骼将被强制扩展或缩小。
适用于在骨骼数量不同的模型之间进行重定向时使用长度为 ``0`` 的虚设骨骼来匹配姿势。
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
方法说明
--------
.. _class_RetargetModifier3D_method_is_position_enabled:
.. rst-class:: classref-method
:ref:`bool<class_bool>` **is_position_enabled**\ (\ ) |const| :ref:`🔗<class_RetargetModifier3D_method_is_position_enabled>`
如果 :ref:`enable<class_RetargetModifier3D_property_enable>` 中有 :ref:`TRANSFORM_FLAG_POSITION<class_RetargetModifier3D_constant_TRANSFORM_FLAG_POSITION>` 则返回 ``true``\ 。
.. rst-class:: classref-item-separator
----
.. _class_RetargetModifier3D_method_is_rotation_enabled:
.. rst-class:: classref-method
:ref:`bool<class_bool>` **is_rotation_enabled**\ (\ ) |const| :ref:`🔗<class_RetargetModifier3D_method_is_rotation_enabled>`
如果 :ref:`enable<class_RetargetModifier3D_property_enable>` 中有 :ref:`TRANSFORM_FLAG_ROTATION<class_RetargetModifier3D_constant_TRANSFORM_FLAG_ROTATION>` 则返回 ``true``\ 。
.. rst-class:: classref-item-separator
----
.. _class_RetargetModifier3D_method_is_scale_enabled:
.. rst-class:: classref-method
:ref:`bool<class_bool>` **is_scale_enabled**\ (\ ) |const| :ref:`🔗<class_RetargetModifier3D_method_is_scale_enabled>`
如果 :ref:`enable<class_RetargetModifier3D_property_enable>` 中有 :ref:`TRANSFORM_FLAG_SCALE<class_RetargetModifier3D_constant_TRANSFORM_FLAG_SCALE>` 则返回 ``true``\ 。
.. rst-class:: classref-item-separator
----
.. _class_RetargetModifier3D_method_set_position_enabled:
.. rst-class:: classref-method
|void| **set_position_enabled**\ (\ enabled\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_RetargetModifier3D_method_set_position_enabled>`
在 :ref:`enable<class_RetargetModifier3D_property_enable>` 中设置 :ref:`TRANSFORM_FLAG_POSITION<class_RetargetModifier3D_constant_TRANSFORM_FLAG_POSITION>`\ 。
.. rst-class:: classref-item-separator
----
.. _class_RetargetModifier3D_method_set_rotation_enabled:
.. rst-class:: classref-method
|void| **set_rotation_enabled**\ (\ enabled\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_RetargetModifier3D_method_set_rotation_enabled>`
在 :ref:`enable<class_RetargetModifier3D_property_enable>` 中设置 :ref:`TRANSFORM_FLAG_ROTATION<class_RetargetModifier3D_constant_TRANSFORM_FLAG_ROTATION>`\ 。
.. rst-class:: classref-item-separator
----
.. _class_RetargetModifier3D_method_set_scale_enabled:
.. rst-class:: classref-method
|void| **set_scale_enabled**\ (\ enabled\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_RetargetModifier3D_method_set_scale_enabled>`
在 :ref:`enable<class_RetargetModifier3D_property_enable>` 中设置 :ref:`TRANSFORM_FLAG_SCALE<class_RetargetModifier3D_constant_TRANSFORM_FLAG_SCALE>`\ 。
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
.. |static| replace:: :abbr:`static (调用本方法无需实例,可直接使用类名进行调用。)`
.. |operator| replace:: :abbr:`operator (本方法描述的是使用本类型作为左操作数的有效运算符。)`
.. |bitfield| replace:: :abbr:`BitField (这个值是由下列位标志构成位掩码的整数。)`
.. |void| replace:: :abbr:`void (无返回值。)`