feat: implement ColorPalette as a proper Stride asset (.sdpalette)#3103
feat: implement ColorPalette as a proper Stride asset (.sdpalette)#3103SmitBdangar wants to merge 3 commits intostride3d:masterfrom
Conversation
- Add ColorPalette runtime class (DataContract + ContentSerializer) - Add ColorPaletteAsset (.sdpalette) with AssetCompiler - Re-use GplPaletteParser for .gpl file import support - Update ColorPaletteViewModel to use SetPalette() instead of hardcoded file - Add ColorPalette.sdtpl template for GameStudio Add Asset menu - Fixed typo: Platimium -> Platinum Closes stride3d#3064
- Add ColorPalette runtime class (DataContract + ContentSerializer) - Add ColorPaletteAsset (.sdpalette) with AssetCompiler - Re-use GplPaletteParser for .gpl file import support - Update ColorPaletteViewModel to use SetPalette() instead of hardcoded file - Add ColorPalette.sdtpl template for GameStudio Add Asset menu - Fixed typo: Platimium -> Platinum Closes stride3d#3064
|
Please follow the PR template |
|
@Kryptos-FR Updated the PR description to follow the template, sorry about that |
|
If this PR superseeds your previous, did you consider closing the previous PR? |
| { "Nickel", new Color3(0.827766422f, 0.797984931f, 0.74652364f) }, | ||
| { "Titanium", new Color3(0.756946965f, 0.727607463f, 0.695207239f) }, | ||
| { "Cobalt", new Color3(0.829103572f, 0.824958926f, 0.812750243f) }, | ||
| { "Platinum", new Color3(0.834934076f, 0.814845027f, 0.783999116f) }, // Fixed typo: platimium |
There was a problem hiding this comment.
Useless comment...
For an reader this wouldn't matter, but it is enough that you specified this change in your PR message.
| var runtime = new ColorPalette { Colors = colors }; | ||
| assetManager.Save(Url, runtime); | ||
|
|
||
| commandContext.Logger.Info($"ColorPaletteAsset compiled: {Url} ({colors.Count} colors)"); |
There was a problem hiding this comment.
Is logging here really necessary? Compared to other asset types, they don't use logging when they finish asset compilation. Only warnings or errors if it is the case.
That would uselessly fill the build output.
MsEpsilon
left a comment
There was a problem hiding this comment.
Nitpicks, mostly. Except the logging in DoCommandOverride that I consider that should be removed.
Also make sure you did compile, run the GameStudio, and ALSO create, save and reload a project with the asset of the type ColorPaletteAsset (assuming you didn't by not checking I have built the editor to try this change out.)
MsEpsilon
left a comment
There was a problem hiding this comment.
Nothing I can comment on, wonder what other persons think about this.
LGTM when I try this out myself in the next hours.
PR Details
Reworks the color palette feature as a proper Stride asset (.sdpalette)
instead of a hardcoded file, addressing feedback from #3100.
Related Issue
Closes #3064
Types of changes
Changes
ColorPalette.cs— runtime class with DataContract + ContentSerializerColorPaletteAsset.cs— design-time .sdpalette asset with AssetCompilerGplPaletteParser.cs— parses .gpl files at compile timeColorPaletteViewModel.cs— uses SetPalette() instead of hardcoded file pathColorPalette.sdtpl— makes Color Palette appear in GameStudio Add Asset menuHow to use
Checklist
Notes
Could not run GameStudio locally due to native C++ build tool limitations,
but
Stride.Core.Assets.Editorbuilds successfully with 0 errors.Supersedes #3100