Skip to content

Commit 49cd554

Browse files
committed
Merge branch 'master' into gh-pages
2 parents 370f0fc + b549e4c commit 49cd554

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1606
-902
lines changed

index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@
9898
<script src="js/util/array_util.js"></script>
9999
<script src="js/util/event_system.js"></script>
100100
<script src="js/util/property.js"></script>
101+
<script src="js/util/json.js"></script>
101102
<script src="js/interface/menu.js"></script>
102103
<script src="js/interface/actions.js"></script>
103104
<script src="js/interface/themes.js"></script>

js/animations/animation_controllers.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ class AnimationControllerState {
7575
target: '',
7676
condition: ''
7777
};
78+
this.transitions.push(transition);
7879
if (typeof a == 'object' && typeof a.uuid == 'string' && a.uuid.length == 36) {
7980
// Internal
8081
Object.assign(transition, a);
@@ -90,11 +91,13 @@ class AnimationControllerState {
9091
setTimeout(() => {
9192
// Delay to after loading controller so that all states can be found
9293
let state_match = this.controller.states.find(state => state !== this && state.name == key);
93-
if (state_match) transition.target = state_match.uuid;
94+
if (state_match) {
95+
let updated_transition = this.transitions.find(t => t.uuid == transition.uuid) ?? transitions;
96+
updated_transition.target = state_match.uuid;
97+
}
9498
}, 0);
9599
}
96100
}
97-
this.transitions.push(transition);
98101
})
99102
}
100103
if (data.particles instanceof Array) {

js/interface/dialog.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -535,6 +535,8 @@ window.MessageBox = class MessageBox extends Dialog {
535535
super(options.id, options);
536536
this.options = options;
537537
if (!options.buttons) this.buttons = ['dialog.ok'];
538+
this.cancelIndex = Math.min(this.buttons.length-1, this.cancelIndex);
539+
this.confirmIndex = Math.min(this.buttons.length-1, this.confirmIndex);
538540
this.callback = callback;
539541
}
540542
close(button, result, event) {

js/interface/menu_bar.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,7 @@ const MenuBar = {
331331
'adjust_curves',
332332
new MenuSeparator('filters'),
333333
'limit_to_palette',
334+
'split_rgb_into_layers',
334335
'clear_unused_texture_space',
335336
new MenuSeparator('transform'),
336337
'flip_texture_x',

js/interface/settings.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -528,6 +528,7 @@ const Settings = {
528528
new Setting('outlines_in_paint_mode', {category: 'paint', value: true});
529529
new Setting('move_with_selection_tool', {category: 'paint', value: true});
530530
new Setting('pick_color_opacity', {category: 'paint', value: false});
531+
new Setting('pick_combined_color', {category: 'paint', value: false});
531532
new Setting('paint_through_transparency', {category: 'paint', value: true});
532533
new Setting('paint_side_restrict', {category: 'paint', value: true});
533534
new Setting('paint_with_stylus_only', {category: 'paint', value: false});

js/io/formats/bbmodel.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ var codec = new Codec('project', {
263263
if (Animation.all.length) {
264264
model.animations = [];
265265
Animation.all.forEach(a => {
266-
model.animations.push(a.getUndoCopy({bone_names: true, absolute_paths: options.absolute_paths}, true))
266+
model.animations.push(a.getUndoCopy({absolute_paths: options.absolute_paths}, true))
267267
})
268268
}
269269
if (AnimationController.all.length) {

js/io/formats/bedrock.js

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ window.BedrockEntityManager = class BedrockEntityManager {
9696
}
9797
}
9898
if (valid_textures_list.length == 1) {
99-
new Texture({keep_size: true, render_mode}).fromPath(valid_textures_list[0]).add()
99+
let texture = new Texture({keep_size: true, render_mode}).fromPath(valid_textures_list[0]).add()
100+
if (isApp) loadAdjacentTextureSet(texture);
100101
if (render_mode == 'layered') {
101102
updateLayeredTextures();
102103
}
@@ -169,14 +170,15 @@ window.BedrockEntityManager = class BedrockEntityManager {
169170
cancelIndex: 2,
170171
onButton(index) {
171172
dialog.hide();
173+
let textures_to_import = [];
172174
if (index == 1) {
173-
valid_textures_list.forEach(path => {
174-
new Texture({keep_size: true, render_mode}).fromPath(path).add()
175-
})
175+
textures_to_import = valid_textures_list;
176176
} else if (index == 0) {
177-
selected_textures.forEach(path => {
178-
new Texture({keep_size: true, render_mode}).fromPath(path).add()
179-
})
177+
textures_to_import = selected_textures;
178+
}
179+
for (let path of textures_to_import) {
180+
let texture = new Texture({keep_size: true, render_mode}).fromPath(path).add();
181+
if (isApp) loadAdjacentTextureSet(texture);
180182
}
181183
if (render_mode == 'layered') {
182184
updateLayeredTextures();
@@ -322,7 +324,8 @@ window.BedrockEntityManager = class BedrockEntityManager {
322324
} else {
323325
function tryItWith(extension) {
324326
if (fs.existsSync(texture_path+'.'+extension)) {
325-
var texture = new Texture({keep_size: true}).fromPath(texture_path+'.'+extension).add()
327+
var texture = new Texture({keep_size: true}).fromPath(texture_path+'.'+extension).add();
328+
loadAdjacentTextureSet(texture);
326329
return true;
327330
}
328331
}
@@ -454,6 +457,7 @@ window.BedrockBlockManager = class BedrockBlockManager {
454457
])
455458
if (full_texture_path) {
456459
let texture = new Texture({keep_size: true}).fromPath(full_texture_path).add();
460+
if (isApp) loadAdjacentTextureSet(texture);
457461
if (target == '*') {
458462
texture.use_as_default = true;
459463

js/io/formats/generic.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,5 @@ new ModelFormat({
2424
animation_mode: true,
2525
animated_textures: true,
2626
locators: true,
27+
pbr: true,
2728
})

js/io/formats/image.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
(function() {
22

33
let codec = new Codec('image', {
4-
name: tl('format.name'),
4+
name: tl('format.image'),
55
extension: 'png',
66
remember: true,
77
load_filter: {

js/io/formats/java_block.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ var codec = new Codec('java_block', {
453453
open_with_textures: {text: 'message.child_model_only.open_with_textures', condition: Texture.all.length > 0}
454454
}
455455
}, (result) => {
456-
if (result) {
456+
if (typeof result == 'string') {
457457
let parent = model.parent.replace(/\w+:/, '');
458458
let path_arr = path.split(osfs);
459459
let index = path_arr.length - path_arr.indexOf('models');

0 commit comments

Comments
 (0)