Maya Plugin 编译Maya插件

Maya自身的功能就已经非常强大了,但是更棒的是它的扩展性非常强,提供API让用户自己来编写插件Plugin。Maya的插件主要是两种,一种是用C++编写的,后缀为".mll",另一种是用Python编写的,后缀为".py"。在用C++编写插件时,我们可以用下面的这个CMakeLists.txt文件来生成项目工程:

SET(MAYA_DIRECTORY "C:/Program Files/Autodesk/Maya2015")
SET(MAYA_HEADERS_DIR "${MAYA_DIRECTORY}/include")
SET(MAYA_LIBRARY_DIR "${MAYA_DIRECTORY}/lib")
SET(SOURCE_FILES
  yourPlugin.cpp 
)
source_group("" FILES ${SOURCE_FILES})
INCLUDE_DIRECTORIES(${MAYA_HEADERS_DIR})
LINK_DIRECTORIES(${MAYA_LIBRARY_DIR})
SET(LIBRARIES Foundation.lib OpenMaya.lib OpenMayaAnim.lib OpenMayaUI.lib)
SET(MAYA_DEFINITIONS _AFXDLL _MBCS NT_PLUGIN REQUIRE_IOSTREAM _BOOL)
ADD_LIBRARY(${MAYA_PLUGIN_NAME} SHARED ${SOURCE_FILES})
TARGET_LINK_LIBRARIES(${MAYA_PLUGIN_NAME} ${LIBRARIES})
SET_TARGET_PROPERTIES(${MAYA_PLUGIN_NAME} PROPERTIES COMPILE_DEFINITIONS "${MAYA_DEFINITIONS}")
SET_TARGET_PROPERTIES(${MAYA_PLUGIN_NAME} PROPERTIES OUTPUT_NAME "${MAYA_PLUGIN_NAME}")
SET_TARGET_PROPERTIES(${MAYA_PLUGIN_NAME} PROPERTIES SUFFIX ".mll")
SET_TARGET_PROPERTIES(${MAYA_PLUGIN_NAME} PROPERTIES CLEAN_DIRECT_OUTPUT 1)
SET_TARGET_PROPERTIES(${MAYA_PLUGIN_NAME} PROPERTIES LINK_FLAGS "/export:initializePlugin /export:uninitializePlugin")

本文转自博客园Grandyang的博客,原文链接:编译Maya插件Maya Plugin ,如需转载请自行联系原博主。

上一篇:Eclipse插件之FindBugs


下一篇:【mongodb】安装pymongo