|
|
@@ -19,12 +19,14 @@
|
|
|
|
|
|
//Includes & Definitions
|
|
|
#include "MaxToEgg.h"
|
|
|
+#include "MaxEggExpOptions.h"
|
|
|
#include "windef.h"
|
|
|
|
|
|
/* Error-Reporting Includes
|
|
|
*/
|
|
|
#include "Logger.h"
|
|
|
#define ME Logger::ST_MAP_ME_TO_APP_SPECIFIC_SYSTEM6
|
|
|
+#define MaxEggPlugin_CLASS_ID Class_ID(0x7ac0d6b7, 0x55731ef6)
|
|
|
|
|
|
/* Externed Globals
|
|
|
*/
|
|
|
@@ -42,51 +44,333 @@ extern TCHAR *GetString(int id);
|
|
|
a suitable interface to Max files can be connected from a standalone
|
|
|
program instead of a plugin.
|
|
|
*/
|
|
|
-class MaxEggPlugin : public SceneExport
|
|
|
+class MaxEggPlugin : public HelperObject
|
|
|
{
|
|
|
+ MaxEggExpOptions **eggList;
|
|
|
+ int numEggs;
|
|
|
+ int maxEggs;
|
|
|
+
|
|
|
public:
|
|
|
- static HWND hParams;
|
|
|
- bool confirmExport;
|
|
|
- bool makeBam;
|
|
|
- bool animation;
|
|
|
- enum Anim_Type {
|
|
|
- AT_none,
|
|
|
- AT_model,
|
|
|
- AT_chan,
|
|
|
- AT_pose,
|
|
|
- AT_strobe,
|
|
|
- AT_both
|
|
|
- };
|
|
|
- Anim_Type anim_type;
|
|
|
+ bool autoOverwrite;
|
|
|
+ bool pview;
|
|
|
+ bool logOutput;
|
|
|
|
|
|
- // Number of extensions supported
|
|
|
- int ExtCount();
|
|
|
- // Extension #n (i.e. "3DS")
|
|
|
- const TCHAR *Ext(int n);
|
|
|
- // Long ASCII description (i.e. "Autodesk 3D Studio File")
|
|
|
- const TCHAR *LongDesc();
|
|
|
- // Short ASCII description (i.e. "3D Studio")
|
|
|
- const TCHAR *ShortDesc();
|
|
|
- // ASCII Author name
|
|
|
- const TCHAR *AuthorName();
|
|
|
- // ASCII Copyright message
|
|
|
- const TCHAR *CopyrightMessage();
|
|
|
- // Other message #1
|
|
|
- const TCHAR *OtherMessage1();
|
|
|
- // Other message #2
|
|
|
- const TCHAR *OtherMessage2();
|
|
|
- // Version number * 100 (i.e. v3.01 = 301)
|
|
|
- unsigned int Version();
|
|
|
- // Show DLL's "About..." box
|
|
|
- void ShowAbout(HWND hWnd);
|
|
|
-
|
|
|
- BOOL SupportsOptions(int ext, DWORD options);
|
|
|
- int DoExport(const TCHAR *name,ExpInterface *ei,
|
|
|
- Interface *i, BOOL suppressPrompts=FALSE, DWORD options=0);
|
|
|
+ // Class vars
|
|
|
+ static Mesh mesh; // This plugin generates no geometry, this mesh is not passed on to 3D Studio.
|
|
|
+ static short meshBuilt;
|
|
|
+ static HWND hMaxEggParams;
|
|
|
+ static IObjParam *iObjParams;
|
|
|
|
|
|
//Constructor/Destructor
|
|
|
MaxEggPlugin();
|
|
|
virtual ~MaxEggPlugin();
|
|
|
+
|
|
|
+ //Other class Methods
|
|
|
+ void DoExport();
|
|
|
+ void UpdateUI();
|
|
|
+ void SaveCheckState();
|
|
|
+ void BuildMesh();
|
|
|
+
|
|
|
+ void AddEgg(MaxEggExpOptions *newEgg);
|
|
|
+ void RemoveEgg(int i);
|
|
|
+ MaxEggExpOptions *GetEgg(int i) { return (i >= 0 && i < numEggs) ? eggList[i] : NULL; }
|
|
|
+
|
|
|
+ // Required implimented virtual methods:
|
|
|
+ // inherited virtual methods for Reference-management
|
|
|
+ RefResult NotifyRefChanged( Interval changeInt, RefTargetHandle hTarget, PartID& partID, RefMessage message );
|
|
|
+ void GetMat(TimeValue t, INode* inod, ViewExp *vpt, Matrix3& mat);
|
|
|
+
|
|
|
+ // From BaseObject
|
|
|
+ int HitTest(TimeValue t, INode* inode, int type, int crossing, int flags, IPoint2 *p, ViewExp *vpt);
|
|
|
+ int Display(TimeValue t, INode* inode, ViewExp *vpt, int flags);
|
|
|
+ CreateMouseCallBack* GetCreateMouseCallBack();
|
|
|
+ void BeginEditParams( IObjParam *ip, ULONG flags,Animatable *prev);
|
|
|
+ void EndEditParams( IObjParam *ip, ULONG flags,Animatable *next);
|
|
|
+ TCHAR *GetObjectName() { return GetString(IDS_LIBDESCRIPTION); }
|
|
|
+
|
|
|
+ // From Object
|
|
|
+ ObjectState Eval(TimeValue time);
|
|
|
+ void InitNodeName(TSTR& s) { s = GetString(IDS_CLASS_NAME); }
|
|
|
+ Interval ObjectValidity(TimeValue time);
|
|
|
+ void Invalidate();
|
|
|
+ int DoOwnSelectHilite() { return 1; }
|
|
|
+
|
|
|
+ // From GeomObject
|
|
|
+ int IntersectRay(TimeValue t, Ray& r, float& at) { return 0; }
|
|
|
+ void GetWorldBoundBox(TimeValue t, INode *mat, ViewExp *vpt, Box3& box );
|
|
|
+ void GetLocalBoundBox(TimeValue t, INode *mat, ViewExp *vpt, Box3& box );
|
|
|
+ void GetDeformBBox(TimeValue t, Box3& box, Matrix3 *tm, BOOL useSel );
|
|
|
+
|
|
|
+ // Animatable methods
|
|
|
+ void DeleteThis() { delete this; }
|
|
|
+ Class_ID ClassID() { return MaxEggPlugin_CLASS_ID; }
|
|
|
+ void GetClassName(TSTR& s) { s = TSTR(GetString(IDS_CLASS_NAME)); }
|
|
|
+ TSTR SubAnimName(int i) { return TSTR(GetString(IDS_CLASS_NAME)); }
|
|
|
+
|
|
|
+ // From ref
|
|
|
+ RefTargetHandle Clone(RemapDir& remap = NoRemap());
|
|
|
+
|
|
|
+ // IO
|
|
|
+ IOResult Save(ISave *isave);
|
|
|
+ IOResult Load(ILoad *iload);
|
|
|
+
|
|
|
};
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+const double meshVerts[252][3] = {
|
|
|
+ {0.729464, 0.714986, -0.919852},
|
|
|
+ {0.466137, 0.160201, -0.594656},
|
|
|
+ {-0.265897, 0.714986, -1.14704},
|
|
|
+ {0.466137, 0.160201, -0.594656},
|
|
|
+ {-0.177333, 0.160201, -0.741523},
|
|
|
+ {-0.265897, 0.714986, -1.14704},
|
|
|
+ {-0.265897, 0.714986, -1.14704},
|
|
|
+ {-0.177333, 0.160201, -0.741523},
|
|
|
+ {-1.06411, 0.714986, -0.510479},
|
|
|
+ {-0.177333, 0.160201, -0.741523},
|
|
|
+ {-0.693356, 0.160201, -0.330009},
|
|
|
+ {-1.06411, 0.714986, -0.510479},
|
|
|
+ {-1.06411, 0.714986, 0.510479},
|
|
|
+ {-1.06411, 0.714986, -0.510479},
|
|
|
+ {-0.693356, 0.160201, 0.330009},
|
|
|
+ {-0.693356, 0.160201, -0.330009},
|
|
|
+ {-0.693356, 0.160201, 0.330009},
|
|
|
+ {-1.06411, 0.714986, -0.510479},
|
|
|
+ {-0.265897, 0.714986, 1.14704},
|
|
|
+ {-1.06411, 0.714986, 0.510479},
|
|
|
+ {-0.177333, 0.160201, 0.741523},
|
|
|
+ {-0.693356, 0.160201, 0.330009},
|
|
|
+ {-0.177333, 0.160201, 0.741523},
|
|
|
+ {-1.06411, 0.714986, 0.510479},
|
|
|
+ {0.729464, 0.714986, 0.919852},
|
|
|
+ {-0.265897, 0.714986, 1.14704},
|
|
|
+ {0.466137, 0.160201, 0.594656},
|
|
|
+ {-0.177333, 0.160201, 0.741523},
|
|
|
+ {0.466137, 0.160201, 0.594656},
|
|
|
+ {-0.265897, 0.714986, 1.14704},
|
|
|
+ {1.17244, 0.714986, 0.0},
|
|
|
+ {0.729464, 0.714986, 0.919852},
|
|
|
+ {0.752508, 0.160201, 0.0},
|
|
|
+ {0.466137, 0.160201, 0.594656},
|
|
|
+ {0.752508, 0.160201, 0.0},
|
|
|
+ {0.729464, 0.714986, 0.919852},
|
|
|
+ {0.729464, 0.714986, -0.919852},
|
|
|
+ {1.17244, 0.714986, 0.0},
|
|
|
+ {0.466137, 0.160201, -0.594656},
|
|
|
+ {0.752508, 0.160201, 0.0},
|
|
|
+ {0.466137, 0.160201, -0.594656},
|
|
|
+ {1.17244, 0.714986, 0.0},
|
|
|
+ {-0.286334, 1.44995, -1.26822},
|
|
|
+ {0.814187, 1.44995, -1.01703},
|
|
|
+ {-0.265897, 0.714986, -1.14704},
|
|
|
+ {0.729464, 0.714986, -0.919852},
|
|
|
+ {-0.265897, 0.714986, -1.14704},
|
|
|
+ {0.814187, 1.44995, -1.01703},
|
|
|
+ {-1.16888, 1.44995, -0.564412},
|
|
|
+ {-0.286334, 1.44995, -1.26822},
|
|
|
+ {-1.06411, 0.714986, -0.510479},
|
|
|
+ {-0.265897, 0.714986, -1.14704},
|
|
|
+ {-1.06411, 0.714986, -0.510479},
|
|
|
+ {-0.286334, 1.44995, -1.26822},
|
|
|
+ {-1.16888, 1.44995, 0.564411},
|
|
|
+ {-1.16888, 1.44995, -0.564412},
|
|
|
+ {-1.06411, 0.714986, 0.510479},
|
|
|
+ {-1.06411, 0.714986, -0.510479},
|
|
|
+ {-1.06411, 0.714986, 0.510479},
|
|
|
+ {-1.16888, 1.44995, -0.564412},
|
|
|
+ {-1.16888, 1.44995, 0.564411},
|
|
|
+ {-1.06411, 0.714986, 0.510479},
|
|
|
+ {-0.286334, 1.44995, 1.26822},
|
|
|
+ {-1.06411, 0.714986, 0.510479},
|
|
|
+ {-0.265897, 0.714986, 1.14704},
|
|
|
+ {-0.286334, 1.44995, 1.26822},
|
|
|
+ {-0.286334, 1.44995, 1.26822},
|
|
|
+ {-0.265897, 0.714986, 1.14704},
|
|
|
+ {0.814187, 1.44995, 1.01703},
|
|
|
+ {-0.265897, 0.714986, 1.14704},
|
|
|
+ {0.729464, 0.714986, 0.919852},
|
|
|
+ {0.814187, 1.44995, 1.01703},
|
|
|
+ {1.30396, 1.44995, 0.0},
|
|
|
+ {0.814187, 1.44995, 1.01703},
|
|
|
+ {1.17244, 0.714986, 0.0},
|
|
|
+ {0.729464, 0.714986, 0.919852},
|
|
|
+ {1.17244, 0.714986, 0.0},
|
|
|
+ {0.814187, 1.44995, 1.01703},
|
|
|
+ {1.30396, 1.44995, 0.0},
|
|
|
+ {1.17244, 0.714986, 0.0},
|
|
|
+ {0.814187, 1.44995, -1.01703},
|
|
|
+ {1.17244, 0.714986, 0.0},
|
|
|
+ {0.729464, 0.714986, -0.919852},
|
|
|
+ {0.814187, 1.44995, -1.01703},
|
|
|
+ {-0.286334, 1.44995, -1.26822},
|
|
|
+ {-0.227573, 2.16723, -1.05763},
|
|
|
+ {0.814187, 1.44995, -1.01703},
|
|
|
+ {0.814187, 1.44995, -1.01703},
|
|
|
+ {-0.227573, 2.16723, -1.05763},
|
|
|
+ {0.690208, 2.16723, -0.848157},
|
|
|
+ {-1.16888, 1.44995, -0.564412},
|
|
|
+ {-0.963577, 2.16723, -0.470692},
|
|
|
+ {-0.286334, 1.44995, -1.26822},
|
|
|
+ {-0.286334, 1.44995, -1.26822},
|
|
|
+ {-0.963577, 2.16723, -0.470692},
|
|
|
+ {-0.227573, 2.16723, -1.05763},
|
|
|
+ {-1.16888, 1.44995, -0.564412},
|
|
|
+ {-1.16888, 1.44995, 0.564411},
|
|
|
+ {-0.963577, 2.16723, -0.470692},
|
|
|
+ {-1.16888, 1.44995, 0.564411},
|
|
|
+ {-0.963577, 2.16723, 0.470692},
|
|
|
+ {-0.963577, 2.16723, -0.470692},
|
|
|
+ {-1.16888, 1.44995, 0.564411},
|
|
|
+ {-0.286334, 1.44995, 1.26822},
|
|
|
+ {-0.963577, 2.16723, 0.470692},
|
|
|
+ {-0.286334, 1.44995, 1.26822},
|
|
|
+ {-0.227574, 2.16723, 1.05763},
|
|
|
+ {-0.963577, 2.16723, 0.470692},
|
|
|
+ {-0.286334, 1.44995, 1.26822},
|
|
|
+ {0.814187, 1.44995, 1.01703},
|
|
|
+ {-0.227574, 2.16723, 1.05763},
|
|
|
+ {0.814187, 1.44995, 1.01703},
|
|
|
+ {0.690208, 2.16723, 0.848157},
|
|
|
+ {-0.227574, 2.16723, 1.05763},
|
|
|
+ {0.814187, 1.44995, 1.01703},
|
|
|
+ {1.30396, 1.44995, 0.0},
|
|
|
+ {0.690208, 2.16723, 0.848157},
|
|
|
+ {1.30396, 1.44995, 0.0},
|
|
|
+ {1.09866, 2.16723, 0.0},
|
|
|
+ {0.690208, 2.16723, 0.848157},
|
|
|
+ {0.814187, 1.44995, -1.01703},
|
|
|
+ {0.690208, 2.16723, -0.848157},
|
|
|
+ {1.30396, 1.44995, 0.0},
|
|
|
+ {1.30396, 1.44995, 0.0},
|
|
|
+ {0.690208, 2.16723, -0.848157},
|
|
|
+ {1.09866, 2.16723, 0.0},
|
|
|
+ {-0.227573, 2.16723, -1.05763},
|
|
|
+ {-0.154893, 2.72566, -0.759032},
|
|
|
+ {0.690208, 2.16723, -0.848157},
|
|
|
+ {0.690208, 2.16723, -0.848157},
|
|
|
+ {-0.154893, 2.72566, -0.759032},
|
|
|
+ {0.50377, 2.72566, -0.608696},
|
|
|
+ {-0.963577, 2.16723, -0.470692},
|
|
|
+ {-0.683099, 2.72566, -0.337801},
|
|
|
+ {-0.227573, 2.16723, -1.05763},
|
|
|
+ {-0.227573, 2.16723, -1.05763},
|
|
|
+ {-0.683099, 2.72566, -0.337801},
|
|
|
+ {-0.154893, 2.72566, -0.759032},
|
|
|
+ {-0.963577, 2.16723, -0.470692},
|
|
|
+ {-0.963577, 2.16723, 0.470692},
|
|
|
+ {-0.683099, 2.72566, -0.337801},
|
|
|
+ {-0.963577, 2.16723, 0.470692},
|
|
|
+ {-0.683099, 2.72566, 0.337801},
|
|
|
+ {-0.683099, 2.72566, -0.337801},
|
|
|
+ {-0.963577, 2.16723, 0.470692},
|
|
|
+ {-0.227574, 2.16723, 1.05763},
|
|
|
+ {-0.683099, 2.72566, 0.337801},
|
|
|
+ {-0.227574, 2.16723, 1.05763},
|
|
|
+ {-0.154893, 2.72566, 0.759032},
|
|
|
+ {-0.683099, 2.72566, 0.337801},
|
|
|
+ {-0.227574, 2.16723, 1.05763},
|
|
|
+ {0.690208, 2.16723, 0.848157},
|
|
|
+ {-0.154893, 2.72566, 0.759032},
|
|
|
+ {0.690208, 2.16723, 0.848157},
|
|
|
+ {0.50377, 2.72566, 0.608696},
|
|
|
+ {-0.154893, 2.72566, 0.759032},
|
|
|
+ {0.690208, 2.16723, 0.848157},
|
|
|
+ {1.09866, 2.16723, 0.0},
|
|
|
+ {0.50377, 2.72566, 0.608696},
|
|
|
+ {1.09866, 2.16723, 0.0},
|
|
|
+ {0.796903, 2.72566, 0.0},
|
|
|
+ {0.50377, 2.72566, 0.608696},
|
|
|
+ {1.09866, 2.16723, 0.0},
|
|
|
+ {0.690208, 2.16723, -0.848157},
|
|
|
+ {0.796903, 2.72566, 0.0},
|
|
|
+ {0.690208, 2.16723, -0.848157},
|
|
|
+ {0.50377, 2.72566, -0.608696},
|
|
|
+ {0.796903, 2.72566, 0.0},
|
|
|
+ {0.50377, 2.72566, -0.608696},
|
|
|
+ {-0.154893, 2.72566, -0.759032},
|
|
|
+ {0.259722, 3.11175, -0.299638},
|
|
|
+ {-0.154893, 2.72566, -0.759032},
|
|
|
+ {-0.0645132, 3.11175, -0.373643},
|
|
|
+ {0.259722, 3.11175, -0.299638},
|
|
|
+ {-0.154893, 2.72566, -0.759032},
|
|
|
+ {-0.683099, 2.72566, -0.337801},
|
|
|
+ {-0.0645132, 3.11175, -0.373643},
|
|
|
+ {-0.683099, 2.72566, -0.337801},
|
|
|
+ {-0.324529, 3.11175, -0.166287},
|
|
|
+ {-0.0645132, 3.11175, -0.373643},
|
|
|
+ {-0.683099, 2.72566, -0.337801},
|
|
|
+ {-0.683099, 2.72566, 0.337801},
|
|
|
+ {-0.324529, 3.11175, -0.166287},
|
|
|
+ {-0.683099, 2.72566, 0.337801},
|
|
|
+ {-0.324529, 3.11175, 0.166287},
|
|
|
+ {-0.324529, 3.11175, -0.166287},
|
|
|
+ {-0.683099, 2.72566, 0.337801},
|
|
|
+ {-0.154893, 2.72566, 0.759032},
|
|
|
+ {-0.324529, 3.11175, 0.166287},
|
|
|
+ {-0.154893, 2.72566, 0.759032},
|
|
|
+ {-0.0645132, 3.11175, 0.373642},
|
|
|
+ {-0.324529, 3.11175, 0.166287},
|
|
|
+ {-0.154893, 2.72566, 0.759032},
|
|
|
+ {0.50377, 2.72566, 0.608696},
|
|
|
+ {-0.0645132, 3.11175, 0.373642},
|
|
|
+ {0.50377, 2.72566, 0.608696},
|
|
|
+ {0.259722, 3.11175, 0.299638},
|
|
|
+ {-0.0645132, 3.11175, 0.373642},
|
|
|
+ {0.50377, 2.72566, 0.608696},
|
|
|
+ {0.796903, 2.72566, 0.0},
|
|
|
+ {0.259722, 3.11175, 0.299638},
|
|
|
+ {0.796903, 2.72566, 0.0},
|
|
|
+ {0.40402, 3.11175, 0.0},
|
|
|
+ {0.259722, 3.11175, 0.299638},
|
|
|
+ {0.796903, 2.72566, 0.0},
|
|
|
+ {0.50377, 2.72566, -0.608696},
|
|
|
+ {0.40402, 3.11175, 0.0},
|
|
|
+ {0.50377, 2.72566, -0.608696},
|
|
|
+ {0.259722, 3.11175, -0.299638},
|
|
|
+ {0.40402, 3.11175, 0.0},
|
|
|
+ {-0.177333, 0.160201, -0.741523},
|
|
|
+ {0.466137, 0.160201, -0.594656},
|
|
|
+ {-0.00334214, 0.00443203, 0.0},
|
|
|
+ {-0.693356, 0.160201, -0.330009},
|
|
|
+ {-0.177333, 0.160201, -0.741523},
|
|
|
+ {-0.00334214, 0.00443203, 0.0},
|
|
|
+ {-0.693356, 0.160201, 0.330009},
|
|
|
+ {-0.693356, 0.160201, -0.330009},
|
|
|
+ {-0.00334214, 0.00443203, 0.0},
|
|
|
+ {-0.177333, 0.160201, 0.741523},
|
|
|
+ {-0.693356, 0.160201, 0.330009},
|
|
|
+ {-0.00334214, 0.00443203, 0.0},
|
|
|
+ {0.466137, 0.160201, 0.594656},
|
|
|
+ {-0.177333, 0.160201, 0.741523},
|
|
|
+ {-0.00334214, 0.00443203, 0.0},
|
|
|
+ {0.752508, 0.160201, 0.0},
|
|
|
+ {0.466137, 0.160201, 0.594656},
|
|
|
+ {-0.00334214, 0.00443203, 0.0},
|
|
|
+ {0.466137, 0.160201, -0.594656},
|
|
|
+ {0.752508, 0.160201, 0.0},
|
|
|
+ {-0.00334214, 0.00443203, 0.0},
|
|
|
+ {0.259722, 3.11175, -0.299638},
|
|
|
+ {-0.0645132, 3.11175, -0.373643},
|
|
|
+ {0.0207683, 3.20912, 0.0},
|
|
|
+ {-0.0645132, 3.11175, -0.373643},
|
|
|
+ {-0.324529, 3.11175, -0.166287},
|
|
|
+ {0.0207683, 3.20912, 0.0},
|
|
|
+ {-0.324529, 3.11175, -0.166287},
|
|
|
+ {-0.324529, 3.11175, 0.166287},
|
|
|
+ {0.0207683, 3.20912, 0.0},
|
|
|
+ {-0.324529, 3.11175, 0.166287},
|
|
|
+ {-0.0645132, 3.11175, 0.373642},
|
|
|
+ {0.0207683, 3.20912, 0.0},
|
|
|
+ {-0.0645132, 3.11175, 0.373642},
|
|
|
+ {0.259722, 3.11175, 0.299638},
|
|
|
+ {0.0207683, 3.20912, 0.0},
|
|
|
+ {0.259722, 3.11175, 0.299638},
|
|
|
+ {0.40402, 3.11175, 0.0},
|
|
|
+ {0.0207683, 3.20912, 0.0},
|
|
|
+ {0.40402, 3.11175, 0.0},
|
|
|
+ {0.259722, 3.11175, -0.299638},
|
|
|
+ {0.0207683, 3.20912, 0.0}
|
|
|
+ };
|
|
|
+
|
|
|
#endif // __MaxEggPlugin__H
|