2013年6月11日星期二

Mudbox custom plugin - Remove sculpt layers

Mudbox的SDK有一些例子,提供vs project file on Windows. 我想用CMakeLists.txt尝试一下 how to create a custom plugin using cmake.

遇到的问题是:
1. 在CMakeLists.txt里面除了指定mudbox include目录以外,还需要指定Mudbox自带的Qt各目录,否则编译时候提示找不到Qt头文件.

Do not forget the
  ${MUDBOXSDK_INC_DIR}/QtCore
  ${MUDBOXSDK_INC_DIR}/QtGui
otherwise, there are some compile errors.

2. 代码里面需要先include qt的头文件再include mudbox头文件.

Include the Qt header file, for example QObject.h, before including the mudbox.h file.

3. 假如新建的sculpt layer上并没有做sculpt操作,sculpt layer左边是没有显示lock到某一层的mesh的。这时候,虽然
Geometry::LayerCount()返回的个数中包括了这一空层, 但是在
Geometry::LayerData(...)中返回的LayerMeshData *却是NULL。也就是说无法在插件中删除这些sculpt layer.

If a sculpt layer is created and without any sculpting operation on it, you will see there is no a specified level number before this layer icon, which means this layer is not locked/attached to a level. I call this "empty sculpt layer".
Even if this kind of empty sculpt layer is count of the Geometry::LayerCount() function, the LayerMeshData * returned from Geometry::LayerData(...) is NULL. So no further operations can be done with these empty sculpt layers, especially they cannot be removed by using the RemoveLayer(...).

代码source code:
https://github.com/renc/Mudbox_custom_plugin_CleanLayers 

没有评论:

发表评论