Download presentation
Presentation is loading. Please wait.
Published bySuzan Harmon Modified over 9 years ago
1
© 2012 Autodesk CP2177 - Autodesk® 3ds Max®.NET API Introduction and Techniques Kevin Vandecar Principal Developer Consulting Engineer – M&E Autodesk Developer Network
2
© 2012 Autodesk bio: Kevin Vandecar @ Autodesk for over 18 years all customization related Experience with AutoCAD, AutoCAD Architecture, Revit Five years as Software Engineer on AutoCAD Architecture API and Revit API 18 months focusing on 3ds Max customization in ADN M&E Workgroup Based in Manchester, New Hampshire, US email: kevin.vandecar@autodesk.comkevin.vandecar@autodesk.com
3
© 2012 Autodesk Class Summary Last year, with the release of the Autodesk® Subscription Advantage Pack for Autodesk 3ds Max 2012,.NET users gained access to significant enhancements in the Autodesk 3ds Max.NET SDK, enabling them to do more with Autodesk 3ds Max 2012 software. Now, these.NET APIs are available in the main product. In this class, we will introduce you to.NET API programming in 3ds Max. We will present using the C# language, but the techniques can apply to any.NET programming language, including Microsoft® Visual Basic®. We will cover how to create an assembly that will load into the 3ds Max environment. We will show how to interface with other.NET Framework features that will include the Windows Presentation Foundation (WPF) and other features such as LINQ functionality. This class will be organized for those who want an introduction to these new APIs, including practical techniques. You do not need to know 3ds Max programming, but some general programming experience will be helpful.
4
© 2012 Autodesk Learning Objectives At the end of this class, you will be able to: Create a.NET assembly compatible with 3ds Max Use.NET API to solve common tasks through automation and customization Create WPF style UI within 3ds Max using.NET API Manipulate 3ds Max geometry using.NET API
5
© 2012 Autodesk Autodesk Developer Network ADN Open Blogs, Events, and other free education and support - develop3dsmaxdevelop3dsmax ADN Membership Access to almost all Autodesk software and SDK’s Includes early access to beta software Members-only website with thousands of technical articles Unlimited technical support Product direction through conferences Marketing benefits Exposure on autodesk.com Promotional opportunities One to three free API training classes www.autodesk.com/joinadn
6
© 2012 Autodesk Microsoft.NET Framework
7
© 2012 Autodesk What is.NET? Software architecture framework from Microsoft Windows Phone 7 Azure Programs execute in CLR Programs are “managed” Memory Management via Garbage Collection provided C++/CLI Iron Python C# VB.NET Visual StudioCommon Language Specification
8
© 2012 Autodesk What is.NET? Power of C++ with simplicity of scripting Uses Simple Referencing Language choices using same APIs Reflection
9
© 2012 Autodesk What is.NET? Many modern Foundation Technologies Windows Communication Foundation (WCF) (ASP.NET, Azure, etc.) Windows Presentation Foundation (WPF) (UI Data Binding, Silverlight, View Model, etc.) Windows Workflow Foundation (WF) Other Autodesk Products AutoCAD Revit Inventor
10
© 2012 Autodesk 3ds Max.NET API
11
© 2012 Autodesk 3ds Max.NET API .NET API capability has been part of the 3ds Max SDK for a number of years now, but mainly UI oriented Supported through MAXScript C++/CLI allows mixed-mode functionality New “Enhanced” version introduced in 2012 Subscription Advantage Pack This “enhanced” version is a new assembly called Autodesk.Max.dll A 1-to-1 wrapper of the native C++ APIs
12
© 2012 Autodesk Getting Started - Learning The online Help for 3ds Max SDK now contains two distinct topics to help get started 3ds Max.NET SDK 3ds Max.NET SDK describes the.NET SDK components Lesson 7: Writing.NET Plug-ins Lesson 7: Writing.NET Plug-ins part of the new learning path documentation For 2012 SAP See Christopher Diggin’s blog post http://area.autodesk.com/blogs/chris/net_sdk_enhancements_in_the_3ds_ma x_2012_subscription_advantage_pack http://area.autodesk.com/blogs/chris/net_sdk_enhancements_in_the_3ds_ma x_2012_subscription_advantage_pack
13
© 2012 Autodesk Getting Started - Learning For the Wrapper Assembly – Autodesk.Max.dll Use the C++ Reference and Programmers guide as main form of documentation. Keep in mind it is version ‘1’ Use an assembly browser Object Browser, ILSpy, Reflector, etc. Make sure to use all the assemblies as necessary Some provide the same support
14
© 2012 Autodesk Assemblies 2012 - Assemblies: Autodesk.Max.dll AssemblyLoader.dll CSharpUtilities.dll ExplorerFramework.dll ManagedServices.dll MaxCustomControls.dll SceneExplorer.dll 2013 - Assemblies: Autodesk.Max.dll AssemblyLoader.dll CSharpUtilities.dll ExplorerFramework.dll ManagedServices.dll MaxCustomControls.dll SceneExplorer.dll UiViewModels.dll
15
© 2012 Autodesk Assemblies Autodesk.Max.dll The “enhanced functionality” Autodesk.Max is the root namespace Use the IGlobal Interface, and Interface14 Functions with zero arguments and name begin with “Get” are mapped to properties IGlobal contains Create method for types that can be instanced Class IDs are required to identify object types.
16
© 2012 Autodesk Assemblies UiViewModels.dll Contains the Cui functionality Cui for 2012 was in MaxCustomControls.dll AssemblyLoader.dll Contains the Loader class Has default loader entry point Allows loading other assemblies from another location
17
© 2012 Autodesk Assemblies CSharpUtilities.dll ManagedServices.dll MaxCustomControls.dll Each contains various utilities Worth exploring when needing 3ds Max utilities Windows handling Etc.
18
© 2012 Autodesk Assemblies ExplorerFramework.dll Abstract explorer framework classes upon which the Scene Explorer is built. It can be used for creating a new node traversal for arbitrary scene explorers SceneExplorer.dll Specification of the ExplorerFramework components for the SceneExplorer with bindings to 3ds Max data demo
19
© 2012 Autodesk Creating a Project demo
20
© 2012 Autodesk Two ways to be loaded/run Cui Action facility Easily hook into the UI using the Action system and Customize User Interface UiViewModel.dll Assembly Loader Allows loading and operations similar to the C++ Global Utility Plug-in (GUP) AssemblyLoader.dll
21
© 2012 Autodesk Using Cui Action system 1. Derive from CuiActionCommandAdapter, or implement the ICuiActionCommand interface class 2012: MaxCustomControls assembly 2013: UiViewModels assembly 2. Implement the necessary functions Mostly strings to identify the action to 3ds Max Implement Execute to run the code demo
22
© 2012 Autodesk Using the new Autodesk.Max.dll wrapper functionality Contains the entire C++ SDK as “crude”.NET wrappers Autodesk.Max is the root namespace Use the IGlobal Interface, and IInterface14
23
© 2012 Autodesk Using the new Autodesk.Max.dll wrapper functionality Functions with zero arguments and name begin with “Get” are mapped to properties IGlobal contains Create method for types that can be instanced Class IDs are required to identify object types Make sure to use IInterface.CreateInterface for constructing new instances of typical objects Not IGlobal.CreatInstance
24
© 2012 Autodesk What can you do? Automate tasks Interop with MAXScript Interop via C++/CLI to full SDK plugin Create nice UI elements WPF Use other.NET API components Lync
25
© 2012 Autodesk What to avoid
26
© 2012 Autodesk Tips/Tricks When using CuiActionCommandAdapter make a custom abstract base class category and other requirements implemented with defaults derive from it, and simply implement Execute() and ActionText() and any other overrides you want demo
27
© 2012 Autodesk Tips/Tricks Use VS tools Implement abstract, etc, Use Object Browser Error check: Try and Catch exceptions! Check return values! Mix assembly functionality where appropriate ManagedServices CSharpUtilities
28
Some Examples
29
3ds Max Customization Resources Autodesk AREA http://area.autodesk.com/ http://area.autodesk.com/ http://www.gamedev.net http://www.gamedev.net http://www.cgsociety.org http://www.cgsociety.org http://code.google.com/p/3ds-max-dev/ http://code.google.com/p/3ds-max-dev/ Autodesk 3ds Max Developer Center www.autodesk.com/develop3dsmax www.autodesk.com/develop3dsmax Autodesk Developer Network www.autodesk.com/joinadn www.autodesk.com/joinadn
30
Q&A Feel free to contact me later: kevin.vandecar@autodesk.com Thank You!
31
© 2012 Autodesk Autodesk, AutoCAD* [*if/when mentioned in the pertinent material, followed by an alphabetical list of all other trademarks mentioned in the material] are registered trademarks or trademarks of Autodesk, Inc., and/or its subsidiaries and/or affiliates in the USA and/or other countries. All other brand names, product names, or trademarks belong to their respective holders. Autodesk reserves the right to alter product and services offerings, and specifications and pricing at any time without notice, and is not responsible for typographical or graphical errors that may appear in this document. © 2012 Autodesk, Inc. All rights reserved.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.