Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Asset] Unified 3D asset importer (on behalf of Noa7/Noah7071) #2163

Merged
merged 88 commits into from
Apr 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
ed0e939
BASE COMM
noa7 Jan 30, 2024
a3f044a
Updates on Shader and resource marshaling
noa7 Jan 30, 2024
8a3c13f
Update- cleanup
noa7 Jan 31, 2024
a679906
Updates- clean up
noa7 Jan 31, 2024
afe10c0
Updates
noa7 Jan 31, 2024
0a516fd
Updates as by Eidren & IXLLEGACYIXL on Github PR review
noa7707 Feb 1, 2024
6649b09
Update shader- remove commented test code
Noah7071 Feb 1, 2024
6ed75b6
Update: Clean up to effect class & shader
Noah7071 Feb 1, 2024
5db94d9
Scale Factor moved to Importer
Noah7071 Feb 1, 2024
c04c84d
Removed extra class Vec4
Noah7071 Feb 1, 2024
e66c0c8
Fix to update scale factor in impoter
Noah7071 Feb 1, 2024
36c3daf
Normal fix on blendshapes
Noah7071 Feb 7, 2024
06c130b
Normal fix
Noah7071 Feb 7, 2024
1751b13
IMPORTER CKECIIN
Noah7071 Feb 18, 2024
af97e33
Importer
Noah7071 Feb 20, 2024
b479aac
Incorporating Kryptos feedback on PR
Noah7071 Feb 20, 2024
f492fc5
Incorporating doprez feedback
Noah7071 Feb 20, 2024
52bb440
Updated .props to remove Assimp from Runtime refs
Noah7071 Feb 21, 2024
67fe225
Feedback from Jklawreszuk
Noah7071 Feb 21, 2024
396b3e3
Removed workspace file, Jklawreszuk
Noah7071 Feb 21, 2024
d8bed82
Feedback from IXLLEGACYIXL
Noah7071 Feb 21, 2024
7cbd671
Account for default scaling
Noah7071 Feb 21, 2024
3e63b07
Removed Assimp feedback Wolffy101
Noah7071 Feb 21, 2024
3374082
Multiple Animation
Noah7071 Feb 22, 2024
15b1791
Removed test leftover code
Noah7071 Feb 22, 2024
6a292b4
UI update to give option to(or not to) import animatioms
Noah7071 Feb 22, 2024
ba707a8
Feedback empty spaces @Kryptos
Noah7071 Feb 22, 2024
167112b
BlendShape+Importer
Noah7071 Mar 1, 2024
87cd7cd
PR Feedback
Noah7071 Mar 2, 2024
0de8d50
PR Feedback
Noah7071 Mar 2, 2024
0f9c79e
Blendshape
Noah7071 Mar 2, 2024
6c0d92a
Root check
Noah7071 Mar 7, 2024
0bcefd5
Feed back implementation
Noah7071 Mar 12, 2024
89f4da8
Feedback implementation @Eideren
Noah7071 Mar 12, 2024
828fe32
Feedback implementation @Eideren
Noah7071 Mar 12, 2024
d818cca
Feedback incorporated @Eideren
Noah7071 Mar 12, 2024
5f9687c
Animationscale @Eideren
Noah7071 Mar 12, 2024
03aca2a
Anim root data
Noah7071 Mar 13, 2024
8749776
Animation Update
Noah7071 Mar 29, 2024
c0d5251
Update aling the file to latest
Noah7071 Mar 29, 2024
b427dfb
logging feeback
Noah7071 Mar 29, 2024
0c959e6
Removed blendshape code of importer
Noah7071 Mar 29, 2024
25db355
Removed blendshape code
Noah7071 Mar 29, 2024
e2a0d18
Fix for pipe "|" character in name
Noah7071 Mar 30, 2024
4721401
Invalid chars replace to _
Noah7071 Mar 30, 2024
fb36cf4
Invalid char fix
Noah7071 Mar 30, 2024
10ceeb6
Handling invalid char
Noah7071 Mar 30, 2024
0b8fbbb
Remove data field contains blend shape
Noah7071 Mar 31, 2024
7ba5762
Reverting non impacted files
Noah7071 Mar 31, 2024
aa300ad
Line gap
Noah7071 Mar 31, 2024
aa2ed18
Rebase
Noah7071 Mar 31, 2024
03d4bf9
Fix of anim import node name invid chracaters
Noah7071 Mar 31, 2024
4873392
Optimize invalid char replace code
Noah7071 Mar 31, 2024
a368f11
Fix mesh bone to sksleton for invalid char
Noah7071 Mar 31, 2024
d8f718a
Fix Node naming
Noah7071 Apr 1, 2024
f5a5534
Revert "Fix Node naming"
Noah7071 Apr 1, 2024
887a7c7
Fix for animation only import
Noah7071 Apr 1, 2024
74c1ff1
Revert "Fix for animation only import"
Noah7071 Apr 1, 2024
eccc072
Fix to anim not loading
Noah7071 Apr 1, 2024
ec79e2e
Anim importer fix
Noah7071 Apr 1, 2024
13419c6
Naming issues
Noah7071 Apr 2, 2024
2cad466
Sword fix
Noah7071 Apr 2, 2024
dd2d7f8
debug code removal
Noah7071 Apr 2, 2024
c6a2e8b
Line break spacings
Noah7071 Apr 2, 2024
1a75711
Null check skeletonURL
Noah7071 Apr 2, 2024
871fe9e
Revert import UI Text
Noah7071 Apr 2, 2024
d3870ed
Casing
Noah7071 Apr 2, 2024
ead5eee
Duplicate line
Noah7071 Apr 2, 2024
b56c555
Duplicate line
Noah7071 Apr 2, 2024
82720dd
Removed Impoter.Assimp
Noah7071 Apr 2, 2024
9b54db5
Shift keys
Noah7071 Apr 2, 2024
1c1b85f
Removed namespace
Noah7071 Apr 2, 2024
4a78465
Mannaquin bones fix
Noah7071 Apr 2, 2024
cfe2466
Animation pivots
Noah7071 Apr 2, 2024
774d286
Anim fix
Noah7071 Apr 3, 2024
98095c8
Anim Importer Debone Fix
Noah7071 Apr 3, 2024
a68e883
spacing and comm code
Noah7071 Apr 3, 2024
23535bf
Hashset for list bone name
Noah7071 Apr 3, 2024
55e2d25
extra parameter
Noah7071 Apr 3, 2024
2128a92
UV coords fixed
Noah7071 Apr 3, 2024
b260e77
Spacings removaal
Noah7071 Apr 3, 2024
ef3ef1f
more spacing
Noah7071 Apr 3, 2024
dd4ba9f
spacing
Noah7071 Apr 3, 2024
e8209e3
Fix line ending for Directory.Packages.props
Eideren Apr 3, 2024
e86da5d
Fix spacing
Eideren Apr 3, 2024
5ad2373
Rollback analyzer change
Eideren Apr 3, 2024
20815cd
Fix spacing
Eideren Apr 3, 2024
5d7522c
Merge branch 'master' into Unified_ThreeD_Importer
Eideren Apr 3, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 16 additions & 28 deletions build/Stride.sln
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Stride.Input.Tests.Windows"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Stride.Core.Tests", "..\sources\core\Stride.Core.Tests\Stride.Core.Tests.csproj", "{5AA408BA-E766-453E-B661-E3D7EC46E2A6}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Stride.Importer.FBX", "..\sources\tools\Stride.Importer.FBX\Stride.Importer.FBX.vcxproj", "{0467D515-FD66-4B8A-A128-CB642C2ED03F}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Stride.Core.Shaders", "..\sources\shaders\Stride.Core.Shaders\Stride.Core.Shaders.csproj", "{F2D52EDB-BC17-4243-B06D-33CD20F87A7F}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Stride.Core.Presentation.Wpf", "..\sources\presentation\Stride.Core.Presentation.Wpf\Stride.Core.Presentation.Wpf.csproj", "{47AFCC2E-E9F0-47D6-9D75-9E646546A92B}"
Expand Down Expand Up @@ -312,8 +310,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "xunit.runner.stride", "..\s
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Stride.Engine.NoAssets.Tests.Windows", "..\sources\engine\Stride.Engine.NoAssets.Tests\Stride.Engine.NoAssets.Tests.Windows.csproj", "{1C94168A-3C0D-4C6B-883B-91627D2EF3A1}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Stride.Importer.Assimp", "..\sources\tools\Stride.Importer.Assimp\Stride.Importer.Assimp.csproj", "{967BA05D-4AC4-4848-AEFD-894EF2309E4D}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Stride.Importer.Common", "..\sources\tools\Stride.Importer.Common\Stride.Importer.Common.csproj", "{806AA078-6070-4BB6-B05B-6EE6B21B1CDE}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Stride.Core.CompilerServices", "..\sources\core\Stride.Core.CompilerServices\Stride.Core.CompilerServices.csproj", "{D62BBD65-AB1C-41C7-8EC3-88949993C71E}"
Expand All @@ -334,6 +330,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "NuGetResolver", "NuGetResol
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Stride.Core.Presentation", "..\sources\presentation\Stride.Core.Presentation\Stride.Core.Presentation.csproj", "{0C63EF8B-26F9-4511-9FC5-7431DE9657D6}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Stride.Importer.3D", "..\sources\tools\Stride.Importer.3D\Stride.Importer.3D.csproj", "{66EFFDE4-24F0-4E57-9618-0F5577E20A1E}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -405,16 +403,6 @@ Global
{5AA408BA-E766-453E-B661-E3D7EC46E2A6}.Release|Mixed Platforms.Build.0 = Debug|Any CPU
{5AA408BA-E766-453E-B661-E3D7EC46E2A6}.Release|Win32.ActiveCfg = Debug|Any CPU
{5AA408BA-E766-453E-B661-E3D7EC46E2A6}.Release|Win32.Build.0 = Debug|Any CPU
{0467D515-FD66-4B8A-A128-CB642C2ED03F}.Debug|Any CPU.ActiveCfg = Debug|Win32
{0467D515-FD66-4B8A-A128-CB642C2ED03F}.Debug|Mixed Platforms.ActiveCfg = Debug|x64
{0467D515-FD66-4B8A-A128-CB642C2ED03F}.Debug|Mixed Platforms.Build.0 = Debug|x64
{0467D515-FD66-4B8A-A128-CB642C2ED03F}.Debug|Win32.ActiveCfg = Debug|Win32
{0467D515-FD66-4B8A-A128-CB642C2ED03F}.Debug|Win32.Build.0 = Debug|Win32
{0467D515-FD66-4B8A-A128-CB642C2ED03F}.Release|Any CPU.ActiveCfg = Release|Win32
{0467D515-FD66-4B8A-A128-CB642C2ED03F}.Release|Mixed Platforms.ActiveCfg = Release|x64
{0467D515-FD66-4B8A-A128-CB642C2ED03F}.Release|Mixed Platforms.Build.0 = Release|x64
{0467D515-FD66-4B8A-A128-CB642C2ED03F}.Release|Win32.ActiveCfg = Release|Win32
{0467D515-FD66-4B8A-A128-CB642C2ED03F}.Release|Win32.Build.0 = Release|Win32
{F2D52EDB-BC17-4243-B06D-33CD20F87A7F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F2D52EDB-BC17-4243-B06D-33CD20F87A7F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F2D52EDB-BC17-4243-B06D-33CD20F87A7F}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
Expand Down Expand Up @@ -1385,18 +1373,6 @@ Global
{1C94168A-3C0D-4C6B-883B-91627D2EF3A1}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{1C94168A-3C0D-4C6B-883B-91627D2EF3A1}.Release|Win32.ActiveCfg = Release|Any CPU
{1C94168A-3C0D-4C6B-883B-91627D2EF3A1}.Release|Win32.Build.0 = Release|Any CPU
{967BA05D-4AC4-4848-AEFD-894EF2309E4D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{967BA05D-4AC4-4848-AEFD-894EF2309E4D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{967BA05D-4AC4-4848-AEFD-894EF2309E4D}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{967BA05D-4AC4-4848-AEFD-894EF2309E4D}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{967BA05D-4AC4-4848-AEFD-894EF2309E4D}.Debug|Win32.ActiveCfg = Debug|Any CPU
{967BA05D-4AC4-4848-AEFD-894EF2309E4D}.Debug|Win32.Build.0 = Debug|Any CPU
{967BA05D-4AC4-4848-AEFD-894EF2309E4D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{967BA05D-4AC4-4848-AEFD-894EF2309E4D}.Release|Any CPU.Build.0 = Release|Any CPU
{967BA05D-4AC4-4848-AEFD-894EF2309E4D}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{967BA05D-4AC4-4848-AEFD-894EF2309E4D}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{967BA05D-4AC4-4848-AEFD-894EF2309E4D}.Release|Win32.ActiveCfg = Release|Any CPU
{967BA05D-4AC4-4848-AEFD-894EF2309E4D}.Release|Win32.Build.0 = Release|Any CPU
{806AA078-6070-4BB6-B05B-6EE6B21B1CDE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{806AA078-6070-4BB6-B05B-6EE6B21B1CDE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{806AA078-6070-4BB6-B05B-6EE6B21B1CDE}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
Expand Down Expand Up @@ -1493,6 +1469,18 @@ Global
{0C63EF8B-26F9-4511-9FC5-7431DE9657D6}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{0C63EF8B-26F9-4511-9FC5-7431DE9657D6}.Release|Win32.ActiveCfg = Release|Any CPU
{0C63EF8B-26F9-4511-9FC5-7431DE9657D6}.Release|Win32.Build.0 = Release|Any CPU
{66EFFDE4-24F0-4E57-9618-0F5577E20A1E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{66EFFDE4-24F0-4E57-9618-0F5577E20A1E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{66EFFDE4-24F0-4E57-9618-0F5577E20A1E}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{66EFFDE4-24F0-4E57-9618-0F5577E20A1E}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{66EFFDE4-24F0-4E57-9618-0F5577E20A1E}.Debug|Win32.ActiveCfg = Debug|Any CPU
{66EFFDE4-24F0-4E57-9618-0F5577E20A1E}.Debug|Win32.Build.0 = Debug|Any CPU
{66EFFDE4-24F0-4E57-9618-0F5577E20A1E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{66EFFDE4-24F0-4E57-9618-0F5577E20A1E}.Release|Any CPU.Build.0 = Release|Any CPU
{66EFFDE4-24F0-4E57-9618-0F5577E20A1E}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{66EFFDE4-24F0-4E57-9618-0F5577E20A1E}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{66EFFDE4-24F0-4E57-9618-0F5577E20A1E}.Release|Win32.ActiveCfg = Release|Any CPU
{66EFFDE4-24F0-4E57-9618-0F5577E20A1E}.Release|Win32.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -1502,13 +1490,13 @@ Global
{6F473FA6-4F8B-4FBA-AE33-EE5AF997D50C} = {1AE1AC60-5D2F-4CA7-AE20-888F44551185}
{4A15BAAD-AA37-4754-A2BF-8D4049211E36} = {1AE1AC60-5D2F-4CA7-AE20-888F44551185}
{1AC70118-C90F-4EC6-9D8B-C628BDF900F7} = {4C142567-C42B-40F5-B092-798882190209}
{B175D318-B4D0-49EA-9AEF-A54ACA2F03DC} = {25F10A0B-7259-404C-86BE-FD2363C92F72}
{2FCA2D8B-B10F-4DCA-9847-4221F74BA586} = {5D2D3BE8-9910-45CA-8E45-95660DA4C563}
{C121A566-555E-42B9-9B0A-1696529A9088} = {4C142567-C42B-40F5-B092-798882190209}
{FB06C76A-6BB7-40BE-9AFA-FEC13B045FB5} = {4C142567-C42B-40F5-B092-798882190209}
{A8F8D125-7A22-489F-99BC-9A02F545A17F} = {A7ED9F01-7D78-4381-90A6-D50E51C17250}
{01700344-CF44-482C-BEBC-60213B0F844C} = {A7ED9F01-7D78-4381-90A6-D50E51C17250}
{5AA408BA-E766-453E-B661-E3D7EC46E2A6} = {22ADD4CD-092E-4ADC-A21E-64CF42230152}
{0467D515-FD66-4B8A-A128-CB642C2ED03F} = {6F473FA6-4F8B-4FBA-AE33-EE5AF997D50C}
{F2D52EDB-BC17-4243-B06D-33CD20F87A7F} = {10D145AF-C8AE-428F-A80F-CA1B591D0DB2}
{47AFCC2E-E9F0-47D6-9D75-9E646546A92B} = {75A820AB-0F21-40F2-9448-5D7F495B97A0}
{C223FCD7-CDCC-4943-9E11-9C2CC8FA9FC4} = {52AE329E-B588-40D0-A578-8D0DB1BD83E5}
Expand Down Expand Up @@ -1608,7 +1596,6 @@ Global
{66BE41FC-FC52-48D0-9C04-BCE8CC393020} = {4C142567-C42B-40F5-B092-798882190209}
{D5B023BE-010F-44A8-ABF1-DB6F3BCEA392} = {1AE1AC60-5D2F-4CA7-AE20-888F44551185}
{1C94168A-3C0D-4C6B-883B-91627D2EF3A1} = {A7ED9F01-7D78-4381-90A6-D50E51C17250}
{967BA05D-4AC4-4848-AEFD-894EF2309E4D} = {6F473FA6-4F8B-4FBA-AE33-EE5AF997D50C}
{806AA078-6070-4BB6-B05B-6EE6B21B1CDE} = {6F473FA6-4F8B-4FBA-AE33-EE5AF997D50C}
{D62BBD65-AB1C-41C7-8EC3-88949993C71E} = {2E93E2B5-4500-4E47-9B65-E705218AB578}
{BACD76E5-35D0-4389-9BB9-8743AC4D89DE} = {22ADD4CD-092E-4ADC-A21E-64CF42230152}
Expand All @@ -1619,6 +1606,7 @@ Global
{02FD0BDE-4293-414F-97E6-69FF71105420} = {158087CF-AF74-44E9-AA20-A6AEB1E398A9}
{158087CF-AF74-44E9-AA20-A6AEB1E398A9} = {1AE1AC60-5D2F-4CA7-AE20-888F44551185}
{0C63EF8B-26F9-4511-9FC5-7431DE9657D6} = {75A820AB-0F21-40F2-9448-5D7F495B97A0}
{66EFFDE4-24F0-4E57-9618-0F5577E20A1E} = {6F473FA6-4F8B-4FBA-AE33-EE5AF997D50C}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {FF877973-604D-4EA7-B5F5-A129961F9EF2}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
<CheckBox Content="{sd:Localize Deduplicate materials, Context=Button}" IsChecked="{Binding DeduplicateMaterials}" Margin="5" Visibility="{Binding ShowDeduplicateMaterialsCheckBox, Converter={sd:VisibleOrCollapsed}}"/>
<TextBlock Text="{sd:Localize Warning\: Deduplicate materials is currently not supported for FBX files}" Margin="5" Visibility="{Binding ShowFbxDedupeNotSupportedWarning, Converter={sd:VisibleOrCollapsed}}"/>
<CheckBox Content="{sd:Localize Import textures, Context=Button}" IsChecked="{Binding ImportTextures}" Margin="5"/>
<CheckBox Content="{sd:Localize Import Animations, Context=Button}" IsChecked="{Binding ImportAnimations}" Margin="5"/>
</StackPanel>
</Border>
<Border Background="{StaticResource EmphasisColorBrush}" Margin="20,0">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public DummyReferenceContainer()
private bool showFbxDedupeNotSupportedWarning = false;
private bool deduplicateMaterials = true;
private bool importTextures = true;
private bool importAnimations = true;
private bool importSkeleton = true;
private bool dontImportSkeleton;
private bool reuseSkeleton;
Expand All @@ -62,6 +63,8 @@ public ImportModelFromFileViewModel(IViewModelServiceProvider serviceProvider)

public bool ImportTextures { get { return importTextures; } set { SetValue(ref importTextures, value); } }

public bool ImportAnimations { get { return importAnimations; } set { SetValue(ref importAnimations, value); } }

public bool ImportSkeleton { get { return importSkeleton; } set { SetValue(ref importSkeleton, value); } }

public bool DontImportSkeleton { get { return dontImportSkeleton; } set { SetValue(ref dontImportSkeleton, value); } }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public static class ModelFromFileTemplateSettings
public static SettingsKey<bool> ImportMaterials = new SettingsKey<bool>("Templates/ModelFromFile/ImportMaterials", PackageUserSettings.SettingsContainer, true);
public static SettingsKey<bool> DeduplicateMaterials = new SettingsKey<bool>("Templates/ModelFromFile/DeduplicateMaterials", PackageUserSettings.SettingsContainer, true);
public static SettingsKey<bool> ImportTextures = new SettingsKey<bool>("Templates/ModelFromFile/ImportTextures", PackageUserSettings.SettingsContainer, true);
public static SettingsKey<bool> ImportAnimations = new SettingsKey<bool>("Templates/ModelFromFile/ImportAnimations", PackageUserSettings.SettingsContainer, true);
public static SettingsKey<bool> ImportSkeleton = new SettingsKey<bool>("Templates/ModelFromFile/ImportSkeleton", PackageUserSettings.SettingsContainer, true);
public static SettingsKey<AssetId> DefaultSkeleton = new SettingsKey<AssetId>("Templates/ModelFromFile/DefaultSkeleton", PackageUserSettings.SettingsContainer, AssetId.Empty);
}
Expand All @@ -39,6 +40,7 @@ public class ModelFromFileTemplateGenerator : AssetFromFileTemplateGenerator
protected static readonly PropertyKey<bool> ImportMaterialsKey = new PropertyKey<bool>("ImportMaterials", typeof(ModelFromFileTemplateGenerator));
protected static readonly PropertyKey<bool> DeduplicateMaterialsKey = new PropertyKey<bool>("DeduplicateMaterials", typeof(ModelFromFileTemplateGenerator));
protected static readonly PropertyKey<bool> ImportTexturesKey = new PropertyKey<bool>("ImportTextures", typeof(ModelFromFileTemplateGenerator));
protected static readonly PropertyKey<bool> ImportAnimationsKey = new PropertyKey<bool>("ImportAnimations", typeof(ModelFromFileTemplateGenerator));
protected static readonly PropertyKey<bool> ImportSkeletonKey = new PropertyKey<bool>("ImportSkeleton", typeof(ModelFromFileTemplateGenerator));
protected static readonly PropertyKey<Skeleton> SkeletonToUseKey = new PropertyKey<Skeleton>("SkeletonToUse", typeof(ModelFromFileTemplateGenerator));

Expand All @@ -57,8 +59,7 @@ protected override async Task<bool> PrepareAssetCreation(AssetTemplateGeneratorP
if (files == null)
return true;

var showDeduplicateMaterialsCheckBox = files.Any(x => ImportAssimpCommand.IsSupportingExtensions(x.GetFileExtension()));
var showFbxDedupeNotSupportedWarning = showDeduplicateMaterialsCheckBox && files.Any(x => ImportFbxCommand.IsSupportingExtensions(x.GetFileExtension()));
var showDeduplicateMaterialsCheckBox = files.Any(x => ImportThreeDCommand.IsSupportingExtensions(x.GetFileExtension()));
// Load settings from the last time this template was used for this project
var profile = parameters.Package.UserSettings.Profile;
var window = new ModelAssetTemplateWindow
Expand All @@ -67,9 +68,10 @@ protected override async Task<bool> PrepareAssetCreation(AssetTemplateGeneratorP
{
ImportMaterials = ModelFromFileTemplateSettings.ImportMaterials.GetValue(profile, true),
ShowDeduplicateMaterialsCheckBox = showDeduplicateMaterialsCheckBox,
ShowFbxDedupeNotSupportedWarning = showFbxDedupeNotSupportedWarning,
ShowFbxDedupeNotSupportedWarning = false,
DeduplicateMaterials = ModelFromFileTemplateSettings.DeduplicateMaterials.GetValue(profile, true),
ImportTextures = ModelFromFileTemplateSettings.ImportTextures.GetValue(profile, true),
ImportAnimations = ModelFromFileTemplateSettings.ImportAnimations.GetValue(profile, true),
ImportSkeleton = ModelFromFileTemplateSettings.ImportSkeleton.GetValue(profile, true)
}
};
Expand All @@ -92,13 +94,15 @@ protected override async Task<bool> PrepareAssetCreation(AssetTemplateGeneratorP
parameters.Tags.Set(ImportMaterialsKey, window.Parameters.ImportMaterials);
parameters.Tags.Set(DeduplicateMaterialsKey, window.Parameters.DeduplicateMaterials);
parameters.Tags.Set(ImportTexturesKey, window.Parameters.ImportTextures);
parameters.Tags.Set(ImportAnimationsKey, window.Parameters.ImportAnimations);
parameters.Tags.Set(ImportSkeletonKey, window.Parameters.ImportSkeleton);
parameters.Tags.Set(SkeletonToUseKey, skeletonToReuse);

// Save settings
ModelFromFileTemplateSettings.ImportMaterials.SetValue(window.Parameters.ImportMaterials, profile);
ModelFromFileTemplateSettings.DeduplicateMaterials.SetValue(window.Parameters.DeduplicateMaterials, profile);
ModelFromFileTemplateSettings.ImportTextures.SetValue(window.Parameters.ImportTextures, profile);
ModelFromFileTemplateSettings.ImportAnimations.SetValue(window.Parameters.ImportAnimations, profile);
ModelFromFileTemplateSettings.ImportSkeleton.SetValue(window.Parameters.ImportSkeleton, profile);
skeletonId = AttachedReferenceManager.GetAttachedReference(skeletonToReuse)?.Id ?? AssetId.Empty;
ModelFromFileTemplateSettings.DefaultSkeleton.SetValue(skeletonId, profile);
Expand All @@ -116,6 +120,7 @@ protected override IEnumerable<AssetItem> CreateAssets(AssetTemplateGeneratorPar
var importMaterials = parameters.Tags.Get(ImportMaterialsKey);
var deduplicateMaterials = parameters.Tags.Get(DeduplicateMaterialsKey);
var importTextures = parameters.Tags.Get(ImportTexturesKey);
var importAnimations = parameters.Tags.Get(ImportAnimationsKey);
var importSkeleton = parameters.Tags.Get(ImportSkeletonKey);
var skeletonToReuse = parameters.Tags.Get(SkeletonToUseKey);

Expand All @@ -124,6 +129,7 @@ protected override IEnumerable<AssetItem> CreateAssets(AssetTemplateGeneratorPar
importParameters.SelectedOutputTypes.Add(typeof(ModelAsset), true);
importParameters.SelectedOutputTypes.Add(typeof(MaterialAsset), importMaterials);
importParameters.SelectedOutputTypes.Add(typeof(TextureAsset), importTextures);
importParameters.SelectedOutputTypes.Add(typeof(AnimationAsset), importAnimations);
importParameters.SelectedOutputTypes.Add(typeof(SkeletonAsset), importSkeleton);

var importedAssets = new List<AssetItem>();
Expand Down
50 changes: 0 additions & 50 deletions sources/engine/Stride.Assets.Models/FbxAssetImporter.cs

This file was deleted.

Loading