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'
14+
15+ let boundingBoxUpdateIntervalId : ReturnType < typeof setInterval > | undefined
1416
1517/**
1618 * The serialized Variant Bone Config
@@ -355,7 +357,7 @@ export const BLUEPRINT_CODEC = new Blockbench.Codec('animated_java_blueprint', {
355357 }
356358
357359 if ( model . animation_variable_placeholders ) {
358- Interface . Panels . variable_placeholders . inside_vue . _data . text =
360+ Interface . Panels . variable_placeholders . inside_vue . $data . text =
359361 model . animation_variable_placeholders
360362 }
361363
@@ -435,15 +437,23 @@ export const BLUEPRINT_CODEC = new Blockbench.Codec('animated_java_blueprint', {
435437
436438 model . textures = [ ]
437439 for ( const texture of Texture . all ) {
438- const save = texture . getUndoCopy ( ) as Texture
440+ const save = texture . getSaveCopy ( ) as Texture
439441 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, '/' )
442+ if ( isApp && Project . save_path && texture . path && PathModule . isAbsolute ( texture . path ) ) {
443+ const relative = PathModule . relative (
444+ PathModule . dirname ( Project . save_path ) ,
445+ texture . path
446+ )
447+ save . relative_path = relative . replace ( / \\ / g, '/' )
448+ }
449+ if (
450+ options . bitmaps != false &&
451+ ( Settings . get ( 'embed_textures' ) || options . backup || options . bitmaps == true )
452+ ) {
453+ save . source = texture . getDataURL ( )
454+ save . internal = true
443455 }
444- save . source = 'data:image/png;base64,' + texture . getBase64 ( )
445- save . mode = 'bitmap'
446- if ( options . absolute_paths === false ) delete save . path
456+ if ( options . absolute_paths == false ) delete save . path
447457 model . textures . push ( save )
448458 }
449459
@@ -465,9 +475,9 @@ export const BLUEPRINT_CODEC = new Blockbench.Codec('animated_java_blueprint', {
465475 model . animation_controllers . push ( controller . getUndoCopy ( animationOptions , true ) )
466476 }
467477
468- if ( Interface . Panels . variable_placeholders . inside_vue . _data . text ) {
478+ if ( Interface . Panels . variable_placeholders . inside_vue . $data . text ) {
469479 model . animation_variable_placeholders =
470- Interface . Panels . variable_placeholders . inside_vue . _data . text
480+ Interface . Panels . variable_placeholders . inside_vue . $data . text
471481 }
472482
473483 if ( ! options . backup ) {
0 commit comments