1
1
import * as blueprintSettings from './blueprintSettings'
2
- import { BillboardMode , BoneConfig , LocatorConfig } from './nodeConfigs '
2
+ import FormatPageSvelte from './components/formatPage.svelte '
3
3
import ProjectTitleSvelte from './components/projectTitle.svelte'
4
4
import { PACKAGE } from './constants'
5
+ import { BillboardMode , BoneConfig , LocatorConfig } from './nodeConfigs'
6
+ import { process } from './systems/modelDataFixerUpper'
5
7
import { events } from './util/events'
6
8
import { injectSvelteCompomponent } from './util/injectSvelteComponent'
7
9
import { toSafeFuntionName } from './util/minecraftUtil'
8
10
import { addProjectToRecentProjects } from './util/misc'
9
11
import { Valuable } from './util/stores'
10
- import { Variant } from './variants'
11
- import FormatPageSvelte from './components/formatPage.svelte'
12
12
import { translate } from './util/translation'
13
- import { process } from './systems/modelDataFixerUpper '
13
+ import { Variant } from './variants '
14
14
15
15
/**
16
16
* The serialized Variant Bone Config
@@ -355,7 +355,7 @@ export const BLUEPRINT_CODEC = new Blockbench.Codec('animated_java_blueprint', {
355
355
}
356
356
357
357
if ( model . animation_variable_placeholders ) {
358
- Interface . Panels . variable_placeholders . inside_vue . _data . text =
358
+ Interface . Panels . variable_placeholders . inside_vue . $data . text =
359
359
model . animation_variable_placeholders
360
360
}
361
361
@@ -435,15 +435,23 @@ export const BLUEPRINT_CODEC = new Blockbench.Codec('animated_java_blueprint', {
435
435
436
436
model . textures = [ ]
437
437
for ( const texture of Texture . all ) {
438
- const save = texture . getUndoCopy ( ) as Texture
438
+ const save = texture . getSaveCopy ( ) as Texture
439
439
delete save . selected
440
- if ( Project . save_path && texture . path ) {
441
- const relative = PathModule . relative ( Project . save_path , texture . path )
442
- texture . relative_path = relative . replace ( / \\ / g, '/' )
440
+ if ( isApp && Project . save_path && texture . path && PathModule . isAbsolute ( texture . path ) ) {
441
+ const relative = PathModule . relative (
442
+ PathModule . dirname ( Project . save_path ) ,
443
+ texture . path
444
+ )
445
+ save . relative_path = relative . replace ( / \\ / g, '/' )
446
+ }
447
+ if (
448
+ options . bitmaps != false &&
449
+ ( Settings . get ( 'embed_textures' ) || options . backup || options . bitmaps == true )
450
+ ) {
451
+ save . source = texture . getDataURL ( )
452
+ save . internal = true
443
453
}
444
- save . source = 'data:image/png;base64,' + texture . getBase64 ( )
445
- save . mode = 'bitmap'
446
- if ( options . absolute_paths === false ) delete save . path
454
+ if ( options . absolute_paths == false ) delete save . path
447
455
model . textures . push ( save )
448
456
}
449
457
@@ -465,9 +473,9 @@ export const BLUEPRINT_CODEC = new Blockbench.Codec('animated_java_blueprint', {
465
473
model . animation_controllers . push ( controller . getUndoCopy ( animationOptions , true ) )
466
474
}
467
475
468
- if ( Interface . Panels . variable_placeholders . inside_vue . _data . text ) {
476
+ if ( Interface . Panels . variable_placeholders . inside_vue . $data . text ) {
469
477
model . animation_variable_placeholders =
470
- Interface . Panels . variable_placeholders . inside_vue . _data . text
478
+ Interface . Panels . variable_placeholders . inside_vue . $data . text
471
479
}
472
480
473
481
if ( ! options . backup ) {
0 commit comments