@@ -13,7 +13,7 @@ import { loadAnimationUI, unloadAnimationUI } from './animationUi';
1313import { removeMonkeypatches } from './utils' ;
1414import { loadKeyframeOverrides , unloadKeyframeOverrides } from './keyframe' ;
1515import azurelibSettings , { OBJ_TYPE_OPTIONS , onSettingsChanged } from './settings' ;
16- import codec , { loadCodec , unloadCodec , maybeExportItemJson } from './codec' ;
16+ import codec , { loadCodec , unloadCodec , maybeExportItemJson , maybeImportItemJson } from './codec' ;
1717
1818const SUPPORTED_BB_VERSION_RANGE = `${ blockbenchConfig . min_version } - ${ blockbenchConfig . max_version } ` ;
1919if ( ! semverSatisfies ( semverCoerce ( Blockbench . version ) , SUPPORTED_BB_VERSION_RANGE ) ) {
@@ -23,6 +23,7 @@ if (!semverSatisfies(semverCoerce(Blockbench.version), SUPPORTED_BB_VERSION_RANG
2323( function ( ) {
2424 let exportAction ;
2525 let exportDisplayAction ;
26+ let importDisplayAction ;
2627 let button ;
2728
2829 Plugin . register ( "azurelib_utils" , Object . assign (
@@ -102,6 +103,17 @@ if (!semverSatisfies(semverCoerce(Blockbench.version), SUPPORTED_BB_VERSION_RANG
102103 } ) ;
103104 MenuBar . addAction ( exportDisplayAction , "file.export" ) ;
104105
106+ importDisplayAction = new Action ( {
107+ id : "import_AzureLib_display" ,
108+ name : "Import AzureLib Display Settings" ,
109+ icon : "icon-bow" ,
110+ description : "Import Display Settings into the display tab." ,
111+ category : "file" ,
112+ condition : ( ) => Format . id === "azure_model" ,
113+ click : maybeImportItemJson ,
114+ } ) ;
115+ MenuBar . addAction ( importDisplayAction , "file.import" ) ;
116+
105117 button = new Action ( 'azurelib_settings' , {
106118 name : 'AzureLib Model Settings' ,
107119 description : 'Change model type.' ,
@@ -130,6 +142,7 @@ if (!semverSatisfies(semverCoerce(Blockbench.version), SUPPORTED_BB_VERSION_RANG
130142 onunload ( ) {
131143 exportAction . delete ( ) ;
132144 exportDisplayAction . delete ( ) ;
145+ importDisplayAction . delete ( ) ;
133146 button . delete ( ) ;
134147 unloadKeyframeOverrides ( ) ;
135148 unloadAnimationUI ( ) ;
0 commit comments