//**************************************************************************/
// Copyright (c) 1998-2007 Autodesk, Inc.
// All rights reserved.
//
// These coded instructions, statements, and computer programs contain
// unpublished proprietary information written by Autodesk, Inc., and are
// protected by Federal copyright law. They may not be disclosed to third
// parties or copied or duplicated in any form, in whole or in part, without
// the prior written consent of Autodesk, Inc.
//**************************************************************************/
// DESCRIPTION: Appwizard generated plugin
// AUTHOR:
//***************************************************************************/
#include "ADNDemoExporter.h"
#include "ADNDemoExporterOpts.h"
#include <stdmat.h>
#include <decomp.h>
#include <iskin.h>
#include <modstack.h>
#define ADNDemoExporter_CLASS_ID Class_ID(0x1f75565c, 0x8d3eebc4)
class ADNDemoExporter : public SceneExport {
public:
static HWND hParams;
int ExtCount(); // Number of extensions supported
const TCHAR * Ext(int n); // Extension #n (i.e. "3DS")
const TCHAR * LongDesc(); // Long ASCII description (i.e. "Autodesk 3D Studio File")
const TCHAR * ShortDesc(); // Short ASCII description (i.e. "3D Studio")
const TCHAR * AuthorName(); // ASCII Author name
const TCHAR * CopyrightMessage(); // ASCII Copyright message
const TCHAR * OtherMessage1(); // Other message #1
const TCHAR * OtherMessage2(); // Other message #2
unsigned int Version(); // Version number * 100 (i.e. v3.01 = 301)
void ShowAbout(HWND hWnd); // Show DLL's "About..." box
BOOL SupportsOptions(int ext, DWORD options);
int DoExport(const TCHAR *name,ExpInterface *ei,Interface *i, BOOL suppressPrompts=FALSE, DWORD options=0);
//Constructor/Destructor
ADNDemoExporter();
~ADNDemoExporter();
private:
// Our options
ADNDemoExporterOpts m_Opts;
//////////////////////////////////////////////////////////////////////////
// Export max entities
// Export a Max Node. This recursive function will iterate
// the max scene tree, and export the interesting information
// from each node visited.
void Export(INode* pNode, int iTreeDepth = 0);
// Iterate the derived object object stack, looking for skin modifiers.
// If found, fill out pIDObj, pSkin, iSkinIdx and return true.
// Else, return false.
bool FindISkinMod(Object* pObj, IDerivedObject*& pIDObj, int& iSkinIdx);
// Try and export the object from this node.
// If we cannot convert the object to something
// we understand, just write out the object ID's
void ExportObject(INode* pNode, int iTreeDepth);
// Export the geometry information contained by TriObject.
// For a start this will be just the vertices and triangle indices
void ExportObject(TriObject* pTriObject, int iTreeDepth);
// Export some basic skinning information.
void ExportSkin(INode* pNode, ISkin* pSkin, int iTreeDepth);
// Export the material off the passed node. If the
// node has no material, export the basic object color
void ExportMaterial(INode* pNode, int iTreeDepth);
// Export all the textures applied to the given material
void ExportTextures(Mtl* pMtl, int iTreeDepth);
// Export the given texture map. If the texture is
// a bitmap, export its path and UV parameters
void ExportTexture(Texmap* pTex, const char* pSlotName, int iTreeDepth);
// Export the local transform of the given node at time t
void ExportPRS(INode* pNode, int iTreeDepth, TimeValue t = 0);
// Export the animation of the given node, either by
// exporting the controllers keyframes or sampling
void ExportAnimation(INode* pNode, int iTreeDepth);
// Sample the nodes PRS over the scene time
void ExportAnimationSample(INode* pNode, int iTreeDepth);
// Export the key frames for the given controller (pAnim).
// If this animatable doesnt support keys, try it's subanims
void ExportAnimationKeys(Animatable* pAnim, const char* pCtrlName, int iTreeDepth);
template <class KeyType>
void ExportAnimationKeyLinear(IKeyControl* iKeyControl, int iTreeDepth);
template <class KeyType>
void ExportAnimationKeyBezier(IKeyControl* iKeyControl, int iTreeDepth);
template <class KeyType>
void ExportAnimationKeyTCB(IKeyControl* iKeyControl, int iTreeDepth);
//////////////////////////////////////////////////////////////////////////
// Output Utilities
// Our output section. Because we are a simple text writer,
// we are simply going to pipe our messages to a text file.
FILE* m_pFile;
// Initialize our out stream. This function must be
// called before commencing the export process
BOOL BeginWriting(const char* pPath);
// Finalize our out stream. This function must be
// called before finishing the export process
void EndWriting();
// A simple printf wrapper function to encapsulate
// writing to the file.
void Write(int indent, const char* pMsg, ...);
// Write out the given transform in terms
// of its position, rotation, and scale parts
void Write(int indent, const Matrix3& tmVal);
// write out the given value after the message
void WriteValue(int indent, const char* pMsg, float val);
void WriteValue(int indent, const char* pMsg, const Point3& val);
void WriteValue(int indent, const char* pMsg, const Quat& val);
void WriteValue(int indent, const char* pMsg, const AngAxis& val);
void WriteValue(int indent, const char* pMsg, const ScaleValue& val);
};
class ADNDemoExporterClassDesc : public ClassDesc2
{
public:
virtual int IsPublic() { return TRUE; }
virtual void* Create(BOOL /*loading = FALSE*/) { return new ADNDemoExporter(); }
virtual const TCHAR * ClassName() { return GetString(IDS_CLASS_NAME); }
virtual SClass_ID SuperClassID() { return SCENE_EXPORT_CLASS_ID; }
virtual Class_ID ClassID() { return ADNDemoExporter_CLASS_ID; }
virtual const TCHAR* Category() { return GetString(IDS_CATEGORY); }
virtual const TCHAR* InternalName() { return _T("ADNDemoExporter"); } // returns fixed parsable name (scripter-visible name)
virtual HINSTANCE HInstance() { return hInstance; } // returns owning module handle
};
static ADNDemoExporterClassDesc ADNDemoExporterDesc;
ClassDesc2* GetADNDemoExporterDesc() { return &ADNDemoExporterDesc; }
//--- ADNDemoExporter -------------------------------------------------------
ADNDemoExporter::ADNDemoExporter()
{
m_pFile = NULL; // Dont forget to initialize
}
ADNDemoExporter::~ADNDemoExporter()
{
DbgAssert(m_pFile == NULL); // And check we cleaned up
}
int ADNDemoExporter::ExtCount()
{
return 1;
}
const TCHAR *ADNDemoExporter::Ext(int n)
{
return _T("txt");
}
const TCHAR *ADNDemoExporter::LongDesc()
{
return _T("Basic ASCII Scene Exporter");
}
const TCHAR *ADNDemoExporter::ShortDesc()
{
return _T("ASCII");
}
const TCHAR *ADNDemoExporter::AuthorName()
{
return _T("Your Name");
}
const TCHAR *ADNDemoExporter::CopyrightMessage()
{
return _T("Copyright: Your Studio");
}
const TCHAR *ADNDemoExporter::OtherMessage1()
{
//TODO: Return Other message #1 if any
return _T("");
}
const TCHAR *ADNDemoExporter::OtherMessage2()
{
//TODO: Return other message #2 in any
return _T("");
}
unsigned int ADNDemoExporter::Version()
{
#pragma message(TODO("Return Version number * 100 (i.e. v3.01 = 301)"))
return 100;
}
void ADNDemoExporter::ShowAbout(HWND hWnd)
{
// Optional
}
BOOL ADNDemoExporter::SupportsOptions(int ext, DWORD options)
{
#pragma message(TODO("Decide which options to support. Simply return true for each option supported by each Extension the exporter supports."))
return TRUE;
}
int ADNDemoExporter::DoExport(const
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
3dsMax插件编程源码 (104个子文件)
ADNDemoExporter.cpp 27KB
ADNDemoExporter.cpp 24KB
ADNDemoExporter.cpp 22KB
ADNDemoExporter.cpp 20KB
ADNDemoExporter.cpp 20KB
ADNDemoExporter.cpp 13KB
ADNDemoExporter.cpp 11KB
ADNDemoExporter.cpp 10KB
ADNDemoExporter.cpp 8KB
ADNDemoExporter.cpp 5KB
DllEntry.cpp 3KB
DllEntry.cpp 3KB
DllEntry.cpp 3KB
DllEntry.cpp 3KB
DllEntry.cpp 3KB
DllEntry.cpp 3KB
DllEntry.cpp 3KB
DllEntry.cpp 3KB
DllEntry.cpp 3KB
DllEntry.cpp 3KB
ADNDemoExporterOpts.cpp 3KB
ADNDemoExporterOpts.cpp 3KB
ADNDemoExporterOpts.cpp 3KB
ADNDemoExporterOpts.cpp 2KB
ADNDemoExporter.def 321B
ADNDemoExporter.def 321B
ADNDemoExporter.def 321B
ADNDemoExporter.def 321B
ADNDemoExporter.def 321B
ADNDemoExporter.def 321B
ADNDemoExporter.def 321B
ADNDemoExporter.def 321B
ADNDemoExporter.def 321B
ADNDemoExporter.def 321B
ADNDemoExporterOpts.h 2KB
ADNDemoExporterOpts.h 2KB
ADNDemoExporterOpts.h 1KB
ADNDemoExporterOpts.h 1KB
resource.h 1KB
resource.h 1KB
resource.h 1KB
resource.h 1KB
3dsmaxsdk_preinclude.h 1KB
3dsmaxsdk_preinclude.h 1KB
3dsmaxsdk_preinclude.h 1KB
3dsmaxsdk_preinclude.h 1KB
3dsmaxsdk_preinclude.h 1KB
3dsmaxsdk_preinclude.h 1KB
3dsmaxsdk_preinclude.h 1KB
3dsmaxsdk_preinclude.h 1KB
3dsmaxsdk_preinclude.h 1KB
3dsmaxsdk_preinclude.h 1KB
ADNDemoExporter.h 959B
ADNDemoExporter.h 959B
ADNDemoExporter.h 959B
ADNDemoExporter.h 959B
ADNDemoExporter.h 959B
ADNDemoExporter.h 959B
ADNDemoExporter.h 959B
ADNDemoExporter.h 959B
ADNDemoExporter.h 959B
ADNDemoExporter.h 959B
resource.h 929B
resource.h 929B
resource.h 929B
resource.h 929B
resource.h 929B
resource.h 929B
BuildLog.htm 6KB
ADNDemoExporter.dle.embed.manifest 2KB
ADNDemoExporter.ncb 43KB
DllEntry.obj 70KB
ADNDemoExporter.rc 3KB
ADNDemoExporter.rc 3KB
ADNDemoExporter.rc 3KB
ADNDemoExporter.rc 3KB
ADNDemoExporter.rc 3KB
ADNDemoExporter.rc 3KB
ADNDemoExporter.rc 3KB
ADNDemoExporter.rc 3KB
ADNDemoExporter.rc 3KB
ADNDemoExporter.rc 3KB
ADNDemoExporter.sln 2KB
ADNDemoExporter.sln 2KB
ADNDemoExporter.sln 2KB
ADNDemoExporter.sln 2KB
ADNDemoExporter.sln 2KB
ADNDemoExporter.sln 2KB
ADNDemoExporter.sln 2KB
ADNDemoExporter.sln 2KB
ADNDemoExporter.sln 2KB
ADNDemoExporter.sln 2KB
ADNDemoExporter.suo 10KB
ADNDemoExporter.vcproj.MICROSOF-80236F.Administrator.user 4KB
ADNDemoExporter.vcproj 21KB
ADNDemoExporter.vcproj 21KB
ADNDemoExporter.vcproj 21KB
ADNDemoExporter.vcproj 21KB
ADNDemoExporter.vcproj 21KB
ADNDemoExporter.vcproj 21KB
共 104 条
- 1
- 2
资源评论
思月行云
- 粉丝: 2656
- 资源: 114
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功