File tree Expand file tree Collapse file tree 3 files changed +23
-2
lines changed Expand file tree Collapse file tree 3 files changed +23
-2
lines changed Original file line number Diff line number Diff line change @@ -150,8 +150,16 @@ export interface IBlueprintFormatJSON {
150150
151151export function convertToBlueprint ( ) {
152152 // Convert the current project to a Blueprint
153- // NOTE - Nothing needs to be done here yet. The default functionality is sufficient.
154153 Project ! . save_path = ''
154+
155+ for ( const group of Group . all ) {
156+ group . createUniqueName ( Group . all . filter ( g => g !== group ) )
157+ group . sanitizeName ( )
158+ }
159+ for ( const animation of Blockbench . Animation . all ) {
160+ animation . createUniqueName ( Blockbench . Animation . all . filter ( a => a !== animation ) )
161+ animation . name = toSafeFuntionName ( animation . name )
162+ }
155163}
156164
157165export function getDefaultProjectSettings ( ) : ModelProject [ 'animated_java' ] {
Original file line number Diff line number Diff line change 1+ import { isCurrentFormat } from '../blueprintFormat'
12import CustomKeyframePanelSvelteComponent from '../components/customKeyframePanel.svelte'
23import { CUSTOM_CHANNELS } from '../mods/customKeyframesMod'
34import { events } from '../util/events'
@@ -8,7 +9,12 @@ import { translate } from '../util/translation'
89const CURRENT_PANEL = new Valuable < HTMLDivElement | undefined > ( undefined )
910
1011export function injectCustomKeyframePanel ( selectedKeyframe : _Keyframe ) {
11- if ( ! CUSTOM_CHANNELS . includes ( selectedKeyframe . channel ) ) return
12+ if (
13+ ! isCurrentFormat ( ) ||
14+ ! selectedKeyframe ||
15+ ! CUSTOM_CHANNELS . includes ( selectedKeyframe . channel )
16+ )
17+ return
1218
1319 const element = document . querySelector (
1420 '#panel_keyframe .panel_vue_wrapper .keyframe_data_point'
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ createBlockbenchMod(
77 `${ PACKAGE . name } :groupNameMod` ,
88 {
99 originalRename : Group . prototype . saveName ,
10+ originalSanitize : Group . prototype . sanitizeName ,
1011 } ,
1112 context => {
1213 Group . prototype . saveName = function ( this : Group , save ?: boolean ) {
@@ -15,6 +16,12 @@ createBlockbenchMod(
1516 }
1617 return context . originalRename . call ( this , save )
1718 }
19+ Group . prototype . sanitizeName = function ( this : Group ) {
20+ if ( isCurrentFormat ( ) ) {
21+ this . name = toSafeFuntionName ( this . name )
22+ }
23+ return context . originalSanitize . call ( this )
24+ }
1825 return context
1926 } ,
2027 context => {
You can’t perform that action at this time.
0 commit comments