mirror of
https://github.com/JannisX11/blockbench.git
synced 2025-02-11 16:12:06 +08:00
Add bedrock attachable preview support for nested binding
Add new globals Fix error in bbmodel merging
This commit is contained in:
parent
6ab3c53e56
commit
08d86dfd79
@ -2136,8 +2136,13 @@ BARS.defineActions(function() {
|
||||
|
||||
let player_skin_setup = false;
|
||||
function updateBase(mode) {
|
||||
let root_has_binding = Outliner.root.find(g => g instanceof Group && g.bedrock_binding)
|
||||
if (mode == 'attachable_first') {
|
||||
Project.model_3d.position.set(-20, 21, 0);
|
||||
if (root_has_binding) {
|
||||
Project.model_3d.position.set(-20, 21, 0);
|
||||
} else {
|
||||
Project.model_3d.position.set(-8, 6, -18);
|
||||
}
|
||||
Project.model_3d.rotation.set(
|
||||
Math.degToRad(-95),
|
||||
Math.degToRad(45),
|
||||
@ -2151,8 +2156,13 @@ BARS.defineActions(function() {
|
||||
|
||||
if (mode == 'attachable_third') {
|
||||
let angle = Math.degToRad(15);
|
||||
let arm_offset = Reusable.vec1.set(1, -31, 1).applyAxisAngle(Reusable.vec2.set(1, 0, 0), angle);
|
||||
Project.model_3d.position.set(5, 22, 0).add(arm_offset);
|
||||
if (root_has_binding) {
|
||||
let arm_offset = Reusable.vec1.set(1, -31, 1).applyAxisAngle(Reusable.vec2.set(1, 0, 0), angle);
|
||||
Project.model_3d.position.set(5, 22, 0).add(arm_offset);
|
||||
} else {
|
||||
let arm_offset = Reusable.vec1.set(1, -7, 1).applyAxisAngle(Reusable.vec2.set(1, 0, 0), angle);
|
||||
Project.model_3d.position.set(5, 22, 0).add(arm_offset);
|
||||
}
|
||||
Project.model_3d.rotation.set(angle, 0, 0);
|
||||
player_preview_model.enable()
|
||||
|
||||
|
@ -66,3 +66,5 @@ Blockbench.DisplaySlot = DisplaySlot;
|
||||
Blockbench.Reusable = Reusable;
|
||||
|
||||
Blockbench.Texture = Texture;
|
||||
Blockbench.TextureLayer = TextureLayer;
|
||||
Blockbench.SharedActions = SharedActions;
|
||||
|
@ -598,10 +598,10 @@ var codec = new Codec('project', {
|
||||
ani.uuid = guid();
|
||||
}
|
||||
if (base_ani.animators) {
|
||||
for (let key in animators) {
|
||||
for (let key in base_ani.animators) {
|
||||
if (uuid_map[key]) {
|
||||
animators[uuid_map[key]] = animators[key];
|
||||
delete animators[key];
|
||||
base_ani.animators[uuid_map[key]] = base_ani.animators[key];
|
||||
delete base_ani.animators[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user