max插件編譯相關

         上篇轉載的,主要說一些表層基礎知識.~ 大致瞭解了max相關的東東.

      最近這幾天準備着手code,根據自己的引擎,開源的和非開源的一些流傳代碼,基本確定了思路.~ 模型的導入導出沒啥技術含量,確實基石又是連接美術的最重要一環節. 

      以ogre爲例子,發現的插件,Ofusion, OgreMax,還有一個ogre自帶用max腳本寫的導出程序,不說前兩者功能如何,我也沒有比較,沒有代碼...對程序員來說沒鳥用處.可控性低無法擴展,如果做項目至少我不會去用.ogre自帶的就是個sample,用腳本寫的,我權當學習去看腳本, 看了1天,決定放棄腳本...還是走sdk,據說sdk很難用,但是想到腳本.....畢竟是c++.定下方針 sdk, 另外 ogreMax用sdk寫的.....專業的可控工具還是要用maxsdk寫.

      網上有篇sdk使用教程

       3ds max sdk導出插件編寫的心得
         作者:yhchinabest
         來自:CG先生-
3D圖形插件開發網http://www.cgsir.com/ 

      
起步可以用這個.

         對博客不熟感覺好難用.....

           這篇文章不用來介紹具體導出物件之類的代碼細節..因爲這些細節是我下面要做的東東.~^_^ 想說一下遇到的問題.

      暈死了又打不了中文了.....

      遇到的主要問題是運行時庫的問題.這一塊我不是很熟,全部按照max官方給用戶的方法來進行操作.

      具體問題如下,以gb2.3爲例子:

      我在debug編譯好的max插件,進行調試的時候,啓動max的時候報錯,                    

      導致現象這個dll沒被初始化的話裏面的腳本函數無法調用c++函數,導致插件無法使用,無法調試.

      解決辦法:

      這個問題maxsdk的文檔裏有說明:Tutorial : Manually Creating a New Plugin Project : 摘錄其中核心一段,

 

 

 

       還有博客呀真難用...字體不太會控制...暈死

         A new plugin project contains two default configurations. These are named Release and Debug. The sample code that comes with the 3ds Max SDK has an additional configuration: Win32 Hybrid. This section discusses the need for these different configuration.

      

There are three conditions for plugins working with 3ds Max. These are:

  1. Release: Release 3ds Max and Release Mode (non-debug) plugins. When you create a plugin for general distribtion you'll compile in Release mode.
  2. Hybrid: Release 3ds Max and Debug Mode plugins. While developing a plugin and using source code level debugging you'll compile in Hybrid mode.
  3. Debug: Debug 3ds Max (only registered developers have access to this special version of 3ds Max) and Debug Mode plugins. While using the special Debug SDK, and Debug 3ds Max you'd compile in Debug Mode.

In Microsoft Developer Studio the Debug and Release C runtime libraries use different heap management. This means that allocating an object in debug mode and de-allocating it in release mode (and vice versa) can cause a crash. Most developers will work with a version of 3ds Max compiled in Release mode. Thus it uses the run-time libraries called Multithreaded DLL. plugins that work with this version of 3ds Max need to match this run-time library. If they don't crashes will occur.

       如果不是super用戶,max提供的雜交模式,即max是release,插件運行在debug下可以調試,究其原因是 Multithreaded DLL,這一塊不是很熟,下面會去弄懂,就是保證插件的運行時庫和max的運行時庫一樣就ok了.

        到此可以告一段路得出結論:在開發插件過程中,可以採用雜交方式,美術可以用程序可以調試.

另注:

       gb2.3裏面有debug_dll_maxXXX和release_dll_maxXXX兩種模式,原以爲沒有雜交模式,整的我很蛋疼,按照maxsdk文檔自己去搞...後來發現release_dll_maxXXX是雜交模式......

        gb3.0三種模式都有.

        debug release hybrid自己都可以手工設置的,2.3的設置今天有看了一下發現release的生成debug調試信息.所以就可以調試了,即所謂的雜交模式.~.

        調試着一塊看似很麻煩,但是整理一下會發現就那幾項....不用害怕^_^

        博客的字體好難搞.....

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章