MeshLabXML icon indicating copy to clipboard operation
MeshLabXML copied to clipboard

Integration of new filter names in 1.3.4Beta

Open RoyJames opened this issue 5 years ago • 2 comments

Hi it's me again. I have compiled the latest (Beta ver) meshlab from the source repo. After that I resolved most filter bugs. Now I guess the only remaining problem is the difference of names (and possibly parameters) of some filters. When I want to use the most frequently used Transform filters the meshlabserver will complain that the filter specified by MeshLabXML cannot be found. For example:

In transform.py, the filter name is 'Transform: Move, Translate, Center', but the script saved from meshlab is:

<!DOCTYPE FilterScript>
<FilterScript>
 <filter name="Transform: Translate, Center, set Origin">
  <Param isxmlparam="0" enum_val2="Center on Layer BBox" value="0" enum_val1="Center on Scene BBox" name="traslMethod" description="Transformation:" enum_cardinality="4" type="RichEnum" tooltip="[XYZ translation] adds X,Y and Z offset to Layer transformation, [Center on BBox] moves Layer Origin to the Bounding Box center, [Set new Origin] moves Layer Origin to a specific point" enum_val3="Set new Origin" enum_val0="XYZ translation"/>
  <Param isxmlparam="0" min="-497.7" max="497.7" value="1" name="axisX" description="X Axis" type="RichDynamicFloat" tooltip="when using [XYZ translation], amount of translation along the X axis (in model units)"/>
  <Param isxmlparam="0" min="-497.7" max="497.7" value="2" name="axisY" description="Y Axis" type="RichDynamicFloat" tooltip="when using [XYZ translation], amount of translation along the Y axis (in model units)"/>
  <Param isxmlparam="0" min="-497.7" max="497.7" value="3" name="axisZ" description="Z Axis" type="RichDynamicFloat" tooltip="when using [XYZ translation], amount of translation along the Z axis (in model units)"/>
  <Param isxmlparam="0" x="4" y="5" name="newOrigin" z="6" description="New Origin:" type="RichPoint3f" tooltip="when using [Set new Origin], this is the location of the new Origin."/>
  <Param isxmlparam="0" value="true" name="Freeze" description="Freeze Matrix" type="RichBool" tooltip="The transformation is explicitly applied, and the vertex coordinates are actually changed"/>
  <Param isxmlparam="0" value="false" name="allLayers" description="Apply to all visible Layers" type="RichBool" tooltip="If selected the filter will be applied to all visible mesh layers"/>
 </filter>
</FilterScript>

The scale operation in transform.py is 'Transform: Scale' but meshlab gives:

<!DOCTYPE FilterScript>
<FilterScript>
 <filter name="Transform: Scale, Normalize">
  <Param isxmlparam="0" value="1" name="axisX" description="X Axis" type="RichFloat" tooltip="Scaling"/>
  <Param isxmlparam="0" value="1" name="axisY" description="Y Axis" type="RichFloat" tooltip="Scaling"/>
  <Param isxmlparam="0" value="1" name="axisZ" description="Z Axis" type="RichFloat" tooltip="Scaling"/>
  <Param isxmlparam="0" value="true" name="uniformFlag" description="Uniform Scaling" type="RichBool" tooltip="If selected an uniform scaling (the same for all the three axis) is applied (the X axis value is used)"/>
  <Param isxmlparam="0" enum_val2="custom point" value="0" enum_val1="barycenter" name="scaleCenter" description="Center of scaling:" enum_cardinality="3" type="RichEnum" tooltip="Choose a method" enum_val0="origin"/>
  <Param isxmlparam="0" x="0" y="0" name="customCenter" z="0" description="Custom center" type="RichPoint3f" tooltip="This scaling center is used only if the 'custom point' option is chosen."/>
  <Param isxmlparam="0" value="true" name="unitFlag" description="Scale to Unit bbox" type="RichBool" tooltip="If selected, the object is scaled to a box whose sides are at most 1 unit lenght"/>
  <Param isxmlparam="0" value="true" name="Freeze" description="Freeze Matrix" type="RichBool" tooltip="The transformation is explicitly applied, and the vertex coordinates are actually changed"/>
  <Param isxmlparam="0" value="false" name="allLayers" description="Apply to all visible Layers" type="RichBool" tooltip="If selected the filter will be applied to all visible mesh layers"/>
 </filter>
</FilterScript>

I can certainly make these changes in your package myself, but in case you are already doing so, I want to ask first: do you have plans to push these changes recently?

meshlab2018

RoyJames avatar Jul 27 '18 19:07 RoyJames

Yeah, the MeshLab developers sometimes change filter names between versions, and add or remove parameters, so MLX needs to play catch up whenever a new version is released to identify and fix all the changes. However, there has not yet been a stable release since 2016.12, and I just don't have the resources to try to track all of the development changes and beta versions that are released. This is especially true since the way I am currently tracking this is to identify the correct filter names by the explicit MeshLab version number, however it is not manageable to try to track every beta or build version that is released. I still need MLX to work on older versions, not just the latest.

The next release of MeshLab will make this process somewhat easier, since it should incorporate a method to query the version number (ref https://github.com/cnr-isti-vclab/meshlab/issues/249). Currently, you need to explicitly tell MLX the version number so that it can choose the correct filter names and parameters.

TL;DR: I don't currently plan on making any updates to the MLX filter names until the next stable release of MeshLab, which is promised Real Soon Now ;). If you need this functionality sooner, I would suggest that you fork the repo and make your own changes there. Once the stable version is released, please send me a push request with your changes, which will make my job easier. :) I will go ahead and leave this issue open, as the changes will be made eventually.

I also have plans of someday writing unit tests to check each implemented filter and automatically identify any breakages between releases, but that's not a high priority at the moment (help welcome!).

3DLIRIOUS avatar Jul 28 '18 21:07 3DLIRIOUS

Thanks for your reply. I am also looking forward to their new stable release. Currently, I have made the mentioned changes myself and will push that back once they release the newer version. I am glad to contribute to this repository someday :)

RoyJames avatar Jul 29 '18 17:07 RoyJames