Hi, when opening fbx in FME, I see a property with a description of the material in the geometry parts (pay attention to the line highlighted with a marker)
FME has a python interpreter, with its own classes and functions.
I have already pulled out the coordinates of the points, in the code below
import fme
import fmeobjects
FeatureProcessor class (object):
def __init__(self):
passes
entering def (self, feature):
all_geom = function.getGeometry()
first_part = all_geom.getPartAt(0)
if type(first_part) == fmeobjects.FMEMesh:
meshs = first_part.getAsMultiSurface()
vertices_list = first_part.getVertices()
textur_coord_list = first_part.getTextureCoordinates()
textur_length = len(textur_coord_list)
if textur_length > 0:
for trian_mesh in first_part:
ver_index = trian_mesh.getVertexIndices()
textur_index = trian_mesh.getVertexNormalIndices()
newFeature = fmeobjects.FMEFeature()
pnt1 = vertices_listtver_indexx0]]
pnt1_t = textur_coord_list textur_index 0]]
newFeature.setAttribute('X1',pnt110])
newFeature.setAttribute('Y1',pnt111])
newFeature.setAttribute('Z1',pnt112])
newFeature.setAttribute('U1',pnt1_tt0])
newFeature.setAttribute('V1',pnt1_tt1])
pnt2 = vertices_listtver_indexx1]]
pnt2_t = textur_coord_list textur_indexx1]]
newFeature.setAttribute('X2',pnt220])
newFeature.setAttribute('Y2',pnt221])
newFeature.setAttribute('Z2',pnt222])
newFeature.setAttribute('U2',pnt2_tt0])
newFeature.setAttribute('V2',pnt2_tt1])
pnt3 = vertices_listtver_indexx2]]
pnt3_t = textur_coord_listttextur_indexx2]]
newFeature.setAttribute('X3',pnt330])
newFeature.setAttribute('Y3',pnt331])
newFeature.setAttribute('Z3',pnt332])
newFeature.setAttribute('U3',pnt3_tt0])
newFeature.setAttribute('V3',pnt3_tt1])
newFeature.setAttribute('geometry_name', feature.getAttribute('_geometry_name'))
newFeature.setAttribute('path_rootname', feature.getAttribute('path_rootname'))
newFeature.setAttribute ('appearance')
self.pyoutput(newFeature)
more:
newFeature_error = fmeobjects.FMEFeature()
newFeature_error.setAttribute('error_geometry', feature.getAttribute('_geometry_name'))
self.pyoutput(newFeature_error)
def close(self):
passes
def process_group(self):
passes
But it doesn't work for Appearance.
Judging by the help – appearance, this is part of the geometry. If you fall into the appearance class, then it should be a separate class, but how to pull it into separate variables is not described in the help
When referring to any function, it says that there are no such attributes.
I tried to refer to the feature unit itself, and to all its parts
-all_geometry
-first_part
-mesh
-trian_mesh
Please help with changing the code to extract attributes from the Front Appearance Preference line marked in the image above.
PS The FBX file for the test is attached.