Skip to content
Permalink
Browse files

[SpriteStudio] Added templates

  • Loading branch information
xen2 committed Nov 2, 2018
1 parent 6c82ca5 commit a88632d9d361002a36933813b411b9645b5a33b9
@@ -81,13 +81,18 @@ public XenkoDefaultAssetsPlugin()
ProfileSettings.Add(new PackageSettingsEntry(GameUserSettings.Effect.EffectCompilation, TargetPackage.Executable));
ProfileSettings.Add(new PackageSettingsEntry(GameUserSettings.Effect.RecordUsedEffects, TargetPackage.Executable));

var logger = new LoggerResult();
var presentationPackageFile = PackageStore.Instance.GetPackageFileName("Xenko.Assets.Presentation", new PackageVersionRange(new PackageVersion(XenkoVersion.NuGetVersion)));
var presentationPackage = Package.Load(logger, presentationPackageFile);
if (logger.HasErrors)
throw new InvalidOperationException($"Could not load package Xenko.Assets.Presentation:{Environment.NewLine}{logger.ToText()}");
// Load templates
// Currently hardcoded, this will need to change with plugin system
foreach (var packageName in new[] { "Xenko.Assets.Presentation", "Xenko.SpriteStudio.Offline" })
{
var logger = new LoggerResult();
var packageFile = PackageStore.Instance.GetPackageFileName(packageName, new PackageVersionRange(new PackageVersion(XenkoVersion.NuGetVersion)));
var package = Package.Load(logger, packageFile);
if (logger.HasErrors)
throw new InvalidOperationException($"Could not load package {packageName}:{Environment.NewLine}{logger.ToText()}");

TemplateManager.RegisterPackage(presentationPackage);
TemplateManager.RegisterPackage(package);
}
}

/// <inheritdoc />
@@ -1,4 +1,4 @@
<Project>
<Project>
<PropertyGroup>
<XenkoAssemblySign>true</XenkoAssemblySign>
</PropertyGroup>
@@ -10,6 +10,7 @@
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<XenkoAssemblyProcessor>true</XenkoAssemblyProcessor>
<XenkoAssemblyProcessorOptions>--serialization --parameter-key</XenkoAssemblyProcessorOptions>
<XenkoPackAssets>true</XenkoPackAssets>
<TargetFramework>$(TargetFrameworkTool)</TargetFramework>
</PropertyGroup>
<ItemGroup>
@@ -0,0 +1,8 @@
!Package
SerializedVersion: {Assets: 3.1.0.0}
TemplateFolders:
- Path: !dir Templates/Assets
Group: Assets
Files:
- !file Templates/Assets/SpriteStudio/DefaultSpriteStudioAnimation.xktpl
- !file Templates/Assets/SpriteStudio/DefaultSpriteStudioModel.xktpl

0 comments on commit a88632d

Please sign in to comment.
You can’t perform that action at this time.