📄 maxapi.h
字号:
virtual IRollupWindow *GetCommandPanelRollup()=0;
// When the user mouses down in dead area, the plug-in should pass
// mouse messages to this function which will pass them on to the rollup.
virtual void RollupMouseMessage( HWND hDlg, UINT message,
WPARAM wParam, LPARAM lParam )=0;
// get/set the current time.
virtual TimeValue GetTime()=0;
virtual void SetTime(TimeValue t,BOOL redraw=TRUE)=0;
// get/set the anim interval.
virtual Interval GetAnimRange()=0;
virtual void SetAnimRange(Interval range)=0;
// Register a callback object that will get called every time the
// user changes the frame slider.
virtual void RegisterTimeChangeCallback(TimeChangeCallback *tc)=0;
virtual void UnRegisterTimeChangeCallback(TimeChangeCallback *tc)=0;
// Register a callback object that will get called when the user
// causes the command mode to change
virtual void RegisterCommandModeChangedCallback(CommandModeChangedCallback *cb)=0;
virtual void UnRegisterCommandModeChangedCallback(CommandModeChangedCallback *cb)=0;
// Register a ViewportDisplayCallback
// If 'preScene' is TRUE then the callback will be called before object are rendered (typically, but not always).
virtual void RegisterViewportDisplayCallback(BOOL preScene,ViewportDisplayCallback *cb)=0;
virtual void UnRegisterViewportDisplayCallback(BOOL preScene,ViewportDisplayCallback *cb)=0;
virtual void NotifyViewportDisplayCallbackChanged(BOOL preScene,ViewportDisplayCallback *cb)=0;
// Register a ExitMAXCallback
virtual void RegisterExitMAXCallback(ExitMAXCallback *cb)=0;
virtual void UnRegisterExitMAXCallback(ExitMAXCallback *cb)=0;
virtual RightClickMenuManager* GetRightClickMenuManager()=0;
// Delete key notitfication
virtual void RegisterDeleteUser(EventUser *user)=0; // Register & Activate
virtual void UnRegisterDeleteUser(EventUser *user)=0; // Deactivate & UnRegister
//----- Creation-related Methods--------------------------
virtual void MakeNameUnique(TSTR &name)=0;
virtual INode *CreateObjectNode( Object *obj)=0;
virtual GenCamera *CreateCameraObject(int type) = 0;
virtual Object *CreateTargetObject() = 0;
virtual GenLight *CreateLightObject(int type) = 0;
virtual void *CreateInstance(SClass_ID superID, Class_ID classID)=0;
virtual int BindToTarget(INode *laNode, INode *targNode)=0;
virtual int IsCPEdgeOnInView()=0;
virtual void DeleteNode(INode *node, BOOL redraw=TRUE, BOOL overrideSlaves=FALSE)=0;
virtual INode *GetRootNode()=0;
virtual void NodeInvalidateRect( INode *node )=0;
virtual void SelectNode( INode *node, int clearSel = 1)=0;
virtual void DeSelectNode(INode *node)=0;
virtual void SelectNodeTab(INodeTab &nodes,BOOL sel,BOOL redraw=TRUE)=0;
virtual void ClearNodeSelection(BOOL redraw=TRUE)=0;
virtual void AddLightToScene(INode *node)=0;
virtual void AddGridToScene(INode *node) = 0;
virtual void SetNodeTMRelConstPlane(INode *node, Matrix3& mat)=0;
virtual void SetActiveGrid(INode *node)=0;
virtual INode *GetActiveGrid()=0;
// When a plug-in object implements it's own BeginCreate()/EndCreate()
// it can cause EndCreate() to be called by calling this method.
virtual void StopCreating()=0;
// This creates a new object/node with out going throught the usual
// create mouse proc sequence.
// The matrix is relative to the contruction plane.
virtual Object *NonMouseCreate(Matrix3 tm)=0;
virtual void NonMouseCreateFinish(Matrix3 tm)=0;
// directories
virtual TCHAR *GetDir(int which)=0; // which = APP_XXX_DIR
virtual int GetPlugInEntryCount()=0; // # of entries in PLUGIN.INI
virtual TCHAR *GetPlugInDesc(int i)=0; // ith description
virtual TCHAR *GetPlugInDir(int i)=0; // ith directory
// bitmap path
virtual int GetMapDirCount()=0; // number of dirs in path
virtual TCHAR *GetMapDir(int i)=0; // i'th dir of path
virtual BOOL AddMapDir(TCHAR *dir)=0; // add a path to the list
virtual float GetLightConeConstraint()=0;
// for light exclusion/inclusion lists
virtual int DoExclusionListDialog(NameTab *nl, BOOL doShadows=TRUE)=0;
virtual MtlBase *DoMaterialBrowseDlg(HWND hParent,DWORD flags,BOOL &newMat,BOOL &cancel)=0;
virtual void PutMtlToMtlEditor(MtlBase *mb, int slot=-1)=0;
virtual MtlBase* GetMtlSlot(int slot)=0;
virtual MtlBaseLib* GetSceneMtls()=0;
// Before assigning material to scene, call this to avoid duplicate names.
// returns 1:OK 0:Cancel
virtual BOOL OkMtlForScene(MtlBase *m)=0;
// Access names of current files
virtual TSTR &GetCurFileName()=0;
virtual TSTR &GetCurFilePath()=0;
virtual TCHAR *GetMatLibFileName()=0;
// These may bring up file requesters
virtual void FileOpen()=0;
virtual BOOL FileSave()=0;
virtual BOOL FileSaveAs()=0;
virtual void FileSaveSelected()=0;
virtual void FileReset(BOOL noPrompt=FALSE)=0;
virtual void FileMerge()=0;
virtual void FileHold()=0;
virtual void FileFetch()=0;
virtual void FileOpenMatLib(HWND hWnd)=0; // Window handle is parent window
virtual void FileSaveMatLib(HWND hWnd)=0;
virtual void FileSaveAsMatLib(HWND hWnd)=0;
virtual BOOL FileImport()=0;
virtual BOOL FileExport()=0;
// This loads 3dsmax.mat (if it exists
virtual void LoadDefaultMatLib()=0;
// These do not bring up file requesters
virtual int LoadFromFile(const TCHAR *name, BOOL refresh=TRUE)=0;
virtual int SaveToFile(const TCHAR *fname)=0;
virtual void FileSaveSelected(TCHAR *fname)=0;
virtual void FileSaveNodes(INodeTab* nodes, TCHAR *fname)=0;
virtual int LoadMaterialLib(const TCHAR *name, MtlBaseLib *lib=NULL)=0;
virtual int SaveMaterialLib(const TCHAR *name, MtlBaseLib *lib=NULL)=0;
virtual int MergeFromFile(const TCHAR *name,
BOOL mergeAll=FALSE, // when true, merge dialog is not put up
BOOL selMerged=FALSE, // select merged items?
BOOL refresh=TRUE, // refresh viewports ?
int dupAction = MERGE_DUPS_PROMPT, // what to do when duplicates are encountered
NameTab* mrgList=NULL // names to be merged (mergeAll must be TRUE)
)=0;
virtual BOOL ImportFromFile(const TCHAR *name, BOOL suppressPrompts=FALSE, Class_ID *importerID=NULL)=0;
virtual BOOL ExportToFile(const TCHAR *name, BOOL suppressPrompts=FALSE, DWORD options=0, Class_ID *exporterID=NULL)=0;
// Returns TRUE if this instance of MAX is in slave mode
virtual BOOL InSlaveMode()=0;
// Brings up the object color picker. Returns TRUE if the user
// picks a color and FALSE if the user cancels the dialog.
// If the user picks a color then 'col' will be set to the color.
virtual BOOL NodeColorPicker(HWND hWnd,DWORD &col)=0;
// The following gourping functions will operate on the table
// of nodes passed in or the current selection set if the table is NULL
// If name is NULL a dialog box will prompt the user to select a name.
// If sel group is TRUE, the group node will be selected after the operation completes.
// returns a pointer to the group node created.
virtual INode *GroupNodes(INodeTab *nodes=NULL,TSTR *name=NULL,BOOL selGroup=TRUE)=0;
virtual void UngroupNodes(INodeTab *nodes=NULL)=0;
virtual void ExplodeNodes(INodeTab *nodes=NULL)=0;
virtual void OpenGroup(INodeTab *nodes=NULL,BOOL clearSel=TRUE)=0;
virtual void CloseGroup(INodeTab *nodes=NULL,BOOL selGroup=TRUE)=0;
// Flashes nodes (to be used to indicate the completion of a pick operation, for example)
virtual void FlashNodes(INodeTab *nodes)=0;
// If a plug-in needs to do a PeekMessage() and wants to actually remove the
// message from the queue, it can use this method to have the message
// translated and dispatched.
virtual void TranslateAndDispatchMAXMessage(MSG &msg)=0;
// This will go into a PeekMessage loop until there are no more
// messages left. If this method returns FALSE then the user
// is attempting to quit MAX and the caller should return.
virtual BOOL CheckMAXMessages()=0;
// Access viewport background image settings.
virtual BOOL setBkgImageName(TCHAR *name)=0;
virtual TCHAR * getBkgImageName(void)=0;
virtual void setBkgImageAspect(int t)=0;
virtual int getBkgImageAspect()=0;
virtual void setBkgImageAnimate(BOOL onOff)=0;
virtual int getBkgImageAnimate(void)=0;
virtual void setBkgFrameRange(int start, int end, int step=1)=0;
virtual int getBkgFrameRangeVal(int which)=0;
virtual void setBkgORType(int which, int type)=0; // which=0 => before start, which=1 => after end
virtual int getBkgORType(int which)=0;
virtual void setBkgStartTime(TimeValue t)=0;
virtual TimeValue getBkgStartTime()=0;
virtual void setBkgSyncFrame(int f)=0;
virtual int getBkgSyncFrame()=0;
virtual int getBkgFrameNum(TimeValue t)=0;
// Gets the state of the real-time animation playback toggle.
virtual BOOL GetRealTimePlayback()=0;
virtual void SetRealTimePlayback(BOOL realTime)=0;
virtual BOOL GetPlayActiveOnly()=0;
virtual void SetPlayActiveOnly(BOOL playActive)=0;
virtual void StartAnimPlayback(int selOnly=FALSE)=0;
virtual void EndAnimPlayback()=0;
virtual BOOL IsAnimPlaying()=0;
virtual int GetPlaybackSpeed()=0;
virtual void SetPlaybackSpeed(int s)=0;
// The following APIs provide a simplistic method to call
// the renderer and render frames. The renderer just uses the
// current user specified parameters.
// Note that the renderer uses the width, height, and aspect
// of the specified bitmap so the caller can control the size
// of the rendered image rendered.
// Renderer must be opened before frames can be rendered.
// Either camNode or view must be non-NULL but not both.
//
// Returns the result of the open call on the current renderer.
// 0 is fail and 1 is succeed.
virtual int OpenCurRenderer(INode *camNode,ViewExp *view,RendType t = RENDTYPE_NORMAL, int w=0, int h=0)=0;
// optional way to specify the view when Opening the renderer.
virtual int OpenCurRenderer(ViewParams *vpar,RendType t = RENDTYPE_NORMAL, int w=0, int h=0)=0;
// The renderer must be closed when you are done with it.
virtual void CloseCurRenderer()=0;
// Renders a frame to the given bitmap.
// The RendProgressCallback is an optional callback (the base class is
// defined in render.h).
//
// Returns the result of the render call on the current renderer.
// 0 is fail and 1 is succeed.
virtual int CurRendererRenderFrame(TimeValue t,Bitmap *bm,RendProgressCallback *prog=NULL, float frameDur = 1.0f, ViewParams *vp=NULL, RECT *regionRect = NULL)=0;
// To get more control over the renderer, the renderer can
// be called dircetly. The following methods give access to
// the current renderer and the the user's current rendering settings.
// Retreives a pointer the renderer currently set to be the
// active renderer.
virtual Renderer *GetCurrentRenderer()=0;
virtual Renderer *GetProductionRenderer()=0;
virtual Renderer *GetDraftRenderer()=0;
virtual void AssignCurRenderer(Renderer *rend)=0;
virtual void AssignProductionRenderer(Renderer *rend)=0;
virtual void AssignDraftRenderer(Renderer *rend)=0;
virtual void SetUseDraftRenderer(BOOL b)=0;
virtual BOOL GetUseDraftRenderer()=0;
// Fills in a RendParams structure that can be passed to the
// renderer with the user's current rendering settings.
// A vpt pointer only needs to be passed in if the RendType
// is RENDTYPE_REGION or RENDTYPE_BLOWUP. In these cases it will
// set up the RendParams regxmin,regxmax,regymin,regymax from
// values stored in the viewport.
virtual void SetupRendParams(RendParams &rp, ViewExp *vpt, RendType t = RENDTYPE_NORMAL)=0;
// Call during render to check if user has cancelled render.
// Returns TRUE iff user has cancelled.
virtual BOOL CheckForRenderAbort()=0;
// These give access to individual user specified render parameters
// These are either parameters that the user specifies in the
// render dialog or the renderer page of the preferences dialog.
virtual int GetRendTimeType()=0;
virtual void SetRendTimeType(int type)=0;
virtual TimeValue GetRendStart()=0;
virtual void SetRendStart(TimeValue start)=0;
virtual TimeValue GetRendEnd()=0;
virtual void SetRendEnd(TimeValue end)=0;
virtual int GetRendNThFrame()=0;
virtual void SetRendNThFrame(int n)=0;
virtual BOOL GetRendShowVFB()=0;
virtual void SetRendShowVFB(BOOL onOff)=0;
virtual BOOL GetRendSaveFile()=0;
virtual void SetRendSaveFile(BOOL onOff)=0;
virtual BOOL GetRendUseDevice()=0;
virtual void SetRendUseDevice(BOOL onOff)=0;
virtual BOOL GetRendUseNet()=0;
virtual void SetRendUseNet(BOOL onOff)=0;
virtual BitmapInfo& GetRendFileBI()=0;
virtual BitmapInfo& GetRendDeviceBI()=0;
virtual int GetRendWidth()=0;
virtual void SetRendWidth(int w)=0;
virtual int GetRendHeight()=0;
virtual void SetRendHeight(int h)=0;
virtual float GetRendApect()=0;
virtual void SetRendAspect(float a)=0;
virtual float GetRendImageAspect()=0;
virtual float GetRendApertureWidth()=0; // get aperture width in mm.
virtual void SetRendApertureWidth(float aw)=0; // set aperture width in mm.
virtual BOOL GetRendFieldRender()=0;
virtual void SetRendFieldRender(BOOL onOff)=0;
virtual BOOL GetRendColorCheck()=0;
virtual void SetRendColorCheck(BOOL onOff)=0;
virtual BOOL GetRendSuperBlack()=0;
virtual void SetRendSuperBlack(BOOL onOff)=0;
virtual BOOL GetRendHidden()=0;
virtual void SetRendHidden(BOOL onOff)=0;
virtual BOOL GetRendForce2Side()=0;
virtual void SetRendForce2Side(BOOL onOff)=0;
virtual BOOL GetRendAtmosphere()=0;
virtual void SetRendAtmosphere(BOOL onOff)=0;
virtual BOOL GetRendEffects()=0;
virtual void SetRendEffects(BOOL onOff)=0;
virtual BOOL GetRendDisplacement()=0;
virtual void SetRendDisplacement(BOOL onOff)=0;
virtual TSTR& GetRendPickFramesString()=0;
virtual BOOL GetRendDitherTrue()=0;
virtual void SetRendDitherTrue(BOOL onOff)=0;
virtual BOOL GetRendDither256()=0;
virtual void SetRendDither256(BOOL onOff)=0;
virtual BOOL GetRendMultiThread()=0;
virtual void SetRendMultiThread(BOOL onOff)=0;
virtual BOOL GetRendNThSerial()=0;
virtual void SetRendNThSerial(BOOL onOff)=0;
virtual int GetRendVidCorrectMethod()=0; // 0->FLAG, 1->SCALE_LUMA 2->SCALE_SAT
virtual void SetRendVidCorrectMethod(int m)=0;
virtual int GetRendFieldOrder()=0; // 0->even, 1-> odd
virtual void SetRendFieldOrder(int fo)=0;
virtual int GetRendNTSC_PAL()=0; // 0 ->NTSC, 1 ->PAL
virtual void SetRendNTSC_PAL(int np)=0;
virtual int GetRendSuperBlackThresh()=0;
virtual void SetRendSuperBlackThresh(int sb)=0;
// virtual float GetRendMaxPixelSize()=0;
// virtual void SetRendMaxPixelSize(float s)=0;
virtual int GetRendFileNumberBase()=0;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -