Skip to content

Commit

Permalink
Add support for 3ds Max 2023
Browse files Browse the repository at this point in the history
  • Loading branch information
pudingus committed Mar 27, 2022
1 parent cf522d9 commit 15aaca9
Show file tree
Hide file tree
Showing 5 changed files with 207 additions and 3 deletions.
76 changes: 76 additions & 0 deletions plugins/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# nspec

This plugin exposes functions for MAXScript for modifying explicit normals. It exposes 'nspec' class and 'inspec' interface and it's functions
```
<int> GetNumNormals <Mesh>
<int> GetNumFaces <Mesh>
<point3> GetNormal <Mesh> <int normalId>
<int> GetNormalId <Mesh> <int face> <int corner>
<bool> SetNumNormals <Mesh> <int>
<bool> SetNumFaces <Mesh> <int>
SetNormal <Mesh> <int normalId> <point3 normal>
SetNormalId <Mesh> <int face> <int corner> <int normalId>
SetNormalExplicit <Mesh> <int normalId> <bool explicit>
<bool> GetNormalExplicit <Mesh> <int normalId>
```
Sample usage:
```
nspec.getnormal $.mesh 14
```
or
```
nspec.inspec.getnormal $.mesh 14
```

This is how I came up with the name 'nspec'...
I use a class called MeshNormalSpec from the SDK, so MeshNormalSpec -> NormalSpec -> nspec

## Requirements

This plugin requires Autodesk 3ds Max SDK and the SDK's dependencies

https://www.autodesk.com/developer-network/platform-technologies/3ds-max#3dsmax-sdk

The SDK also comes with the 3ds Max installer.

**nspec_2014**
MSVC v100 (2010)
3ds Max 2014 SDK

**nspec_2015**
MSVC v110 (2012)
3ds Max 2015 SDK

**nspec_2017**
MSVC v140 (2015)
3ds Max 2017 SDK

**nspec_2018**
MSVC v140 (2015)
Windows SDK 10.0.10586
3ds Max 2018 SDK

**nspec_2019**
MSVC v140 (2015)
Windows SDK 10.0.10586
3ds Max 2019 SDK

**nspec_2020**
MSVC v141 (2017)
Windows SDK 10.0.17134.0
3ds Max 2020 SDK

**nspec_2022**
MSVC v141 (2017)
Windows SDK 10.0.17134.0
3ds Max 2022 SDK

**nspec_2023**
MSVC v142 (2019)
Windows SDK 10.0.19041.0
3ds Max 2023 SDK

## Building
- Open 'nspec.sln' in Visual Studio
- Set the configuration to 'Release'
- Build
12 changes: 10 additions & 2 deletions plugins/nspec.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.31019.35
# Visual Studio Version 17
VisualStudioVersion = 17.1.32319.34
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nspec_2022", "nspec\nspec_2022.vcxproj", "{E614241F-075D-4EAD-B95F-2D40B9A7C168}"
EndProject
Expand All @@ -17,6 +17,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nspec_2015", "nspec\nspec_2
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nspec_2014", "nspec\nspec_2014.vcxproj", "{F3DB68C2-EC68-45E0-BC6F-41D1C0039A94}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nspec_2023", "nspec\nspec_2023.vcxproj", "{DD41347B-D5A8-4709-B984-19F68E295C1D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Expand Down Expand Up @@ -66,6 +68,12 @@ Global
{F3DB68C2-EC68-45E0-BC6F-41D1C0039A94}.Hybrid|x64.Build.0 = Hybrid|x64
{F3DB68C2-EC68-45E0-BC6F-41D1C0039A94}.Release|x64.ActiveCfg = Release|x64
{F3DB68C2-EC68-45E0-BC6F-41D1C0039A94}.Release|x64.Build.0 = Release|x64
{DD41347B-D5A8-4709-B984-19F68E295C1D}.Debug|x64.ActiveCfg = Debug|x64
{DD41347B-D5A8-4709-B984-19F68E295C1D}.Debug|x64.Build.0 = Debug|x64
{DD41347B-D5A8-4709-B984-19F68E295C1D}.Hybrid|x64.ActiveCfg = Hybrid|x64
{DD41347B-D5A8-4709-B984-19F68E295C1D}.Hybrid|x64.Build.0 = Hybrid|x64
{DD41347B-D5A8-4709-B984-19F68E295C1D}.Release|x64.ActiveCfg = Release|x64
{DD41347B-D5A8-4709-B984-19F68E295C1D}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
71 changes: 71 additions & 0 deletions plugins/nspec/nspec_2023.vcxproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Hybrid|x64">
<Configuration>Hybrid</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectName>nspec_2023</ProjectName>
<ProjectGuid>{DD41347B-D5A8-4709-B984-19F68E295C1D}</ProjectGuid>
<ConfigurationType>DynamicLibrary</ConfigurationType>
<MaxSDK>$(ADSK_3DSMAX_SDK_2023)</MaxSDK>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<Import Project="$(MaxSDK)\ProjectSettings\PropertySheets\3dsmax.general.project.settings.props" />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="PropertySheets">
<Import Project="$(MaxSDK)\ProjectSettings\PropertySheets\3dsmax.cpp.props" />
</ImportGroup>
<PropertyGroup>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
<OutDir>$(ProjectDir)\bin\$(Configuration)_$(Platform)\2023\</OutDir>
<IntDir>$(ProjectDir)\obj\$(Configuration)_$(Platform)\2023\</IntDir>
<TargetName>nspec</TargetName>
<TargetExt>.gup</TargetExt>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<WholeProgramOptimization>false</WholeProgramOptimization>
<PreprocessorDefinitions>_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(MaxSdkInc);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<WarningLevel>Level4</WarningLevel>
<DebugInformationFormat Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">EditAndContinue</DebugInformationFormat>
</ClCompile>
<Link>
<AdditionalLibraryDirectories>$(MaxSdkLib);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>bmm.lib;core.lib;geom.lib;gfx.lib;mesh.lib;maxutil.lib;maxscrpt.lib;gup.lib;paramblk2.lib;;%(AdditionalDependencies)</AdditionalDependencies>
<ModuleDefinitionFile>nspec.def</ModuleDefinitionFile>
<GenerateDebugInformation Condition="'$(Configuration)'=='Release'">false</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="nspec.cpp" />
<ClCompile Include="DllEntry.cpp" />
<ClCompile Include="util.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="resource.h" />
<ClInclude Include="util.h" />
<ClInclude Include="nspec.h" />
</ItemGroup>
<ItemGroup>
<None Include="nspec.def" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="nspec.rc" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
</Project>
49 changes: 49 additions & 0 deletions plugins/nspec/nspec_2023.vcxproj.filters
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{fbad0f2d-faaa-4b0b-865c-583fac8ddcb1}</UniqueIdentifier>
<Extensions>cpp;c;cxx;rc;def;r;odl;idl;hpj;bat</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{92f20462-242f-4a0c-883e-b3c33819b84b}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{ad6e765e-4300-41dc-b185-05b019286785}</UniqueIdentifier>
<Extensions>ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="DllEntry.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="util.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="nspec.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="util.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="nspec.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="resource.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="nspec.def">
<Filter>Source Files</Filter>
</None>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="nspec.rc">
<Filter>Source Files</Filter>
</ResourceCompile>
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion scripts/max4ds/init.ms
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
local set_heapsize = 64 * 1024 * 1024 --64 MiB
if heapsize < set_heapsize then heapsize = set_heapsize

global Max4ds_version = "v0.8.3"
global Max4ds_version = "v0.8.4"
--global Max4ds_scriptsPath = getFilenamePath (getThisScriptFilename())

fn DisableScript file = (
Expand Down

0 comments on commit 15aaca9

Please sign in to comment.