1- var appVersion = '1.11.0 '
1+ var appVersion = '1.11.1 '
22var osfs = '/'
33var File , i ;
44var browser_name = 'electron'
@@ -75,8 +75,6 @@ function initializeApp() {
7575 }
7676 Toolbox . updateBar ( )
7777
78- updateMenu ( )
79-
8078 if ( isApp ) {
8179 updateRecentProjects ( )
8280 }
@@ -321,26 +319,6 @@ function setupVue() {
321319 } )
322320 project_vue . _data . Project = Project
323321
324- /*
325- var displaypresets_vue = new Vue({
326- el: '#display_presets',
327- data: {display_presets},
328- methods: {
329- applyPreset: function(preset, event) {
330- var index = display_presets.indexOf(preset)
331- applyDisplayPreset(display_presets[index])
332- },
333- deletePreset: function(preset, event) {
334- var index = display_presets.indexOf(preset)
335- if (display_presets[index].fixed == true) return;
336- display_presets.splice(index, 1)
337- localStorage.setItem('display_presets', JSON.stringify(display_presets))
338- }
339- }
340- })
341- displaypresets_vue._data.display_presets = display_presets
342- */
343-
344322 var stats_bar_vue = new Vue ( {
345323 el : '#status_bar' ,
346324 data : { Prop}
@@ -954,6 +932,9 @@ var Undo = {
954932 history : [ ] ,
955933
956934 add : function ( action , isTextureEdit ) {
935+ if ( settings . show_actions . value === true ) {
936+ showStatusMessage ( action )
937+ }
957938 if ( isTextureEdit ) {
958939 var entry = new Undo . textureHistoryEntry ( action )
959940 } else {
@@ -1057,7 +1038,7 @@ var Undo = {
10571038 tex . iconpath = arr . join ( '?' )
10581039 }
10591040
1060- tex . load ( )
1041+ tex . load ( true , true )
10611042 textures . push ( tex )
10621043 } )
10631044 texturelist . $forceUpdate ( ) ;
@@ -1097,12 +1078,7 @@ var Undo = {
10971078 } )
10981079 }
10991080}
1100- function setUndo ( action ) {
1101- if ( settings . show_actions . value === true ) {
1102- showStatusMessage ( action )
1103- }
1104- Undo . add ( action )
1105- }
1081+ var setUndo = Undo . add
11061082//Misc
11071083var Screencam = {
11081084 normalCanvas : function ( options , cb ) {
@@ -1168,7 +1144,7 @@ var Screencam = {
11681144 } )
11691145 } ) ;
11701146 } )
1171- } , 20 )
1147+ } , 40 )
11721148 } ,
11731149 returnScreenshot : function ( dataUrl , cb ) {
11741150 if ( cb ) {
@@ -1211,46 +1187,32 @@ var clipbench = {
12111187 var p = Prop . active_panel
12121188 if ( open_dialog == 'uv_dialog' ) {
12131189 uv_dialog . copy ( event )
1214- } else if ( p == 'uv' ) {
1215- main_uv . copy ( event )
12161190 } else if ( display_mode ) {
12171191 copyDisplaySlot ( )
1192+ } else if ( p == 'uv' || p == 'preview' ) {
1193+ main_uv . copy ( event )
12181194 } else if ( p == 'textures' && isApp ) {
12191195 if ( textures . selected ) {
1220- cl ( 'test' )
1221- if ( textures . selected . mode === 'bitmap' ) {
1222- var img = nativeImage . createFromDataURL ( textures . selected . iconpath )
1223- } else {
1224- var img = nativeImage . createFromPath ( textures . selected . iconpath . split ( '?' ) [ 0 ] )
1225- }
1226- clipboard . writeImage ( img )
1196+ clipbench . setTexture ( textures . selected )
12271197 }
1228- } else if ( p == 'outliner' || p == 'preview' ) {
1229- clipbench . cubes = [ ]
1230- clipbench . group = undefined
1198+ } else if ( p == 'outliner' ) {
1199+ clipbench . setCubes ( )
1200+ clipbench . setGroup ( )
12311201 if ( selected_group ) {
1232- clipbench . group = selected_group . duplicate ( 'cache' )
1233- if ( isApp ) {
1234- clipboard . writeHTML ( JSON . stringify ( { type : 'group' , content : clipbench . group } ) )
1235- }
1202+ clipbench . setGroup ( selected_group )
12361203 } else {
1237- selected . forEach ( function ( obj ) {
1238- var base_cube = new Cube ( obj )
1239- base_cube . display . mesh = undefined ;
1240- clipbench . cubes . push ( base_cube )
1241- } )
1242- clipboard . writeHtml ( JSON . stringify ( { type : 'cubes' , content : clipbench . cubes } ) )
1204+ clipbench . setCubes ( selected )
12431205 }
12441206 }
12451207 } ,
12461208 paste : function ( event ) {
12471209 var p = Prop . active_panel
12481210 if ( open_dialog == 'uv_dialog' ) {
12491211 uv_dialog . paste ( event )
1250- } else if ( p == 'uv' ) {
1251- main_uv . paste ( event )
12521212 } else if ( display_mode ) {
12531213 pasteDisplaySlot ( )
1214+ } else if ( p == 'uv' || p == 'preview' ) {
1215+ main_uv . paste ( event )
12541216 } else if ( p == 'textures' && isApp ) {
12551217 var img = clipboard . readImage ( )
12561218 if ( img ) {
@@ -1260,7 +1222,7 @@ var clipbench = {
12601222 texture . openMenu ( )
12611223 } , 40 )
12621224 }
1263- } else if ( p == 'outliner' || p == 'preview' ) {
1225+ } else if ( p == 'outliner' ) {
12641226 //Group
12651227 var group = 'root'
12661228 if ( selected_group ) {
@@ -1286,22 +1248,51 @@ var clipbench = {
12861248 clipbench . group . duplicate ( group )
12871249 } else {
12881250 clipbench . cubes . forEach ( function ( obj ) {
1289- var base_cube = new Cube ( )
1290- base_cube . extend ( obj )
1291- base_cube . uuid = guid ( )
1292- base_cube . display . mesh = undefined ;
1293-
1294- elements . push ( base_cube )
1295- base_cube . addTo ( group )
1296- Canvas . addCube ( elements [ elements . length - 1 ] )
1251+ var base_cube = new Cube ( obj )
1252+
1253+ base_cube . addTo ( group ) . init ( )
12971254 selected . push ( elements [ elements . length - 1 ] )
12981255 } )
12991256 updateSelection ( )
13001257 setUndo ( 'Pasted Cubes' )
13011258 }
13021259 }
1260+ } ,
1261+ setTexture : function ( texture ) {
1262+ //Sets the raw image of the texture
1263+ if ( ! isApp ) return ;
13031264
1265+ if ( texture . mode === 'bitmap' ) {
1266+ var img = nativeImage . createFromDataURL ( texture . iconpath )
1267+ } else {
1268+ var img = nativeImage . createFromPath ( texture . iconpath . split ( '?' ) [ 0 ] )
1269+ }
1270+ clipboard . writeImage ( img )
13041271 } ,
1272+ setGroup : function ( group ) {
1273+ if ( ! group ) {
1274+ clipbench . group = undefined
1275+ return ;
1276+ }
1277+ clipbench . group = group . duplicate ( 'cache' )
1278+ if ( isApp ) {
1279+ clipboard . writeHTML ( JSON . stringify ( { type : 'group' , content : clipbench . group } ) )
1280+ }
1281+ } ,
1282+ setCubes : function ( cubes ) {
1283+ if ( ! cubes ) {
1284+ clipbench . cubes = [ ]
1285+ return ;
1286+ }
1287+ cubes . forEach ( function ( obj ) {
1288+ var base_cube = new Cube ( obj )
1289+ base_cube . display . mesh = undefined ;
1290+ clipbench . cubes . push ( base_cube )
1291+ } )
1292+ if ( isApp ) {
1293+ clipboard . writeHtml ( JSON . stringify ( { type : 'cubes' , content : clipbench . cubes } ) )
1294+ }
1295+ }
13051296}
13061297TextureAnimator = {
13071298 isPlaying : false ,
0 commit comments