Embed-SweetHome3D
Embed-SweetHome3D
Description
This plugin lets you embed a house designed in SweetHome3D as an interactive HTML5/WebGL model, directly inside your WordPress posts and pages.
You can insert a model either with the SweetHome3D block in the block editor, or with the classic [sh3d] shortcode.
Features:
- Gutenberg block with a live preview and a model picker
[sh3d id=1]shortcode (fully backwards compatible with 1.0.x)- Configurable size (max width) and aspect ratio (4:3, 16:9, 3:2, 1:1)
- Optional auto-rotation and navigation panel
- Several models on the same page
- Uploaded archives are validated (a valid SweetHome3D model must contain a
Home.xmlentry)
How to use:
- In SweetHome3D, export your house with the Export to HTML5 plug-in (menu Tools -> Export to HTML5)
- Unzip the generated file. It contains a
lib/folder,viewHome.html,viewHomeInOverlay.htmland your_house.zip — that inner ZIP is the file you need - In your WordPress admin, open the SweetHome3D menu and upload
your_house.zip - Insert the SweetHome3D block, or copy the generated
[sh3d id=X]shortcode into your content
Disclaimer: This plugin is not part of the SweetHome3D project and is not affiliated with its developer(s).
Installation
- Upload the plugin files to
/wp-content/plugins/embed-sweethome3d, or install it through the WordPress plugins screen. - Activate the plugin through the ‘Plugins’ screen in WordPress.
- A new SweetHome3D entry appears in the left admin menu.
- Upload your
house.zipthere (see the Description section).
Requirements: PHP 8.1+ and the PHP zip extension (used to validate uploaded models).
Faq
Your ZIP file is not a valid SweetHome3D model. Upload the inner your_house.zip (the one contained inside the HTML5 export), not the exported archive itself. Since version 2.0.0 the plugin validates this at upload time.
In the block, use the “Max width” and “Aspect ratio” settings. With the shortcode, use the attributes, e.g. [sh3d id=1 width=800 ratio=16:9].
id (required), width (max width in px, 0 = responsive), ratio (4:3, 16:9, 3:2, 1:1), rotation (auto-rotation in rounds per minute, 0 = off) and nav (none or default).
Edit the scenery of your 3D view in SweetHome3D. See this article.
Reviews
Changelog
2.0.1
- Added bundled translations: French, Spanish, German, Italian and Brazilian Portuguese (admin screen, block editor and front-end messages).
2.0.0
- Full rewrite for modern WordPress (requires WP 6.4+ and PHP 8.1+).
- New: Gutenberg block with live preview.
- New: configurable size, aspect ratio, auto-rotation and navigation panel.
- New: support for multiple models on the same page.
- New: uploaded archives are validated (Home.xml check).
- Security: fixed SQL injection vectors, added capability and nonce checks throughout.
- Assets are now only loaded on pages that actually display a model.
- Existing
[sh3d id=X]shortcodes and stored models keep working.
1.0.1
- Minor fixes.
1.0.0
- First release.