Up to date

This page is up to date for Godot 4.2. If you still find outdated information, please open an issue.

Node type customization using name suffixes

Muitas vezes, ao editar uma cena, há tarefas comuns que precisam ser feitas após a exportação:

  • Adicionando detecção de colisão a objetos.

  • Definindo objetos como malhas de navegação.

  • Deleting nodes that are not used in the game engine (like specific lights used for modeling).

To simplify this workflow, Godot offers several suffixes that can be added to the names of the objects in your 3D modeling software. When imported, Godot will detect suffixes in object names and will perform actions automatically.

Aviso

All the suffixes described below are case-sensitive.

Remover os Nós (-noimp)

Nomes de nó que tenham o sufixo -noimp serão removidos no momento da importação, não importa qual seja o seu tipo. Eles não aparecerão na cena importada.

This is equivalent to enabling Skip Import for a node in the Advanced Import Settings dialog.

Criar colisões (-col, -convcol, -colionly, -convcolonly)

A opção -col funcionará apenas para objetos Mesh. Se for detectado, um nó de colisão estática filho será adicionado, usando a mesma geometria da malha. Isto criará uma forma de colisão de malha de triângulo, que é uma opção lenta, mas precisa para a detecção de colisão. Esta opção é normalmente o que você quer para geometria de fase (mas veja também -colonly abaixo).

The option -convcol will create a ConvexPolygonShape3D instead of a ConcavePolygonShape3D. Unlike triangle meshes which can be concave, a convex shape can only accurately represent a shape that doesn't have any concave angles (a pyramid is convex, but a hollow box is concave). Due to this, convex collision shapes are generally not suited for level geometry. When representing simple enough meshes, convex collision shapes can result in better performance compared to a triangle collision shape. This option is ideal for simple or dynamic objects that require mostly-accurate collision detection.

No entanto, em ambos os casos, a geometria visual é muito complexa ou muito irregular para colisões. Isto pode criar falhas físicas e retardar o motor desnecessariamente.

To solve this, the -colonly modifier exists. It will remove the mesh upon importing and will create a StaticBody3D collision instead. This helps the visual mesh and actual collision to be separated.

The option -convcolonly works in a similar way, but will create a ConvexPolygonShape3D instead using convex decomposition.

With Collada files, the option -colonly can also be used with Blender's empty objects. On import, it will create a StaticBody3D with a collision node as a child. The collision node will have one of a number of predefined shapes, depending on Blender's empty draw type:

Choosing a draw type for an Empty on creation in Blender

Choosing a draw type for an Empty on creation in Blender

Quando possível, tente usar algumas formas de colisão primitivas ao invés de malhas triangulares ou formas convexas. As formas primitivas costumam ter o melhor desempenho e confiabilidade.

Nota

For better visibility on Blender's editor, you can set the "X-Ray" option on collision empties and set some distinct color for them by changing Edit > Preferences > Themes > 3D Viewport > Empty.

If using Blender 2.79 or older, follow these steps instead: User Preferences > Themes > 3D View > Empty.

Ver também

Veja Formas de colisão (3D) para uma visão abrangente das formas de colisão.

Criar navegação (-navmesh)

Um nó de malha com o sufixo -navmesh será convertido em uma malha de navegação. O nó original da Malha será removido no momento da importação.

Cria um Veículo (-vehicle)

A mesh node with the -vehicle suffix will be imported as a child to a VehicleBody3D node.

Crie uma Roda de Veículo (-wheel)

A mesh node with the -wheel suffix will be imported as a child to a VehicleWheel3D node.

Rigid Body (-rigid)

A mesh node with the -rigid suffix will be imported as a RigidBody3D.

Loop de animação (-loop, -cycle)

Animation clips in the source 3D file that start or end with the token loop or cycle will be imported as a Godot Animation with the loop flag set. Unlike the other suffixes described above, this does not require a hyphen.

No Blender, isso requer o uso do Editor NLA e nomear a Ação com o prefixo ou sufixo loop ou cycle.