Well, it's been a while since last posting, but trying to do more. Recently someone asked about the .NET API for recent versions of 3ds Max. There has really been no big changes for a few releases except moving from ParamBlock1 to ParamBlock2 for some of the older geometry objects and modifiers. .NET API, plus WPF, etc. still work OK, even though the main 3ds Max UI is moving to Qt. To demonstrate, I updated the samples I provided back in 2014 release to work with 2018. These are the things I changed to get everything working well again:
- Update the csproj variables to use the 3ds Max values (Currently: $(ADSK_3DSMAX_x64_2018)). Note the original project used: $(ADSK_MAXDES_x64_2014), but 3ds Max Design as not been available for several releases now, and is combined with 3ds Max as a workspace. That makes it easier to handle 3ds Max plugin projects! The variable changes are for the assembly references, and also for the Post-Build event command line, that provides the copy operation.
- The .NET Target framework should move to at least 4.6 to match the version 3ds Max itself is using.
- In the code, there was one place where we fixed a defect in Autodesk.Max.dll. Line #119 of HelixControl.xaml.cs was using the (IntPtr) cast for the IINodeTab value. We fixed that API to properly use an integer index, so the cast is no longer required.
- Updated a screen bitmap for the CreateTeapotUserControl
- Fixed the teapot creation in CreateTeapotUserControl... turns out it was updated with the move to ParamBlock2. Added a comment to show this.
- Added a tiny error check for the "05 - Create Face Objects" routine to ensure the user picks something before continuing.
Overall, pretty minor changes...I have attached the updated sample here: AdnCuiSamples_BlogV2018.