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调试信息.所以就可以调试了,即所谓的杂交模式.~.

        调试着一块看似很麻烦,但是整理一下会发现就那几项....不用害怕^_^

        博客的字体好难搞.....

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值