iMorphByBone.h

Go to the documentation of this file.
00001 #pragma once
00002 
00003 #include "iFnPub.h"
00004 #include "matrix3.h"
00005 
00006 //***************************************************************
00007 //Function Publishing System stuff   
00008 //****************************************************************
00009 #define MORPHBYBONE_INTERFACE Interface_ID(0xDE17A34f, 0x8B52E4E3)
00010 
00011 
00012 enum {  morphbybone_addbone,
00013         morphbybone_removebone,
00014         morphbybone_selectbone,
00015         morphbybone_getselectedbone,
00016         morphbybone_getselectedmorph,
00017         morphbybone_selectvertices,
00018         morphbybone_isselectedvertex,
00019         morphbybone_resetgraph,
00020         morphbybone_grow,morphbybone_shrink,
00021         morphbybone_ring,morphbybone_loop,
00022 
00023         morphbybone_createmorph,
00024         morphbybone_removemorph,
00025         morphbybone_editmorph,
00026 
00027         morphbybone_clearvertices,
00028         morphbybone_deletevertices,
00029         morphbybone_resetorientation,
00030 
00031         morphbybone_reloadtarget,
00032         morphbybone_mirrorpaste,
00033         morphbybone_editfalloffgraph,
00034         
00035         morphbybone_setexternalnode,
00036 
00037         morphbybone_moveverts,
00038         morphbybone_transformverts,
00039 
00040         morphbybone_numberofbones,
00041 
00042         morphbybone_bonegetinitialnodetm,
00043         morphbybone_bonesetinitialnodetm,
00044 
00045         morphbybone_bonegetinitialobjecttm,
00046         morphbybone_bonesetinitialobjecttm,
00047         
00048         morphbybone_bonegetinitialparenttm,
00049         morphbybone_bonesetinitialparenttm,
00050         
00051         morphbybone_bonegetnumberofmorphs,
00052 
00053         morphbybone_bonegetmorphname,
00054         morphbybone_bonesetmorphname,
00055 
00056         morphbybone_bonegetmorphangle,
00057         morphbybone_bonesetmorphangle,
00058 
00059         morphbybone_bonegetmorphtm,
00060         morphbybone_bonesetmorphtm,
00061 
00062         morphbybone_bonegetmorphparenttm,
00063         morphbybone_bonesetmorphparenttm,
00064 
00065         morphbybone_bonegetmorphisdead,
00066         morphbybone_bonegetmorphsetdead,
00067 
00068         morphbybone_bonegetmorphnumpoints,
00069         morphbybone_bonesetmorphnumpoints,
00070 
00071         morphbybone_bonegetmorphvertid,
00072         morphbybone_bonesetmorphvertid,
00073 
00074         morphbybone_bonegetmorphvec,
00075         morphbybone_bonesetmorphvec,
00076 
00077         morphbybone_bonegetmorphpvec,
00078         morphbybone_bonesetmorphpvec,
00079 
00080         morphbybone_bonegetmorphop,
00081         morphbybone_bonesetmorphop,
00082 
00083         morphbybone_bonegetmorphowner,
00084         morphbybone_bonesetmorphowner,
00085 
00086         morphbybone_bonegetmorphfalloff,
00087         morphbybone_bonesetmorphfalloff,
00088 
00089         morphbybone_bonegetjointtype,
00090         morphbybone_bonesetjointtype,
00091 
00092         morphbybone_update,
00093 
00094         morphbybone_getweight,
00095 
00096         morphbybone_bonegetmorphenabled,
00097         morphbybone_bonesetmorphenabled,
00098 
00099         };
00100 //****************************************************************
00101 
00106 class IMorphByBone : public FPMixinInterface 
00107 {
00108     public:
00109 
00110         //Function Publishing System
00111         //Function Map For Mixin Interface
00112         //*************************************************
00113         BEGIN_FUNCTION_MAP
00114 
00115             VFN_1(morphbybone_addbone, fnAddBone, TYPE_INODE);
00116             VFN_1(morphbybone_removebone, fnRemoveBone, TYPE_INODE);
00117             VFN_2(morphbybone_selectbone, fnSelectBone, TYPE_INODE,TYPE_STRING);
00118             FN_0(morphbybone_getselectedbone, TYPE_INODE, fnGetSelectedBone);
00119             FN_0(morphbybone_getselectedmorph, TYPE_STRING, fnGetSelectedMorph);
00120             VFN_2(morphbybone_selectvertices, fnSelectVertices, TYPE_INODE,TYPE_BITARRAY);
00121             FN_2(morphbybone_isselectedvertex,TYPE_BOOL, fnIsSelectedVertex, TYPE_INODE,TYPE_INT);
00122 
00123             VFN_0(morphbybone_resetgraph, fnResetGraph);
00124             VFN_0(morphbybone_grow, fnGrow);
00125             VFN_0(morphbybone_shrink, fnShrink);
00126             VFN_0(morphbybone_ring, fnRing);
00127             VFN_0(morphbybone_loop, fnLoop);
00128 
00129             VFN_1(morphbybone_createmorph, fnCreateMorph, TYPE_INODE);
00130             VFN_2(morphbybone_removemorph, fnRemoveMorph, TYPE_INODE,TYPE_STRING);
00131 
00132             VFN_1(morphbybone_editmorph, fnEdit,TYPE_BOOL);
00133 
00134             VFN_0(morphbybone_clearvertices, fnClearSelectedVertices);
00135             VFN_0(morphbybone_deletevertices, fnDeleteSelectedVertices);
00136 
00137             VFN_2(morphbybone_resetorientation, fnResetOrientation, TYPE_INODE,TYPE_STRING);
00138             VFN_2(morphbybone_reloadtarget, fnReloadTarget, TYPE_INODE,TYPE_STRING);
00139             VFN_1(morphbybone_mirrorpaste, fnMirrorPaste, TYPE_INODE);
00140             
00141             VFN_2(morphbybone_editfalloffgraph, fnEditFalloffGraph, TYPE_INODE,TYPE_STRING);
00142 
00143             VFN_3(morphbybone_setexternalnode, fnSetExternalNode, TYPE_INODE,TYPE_STRING,TYPE_INODE);
00144 
00145             VFN_1(morphbybone_moveverts, fnMoveVerts, TYPE_POINT3);
00146 
00147             VFN_2(morphbybone_transformverts, fnTransFormVerts, TYPE_MATRIX3, TYPE_MATRIX3);
00148 
00149             FN_0(morphbybone_numberofbones, TYPE_INT, fnNumberOfBones);
00150 
00151             FN_1(morphbybone_bonegetinitialnodetm, TYPE_MATRIX3, fnBoneGetInitialNodeTM, TYPE_INODE);
00152             VFN_2(morphbybone_bonesetinitialnodetm, fnBoneSetInitialNodeTM, TYPE_INODE, TYPE_MATRIX3);
00153 
00154             FN_1(morphbybone_bonegetinitialobjecttm, TYPE_MATRIX3, fnBoneGetInitialObjectTM, TYPE_INODE);
00155             VFN_2(morphbybone_bonesetinitialobjecttm, fnBoneSetInitialObjectTM, TYPE_INODE, TYPE_MATRIX3);
00156 
00157             FN_1(morphbybone_bonegetinitialparenttm, TYPE_MATRIX3, fnBoneGetInitialParentTM, TYPE_INODE);
00158             VFN_2(morphbybone_bonesetinitialparenttm, fnBoneSetInitialParentTM, TYPE_INODE, TYPE_MATRIX3);
00159 
00160             FN_1(morphbybone_bonegetnumberofmorphs, TYPE_INT, fnBoneGetNumberOfMorphs,TYPE_INODE);
00161 
00162             FN_2(morphbybone_bonegetmorphname, TYPE_STRING, fnBoneGetMorphName,TYPE_INODE,TYPE_INT);
00163             VFN_3(morphbybone_bonesetmorphname, fnBoneSetMorphName,TYPE_INODE,TYPE_INT,TYPE_STRING);
00164 
00165             FN_2(morphbybone_bonegetmorphangle, TYPE_FLOAT, fnBoneGetMorphAngle,TYPE_INODE,TYPE_INT);
00166             VFN_3(morphbybone_bonesetmorphangle, fnBoneSetMorphAngle,TYPE_INODE,TYPE_INT,TYPE_FLOAT);
00167 
00168             FN_2(morphbybone_bonegetmorphtm, TYPE_MATRIX3, fnBoneGetMorphTM,TYPE_INODE,TYPE_INT);
00169             VFN_3(morphbybone_bonesetmorphtm, fnBoneSetMorphTM,TYPE_INODE,TYPE_INT,TYPE_MATRIX3);
00170 
00171             FN_2(morphbybone_bonegetmorphparenttm, TYPE_MATRIX3, fnBoneGetMorphParentTM,TYPE_INODE,TYPE_INT);
00172             VFN_3(morphbybone_bonesetmorphparenttm, fnBoneSetMorphParentTM,TYPE_INODE,TYPE_INT,TYPE_MATRIX3);
00173 
00174             FN_2(morphbybone_bonegetmorphisdead, TYPE_BOOL, fnBoneGetMorphIsDead,TYPE_INODE,TYPE_INT);
00175             VFN_3(morphbybone_bonegetmorphsetdead, fnBoneSetMorphSetDead,TYPE_INODE,TYPE_INT,TYPE_BOOL);
00176 
00177             FN_2 (morphbybone_bonegetmorphnumpoints, TYPE_INT, fnBoneGetMorphNumPoints,TYPE_INODE,TYPE_INT);
00178             VFN_3(morphbybone_bonesetmorphnumpoints, fnBoneSetMorphNumPoints,TYPE_INODE,TYPE_INT,TYPE_INT);
00179 
00180 
00181             FN_3 (morphbybone_bonegetmorphvertid, TYPE_INT, fnBoneGetMorphVertID,TYPE_INODE,TYPE_INT,TYPE_INT);
00182             VFN_4(morphbybone_bonesetmorphvertid, fnBoneSetMorphVertID,TYPE_INODE,TYPE_INT,TYPE_INT,TYPE_INT);
00183 
00184 
00185             FN_3 (morphbybone_bonegetmorphvec, TYPE_POINT3, fnBoneGetMorphVec,TYPE_INODE,TYPE_INT,TYPE_INT);
00186             VFN_4(morphbybone_bonesetmorphvec, fnBoneSetMorphVec,TYPE_INODE,TYPE_INT,TYPE_INT,TYPE_POINT3);
00187 
00188             FN_3 (morphbybone_bonegetmorphpvec, TYPE_POINT3, fnBoneGetMorphPVec,TYPE_INODE,TYPE_INT,TYPE_INT);
00189             VFN_4(morphbybone_bonesetmorphpvec, fnBoneSetMorphPVec,TYPE_INODE,TYPE_INT,TYPE_INT,TYPE_POINT3);
00190 
00191 
00192             FN_3 (morphbybone_bonegetmorphop, TYPE_POINT3, fnBoneGetMorphOP,TYPE_INODE,TYPE_INT,TYPE_INT);
00193             VFN_4(morphbybone_bonesetmorphop, fnBoneSetMorphOP,TYPE_INODE,TYPE_INT,TYPE_INT,TYPE_POINT3);
00194 
00195 
00196             FN_3 (morphbybone_bonegetmorphowner, TYPE_INODE, fnBoneGetMorphOwner,TYPE_INODE,TYPE_INT,TYPE_INT);
00197             VFN_4(morphbybone_bonesetmorphowner, fnBoneSetMorphOwner,TYPE_INODE,TYPE_INT,TYPE_INT,TYPE_INODE);
00198 
00199             FN_2 (morphbybone_bonegetmorphfalloff, TYPE_INT, fnBoneGetMorphFalloff,TYPE_INODE,TYPE_INT);
00200             VFN_3(morphbybone_bonesetmorphfalloff, fnBoneSetMorphFalloff,TYPE_INODE,TYPE_INT,TYPE_INT);
00201 
00202             FN_1 (morphbybone_bonegetjointtype, TYPE_INT, fnBoneGetJointType,TYPE_INODE);
00203             VFN_2(morphbybone_bonesetjointtype, fnBoneSetJointType,TYPE_INODE,TYPE_INT);
00204 
00205             VFN_0(morphbybone_update, fnUpdate);
00206 
00207             FN_2(morphbybone_getweight, TYPE_FLOAT, fnGetWeight,TYPE_INODE,TYPE_STRING);
00208             
00209 
00210             FN_2 (morphbybone_bonegetmorphenabled, TYPE_BOOL, fnBoneGetMorphEnabled,TYPE_INODE,TYPE_INT);
00211             VFN_3(morphbybone_bonesetmorphenabled, fnBoneSetMorphEnabled,TYPE_INODE,TYPE_INT,TYPE_BOOL);
00212 
00213 
00214         END_FUNCTION_MAP
00215 
00216         FPInterfaceDesc* GetDesc();
00217         
00218         //note functions that start with fn are to be used with maxscript since these expect 1 based indices
00219         
00223         virtual void    fnAddBone(INode *node)=0;
00224 
00228         virtual void    fnRemoveBone(INode *node)=0;
00229 
00235         virtual void    fnSelectBone(INode *node,MCHAR* morphName)=0;
00236 
00239         virtual INode*  fnGetSelectedBone()=0;
00240 
00243         virtual MCHAR*  fnGetSelectedMorph()=0;
00244         
00250         virtual void    fnSelectVertices(INode *node,BitArray *sel)=0;
00255         virtual BOOL    fnIsSelectedVertex(INode *node,int index)=0;
00256         
00260         virtual void    fnResetGraph()=0;
00263         virtual void    fnShrink()=0;
00266         virtual void    fnGrow()=0;
00269         virtual void    fnRing()=0;
00272         virtual void    fnLoop()=0;
00273 
00277         virtual void    fnCreateMorph(INode *node)=0;
00278 
00283         virtual void    fnRemoveMorph(INode *node, MCHAR *name)=0;
00284 
00289         virtual void    fnEdit(BOOL edit)=0;
00290 
00294         virtual void    fnClearSelectedVertices()=0;
00298         virtual void    fnDeleteSelectedVertices()=0;
00299 
00304         virtual void    fnResetOrientation(INode *node, MCHAR *name)=0;
00309         virtual void    fnReloadTarget(INode *node, MCHAR *name)=0;
00310 
00314         virtual void    fnMirrorPaste(INode *node)=0;
00315 
00320         virtual void    fnEditFalloffGraph(INode *node, MCHAR *name)=0;
00325         virtual void    fnSetExternalNode(INode *node, MCHAR *name,INode *exnode)=0;
00326         
00330         virtual void    fnMoveVerts(Point3 vec)=0;
00335         virtual void    fnTransFormVerts(Matrix3 a, Matrix3 b)=0;
00336 
00339         virtual int     fnNumberOfBones() = 0;
00340 
00346         virtual Matrix3*    fnBoneGetInitialNodeTM(INode *node) = 0;
00351         virtual void    fnBoneSetInitialNodeTM(INode *node, Matrix3 tm) = 0;
00352 
00353 
00359         virtual Matrix3*    fnBoneGetInitialObjectTM(INode *node) = 0;
00364         virtual void    fnBoneSetInitialObjectTM(INode *node, Matrix3 tm) = 0;
00365 
00366 
00370         virtual Matrix3*    fnBoneGetInitialParentTM(INode *node) = 0;
00375         virtual void    fnBoneSetInitialParentTM(INode *node, Matrix3 tm) = 0;
00376 
00380         virtual int     fnBoneGetNumberOfMorphs(INode *node) = 0;
00381 
00385         virtual MCHAR*  fnBoneGetMorphName(INode *node, int morphIndex) = 0;
00386         virtual void    fnBoneSetMorphName(INode *node, int morphIndex,MCHAR* name) = 0;
00387 
00388         virtual float   fnBoneGetMorphAngle(INode *node, int morphIndex) = 0;
00389         virtual void    fnBoneSetMorphAngle(INode *node, int morphIndex,float angle) = 0;
00390 
00391 
00392         virtual Matrix3* fnBoneGetMorphTM(INode *node, int morphIndex) = 0;
00393         virtual void     fnBoneSetMorphTM(INode *node, int morphIndex,Matrix3 tm) = 0;
00394 
00395         virtual Matrix3* fnBoneGetMorphParentTM(INode *node, int morphIndex) = 0;
00396         virtual void     fnBoneSetMorphParentTM(INode *node, int morphIndex,Matrix3 tm) = 0;
00397 
00398         virtual BOOL     fnBoneGetMorphIsDead(INode *node, int morphIndex) = 0;
00399         virtual void     fnBoneSetMorphSetDead(INode *node, int morphIndex,BOOL dead) = 0;
00400 
00401         virtual int      fnBoneGetMorphNumPoints(INode *node, int morphIndex) = 0;
00402         virtual void     fnBoneSetMorphNumPoints(INode *node, int morphIndex, int numberPoints) = 0;
00403 
00410         virtual int      fnBoneGetMorphVertID(INode *node, int morphIndex, int ithIndex) = 0;
00411         virtual void     fnBoneSetMorphVertID(INode *node, int morphIndex, int ithIndex, int vertIndex) = 0;
00412 
00414         virtual Point3*  fnBoneGetMorphVec(INode *node, int morphIndex, int ithIndex) = 0;
00415         virtual void     fnBoneSetMorphVec(INode *node, int morphIndex, int ithIndex, Point3 vec) = 0;
00416 
00418         virtual Point3*  fnBoneGetMorphPVec(INode *node, int morphIndex, int ithIndex) = 0;
00419         virtual void     fnBoneSetMorphPVec(INode *node, int morphIndex, int ithIndex, Point3 vec) = 0;
00420 
00422         virtual Point3*  fnBoneGetMorphOP(INode *node, int morphIndex, int ithIndex) = 0;
00423         virtual void     fnBoneSetMorphOP(INode *node, int morphIndex, int ithIndex, Point3 vec) = 0;
00424 
00426         virtual INode*   fnBoneGetMorphOwner(INode *node, int morphIndex, int ithIndex) = 0;
00427         virtual void     fnBoneSetMorphOwner(INode *node, int morphIndex, int ithIndex, INode *onode) = 0;
00428 
00429         virtual int      fnBoneGetMorphFalloff(INode *node, int morphIndex) = 0;
00430         virtual void     fnBoneSetMorphFalloff(INode *node, int morphIndex, int falloff) = 0;
00431 
00432 
00433         virtual int      fnBoneGetJointType(INode *node) = 0;
00434         virtual void     fnBoneSetJointType(INode *node, int jointType) = 0;
00435 
00438         virtual void     fnUpdate() = 0;
00439 
00444         virtual float    fnGetWeight(INode *node, MCHAR*name) = 0;
00445 
00446         virtual BOOL     fnBoneGetMorphEnabled(INode *node, int morphIndex) = 0;
00447         virtual void     fnBoneSetMorphEnabled(INode *node, int morphIndex, BOOL enabled) = 0;
00448 
00449 
00450     };
00451 
00452 
00453 
00454 
00455