You have two alternatives to do that:
First takes two steps:
- Convert your mesh to per-wedge-textured using the command
meshlabserver -i inputMesh.obj -o tmpMesh.obj -m wt
- Apply your other filters using
meshlabserver -i tmpMesh.obj -o outputMesh.obj -m wt -s myScript.mlx
The second alternative is do everything in just a step, by calling the filter Convert PerVertex UV into PerWedge UV
in your mlx script before of calling Simplification: Quadric Edge ...
. Also, I suggest to call Remove Unreferenced Vertices
just by sanity.
Try saving this script to a file named textureSimplify.mlx
<!DOCTYPE FilterScript>
<FilterScript>
<filter name="Remove Unreferenced Vertices"/>
<filter name="Convert PerVertex UV into PerWedge UV"/>
<filter name="Simplification: Quadric Edge Collapse Decimation (with texture)">
<Param value="3000" name="TargetFaceNum" description="Target number of faces" isxmlparam="0" tooltip="" type="RichInt"/>
<Param value="0" name="TargetPerc" description="Percentage reduction (0..1)" isxmlparam="0" tooltip="" type="RichFloat"/>
<Param value="0.3" name="QualityThr" description="Quality threshold" isxmlparam="0" tooltip="" type="RichFloat"/>
<Param value="1" name="Extratcoordw" description="Texture Weight" isxmlparam="0" tooltip="" type="RichFloat"/>
<Param value="false" name="PreserveBoundary" description="Preserve Boundary of the mesh" isxmlparam="0" tooltip="" type="RichBool"/>
<Param value="1" name="BoundaryWeight" description="Boundary Preserving Weight" isxmlparam="0" tooltip="" type="RichFloat"/>
<Param value="true" name="OptimalPlacement" description="Optimal position of simplified vertices" isxmlparam="0" tooltip="" type="RichBool"/>
<Param value="true" name="PreserveNormal" description="Preserve Normal" isxmlparam="0" tooltip="" type="RichBool"/>
<Param value="true" name="PlanarQuadric" description="Planar Simplification" isxmlparam="0" tooltip="" type="RichBool"/>
<Param value="false" name="Selected" description="Simplify only selected faces" isxmlparam="0" tooltip="" type="RichBool"/>
</filter>
</FilterScript>
Edit the line <Param value="3000" name="TargetFaceNum"
to change the value 3000 to your desired number of faces, and then execute the script using the command:
> meshlabserver -i inputMesh.obj -o outputMesh.obj -m wt -s textureSimplify.mlx