00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #pragma once
00016 #include "..\iFnPub.h"
00017 #include "..\maxapi.h"
00018 #include "iXRefObjRecord.h"
00019
00020
00021 class IXRefItem;
00022 class IXRefProxy;
00023 class IXRefObject8;
00024
00026 #define IID_OBJ_XREF_MGR8 Interface_ID(0x38575e56, 0x3b852a63)
00027
00029
00049 class IObjXRefManager8 : public FPStaticInterface
00050 {
00051 public:
00053
00054
00055
00057 virtual unsigned int RecordCount() const = 0;
00059
00062 virtual IObjXRefRecord* GetRecord(unsigned int i) const = 0;
00063
00065
00069 virtual IObjXRefRecord* FindRecord(XRefRecordHandle xrefRecHandle) const = 0;
00070
00072
00082 virtual bool CanCombineRecords(
00083 const IObjXRefRecord& firstRecord,
00084 const IObjXRefRecord& secondRecord) const = 0;
00085
00087
00094 virtual IObjXRefRecord* CombineRecords(Tab<IObjXRefRecord*>& xrefRecords) = 0;
00095
00097
00101 virtual bool RemoveRecordFromScene(const IObjXRefRecord& xrefRecord) = 0;
00102
00104
00108 virtual bool MergeRecordIntoScene(const IObjXRefRecord& xrefRecord) = 0;
00109
00111
00119 virtual bool SetRecordSrcFile(IObjXRefRecord& xrefRecord, const MaxSDK::AssetManagement::AssetUser& srcFileName) = 0;
00120
00122
00127 virtual bool UpdateAllRecords() = 0;
00129
00131
00132
00133
00152 virtual IObjXRefRecord* AddXRefItemsFromFile(
00153 const MaxSDK::AssetManagement::AssetUser& srcFileName,
00154 bool promptObjNames,
00155 const Tab<MCHAR*>* objNames,
00156 unsigned int xrefOptions) = 0;
00157
00159
00173 virtual bool AddXRefItemsToXRefRecord(
00174 IObjXRefRecord& xrefRecord,
00175 bool promptObjNames,
00176 const Tab<MCHAR*>* objNames) = 0;
00177
00179
00189 virtual bool RemoveXRefItemsFromScene(const Tab<ReferenceTarget*>& xrefItems) = 0;
00190
00192
00204 virtual bool MergeXRefItemsIntoScene(const Tab<ReferenceTarget*>& xrefItems) = 0;
00205
00207
00216 virtual void ApplyXRefMaterialsToXRefObjects(const Tab<ReferenceTarget*>& objectXRefItems) = 0;
00217
00219
00226 virtual void ApplyXRefControllersToXRefObjects(const Tab<ReferenceTarget*>& objectXRefItems) = 0;
00227
00229
00235 virtual bool CanResetXRefControllersPRSOffset(ReferenceTarget& inXRefItem) const = 0;
00236
00239
00245 virtual bool ResetXRefControllersPRSOffset(const Tab<ReferenceTarget*>& inXRefItems) = 0;
00246
00248
00260 virtual bool SetXRefItemSrcName(ReferenceTarget& xrefItem, const MCHAR* srcItemName) = 0;
00261
00263
00272 virtual bool SetProxyItemSrcName(ReferenceTarget& xrefProxy, const MCHAR* proxyName) = 0;
00273
00275
00283 virtual bool SetXRefItemSrcFile(ReferenceTarget& xrefItem, const MaxSDK::AssetManagement::AssetUser& srcAsset) = 0;
00284
00286
00294 virtual bool SetProxyItemSrcFile(ReferenceTarget& xrefProxy, const MaxSDK::AssetManagement::AssetUser& proxyAsset) = 0;
00296
00298
00299
00300
00301
00303 virtual unsigned int GetDupObjNameAction() const = 0;
00306
00308 virtual void SetDupObjNameAction(unsigned int action) = 0;
00309
00312
00314 virtual unsigned int GetDupMtlNameAction() const = 0;
00317
00319 virtual void SetDupMtlNameAction(unsigned int action) = 0;
00320
00322
00328 virtual IXRefObject8* IsNodeXRefed(INode& node) const = 0;
00330
00334
00335
00336
00341 virtual void SetMergeTransforms(bool in_merge) = 0;
00343
00344 virtual bool GetMergeTransforms() const = 0;
00345
00347
00352 virtual void SetMergeMaterials(bool in_merge) = 0;
00354
00355 virtual bool GetMergeMaterials() const = 0;
00356
00358
00363 virtual void SetMergeManipulators(bool in_merge) = 0;
00365
00366 virtual bool GetMergeManipulators() const = 0;
00367
00369
00382 virtual void SetMergeModifiers(int in_merge) = 0;
00384
00385 virtual int GetMergeModifiers() const = 0;
00386
00388
00392 virtual void SetIncludeAll(bool in_include) = 0;
00394
00395 virtual bool GetIncludeAll() const = 0;
00396
00397
00399
00402 virtual void SetAutoUpdate(bool in_autoUpdate) = 0;
00404
00405 virtual bool GetAutoUpdate() const = 0;
00406
00408
00409
00411 static IObjXRefManager8* GetInstance() {
00412 return static_cast<IObjXRefManager8*>(GetCOREInterface(IID_OBJ_XREF_MGR8));
00413 }
00414
00415
00417 enum {
00418 kfpRecordCount,
00419 kfpGetRecord,
00420 kfpFindRecord,
00421 kfpRemoveRecordFromScene,
00422 kfpMergeRecordIntoScene,
00423 kfpSetRecordSrcFile,
00424 kfpUpdateAllRecords,
00425 kfpSetXRefItemSrcName,
00426 kfpSetProxyItemSrcName,
00427 kfpSetXRefItemSrcFile,
00428 kfpSetProxyItemSrcFile,
00429 kfpRemoveXRefsFromScene,
00430 kfpMergeXRefsIntoScene,
00431 kfpAddXRefItemsToXRefRecord,
00432 kfpAddXRefItemsFromFile,
00433 kfpCanCombineRecords,
00434 kfpCombineRecords,
00435 kfpApplyXRefMaterialsToXRefObjects,
00436 kfpGetDupObjNameAction, kfpSetDupObjNameAction,
00437 kfpGetDupMtlNameAction, kfpSetDupMtlNameAction,
00438 kfpIsNodeXRefed,
00439 kfpApplyXRefControllersToXRefObjects,
00440 kfpResetXRefControllersPRSOffset,
00441 kfpCanResetXRefControllersPRSOffset,
00442
00443
00444 kfpGetMergeTransforms, kfpSetMergeTransforms,
00445 kfpGetMergeMaterials, kfpSetMergeMaterials,
00446 kfpGetMergeManipulators, kfpSetMergeManipulators,
00447 kfpGetMergeModifiers, kfpSetMergeModifiers,
00448 kfpGetIncludeAll, kfpSetIncludeAll,
00449 kfpGetAutoUpdate, kfpSetAutoUpdate,
00450 };
00451
00453 enum FPEnums
00454 {
00455 kfpXrefOptions,
00456 kfpDupNodeNameActions,
00457 kfpDupMaterialNameActions,
00458 kfpXrefModifierOptions
00459 };
00460
00461 BEGIN_FUNCTION_MAP
00462 RO_PROP_FN(kfpRecordCount, RecordCount, TYPE_DWORD);
00463 PROP_FNS(kfpGetDupObjNameAction, GetDupObjNameAction, kfpSetDupObjNameAction, SetDupObjNameAction, TYPE_ENUM);
00464 PROP_FNS(kfpGetDupMtlNameAction, GetDupMtlNameAction, kfpSetDupMtlNameAction, SetDupMtlNameAction, TYPE_ENUM);
00465 FN_1(kfpGetRecord, TYPE_INTERFACE, GetRecord, TYPE_INDEX);
00466 FN_1(kfpFindRecord, TYPE_INTERFACE, FindRecord, TYPE_DWORD);
00467 FN_1(kfpRemoveRecordFromScene, TYPE_bool, FPRemoveRecordFromScene, TYPE_INTERFACE);
00468 FN_1(kfpMergeRecordIntoScene, TYPE_bool, FPMergeRecordIntoScene, TYPE_INTERFACE);
00469 FN_2(kfpSetRecordSrcFile, TYPE_bool, FPSetRecordSrcFile, TYPE_INTERFACE, TYPE_FILENAME);
00470 FN_0(kfpUpdateAllRecords, TYPE_bool, UpdateAllRecords);
00471 FN_2(kfpSetXRefItemSrcName, TYPE_bool, SetXRefItemSrcName, TYPE_REFTARG_BR, TYPE_STRING);
00472 FN_2(kfpSetProxyItemSrcName, TYPE_bool, SetProxyItemSrcName, TYPE_REFTARG_BR, TYPE_STRING);
00473 FN_2(kfpSetXRefItemSrcFile, TYPE_bool, FPSetXRefItemSrcFile, TYPE_REFTARG_BR, TYPE_FILENAME);
00474 FN_2(kfpSetProxyItemSrcFile, TYPE_bool, FPSetProxyItemSrcFile, TYPE_REFTARG_BR, TYPE_FILENAME);
00475 FN_1(kfpRemoveXRefsFromScene, TYPE_bool, RemoveXRefItemsFromScene, TYPE_REFTARG_TAB_BR);
00476 FN_1(kfpMergeXRefsIntoScene, TYPE_bool, MergeXRefItemsIntoScene, TYPE_REFTARG_TAB_BR);
00477 FN_3(kfpAddXRefItemsToXRefRecord, TYPE_bool, FPAddXRefItemsToXRefRecord, TYPE_INTERFACE, TYPE_bool, TYPE_STRING_TAB);
00478 FN_4(kfpAddXRefItemsFromFile, TYPE_INTERFACE, FPAddXRefItemsFromFile, TYPE_FILENAME, TYPE_bool, TYPE_STRING_TAB, TYPE_ENUM_TAB_BR);
00479 FN_2(kfpCanCombineRecords, TYPE_bool, FPCanCombineRecords, TYPE_INTERFACE, TYPE_INTERFACE);
00480 FN_1(kfpCombineRecords, TYPE_INTERFACE, FPCombineRecords, TYPE_INTERFACE_TAB_BR);
00481 VFN_1(kfpApplyXRefMaterialsToXRefObjects, ApplyXRefMaterialsToXRefObjects, TYPE_REFTARG_TAB_BR);
00482 FN_1(kfpIsNodeXRefed, TYPE_INTERFACE, FPIsNodeXRefed, TYPE_INODE);
00483 VFN_1(kfpApplyXRefControllersToXRefObjects, ApplyXRefControllersToXRefObjects, TYPE_REFTARG_TAB_BR);
00484 FN_1(kfpResetXRefControllersPRSOffset, TYPE_bool, ResetXRefControllersPRSOffset, TYPE_REFTARG_TAB_BR);
00485 FN_1(kfpCanResetXRefControllersPRSOffset, TYPE_bool, CanResetXRefControllersPRSOffset, TYPE_REFTARG_BR);
00486 PROP_FNS(kfpGetMergeTransforms, GetMergeTransforms,
00487 kfpSetMergeTransforms, SetMergeTransforms, TYPE_bool);
00488 PROP_FNS(kfpGetMergeMaterials, GetMergeMaterials,
00489 kfpSetMergeMaterials, SetMergeMaterials, TYPE_bool);
00490 PROP_FNS(kfpGetMergeManipulators, GetMergeManipulators,
00491 kfpSetMergeManipulators, SetMergeManipulators, TYPE_bool);
00492 PROP_FNS(kfpGetMergeModifiers, GetMergeModifiers,
00493 kfpSetMergeModifiers, SetMergeModifiers, TYPE_ENUM);
00494 PROP_FNS(kfpGetIncludeAll, GetIncludeAll,
00495 kfpSetIncludeAll, SetIncludeAll, TYPE_bool);
00496 PROP_FNS(kfpGetAutoUpdate, GetAutoUpdate,
00497 kfpSetAutoUpdate, SetAutoUpdate, TYPE_bool);
00498 END_FUNCTION_MAP
00499
00500 private:
00501 bool FPSetRecordSrcFile(FPInterface* xrefRecord, const MCHAR* srcFileName);
00502 bool FPAddXRefItemsToXRefRecord(
00503 FPInterface* xrefRecord,
00504 bool promptObjNames,
00505 Tab<MCHAR*>* objNames);
00506 IObjXRefRecord* FPAddXRefItemsFromFile(
00507 const MCHAR* srcFileName,
00508 bool promptObjNames,
00509 Tab<MCHAR*>* objNames,
00510 IntTab& xrefOptions);
00511 bool FPCanCombineRecords(FPInterface* firstXRefRec, FPInterface* secondXRefRec);
00512 IObjXRefRecord* FPCombineRecords(Tab<FPInterface*>& xrefRecords);
00513 IXRefItem* FPIsNodeXRefed(INode* node);
00514 bool FPRemoveRecordFromScene(FPInterface* xrefRecord);
00515 bool FPMergeRecordIntoScene(FPInterface* xrefRecord);
00516 virtual bool FPSetXRefItemSrcFile(ReferenceTarget& xrefItem, const MCHAR* fname)=0;
00517 virtual bool FPSetProxyItemSrcFile(ReferenceTarget& xrefProxy, const MCHAR* fname)=0;
00518 };
00519
00520