mirror of
https://github.com/JannisX11/blockbench.git
synced 2024-11-21 01:13:37 +08:00
Fix rotation order in dae and fbx
Fix issues with loading certain plugins from URL Fix issue with quick message box
This commit is contained in:
parent
7c5e4895c6
commit
d505e50805
@ -101,7 +101,7 @@ const Blockbench = {
|
||||
return node
|
||||
},
|
||||
showQuickMessage(message, time = 1000) {
|
||||
document.getElementById('quick_message_box').remove()
|
||||
document.getElementById('quick_message_box')?.remove();
|
||||
let quick_message_box = Interface.createElement('div', {id: 'quick_message_box'}, tl(message));
|
||||
document.body.append(quick_message_box);
|
||||
|
||||
|
@ -540,11 +540,13 @@ var codec = new Codec('collada', {
|
||||
]
|
||||
}
|
||||
if (node.rotatable) {
|
||||
tag.content.push(
|
||||
let rotation_angles = [
|
||||
{type: 'rotate', attributes: {sid: 'rotationZ'}, content: `0 0 1 ${node.rotation[2]}`},
|
||||
{type: 'rotate', attributes: {sid: 'rotationY'}, content: `0 1 0 ${node.rotation[1]}`},
|
||||
{type: 'rotate', attributes: {sid: 'rotationX'}, content: `1 0 0 ${node.rotation[0]}`},
|
||||
)
|
||||
{type: 'rotate', attributes: {sid: 'rotationX'}, content: `1 0 0 ${node.rotation[0]}`}
|
||||
];
|
||||
if (node.mesh.rotation.order == 'XYZ') rotation_angles.reverse();
|
||||
tag.content.push(...rotation_angles);
|
||||
}
|
||||
if (node instanceof Cube || node instanceof Mesh) {
|
||||
let textures = [];
|
||||
|
@ -129,6 +129,7 @@ var codec = new Codec('fbx', {
|
||||
}
|
||||
function addNodeBase(node, fbx_type) {
|
||||
let unique_name = getUniqueName('object', node.uuid, node.name);
|
||||
let rotation_order = node.mesh.rotation.order == 'XYZ' ? 5 : 0;
|
||||
Objects[node.uuid] = {
|
||||
_key: 'Model',
|
||||
_values: [getID(node.uuid), `Model::${unique_name}`, fbx_type],
|
||||
@ -140,7 +141,8 @@ var codec = new Codec('fbx', {
|
||||
P4: {_key: 'P', _values: ["Lcl Translation", "Lcl Translation", "", "A", ...getElementPos(node)]},
|
||||
P5: node.rotation ? {_key: 'P', _values: ["RotationPivot", "Vector3D", "Vector", "", 0, 0, 0]} : undefined,
|
||||
P6: node.rotation ? {_key: 'P', _values: ["Lcl Rotation", "Lcl Rotation", "", "A", ...node.rotation]} : undefined,
|
||||
P7: node.faces ? {_key: 'P', _values: ["DefaultAttributeIndex", "int", "Integer", "",0]} : undefined,
|
||||
P7: node.rotation ? {_key: 'P', _values: ["RotationOrder", "enum", "", "", rotation_order]} : undefined,
|
||||
P8: node.faces ? {_key: 'P', _values: ["DefaultAttributeIndex", "int", "Integer", "",0]} : undefined,
|
||||
},
|
||||
Shading: '_Y',
|
||||
Culling: "CullingOff",
|
||||
|
@ -79,14 +79,15 @@ async function loadInfoFromURL() {
|
||||
|
||||
if (Blockbench.queries.plugins) {
|
||||
let plugin_ids = Blockbench.queries.plugins.split(/,/);
|
||||
let plugins = plugin_ids.map(id => Plugins.all.find(plugin => plugin.id == id)).filter(p => p instanceof Plugin && p.installed == false);
|
||||
let plugins = plugin_ids.map(id => Plugins.all.find(plugin => plugin.id == id))
|
||||
.filter(p => p instanceof Plugin && p.installed == false && p.isInstallable());
|
||||
if (plugins.length) {
|
||||
await new Promise(resolve => {
|
||||
let form = {
|
||||
info: {type: 'info', text: 'dialog.load_plugins_from_query.text'}
|
||||
}
|
||||
plugins.forEach(plugin => {
|
||||
form[plugin.id] = {type: 'checkbox', label: plugin.name, description: plugin.description, value: true}
|
||||
form[plugin.id.replace(/\./g, '_')] = {type: 'checkbox', label: plugin.name, description: plugin.description, value: true}
|
||||
})
|
||||
new Dialog({
|
||||
id: 'load_plugins_from_query',
|
||||
@ -96,7 +97,7 @@ async function loadInfoFromURL() {
|
||||
onConfirm: async function(result) {
|
||||
let promises = [];
|
||||
plugins.forEach(plugin => {
|
||||
if (result[plugin.id]) {
|
||||
if (result[plugin.id.replace(/\./g, '_')]) {
|
||||
promises.push(plugin.download());
|
||||
}
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user