Creating a point or vertex in the FBX SDK

I am trying to create a single vertex at the given coordinate of the parent node.

# create a manager, scene and node
manager = fbx.FbxManager.Create()
scene = fbx.FbxScene.Create(manager, "")
node = fbx.FbxNode.Create(manager, "")

# create a mesh
mesh = fbx.FbxMesh.Create(scene, "")

# How to add a single vertex to the mesh?

# add the mesh attribute to the node
node.AddNodeAttribute(mesh)

# add node to the node tree
root_node = scene.GetRootNode()
root_node.AddChild(node)

# Translate the node to (0, 0, 10)
node.LclTranslation.Set(fbx.FbxDouble3(0, 0, 10))

This does not have to be a specific python answer. I appreciate your help.

+4
source share
1 answer

A vertex or point is a coordinate defined as follows:

v = fbx.FbxVector4(x, y, z)

The vertex itself is not visible if it is not a control point for the grid.

my_mesh = fbx.FbxMesh.Create(my_scene, '')
my_mesh.SetControlPointAt(v, 0)

Where 0is the "order" or "index" of the vertex in the vertex group (if any). Then a polygon can be drawn, which can be the side of the grid:

my_mesh.BeginPolygon()
my_mesh.AddPolygon(0)
my_mesh.AddPolygon(n)
...
my_mesh.EndPolygon()
+1
source

Source: https://habr.com/ru/post/1629404/


All Articles