How to write a controller?( SDK Background)

來源:互聯網
上載者:User
Executing 3ds Max and Your Plugin

There are several ways to cause execution to halt at a specific spot in your code. One is to set a breakpoint at the spot. This is done by placing the cursor on the line where you want execution to stop and pressing F9. Then, to run the debugger, simply press F5. This will launch 3ds Max and get things going. Max will run and load your plugin as usual upon startup. Begin execution of your plugin as you normally would inside Max (for example, if your plugin is a modifier apply it to an object). When execution of your plugin's code reaches the breakpoint, control will return to VC++ and you may use its tool to examine the state of things (see the section below for more details). 

A second way to reach a certain line in your code is to use 'Run to Cursor' option. This is chosen by placing the cursor on the desired line of your source file and selecting Build/Start Debug/Run to Cursor (or by pressing Ctrl+F10). This will begin execution and stop when the point in your source code where the cursor sits. 

Once execution is stopped, you can begin again by pressing F5, or pressing F11 to step to the next line of source or into the next function or method. Note that if you attempt to step into Max's code (not your own) you'll wind up with a window showing the disassembly of the source (since no debugging information is available for Max's internal code.) If this happens you can simply close this window and set another breakpoint inside your own code.

略譯:F9設定斷點 ;Ctrl+F10+Cursor的位置表示程式運行到游標所在的位置 ;F5 偵錯工具;Ctrl+F5 運行程式;F11單步調試。

 

The DebugPrint() Function

The function DebugPrint() may be used to send information to the Debug window in Visual Studio. This is handy for outputting debug information, as it only appears while debugging. This window is scrollable so a developer can print a lot of information to it, then go back to look it over. The format string works like the standard C printf() function.

void DebugPrint(const TCHAR *format, ...);

For more information on debugging see the topic on debugging.

略譯:DebugPrint 相當於OutdebugStr就是在Visual Studio的debug視窗裡顯示調試的資訊,max用DebugPrint進行一些調試。

 

The Way Max Operates Max和外掛程式的運作

 

In this section we look at certain fundamental aspects in which Max behaves. This discussion is not controller specific and is valid for most other Max features. We introduce the idea of plugins and the way they are integrated into the Max architecture. The plugins form a cornerstone of the Max architecture and the way they interact with the core of Max and with each other makes the architecture efficient and expandable with third-party contributions. We touch upon the reference architecture in this context. We also discuss about a few other essential Max components – the parametric nature of Max objects, the object nodes, the sense of time and interval and finally, some UI issues.

 

本節我們將看到一些Max和外掛程式運作的重要特色。本次討論並不是只面向控制器,對其他max的特色也很有用的。我們講述外掛程式的思想以及其怎樣整合到max的架構裡。這些外掛程式是max架構的基石,並且它們與max的核心部分的巧妙運用。也正是這巧妙運用,讓Max很高效和對第三方外掛程式有很高的擴充性。我們將講述reference 架構,並且討論一些其他的max的主要部分:Max物體的參數特性,物體節點,時間,間隔以及最後一些使用者介面的問題。

 

What Are the Plugins?

Max can be thought of as an operating system for 3D graphics. What a user is doing when running Max, for the most part, is using plugins. Almost all areas of Max are open to developers, and the Max programmers use the same SDK and tools as third-party developers. 

Instances of the plugin classes developer create are called Objects. The way that they can be built independent of one another, yet work together to function as an system, is what makes the Max plugin architecture so powerful. The biggest impact this object oriented design has on developers is that one can develop plugins independently, without having to know or worry about how the other plugins are going about their tasks. Developers do have to understand the Max Reference Architecture, however. The Reference Architecture (discussed later in this topic) is the system that allows all the plugins to communicate.

All of the following areas of Max are implemented as plugins: shapes and splines, patch objects, particle systems, modifiers, space warps, lights, cameras, bitmaps, texture maps, materials, image filters and compositors, animation controllers, file import/export utilities, atmospheric effects, renderers, and sound support.

For a list of all the plugin types that can be developed with the SDK see the section on choosing a plugin type in the getting started section.

This section describes the type of executable used for Max plugins and the tools used to create them.

Plugins for Max are developed with Microsoft Visual C++. plugins are implemented as Windows Dynamic Link Libraries (DLLs). A dynamic-link library (DLL) is an executable file that acts as a shared library of functions. Dynamic linking provides a way for a process to call a function that is not part of its executable code. The executable code for the function is located in a DLL, which contains one or more functions that are compiled, linked, and stored separately from the processes that use them.

 

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.