11import * as blueprintSettings from './blueprintSettings'
2- import { BillboardMode , BoneConfig , LocatorConfig } from './nodeConfigs '
2+ import FormatPageSvelte from './components/formatPage.svelte '
33import ProjectTitleSvelte from './components/projectTitle.svelte'
44import { PACKAGE } from './constants'
5+ import { BillboardMode , BoneConfig , LocatorConfig } from './nodeConfigs'
6+ import { process } from './systems/modelDataFixerUpper'
57import { events } from './util/events'
68import { injectSvelteCompomponent } from './util/injectSvelteComponent'
79import { toSafeFuntionName } from './util/minecraftUtil'
810import { addProjectToRecentProjects } from './util/misc'
911import { Valuable } from './util/stores'
10- import { Variant } from './variants'
11- import FormatPageSvelte from './components/formatPage.svelte'
1212import { translate } from './util/translation'
13- import { process } from './systems/modelDataFixerUpper '
13+ import { Variant } from './variants '
1414
1515/**
1616 * The serialized Variant Bone Config
@@ -355,7 +355,7 @@ export const BLUEPRINT_CODEC = new Blockbench.Codec('animated_java_blueprint', {
355355 }
356356
357357 if ( model . animation_variable_placeholders ) {
358- Interface . Panels . variable_placeholders . inside_vue . _data . text =
358+ Interface . Panels . variable_placeholders . inside_vue . $data . text =
359359 model . animation_variable_placeholders
360360 }
361361
@@ -435,15 +435,23 @@ export const BLUEPRINT_CODEC = new Blockbench.Codec('animated_java_blueprint', {
435435
436436 model . textures = [ ]
437437 for ( const texture of Texture . all ) {
438- const save = texture . getUndoCopy ( ) as Texture
438+ const save = texture . getSaveCopy ( ) as Texture
439439 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
443453 }
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
447455 model . textures . push ( save )
448456 }
449457
@@ -465,9 +473,9 @@ export const BLUEPRINT_CODEC = new Blockbench.Codec('animated_java_blueprint', {
465473 model . animation_controllers . push ( controller . getUndoCopy ( animationOptions , true ) )
466474 }
467475
468- if ( Interface . Panels . variable_placeholders . inside_vue . _data . text ) {
476+ if ( Interface . Panels . variable_placeholders . inside_vue . $data . text ) {
469477 model . animation_variable_placeholders =
470- Interface . Panels . variable_placeholders . inside_vue . _data . text
478+ Interface . Panels . variable_placeholders . inside_vue . $data . text
471479 }
472480
473481 if ( ! options . backup ) {
0 commit comments