Skip to content

Commit db4dea4

Browse files
authored
Merge pull request #580 from elpie89/flatten_hierarchy
flatten hierarchies feature implemented trough hold/fetch logic
2 parents 2670a06 + bfdd75e commit db4dea4

23 files changed

+1471
-2856
lines changed

3ds Max/Max2Babylon/2015/Max2Babylon2015.csproj

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@
7070
<Reference Include="GDImageLibrary">
7171
<HintPath>..\..\Refs\GDImageLibrary.dll</HintPath>
7272
</Reference>
73+
<Reference Include="ManagedServices">
74+
<HintPath>Refs\ManagedServices.dll</HintPath>
75+
</Reference>
7376
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
7477
<HintPath>..\..\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
7578
</Reference>
@@ -117,6 +120,9 @@
117120
<Compile Include="..\BabylonSaveAnimationToContainers.cs">
118121
<Link>BabylonSaveAnimationToContainers.cs</Link>
119122
</Compile>
123+
<Compile Include="..\BabylonSkipFlatten.cs">
124+
<Link>BabylonSkipFlatten.cs</Link>
125+
</Compile>
120126
<Compile Include="..\Descriptor.cs">
121127
<Link>Descriptor.cs</Link>
122128
</Compile>
@@ -254,6 +260,12 @@
254260
<Compile Include="..\MaxScriptManager.cs">
255261
<Link>MaxScriptManager.cs</Link>
256262
</Compile>
263+
<Compile Include="..\Tools\MeshUtlities.cs">
264+
<Link>Tools\MeshUtlities.cs</Link>
265+
</Compile>
266+
<Compile Include="..\Tools\ScriptsUtilities.cs">
267+
<Link>Tools\ScriptsUtilities.cs</Link>
268+
</Compile>
257269
<Compile Include="..\Tools\Tools.cs">
258270
<Link>Tools\Tools.cs</Link>
259271
</Compile>
@@ -278,6 +290,7 @@
278290
</ItemGroup>
279291
<ItemGroup>
280292
<Content Include="Refs\Autodesk.Max.dll" />
293+
<Content Include="Refs\ManagedServices.dll" />
281294
<None Include="Resources\MaxExporter.png" />
282295
</ItemGroup>
283296
<ItemGroup>
328 KB
Binary file not shown.

3ds Max/Max2Babylon/2017/Max2Babylon2017.csproj

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@
7070
<Reference Include="GDImageLibrary">
7171
<HintPath>..\..\Refs\GDImageLibrary.dll</HintPath>
7272
</Reference>
73+
<Reference Include="ManagedServices, Version=0.0.0.0, Culture=neutral, processorArchitecture=AMD64">
74+
<SpecificVersion>False</SpecificVersion>
75+
<HintPath>Refs\ManagedServices.dll</HintPath>
76+
</Reference>
7377
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
7478
<HintPath>..\..\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
7579
</Reference>
@@ -117,6 +121,9 @@
117121
<Compile Include="..\BabylonSaveAnimationToContainers.cs">
118122
<Link>BabylonSaveAnimationToContainers.cs</Link>
119123
</Compile>
124+
<Compile Include="..\BabylonSkipFlatten.cs">
125+
<Link>BabylonSkipFlatten.cs</Link>
126+
</Compile>
120127
<Compile Include="..\Descriptor.cs">
121128
<Link>Descriptor.cs</Link>
122129
</Compile>
@@ -254,6 +261,12 @@
254261
<Compile Include="..\MaxScriptManager.cs">
255262
<Link>MaxScriptManager.cs</Link>
256263
</Compile>
264+
<Compile Include="..\Tools\MeshUtlities.cs">
265+
<Link>Tools\MeshUtlities.cs</Link>
266+
</Compile>
267+
<Compile Include="..\Tools\ScriptsUtilities.cs">
268+
<Link>Tools\ScriptsUtilities.cs</Link>
269+
</Compile>
257270
<Compile Include="..\Tools\Tools.cs">
258271
<Link>Tools\Tools.cs</Link>
259272
</Compile>
@@ -278,6 +291,7 @@
278291
</ItemGroup>
279292
<ItemGroup>
280293
<Content Include="Refs\Autodesk.Max.dll" />
294+
<Content Include="Refs\ManagedServices.dll" />
281295
<None Include="Resources\MaxExporter.png" />
282296
</ItemGroup>
283297
<ItemGroup>
328 KB
Binary file not shown.

3ds Max/Max2Babylon/2018/Max2Babylon2018.csproj

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@
7070
<Reference Include="GDImageLibrary">
7171
<HintPath>..\..\Refs\GDImageLibrary.dll</HintPath>
7272
</Reference>
73+
<Reference Include="ManagedServices">
74+
<HintPath>Refs\ManagedServices.dll</HintPath>
75+
</Reference>
7376
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
7477
<HintPath>..\..\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
7578
</Reference>
@@ -117,6 +120,9 @@
117120
<Compile Include="..\BabylonSaveAnimationToContainers.cs">
118121
<Link>BabylonSaveAnimationToContainers.cs</Link>
119122
</Compile>
123+
<Compile Include="..\BabylonSkipFlatten.cs">
124+
<Link>BabylonSkipFlatten.cs</Link>
125+
</Compile>
120126
<Compile Include="..\Descriptor.cs">
121127
<Link>Descriptor.cs</Link>
122128
</Compile>
@@ -254,6 +260,12 @@
254260
<Compile Include="..\MaxScriptManager.cs">
255261
<Link>MaxScriptManager.cs</Link>
256262
</Compile>
263+
<Compile Include="..\Tools\MeshUtlities.cs">
264+
<Link>Tools\MeshUtlities.cs</Link>
265+
</Compile>
266+
<Compile Include="..\Tools\ScriptsUtilities.cs">
267+
<Link>Tools\ScriptsUtilities.cs</Link>
268+
</Compile>
257269
<Compile Include="..\Tools\Tools.cs">
258270
<Link>Tools\Tools.cs</Link>
259271
</Compile>
328 KB
Binary file not shown.

3ds Max/Max2Babylon/2019/Max2Babylon2019.csproj

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@
7070
<Reference Include="GDImageLibrary">
7171
<HintPath>..\..\Refs\GDImageLibrary.dll</HintPath>
7272
</Reference>
73+
<Reference Include="ManagedServices">
74+
<HintPath>Refs\ManagedServices.dll</HintPath>
75+
</Reference>
7376
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
7477
<HintPath>..\..\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
7578
</Reference>
@@ -117,6 +120,9 @@
117120
<Compile Include="..\BabylonSaveAnimationToContainers.cs">
118121
<Link>BabylonSaveAnimationToContainers.cs</Link>
119122
</Compile>
123+
<Compile Include="..\BabylonSkipFlatten.cs">
124+
<Link>BabylonSkipFlatten.cs</Link>
125+
</Compile>
120126
<Compile Include="..\Descriptor.cs">
121127
<Link>Descriptor.cs</Link>
122128
</Compile>
@@ -254,6 +260,12 @@
254260
<Compile Include="..\MaxScriptManager.cs">
255261
<Link>MaxScriptManager.cs</Link>
256262
</Compile>
263+
<Compile Include="..\Tools\MeshUtlities.cs">
264+
<Link>Tools\MeshUtlities.cs</Link>
265+
</Compile>
266+
<Compile Include="..\Tools\ScriptsUtilities.cs">
267+
<Link>Tools\ScriptsUtilities.cs</Link>
268+
</Compile>
257269
<Compile Include="..\Tools\Tools.cs">
258270
<Link>Tools\Tools.cs</Link>
259271
</Compile>
@@ -328,7 +340,6 @@
328340
<ItemGroup>
329341
<None Include="packages.config" />
330342
</ItemGroup>
331-
<ItemGroup />
332343
<ItemGroup>
333344
<Content Include="Refs\Autodesk.Max.dll" />
334345
<None Include="Resources\MaxExporter.png" />
335 KB
Binary file not shown.
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
using System.Windows.Forms;
2+
using Autodesk.Max;
3+
using ActionItem = Autodesk.Max.Plugins.ActionItem;
4+
5+
namespace Max2Babylon
6+
{
7+
class BabylonSkipFlattenToggle:ActionItem
8+
{
9+
10+
public override bool ExecuteAction()
11+
{
12+
IINode sel = Loader.Core.GetSelNode(0);
13+
if (sel == null) return true;
14+
15+
bool doNotFlatten = sel.IsMarkedAsNotFlattenable();
16+
sel.SetUserPropBool("babylonjs_DoNotFlatten", !doNotFlatten);
17+
return true;
18+
}
19+
20+
public void Close()
21+
{
22+
return;
23+
}
24+
25+
public override int Id_
26+
{
27+
get { return 1; }
28+
}
29+
30+
public override string ButtonText
31+
{
32+
get { return "Babylon Toggle Skip Flatten Status"; }
33+
}
34+
35+
public override string MenuText
36+
{
37+
get
38+
{
39+
IINode sel = Loader.Core.GetSelNode(0);
40+
if (sel == null)
41+
{
42+
return "&Node Flattening - Disabled";
43+
}
44+
45+
if (!sel.IsMarkedAsNotFlattenable())
46+
{
47+
return "&Node Flattening - Disabled";
48+
}
49+
50+
return "&Node Flattening - Enabled";
51+
}
52+
}
53+
54+
public override string DescriptionText
55+
{
56+
get { return "Toggle skip flatten status"; }
57+
}
58+
59+
public override string CategoryText
60+
{
61+
get { return "Babylon"; }
62+
}
63+
64+
public override bool IsChecked_
65+
{
66+
get { return false; }
67+
}
68+
69+
public override bool IsItemVisible
70+
{
71+
get { return true; }
72+
}
73+
74+
public override bool IsEnabled_
75+
{
76+
get { return true; }
77+
}
78+
}
79+
80+
}

3ds Max/Max2Babylon/Exporter/BabylonExporter.IMaterialExporter.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
using Autodesk.Max;
55
using Babylon2GLTF;
66
using BabylonExport.Entities;
7-
using GLTFExport.Entities;
8-
using Utilities;
9-
7+
using GLTFExport.Entities;
8+
using Utilities;
9+
1010
namespace Max2Babylon
1111
{
1212
public interface IMaxMaterialExporter
@@ -81,7 +81,7 @@ public struct ClassIDWrapper : IEquatable<ClassIDWrapper>
8181
public static readonly ClassIDWrapper Switch_Shader_Material = new ClassIDWrapper(0x7e73161f, 0xa844c228);
8282
public static readonly ClassIDWrapper Two_Sided_Material = new ClassIDWrapper(0x7e73161f, 0x7ffd6281);
8383

84-
84+
public static readonly ClassIDWrapper Editable_Poly = new ClassIDWrapper(469250957, 422535320);
8585

8686
private uint partA, partB;
8787
public ClassIDWrapper(IClass_ID classID) { partA = classID.PartA; partB = classID.PartB; }

0 commit comments

Comments
 (0)