Skip to content

Commit

Permalink
fixes site editor and adds changelog (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
antpb authored Aug 10, 2023
1 parent 6966d39 commit f474891
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 5 deletions.
17 changes: 16 additions & 1 deletion blocks/environment/components/ThreeObjectEdit.js
Original file line number Diff line number Diff line change
Expand Up @@ -1235,7 +1235,22 @@ function ThreeObject(props) {
let htmlobject;
let htmlobjectId;

const currentBlocks = wp.data.select("core/block-editor").getBlocks();
const { select } = wp.data;

function getNestedBlocks(clientId) {
const blockEditor = select("core/block-editor");
const blocks = blockEditor.getBlocks(clientId);
let allBlocks = [...blocks];

blocks.forEach(block => {
const innerBlocks = getNestedBlocks(block.clientId);
allBlocks = [...allBlocks, ...innerBlocks];
});

return allBlocks;
}

const currentBlocks = getNestedBlocks(props.clientId);
if (currentBlocks) {
currentBlocks.forEach((block) => {
if (block.name === "three-object-viewer/environment") {
Expand Down
9 changes: 6 additions & 3 deletions readme.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
=== Three Object Viewer ===
Requires at least: 5.7
Tested up to: 6.2.2
Requires at least: 6.0
Tested up to: 6.3
Requires PHP: 7.2
Stable tag: 1.5.1
Stable tag: 1.5.2
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Author: antpb
Expand Down Expand Up @@ -42,6 +42,9 @@ It can also be installed manually using a zip file.


== Changelog ==
= 1.5.2 =
Fixed: Full compatibility with the Site Editor.

= 1.5.1 =
Added: Video Block - Now sets audio to positionally play where the video's plane or mesh is located in the scene.
Fixed: Player Controller animations fixed to not play incorrect direction when multiple directions are held.
Expand Down
2 changes: 1 addition & 1 deletion three-object-viewer.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: Three Object Viewer
* Plugin URI: https://3ov.xyz/
* Description: A plugin for viewing 3D files with support for WebXR and Open Metaverse Interoperability GLTF Extensions.
* Version: 1.5.1
* Version: 1.5.2
* Requires at least: 5.7
* Requires PHP: 7.1.0
* Author: antpb
Expand Down

0 comments on commit f474891

Please sign in to comment.