Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Viewer 3D

No security coverage Obsolete

This module adds a field type to Drupal for uploading and displaying interactive 3D models using GLB files and Babylon.js. It allows content editors to embed a 3D viewer directly into content for an engaging user experience.

Description

Viewer 3D provides a specialized field type for Drupal that allows content editors to easily upload and manage 3D model files (GLB format) and render them using Babylon.js. The module creates an interactive 3D viewer directly in your content, giving your users an engaging way to interact with 3D models.

Future development plans include layer-based customization of models, allowing content editors to define customizable elements (like different parts of a 3D model) and set available options for colors and materials on a per-content type basis.

Requirements

  • Drupal 10.x or 11.x
  • PHP 8.3 or higher
  • Composer
  • Access to asset-packagist.org (for Babylon.js libraries)

Installation

1. Add Asset Packagist to your project

This module requires npm packages from Babylon.js which are distributed through asset-packagist.org. When the module is installed, it will automatically try to install these Babylon.js dependencies via Composer, which is why your project's root composer.json must be configured properly first.

Follow these steps to configure your project's composer.json:

Step 1: Add the required composer package

Add the Composer Installers Extender plugin to your project:

composer require oomphinc/composer-installers-extender:^2.0

Step 2: Add the asset-packagist repository

Run the following Composer command to add the asset-packagist repository:

composer config repositories.asset-packagist composer https://asset-packagist.org

Step 3: Configure installer paths

Run this Composer command to configure installer paths for asset types. Note that you'll need to adjust the path according to your specific Drupal project structure (replace `web` with `docroot` or other document root folder name if needed):

# Replace 'web' with your document root folder name (e.g., 'docroot') as needed
# First, check your current installer paths configuration
composer config extra.installer-paths --json

# If you already have a web/libraries/{$name} path config and want to add asset types
composer config --json --merge extra.installer-paths."web/libraries/{\$name}" '["type:bower-asset", "type:npm-asset"]'

# If you don't have a web/libraries path yet, use this command instead:
composer config --json extra.installer-paths."web/libraries/{\$name}" '["type:drupal-library", "type:bower-asset", "type:npm-asset"]'

Note: If your Drupal installation doesn't use a subdirectory for the web root (i.e., core is in the project root), you should use `libraries/${name}` instead (without the `web/` prefix).

Step 4: Add installer types

Run this Composer command to add the installer-types configuration:

# Check if you already have installer-types configuration
composer config extra.installer-types --json

# If you already have installer-types set, use --merge to add new types
composer config --json --merge extra.installer-types '["bower-asset", "npm-asset"]'

# If you don't have installer-types set yet, use this command
composer config --json extra.installer-types '["bower-asset", "npm-asset"]'

Step 5: Update composer
After making these changes, update your project dependencies:

composer update

2. Install the module

After configuring asset-packagist, install the module using Composer:

composer require drupal/viewer_3d

This will automatically download the module along with its Babylon.js dependencies from asset-packagist.

3. Enable the module

Enable the module through the Drupal admin interface or using Drush:

drush en viewer_3d

Ask your assistant about Viewer 3D

Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
1
Tracked since
Feb 2025
Latest release
1 year ago
Releases (12 mo)
0 ▼ from 1
Maintenance
Dormant

Releases

Version Type Core PHP Release date
1.0.x-dev Dev 10–11 Feb 27, 2025